Class: Account
Hierarchy​
↳
Account
Implements​
Constructors​
constructor​
• new Account(providerOrOptions
, address
, pkOrSigner
, cairoVersion?
)
Parameters​
Name | Type | Default value |
---|---|---|
providerOrOptions | ProviderOptions | ProviderInterface | undefined |
address | string | undefined |
pkOrSigner | string | Uint8Array | SignerInterface | undefined |
cairoVersion | CairoVersion | '0' |
Overrides​
Defined in​
Properties​
signer​
• signer: SignerInterface
Implementation of​
Defined in​
address​
• address: string
Implementation of​
Defined in​
cairoVersion​
• cairoVersion: CairoVersion
Implementation of​
Defined in​
deploySelf​
• deploySelf: (__namedParameters
: DeployAccountContractPayload
, transactionsDetail
: InvocationsDetails
) => Promise
<DeployContractResponse
>
Type declaration​
▸ («destructured»
, transactionsDetail?
): Promise
<DeployContractResponse
>
Parameters​
Name | Type |
---|---|
«destructured» | DeployAccountContractPayload |
transactionsDetail | InvocationsDetails |
Returns​
Promise
<DeployContractResponse
>
Defined in​
Methods​
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
Implementation of​
Defined in​
getNonceSafe​
â–¸ Private
getNonceSafe(nonce?
): Promise
<bigint
>
Parameters​
Name | Type |
---|---|
nonce? | BigNumberish |
Returns​
Promise
<bigint
>
Defined in​
estimateFee​
â–¸ estimateFee(calls
, estimateFeeDetails?
): Promise
<EstimateFee
>
Parameters​
Name | Type |
---|---|
calls | AllowArray <Call > |
estimateFeeDetails? | EstimateFeeDetails |
Returns​
Promise
<EstimateFee
>
Defined in​
estimateInvokeFee​
â–¸ estimateInvokeFee(calls
, «destructured»?
): Promise
<EstimateFee
>
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 |
«destructured» | EstimateFeeDetails | - |
Returns​
Promise
<EstimateFee
>
response from estimate_fee
Implementation of​
AccountInterface.estimateInvokeFee
Defined in​
estimateDeclareFee​
▸ estimateDeclareFee(«destructured»
, «destructured»?
): Promise
<EstimateFee
>
Estimate Fee for executing a DECLARE transaction on starknet
Parameters​
Name | Type | Description |
---|---|---|
«destructured» | DeclareContractPayload | the 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​
estimateAccountDeployFee​
▸ estimateAccountDeployFee(«destructured»
, «destructured»?
): Promise
<EstimateFee
>
Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet
Parameters​
Name | Type | Description |
---|---|---|
«destructured» | DeployAccountContractPayload | contract - the compiled contract to be deployed - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli. |
«destructured» | EstimateFeeDetails | optional blockIdentifier - constant nonce = 0 |
Returns​
Promise
<EstimateFee
>
response from estimate_fee
Implementation of​
AccountInterface.estimateAccountDeployFee
Defined in​
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​
Name | Type | Description |
---|---|---|
payload | UniversalDeployerContractPayload | UniversalDeployerContractPayload [] | containing - classHash: computed class hash of compiled contract - salt: address salt - unique: bool if true ensure unique salt - calldata: constructor calldata |
transactionsDetail? | InvocationsDetails | Invocation Details containing: - optional nonce - optional version - optional maxFee |
Returns​
Promise
<EstimateFee
>
Implementation of​
AccountInterface.estimateDeployFee
Defined in​
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​
Name | Type |
---|---|
invocations | Invocations |
«destructured» | EstimateFeeDetails |
Returns​
Promise
<EstimateFeeBulk
>
response from estimate_fee
Implementation of​
AccountInterface.estimateFeeBulk
Defined in​
buildInvocation​
â–¸ buildInvocation(call
, signerDetails
): Promise
<Invocation
>
Parameters​
Name | Type |
---|---|
call | Call [] |
signerDetails | InvocationsSignerDetails |
Returns​
Promise
<Invocation
>
Defined in​
execute​
â–¸ execute(calls
, abis?
, transactionsDetail?
): Promise
<InvokeFunctionResponse
>
Invoke execute function in account contract
Parameters​
Name | Type | Default value | Description |
---|---|---|---|
calls | AllowArray <Call > | undefined | 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 | undefined | Abi [] | undefined | - |
transactionsDetail | InvocationsDetails | {} | - |
Returns​
Promise
<InvokeFunctionResponse
>
response from addTransaction
Implementation of​
Defined in​
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​
Name | Type | Description |
---|---|---|
payload | DeclareContractPayload | DeclareContractPayload |
transactionsDetail | InvocationsDetails | (optional) InvocationsDetails = {} |
Returns​
Promise
<DeclareContractResponse
>
DeclareContractResponse
Defined in​
declare​
â–¸ declare(payload
, transactionsDetail?
): Promise
<DeclareContractResponse
>
Declares a given compiled contract (json) to starknet
Parameters​
Name | Type | Description |
---|---|---|
payload | 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 | Invocation Details containing: - optional nonce - optional version - optional maxFee |
Returns​
Promise
<DeclareContractResponse
>
a confirmation of sending a transaction on the starknet contract
Implementation of​
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 | [nonce=getNonce] - [version=transactionVersion] - [maxFee=getSuggestedMaxFee] |
Returns​
Promise
<MultiDeployContractResponse
>
- contract_address[]
- transaction_hash
Implementation of​
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 | [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​
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 | [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​
deployAccount​
▸ deployAccount(«destructured»
, transactionsDetail?
): Promise
<DeployContractResponse
>
Deploy the account on Starknet
Parameters​
Name | Type | Description |
---|---|---|
«destructured» | DeployAccountContractPayload | transaction payload to be deployed containing: - classHash: computed class hash of compiled contract - optional constructor calldata - optional address salt - optional contractAddress |
transactionsDetail | InvocationsDetails | Invocation 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​
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​
Name | Type |
---|---|
typedData | TypedData |
Returns​
Promise
<Signature
>
the signature of the JSON object
Implementation of​
Defined in​
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​
Name | Type |
---|---|
typedData | TypedData |
Returns​
Promise
<string
>
the hash of the JSON object
Implementation of​
Defined in​
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​
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
Implementation of​
AccountInterface.verifyMessageHash
Defined in​
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​
Name | Type | Description |
---|---|---|
typedData | TypedData | JSON object to be verified |
signature | Signature | signature of the JSON object |
Returns​
Promise
<boolean
>
true if the signature is valid, false otherwise
Implementation of​
AccountInterface.verifyMessage
Defined in​
getSuggestedMaxFee​
▸ getSuggestedMaxFee(«destructured»
, details
): Promise
<bigint
>
Gets Suggested Max Fee based on the transaction type
Parameters​
Name | Type |
---|---|
«destructured» | EstimateFeeAction |
details | EstimateFeeDetails |
Returns​
Promise
<bigint
>
suggestedMaxFee
Implementation of​
AccountInterface.getSuggestedMaxFee
Defined in​
buildDeclarePayload​
â–¸ buildDeclarePayload(payload
, «destructured»
): Promise
<DeclareContractTransaction
>
will be renamed to buildDeclareContractTransaction
Parameters​
Name | Type |
---|---|
payload | DeclareContractPayload |
«destructured» | InvocationsSignerDetails |
Returns​
Promise
<DeclareContractTransaction
>
Defined in​
buildAccountDeployPayload​
▸ buildAccountDeployPayload(«destructured»
, «destructured»
): Promise
<DeployAccountContractTransaction
>
Parameters​
Name | Type |
---|---|
«destructured» | DeployAccountContractPayload |
«destructured» | InvocationsSignerDetails |
Returns​
Promise
<DeployAccountContractTransaction
>
Defined in​
buildUDCContractPayload​
â–¸ buildUDCContractPayload(payload
): Call
[]
Parameters​
Name | Type |
---|---|
payload | UniversalDeployerContractPayload | UniversalDeployerContractPayload [] |
Returns​
Call
[]
Defined in​
simulateTransaction​
â–¸ simulateTransaction(invocations
, «destructured»?
): 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 |
«destructured» | SimulateTransactionDetails | SimulateTransactionDetails |
Returns​
Promise
<SimulateTransactionResponse
>
response from simulate_transaction
Implementation of​
AccountInterface.simulateTransaction
Defined in​
accountInvocationsFactory​
â–¸ accountInvocationsFactory(invocations
, «destructured»
): Promise
<AccountInvocations
>
Parameters​
Name | Type |
---|---|
invocations | Invocations |
«destructured» | AccountInvocationsFactoryDetails |
Returns​
Promise
<AccountInvocations
>
Defined in​
getStarkName​
â–¸ getStarkName(address?
, StarknetIdContract?
): Promise
<string
>
Parameters​
Name | Type |
---|---|
address | BigNumberish |
StarknetIdContract? | string |
Returns​
Promise
<string
>
Overrides​
Defined in​
getChainId​
â–¸ getChainId(): Promise
<StarknetChainId
>
Gets the Starknet chain Id
Returns​
Promise
<StarknetChainId
>
the chain Id
Implementation of​
Inherited from​
Defined in​
getBlock​
â–¸ getBlock(blockIdentifier
): Promise
<GetBlockResponse
>
Gets the block information
Parameters​
Name | Type | Description |
---|---|---|
blockIdentifier | BlockIdentifier | block identifier |
Returns​
Promise
<GetBlockResponse
>
the block object
Implementation of​
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
Implementation of​
Inherited from​
Defined in​
getClassHashAt​
â–¸ getClassHashAt(contractAddress
, blockIdentifier?
): Promise
<string
>
Returns the class hash deployed under the given address.
Parameters​
Name | Type | Description |
---|---|---|
contractAddress | string | contract address |
blockIdentifier? | BlockIdentifier | block identifier |
Returns​
Promise
<string
>
Class hash
Implementation of​
AccountInterface.getClassHashAt
Inherited from​
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
Implementation of​
AccountInterface.getClassByHash
Inherited from​
Defined in​
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​
Name | Type | Description |
---|---|---|
invocationWithTxType | 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 |
invocationDetails | InvocationsDetailsWithNonce | optional details containing: - nonce - optional nonce - version - optional version |
blockIdentifier | BlockIdentifier | (optional) block identifier |
Returns​
Promise
<EstimateFeeResponse
>
the estimated fee
Implementation of​
AccountInterface.getEstimateFee
Inherited from​
Defined in​
getInvokeEstimateFee​
â–¸ getInvokeEstimateFee(invocationWithTxType
, invocationDetails
, blockIdentifier?
, skipValidate?
): Promise
<EstimateFeeResponse
>
Estimates the fee for a given INVOKE transaction
Parameters​
Name | Type | Description |
---|---|---|
invocationWithTxType | 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 |
invocationDetails | 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
Implementation of​
AccountInterface.getInvokeEstimateFee
Inherited from​
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 - (optional) skipValidate - boolean (default false) |
Returns​
Promise
<EstimateFeeResponseBulk
>
the estimated fee
Implementation of​
AccountInterface.getEstimateFeeBulk
Inherited from​
Defined in​
getNonceForAddress​
â–¸ getNonceForAddress(contractAddress
, blockIdentifier?
): Promise
<string
>
Gets the nonce of a contract with respect to a specific block
Parameters​
Name | Type | Description |
---|---|---|
contractAddress | string | contract address |
blockIdentifier? | BlockIdentifier | - |
Returns​
Promise
<string
>
the hex nonce
Implementation of​
AccountInterface.getNonceForAddress
Inherited from​
Defined in​
getStorageAt​
â–¸ getStorageAt(contractAddress
, key
, blockIdentifier?
): Promise
<string
>
Gets the contract's storage variable at a specific 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
Implementation of​
Inherited from​
Defined in​
getTransaction​
â–¸ getTransaction(txHash
): Promise
<GetTransactionResponse
>
Gets the transaction information from a tx id.
Parameters​
Name | Type |
---|---|
txHash | BigNumberish |
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​
Defined in​
getTransactionReceipt​
â–¸ getTransactionReceipt(txHash
): Promise
<GetTransactionReceiptResponse
>
Gets the transaction receipt from a tx hash.
Parameters​
Name | Type |
---|---|
txHash | BigNumberish |
Returns​
Promise
<GetTransactionReceiptResponse
>
the transaction receipt object
Implementation of​
AccountInterface.getTransactionReceipt
Inherited from​
Provider.getTransactionReceipt
Defined in​
callContract​
â–¸ callContract(request
, blockIdentifier?
): Promise
<CallContractResponse
>
Calls a function on the Starknet contract.
Parameters​
Name | Type | Description |
---|---|---|
request | Call | transaction to be called |
blockIdentifier? | BlockIdentifier | block identifier |
Returns​
Promise
<CallContractResponse
>
the result of the function on the smart contract.
Implementation of​
Inherited from​
Defined in​
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​
Name | Type | Description |
---|---|---|
functionInvocation | 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
<InvokeFunctionResponse
>
response from addTransaction
Implementation of​
AccountInterface.invokeFunction
Inherited from​
Defined in​
deployAccountContract​
â–¸ deployAccountContract(payload
, details
): Promise
<DeployContractResponse
>
Deploys a given compiled Account contract (json) to starknet
Parameters​
Name | Type | Description |
---|---|---|
payload | DeployAccountContractTransaction | 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
Implementation of​
AccountInterface.deployAccountContract
Inherited from​
Provider.deployAccountContract
Defined in​
declareContract​
â–¸ declareContract(transaction
, details
): Promise
<DeclareContractResponse
>
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
<DeclareContractResponse
>
a confirmation of sending a transaction on the starknet contract
Implementation of​
AccountInterface.declareContract
Inherited from​
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
Implementation of​
AccountInterface.getDeclareEstimateFee
Inherited from​
Provider.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
Implementation of​
AccountInterface.getDeployAccountEstimateFee
Inherited from​
Provider.getDeployAccountEstimateFee
Defined in​
getCode​
â–¸ getCode(contractAddress
, blockIdentifier?
): Promise
<GetCodeResponse
>
Deprecated
The method should not be used
Parameters​
Name | Type |
---|---|
contractAddress | string |
blockIdentifier? | BlockIdentifier |
Returns​
Promise
<GetCodeResponse
>
Implementation of​
Inherited from​
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
Implementation of​
AccountInterface.waitForTransaction
Inherited from​
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
Implementation of​
AccountInterface.getSimulateTransaction
Inherited from​
Provider.getSimulateTransaction
Defined in​
getStateUpdate​
â–¸ getStateUpdate(blockIdentifier?
): Promise
<StateUpdateResponse
>
Gets the state changes in a specific block
Parameters​
Name | Type | Description |
---|---|---|
blockIdentifier? | BlockIdentifier | block identifier |
Returns​
Promise
<StateUpdateResponse
>
StateUpdateResponse
Implementation of​
AccountInterface.getStateUpdate
Inherited from​
Defined in​
getAddressFromStarkName​
â–¸ getAddressFromStarkName(name
, StarknetIdContract?
): Promise
<string
>
Parameters​
Name | Type |
---|---|
name | string |
StarknetIdContract? | string |
Returns​
Promise
<string
>
Inherited from​
Provider.getAddressFromStarkName