Class: WalletAccount
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
-
↳
WalletAccount
Implements
Constructors
constructor
• new WalletAccount(options): WalletAccount
Parameters
| Name | Type |
|---|---|
options | WalletAccountOptions |
Returns
Overrides
Defined in
Properties
walletProvider
• walletProvider: StarknetWalletProvider
Defined in
signer
• signer: SignerInterface
Signer instance for signing transactions and messages
Implementation of
Inherited from
Defined in
address
• address: string
The address of the account contract on Starknet
Implementation of
Inherited from
Defined in
cairoVersion
• cairoVersion: CairoVersion
Cairo version of the account contract implementation
Implementation of
Inherited from
Defined in
transactionVersion
• Readonly transactionVersion: "0x3"
Inherited from
Defined in
paymaster
• paymaster: PaymasterInterface
Inherited from
Defined in
deployer
• deployer: Deployer
Optional deployer instance for custom contract deployment logic
Default
Uses default UDC (Universal Deployer Contract) if not specified
Implementation of
Inherited from
Defined in
defaultTipType
• defaultTipType: TipType
Inherited from
Defined in
deploySelf
• deploySelf: (__namedParameters: DeployAccountContractPayload, details: UniversalDetails) => Promise<DeployContractResponse>
Type declaration
▸ («destructured», details?): Promise<DeployContractResponse>
Parameters
| Name | Type |
|---|---|
«destructured» | DeployAccountContractPayload |
details | UniversalDetails |
Returns
Promise<DeployContractResponse>
Inherited from
Defined in
responseParser
• responseParser: RPCResponseParser
Implementation of
AccountInterface.responseParser
Inherited from
Defined in
channel
• channel: RpcChannel | RpcChannel
Implementation of
Inherited from
Defined in
getStateUpdate
• getStateUpdate: () => 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 }[] } }>(blockIdentifier: "pre_confirmed") => Promise<PRE_CONFIRMED_STATE_UPDATE>(blockIdentifier: "latest") => 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 }[] } }>(blockIdentifier?: BlockIdentifier) => Promise<StateUpdateResponse>
Type declaration
▸ (): 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 }[] } }>
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 }[] } }>
▸ (blockIdentifier): Promise<PRE_CONFIRMED_STATE_UPDATE>
Parameters
| Name | Type |
|---|---|
blockIdentifier | "pre_confirmed" |
Returns
Promise<PRE_CONFIRMED_STATE_UPDATE>
▸ (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 }[] } }>
Parameters
| Name | Type |
|---|---|
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 }[] } }>
▸ (blockIdentifier?): Promise<StateUpdateResponse>
Parameters
| Name | Type |
|---|---|
blockIdentifier? | BlockIdentifier |
Returns
Promise<StateUpdateResponse>
Implementation of
AccountInterface.getStateUpdate
Inherited from
Defined in
Methods
connect
▸ connect(provider, walletProvider, cairoVersion?, paymaster?, silentMode?): Promise<WalletAccount>
Parameters
| Name | Type | Default value |
|---|---|---|
provider | ProviderOptions | ProviderInterface | undefined |
walletProvider | StarknetWalletProvider | undefined |
cairoVersion? | CairoVersion | undefined |
paymaster? | PaymasterOptions | PaymasterInterface | undefined |
silentMode | boolean | false |
Returns
Promise<WalletAccount>
Defined in
connectSilent
▸ connectSilent(provider, walletProvider, cairoVersion?, paymaster?): Promise<WalletAccount>
Parameters
| Name | Type |
|---|---|
provider | ProviderInterface |
walletProvider | StarknetWalletProvider |
cairoVersion? | CairoVersion |
paymaster? | PaymasterOptions | PaymasterInterface |
Returns
Promise<WalletAccount>
Defined in
getStarkName
▸ getStarkName(provider, address, StarknetIdContract?): Promise<string>
Parameters
| Name | Type |
|---|---|
provider | ProviderInterface |
address | BigNumberish |
StarknetIdContract? | string |
Returns
Promise<string>
Inherited from
Defined in
src/provider/extensions/starknetId.ts:62
getAddressFromStarkName
▸ getAddressFromStarkName(provider, name, StarknetIdContract?): Promise<string>
Parameters
| Name | Type |
|---|---|
provider | ProviderInterface |
name | string |
StarknetIdContract? | string |
Returns
Promise<string>
Inherited from
Account.getAddressFromStarkName
Defined in
src/provider/extensions/starknetId.ts:96
getStarkProfile
▸ getStarkProfile(provider, address, StarknetIdContract?, StarknetIdIdentityContract?, StarknetIdVerifierContract?, StarknetIdPfpContract?, StarknetIdPopContract?, StarknetIdMulticallContract?): Promise<StarkProfile>
Parameters
| Name | Type |
|---|---|
provider | ProviderInterface |
address | BigNumberish |
StarknetIdContract? | string |
StarknetIdIdentityContract? | string |
StarknetIdVerifierContract? | string |
StarknetIdPfpContract? | string |
StarknetIdPopContract? | string |
StarknetIdMulticallContract? | string |
Returns
Promise<StarkProfile>
Inherited from
Defined in
src/provider/extensions/starknetId.ts:128
getBrotherName
▸ getBrotherName(provider, address, BrotherIdContract?): Promise<string>
Static implementation of getBrotherName
Parameters
| Name | Type | Description |
|---|---|---|
provider | ProviderInterface | The provider interface |
address | BigNumberish | The address to get the domain for |
BrotherIdContract? | string | Optional contract address |
Returns
Promise<string>
The domain name with .brother suffix
Inherited from
Defined in
src/provider/extensions/brotherId.ts:148
getAddressFromBrotherName
▸ getAddressFromBrotherName(provider, name, BrotherIdContract?): Promise<string>
Static implementation of getAddressFromBrotherName
Parameters
| Name | Type | Description |
|---|---|---|
provider | ProviderInterface | The provider interface |
name | string | The domain name |
BrotherIdContract? | string | Optional contract address |
Returns
Promise<string>
The resolver address
Inherited from
Account.getAddressFromBrotherName
Defined in
src/provider/extensions/brotherId.ts:186
getBrotherProfile
▸ getBrotherProfile(provider, address, BrotherIdContract?): Promise<BrotherProfile>
Static implementation of getBrotherProfile
Parameters
| Name | Type | Description |
|---|---|---|
provider | ProviderInterface | The provider interface |
address | BigNumberish | The address to get the profile for |
BrotherIdContract? | string | Optional contract address |
Returns
Promise<BrotherProfile>
The complete Brother profile
Inherited from
Defined in
src/provider/extensions/brotherId.ts:226
onAccountChange
▸ onAccountChange(callback): void
WALLET EVENTS
Parameters
| Name | Type |
|---|---|
callback | AccountChangeEventHandler |
Returns
void
Defined in
onNetworkChanged
▸ onNetworkChanged(callback): void
Parameters
| Name | Type |
|---|---|
callback | NetworkChangeEventHandler |
Returns
void
Defined in
requestAccounts
▸ requestAccounts(silentMode?): Promise<string[]>
WALLET SPECIFIC METHODS
Parameters
| Name | Type | Default value |
|---|---|---|
silentMode | boolean | false |
Returns
Promise<string[]>
Defined in
getPermissions
▸ getPermissions(): Promise<"accounts"[]>
Returns
Promise<"accounts"[]>
Defined in
switchStarknetChain
▸ switchStarknetChain(chainId): Promise<boolean>
Parameters
| Name | Type |
|---|---|
chainId | "0x534e5f4d41494e" | "0x534e5f5345504f4c4941" |
Returns
Promise<boolean>
Defined in
watchAsset
▸ watchAsset(asset): Promise<boolean>
Parameters
| Name | Type |
|---|---|
asset | WatchAssetParameters |
Returns
Promise<boolean>
Defined in
addStarknetChain
▸ addStarknetChain(chain): Promise<boolean>
Parameters
| Name | Type |
|---|---|
chain | AddStarknetChainParameters |
Returns
Promise<boolean>
Defined in
execute
▸ execute(calls): Promise<AddInvokeTransactionResult>
ACCOUNT METHODS
Parameters
| Name | Type |
|---|---|
calls | AllowArray<Call> |
Returns
Promise<AddInvokeTransactionResult>
Implementation of
Overrides
Defined in
declare
▸ declare(payload): Promise<AddDeclareTransactionResult>
ACCOUNT METHODS
Parameters
| Name | Type |
|---|---|
payload | DeclareContractPayload |
Returns
Promise<AddDeclareTransactionResult>
Declaration transaction hash and class hash
Example
const declareResult = await account.declare({
contract: compiledSierra,
casm: compiledCasm,
});
Implementation of
Overrides
Defined in
deploy
▸ deploy(payload): Promise<MultiDeployContractResponse>
ACCOUNT METHODS
Parameters
| Name | Type |
|---|---|
payload | UniversalDeployerContractPayload | UniversalDeployerContractPayload[] |
Returns
Promise<MultiDeployContractResponse>
Deployed contract addresses and transaction hash
Example
const deployment = await account.deploy([
{ classHash: erc20ClassHash, constructorCalldata: [name, symbol] },
{ classHash: nftClassHash, unique: true },
]);
Implementation of
Overrides
Defined in
signMessage
▸ signMessage(typedData): Promise<SIGNATURE>
Sign a typed data message for off-chain verification
Parameters
| Name | Type | Description |
|---|---|---|
typedData | 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!' }
});
Implementation of
Overrides
Defined in
getNonce
▸ getNonce(blockIdentifier?): Promise<string>
Get the current nonce of the account
Parameters
| Name | Type | Description |
|---|---|---|
blockIdentifier? | BlockIdentifier | Block to query nonce at (default: 'pending') |
Returns
Promise<string>
Account nonce as hex string
Example
const nonce = await account.getNonce();
const historicalNonce = await account.getNonce('latest');
Implementation of
Inherited from
Defined in
getNonceSafe
▸ getNonceSafe(nonce?): Promise<bigint>
Parameters
| Name | Type |
|---|---|
nonce? | BigNumberish |
Returns
Promise<bigint>
Inherited from
Defined in
getCairoVersion
▸ getCairoVersion(classHash?): Promise<CairoVersion>
Retrieves the Cairo version from the network and sets cairoVersion if not already set in the constructor.
Parameters
| Name | Type | Description |
|---|---|---|
classHash? | string | if provided detects Cairo version from classHash, otherwise from the account address |
Returns
Promise<CairoVersion>
Inherited from
Defined in
estimateInvokeFee
▸ estimateInvokeFee(calls, details?): Promise<EstimateFeeResponseOverhead>
Estimate fee for executing an INVOKE transaction on Starknet
Parameters
| Name | Type | Description |
|---|---|---|
calls | AllowArray<Call> | Single call or array of calls to estimate fees for |
details | UniversalDetails | Optional details for fee estimation |
Returns
Promise<EstimateFeeResponseOverhead>
Fee estimation including overall_fee and resourceBounds
Example
const fee = await account.estimateInvokeFee({
contractAddress: '0x123...',
entrypoint: 'transfer',
calldata: [recipient, amount],
});
Implementation of
AccountInterface.estimateInvokeFee
Inherited from
Defined in
estimateDeclareFee
▸ estimateDeclareFee(payload, details?): Promise<EstimateFeeResponseOverhead>
Estimate fee for executing a DECLARE transaction on Starknet
Parameters
| Name | Type | Description |
|---|---|---|
payload | DeclareContractPayload | Contract declaration payload |
details | UniversalDetails | Optional details for fee estimation |
Returns
Promise<EstimateFeeResponseOverhead>
Fee estimation including overall_fee and resourceBounds
Example
const fee = await account.estimateDeclareFee({
contract: compiledContract,
casm: compiledCasm,
});
Implementation of
AccountInterface.estimateDeclareFee
Inherited from
Defined in
estimateAccountDeployFee
▸ estimateAccountDeployFee(«destructured», details?): Promise<EstimateFeeResponseOverhead>
Estimate fee for executing an INVOKE transaction on Starknet
Parameters
| Name | Type | Description |
|---|---|---|
«destructured» | DeployAccountContractPayload | Single call or array of calls to estimate fees for |
details | UniversalDetails | Optional details for fee estimation |
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,
});
Implementation of
AccountInterface.estimateAccountDeployFee
Inherited from
Account.estimateAccountDeployFee
Defined in
estimateDeployFee
▸ estimateDeployFee(payload, details?): Promise<EstimateFeeResponseOverhead>
Estimate fee for executing an INVOKE transaction on Starknet
Parameters
| Name | Type | Description |
|---|---|---|
payload | UniversalDeployerContractPayload | UniversalDeployerContractPayload[] | Single call or array of calls to estimate fees for |
details | UniversalDetails | Optional details for fee estimation |
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,
});
Implementation of
AccountInterface.estimateDeployFee
Inherited from
Defined in
estimateFeeBulk
▸ estimateFeeBulk(invocations, details?): Promise<EstimateFeeBulk>
Estimate fee for executing an INVOKE transaction on Starknet
Parameters
| Name | Type | Description |
|---|---|---|
invocations | Invocations | Single call or array of calls to estimate fees for |
details | UniversalDetails | Optional details for fee estimation |
Returns
Promise<EstimateFeeBulk>
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 } },
]);
Implementation of
AccountInterface.estimateFeeBulk
Inherited from
Defined in
simulateTransaction
▸ simulateTransaction(invocations, details?): Promise<SimulateTransactionOverheadResponse>
Parameters
| Name | Type |
|---|---|
invocations | Invocations |
details | SimulateTransactionDetails |
Returns
Promise<SimulateTransactionOverheadResponse>
Inherited from
Defined in
fastExecute
▸ fastExecute(transactions, transactionsDetail?, waitDetail?): Promise<fastExecuteResponse>
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.
- This method requires the provider to be initialized with
pre_confirmedblockIdentifier option. - Rpc 0.9 minimum.
- In a normal myAccount.execute() call, followed by myProvider.waitForTransaction(), you have an immediate access to the events and to the transaction report. Here, we are processing consecutive transactions faster, but events & transaction reports are not available immediately.
- As a consequence of the previous point, do not use contract/account deployment with this method.
Parameters
| Name | Type | Description |
|---|---|---|
transactions | AllowArray<Call> | Single call or array of calls to execute |
transactionsDetail? | UniversalDetails | Transaction execution options |
waitDetail? | fastWaitForTransactionOptions | options to scan the network for the next possible transaction. retries is the number of times to retry, retryInterval is the time in ms between retries. |
Returns
Promise<fastExecuteResponse>
Response containing the transaction result and status for the next transaction. If isReady is true, you can execute the next transaction. 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.
Inherited from
Defined in
declareIfNot
▸ declareIfNot(payload, transactionsDetail?): Promise<{ class_hash: string ; transaction_hash: string }>
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 | - |
transactionsDetail | UniversalDetails | (optional) |
Returns
Promise<{ class_hash: string ; transaction_hash: string }>
Implementation of
Inherited from
Defined in
deployContract
▸ deployContract(payload, details?): Promise<DeployContractUDCResponse>
ACCOUNT METHODS
Parameters
| Name | Type | Description |
|---|---|---|
payload | UniversalDeployerContractPayload | UniversalDeployerContractPayload[] | |
details | UniversalDetails & waitForTransactionOptions | Transaction execution options |
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);
Implementation of
AccountInterface.deployContract
Inherited from
Defined in
declareAndDeploy
▸ declareAndDeploy(payload, details?): Promise<DeclareDeployUDCResponse>
ACCOUNT METHODS
Parameters
| Name | Type | Description |
|---|---|---|
payload | DeclareAndDeployContractPayload | |
details | UniversalDetails & waitForTransactionOptions | Transaction execution options |
Returns
Promise<DeclareDeployUDCResponse>
Declaration and deployment results
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],
});
Implementation of
AccountInterface.declareAndDeploy
Inherited from
Defined in
deployAccount
▸ deployAccount(«destructured», details?): Promise<DeployContractResponse>
ACCOUNT METHODS
Parameters
| Name | Type | Description |
|---|---|---|
«destructured» | DeployAccountContractPayload | |
details | UniversalDetails | Transaction execution options |
Returns
Promise<DeployContractResponse>
Deployment transaction hash and contract address
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,
});
Implementation of
AccountInterface.deployAccount
Inherited from
Defined in
hashMessage
▸ hashMessage(typedData): Promise<string>
Hash a typed data message using Pedersen hash
Parameters
| Name | Type | Description |
|---|---|---|
typedData | 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);
Implementation of
Inherited from
Defined in
getSnip9Version
▸ getSnip9Version(): Promise<"0" | "1" | "2">
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"
Inherited from
Defined in
isValidSnip9Nonce
▸ isValidSnip9Nonce(nonce): Promise<boolean>
Verify if a SNIP-9 nonce has not yet been used by the account.
Parameters
| Name | Type | Description |
|---|---|---|
nonce | BigNumberish | SNIP-9 nonce to test. |
Returns
Promise<boolean>
true if SNIP-9 nonce not yet used.
Example
const result = myAccount.isValidSnip9Nonce(1234);
// result = true
Inherited from
Defined in
getSnip9Nonce
▸ getSnip9Nonce(): Promise<string>
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"
Inherited from
Defined in
getOutsideTransaction
▸ getOutsideTransaction(options, calls, version?, nonce?): Promise<OutsideTransaction>
Creates an object containing transaction(s) that can be executed by an other account with Account.executeFromOutside(), called Outside Transaction.
Parameters
| Name | Type | Description |
|---|---|---|
options | OutsideExecutionOptions | Parameters of the transaction(s). |
calls | AllowArray<Call> | Transaction(s) to execute. |
version? | "0" | "1" | "2" | SNIP-9 version of the Account that creates the outside transaction. |
nonce? | BigNumberish | 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'
// }
Inherited from
Defined in
executeFromOutside
▸ executeFromOutside(outsideTransaction, opts?): Promise<{ transaction_hash: string }>
An account B executes a transaction that has been signed by an account A. Fees are paid by B.
Parameters
| Name | Type | Description |
|---|---|---|
outsideTransaction | AllowArray<OutsideTransaction> | the signed transaction generated by Account.getOutsideTransaction(). |
opts? | UniversalDetails | 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...`}
Inherited from
Defined in
buildInvocation
▸ buildInvocation(call, details): Promise<Invocation>
Parameters
| Name | Type |
|---|---|
call | Call[] |
details | InvocationsSignerDetails |
Returns
Promise<Invocation>
Inherited from
Defined in
buildDeclarePayload
▸ buildDeclarePayload(payload, details): Promise<DeclareContractTransaction>
Parameters
| Name | Type |
|---|---|
payload | DeclareContractPayload |
details | InvocationsSignerDetails |
Returns
Promise<DeclareContractTransaction>
Inherited from
Defined in
buildAccountDeployPayload
▸ buildAccountDeployPayload(«destructured», details): Promise<DeployAccountContractTransaction>
Parameters
| Name | Type |
|---|---|
«destructured» | DeployAccountContractPayload |
details | InvocationsSignerDetails |
Returns
Promise<DeployAccountContractTransaction>
Inherited from
Account.buildAccountDeployPayload
Defined in
accountInvocationsFactory
▸ accountInvocationsFactory(invocations, details): Promise<[{ type: "INVOKE" } & CallDetails & { signature?: Signature | undefined; } & InvocationsDetailsWithNonce]>
Build account invocations with proper typing based on transaction type
Parameters
| Name | Type |
|---|---|
invocations | [{ type: "INVOKE" ; payload: AllowArray<Call> }] |
details | AccountInvocationsFactoryDetails |
Returns
Promise<[{ type: "INVOKE" } & CallDetails & { signature?: Signature | undefined; } & InvocationsDetailsWithNonce]>
Inherited from
Account.accountInvocationsFactory
Defined in
▸ accountInvocationsFactory(invocations, details): Promise<[{ type: "DECLARE" } & DeclareContractTransaction & InvocationsDetailsWithNonce]>
Parameters
| Name | Type |
|---|---|
invocations | [{ type: "DECLARE" ; payload: DeclareContractPayload }] |
details | AccountInvocationsFactoryDetails |
Returns
Promise<[{ type: "DECLARE" } & DeclareContractTransaction & InvocationsDetailsWithNonce]>
Inherited from
Account.accountInvocationsFactory
Defined in
▸ accountInvocationsFactory(invocations, details): Promise<[{ type: "DEPLOY_ACCOUNT" } & Omit<DeployAccountContractPayload, "contractAddress"> & { signature?: Signature | undefined; } & InvocationsDetailsWithNonce]>
Parameters
| Name | Type |
|---|---|
invocations | [{ type: "DEPLOY_ACCOUNT" ; payload: DeployAccountContractPayload }] |
details | AccountInvocationsFactoryDetails |
Returns
Promise<[{ type: "DEPLOY_ACCOUNT" } & Omit<DeployAccountContractPayload, "contractAddress"> & { signature?: Signature | undefined; } & InvocationsDetailsWithNonce]>
Inherited from
Account.accountInvocationsFactory