Skip to main content
Version: 9.2.1

Class: AccountInterface

Interface for interacting with Starknet account contracts

Extends ProviderInterface to provide account-specific functionality including:

  • Transaction execution and signing
  • Fee estimation for various transaction types
  • Contract deployment through UDC (Universal Deployer Contract)
  • Paymaster support for sponsored transactions
  • EIP-712 message signing

Remarks

Implementations of this interface typically handle the complexities of:

  • Nonce management
  • Transaction signing with the account's private key
  • Interaction with the account contract's execute entrypoint

Hierarchy

Implemented by

Constructors

constructor

new AccountInterface(): AccountInterface

Returns

AccountInterface

Inherited from

ProviderInterface.constructor

Properties

address

Abstract address: string

The address of the account contract on Starknet

Defined in

src/account/interface.ts:56


signer

Abstract signer: SignerInterface

Signer instance for signing transactions and messages

Defined in

src/account/interface.ts:61


cairoVersion

Abstract cairoVersion: CairoVersion

Cairo version of the account contract implementation

Defined in

src/account/interface.ts:66


deployer

Optional Abstract deployer: DeployerInterface

Optional deployer instance for custom contract deployment logic

Default

Uses default UDC (Universal Deployer Contract) if not specified

Defined in

src/account/interface.ts:72


channel

Abstract channel: RpcChannel | RpcChannel

Inherited from

ProviderInterface.channel

Defined in

src/provider/interface.ts:47


responseParser

Abstract responseParser: RPCResponseParser

Inherited from

ProviderInterface.responseParser

Defined in

src/provider/interface.ts:49

Methods

estimateInvokeFee

estimateInvokeFee(calls, estimateFeeDetails?): Promise<EstimateFeeResponseOverhead>

Estimate fee for executing an INVOKE transaction on Starknet

Parameters

NameTypeDescription
callsAllowArray<Call>Single call or array of calls to estimate fees for - .contractAddress - The address of the contract to invoke - .entrypoint - The function selector of the contract method - .calldata - The serialized function parameters (defaults to [])
estimateFeeDetails?UniversalDetailsOptional details for fee estimation - .blockIdentifier - Block to estimate against - .nonce - Account nonce (defaults to current nonce) - .skipValidate - Skip account validation (default: true) - .tip - Priority fee tip in fri/wei for faster inclusion - .accountDeploymentData - Include account deployment - .paymasterData - Paymaster sponsorship data - .nonceDataAvailabilityMode - DA mode for nonce - .feeDataAvailabilityMode - DA mode for fee - .version - Transaction version (v3 uses fri, v1/v2 use wei) - .resourceBounds - Resource limits for v3 transactions

Returns

Promise<EstimateFeeResponseOverhead>

Fee estimation including overall_fee and resourceBounds

Example

const fee = await account.estimateInvokeFee({
contractAddress: '0x123...',
entrypoint: 'transfer',
calldata: [recipient, amount],
});

Defined in

src/account/interface.ts:104


estimateDeclareFee

estimateDeclareFee(contractPayload, estimateFeeDetails?): Promise<EstimateFeeResponseOverhead>

Estimate fee for executing a DECLARE transaction on Starknet

Parameters

NameTypeDescription
contractPayloadDeclareContractPayloadContract declaration payload. - .contract - Compiled contract (Sierra JSON). - .casm - Compiled Cairo assembly (required for Cairo 1). - .classHash - Pre-computed class hash (optional optimization). - .compiledClassHash - Pre-computed CASM hash (alternative to casm).
estimateFeeDetails?UniversalDetailsOptional details for fee estimation. - .blockIdentifier - Block to estimate against. - .nonce - Account nonce (defaults to current nonce) - .skipValidate - Skip account validation (default: true) - .tip - Priority fee tip for faster inclusion - .version - Transaction version (v3 uses fri, v1/v2 use wei)

Returns

Promise<EstimateFeeResponseOverhead>

Fee estimation including overall_fee and resourceBounds

Example

const fee = await account.estimateDeclareFee({
contract: compiledContract,
casm: compiledCasm,
});

Defined in

src/account/interface.ts:135


estimateAccountDeployFee

estimateAccountDeployFee(contractPayload, estimateFeeDetails?): Promise<EstimateFeeResponseOverhead>

Estimate fee for executing an INVOKE transaction on Starknet

Parameters

NameTypeDescription
contractPayloadDeployAccountContractPayloadSingle call or array of calls to estimate fees for - .contractAddress - The address of the contract to invoke - .entrypoint - The function selector of the contract method - .calldata - The serialized function parameters (defaults to [])
estimateFeeDetails?UniversalDetailsOptional details for fee estimation - .blockIdentifier - Block to estimate against - .nonce - Account nonce (defaults to current nonce) - .skipValidate - Skip account validation (default: true) - .tip - Priority fee tip in fri/wei for faster inclusion - .accountDeploymentData - Include account deployment - .paymasterData - Paymaster sponsorship data - .nonceDataAvailabilityMode - DA mode for nonce - .feeDataAvailabilityMode - DA mode for fee - .version - Transaction version (v3 uses fri, v1/v2 use wei) - .resourceBounds - Resource limits for v3 transactions

Returns

Promise<EstimateFeeResponseOverhead>

Fee estimation including overall_fee and resourceBounds

Fee estimation including overall_fee and resourceBounds

Example

const fee = await account.estimateAccountDeployFee({
classHash: accountClassHash,
constructorCalldata: { publicKey },
addressSalt: publicKey,
});

Defined in

src/account/interface.ts:162


estimateDeployFee

estimateDeployFee(deployContractPayload, estimateFeeDetails?): Promise<EstimateFeeResponseOverhead>

Estimate fee for executing an INVOKE transaction on Starknet

Parameters

NameTypeDescription
deployContractPayloadUniversalDeployerContractPayload | UniversalDeployerContractPayload[]Single call or array of calls to estimate fees for - .contractAddress - The address of the contract to invoke - .entrypoint - The function selector of the contract method - .calldata - The serialized function parameters (defaults to [])
estimateFeeDetails?UniversalDetailsOptional details for fee estimation - .blockIdentifier - Block to estimate against - .nonce - Account nonce (defaults to current nonce) - .skipValidate - Skip account validation (default: true) - .tip - Priority fee tip in fri/wei for faster inclusion - .accountDeploymentData - Include account deployment - .paymasterData - Paymaster sponsorship data - .nonceDataAvailabilityMode - DA mode for nonce - .feeDataAvailabilityMode - DA mode for fee - .version - Transaction version (v3 uses fri, v1/v2 use wei) - .resourceBounds - Resource limits for v3 transactions

Returns

Promise<EstimateFeeResponseOverhead>

Fee estimation for the deployment transaction

Fee estimation including overall_fee and resourceBounds

Example

const fee = await account.estimateDeployFee({
classHash: contractClassHash,
constructorCalldata: [param1, param2],
unique: true,
});

Defined in

src/account/interface.ts:189


estimateFeeBulk

estimateFeeBulk(invocations, details?): Promise<EstimateFeeResponseBulkOverhead>

Estimate fee for executing an INVOKE transaction on Starknet

Parameters

NameTypeDescription
invocationsInvocationsSingle call or array of calls to estimate fees for - .contractAddress - The address of the contract to invoke - .entrypoint - The function selector of the contract method - .calldata - The serialized function parameters (defaults to [])
details?UniversalDetailsOptional details for fee estimation - .blockIdentifier - Block to estimate against - .nonce - Account nonce (defaults to current nonce) - .skipValidate - Skip account validation (default: true) - .tip - Priority fee tip in fri/wei for faster inclusion - .accountDeploymentData - Include account deployment - .paymasterData - Paymaster sponsorship data - .nonceDataAvailabilityMode - DA mode for nonce - .feeDataAvailabilityMode - DA mode for fee - .version - Transaction version (v3 uses fri, v1/v2 use wei) - .resourceBounds - Resource limits for v3 transactions

Returns

Promise<EstimateFeeResponseBulkOverhead>

Array of fee estimations for each transaction

Fee estimation including overall_fee and resourceBounds

Example

const fees = await account.estimateFeeBulk([
{ type: 'INVOKE', payload: { contractAddress, entrypoint, calldata } },
{ type: 'DECLARE', payload: { contract, casm } },
]);

Defined in

src/account/interface.ts:213


execute

execute(transactions, transactionsDetail?): Promise<{ transaction_hash: string }>

Execute one or multiple calls through the account contract

Parameters

NameTypeDescription
transactionsAllowArray<Call>Single call or array of calls to execute - .contractAddress - Target contract address - .entrypoint - Function to invoke on the contract - .calldata - Function parameters
transactionsDetail?InvocationsDetailsTransaction execution options - .nonce - Override account nonce - .maxFee - Maximum fee for v1/v2 transactions - .resourceBounds - Resource limits for v3 transactions - .tip - Priority fee tip - .version - Force specific transaction version

Returns

Promise<{ transaction_hash: string }>

Transaction hash and response

Example

const result = await account.execute([
{ contractAddress: token, entrypoint: 'transfer', calldata: [to, amount] },
{ contractAddress: nft, entrypoint: 'mint', calldata: [recipient] },
]);

Defined in

src/account/interface.ts:242


estimatePaymasterTransactionFee

estimatePaymasterTransactionFee(calls, paymasterDetails): Promise<PaymasterFeeEstimate>

Estimate fees for a paymaster-sponsored transaction

Parameters

NameTypeDescription
callsCall[]Array of calls to be sponsored - .contractAddress - Target contract address - .entrypoint - Function to invoke - .calldata - Function parameters
paymasterDetailsPaymasterDetailsPaymaster configuration - .feeMode - Sponsorship mode: 'sponsored' or gas token - .deploymentData - Account deployment data if needed - .timeBounds - Valid execution time window

Returns

Promise<PaymasterFeeEstimate>

Fee estimates in both STRK and gas token

Example

const fees = await account.estimatePaymasterTransactionFee(
[{ contractAddress, entrypoint, calldata }],
{ feeMode: { mode: 'sponsored' } }
);

Defined in

src/account/interface.ts:269


buildPaymasterTransaction

buildPaymasterTransaction(calls, paymasterDetails): Promise<PreparedTransaction>

Estimate fees for a paymaster-sponsored transaction

Parameters

NameTypeDescription
callsCall[]Array of calls to be sponsored - .contractAddress - Target contract address - .entrypoint - Function to invoke - .calldata - Function parameters
paymasterDetailsPaymasterDetailsPaymaster configuration - .feeMode - Sponsorship mode: 'sponsored' or gas token - .deploymentData - Account deployment data if needed - .timeBounds - Valid execution time window

Returns

Promise<PreparedTransaction>

Prepared transaction with typed data for signing

Fee estimates in both STRK and gas token

Example

const prepared = await account.buildPaymasterTransaction(calls, {
feeMode: { mode: 'default', gasToken: ETH_ADDRESS },
});

Defined in

src/account/interface.ts:290


executePaymasterTransaction

executePaymasterTransaction(calls, paymasterDetails, maxFeeInGasToken?): Promise<{ transaction_hash: string }>

Execute a paymaster-sponsored transaction

Parameters

NameTypeDescription
callsCall[]Array of calls to execute
paymasterDetailsPaymasterDetailsPaymaster configuration - .feeMode - 'sponsored' or gas token payment - .deploymentData - Deploy account if needed - .timeBounds - Execution validity window (UNIX timestamps)
maxFeeInGasToken?BigNumberishMaximum acceptable fee in gas token

Returns

Promise<{ transaction_hash: string }>

Transaction hash if successful

Throws

If gas token price exceeds maxFeeInGasToken

Throws

If transaction parameters are modified by paymaster

Example

const txHash = await account.executePaymasterTransaction(
calls,
{ feeMode: { mode: 'sponsored' }, timeBounds: { executeBefore: Date.now() / 1000 + 3600 } },
maxFeeETH
);

Defined in

src/account/interface.ts:318


declare

declare(contractPayload, transactionsDetail?): Promise<{ class_hash: string ; transaction_hash: string }>

Execute one or multiple calls through the account contract

Parameters

NameTypeDescription
contractPayloadDeclareContractPayloadSingle call or array of calls to execute - .contractAddress - Target contract address - .entrypoint - Function to invoke on the contract - .calldata - Function parameters
transactionsDetail?InvocationsDetailsTransaction execution options - .nonce - Override account nonce - .maxFee - Maximum fee for v1/v2 transactions - .resourceBounds - Resource limits for v3 transactions - .tip - Priority fee tip - .version - Force specific transaction version

Returns

Promise<{ class_hash: string ; transaction_hash: string }>

Declaration transaction hash and class hash

Transaction hash and response

Example

const declareResult = await account.declare({
contract: compiledSierra,
casm: compiledCasm,
});

Defined in

src/account/interface.ts:346


deploy

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

Execute one or multiple calls through the account contract

Parameters

NameTypeDescription
payloadUniversalDeployerContractPayload | UniversalDeployerContractPayload[]Single call or array of calls to execute - .contractAddress - Target contract address - .entrypoint - Function to invoke on the contract - .calldata - Function parameters
details?InvocationsDetailsTransaction execution options - .nonce - Override account nonce - .maxFee - Maximum fee for v1/v2 transactions - .resourceBounds - Resource limits for v3 transactions - .tip - Priority fee tip - .version - Force specific transaction version

Returns

Promise<MultiDeployContractResponse>

Deployed contract addresses and transaction hash

Transaction hash and response

Example

const deployment = await account.deploy([
{ classHash: erc20ClassHash, constructorCalldata: [name, symbol] },
{ classHash: nftClassHash, unique: true },
]);

Defined in

src/account/interface.ts:372


deployContract

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

Execute one or multiple calls through the account contract

Parameters

NameTypeDescription
payloadUniversalDeployerContractPayload | UniversalDeployerContractPayload[]Single call or array of calls to execute - .contractAddress - Target contract address - .entrypoint - Function to invoke on the contract - .calldata - Function parameters
details?InvocationsDetailsTransaction execution options - .nonce - Override account nonce - .maxFee - Maximum fee for v1/v2 transactions - .resourceBounds - Resource limits for v3 transactions - .tip - Priority fee tip - .version - Force specific transaction version

Returns

Promise<DeployContractUDCResponse>

Deployment result with contract address and UDC event details

Deployed contract addresses and transaction hash

Remarks

This method waits for transaction confirmation before returning

Example

const result = await account.deployContract({
classHash: contractClassHash,
constructorCalldata: params,
});
console.log('Deployed at:', result.address);

Defined in

src/account/interface.ts:398


declareAndDeploy

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

Execute one or multiple calls through the account contract

Parameters

NameTypeDescription
payloadDeclareAndDeployContractPayloadSingle call or array of calls to execute - .contractAddress - Target contract address - .entrypoint - Function to invoke on the contract - .calldata - Function parameters
details?InvocationsDetailsTransaction execution options - .nonce - Override account nonce - .maxFee - Maximum fee for v1/v2 transactions - .resourceBounds - Resource limits for v3 transactions - .tip - Priority fee tip - .version - Force specific transaction version

Returns

Promise<DeclareDeployUDCResponse>

Declaration and deployment results

Transaction hash and response

Remarks

  • Automatically skips declaration if contract is already declared
  • Waits for both transactions to complete
  • Does not support batch operations

Example

const result = await account.declareAndDeploy({
contract: compiledContract,
casm: compiledCasm,
constructorCalldata: [param1, param2],
});

Defined in

src/account/interface.ts:432


deployAccount

deployAccount(contractPayload, transactionsDetail?): Promise<DeployContractResponse>

Execute one or multiple calls through the account contract

Parameters

NameTypeDescription
contractPayloadDeployAccountContractPayloadSingle call or array of calls to execute - .contractAddress - Target contract address - .entrypoint - Function to invoke on the contract - .calldata - Function parameters
transactionsDetail?InvocationsDetailsTransaction execution options - .nonce - Override account nonce - .maxFee - Maximum fee for v1/v2 transactions - .resourceBounds - Resource limits for v3 transactions - .tip - Priority fee tip - .version - Force specific transaction version

Returns

Promise<DeployContractResponse>

Deployment transaction hash and contract address

Transaction hash and response

Remarks

Used for deploying the account contract when using a pre-funded address

Example

const deployment = await account.deployAccount({
classHash: accountClassHash,
constructorCalldata: { publicKey: pubKey },
addressSalt: pubKey,
});

Defined in

src/account/interface.ts:461


signMessage

signMessage(typedData): Promise<Signature>

Sign a typed data message for off-chain verification

Parameters

NameTypeDescription
typedDataTypedDataEIP-712 style typed data structure

Returns

Promise<Signature>

Signature array [r, s]

Remarks

  • Includes domain separation to prevent signature reuse
  • Compatible with Starknet's signature verification
  • Cannot be used to sign transactions

Example

const signature = await account.signMessage({
domain: { name: 'MyDapp', chainId: 'SN_MAIN' },
types: { ... },
primaryType: 'Message',
message: { content: 'Hello Starknet!' }
});

Defined in

src/account/interface.ts:485


hashMessage

hashMessage(typedData): Promise<string>

Hash a typed data message using Pedersen hash

Parameters

NameTypeDescription
typedDataTypedDataEIP-712 style typed data structure

Returns

Promise<string>

Message hash as hex string

Remarks

  • Uses Pedersen hash function (not Keccak)
  • Includes domain separation
  • Result can be used for signature verification

Example

const messageHash = await account.hashMessage(typedData);

Defined in

src/account/interface.ts:501


getNonce

getNonce(blockIdentifier?): Promise<string>

Get the current nonce of the account

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierBlock to query nonce at (default: 'latest' tag)

Returns

Promise<string>

Account nonce as hex string

Example

const nonce = await account.getNonce();
const historicalNonce = await account.getNonce('latest');

Defined in

src/account/interface.ts:514


declareIfNot

declareIfNot(contractPayload, transactionsDetail?): Promise<{ class_hash: string ; transaction_hash: string }>

Declare a contract class if not already declared

Parameters

NameTypeDescription
contractPayloadDeclareContractPayloadContract declaration payload
transactionsDetail?InvocationsDetailsTransaction execution options

Returns

Promise<{ class_hash: string ; transaction_hash: string }>

Declaration result (with empty transaction_hash if already declared)

Example

const result = await account.declareIfNot({
contract: compiledContract,
casm: compiledCasm,
});

Defined in

src/account/interface.ts:530


getChainId

getChainId(): Promise<"0x534e5f4d41494e" | "0x534e5f5345504f4c4941">

Gets the Starknet chain Id

Returns

Promise<"0x534e5f4d41494e" | "0x534e5f5345504f4c4941">

the chain Id

Inherited from

ProviderInterface.getChainId

Defined in

src/provider/interface.ts:56


callContract

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

Calls a function on the Starknet contract.

Parameters

NameTypeDescription
callCalltransaction to be called
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<CallContractResponse>

the result of the function on the smart contract.

Inherited from

ProviderInterface.callContract

Defined in

src/provider/interface.ts:65


getBlock

getBlock(): Promise<{ transactions: string[] ; block_number: number ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string }>

Gets the block information

Returns

Promise<{ transactions: string[] ; block_number: number ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string }>

the block object

Inherited from

ProviderInterface.getBlock

Defined in

src/provider/interface.ts:75

getBlock(blockIdentifier): Promise<{ transactions: string[] ; block_number: number ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string }>

Parameters

NameType
blockIdentifier"pre_confirmed"

Returns

Promise<{ transactions: string[] ; block_number: number ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string }>

Inherited from

ProviderInterface.getBlock

Defined in

src/provider/interface.ts:76

getBlock(blockIdentifier): Promise<{ status: EBlockStatus ; block_hash: string ; parent_hash: string ; block_number: number ; new_root: string ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string ; event_commitment: string ; transaction_commitment: string ; receipt_commitment: string ; state_diff_commitment: string ; event_count: number ; transaction_count: number ; state_diff_length: number ; transactions: string[] }>

Parameters

NameType
blockIdentifier"latest"

Returns

Promise<{ status: EBlockStatus ; block_hash: string ; parent_hash: string ; block_number: number ; new_root: string ; timestamp: number ; sequencer_address: string ; l1_gas_price: RESOURCE_PRICE ; l2_gas_price: RESOURCE_PRICE ; l1_data_gas_price: RESOURCE_PRICE ; l1_da_mode: L1_DA_MODE ; starknet_version: string ; event_commitment: string ; transaction_commitment: string ; receipt_commitment: string ; state_diff_commitment: string ; event_count: number ; transaction_count: number ; state_diff_length: number ; transactions: string[] }>

Inherited from

ProviderInterface.getBlock

Defined in

src/provider/interface.ts:77

getBlock(blockIdentifier): Promise<GetBlockResponse>

Parameters

NameType
blockIdentifierBlockIdentifier

Returns

Promise<GetBlockResponse>

Inherited from

ProviderInterface.getBlock

Defined in

src/provider/interface.ts:78


getClassAt

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

Gets the contract class of the deployed contract.

Parameters

NameTypeDescription
contractAddressBigNumberishcontract address
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<ContractClassResponse>

Contract class of compiled contract

Inherited from

ProviderInterface.getClassAt

Defined in

src/provider/interface.ts:87


getL1GasPrice

getL1GasPrice(blockIdentifier?): Promise<string>

Gets the price of l1 gas in the block

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<string>

gas price of the block

Inherited from

ProviderInterface.getL1GasPrice

Defined in

src/provider/interface.ts:98


getL1MessageHash

getL1MessageHash(l2TxHash): Promise<string>

Get L1 message hash from L2 transaction hash

Parameters

NameTypeDescription
l2TxHashBigNumberishL2 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

src/provider/interface.ts:111


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
contractAddressBigNumberishcontract address
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<string>

Class hash

Inherited from

ProviderInterface.getClassHashAt

Defined in

src/provider/interface.ts:120


getClassByHash

getClassByHash(classHash): Promise<ContractClassResponse>

Returns the contract class deployed under the given class hash.

Parameters

NameTypeDescription
classHashBigNumberishclass hash

Returns

Promise<ContractClassResponse>

Contract class of compiled contract

Inherited from

ProviderInterface.getClassByHash

Defined in

src/provider/interface.ts:131


getNonceForAddress

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

Returns the nonce associated with the given address in the given block

Parameters

NameTypeDescription
contractAddressBigNumberishcontract address
blockIdentifier?BlockIdentifier-

Returns

Promise<string>

the hex nonce

Inherited from

ProviderInterface.getNonceForAddress

Defined in

src/provider/interface.ts:139


getStorageAt

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

Get the value of the storage (contract's variable) at the given address and key

Parameters

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

Returns

Promise<string>

the value of the storage variable

Inherited from

ProviderInterface.getStorageAt

Defined in

src/provider/interface.ts:152


getTransaction

getTransaction(transactionHash): Promise<TransactionWithHash>

Gets the transaction information from a tx id.

Parameters

NameType
transactionHashBigNumberish

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

src/provider/interface.ts:164


getTransactionReceipt

getTransactionReceipt(transactionHash): Promise<GetTransactionReceiptResponse>

Gets the transaction receipt from a tx hash.

Parameters

NameType
transactionHashBigNumberish

Returns

Promise<GetTransactionReceiptResponse>

the transaction receipt object

Inherited from

ProviderInterface.getTransactionReceipt

Defined in

src/provider/interface.ts:172


deployAccountContract

deployAccountContract(payload, details): Promise<DeployContractResponse>

Deploys a given compiled Account contract (json) to starknet

Parameters

NameTypeDescription
payloadDeployAccountContractPayloadpayload 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

Inherited from

ProviderInterface.deployAccountContract

Defined in

src/provider/interface.ts:185


invokeFunction

invokeFunction(invocation, details): Promise<{ transaction_hash: string }>

Invokes a function on starknet

Parameters

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

Returns

Promise<{ transaction_hash: string }>

response from addTransaction

Inherited from

ProviderInterface.invokeFunction

Defined in

src/provider/interface.ts:204


declareContract

declareContract(transaction, details): Promise<{ class_hash: string ; transaction_hash: string }>

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<{ class_hash: string ; transaction_hash: string }>

a confirmation of sending a transaction on the starknet contract

Inherited from

ProviderInterface.declareContract

Defined in

src/provider/interface.ts:221


getInvokeEstimateFee

getInvokeEstimateFee(invocation, details, blockIdentifier?, skipValidate?): Promise<EstimateFeeResponseOverhead>

Estimates the fee for a given INVOKE transaction

Parameters

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

Returns

Promise<EstimateFeeResponseOverhead>

the estimated fee

Deprecated

Consider using getEstimateFeeBulk for multiple transactions

Example

const feeEstimate = await provider.getInvokeEstimateFee(invocation, details);
// Equivalent to:
const [feeEstimate] = await provider.getEstimateFeeBulk(
[{ type: ETransactionType.INVOKE, ...invocation, ...details }],
options
);

Alias

getEstimateFeeBulk - This method is an alias that calls getEstimateFeeBulk with a single transaction

Inherited from

ProviderInterface.getInvokeEstimateFee

Defined in

src/provider/interface.ts:249


getDeclareEstimateFee

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

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<EstimateFeeResponseOverhead>

the estimated fee

Deprecated

Consider using getEstimateFeeBulk for multiple transactions

Example

const feeEstimate = await provider.getDeclareEstimateFee(transaction, details);
// Equivalent to:
const [feeEstimate] = await provider.getEstimateFeeBulk(
[{ type: ETransactionType.DECLARE, ...transaction, ...details }],
options
);

Alias

getEstimateFeeBulk - This method is an alias that calls getEstimateFeeBulk with a single transaction

Inherited from

ProviderInterface.getDeclareEstimateFee

Defined in

src/provider/interface.ts:279


getDeployAccountEstimateFee

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

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<EstimateFeeResponseOverhead>

the estimated fee

Deprecated

Consider using getEstimateFeeBulk for multiple transactions

Example

const feeEstimate = await provider.getDeployAccountEstimateFee(transaction, details);
// Equivalent to:
const [feeEstimate] = await provider.getEstimateFeeBulk(
[{ type: ETransactionType.DEPLOY_ACCOUNT, ...transaction, ...details }],
options
);

Alias

getEstimateFeeBulk - This method is an alias that calls getEstimateFeeBulk with a single transaction

Inherited from

ProviderInterface.getDeployAccountEstimateFee

Defined in

src/provider/interface.ts:310


getEstimateFeeBulk

getEstimateFeeBulk(invocations, options?): Promise<EstimateFeeResponseBulkOverhead>

Estimates the fee for a list of INVOKE transaction

Parameters

NameTypeDescription
invocationsAccountInvocationsAccountInvocations - Complete invocations array with account details
options?getEstimateFeeBulkOptionsgetEstimateFeeBulkOptions - (optional) blockIdentifier - BlockIdentifier

Returns

Promise<EstimateFeeResponseBulkOverhead>

the estimated fee

Inherited from

ProviderInterface.getEstimateFeeBulk

Defined in

src/provider/interface.ts:325


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

Inherited from

ProviderInterface.waitForTransaction

Defined in

src/provider/interface.ts:338


getSimulateTransaction

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

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<SimulateTransactionOverheadResponse>

an array of transaction trace and estimated fee

Inherited from

ProviderInterface.getSimulateTransaction

Defined in

src/provider/interface.ts:353


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

Inherited from

ProviderInterface.getStateUpdate

Defined in

src/provider/interface.ts:364


getBlockStateUpdate

getBlockStateUpdate(): Promise<{ block_hash: string ; new_root: string ; old_root: string ; state_diff: { storage_diffs: { address: string ; storage_entries: { key: string ; value: string }[] }[] ; deprecated_declared_classes: string[] ; declared_classes: { class_hash: string ; compiled_class_hash: string }[] ; deployed_contracts: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: string }[] } }>

Gets the state changes in a specific block (result of executing the requested block) Alternative method name for getStateUpdate with specific overloads

Returns

Promise<{ block_hash: string ; new_root: string ; old_root: string ; state_diff: { storage_diffs: { address: string ; storage_entries: { key: string ; value: string }[] }[] ; deprecated_declared_classes: string[] ; declared_classes: { class_hash: string ; compiled_class_hash: string }[] ; deployed_contracts: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: string }[] } }>

StateUpdateResponse

Inherited from

ProviderInterface.getBlockStateUpdate

Defined in

src/provider/interface.ts:372

getBlockStateUpdate(blockIdentifier): Promise<{ block_hash: never ; state_diff: { storage_diffs: { address: string ; storage_entries: { key: string ; value: string }[] }[] ; deprecated_declared_classes: string[] ; declared_classes: { class_hash: string ; compiled_class_hash: string }[] ; deployed_contracts: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: string }[] } ; old_root: undefined | string }>

Parameters

NameType
blockIdentifier"pre_confirmed"

Returns

Promise<{ block_hash: never ; state_diff: { storage_diffs: { address: string ; storage_entries: { key: string ; value: string }[] }[] ; deprecated_declared_classes: string[] ; declared_classes: { class_hash: string ; compiled_class_hash: string }[] ; deployed_contracts: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: string }[] } ; old_root: undefined | string }>

Inherited from

ProviderInterface.getBlockStateUpdate

Defined in

src/provider/interface.ts:373

getBlockStateUpdate(blockIdentifier): Promise<{ block_hash: string ; new_root: string ; old_root: string ; state_diff: { storage_diffs: { address: string ; storage_entries: { key: string ; value: string }[] }[] ; deprecated_declared_classes: string[] ; declared_classes: { class_hash: string ; compiled_class_hash: string }[] ; deployed_contracts: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: string }[] } }>

Parameters

NameType
blockIdentifier"latest"

Returns

Promise<{ block_hash: string ; new_root: string ; old_root: string ; state_diff: { storage_diffs: { address: string ; storage_entries: { key: string ; value: string }[] }[] ; deprecated_declared_classes: string[] ; declared_classes: { class_hash: string ; compiled_class_hash: string }[] ; deployed_contracts: { address: string ; class_hash: string }[] ; replaced_classes: { contract_address: string ; class_hash: string }[] ; nonces: { nonce: string ; contract_address: string }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: string }[] } }>

Inherited from

ProviderInterface.getBlockStateUpdate

Defined in

src/provider/interface.ts:376

getBlockStateUpdate(blockIdentifier?): Promise<StateUpdateResponse>

Parameters

NameType
blockIdentifier?BlockIdentifier

Returns

Promise<StateUpdateResponse>

Inherited from

ProviderInterface.getBlockStateUpdate

Defined in

src/provider/interface.ts:377


getContractVersion

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

Gets the contract version from the provided address

Parameters

NameTypeDescription
contractAddressBigNumberishstring
classHash?undefinedundefined
options?getContractVersionOptionsgetContractVersionOptions - (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

src/provider/interface.ts:389

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

Gets the contract version from the provided address

Parameters

NameTypeDescription
contractAddressundefinedundefined
classHashBigNumberish
options?getContractVersionOptionsgetContractVersionOptions - (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

src/provider/interface.ts:403


getBlockLatestAccepted

getBlockLatestAccepted(): Promise<{ block_hash: string ; block_number: number }>

Get the most recent accepted block hash and number

Returns

Promise<{ block_hash: string ; block_number: number }>

Object containing block hash and number

Inherited from

ProviderInterface.getBlockLatestAccepted

Defined in

src/provider/interface.ts:414


getBlockNumber

getBlockNumber(): Promise<number>

Get the most recent accepted block number

Returns

Promise<number>

Number of the latest block

Inherited from

ProviderInterface.getBlockNumber

Defined in

src/provider/interface.ts:420


getBlockWithTxHashes

getBlockWithTxHashes(blockIdentifier?): Promise<any>

Get block information with transaction hashes

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<any>

Block with transaction hashes

Inherited from

ProviderInterface.getBlockWithTxHashes

Defined in

src/provider/interface.ts:427


getBlockWithTxs

getBlockWithTxs(blockIdentifier?): Promise<any>

Get block information with full transactions

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<any>

Block with full transactions

Inherited from

ProviderInterface.getBlockWithTxs

Defined in

src/provider/interface.ts:434


getBlockWithReceipts

getBlockWithReceipts(blockIdentifier?): Promise<any>

Get block information with transaction receipts

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<any>

Block with transaction receipts

Inherited from

ProviderInterface.getBlockWithReceipts

Defined in

src/provider/interface.ts:441


getBlockTransactionsTraces

getBlockTransactionsTraces(blockIdentifier?): Promise<any>

Get transaction traces for all transactions in a block

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<any>

Array of transaction traces

Inherited from

ProviderInterface.getBlockTransactionsTraces

Defined in

src/provider/interface.ts:448


getBlockTransactionCount

getBlockTransactionCount(blockIdentifier?): Promise<number>

Get the number of transactions in a block

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<number>

Transaction count

Inherited from

ProviderInterface.getBlockTransactionCount

Defined in

src/provider/interface.ts:455


waitForBlock

waitForBlock(blockIdentifier?, retryInterval?): Promise<void>

Pause execution until a specified block is created

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock number or tag
retryInterval?numbermilliseconds between requests (default: 5000)

Returns

Promise<void>

Example

await provider.waitForBlock(12345);
await provider.waitForBlock('latest');

Inherited from

ProviderInterface.waitForBlock

Defined in

src/provider/interface.ts:467


getTransactionByHash

getTransactionByHash(txHash): Promise<TransactionWithHash>

Gets the transaction information from a tx hash (alias for getTransaction)

Parameters

NameTypeDescription
txHashBigNumberishtransaction hash

Returns

Promise<TransactionWithHash>

Transaction information

Inherited from

ProviderInterface.getTransactionByHash

Defined in

src/provider/interface.ts:478


getTransactionByBlockIdAndIndex

getTransactionByBlockIdAndIndex(blockIdentifier, index): Promise<TransactionWithHash>

Gets transaction by block identifier and index

Parameters

NameTypeDescription
blockIdentifierBlockIdentifierblock identifier
indexnumbertransaction index in the block

Returns

Promise<TransactionWithHash>

Transaction information

Inherited from

ProviderInterface.getTransactionByBlockIdAndIndex

Defined in

src/provider/interface.ts:486


getTransactionTrace

getTransactionTrace(txHash): Promise<TRANSACTION_TRACE | TRANSACTION_TRACE>

Gets the transaction trace

Parameters

NameTypeDescription
txHashBigNumberishtransaction hash

Returns

Promise<TRANSACTION_TRACE | TRANSACTION_TRACE>

Transaction trace

Inherited from

ProviderInterface.getTransactionTrace

Defined in

src/provider/interface.ts:496


getTransactionStatus

getTransactionStatus(transactionHash): Promise<any>

Get the status of a transaction

Parameters

NameTypeDescription
transactionHashBigNumberishtransaction hash

Returns

Promise<any>

Transaction status

Inherited from

ProviderInterface.getTransactionStatus

Defined in

src/provider/interface.ts:505


fetch

fetch(method, params?, id?): Promise<any>

Direct RPC method call

Parameters

NameTypeDescription
methodstringRPC method name
params?objectmethod parameters
id?string | numberrequest ID

Returns

Promise<any>

RPC response

Inherited from

ProviderInterface.fetch

Defined in

src/provider/interface.ts:515


readSpecVersion

readSpecVersion(): undefined | string

Read channel spec version

Returns

undefined | string

Spec version string or undefined if not set

Inherited from

ProviderInterface.readSpecVersion

Defined in

src/provider/interface.ts:521


getSpecVersion

getSpecVersion(): Promise<string>

Get channel spec version

Returns

Promise<string>

Promise resolving to spec version

Inherited from

ProviderInterface.getSpecVersion

Defined in

src/provider/interface.ts:527


setUpSpecVersion

setUpSpecVersion(): Promise<string>

Setup channel spec version and return it

Returns

Promise<string>

Promise resolving to spec version

Inherited from

ProviderInterface.setUpSpecVersion

Defined in

src/provider/interface.ts:533


getClass

getClass(classHash, blockIdentifier?): Promise<ContractClassResponse>

Get contract class by hash with optional block identifier

Parameters

NameTypeDescription
classHashBigNumberishclass hash
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<ContractClassResponse>

Contract class

Inherited from

ProviderInterface.getClass

Defined in

src/provider/interface.ts:542


estimateMessageFee

estimateMessageFee(message, blockIdentifier?): Promise<MESSAGE_FEE_ESTIMATE | FEE_ESTIMATE>

Estimate the fee for a message from L1

Parameters

NameTypeDescription
messageMSG_FROM_L1L1 message
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<MESSAGE_FEE_ESTIMATE | FEE_ESTIMATE>

Fee estimate

Inherited from

ProviderInterface.estimateMessageFee

Defined in

src/provider/interface.ts:553


getSyncingStats

getSyncingStats(): Promise<any>

Get node synchronization status

Returns

Promise<any>

Sync status or false if not syncing

Inherited from

ProviderInterface.getSyncingStats

Defined in

src/provider/interface.ts:562


getEvents

getEvents(eventFilter): Promise<EVENTS_CHUNK | EVENTS_CHUNK>

Get events matching the given filter

Parameters

NameTypeDescription
eventFilterEventFilter | EventFilterevent filter

Returns

Promise<EVENTS_CHUNK | EVENTS_CHUNK>

Events and pagination info

Inherited from

ProviderInterface.getEvents

Defined in

src/provider/interface.ts:569


verifyMessageInStarknet

verifyMessageInStarknet(message, signature, accountAddress, signatureVerificationFunctionName?, signatureVerificationResponse?): Promise<boolean>

Verify in Starknet a signature of a TypedData object or of a given hash.

Parameters

NameTypeDescription
messageTypedData | BigNumberishTypedData object to be verified, or message hash to be verified.
signatureSignaturesignature of the message.
accountAddressBigNumberishaddress of the account that has signed the message.
signatureVerificationFunctionName?stringif account contract with non standard account verification function name.
signatureVerificationResponse?Objectif account contract with non standard response of verification function.
signatureVerificationResponse.okResponsestring[]-
signatureVerificationResponse.nokResponsestring[]-
signatureVerificationResponse.errorstring[]-

Returns

Promise<boolean>

const myTypedMessage: TypedMessage = .... ;
const messageHash = typedData.getMessageHash(myTypedMessage,accountAddress);
const sign: WeierstrassSignatureType = ec.starkCurve.sign(messageHash, privateKey);
const accountAddress = "0x43b7240d227aa2fb8434350b3321c40ac1b88c7067982549e7609870621b535";
const result1 = await myRpcProvider.verifyMessageInStarknet(myTypedMessage, sign, accountAddress);
const result2 = await myRpcProvider.verifyMessageInStarknet(messageHash, sign, accountAddress);
// result1 = result2 = true

Inherited from

ProviderInterface.verifyMessageInStarknet

Defined in

src/provider/interface.ts:591


isClassDeclared

isClassDeclared(contractClassIdentifier, blockIdentifier?): Promise<boolean>

Test if class is already declared

Parameters

NameTypeDescription
contractClassIdentifierContractClassIdentifiercontract class identifier
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<boolean>

true if class is declared

Inherited from

ProviderInterface.isClassDeclared

Defined in

src/provider/interface.ts:609


prepareInvocations

prepareInvocations(invocations): Promise<Invocations>

Build bulk invocations with auto-detect declared class

Parameters

NameTypeDescription
invocationsInvocationsarray of invocations

Returns

Promise<Invocations>

Prepared invocations

Inherited from

ProviderInterface.prepareInvocations

Defined in

src/provider/interface.ts:619


getL1MessagesStatus

getL1MessagesStatus(transactionHash): Promise<L1L2MessagesStatus | L1L2MessagesStatus>

Get L1 messages status for a transaction

Parameters

NameTypeDescription
transactionHashBigNumberishL1 transaction hash

Returns

Promise<L1L2MessagesStatus | L1L2MessagesStatus>

L1 message status

Inherited from

ProviderInterface.getL1MessagesStatus

Defined in

src/provider/interface.ts:626


getStorageProof

getStorageProof(classHashes, contractAddresses, contractsStorageKeys, blockIdentifier?): Promise<StorageProof>

Get Merkle paths in state tries

Parameters

NameTypeDescription
classHashesBigNumberish[]class hashes
contractAddressesBigNumberish[]contract addresses
contractsStorageKeysCONTRACT_STORAGE_KEYS[]storage keys
blockIdentifier?BlockIdentifierblock identifier

Returns

Promise<StorageProof>

Storage proof

Inherited from

ProviderInterface.getStorageProof

Defined in

src/provider/interface.ts:638


getCompiledCasm

getCompiledCasm(classHash): Promise<CASM_COMPILED_CONTRACT_CLASS>

Get compiled CASM contract class

Parameters

NameTypeDescription
classHashBigNumberishclass hash

Returns

Promise<CASM_COMPILED_CONTRACT_CLASS>

Compiled CASM contract class

Inherited from

ProviderInterface.getCompiledCasm

Defined in

src/provider/interface.ts:650


getEstimateTip

getEstimateTip(blockIdentifier?, options?): Promise<TipEstimate>

Get transaction tip estimation based on network analysis

Parameters

NameTypeDescription
blockIdentifier?BlockIdentifierblock identifier to analyze from
options?TipAnalysisOptionstip analysis options

Returns

Promise<TipEstimate>

Tip estimation with statistics

Example

const tipEstimate = await provider.getEstimateTip('latest', {
maxBlocks: 10,
minTxsNecessary: 5,
});
console.log('Recommended tip:', tipEstimate.recommendedTip);

Inherited from

ProviderInterface.getEstimateTip

Defined in

src/provider/interface.ts:668