Class: WalletAccountV6
Defined in: src/wallet/accountV6.ts:33
WalletAccountV6 class. Extends WalletAccountV5 with get-starknet v6 types and STRK20 privacy protocol methods.
Extends
Constructors
Constructor
new WalletAccountV6(
options):WalletAccountV6
Defined in: src/wallet/accountV6.ts:34
Parameters
options
WalletAccountV6Options
Returns
WalletAccountV6
Overrides
Properties
walletProvider
walletProvider:
WalletWithStarknetFeatures
Defined in: src/wallet/accountV5.ts:50
Inherited from
WalletAccountV5.walletProvider
provider
provider:
RpcProvider
Defined in: src/account/default.ts:106
Provider instance for blockchain interaction
Inherited from
signer
signer:
SignerInterface
Defined in: src/account/default.ts:108
Signer instance for signing transactions and messages
Inherited from
address
address:
string
Defined in: src/account/default.ts:110
The address of the account contract on Starknet
Inherited from
cairoVersion
cairoVersion:
CairoVersion
Defined in: src/account/default.ts:112
Cairo version of the account contract implementation
Inherited from
transactionVersion
readonlytransactionVersion:"0x3"
Defined in: src/account/default.ts:114
Inherited from
WalletAccountV5.transactionVersion
paymaster
paymaster:
PaymasterInterface
Defined in: src/account/default.ts:116
Inherited from
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
Inherited from
defaultTipType
defaultTipType:
TipType
Defined in: src/account/default.ts:120
Inherited from
WalletAccountV5.defaultTipType
accountPluginManager
readonlyaccountPluginManager:PluginManager
Defined in: src/account/default.ts:123
Internal
Account-level plugin management
Inherited from
WalletAccountV5.accountPluginManager
deploySelf
deploySelf: (
contractPayload,details) =>Promise<DeployContractResponse>
Defined in: src/account/default.ts:559
ACCOUNT METHODS
Parameters
contractPayload
details?
UniversalDetails = {}
Returns
Promise<DeployContractResponse>
Example
const deployment = await account.deployAccount({
classHash: accountClassHash,
constructorCalldata: { publicKey: pubKey },
addressSalt: pubKey,
});
Inherited from
Methods
connect()
staticconnect(provider,walletProvider,cairoVersion?,paymaster?,silentMode?):Promise<WalletAccountV6>
Defined in: src/wallet/accountV6.ts:150
Parameters
provider
ProviderInterface | ProviderOptions
walletProvider
WalletWithStarknetFeatures
cairoVersion?
paymaster?
PaymasterOptions | PaymasterInterface
silentMode?
boolean = false
Returns
Promise<WalletAccountV6>
Overrides
connectSilent()
staticconnectSilent(provider,walletProvider,cairoVersion?,paymaster?):Promise<WalletAccountV6>
Defined in: src/wallet/accountV6.ts:172
Parameters
provider
ProviderInterface | ProviderOptions
walletProvider
WalletWithStarknetFeatures
cairoVersion?
paymaster?
PaymasterOptions | PaymasterInterface
Returns
Promise<WalletAccountV6>
Overrides
switchStarknetChain()
switchStarknetChain(
chainId,silent_mode?):Promise<boolean>
Defined in: src/wallet/accountV6.ts:43
Parameters
chainId
"0x534e5f4d41494e" | "0x534e5f5345504f4c4941"
silent_mode?
boolean = false
Returns
Promise<boolean>
Overrides
WalletAccountV5.switchStarknetChain
executeWithProof()
executeWithProof(
calls,proof?):Promise<AddInvokeTransactionResult>
Defined in: src/wallet/accountV6.ts:60
Execute call(s) with an optional STRK20 privacy proof attached. Same signature as
execute(), with an extra parameter for the proof provided by strk20PrepareInvoke().
Parameters
calls
The call(s) to invoke.
proof?
The SNIP-36 zero-knowledge proof to attach.
Returns
Promise<AddInvokeTransactionResult>
The hash of the submitted transaction.
Example
const { proof } = await myWalletAccount.strk20PrepareInvoke(actions);
const result = await myWalletAccount.executeWithProof(myContract.populate('claim'), proof);
// result = { transaction_hash: '0x6f7d...' }
strk20Balances()
strk20Balances(
tokens):Promise<STRK20_BALANCE_ENTRY[]>
Defined in: src/wallet/accountV6.ts:75
Get the private balances held by the user inside the STRK20 privacy pool.
Parameters
tokens
string[]
The tokens to get the private balance of. An empty array returns every shielded token.
Returns
Promise<STRK20_BALANCE_ENTRY[]>
One entry per token.
Example
const balances = await myWalletAccount.strk20Balances([strkAddress]);
// balances = [{ token: '0x4718...', amount: '0x2386f26fc10000' }]
strk20PrepareInvoke()
strk20PrepareInvoke(
actions,simulate?):Promise<STRK20_CALL_AND_PROOF>
Defined in: src/wallet/accountV6.ts:100
Build the Starknet call and the SNIP-36 zero-knowledge proof of a STRK20 transaction, without submitting it : the DAPP submits the returned call itself, and therefore pays the fee (the wallet adds no fee action in this mode).
With simulate set to true, the wallet skips the expensive proof generation and
returns an empty proof : the call is then NOT submittable on-chain, and is only useful
for fee estimation or UI previews.
Parameters
actions
The STRK20 actions to perform atomically (min 1).
simulate?
boolean
True to skip the proof generation.
Returns
Promise<STRK20_CALL_AND_PROOF>
The Starknet.js call to submit, and its proof.
Example
const { call, proof } = await myWalletAccount.strk20PrepareInvoke(actions);
const result = await mySponsorAccount.execute(call, {
proof: proof.data,
proofFacts: proof.proof_facts,
});
// result = { transaction_hash: '0x6f7d...' }
strk20InvokeTransaction()
strk20InvokeTransaction(
actions):Promise<{transaction_hash:string; }>
Defined in: src/wallet/accountV6.ts:124
Submit STRK20 actions as a single atomic transaction. The wallet displays an approval UI, generates the SNIP-36 proof, adds the fee action, and submits — so this call may take significantly longer than a standard invoke.
Parameters
actions
The STRK20 actions to perform atomically (min 1).
Returns
Promise<{ transaction_hash: string; }>
The hash of the submitted transaction.
Example
const result = await myWalletAccount.strk20InvokeTransaction(actions);
// result = { transaction_hash: '0x6f7d...' }
strk20ShadowAccountCommitment()
strk20ShadowAccountCommitment(
dappName,nonce?):Promise<string>
Defined in: src/wallet/accountV6.ts:146
Compute the commitment of a DAPP STRK20 shadow account. The commitment is computed locally by the wallet from the user private state ; no transaction is sent.
When nonce is given, the full commitment of this single shadow account is returned.
When nonce is omitted, the partial (nonce independent) commitment is returned
instead : it is shared by every shadow account the user derives for this DAPP, so it
can be published once to let a DAPP recognize all the shadow accounts of a user
without learning any individual nonce.
Parameters
dappName
string
The DAPP that scopes the shadow account(s).
nonce?
string
The shadow account nonce ; each nonce selects a distinct shadow account for this user + DAPP. Omit it to get the partial commitment.
Returns
Promise<string>
The shadow account commitment.
Example
const commitment = await myWalletAccount.strk20ShadowAccountCommitment('myDapp', '0x0');
// commitment = '0x5f2e...'
onChange()
onChange(
callback): () =>void
Defined in: src/wallet/accountV5.ts:90
Subscribe a callback to wallet account/network changes.
Parameters
callback
(change) => void
called on each change.
Returns
a function to unsubscribe this specific callback.
() => void
Inherited from
unsubscribeChange()
unsubscribeChange():
void
Defined in: src/wallet/accountV5.ts:100
Unsubscribe from all wallet events, including the callbacks registered through onChange. To call before the instance is deleted.
Returns
void
Inherited from
WalletAccountV5.unsubscribeChange
requestAccounts()
requestAccounts(
silentMode?):Promise<string[]>
Defined in: src/wallet/accountV5.ts:109
WALLET SPECIFIC METHODS
Parameters
silentMode?
boolean = false
Returns
Promise<string[]>
Inherited from
WalletAccountV5.requestAccounts
getPermissions()
getPermissions():
Promise<"accounts"[]>
Defined in: src/wallet/accountV5.ts:113
Returns
Promise<"accounts"[]>
Inherited from
WalletAccountV5.getPermissions
watchAsset()
watchAsset(
asset):Promise<boolean>
Defined in: src/wallet/accountV5.ts:121
Parameters
asset
WatchAssetParameters
Returns
Promise<boolean>
Inherited from
addStarknetChain()
addStarknetChain(
chain):Promise<boolean>
Defined in: src/wallet/accountV5.ts:125
Parameters
chain
AddStarknetChainParameters
Returns
Promise<boolean>
Inherited from
WalletAccountV5.addStarknetChain
execute()
execute(
calls):Promise<AddInvokeTransactionResult>
Defined in: src/wallet/accountV5.ts:132
ACCOUNT METHODS
Parameters
calls
Returns
Promise<AddInvokeTransactionResult>
Inherited from
declare()
declare(
payload):Promise<AddDeclareTransactionResult>
Defined in: src/wallet/accountV5.ts:149
ACCOUNT METHODS
Parameters
payload
Returns
Promise<AddDeclareTransactionResult>
Example
const declareResult = await account.declare({
contract: compiledSierra,
casm: compiledCasm,
});
Inherited from
deploy()
deploy(
payload):Promise<MultiDeployContractResponse>
Defined in: src/wallet/accountV5.ts:167
ACCOUNT METHODS
Parameters
payload
UniversalDeployerContractPayload | UniversalDeployerContractPayload[]
Returns
Promise<MultiDeployContractResponse>
Example
const deployment = await account.deploy([
{ classHash: erc20ClassHash, constructorCalldata: [name, symbol] },
{ classHash: nftClassHash, unique: true },
]);
Inherited from
signMessage()
signMessage(
typedData):Promise<SIGNATURE>
Defined in: src/wallet/accountV5.ts:178
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!' }
});
Inherited from
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');
Inherited from
getNonceSafe()
protectedgetNonceSafe(nonce?):Promise<bigint>
Defined in: src/account/default.ts:165
Parameters
nonce?
Returns
Promise<bigint>
Inherited from
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>
Inherited from
WalletAccountV5.getCairoVersion