Skip to main content
Version: 5.24.3

Class: Account

Deprecated

Use RpcProvider instead. Common Provider will be removed with Sequencer provider.

Hierarchy​

Implements​

Constructors​

constructor​

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

Parameters​

NameType
providerOrOptionsProviderOptions | ProviderInterface
addressstring
pkOrSignerstring | Uint8Array | SignerInterface
cairoVersion?CairoVersion

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:437

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:88


getNonceSafe​

â–¸ Private getNonceSafe(nonce?): Promise<bigint>

Parameters​

NameType
nonce?BigNumberish

Returns​

Promise<bigint>

Defined in​

src/account/default.ts:92


getCairoVersion​

â–¸ getCairoVersion(classHash?): Promise<CairoVersion>

Retrieves the Cairo version from the network and sets cairoVersion if not already set in the constructor

Parameters​

NameTypeDescription
classHash?stringif provided detects Cairo version from classHash, otherwise from the account address

Returns​

Promise<CairoVersion>

Defined in​

src/account/default.ts:105


estimateFee​

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

Parameters​

NameType
callsAllowArray<Call>
estimateFeeDetails?EstimateFeeDetails

Returns​

Promise<EstimateFee>

Defined in​

src/account/default.ts:115


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:122


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:156


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:190


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:229


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:237


buildInvocation​

â–¸ buildInvocation(call, signerDetails): Promise<Invocation>

Parameters​

NameType
callCall[]
signerDetailsInvocationsSignerDetails

Returns​

Promise<Invocation>

Defined in​

src/account/default.ts:261


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:275


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
payloadDeclareContractPayload-
transactionsDetailInvocationsDetails(optional)

Returns​

Promise<DeclareContractResponse>

Defined in​

src/account/default.ts:320


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:336


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:365


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:411


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
payloadDeclareAndDeployContractPayloadcontract: compiled contract code - [casm=cairo1]: CairoAssembly | undefined; - [compiledClassHash]: string | undefined; - [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<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:420


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:439


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 can't 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:493


hashMessage​

â–¸ hashMessage(typedData): Promise<string>

Hash a JSON object with Pedersen hash and return the hash This adds a message prefix so it can't 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:497


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:501


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:517


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:522


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:556


buildAccountDeployPayload​

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

Parameters​

NameType
«destructured»DeployAccountContractPayload
«destructured»InvocationsSignerDetails

Returns​

Promise<DeployAccountContractTransaction>

Defined in​

src/account/default.ts:580


buildUDCContractPayload​

â–¸ buildUDCContractPayload(payload): Call[]

Parameters​

NameType
payloadUniversalDeployerContractPayload | UniversalDeployerContractPayload[]

Returns​

Call[]

Defined in​

src/account/default.ts:613


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:640


accountInvocationsFactory​

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

Parameters​

NameType
invocationsInvocations
«destructured»AccountInvocationsFactoryDetails

Returns​

Promise<AccountInvocations>

Defined in​

src/account/default.ts:657


getStarkName​

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

Parameters​

NameType
addressBigNumberish
StarknetIdContract?string

Returns​

Promise<string>

Overrides​

Provider.getStarkName

Defined in​

src/account/default.ts:732


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:68


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:72


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:76


getClassHashAt​

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

Returns the contract class hash in the given block for the contract deployed at 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:83


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:90


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:94


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:102


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:116


getNonceForAddress​

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

Returns the nonce associated with the given address in the given 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:123


getStorageAt​

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

Get the value of the storage (contract's variable) at the given address and 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:130


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:138


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:142


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:146


invokeFunction​

â–¸ invokeFunction(functionInvocation, details): Promise<InvokeFunctionResponse>

Invokes a function on starknet

Deprecated

This method won't 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:153


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:160


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:167


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:174


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:183


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:197


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:204


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:211


getStateUpdate​

â–¸ getStateUpdate(blockIdentifier?): Promise<StateUpdateResponse>

Gets the state changes in a specific block (result of executing the requested block)

Parameters​

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier

Returns​

Promise<StateUpdateResponse>

StateUpdateResponse

Implementation of​

AccountInterface.getStateUpdate

Inherited from​

Provider.getStateUpdate

Defined in​

src/provider/default.ts:218


getAddressFromStarkName​

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

Parameters​

NameType
namestring
StarknetIdContract?string

Returns​

Promise<string>

Inherited from​

Provider.getAddressFromStarkName

Defined in​

src/provider/default.ts:226


getContractVersion​

â–¸ getContractVersion(contractAddress, classHash?, options?): Promise<ContractVersion>

Gets the contract version from the provided address

Parameters​

NameTypeDescription
contractAddressstringstring
classHash?undefinedundefined
options?getContractVersionOptionsgetContractVersionOptions - (optional) compiler - (default true) extract compiler version using type tactic from abi - (optional) blockIdentifier - block identifier

Returns​

Promise<ContractVersion>

Implementation of​

AccountInterface.getContractVersion

Inherited from​

Provider.getContractVersion

Defined in​

src/provider/default.ts:230

â–¸ getContractVersion(contractAddress, classHash, options?): Promise<ContractVersion>

Gets the contract version from the provided address

Parameters​

NameTypeDescription
contractAddressundefinedundefined
classHashstring
options?getContractVersionOptionsgetContractVersionOptions - (optional) compiler - (default true) extract compiler version using type tactic from abi - (optional) blockIdentifier - block identifier

Returns​

Promise<ContractVersion>

Implementation of​

AccountInterface.getContractVersion

Inherited from​

Provider.getContractVersion

Defined in​

src/provider/default.ts:235