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 | WalletAccountV4Options |
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 }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: string }[] } }>(blockIdentifier: "pre_confirmed") => 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 }>(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 }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: 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 }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: 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 }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: string }[] } }>
▸ (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
| Name | Type |
|---|---|
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 }>
▸ (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
| 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 }[] ; migrated_compiled_classes: undefined | { class_hash: string ; compiled_class_hash: 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