Class: Account
Defined in: src/account/default.ts:102
Interface for interacting with Starknet account contracts
Provides 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
Extends
Extended by
Implements
Constructors
Constructor
new Account(
options):Account
Defined in: src/account/default.ts:125
Parameters
options
Returns
Account
Inherited from
StarknetIdAccountMethods.constructor
Properties
provider
provider:
RpcProvider
Defined in: src/account/default.ts:106
Provider instance for blockchain interaction
Implementation of
signer
signer:
SignerInterface
Defined in: src/account/default.ts:108
Signer instance for signing transactions and messages
Implementation of
address
address:
string
Defined in: src/account/default.ts:110
The address of the account contract on Starknet
Implementation of
cairoVersion
cairoVersion:
CairoVersion
Defined in: src/account/default.ts:112
Cairo version of the account contract implementation
Implementation of
transactionVersion
readonlytransactionVersion:"0x3"
Defined in: src/account/default.ts:114
paymaster
paymaster:
PaymasterInterface
Defined in: src/account/default.ts:116
deployer
deployer:
Deployer
Defined in: src/account/default.ts:118
Optional deployer instance for custom contract deployment logic
Default
Uses default UDC (Universal Deployer Contract) if not specified
Implementation of
defaultTipType
defaultTipType:
TipType
Defined in: src/account/default.ts:120
accountPluginManager
readonlyaccountPluginManager:PluginManager
Defined in: src/account/default.ts:123
Internal
Account-level plugin management
deploySelf
deploySelf: (
contractPayload,details) =>Promise<DeployContractResponse>
Defined in: src/account/default.ts:559
Execute one or multiple calls through the account contract
Parameters
contractPayload
Single call or array of calls to execute
- .contractAddress - Target contract address
- .entrypoint - Function to invoke on the contract
- .calldata - Function parameters
details?
UniversalDetails = {}
Transaction 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>
Transaction hash and response
Example
const deployment = await account.deployAccount({
classHash: accountClassHash,
constructorCalldata: { publicKey: pubKey },
addressSalt: pubKey,
});
Methods
getNonce()
getNonce(
blockIdentifier?):Promise<string>
Defined in: src/account/default.ts:161
Get the current nonce of the account
Parameters
blockIdentifier?
Block 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');
getNonceSafe()
protectedgetNonceSafe(nonce?):Promise<bigint>
Defined in: src/account/default.ts:165
Parameters
nonce?
Returns
Promise<bigint>
getCairoVersion()
getCairoVersion(
classHash?):Promise<CairoVersion>
Defined in: src/account/default.ts:178
Retrieves the Cairo version from the network and sets cairoVersion if not already set in the constructor.
Parameters
classHash?
string
if provided detects Cairo version from classHash, otherwise from the account address
Returns
Promise<CairoVersion>
estimateInvokeFee()
estimateInvokeFee(
calls,details?):Promise<EstimateFeeResponseOverhead>
Defined in: src/account/default.ts:188
Estimate fee for executing an INVOKE transaction on Starknet
Parameters
calls
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 [])
details?
UniversalDetails = {}
Returns
Promise<EstimateFeeResponseOverhead>
Fee estimation including overall_fee and resourceBounds
Example
const fee = await account.estimateInvokeFee({
contractAddress: '0x123...',
entrypoint: 'transfer',
calldata: [recipient, amount],
});
estimateDeclareFee()
estimateDeclareFee(
payload,details?):Promise<EstimateFeeResponseOverhead>
Defined in: src/account/default.ts:198
Estimate fee for executing a DECLARE transaction on Starknet
Parameters
payload
details?
UniversalDetails = {}
Returns
Promise<EstimateFeeResponseOverhead>
Fee estimation including overall_fee and resourceBounds
Example
const fee = await account.estimateDeclareFee({
contract: compiledContract,
casm: compiledCasm,
});
estimateAccountDeployFee()
estimateAccountDeployFee(
contractPayload,details?):Promise<EstimateFeeResponseOverhead>
Defined in: src/account/default.ts:217
Estimate fee for executing an INVOKE transaction on Starknet
Parameters
contractPayload
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 [])
details?
UniversalDetails = {}
Returns
Promise<EstimateFeeResponseOverhead>
Fee estimation including overall_fee and resourceBounds
Example
const fee = await account.estimateAccountDeployFee({
classHash: accountClassHash,
constructorCalldata: { publicKey },
addressSalt: publicKey,
});
estimateDeployFee()
estimateDeployFee(
payload,details?):Promise<EstimateFeeResponseOverhead>
Defined in: src/account/default.ts:247
Estimate fee for executing an INVOKE transaction on Starknet
Parameters
payload
UniversalDeployerContractPayload | 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 [])
details?
UniversalDetails = {}
Returns
Promise<EstimateFeeResponseOverhead>
Fee estimation including overall_fee and resourceBounds
Example
const fee = await account.estimateDeployFee({
classHash: contractClassHash,
constructorCalldata: [param1, param2],
unique: true,
});
estimateFeeBulk()
estimateFeeBulk(
invocations,details?):Promise<EstimateFeeBulk>
Defined in: src/account/default.ts:255
Estimate fee for executing an INVOKE transaction on Starknet
Parameters
invocations
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 [])
details?
UniversalDetails = {}
Returns
Promise<EstimateFeeBulk>
Fee estimation including overall_fee and resourceBounds
Example
const fees = await account.estimateFeeBulk([
{ type: 'INVOKE', payload: { contractAddress, entrypoint, calldata } },
{ type: 'DECLARE', payload: { contract, casm } },
]);
simulateTransaction()
simulateTransaction(
invocations,details?):Promise<SimulateTransactionOverheadResponse>
Defined in: src/account/default.ts:285
Parameters
invocations
details?
SimulateTransactionDetails = {}
Returns
Promise<SimulateTransactionOverheadResponse>
execute()
execute(
transactions,transactionsDetail?):Promise<{transaction_hash:string; }>
Defined in: src/account/default.ts:365
Execute one or multiple calls through the account contract
Parameters
transactions
Single call or array of calls to execute
- .contractAddress - Target contract address
- .entrypoint - Function to invoke on the contract
- .calldata - Function parameters
transactionsDetail?
UniversalDetails = {}
Transaction 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] },
]);
getSignedTransaction()
getSignedTransaction(
transactions,transactionsDetail?):Promise<INVOKE_TXN_V3>
Defined in: src/account/default.ts:420
Build a signed INVOKE_TXN_V3 transaction without submitting it to the network.
Produces a fully signed transaction object that can be inspected, stored,
or submitted later via provider.channel.sendTransaction().
Main usage is to send a virtual transaction to a proof server.
Fees are estimated automatically if not provided.
Parameters
transactions
Single call or array of calls to include in the transaction
transactionsDetail?
UniversalDetails = {}
Transaction execution options
Returns
Promise<INVOKE_TXN_V3>
A fully signed RPC.INVOKE_TXN_V3 object, ready to broadcast
Remarks
- Unlike
execute(), this method does not submit the transaction ; the account nonce is unchanged after the call. - The
afterExecuteplugin hook is intentionally not triggered. - The returned object can be broadcast with
provider.channel.sendTransaction().
Example
const signedTx = await account.getSignedTransaction({
contractAddress: erc20Address,
entrypoint: 'transfer',
calldata: [recipient, amount, 0],
});
declareIfNot()
declareIfNot(
payload,transactionsDetail?):Promise<{class_hash:string;transaction_hash:string; }>
Defined in: src/account/default.ts:451
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
payload
transactionsDetail?
UniversalDetails = {}
(optional)
Returns
Promise<{ class_hash: string; transaction_hash: string; }>
declare()
declare(
payload,details?):Promise<{class_hash:string;transaction_hash:string; }>
Defined in: src/account/default.ts:470
Execute one or multiple calls through the account contract
Parameters
payload
Single call or array of calls to execute
- .contractAddress - Target contract address
- .entrypoint - Function to invoke on the contract
- .calldata - Function parameters
details?
UniversalDetails = {}
Transaction 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; }>
Transaction hash and response
Example
const declareResult = await account.declare({
contract: compiledSierra,
casm: compiledCasm,
});
deploy()
deploy(
payload,details?):Promise<MultiDeployContractResponse>
Defined in: src/account/default.ts:519
Execute one or multiple calls through the account contract
Parameters
payload
UniversalDeployerContractPayload | UniversalDeployerContractPayload[]
Single call or array of calls to execute
- .contractAddress - Target contract address
- .entrypoint - Function to invoke on the contract
- .calldata - Function parameters
details?
UniversalDetails = {}
Transaction 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>
Transaction hash and response
Example
const deployment = await account.deploy([
{ classHash: erc20ClassHash, constructorCalldata: [name, symbol] },
{ classHash: nftClassHash, unique: true },
]);
deployContract()
deployContract(
payload,details?):Promise<DeployContractUDCResponse>
Defined in: src/account/default.ts:532
Execute one or multiple calls through the account contract
Parameters
payload
UniversalDeployerContractPayload | UniversalDeployerContractPayload[]
Single call or array of calls to execute
- .contractAddress - Target contract address
- .entrypoint - Function to invoke on the contract
- .calldata - Function parameters
details?
UniversalDetails & waitForTransactionOptions = {}
Transaction 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>
Transaction hash and response
Example
const result = await account.deployContract({
classHash: contractClassHash,
constructorCalldata: params,
});
console.log('Deployed at:', result.address);
declareAndDeploy()
declareAndDeploy(
payload,details?):Promise<DeclareDeployUDCResponse>
Defined in: src/account/default.ts:543
Execute one or multiple calls through the account contract
Parameters
payload
DeclareAndDeployContractPayload
Single call or array of calls to execute
- .contractAddress - Target contract address
- .entrypoint - Function to invoke on the contract
- .calldata - Function parameters
details?
UniversalDetails & waitForTransactionOptions = {}
Transaction 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>
Transaction hash and response
Example
const result = await account.declareAndDeploy({
contract: compiledContract,
casm: compiledCasm,
constructorCalldata: [param1, param2],
});
deployAccount()
deployAccount(
contractPayload,details?):Promise<DeployContractResponse>
Defined in: src/account/default.ts:561
Execute one or multiple calls through the account contract
Parameters
contractPayload
Single call or array of calls to execute
- .contractAddress - Target contract address
- .entrypoint - Function to invoke on the contract
- .calldata - Function parameters
details?
UniversalDetails = {}
Transaction 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>
Transaction hash and response
Example
const deployment = await account.deployAccount({
classHash: accountClassHash,
constructorCalldata: { publicKey: pubKey },
addressSalt: pubKey,
});
signMessage()
signMessage(
typedData):Promise<Signature>
Defined in: src/account/default.ts:632
Sign a typed data message for off-chain verification
Parameters
typedData
EIP-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!' }
});
hashMessage()
hashMessage(
typedData):Promise<string>
Defined in: src/account/default.ts:648
Hash a typed data message using Pedersen hash
Parameters
typedData
EIP-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);
getSnip9Version()
getSnip9Version():
Promise<"0"|"1"|"2">
Defined in: src/account/default.ts:661
Verify if an account is compatible with SNIP-9 outside execution, and with which version of this standard.
Returns
Promise<"0" | "1" | "2">
Not compatible, V1, V2.
Example
const result = myAccount.getSnip9Version();
// result = "V1"
isValidSnip9Nonce()
isValidSnip9Nonce(
nonce):Promise<boolean>
Defined in: src/account/default.ts:682
Verify if a SNIP-9 nonce has not yet been used by the account.
Parameters
nonce
SNIP-9 nonce to test.
Returns
Promise<boolean>
true if SNIP-9 nonce not yet used.
Example
const result = myAccount.isValidSnip9Nonce(1234);
// result = true
getSnip9Nonce()
getSnip9Nonce():
Promise<string>
Defined in: src/account/default.ts:706
Outside transaction needs a specific SNIP-9 nonce, that we get in this function. A SNIP-9 nonce can be any number not yet used ; no ordering is needed.
Returns
Promise<string>
an Hex string of a SNIP-9 nonce.
Example
const result = myAccount.getSnip9Nonce();
// result = "0x28a612590dbc36927933c8ee0f357eee639c8b22b3d3aa86949eed3ada4ac55"
getOutsideTransaction()
getOutsideTransaction(
options,calls,version?,nonce?):Promise<OutsideTransaction>
Defined in: src/account/default.ts:743
Creates an object containing transaction(s) that can be executed by an other account with Account.executeFromOutside(), called Outside Transaction.
Parameters
options
Parameters of the transaction(s).
calls
Transaction(s) to execute.
version?
"0" | "1" | "2"
SNIP-9 version of the Account that creates the outside transaction.
nonce?
Outside Nonce.
Returns
Promise<OutsideTransaction>
and object that can be used in Account.executeFromOutside()
Example
const now_seconds = Math.floor(Date.now() / 1000);
const callOptions: OutsideExecutionOptions = {
caller: executorAccount.address,
execute_after: now_seconds - 3600,
execute_before: now_seconds + 3600,
};
const call1: Call = {
contractAddress: ethAddress,
entrypoint: 'transfer',
calldata: {
recipient: recipientAccount.address,
amount: cairo.uint256(100),
},
};
const outsideTransaction1: OutsideTransaction = await signerAccount.getOutsideTransaction(
callOptions,
call3
);
// result = {
// outsideExecution: {
// caller: '0x64b48806902a367c8598f4f95c305e8c1a1acba5f082d294a43793113115691',
// nonce: '0x28a612590dbc36927933c8ee0f357eee639c8b22b3d3aa86949eed3ada4ac55',
// execute_after: 1723650229, execute_before: 1723704229, calls: [[Object]] },
// signature: Signature {
// r: 67518627037915514985321278857825384106482999609634873287406612756843916814n,
// s: 737198738569840639192844101690009498983611654458636624293579534560862067709n, recovery: 0 },
// signerAddress: '0x655f8fd7c4013c07cf12a92184aa6c314d181443913e21f7e209a18f0c78492',
// version: '2'
// }
executeFromOutside()
executeFromOutside(
outsideTransaction,opts?):Promise<{transaction_hash:string; }>
Defined in: src/account/default.ts:803
An account B executes a transaction that has been signed by an account A. Fees are paid by B.
Parameters
outsideTransaction
AllowArray<OutsideTransaction>
the signed transaction generated by Account.getOutsideTransaction().
opts?
same options than Account.execute().
Returns
Promise<{ transaction_hash: string; }>
same response than Account.execute().
Example
const outsideTransaction1: OutsideTransaction = await signerAccount.getOutsideTransaction(
callOptions,
call1
);
const outsideTransaction2: OutsideTransaction = await signerAccount.getOutsideTransaction(
callOptions4,
call4
);
const result = await myAccount.executeFromOutside([outsideTransaction1, outsideTransaction2]);
// result = { transaction_hash: '0x11233...`}
buildInvocation()
buildInvocation(
call,details):Promise<Invocation>
Defined in: src/account/default.ts:839
Parameters
call
Call[]
details
Returns
Promise<Invocation>
buildDeclarePayload()
buildDeclarePayload(
payload,details):Promise<DeclareContractTransaction>
Defined in: src/account/default.ts:854
Parameters
payload
details
Returns
Promise<DeclareContractTransaction>
buildAccountDeployPayload()
buildAccountDeployPayload(
__namedParameters,details):Promise<DeployAccountContractTransaction>
Defined in: src/account/default.ts:889
Parameters
__namedParameters
details
Returns
Promise<DeployAccountContractTransaction>
buildPaymasterTransaction()
buildPaymasterTransaction(
calls,paymasterDetails):Promise<PreparedTransaction>
Defined in: src/account/default.ts:1042
Estimate fees for a paymaster-sponsored transaction
Parameters
calls
Call[]
Array of calls to be sponsored
- .contractAddress - Target contract address
- .entrypoint - Function to invoke
- .calldata - Function parameters
paymasterDetails
Paymaster configuration
- .feeMode - Sponsorship mode: 'sponsored' or gas token
- .deploymentData - Account deployment data if needed
- .timeBounds - Valid execution time window
Returns
Promise<PreparedTransaction>
Fee estimates in both STRK and gas token
Example
const prepared = await account.buildPaymasterTransaction(calls, {
feeMode: { mode: 'default', gasToken: ETH_ADDRESS },
});
estimatePaymasterTransactionFee()
estimatePaymasterTransactionFee(
calls,paymasterDetails):Promise<PaymasterFeeEstimate>
Defined in: src/account/default.ts:1081
Estimate fees for a paymaster-sponsored transaction
Parameters
calls
Call[]
Array of calls to be sponsored
- .contractAddress - Target contract address
- .entrypoint - Function to invoke
- .calldata - Function parameters
paymasterDetails
Paymaster 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' } }
);
preparePaymasterTransaction()
preparePaymasterTransaction(
preparedTransaction):Promise<ExecutableUserTransaction>
Defined in: src/account/default.ts:1089
Parameters
preparedTransaction
Returns
Promise<ExecutableUserTransaction>
executePaymasterTransaction()
executePaymasterTransaction(
calls,paymasterDetails,maxFeeInGasToken?):Promise<{transaction_hash:string; }>
Defined in: src/account/default.ts:1132
Execute a paymaster-sponsored transaction
Parameters
calls
Call[]
Array of calls to execute
paymasterDetails
Paymaster configuration
- .feeMode - 'sponsored' or gas token payment
- .deploymentData - Deploy account if needed
- .timeBounds - Execution validity window (UNIX timestamps)
maxFeeInGasToken?
Maximum 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
);
getStarkName()
getStarkName(
address?,StarknetIdContract?):Promise<string>
Defined in: src/plugins/starknet-id/index.ts:40
Parameters
address?
StarknetIdContract?
string
Returns
Promise<string>
Inherited from
StarknetIdAccountMethods.getStarkName
getAddressFromStarkName()
getAddressFromStarkName(
name,StarknetIdContract?):Promise<string>
Defined in: src/plugins/starknet-id/index.ts:41
Parameters
name
string
StarknetIdContract?
string
Returns
Promise<string>
Inherited from
StarknetIdAccountMethods.getAddressFromStarkName
getStarkProfile()
getStarkProfile(
address,StarknetIdContract?,StarknetIdIdentityContract?,StarknetIdVerifierContract?,StarknetIdPfpContract?,StarknetIdPopContract?,StarknetIdMulticallContract?):Promise<StarkProfile>
Defined in: src/plugins/starknet-id/index.ts:42
Parameters
address
StarknetIdContract?
string
StarknetIdIdentityContract?
string
StarknetIdVerifierContract?
string
StarknetIdPfpContract?
string
StarknetIdPopContract?
string
StarknetIdMulticallContract?
string
Returns
Promise<StarkProfile>
Inherited from
StarknetIdAccountMethods.getStarkProfile
getBrotherName()
getBrotherName(
address,BrotherIdContract?):Promise<string>
Defined in: src/plugins/brother-id/index.ts:47
Parameters
address
BrotherIdContract?
string
Returns
Promise<string>
Inherited from
BrotherIdProviderMethods.getBrotherName
getAddressFromBrotherName()
getAddressFromBrotherName(
name,BrotherIdContract?):Promise<string>
Defined in: src/plugins/brother-id/index.ts:48
Parameters
name
string
BrotherIdContract?
string
Returns
Promise<string>
Inherited from
BrotherIdProviderMethods.getAddressFromBrotherName
getBrotherProfile()
getBrotherProfile(
address,BrotherIdContract?):Promise<BrotherProfile>
Defined in: src/plugins/brother-id/index.ts:49
Parameters
address
BrotherIdContract?
string
Returns
Promise<BrotherProfile>
Inherited from
BrotherIdProviderMethods.getBrotherProfile
fastExecute()
fastExecute(
transactions,transactionsDetail?,waitDetail?):Promise<FastExecuteResponse>
Defined in: src/plugins/fast-execute/types.ts:119
Execute one or multiple calls through the account contract, responding as soon as a new transaction is possible with the same account. Useful for gaming usage where rapid consecutive transactions are needed.
This method requires the provider to be initialized with pre_confirmed blockIdentifier option.
RPC 0.9 minimum.
In a normal account.execute() call followed by provider.waitForTransaction(), you have immediate access
to the events and transaction report. Here, we process consecutive transactions faster, but events and
transaction reports are not available immediately.
As a consequence of the above, do not use contract/account deployment with this method.
Parameters
transactions
any
Single call or array of calls to execute
transactionsDetail?
any
Transaction execution options
waitDetail?
Options to scan the
network for the next possible transaction. retries is the number of times to retry (default: 50),
retryInterval is the time in ms between retries (default: 500).
Returns
Promise<FastExecuteResponse>
Response containing the transaction result and status for the next
transaction. If isReady is true, you can execute the next transaction immediately. If false,
timeout has been reached before the next transaction was possible.
Example
const myProvider = new RpcProvider({
nodeUrl: url,
blockIdentifier: BlockTag.PRE_CONFIRMED,
});
const myAccount = new Account({
provider: myProvider,
address: accountAddress0,
signer: privateKey0,
});
const resp = await myAccount.fastExecute(
call,
{ tip: recommendedTip },
{ retries: 30, retryInterval: 500 }
);
// if resp.isReady is true, you can launch immediately a new tx
if (resp.isReady) {
// send next transaction
}