Class: AccountInterface
Hierarchy​
↳
AccountInterface
Implemented by​
Constructors​
constructor​
• new AccountInterface(): AccountInterface
Returns​
Inherited from​
Properties​
address​
• Abstract
address: string
Defined in​
signer​
• Abstract
signer: SignerInterface
Defined in​
cairoVersion​
• Abstract
cairoVersion: CairoVersion
Defined in​
channel​
• Abstract
channel: RpcChannel
| RpcChannel
Inherited from​
Defined in​
Methods​
estimateInvokeFee​
â–¸ estimateInvokeFee(calls
, estimateFeeDetails?
): Promise
<EstimateFeeResponse
>
Estimate Fee for executing an INVOKE transaction on starknet
Parameters​
Name | Type | Description |
---|---|---|
calls | AllowArray <Call > | the invocation object containing: - contractAddress - the address of the contract - entrypoint - the entrypoint of the contract - calldata? - (defaults to []) the calldata |
estimateFeeDetails? | EstimateFeeDetails | blockIdentifier? - nonce? = 0 - skipValidate? - default true - tip? - prioritize order of transactions in the mempool. - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction) - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337) - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei |
Returns​
Promise
<EstimateFeeResponse
>
response from estimate_fee
Defined in​
estimateDeclareFee​
â–¸ estimateDeclareFee(contractPayload
, estimateFeeDetails?
): Promise
<EstimateFeeResponse
>
Estimate Fee for executing a DECLARE transaction on starknet
Parameters​
Name | Type | Description |
---|---|---|
contractPayload | DeclareContractPayload | the payload object containing: - contract - the compiled contract to be declared - casm? - compiled cairo assembly. Cairo1(casm or compiledClassHash are required) - classHash? - the class hash of the compiled contract. Precalculate for faster execution. - compiledClassHash?: class hash of the cairo assembly. Cairo1(casm or compiledClassHash are required) |
estimateFeeDetails? | EstimateFeeDetails | blockIdentifier? - nonce? = 0 - skipValidate? - default true - tip? - prioritize order of transactions in the mempool. - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction) - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337) - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei |
Returns​
Promise
<EstimateFeeResponse
>
response from estimate_fee
Defined in​
estimateAccountDeployFee​
â–¸ estimateAccountDeployFee(contractPayload
, estimateFeeDetails?
): Promise
<EstimateFeeResponse
>
Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet
Parameters​
Name | Type | Description |
---|---|---|
contractPayload | DeployAccountContractPayload | classHash - the class hash of the compiled contract. - constructorCalldata? - constructor data; - contractAddress? - future account contract address. Precalculate for faster execution. - addressSalt? - salt used for calculation of the contractAddress. Required if contractAddress is provided. |
estimateFeeDetails? | EstimateFeeDetails | blockIdentifier? - nonce? = 0 - skipValidate? - default true - tip? - prioritize order of transactions in the mempool. - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337) - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei |
Returns​
Promise
<EstimateFeeResponse
>
response from estimate_fee
Defined in​
estimateDeployFee​
â–¸ estimateDeployFee(deployContractPayload
, estimateFeeDetails?
): Promise
<EstimateFeeResponse
>
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​
Name | Type | Description |
---|---|---|
deployContractPayload | UniversalDeployerContractPayload | UniversalDeployerContractPayload [] | array or singular - classHash: computed class hash of compiled contract - salt: address salt - unique: bool if true ensure unique salt - constructorCalldata: constructor calldata |
estimateFeeDetails? | EstimateFeeDetails | blockIdentifier? - nonce? - skipValidate? - default true - tip? - prioritize order of transactions in the mempool. - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction) - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337) - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei |
Returns​
Promise
<EstimateFeeResponse
>
Defined in​
estimateFeeBulk​
â–¸ estimateFeeBulk(invocations
, details?
): Promise
<EstimateFeeResponseBulk
>
Estimate Fee for executing a list of transactions on starknet Contract must be deployed for fee estimation to be possible
Parameters​
Name | Type | Description |
---|---|---|
invocations | Invocations | array of transaction object containing : - type - the type of transaction : 'DECLARE' | (multi)'DEPLOY' | (multi)'INVOKE_FUNCTION' | 'DEPLOY_ACCOUNT' - payload - the payload of the transaction |
details? | EstimateFeeDetails | blockIdentifier? - nonce? - skipValidate? - default true - tip? - prioritize order of transactions in the mempool. - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction) - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337) - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition) - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei |
Returns​
Promise
<EstimateFeeResponseBulk
>
response from estimate_fee
Defined in​
getSuggestedFee​
â–¸ getSuggestedFee(estimateFeeAction
, details
): Promise
<EstimateFee
>
Gets Suggested Max Fee based on the transaction type
Parameters​
Name | Type |
---|---|
estimateFeeAction | EstimateFeeAction |
details | EstimateFeeDetails |
Returns​
Promise
<EstimateFee
>
EstimateFee (...response, resourceBounds, suggestedMaxFee)
Defined in​
simulateTransaction​
â–¸ simulateTransaction(invocations
, details?
): Promise
<SimulateTransactionResponse
>
Simulates an array of transaction and returns an array of transaction trace and estimated fee.
Parameters​
Name | Type | Description |
---|---|---|
invocations | Invocations | Invocations containing: - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION |
details? | SimulateTransactionDetails | SimulateTransactionDetails |
Returns​
Promise
<SimulateTransactionResponse
>
response from simulate_transaction
Defined in​
execute​
â–¸ execute(transactions
, transactionsDetail?
): Promise
<{ transaction_hash
: string
}>
Invoke execute function in account contract
Parameters​
Name | Type | Description |
---|---|---|
transactions | AllowArray <Call > | the 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 |
transactionsDetail? | InvocationsDetails | Additional optional parameters for the transaction |
Returns​
Promise
<{ transaction_hash
: string
}>
response from addTransaction
Defined in​
â–¸ execute(transactions
, abis?
, transactionsDetail?
): Promise
<{ transaction_hash
: string
}>
Parameters​
Name | Type | Description |
---|---|---|
transactions | AllowArray <Call > | the 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 |
abis? | Abi [] | (optional) the abi of the contract for better displaying |
transactionsDetail? | InvocationsDetails | Additional optional parameters for the transaction * |
Returns​
Promise
<{ transaction_hash
: string
}>
response from addTransaction
Deprecated
Defined in​
declare​
â–¸ declare(contractPayload
, transactionsDetail?
): Promise
<{ class_hash
: string
; transaction_hash
: string
}>
Declares a given compiled contract (json) to starknet
Parameters​
Name | Type | Description |
---|---|---|
contractPayload | DeclareContractPayload | transaction 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. |
transactionsDetail? | InvocationsDetails | InvocationsDetails |
Returns​
Promise
<{ class_hash
: string
; transaction_hash
: string
}>
a confirmation of sending a transaction on the starknet contract
Defined in​
deploy​
â–¸ deploy(payload
, details?
): Promise
<MultiDeployContractResponse
>
Deploys a declared contract to starknet - using Universal Deployer Contract (UDC) support multicall
Parameters​
Name | Type | Description |
---|---|---|
payload | UniversalDeployerContractPayload | UniversalDeployerContractPayload [] | classHash: computed class hash of compiled contract - [constructorCalldata] contract constructor calldata - [salt=pseudorandom] deploy address salt - [unique=true] ensure unique salt |
details? | InvocationsDetails | InvocationsDetails |
Returns​
Promise
<MultiDeployContractResponse
>
- contract_address[]
- transaction_hash
Defined in​
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​
Name | Type | Description |
---|---|---|
payload | UniversalDeployerContractPayload | UniversalDeployerContractPayload [] | classHash: computed class hash of compiled contract - [constructorCalldata] contract constructor calldata - [salt=pseudorandom] deploy address salt - [unique=true] ensure unique salt |
details? | InvocationsDetails | InvocationsDetails |
Returns​
Promise
<DeployContractUDCResponse
>
- contract_address
- transaction_hash
- address
- deployer
- unique
- classHash
- calldata_len
- calldata
- salt
Defined in​
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​
Name | Type | Description |
---|---|---|
payload | DeclareAndDeployContractPayload | contract: 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 | InvocationsDetails |
Returns​
Promise
<DeclareDeployUDCResponse
>
- declare
- transaction_hash
- deploy
- contract_address
- transaction_hash
- address
- deployer
- unique
- classHash
- calldata_len
- calldata
- salt
Defined in​
deployAccount​
â–¸ deployAccount(contractPayload
, transactionsDetail?
): Promise
<DeployContractResponse
>
Deploy the account on Starknet
Parameters​
Name | Type | Description |
---|---|---|
contractPayload | DeployAccountContractPayload | transaction payload to be deployed containing: - classHash: computed class hash of compiled contract - optional constructor calldata - optional address salt - optional contractAddress |
transactionsDetail? | InvocationsDetails | InvocationsDetails |
Returns​
Promise
<DeployContractResponse
>
a confirmation of sending a transaction on the starknet contract
Defined in​
signMessage​
â–¸ signMessage(typedData
): Promise
<Signature
>
Signs a TypedData object for off-chain usage with the Starknet private key and returns the signature This adds a message prefix so it can't be interchanged with transactions
Parameters​
Name | Type | Description |
---|---|---|
typedData | TypedData | TypedData object to be signed |
Returns​
Promise
<Signature
>
the signature of the TypedData object
Throws
if typedData is not a valid TypedData
Defined in​
hashMessage​
â–¸ hashMessage(typedData
): Promise
<string
>
Hash a TypedData object with Pedersen hash and return the hash This adds a message prefix so it can't be interchanged with transactions
Parameters​
Name | Type | Description |
---|---|---|
typedData | TypedData | TypedData object to be hashed |
Returns​
Promise
<string
>
the hash of the TypedData object
Throws
if typedData is not a valid TypedData
Defined in​
verifyMessage​
â–¸ verifyMessage(typedData
, signature
): Promise
<boolean
>
Verify a signature of a TypedData object
Parameters​
Name | Type | Description |
---|---|---|
typedData | TypedData | TypedData object to be verified |
signature | Signature | signature of the TypedData object |
Returns​
Promise
<boolean
>
true if the signature is valid, false otherwise
Throws
if typedData is not a valid TypedData or the signature is not a valid signature
Defined in​
verifyMessageHash​
â–¸ verifyMessageHash(hash
, signature
): Promise
<boolean
>
Verify a signature of a given hash
Parameters​
Name | Type | Description |
---|---|---|
hash | BigNumberish | hash to be verified |
signature | Signature | signature of the hash |
Returns​
Promise
<boolean
>
true if the signature is valid, false otherwise
Warning
This method is not recommended, use verifyMessage instead
Throws
if the signature is not a valid signature
Defined in​
getNonce​
â–¸ getNonce(blockIdentifier?
): Promise
<string
>
Gets the nonce of the account with respect to a specific block
Parameters​
Name | Type | Description |
---|---|---|
blockIdentifier? | BlockIdentifier | optional blockIdentifier. Defaults to 'pending' |
Returns​
Promise
<string
>
nonce of the account
Defined in​
getChainId​
â–¸ getChainId(): Promise
<StarknetChainId
>
Gets the Starknet chain Id
Returns​
Promise
<StarknetChainId
>
the chain Id
Inherited from​
Defined in​
callContract​
â–¸ callContract(call
, blockIdentifier?
): Promise
<CallContractResponse
>
Calls a function on the Starknet contract.
Parameters​
Name | Type | Description |
---|---|---|
call | Call | transaction to be called |
blockIdentifier? | BlockIdentifier | block identifier |
Returns​
Promise
<CallContractResponse
>
the result of the function on the smart contract.
Inherited from​
ProviderInterface.callContract
Defined in​
getBlock​
â–¸ getBlock(blockIdentifier?
): Promise
<PendingBlock
>
Gets the block information
Parameters​
Name | Type | Description |
---|---|---|
blockIdentifier? | "pending" | block identifier |
Returns​
Promise
<PendingBlock
>
the block object
Inherited from​
Defined in​
â–¸ getBlock(blockIdentifier
): Promise
<Block
>
Parameters​
Name | Type |
---|---|
blockIdentifier | "latest" |
Returns​
Promise
<Block
>
Inherited from​
Defined in​
â–¸ getBlock(blockIdentifier
): Promise
<GetBlockResponse
>
Parameters​
Name | Type |
---|---|
blockIdentifier | BlockIdentifier |
Returns​
Promise
<GetBlockResponse
>
Inherited from​
Defined in​
getClassAt​
â–¸ getClassAt(contractAddress
, blockIdentifier?
): Promise
<ContractClassResponse
>
Gets the contract class of the deployed contract.
Parameters​
Name | Type | Description |
---|---|---|
contractAddress | string | contract address |
blockIdentifier? | BlockIdentifier | block identifier |
Returns​
Promise
<ContractClassResponse
>
Contract class of compiled contract
Inherited from​
Defined in​
getL1GasPrice​
â–¸ getL1GasPrice(blockIdentifier
): Promise
<string
>
Gets the price of l1 gas in the block
Parameters​
Name | Type | Description |
---|---|---|
blockIdentifier | BlockIdentifier | block identifier |
Returns​
Promise
<string
>
gas price of the block
Inherited from​
ProviderInterface.getL1GasPrice
Defined in​
getL1MessageHash​
â–¸ getL1MessageHash(l2TxHash
): Promise
<string
>
Get L1 message hash from L2 transaction hash
Parameters​
Name | Type | Description |
---|---|---|
l2TxHash | BigNumberish | L2 transaction hash |
Returns​
Promise
<string
>
Hex string of L1 message hash
Example
In Sepolia Testnet :
const result = provider.getL1MessageHash(
'0x28dfc05eb4f261b37ddad451ff22f1d08d4e3c24dc646af0ec69fa20e096819'
);
// result = '0x55b3f8b6e607fffd9b4d843dfe8f9b5c05822cd94fcad8797deb01d77805532a'
Inherited from​
ProviderInterface.getL1MessageHash
Defined in​
getClassHashAt​
â–¸ getClassHashAt(contractAddress
, blockIdentifier?
): Promise
<string
>
Returns the contract class hash in the given block for the contract deployed at the given address
Parameters​
Name | Type | Description |
---|---|---|
contractAddress | string | contract address |
blockIdentifier? | BlockIdentifier | block identifier |
Returns​
Promise
<string
>
Class hash
Inherited from​
ProviderInterface.getClassHashAt
Defined in​
getClassByHash​
â–¸ getClassByHash(classHash
): Promise
<ContractClassResponse
>
Returns the contract class deployed under the given class hash.
Parameters​
Name | Type | Description |
---|---|---|
classHash | string | class hash |
Returns​
Promise
<ContractClassResponse
>
Contract class of compiled contract
Inherited from​
ProviderInterface.getClassByHash
Defined in​
getNonceForAddress​
â–¸ getNonceForAddress(contractAddress
, blockIdentifier?
): Promise
<string
>
Returns the nonce associated with the given address in the given block
Parameters​
Name | Type | Description |
---|---|---|
contractAddress | string | contract address |
blockIdentifier? | BlockIdentifier | - |
Returns​
Promise
<string
>
the hex nonce
Inherited from​
ProviderInterface.getNonceForAddress
Defined in​
getStorageAt​
â–¸ getStorageAt(contractAddress
, key
, blockIdentifier?
): Promise
<string
>
Get the value of the storage (contract's variable) at the given address and key
Parameters​
Name | Type | Description |
---|---|---|
contractAddress | string | |
key | BigNumberish | from getStorageVarAddress('<STORAGE_VARIABLE_NAME>') (WIP) |
blockIdentifier? | BlockIdentifier | block identifier |
Returns​
Promise
<string
>
the value of the storage variable
Inherited from​
ProviderInterface.getStorageAt
Defined in​
getTransaction​
â–¸ getTransaction(transactionHash
): Promise
<TransactionWithHash
>
Gets the transaction information from a tx id.
Parameters​
Name | Type |
---|---|
transactionHash | BigNumberish |
Returns​
Promise
<TransactionWithHash
>
the transaction object { transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? }
Inherited from​
ProviderInterface.getTransaction
Defined in​
getTransactionReceipt​
â–¸ getTransactionReceipt(transactionHash
): Promise
<GetTransactionReceiptResponse
>
Gets the transaction receipt from a tx hash.
Parameters​
Name | Type |
---|---|
transactionHash | BigNumberish |
Returns​
Promise
<GetTransactionReceiptResponse
>
the transaction receipt object
Inherited from​
ProviderInterface.getTransactionReceipt
Defined in​
deployAccountContract​
â–¸ deployAccountContract(payload
, details
): Promise
<DeployContractResponse
>
Deploys a given compiled Account contract (json) to starknet
Parameters​
Name | Type | Description |
---|---|---|
payload | DeployAccountContractPayload | payload to be deployed containing: - compiled contract code - constructor calldata - address salt |
details | InvocationsDetailsWithNonce | - |
Returns​
Promise
<DeployContractResponse
>
a confirmation of sending a transaction on the starknet contract
Inherited from​
ProviderInterface.deployAccountContract
Defined in​
invokeFunction​
â–¸ invokeFunction(invocation
, details
): Promise
<{ transaction_hash
: string
}>
Invokes a function on starknet
Parameters​
Name | Type | Description |
---|---|---|
invocation | Invocation | the 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 |
details | InvocationsDetailsWithNonce | optional details containing: - nonce - optional nonce - version - optional version - maxFee - optional maxFee |
Returns​
Promise
<{ transaction_hash
: string
}>
response from addTransaction
Deprecated
This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class
Inherited from​
ProviderInterface.invokeFunction
Defined in​
declareContract​
â–¸ declareContract(transaction
, details
): Promise
<{ class_hash
: string
; transaction_hash
: string
}>
Declares a given compiled contract (json) to starknet
Parameters​
Name | Type | Description |
---|---|---|
transaction | DeclareContractTransaction | transaction payload to be deployed containing: - compiled contract code - sender address - signature |
details | InvocationsDetailsWithNonce | Invocation Details containing: - nonce - optional version - optional maxFee |
Returns​
Promise
<{ class_hash
: string
; transaction_hash
: string
}>
a confirmation of sending a transaction on the starknet contract
Inherited from​
ProviderInterface.declareContract
Defined in​
getEstimateFee​
â–¸ getEstimateFee(invocation
, details
, blockIdentifier?
, skipValidate?
): Promise
<EstimateFeeResponse
>
Estimates the fee for a given INVOKE transaction
Parameters​
Name | Type | Description |
---|---|---|
invocation | Invocation | the 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 |
details | InvocationsDetailsWithNonce | optional 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
Deprecated
Please use getInvokeEstimateFee or getDeclareEstimateFee instead. Should not be used outside of Account class
Inherited from​
ProviderInterface.getEstimateFee
Defined in​
getInvokeEstimateFee​
â–¸ getInvokeEstimateFee(invocation
, details
, blockIdentifier?
, skipValidate?
): Promise
<EstimateFeeResponse
>
Estimates the fee for a given INVOKE transaction
Parameters​
Name | Type | Description |
---|---|---|
invocation | Invocation | the 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 |
details | InvocationsDetailsWithNonce | optional 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
Inherited from​
ProviderInterface.getInvokeEstimateFee
Defined in​
getDeclareEstimateFee​
â–¸ getDeclareEstimateFee(transaction
, details
, blockIdentifier?
, skipValidate?
): Promise
<EstimateFeeResponse
>
Estimates the fee for a given DECLARE transaction
Parameters​
Name | Type | Description |
---|---|---|
transaction | DeclareContractTransaction | transaction payload to be declared containing: - compiled contract code - sender address - signature - (defaults to []) the signature |
details | InvocationsDetailsWithNonce | optional 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
Inherited from​
ProviderInterface.getDeclareEstimateFee
Defined in​
getDeployAccountEstimateFee​
â–¸ getDeployAccountEstimateFee(transaction
, details
, blockIdentifier?
, skipValidate?
): Promise
<EstimateFeeResponse
>
Estimates the fee for a given DEPLOY_ACCOUNT transaction
Parameters​
Name | Type | Description |
---|---|---|
transaction | DeployAccountContractTransaction | transaction payload to be deployed containing: - classHash - constructorCalldata - addressSalt - signature - (defaults to []) the signature |
details | InvocationsDetailsWithNonce | optional 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
Inherited from​
ProviderInterface.getDeployAccountEstimateFee
Defined in​
getEstimateFeeBulk​
â–¸ getEstimateFeeBulk(invocations
, options?
): Promise
<EstimateFeeResponseBulk
>
Estimates the fee for a list of INVOKE transaction
Parameters​
Name | Type | Description |
---|---|---|
invocations | AccountInvocations | AccountInvocations - Complete invocations array with account details |
options? | getEstimateFeeBulkOptions | getEstimateFeeBulkOptions - (optional) blockIdentifier - BlockIdentifier |
Returns​
Promise
<EstimateFeeResponseBulk
>
the estimated fee
Inherited from​
ProviderInterface.getEstimateFeeBulk
Defined in​
waitForTransaction​
â–¸ waitForTransaction(txHash
, options?
): Promise
<GetTransactionReceiptResponse
>
Wait for the transaction to be accepted
Parameters​
Name | Type | Description |
---|---|---|
txHash | BigNumberish | transaction hash |
options? | waitForTransactionOptions | waitForTransactionOptions - (optional) retryInterval: number | undefined; - (optional) successStates: TransactionStatus[] | undefined; |
Returns​
Promise
<GetTransactionReceiptResponse
>
GetTransactionReceiptResponse
Inherited from​
ProviderInterface.waitForTransaction
Defined in​
getSimulateTransaction​
â–¸ getSimulateTransaction(invocations
, options?
): Promise
<SimulateTransactionResponse
>
Simulates the transaction and returns the transaction trace and estimated fee.
Parameters​
Name | Type | Description |
---|---|---|
invocations | AccountInvocations | AccountInvocations - Complete invocations array with account details |
options? | getSimulateTransactionOptions | getSimulateTransactionOptions - (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
Inherited from​
ProviderInterface.getSimulateTransaction
Defined in​
getStateUpdate​
â–¸ getStateUpdate(blockIdentifier?
): Promise
<StateUpdateResponse
>
Gets the state changes in a specific block (result of executing the requested block)
Parameters​
Name | Type | Description |
---|---|---|
blockIdentifier? | BlockIdentifier | block identifier |
Returns​
Promise
<StateUpdateResponse
>
StateUpdateResponse
Inherited from​
ProviderInterface.getStateUpdate
Defined in​
getContractVersion​
â–¸ getContractVersion(contractAddress
, classHash?
, options?
): Promise
<ContractVersion
>
Gets the contract version from the provided address
Parameters​
Name | Type | Description |
---|---|---|
contractAddress | string | string |
classHash? | undefined | undefined |
options? | getContractVersionOptions | getContractVersionOptions - (optional) compiler - (default true) extract compiler version using type tactic from abi - (optional) blockIdentifier - block identifier |
Returns​
Promise
<ContractVersion
>
Inherited from​
ProviderInterface.getContractVersion
Defined in​
â–¸ getContractVersion(contractAddress
, classHash
, options?
): Promise
<ContractVersion
>
Gets the contract version from the provided address
Parameters​
Name | Type | Description |
---|---|---|
contractAddress | undefined | undefined |
classHash | string | |
options? | getContractVersionOptions | getContractVersionOptions - (optional) compiler - (default true) extract compiler version using type tactic from abi - (optional) blockIdentifier - block identifier |
Returns​
Promise
<ContractVersion
>
Inherited from​
ProviderInterface.getContractVersion