Skip to content

Commit

Permalink
Merge pull request #366 from smartcontractkit/gauntlet-tx-v3
Browse files Browse the repository at this point in the history
gauntlet: use v3 transactions
  • Loading branch information
cfal authored Mar 6, 2024
2 parents 4ebc7bb + 25a700a commit 0cb5f76
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages-ts/starknet-gauntlet/src/provider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
CompiledContract,
Account,
Call,
constants,
} from 'starknet'
import { IStarknetWallet } from '../wallet'

Expand Down Expand Up @@ -80,12 +81,24 @@ class Provider implements IStarknetProvider {
constructor(nodeUrl: string, wallet?: IStarknetWallet) {
this.provider = new StarknetProvider({ nodeUrl })
if (wallet) {
this.account = new Account(this.provider, wallet.getAccountAddress(), wallet.signer)
this.account = new Account(
this.provider,
wallet.getAccountAddress(),
wallet.signer,
/* cairoVersion= */ null, // don't set cairo version so that it's automatically detected from the contract
/* transactionVersion= */ constants.TRANSACTION_VERSION.V3,
)
}
}

setAccount(wallet: IStarknetWallet) {
this.account = new Account(this.provider, wallet.getAccountAddress(), wallet.signer)
this.account = new Account(
this.provider,
wallet.getAccountAddress(),
wallet.signer,
/* cairoVersion= */ null,
/* transactionVersion= */ constants.TRANSACTION_VERSION.V3,
)
}

send = async () => {
Expand Down

0 comments on commit 0cb5f76

Please sign in to comment.