Skip to main content
Version: 5.14.1

Class: Account

Hierarchy

Implements

Constructors

constructor

new Account(providerOrOptions, address, pkOrSigner, cairoVersion?)

Parameters

NameTypeDefault value
providerOrOptionsProviderOptions | ProviderInterfaceundefined
addressstringundefined
pkOrSignerstring | Uint8Array | SignerInterfaceundefined
cairoVersionCairoVersion'0'

Overrides

Provider.constructor

Defined in

src/account/default.ts:70

Properties

signer

signer: SignerInterface

Implementation of

AccountInterface.signer

Defined in

src/account/default.ts:64


address

address: string

Implementation of

AccountInterface.address

Defined in

src/account/default.ts:66


cairoVersion

cairoVersion: CairoVersion

Implementation of

AccountInterface.cairoVersion

Defined in

src/account/default.ts:68


deploySelf

deploySelf: (__namedParameters: DeployAccountContractPayload, transactionsDetail: InvocationsDetails) => Promise<DeployContractResponse>

Type declaration

▸ («destructured», transactionsDetail?): Promise<DeployContractResponse>

Parameters
NameType
«destructured»DeployAccountContractPayload
transactionsDetailInvocationsDetails
Returns

Promise<DeployContractResponse>

Defined in

src/account/default.ts:427

Methods

getNonce

getNonce(blockIdentifier?): Promise<string>

Gets the nonce of the account with respect to a specific block

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifieroptional blockIdentifier. Defaults to 'pending'

Returns

Promise<string>

nonce of the account

Implementation of

AccountInterface.getNonce

Defined in

src/account/default.ts:86


getNonceSafe

Private getNonceSafe(nonce?): Promise<bigint>

Parameters

NameType
nonce?BigNumberish

Returns

Promise<bigint>

Defined in

src/account/default.ts:90


estimateFee

estimateFee(calls, estimateFeeDetails?): Promise<EstimateFee>

Parameters

NameType
callsAllowArray<Call>
estimateFeeDetails?EstimateFeeDetails

Returns

Promise<EstimateFee>

Defined in

src/account/default.ts:99


estimateInvokeFee

estimateInvokeFee(calls, «destructured»?): Promise<EstimateFee>

Estimate Fee for executing an INVOKE transaction on starknet

Parameters

NameTypeDescription
callsAllowArray<Call>the invocation object containing: - contractAddress - the address of the contract - entrypoint - the entrypoint of the contract - calldata - (defaults to []) the calldata
«destructured»EstimateFeeDetails-

Returns

Promise<EstimateFee>

response from estimate_fee

Implementation of

AccountInterface.estimateInvokeFee

Defined in

src/account/default.ts:106


estimateDeclareFee

estimateDeclareFee(«destructured», «destructured»?): Promise<EstimateFee>

Estimate Fee for executing a DECLARE transaction on starknet

Parameters

NameTypeDescription
«destructured»DeclareContractPayloadthe payload object containing: - contract - the compiled contract to be declared - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.
«destructured»EstimateFeeDetails-

Returns

Promise<EstimateFee>

response from estimate_fee

Implementation of

AccountInterface.estimateDeclareFee

Defined in

src/account/default.ts:140


estimateAccountDeployFee

estimateAccountDeployFee(«destructured», «destructured»?): Promise<EstimateFee>

Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet

Parameters

NameTypeDescription
«destructured»DeployAccountContractPayloadcontract - the compiled contract to be deployed - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.
«destructured»EstimateFeeDetailsoptional blockIdentifier - constant nonce = 0

Returns

Promise<EstimateFee>

response from estimate_fee

Implementation of

AccountInterface.estimateAccountDeployFee

Defined in

src/account/default.ts:174


estimateDeployFee

estimateDeployFee(payload, transactionsDetail?): Promise<EstimateFee>

Estimate Fee for executing a UDC DEPLOY transaction on starknet This is different from the normal DEPLOY transaction as it goes through the Universal Deployer Contract (UDC)

Parameters

NameTypeDescription
payloadUniversalDeployerContractPayload | UniversalDeployerContractPayload[]containing - classHash: computed class hash of compiled contract - salt: address salt - unique: bool if true ensure unique salt - calldata: constructor calldata
transactionsDetail?InvocationsDetailsInvocation Details containing: - optional nonce - optional version - optional maxFee

Returns

Promise<EstimateFee>

Implementation of

AccountInterface.estimateDeployFee

Defined in

src/account/default.ts:213


estimateFeeBulk

estimateFeeBulk(invocations, «destructured»?): Promise<EstimateFeeBulk>

Estimate Fee for executing a list of transactions on starknet Contract must be deployed for fee estimation to be possible

Parameters

NameType
invocationsInvocations
«destructured»EstimateFeeDetails

Returns

Promise<EstimateFeeBulk>

response from estimate_fee

Implementation of

AccountInterface.estimateFeeBulk

Defined in

src/account/default.ts:221


buildInvocation

buildInvocation(call, signerDetails): Promise<Invocation>

Parameters

NameType
callCall[]
signerDetailsInvocationsSignerDetails

Returns

Promise<Invocation>

Defined in

src/account/default.ts:245


execute

execute(calls, abis?, transactionsDetail?): Promise<InvokeFunctionResponse>

Invoke execute function in account contract

Parameters

NameTypeDefault valueDescription
callsAllowArray<Call>undefinedthe invocation object or an array of them, containing: - contractAddress - the address of the contract - entrypoint - the entrypoint of the contract - calldata - (defaults to []) the calldata - signature - (defaults to []) the signature
abisundefined | Abi[]undefined-
transactionsDetailInvocationsDetails{}-

Returns

Promise<InvokeFunctionResponse>

response from addTransaction

Implementation of

AccountInterface.execute

Defined in

src/account/default.ts:259


declareIfNot

declareIfNot(payload, transactionsDetail?): Promise<DeclareContractResponse>

First check if contract is already declared, if not declare it If contract already declared returned transaction_hash is ''. Method will pass even if contract is already declared

Parameters

NameTypeDescription
payloadDeclareContractPayloadDeclareContractPayload
transactionsDetailInvocationsDetails(optional) InvocationsDetails = {}

Returns

Promise<DeclareContractResponse>

DeclareContractResponse

Defined in

src/account/default.ts:306


declare

declare(payload, transactionsDetail?): Promise<DeclareContractResponse>

Declares a given compiled contract (json) to starknet

Parameters

NameTypeDescription
payloadDeclareContractPayloadtransaction payload to be deployed containing: - contract: compiled contract code - (optional) classHash: computed class hash of compiled contract. Pre-compute it for faster execution. - (required for Cairo1 without compiledClassHash) casm: CompiledContract | string; - (optional for Cairo1 with casm) compiledClassHash: compiled class hash from casm. Pre-compute it for faster execution.
transactionsDetailInvocationsDetailsInvocation Details containing: - optional nonce - optional version - optional maxFee

Returns

Promise<DeclareContractResponse>

a confirmation of sending a transaction on the starknet contract

Implementation of

AccountInterface.declare

Defined in

src/account/default.ts:322


deploy

deploy(payload, details?): Promise<MultiDeployContractResponse>

Deploys a declared contract to starknet - using Universal Deployer Contract (UDC) support multicall

Parameters

NameTypeDescription
payloadUniversalDeployerContractPayload | UniversalDeployerContractPayload[]classHash: computed class hash of compiled contract - [constructorCalldata] contract constructor calldata - [salt=pseudorandom] deploy address salt - [unique=true] ensure unique salt
details?InvocationsDetails[nonce=getNonce] - [version=transactionVersion] - [maxFee=getSuggestedMaxFee]

Returns

Promise<MultiDeployContractResponse>

  • contract_address[]
  • transaction_hash

Implementation of

AccountInterface.deploy

Defined in

src/account/default.ts:351


deployContract

deployContract(payload, details?): Promise<DeployContractUDCResponse>

Simplify deploy simulating old DeployContract with same response + UDC specific response Internal wait for L2 transaction, support multicall

Parameters

NameTypeDescription
payloadUniversalDeployerContractPayload | UniversalDeployerContractPayload[]classHash: computed class hash of compiled contract - [constructorCalldata] contract constructor calldata - [salt=pseudorandom] deploy address salt - [unique=true] ensure unique salt
details?InvocationsDetails[nonce=getNonce] - [version=transactionVersion] - [maxFee=getSuggestedMaxFee]

Returns

Promise<DeployContractUDCResponse>

  • contract_address
  • transaction_hash
  • address
  • deployer
  • unique
  • classHash
  • calldata_len
  • calldata
  • salt

Implementation of

AccountInterface.deployContract

Defined in

src/account/default.ts:397


declareAndDeploy

declareAndDeploy(payload, details?): Promise<DeclareDeployUDCResponse>

Declares and Deploy a given compiled contract (json) to starknet using UDC Internal wait for L2 transaction, do not support multicall Method will pass even if contract is already declared (internal using DeclareIfNot)

Parameters

NameTypeDescription
payloadDeclareAndDeployContractPayload-
details?InvocationsDetails[nonce=getNonce] - [version=transactionVersion] - [maxFee=getSuggestedMaxFee]

Returns

Promise<DeclareDeployUDCResponse>

  • declare
    • transaction_hash
  • deploy
    • contract_address
    • transaction_hash
    • address
    • deployer
    • unique
    • classHash
    • calldata_len
    • calldata
    • salt

Implementation of

AccountInterface.declareAndDeploy

Defined in

src/account/default.ts:408


deployAccount

deployAccount(«destructured», transactionsDetail?): Promise<DeployContractResponse>

Deploy the account on Starknet

Parameters

NameTypeDescription
«destructured»DeployAccountContractPayloadtransaction payload to be deployed containing: - classHash: computed class hash of compiled contract - optional constructor calldata - optional address salt - optional contractAddress
transactionsDetailInvocationsDetailsInvocation Details containing: - constant nonce = 0 - optional version - optional maxFee

Returns

Promise<DeployContractResponse>

a confirmation of sending a transaction on the starknet contract

Implementation of

AccountInterface.deployAccount

Defined in

src/account/default.ts:429


signMessage

signMessage(typedData): Promise<Signature>

Sign an JSON object for off-chain usage with the starknet private key and return the signature This adds a message prefix so it cant be interchanged with transactions

Throws

if the JSON object is not a valid JSON

Parameters

NameType
typedDataTypedData

Returns

Promise<Signature>

the signature of the JSON object

Implementation of

AccountInterface.signMessage

Defined in

src/account/default.ts:483


hashMessage

hashMessage(typedData): Promise<string>

Hash a JSON object with pederson hash and return the hash This adds a message prefix so it cant be interchanged with transactions

Throws

if the JSON object is not a valid JSON

Parameters

NameType
typedDataTypedData

Returns

Promise<string>

the hash of the JSON object

Implementation of

AccountInterface.hashMessage

Defined in

src/account/default.ts:487


verifyMessageHash

verifyMessageHash(hash, signature): Promise<boolean>

Verify a signature of a given hash

Warning

This method is not recommended, use verifyMessage instead

Throws

if the signature is not a valid signature

Parameters

NameTypeDescription
hashBigNumberishhash to be verified
signatureSignaturesignature of the hash

Returns

Promise<boolean>

true if the signature is valid, false otherwise

Implementation of

AccountInterface.verifyMessageHash

Defined in

src/account/default.ts:491


verifyMessage

verifyMessage(typedData, signature): Promise<boolean>

Verify a signature of a JSON object

Throws

if the JSON object is not a valid JSON or the signature is not a valid signature

Parameters

NameTypeDescription
typedDataTypedDataJSON object to be verified
signatureSignaturesignature of the JSON object

Returns

Promise<boolean>

true if the signature is valid, false otherwise

Implementation of

AccountInterface.verifyMessage

Defined in

src/account/default.ts:507


getSuggestedMaxFee

getSuggestedMaxFee(«destructured», details): Promise<bigint>

Gets Suggested Max Fee based on the transaction type

Parameters

NameType
«destructured»EstimateFeeAction
detailsEstimateFeeDetails

Returns

Promise<bigint>

suggestedMaxFee

Implementation of

AccountInterface.getSuggestedMaxFee

Defined in

src/account/default.ts:512


buildDeclarePayload

buildDeclarePayload(payload, «destructured»): Promise<DeclareContractTransaction>

will be renamed to buildDeclareContractTransaction

Parameters

NameType
payloadDeclareContractPayload
«destructured»InvocationsSignerDetails

Returns

Promise<DeclareContractTransaction>

Defined in

src/account/default.ts:546


buildAccountDeployPayload

buildAccountDeployPayload(«destructured», «destructured»): Promise<DeployAccountContractTransaction>

Parameters

NameType
«destructured»DeployAccountContractPayload
«destructured»InvocationsSignerDetails

Returns

Promise<DeployAccountContractTransaction>

Defined in

src/account/default.ts:570


buildUDCContractPayload

buildUDCContractPayload(payload): Call[]

Parameters

NameType
payloadUniversalDeployerContractPayload | UniversalDeployerContractPayload[]

Returns

Call[]

Defined in

src/account/default.ts:603


simulateTransaction

simulateTransaction(invocations, «destructured»?): Promise<SimulateTransactionResponse>

Simulates an array of transaction and returns an array of transaction trace and estimated fee.

Parameters

NameTypeDescription
invocationsInvocationsInvocations containing: - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION
«destructured»SimulateTransactionDetailsSimulateTransactionDetails

Returns

Promise<SimulateTransactionResponse>

response from simulate_transaction

Implementation of

AccountInterface.simulateTransaction

Defined in

src/account/default.ts:630


accountInvocationsFactory

accountInvocationsFactory(invocations, «destructured»): Promise<AccountInvocations>

Parameters

NameType
invocationsInvocations
«destructured»AccountInvocationsFactoryDetails

Returns

Promise<AccountInvocations>

Defined in

src/account/default.ts:647


getStarkName

getStarkName(address?, StarknetIdContract?): Promise<string>

Parameters

NameType
addressBigNumberish
StarknetIdContract?string

Returns

Promise<string>

Overrides

Provider.getStarkName

Defined in

src/account/default.ts:715


getChainId

getChainId(): Promise<StarknetChainId>

Gets the Starknet chain Id

Returns

Promise<StarknetChainId>

the chain Id

Implementation of

AccountInterface.getChainId

Inherited from

Provider.getChainId

Defined in

src/provider/default.ts:63


getBlock

getBlock(blockIdentifier): Promise<GetBlockResponse>

Gets the block information

Parameters

NameTypeDescription
blockIdentifierBlockIdentifierblock identifier

Returns

Promise<GetBlockResponse>

the block object

Implementation of

AccountInterface.getBlock

Inherited from

Provider.getBlock

Defined in

src/provider/default.ts:67


getClassAt

getClassAt(contractAddress, blockIdentifier?): Promise<ContractClassResponse>

Gets the contract class of the deployed contract.

Parameters

NameTypeDescription
contractAddressstringcontract address
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<ContractClassResponse>

Contract class of compiled contract

Implementation of

AccountInterface.getClassAt

Inherited from

Provider.getClassAt

Defined in

src/provider/default.ts:71


getClassHashAt

getClassHashAt(contractAddress, blockIdentifier?): Promise<string>

Returns the class hash deployed under the given address.

Parameters

NameTypeDescription
contractAddressstringcontract address
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<string>

Class hash

Implementation of

AccountInterface.getClassHashAt

Inherited from

Provider.getClassHashAt

Defined in

src/provider/default.ts:78


getClassByHash

getClassByHash(classHash): Promise<ContractClassResponse>

Returns the contract class deployed under the given class hash.

Parameters

NameTypeDescription
classHashstringclass hash

Returns

Promise<ContractClassResponse>

Contract class of compiled contract

Implementation of

AccountInterface.getClassByHash

Inherited from

Provider.getClassByHash

Defined in

src/provider/default.ts:85


getEstimateFee

getEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier): Promise<EstimateFeeResponse>

Estimates the fee for a given INVOKE transaction

Deprecated

Please use getInvokeEstimateFee or getDeclareEstimateFee instead. Should not be used outside of Account class

Parameters

NameTypeDescription
invocationWithTxTypeInvocationthe invocation object containing: - contractAddress - the address of the contract - entrypoint - the entrypoint of the contract - calldata - (defaults to []) the calldata - signature - (defaults to []) the signature
invocationDetailsInvocationsDetailsWithNonceoptional details containing: - nonce - optional nonce - version - optional version
blockIdentifierBlockIdentifier(optional) block identifier

Returns

Promise<EstimateFeeResponse>

the estimated fee

Implementation of

AccountInterface.getEstimateFee

Inherited from

Provider.getEstimateFee

Defined in

src/provider/default.ts:89


getInvokeEstimateFee

getInvokeEstimateFee(invocationWithTxType, invocationDetails, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponse>

Estimates the fee for a given INVOKE transaction

Parameters

NameTypeDescription
invocationWithTxTypeInvocationthe invocation object containing: - contractAddress - the address of the contract - entrypoint - the entrypoint of the contract - calldata - (defaults to []) the calldata - signature - (defaults to []) the signature
invocationDetailsInvocationsDetailsWithNonceoptional details containing: - nonce - optional nonce - version - optional version
blockIdentifier?BlockIdentifier(optional) block identifier
skipValidate?boolean(optional) skip cairo validate method

Returns

Promise<EstimateFeeResponse>

the estimated fee

Implementation of

AccountInterface.getInvokeEstimateFee

Inherited from

Provider.getInvokeEstimateFee

Defined in

src/provider/default.ts:97


getEstimateFeeBulk

getEstimateFeeBulk(invocations, options): Promise<EstimateFeeResponseBulk>

Estimates the fee for a list of INVOKE transaction

Parameters

NameTypeDescription
invocationsAccountInvocationsAccountInvocations - Complete invocations array with account details
optionsgetEstimateFeeBulkOptionsgetEstimateFeeBulkOptions - (optional) blockIdentifier - BlockIdentifier - (optional) skipValidate - boolean (default false)

Returns

Promise<EstimateFeeResponseBulk>

the estimated fee

Implementation of

AccountInterface.getEstimateFeeBulk

Inherited from

Provider.getEstimateFeeBulk

Defined in

src/provider/default.ts:111


getNonceForAddress

getNonceForAddress(contractAddress, blockIdentifier?): Promise<string>

Gets the nonce of a contract with respect to a specific block

Parameters

NameTypeDescription
contractAddressstringcontract address
blockIdentifier?BlockIdentifier-

Returns

Promise<string>

the hex nonce

Implementation of

AccountInterface.getNonceForAddress

Inherited from

Provider.getNonceForAddress

Defined in

src/provider/default.ts:118


getStorageAt

getStorageAt(contractAddress, key, blockIdentifier?): Promise<string>

Gets the contract's storage variable at a specific key.

Parameters

NameTypeDescription
contractAddressstring
keyBigNumberishfrom getStorageVarAddress('<STORAGE_VARIABLE_NAME>') (WIP)
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<string>

the value of the storage variable

Implementation of

AccountInterface.getStorageAt

Inherited from

Provider.getStorageAt

Defined in

src/provider/default.ts:125


getTransaction

getTransaction(txHash): Promise<GetTransactionResponse>

Gets the transaction information from a tx id.

Parameters

NameType
txHashBigNumberish

Returns

Promise<GetTransactionResponse>

the transaction object { transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? }

Implementation of

AccountInterface.getTransaction

Inherited from

Provider.getTransaction

Defined in

src/provider/default.ts:133


getTransactionReceipt

getTransactionReceipt(txHash): Promise<GetTransactionReceiptResponse>

Gets the transaction receipt from a tx hash.

Parameters

NameType
txHashBigNumberish

Returns

Promise<GetTransactionReceiptResponse>

the transaction receipt object

Implementation of

AccountInterface.getTransactionReceipt

Inherited from

Provider.getTransactionReceipt

Defined in

src/provider/default.ts:137


callContract

callContract(request, blockIdentifier?): Promise<CallContractResponse>

Calls a function on the Starknet contract.

Parameters

NameTypeDescription
requestCalltransaction to be called
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<CallContractResponse>

the result of the function on the smart contract.

Implementation of

AccountInterface.callContract

Inherited from

Provider.callContract

Defined in

src/provider/default.ts:141


invokeFunction

invokeFunction(functionInvocation, details): Promise<InvokeFunctionResponse>

Invokes a function on starknet

Deprecated

This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class

Parameters

NameTypeDescription
functionInvocationInvocationthe invocation object containing: - contractAddress - the address of the contract - entrypoint - the entrypoint of the contract - calldata - (defaults to []) the calldata - signature - (defaults to []) the signature
detailsInvocationsDetailsWithNonceoptional details containing: - nonce - optional nonce - version - optional version - maxFee - optional maxFee

Returns

Promise<InvokeFunctionResponse>

response from addTransaction

Implementation of

AccountInterface.invokeFunction

Inherited from

Provider.invokeFunction

Defined in

src/provider/default.ts:148


deployAccountContract

deployAccountContract(payload, details): Promise<DeployContractResponse>

Deploys a given compiled Account contract (json) to starknet

Parameters

NameTypeDescription
payloadDeployAccountContractTransactionpayload to be deployed containing: - compiled contract code - constructor calldata - address salt
detailsInvocationsDetailsWithNonce-

Returns

Promise<DeployContractResponse>

a confirmation of sending a transaction on the starknet contract

Implementation of

AccountInterface.deployAccountContract

Inherited from

Provider.deployAccountContract

Defined in

src/provider/default.ts:155


declareContract

declareContract(transaction, details): Promise<DeclareContractResponse>

Declares a given compiled contract (json) to starknet

Parameters

NameTypeDescription
transactionDeclareContractTransactiontransaction payload to be deployed containing: - compiled contract code - sender address - signature
detailsInvocationsDetailsWithNonceInvocation Details containing: - nonce - optional version - optional maxFee

Returns

Promise<DeclareContractResponse>

a confirmation of sending a transaction on the starknet contract

Implementation of

AccountInterface.declareContract

Inherited from

Provider.declareContract

Defined in

src/provider/default.ts:162


getDeclareEstimateFee

getDeclareEstimateFee(transaction, details, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponse>

Estimates the fee for a given DECLARE transaction

Parameters

NameTypeDescription
transactionDeclareContractTransactiontransaction payload to be declared containing: - compiled contract code - sender address - signature - (defaults to []) the signature
detailsInvocationsDetailsWithNonceoptional details containing: - nonce - version - optional version - optional maxFee
blockIdentifier?BlockIdentifier(optional) block identifier
skipValidate?boolean(optional) skip cairo validate method

Returns

Promise<EstimateFeeResponse>

the estimated fee

Implementation of

AccountInterface.getDeclareEstimateFee

Inherited from

Provider.getDeclareEstimateFee

Defined in

src/provider/default.ts:169


getDeployAccountEstimateFee

getDeployAccountEstimateFee(transaction, details, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponse>

Estimates the fee for a given DEPLOY_ACCOUNT transaction

Parameters

NameTypeDescription
transactionDeployAccountContractTransactiontransaction payload to be deployed containing: - classHash - constructorCalldata - addressSalt - signature - (defaults to []) the signature
detailsInvocationsDetailsWithNonceoptional details containing: - nonce - version - optional version - optional maxFee
blockIdentifier?BlockIdentifier(optional) block identifier
skipValidate?boolean(optional) skip cairo validate method

Returns

Promise<EstimateFeeResponse>

the estimated fee

Implementation of

AccountInterface.getDeployAccountEstimateFee

Inherited from

Provider.getDeployAccountEstimateFee

Defined in

src/provider/default.ts:178


getCode

getCode(contractAddress, blockIdentifier?): Promise<GetCodeResponse>

Deprecated

The method should not be used

Parameters

NameType
contractAddressstring
blockIdentifier?BlockIdentifier

Returns

Promise<GetCodeResponse>

Implementation of

AccountInterface.getCode

Inherited from

Provider.getCode

Defined in

src/provider/default.ts:192


waitForTransaction

waitForTransaction(txHash, options?): Promise<GetTransactionReceiptResponse>

Wait for the transaction to be accepted

Parameters

NameTypeDescription
txHashBigNumberishtransaction hash
options?waitForTransactionOptionswaitForTransactionOptions - (optional) retryInterval: number | undefined; - (optional) successStates: TransactionStatus[] | undefined;

Returns

Promise<GetTransactionReceiptResponse>

GetTransactionReceiptResponse

Implementation of

AccountInterface.waitForTransaction

Inherited from

Provider.waitForTransaction

Defined in

src/provider/default.ts:199


getSimulateTransaction

getSimulateTransaction(invocations, options?): Promise<SimulateTransactionResponse>

Simulates the transaction and returns the transaction trace and estimated fee.

Parameters

NameTypeDescription
invocationsAccountInvocationsAccountInvocations - Complete invocations array with account details
options?getSimulateTransactionOptionsgetSimulateTransactionOptions - (optional) blockIdentifier - block identifier - (optional) skipValidate - skip cairo validate method - (optional) skipExecute - skip cairo execute method

Returns

Promise<SimulateTransactionResponse>

an array of transaction trace and estimated fee

Implementation of

AccountInterface.getSimulateTransaction

Inherited from

Provider.getSimulateTransaction

Defined in

src/provider/default.ts:206


getStateUpdate

getStateUpdate(blockIdentifier?): Promise<StateUpdateResponse>

Gets the state changes in a specific block

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<StateUpdateResponse>

StateUpdateResponse

Implementation of

AccountInterface.getStateUpdate

Inherited from

Provider.getStateUpdate

Defined in

src/provider/default.ts:213


getAddressFromStarkName

getAddressFromStarkName(name, StarknetIdContract?): Promise<string>

Parameters

NameType
namestring
StarknetIdContract?string

Returns

Promise<string>

Inherited from

Provider.getAddressFromStarkName

Defined in

src/provider/default.ts:221