UmbraClient
Umbra SDK reference for Umbra Client.
Defined in: src/client/umbra-client.ts:204
High-level client for interacting with the Umbra Privacy protocol smart contracts.
Remarks
The UmbraClient provides a simplified, user-friendly interface for interacting with
the Umbra Privacy protocol without requiring any knowledge of the underlying architecture,
cryptographic primitives, or implementation details. It abstracts away the complexity of:
- Key derivation and management
- Transaction construction and signing
- Zero-knowledge proof generation
- Rescue cipher encryption/decryption
- Transaction forwarding and confirmation
- Network connectivity and RPC management
Connection Requirement: It is absolutely necessary to provide a connection (via RPC URL, Connection instance, or ConnectionBasedForwarder) when creating the client. All on-chain data operations depend on this connection:
- Fetching account data from the blockchain
- Reading program state and account information
- Sending transactions to the network
- Confirming transaction status
- Querying transaction history
Without a valid connection, the client cannot interact with the Umbra Privacy protocol on-chain.
Key Features:
- Simplified API: Interact with Umbra Privacy smart contracts using high-level methods
- Automatic Management: Handles wallet creation, key derivation, and cipher management automatically
- Flexible Forwarding: Supports multiple transaction forwarding strategies (direct RPC, relayer services)
- Type Safety: Full TypeScript support with branded types for enhanced safety
- Error Handling: Comprehensive error types for better debugging and error recovery
Architecture Abstraction: The client manages all the complex components internally:
- UmbraWallets: Cryptographic wallets that handle key derivation, signing, and encryption
- Transaction Forwarders: Components that submit transactions to the network with various strategies
- Connection Management: Handles Solana network connectivity and RPC interactions
Users can focus on their application logic while the client handles all protocol-specific operations behind the scenes.
Example
// Create client from RPC URL (simplest approach)
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
// Create client from Connection instance
const connection = new Connection('https://api.mainnet-beta.solana.com');
const client = UmbraClient.create(connection);
// Create client from existing forwarder
const forwarder = ConnectionBasedForwarder.fromRpcUrl('https://api.mainnet-beta.solana.com');
const client = UmbraClient.create(forwarder);
// Access managed components
const wallet = client.umbraWallet;
const forwarderInstance = client.txForwarder;
const connectionForwarder = client.connectionBasedForwarder;Type Parameters
T
T = SolanaTransactionSignature
The return type for transaction forwarding operations (defaults to SolanaTransactionSignature)
Properties
connectionBasedForwarder
readonlyconnectionBasedForwarder:ConnectionBasedForwarder
Defined in: src/client/umbra-client.ts:245
The connection-based transaction forwarder for direct RPC submission.
Remarks
This forwarder uses a Solana Connection to submit transactions directly to the network. It supports sequential transaction forwarding with confirmation, delays, and offset-based resumption. This is the primary forwarder created during client initialization.
program
readonlyprogram:Program<Umbra>
Defined in: src/client/umbra-client.ts:246
txForwarder
txForwarder:
ITransactionForwarder<T> |undefined
Defined in: src/client/umbra-client.ts:223
Optional transaction forwarder managed by this client.
Remarks
The transaction forwarder handles submitting signed transactions to the network.
Different forwarders can use different strategies (direct RPC, relayer services, etc.).
The generic type T determines the return type of forwarding operations.
umbraWallet
umbraWallet:
UmbraWallet|undefined
Defined in: src/client/umbra-client.ts:213
Optional Umbra wallet managed by this client.
Remarks
The wallet provides cryptographic operations, transaction signing, and encryption capabilities. Wallets are created from signers and handle all key derivation and cipher management internally.
zkProver
zkProver:
IZkProver|undefined
Defined in: src/client/umbra-client.ts:235
Optional zero-knowledge prover used for generating Groth16 proofs (e.g. for master viewing key registration).
Remarks
This prover is not required for basic client functionality, but methods that
involve anonymity features or on-chain proof verification (such as
registerAccountForAnonymity) will throw an UmbraClientError if it
has not been configured.
Methods
claimDepositConfidentiallyFromMixerPool()
claimDepositConfidentiallyFromMixerPool(
mintAddress,destinationAddress,commitmentInsertionIndex,relayerPublicKey,generationIndex,time,claimableBalance,optionalData):Promise<string>
Defined in: src/client/umbra-client.ts:3182
Claims a deposit confidentially from the mixer pool by generating a zero-knowledge proof and executing the claim transaction through a relayer.
Parameters
mintAddress
The mint address of the token being claimed
destinationAddress
The destination address where the claimed tokens will be deposited
commitmentInsertionIndex
The index in the Merkle tree where the commitment was inserted
relayerPublicKey
The public key of the relayer that will process and pay for the transaction
generationIndex
The generation index used to derive cryptographic values (random secret, nullifier)
time
The timestamp when the original deposit was made (used for linker hash generation)
claimableBalance
The amount that can be claimed (after fees are deducted)
optionalData
Optional SHA3 hash for additional data
Returns
Promise<string>
A promise resolving to the transaction signature of the forwarded transaction
Remarks
This method enables users to claim deposits from the mixer pool while maintaining privacy. The claim process involves:
- Fetching and validating Arcium encrypted user and token accounts
- Generating cryptographic values (random secret, nullifier, linker hash)
- Creating encrypted commitments and zero-knowledge proofs
- Building appropriate deposit instructions based on account state
- Forwarding the transaction through a relayer
Account Initialization: If the user account or token account doesn't exist (null), initialization instructions are automatically added to the transaction. After initialization:
- User Account: Initialized, MXE encrypted, and active
- Token Account: Initialized, active, Arcium balance uninitialized, and MXE encrypted
Deposit Instruction Selection: The method selects the appropriate deposit instruction based on account state:
- If token account's Arcium balance is initialized:
- MXE encrypted →
buildExistingTokenDepositMxeInstruction - Shared →
buildExistingTokenDepositSharedInstruction
- MXE encrypted →
- If token account's Arcium balance is not initialized:
- User account MXE encrypted →
buildNewTokenDepositMxeInstruction - User account shared →
buildNewTokenDepositSharedInstruction
- User account MXE encrypted →
Privacy Features:
- Zero-knowledge proofs verify claim validity without revealing details
- Nullifier hash prevents double-spending
- Encrypted commitments maintain privacy
- Merkle tree proofs verify deposit inclusion
Requirements:
- An Umbra wallet must be set on the client via setUmbraWallet
- A zero-knowledge prover must be set via setZkProver
- The wallet must have a valid master viewing key
- The commitment must exist in the mixer pool at the specified index
Throws
UmbraClientError When:
- No Umbra wallet is set on the client
- No zero-knowledge prover is set on the client
- The wallet's master viewing key is unavailable
- Account fetching fails
- Account decoding fails
- An existing account is not active (user or token account)
- Cryptographic value generation fails (random secret, nullifier, linker hash)
- Zero-knowledge proof generation fails or returns invalid results
- Ephemeral X25519 key pair generation fails
- Rescue cipher encryption fails
- Instruction building fails
- Transaction building or forwarding fails
Example
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
await client.setZkProver(zkProver);
const signature = await client.claimDepositConfidentiallyFromMixerPool(
usdcMintAddress,
destinationAddress,
42n, // commitmentInsertionIndex
relayerPublicKey,
0n, // generationIndex
1704067200n, // time (Unix timestamp)
1000000n, // claimableBalance (1 USDC with 6 decimals)
optionalDataHash
);depositPublicallyIntoMixerPool()
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress):Promise<[U256,SolanaAddress,U128,string|VersionedTransaction|T]>
Defined in: src/client/umbra-client.ts:2184
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
Returns
Promise<[U256, SolanaAddress, U128, string | VersionedTransaction | T]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,index):Promise<[U256,SolanaAddress,U128,string|VersionedTransaction|T]>
Defined in: src/client/umbra-client.ts:2191
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
index
Returns
Promise<[U256, SolanaAddress, U128, string | VersionedTransaction | T]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:2199
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
opts
mode
"connection"
Returns
Promise<[U256, SolanaAddress, U128, string]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:2205
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
index
opts
mode
"connection"
Returns
Promise<[U256, SolanaAddress, U128, string]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,T]>
Defined in: src/client/umbra-client.ts:2212
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
opts
mode
"forwarder"
Returns
Promise<[U256, SolanaAddress, U128, T]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,T]>
Defined in: src/client/umbra-client.ts:2218
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
index
opts
mode
"forwarder"
Returns
Promise<[U256, SolanaAddress, U128, T]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:2225
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
opts
mode
"signed"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:2231
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
index
opts
mode
"signed"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:2238
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
opts
mode
"prepared"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:2244
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
index
opts
mode
"prepared"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
Call Signature
depositPublicallyIntoMixerPool(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:2251
Convenience wrapper that deposits either SOL (via WSOL) or SPL tokens into the mixer pool, delegating to depositPublicallyIntoMixerPoolSol or depositPublicallyIntoMixerPoolSpl as appropriate based on the mint.
Parameters
amount
The amount of SOL/SPL tokens to deposit.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL mint address. If this is WSOL_MINT_ADDRESS, the SOL path is used.
opts
mode
"raw"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Remarks
- When
mintAddress === WSOL_MINT_ADDRESS, this method behaves exactly like depositPublicallyIntoMixerPoolSol, including relayer and commission fee cuts from the deposited amount. - For all other mints, it behaves like depositPublicallyIntoMixerPoolSpl, where
the full SPL
amountis committed into the mixer pool and relayer fees are paid from WSOL.
All mode and index semantics mirror the underlying SOL/SPL methods.
depositPublicallyIntoMixerPoolSol()
Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:1509
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
Returns
Promise<[U256, SolanaAddress, U128, string]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,index):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:1513
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
index
Returns
Promise<[U256, SolanaAddress, U128, string]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,opts):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:1518
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
opts
Optional transaction handling mode (see remarks).
mode
"connection"
Returns
Promise<[U256, SolanaAddress, U128, string]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,index,opts):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:1523
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
index
opts
Optional transaction handling mode (see remarks).
mode
"connection"
Returns
Promise<[U256, SolanaAddress, U128, string]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,opts):Promise<[U256,SolanaAddress,U128,T]>
Defined in: src/client/umbra-client.ts:1529
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
opts
Optional transaction handling mode (see remarks).
mode
"forwarder"
Returns
Promise<[U256, SolanaAddress, U128, T]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,index,opts):Promise<[U256,SolanaAddress,U128,T]>
Defined in: src/client/umbra-client.ts:1534
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
index
opts
Optional transaction handling mode (see remarks).
mode
"forwarder"
Returns
Promise<[U256, SolanaAddress, U128, T]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1540
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
opts
Optional transaction handling mode (see remarks).
mode
"signed"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,index,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1545
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
index
opts
Optional transaction handling mode (see remarks).
mode
"signed"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1551
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
opts
Optional transaction handling mode (see remarks).
mode
"prepared"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,index,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1556
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
index
opts
Optional transaction handling mode (see remarks).
mode
"prepared"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,index,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1562
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
index
opts
Optional transaction handling mode (see remarks).
mode
"raw"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);Call Signature
depositPublicallyIntoMixerPoolSol(
amount,destinationAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1568
Deposits SOL publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SOL to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
opts
Optional transaction handling mode (see remarks).
mode
"raw"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting relayer fees and commission fees.valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, net deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_solinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option:
-
Default /
'forwarder'Signs the transaction with the client'sumbraWalletand forwards it viatxForwarder, returning the generic typeT. This is the recommended mode when using a relayer. -
'connection'Signs the transaction with the client'sumbraWalletand sends it directly viaconnectionBasedForwarder, returning a SolanaTransactionSignature. -
'signed'Signs with the client'sumbraWalletand returns the signed VersionedTransaction without sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsigned VersionedTransaction with fee payer and recent blockhash populated. Use this when the signing key is external but you still want the client to prepare the transaction. -
'raw'Returns an unsigned VersionedTransaction built only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
If the user's Arcium-encrypted account cannot be fetched, it is treated as uninitialised and the account checks (initialised / active / registered master viewing key) will fail with explicit UmbraClientErrors.
Throws
- If no Umbra wallet has been configured on the client.
- If no ZK prover has been configured on the client.
- If the user's account is not initialised, not active, or has not registered a master viewing key.
- If no transaction forwarder is configured when using
'forwarder'mode.
Examples
// Basic usage with a randomly derived index and default 'forwarder' mode.
const signatureOrResult = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
);// Usage with a fixed index for reproducible commitments / proofs.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSol(
amount,
destinationAddress,
index,
{ mode: 'signed' },
);depositPublicallyIntoMixerPoolSpl()
Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:1861
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
Returns
Promise<[U256, SolanaAddress, U128, string]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,index):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:1866
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
index
Returns
Promise<[U256, SolanaAddress, U128, string]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:1872
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
opts
mode
"connection"
Returns
Promise<[U256, SolanaAddress, U128, string]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,string]>
Defined in: src/client/umbra-client.ts:1878
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
index
opts
mode
"connection"
Returns
Promise<[U256, SolanaAddress, U128, string]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,T]>
Defined in: src/client/umbra-client.ts:1885
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
opts
mode
"forwarder"
Returns
Promise<[U256, SolanaAddress, U128, T]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,T]>
Defined in: src/client/umbra-client.ts:1891
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
index
opts
mode
"forwarder"
Returns
Promise<[U256, SolanaAddress, U128, T]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1898
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
opts
mode
"signed"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1904
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
index
opts
mode
"signed"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1911
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
opts
mode
"prepared"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1917
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
index
opts
mode
"prepared"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,index,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1924
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
index
opts
mode
"raw"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);Call Signature
depositPublicallyIntoMixerPoolSpl(
amount,destinationAddress,mintAddress,opts):Promise<[U256,SolanaAddress,U128,VersionedTransaction]>
Defined in: src/client/umbra-client.ts:1931
Deposits SPL tokens publicly into the Umbra mixer pool via a relayer, generating the required zero-knowledge proof and commitment/linker hashes.
Parameters
amount
The amount of SPL tokens to deposit into the mixer pool.
destinationAddress
The Solana address where withdrawn funds should ultimately be sent.
mintAddress
The SPL token mint address being deposited.
opts
mode
"raw"
Returns
Promise<[U256, SolanaAddress, U128, VersionedTransaction]>
Depending on the mode, a tuple [index, relayerPublicKey, claimableBalance, value] where:
indexis the U256 nullifier index used to derive the random secret and nullifier.relayerPublicKeyis the SolanaAddress of the randomly selected relayer used for this deposit.claimableBalanceis the Amount that can be claimed after deducting commission fees (relayer fees are paid separately from WSOL for SPL deposits).valueis either a transaction signature, a forwarded result of typeT, or a prepared/signed VersionedTransaction.
Remarks
This method mirrors depositPublicallyIntoMixerPoolSol but operates on SPL tokens. The key differences are:
- Commission fees are subtracted directly from the deposited SPL
amount, ensuring the on-chain commitment reflects the post-commission value. - Relayer fees are paid out of the user's wrapped SOL (WSOL) balance when the transaction is forwarded,
so the SPL
amountonly accounts for commission deductions.
Internally, it:
- Ensures the Arcium-encrypted user account is initialised, active, and has a registered master viewing key.
- Uses either a caller-provided index or a freshly sampled random index and derives:
- A random secret via UmbraWallet.generateRandomSecret
- A nullifier via UmbraWallet.generateNullifier
- Computes an inner commitment binding the random secret, nullifier, deposit amount, master viewing key, and destination address.
- Computes a time-based linker hash via UmbraWallet.generateLinkerHashForDepositsIntoMixerPool.
- Generates a Groth16 proof using the configured IZkProver.
- Builds a
deposit_into_mixer_pool_splinstruction targeting a randomly selected relayer.
The behavior is controlled by the mode option in the same way as
depositPublicallyIntoMixerPoolSol.
Examples
// Basic SPL deposit with a randomly derived index and default 'forwarder' mode.
const result = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
);// SPL deposit with a fixed index and a prepared transaction.
const index: U256 = /* obtain index */;
const tx = await client.depositPublicallyIntoMixerPoolSpl(
amount,
destinationAddress,
splMintAddress,
index,
{ mode: 'prepared' },
);generateEphemeralArciumX25519PublicKey()
generateEphemeralArciumX25519PublicKey(
index):object
Defined in: src/client/umbra-client.ts:3898
Generates an ephemeral X25519 key pair deterministically from a master viewing key and index.
Parameters
index
A 256-bit unsigned integer used as an index for key pair derivation. Different index values will produce different key pairs.
Returns
object
An object containing:
x25519PrivateKey: The derived X25519 secret key (32 bytes)x25519PublicKey: The corresponding X25519 public key (32 bytes)
x25519PrivateKey
x25519PrivateKey:
ArciumX25519SecretKey
x25519PublicKey
x25519PublicKey:
ArciumX25519PublicKey
Remarks
This method derives a unique ephemeral X25519 key pair for each index value using a two-step KMAC256-based key derivation process:
- First, it derives a domain-separated seed from the master viewing key using the domain separator "Umbra Privacy - Ephemeral Arcium X25519 Public Key Seed"
- Then, it derives the final ephemeral X25519 secret key seed by hashing the index with the domain-separated seed
- The derived seed (first 32 bytes) is used directly as the X25519 private key
- The corresponding public key is computed using X25519 scalar multiplication
The resulting key pair is deterministic: the same master viewing key and index will always produce the same X25519 key pair. This enables applications to generate ephemeral X25519 keys for privacy-preserving operations (such as establishing Rescue cipher shared secrets) without storing them explicitly.
Requirements:
- An Umbra wallet must be set on the client via setUmbraWallet
- The wallet must have a valid master viewing key
Use Cases: Ephemeral X25519 key pairs are commonly used for:
- Establishing temporary encrypted communication channels
- Creating one-time Rescue cipher instances for specific operations
- Privacy-preserving key exchange protocols
Throws
UmbraClientError When:
- No Umbra wallet is set on the client (
umbraWalletis undefined) - The wallet's master viewing key is undefined or invalid
- Key derivation fails (e.g., due to cryptographic operation errors)
- X25519 key pair generation fails (e.g., due to invalid key material)
Example
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
// Generate an ephemeral X25519 key pair for index 0
const { x25519PrivateKey, x25519PublicKey } = client.generateEphemeralArciumX25519PublicKey(0n);
// Use the public key to establish a Rescue cipher with another party
const cipher = RescueCipher.fromX25519Pair(x25519PrivateKey, otherPartyPublicKey);
// Generate a different key pair for index 1
const keyPair1 = client.generateEphemeralArciumX25519PublicKey(1n);
// The same index will always produce the same key pair
const keyPair0Again = client.generateEphemeralArciumX25519PublicKey(0n);
// Compare public keys byte-by-byte
const keysMatch = keyPair0Again.x25519PublicKey.every(
(byte, i) => byte === x25519PublicKey[i]
);
console.log(keysMatch); // truegenerateEphemeralKeypair()
generateEphemeralKeypair(
index):Keypair
Defined in: src/client/umbra-client.ts:3799
Generates an ephemeral Solana keypair deterministically from a master viewing key and index.
Parameters
index
A 256-bit unsigned integer used as an index for keypair derivation. Different index values will produce different keypairs.
Returns
Keypair
A Solana Keypair instance derived from the master viewing key and index
Remarks
This method derives a unique ephemeral keypair for each index value using a two-step KMAC256-based key derivation process:
- First, it derives a domain-separated seed from the master viewing key using the domain separator "Umbra Privacy - Ephemeral Keypair Seed"
- Then, it derives the final ephemeral keypair seed by hashing the index with the domain-separated seed
The resulting keypair is deterministic: the same master viewing key and index will always produce the same keypair. This enables applications to generate ephemeral keypairs for privacy-preserving operations without storing them explicitly.
Requirements:
- An Umbra wallet must be set on the client via setUmbraWallet
- The wallet must have a valid master viewing key
Throws
UmbraClientError When:
- No Umbra wallet is set on the client (
umbraWalletis undefined) - The wallet's master viewing key is undefined or invalid
- Key derivation fails (e.g., due to cryptographic operation errors)
- Keypair creation fails (e.g., due to invalid seed length or format)
Example
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
// Generate an ephemeral keypair for index 0
const keypair0 = client.generateEphemeralKeypair(0n);
// Generate a different ephemeral keypair for index 1
const keypair1 = client.generateEphemeralKeypair(1n);
// The same index will always produce the same keypair
const keypair0Again = client.generateEphemeralKeypair(0n);
console.log(keypair0.publicKey.equals(keypair0Again.publicKey)); // truegetEncryptedTokenBalance()
Call Signature
getEncryptedTokenBalance(
mint):Promise<U128>
Defined in: src/client/umbra-client.ts:1278
Returns the decrypted balance of the user's Arcium-encrypted SPL token account.
Parameters
mint
The SPL token mint address whose encrypted balance should be queried.
Returns
Promise<U128>
The decrypted token balance as an Amount.
Remarks
This method:
- Derives the Arcium-encrypted token account PDA for the current user and the given mint.
- Fetches the on-chain encrypted token account data.
- Decrypts the encrypted balance using the Umbra wallet's MXE Rescue cipher.
If the encrypted token account does not exist on-chain (for example, the user has never
held this token), the fetch will fail and this method will return a zero balance
(0n cast to Amount) instead of throwing.
When called with multiple mints (array overload), this method uses a single
fetchMultiple call under the hood and returns a Map from MintAddress
to decrypted Amount. Any mint whose encrypted account is missing or malformed
will be mapped to a zero balance.
Throws
- If no Umbra wallet has been configured on the client.
- If the Arcium-encrypted token account PDA cannot be derived (single-mint overload).
- If the Rescue cipher for
MXE_ARCIUM_X25519_PUBLIC_KEYis not available. - If the encrypted balance or nonce are missing or malformed (single-mint overload).
- If decryption succeeds but returns an unexpected result (single-mint overload).
Examples
// Assume `client` has been created and configured with an Umbra wallet.
const usdcMint: MintAddress = /* obtain SPL token mint address */;
const balance = await client.getEncryptedTokenBalance(usdcMint);
console.log(`Decrypted USDC balance: ${balance.toString()}`);const [usdcMint, usdtMint]: MintAddress[] = [/* ... */, /* ... */];
const balances = await client.getEncryptedTokenBalance([usdcMint, usdtMint]);
console.log(balances.get(usdcMint)?.toString()); // e.g. "1000000"
console.log(balances.get(usdtMint)?.toString()); // "0" if no account existsCall Signature
getEncryptedTokenBalance(
mints):Promise<Map<MintAddress,U128>>
Defined in: src/client/umbra-client.ts:1279
Returns the decrypted balance of the user's Arcium-encrypted SPL token account.
Parameters
mints
Returns
Promise<Map<MintAddress, U128>>
The decrypted token balance as an Amount.
Remarks
This method:
- Derives the Arcium-encrypted token account PDA for the current user and the given mint.
- Fetches the on-chain encrypted token account data.
- Decrypts the encrypted balance using the Umbra wallet's MXE Rescue cipher.
If the encrypted token account does not exist on-chain (for example, the user has never
held this token), the fetch will fail and this method will return a zero balance
(0n cast to Amount) instead of throwing.
When called with multiple mints (array overload), this method uses a single
fetchMultiple call under the hood and returns a Map from MintAddress
to decrypted Amount. Any mint whose encrypted account is missing or malformed
will be mapped to a zero balance.
Throws
- If no Umbra wallet has been configured on the client.
- If the Arcium-encrypted token account PDA cannot be derived (single-mint overload).
- If the Rescue cipher for
MXE_ARCIUM_X25519_PUBLIC_KEYis not available. - If the encrypted balance or nonce are missing or malformed (single-mint overload).
- If decryption succeeds but returns an unexpected result (single-mint overload).
Examples
// Assume `client` has been created and configured with an Umbra wallet.
const usdcMint: MintAddress = /* obtain SPL token mint address */;
const balance = await client.getEncryptedTokenBalance(usdcMint);
console.log(`Decrypted USDC balance: ${balance.toString()}`);const [usdcMint, usdtMint]: MintAddress[] = [/* ... */, /* ... */];
const balances = await client.getEncryptedTokenBalance([usdcMint, usdtMint]);
console.log(balances.get(usdcMint)?.toString()); // e.g. "1000000"
console.log(balances.get(usdtMint)?.toString()); // "0" if no account existsinitialiseMasterWalletSpecifier()
initialiseMasterWalletSpecifier(
allowedAddress):Promise<string>
Defined in: src/client/umbra-client.ts:2582
Initialises the master wallet specifier, configuring which address is allowed to act as the "master" wallet for protocol‑level operations.
Parameters
allowedAddress
The SolanaAddress that will be authorised as the master wallet.
Returns
Promise<string>
A SolanaTransactionSignature for the submitted initialisation transaction.
Remarks
This helper builds and submits a single initialise_master_wallet_specifier instruction
using the client's UmbraWallet signer as both:
- The payer (fee‑payer for the transaction), and
- The protocol signer for the master wallet specifier initialisation.
The method will throw if:
- No Umbra wallet has been configured on the client.
- The latest blockhash cannot be fetched from the network.
- Transaction signing fails.
- Forwarding the transaction via
connectionBasedForwarderfails.
Example
const masterWalletAddress: SolanaAddress = /* obtain address */;
const txSig = await client.initialiseMasterWalletSpecifier(masterWalletAddress);
console.log('Initialise master wallet specifier tx:', txSig);initialiseMixerPool()
initialiseMixerPool(
mintAddress,optionalData):Promise<string>
Defined in: src/client/umbra-client.ts:3014
Initialises the on-chain mixer pool for a given SPL mint.
Parameters
mintAddress
The SPL MintAddress whose mixer pool should be initialised.
optionalData
Optional Sha3Hash used to attach additional metadata.
Returns
Promise<string>
A SolanaTransactionSignature for the mixer pool initialisation tx.
Remarks
This helper:
- Uses the client's
UmbraWalletsigner as the payer and protocol signer. - Builds an
initialise_mixer_poolinstruction for the specified mint. - Fetches a recent blockhash, signs the transaction, and forwards it via
connectionBasedForwarder.
It will throw if:
- No Umbra wallet has been configured on the client.
- The latest blockhash cannot be fetched.
- Transaction signing fails.
- Forwarding the transaction fails.
Example
const txSig = await client.initialiseMixerPool(
someMintAddress,
someOptionalDataSha3Hash,
);
console.log('Initialise mixer pool tx:', txSig);initialiseProgramInformation()
initialiseProgramInformation(
minimumNumberOfTransactions,riskThreshold,optionalData):Promise<string>
Defined in: src/client/umbra-client.ts:2513
Initialises or updates global program‑level information for the Umbra protocol.
Parameters
minimumNumberOfTransactions
Minimum number of transactions required for certain protocol‑level compliance checks (branded as NumberOfTransactions).
riskThreshold
Risk threshold configuration used by the protocol (branded as RiskThreshold).
optionalData
Optional SHA‑3 hash for attaching additional metadata to the initialisation, branded as Sha3Hash.
Returns
Promise<string>
A SolanaTransactionSignature for the submitted initialisation transaction.
Remarks
This helper builds and sends a single initialise_program_information instruction via
the client's connectionBasedForwarder. It:
- Uses the client's
UmbraWalletsigner as both the payer and protocol signer. - Fetches a recent blockhash from the underlying
Connection. - Signs the resulting VersionedTransaction with the
UmbraWallet.
The method will throw if:
- No Umbra wallet has been configured on the client.
- The latest blockhash cannot be fetched from the network.
- Transaction signing fails.
- Forwarding the transaction via
connectionBasedForwarderfails.
Example
const txSig = await client.initialiseProgramInformation(
100n as NumberOfTransactions,
someRiskThreshold,
someOptionalDataSha3Hash,
);
console.log('Initialise program information tx:', txSig);initialisePublicCommissionFeesPool()
initialisePublicCommissionFeesPool(
mintAddress,instructionSeed,accountOffset):Promise<string>
Defined in: src/client/umbra-client.ts:2872
Initialises a public commission fees pool account for a given SPL mint and account offset.
Parameters
mintAddress
The SPL MintAddress whose public commission fees pool should be initialised.
instructionSeed
The InstructionSeed used for deriving the pool PDA.
accountOffset
The AccountOffset identifying the specific commission pool.
Returns
Promise<string>
A SolanaTransactionSignature for the public commission fees pool initialisation tx.
Remarks
This helper:
- Uses the client's
UmbraWalletsigner as the payer and protocol signer. - Builds an
initialise_public_commission_feesinstruction via the instruction builder. - Fetches a recent blockhash, signs the transaction, and forwards it using
connectionBasedForwarder.
It will throw if:
- No Umbra wallet has been configured on the client.
- The latest blockhash cannot be fetched.
- Transaction signing fails.
- Forwarding the transaction fails.
Example
const txSig = await client.initialisePublicCommissionFeesPool(
someMintAddress,
1 as InstructionSeed,
someAccountOffset,
);
console.log('Initialise public commission fees pool tx:', txSig);initialiseRelayerAccount()
initialiseRelayerAccount(
mintAddress,endpoint):Promise<string>
Defined in: src/client/umbra-client.ts:2726
Initialises a relayer account for a given SPL mint and endpoint.
Parameters
mintAddress
The SPL MintAddress that this relayer will serve.
endpoint
A Sha3Hash identifying or committing to the relayer's endpoint (e.g. URL or service identifier).
Returns
Promise<string>
A SolanaTransactionSignature for the submitted relayer initialisation transaction.
Remarks
This helper:
- Uses the client's
UmbraWalletsigner as the relayer authority and fee payer. - Builds a single
initialise_relayer_accountinstruction for the specifiedmintAddress. - Fetches a recent blockhash from the underlying
Connection. - Signs and forwards the resulting VersionedTransaction.
It will throw if:
- No Umbra wallet has been configured on the client.
- The latest blockhash cannot be fetched.
- Transaction signing fails.
- Forwarding the transaction fails.
Example
const txSig = await client.initialiseRelayerAccount(
someMintAddress,
someEndpointSha3Hash,
);
console.log('Initialise relayer account tx:', txSig);initialiseRelayerFeesAccount()
initialiseRelayerFeesAccount(
mintAddress,instructionSeed,accountOffset):Promise<string>
Defined in: src/client/umbra-client.ts:2798
Initialises a relayer fees account for a given SPL mint and account offset.
Parameters
mintAddress
The SPL MintAddress whose relayer fees pool should be initialised.
instructionSeed
The InstructionSeed used for deriving configuration PDAs.
accountOffset
The AccountOffset identifying the specific relayer fees pool.
Returns
Promise<string>
A SolanaTransactionSignature for the relayer fees account initialisation tx.
Remarks
This helper:
- Uses the client's
UmbraWalletsigner as the relayer authority and payer. - Builds an
initialise_relayer_fees_poolinstruction for the given mint/offset. - Fetches a recent blockhash, signs the transaction, and forwards it via
connectionBasedForwarder.
It will throw if:
- No Umbra wallet has been configured on the client.
- The latest blockhash cannot be fetched.
- Transaction signing fails.
- Forwarding the transaction fails.
Example
const txSig = await client.initialiseRelayerFeesAccount(
someMintAddress,
1 as InstructionSeed,
someAccountOffset,
);
console.log('Initialise relayer fees account tx:', txSig);initialiseWalletSpecifier()
initialiseWalletSpecifier(
instructionSeed,allowedAddress,optionalData):Promise<string>
Defined in: src/client/umbra-client.ts:2653
Initialises a wallet specifier entry for a given instruction seed and allowed address.
Parameters
instructionSeed
The InstructionSeed used to domain‑separate this specifier.
allowedAddress
The SolanaAddress that will be authorised for the given seed.
optionalData
Optional SHA‑3 hash used to attach additional metadata to the specifier.
Returns
Promise<string>
A SolanaTransactionSignature for the submitted initialisation transaction.
Remarks
Wallet specifiers allow the protocol to associate specific instruction seeds with authorised Solana addresses. This helper:
- Uses the client's
UmbraWalletsigner as both the payer and the protocol signer. - Builds a single
initialise_wallet_specifierinstruction. - Fetches a recent blockhash from the
connectionBasedForwarder. - Signs and forwards the resulting VersionedTransaction.
It will throw if:
- No Umbra wallet has been configured on the client.
- The latest blockhash cannot be fetched.
- Transaction signing fails.
- Forwarding the transaction fails.
Example
const txSig = await client.initialiseWalletSpecifier(
1 as InstructionSeed,
someAllowedAddress,
someOptionalDataSha3Hash,
);
console.log('Initialise wallet specifier tx:', txSig);initialiseZkMerkleTree()
initialiseZkMerkleTree(
mintAddress,optionalData):Promise<string>
Defined in: src/client/umbra-client.ts:2944
Initialises the on-chain ZK Merkle tree for a given SPL mint.
Parameters
mintAddress
The SPL MintAddress whose ZK Merkle tree should be initialised.
optionalData
Optional Sha3Hash used to attach additional metadata.
Returns
Promise<string>
A SolanaTransactionSignature for the ZK Merkle tree initialisation tx.
Remarks
This helper:
- Uses the client's
UmbraWalletsigner as the payer and protocol signer. - Builds an
initialise_zk_merkle_treeinstruction for the specified mint. - Fetches a recent blockhash, signs the transaction, and forwards it via
connectionBasedForwarder.
It will throw if:
- No Umbra wallet has been configured on the client.
- The latest blockhash cannot be fetched.
- Transaction signing fails.
- Forwarding the transaction fails.
Example
const txSig = await client.initialiseZkMerkleTree(
someMintAddress,
someOptionalDataSha3Hash,
);
console.log('Initialise ZK Merkle tree tx:', txSig);registerAccountForAnonymity()
Call Signature
registerAccountForAnonymity(
optionalData):Promise<string>
Defined in: src/client/umbra-client.ts:877
Registers the user's Umbra account for anonymity, including master viewing key registration, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
Returns
Promise<string>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key
- Register the user's master viewing key and its blinding factors on-chain:
- Compute SHA-3 and Poseidon commitments to the master viewing key
- Encrypt the master viewing key and blinding factors using the MXE Rescue cipher
- Generate a Groth16 proof via the configured
zkProver - Submit an instruction to update the on-chain master viewing key state
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet,
and a ZK prover must be configured via zkProver.
Call Signature
registerAccountForAnonymity(
optionalData,opts):Promise<string>
Defined in: src/client/umbra-client.ts:880
Registers the user's Umbra account for anonymity, including master viewing key registration, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"connection"
Returns
Promise<string>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key
- Register the user's master viewing key and its blinding factors on-chain:
- Compute SHA-3 and Poseidon commitments to the master viewing key
- Encrypt the master viewing key and blinding factors using the MXE Rescue cipher
- Generate a Groth16 proof via the configured
zkProver - Submit an instruction to update the on-chain master viewing key state
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet,
and a ZK prover must be configured via zkProver.
Call Signature
registerAccountForAnonymity(
optionalData,opts):Promise<T>
Defined in: src/client/umbra-client.ts:884
Registers the user's Umbra account for anonymity, including master viewing key registration, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"forwarder"
Returns
Promise<T>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key
- Register the user's master viewing key and its blinding factors on-chain:
- Compute SHA-3 and Poseidon commitments to the master viewing key
- Encrypt the master viewing key and blinding factors using the MXE Rescue cipher
- Generate a Groth16 proof via the configured
zkProver - Submit an instruction to update the on-chain master viewing key state
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet,
and a ZK prover must be configured via zkProver.
Call Signature
registerAccountForAnonymity(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:888
Registers the user's Umbra account for anonymity, including master viewing key registration, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"signed"
Returns
Promise<VersionedTransaction>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key
- Register the user's master viewing key and its blinding factors on-chain:
- Compute SHA-3 and Poseidon commitments to the master viewing key
- Encrypt the master viewing key and blinding factors using the MXE Rescue cipher
- Generate a Groth16 proof via the configured
zkProver - Submit an instruction to update the on-chain master viewing key state
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet,
and a ZK prover must be configured via zkProver.
Call Signature
registerAccountForAnonymity(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:892
Registers the user's Umbra account for anonymity, including master viewing key registration, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"prepared"
Returns
Promise<VersionedTransaction>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key
- Register the user's master viewing key and its blinding factors on-chain:
- Compute SHA-3 and Poseidon commitments to the master viewing key
- Encrypt the master viewing key and blinding factors using the MXE Rescue cipher
- Generate a Groth16 proof via the configured
zkProver - Submit an instruction to update the on-chain master viewing key state
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet,
and a ZK prover must be configured via zkProver.
Call Signature
registerAccountForAnonymity(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:896
Registers the user's Umbra account for anonymity, including master viewing key registration, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"raw"
Returns
Promise<VersionedTransaction>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key
- Register the user's master viewing key and its blinding factors on-chain:
- Compute SHA-3 and Poseidon commitments to the master viewing key
- Encrypt the master viewing key and blinding factors using the MXE Rescue cipher
- Generate a Groth16 proof via the configured
zkProver - Submit an instruction to update the on-chain master viewing key state
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet,
and a ZK prover must be configured via zkProver.
registerAccountForConfidentiality()
Call Signature
registerAccountForConfidentiality(
optionalData):Promise<string>
Defined in: src/client/umbra-client.ts:658
Registers the user's Umbra account for confidentiality, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
Returns
Promise<string>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key.
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet.
Examples
// 1. Simple usage: sign and send via connectionBasedForwarder
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
const optionalData: Sha3Hash = /* application-specific data */;
const signature = await client.registerAccountForConfidentiality(optionalData);
console.log('Transaction sent, signature:', signature);// 2. Forward via a relayer / custom forwarder (generic T)
type ForwardResponse = { signature: string; slot: number };
const client = UmbraClient<ForwardResponse>.create(connection);
client.txForwarder = await UmbraClient.getRandomRelayerForwarder();
await client.setUmbraWallet(signer);
const res = await client.registerAccountForConfidentiality(optionalData, {
mode: 'forwarder',
});
console.log('Forwarder response:', res.signature, 'at slot', res.slot);// 3. Get a signed transaction but submit it manually
const signedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'signed',
});
// Send via a different connection or RPC strategy
const rawSig = await someSolanaConnection.sendTransaction(signedTx);// 4. Prepare an unsigned transaction for an external signer
const preparedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'prepared',
});
// Hand off to an external signer (e.g. hardware wallet)
const externallySigned = await externalSigner.signTransaction(preparedTx);
const sig = await someSolanaConnection.sendTransaction(externallySigned);// 5. Build a raw transaction and fully customize it yourself
const rawTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'raw',
});
// Replace blockhash / fee payer and then sign + send using your own logicCall Signature
registerAccountForConfidentiality(
optionalData,opts):Promise<string>
Defined in: src/client/umbra-client.ts:661
Registers the user's Umbra account for confidentiality, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"connection"
Returns
Promise<string>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key.
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet.
Examples
// 1. Simple usage: sign and send via connectionBasedForwarder
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
const optionalData: Sha3Hash = /* application-specific data */;
const signature = await client.registerAccountForConfidentiality(optionalData);
console.log('Transaction sent, signature:', signature);// 2. Forward via a relayer / custom forwarder (generic T)
type ForwardResponse = { signature: string; slot: number };
const client = UmbraClient<ForwardResponse>.create(connection);
client.txForwarder = await UmbraClient.getRandomRelayerForwarder();
await client.setUmbraWallet(signer);
const res = await client.registerAccountForConfidentiality(optionalData, {
mode: 'forwarder',
});
console.log('Forwarder response:', res.signature, 'at slot', res.slot);// 3. Get a signed transaction but submit it manually
const signedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'signed',
});
// Send via a different connection or RPC strategy
const rawSig = await someSolanaConnection.sendTransaction(signedTx);// 4. Prepare an unsigned transaction for an external signer
const preparedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'prepared',
});
// Hand off to an external signer (e.g. hardware wallet)
const externallySigned = await externalSigner.signTransaction(preparedTx);
const sig = await someSolanaConnection.sendTransaction(externallySigned);// 5. Build a raw transaction and fully customize it yourself
const rawTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'raw',
});
// Replace blockhash / fee payer and then sign + send using your own logicCall Signature
registerAccountForConfidentiality(
optionalData,opts):Promise<T>
Defined in: src/client/umbra-client.ts:665
Registers the user's Umbra account for confidentiality, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"forwarder"
Returns
Promise<T>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key.
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet.
Examples
// 1. Simple usage: sign and send via connectionBasedForwarder
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
const optionalData: Sha3Hash = /* application-specific data */;
const signature = await client.registerAccountForConfidentiality(optionalData);
console.log('Transaction sent, signature:', signature);// 2. Forward via a relayer / custom forwarder (generic T)
type ForwardResponse = { signature: string; slot: number };
const client = UmbraClient<ForwardResponse>.create(connection);
client.txForwarder = await UmbraClient.getRandomRelayerForwarder();
await client.setUmbraWallet(signer);
const res = await client.registerAccountForConfidentiality(optionalData, {
mode: 'forwarder',
});
console.log('Forwarder response:', res.signature, 'at slot', res.slot);// 3. Get a signed transaction but submit it manually
const signedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'signed',
});
// Send via a different connection or RPC strategy
const rawSig = await someSolanaConnection.sendTransaction(signedTx);// 4. Prepare an unsigned transaction for an external signer
const preparedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'prepared',
});
// Hand off to an external signer (e.g. hardware wallet)
const externallySigned = await externalSigner.signTransaction(preparedTx);
const sig = await someSolanaConnection.sendTransaction(externallySigned);// 5. Build a raw transaction and fully customize it yourself
const rawTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'raw',
});
// Replace blockhash / fee payer and then sign + send using your own logicCall Signature
registerAccountForConfidentiality(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:669
Registers the user's Umbra account for confidentiality, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"signed"
Returns
Promise<VersionedTransaction>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key.
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet.
Examples
// 1. Simple usage: sign and send via connectionBasedForwarder
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
const optionalData: Sha3Hash = /* application-specific data */;
const signature = await client.registerAccountForConfidentiality(optionalData);
console.log('Transaction sent, signature:', signature);// 2. Forward via a relayer / custom forwarder (generic T)
type ForwardResponse = { signature: string; slot: number };
const client = UmbraClient<ForwardResponse>.create(connection);
client.txForwarder = await UmbraClient.getRandomRelayerForwarder();
await client.setUmbraWallet(signer);
const res = await client.registerAccountForConfidentiality(optionalData, {
mode: 'forwarder',
});
console.log('Forwarder response:', res.signature, 'at slot', res.slot);// 3. Get a signed transaction but submit it manually
const signedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'signed',
});
// Send via a different connection or RPC strategy
const rawSig = await someSolanaConnection.sendTransaction(signedTx);// 4. Prepare an unsigned transaction for an external signer
const preparedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'prepared',
});
// Hand off to an external signer (e.g. hardware wallet)
const externallySigned = await externalSigner.signTransaction(preparedTx);
const sig = await someSolanaConnection.sendTransaction(externallySigned);// 5. Build a raw transaction and fully customize it yourself
const rawTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'raw',
});
// Replace blockhash / fee payer and then sign + send using your own logicCall Signature
registerAccountForConfidentiality(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:673
Registers the user's Umbra account for confidentiality, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"prepared"
Returns
Promise<VersionedTransaction>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key.
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet.
Examples
// 1. Simple usage: sign and send via connectionBasedForwarder
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
const optionalData: Sha3Hash = /* application-specific data */;
const signature = await client.registerAccountForConfidentiality(optionalData);
console.log('Transaction sent, signature:', signature);// 2. Forward via a relayer / custom forwarder (generic T)
type ForwardResponse = { signature: string; slot: number };
const client = UmbraClient<ForwardResponse>.create(connection);
client.txForwarder = await UmbraClient.getRandomRelayerForwarder();
await client.setUmbraWallet(signer);
const res = await client.registerAccountForConfidentiality(optionalData, {
mode: 'forwarder',
});
console.log('Forwarder response:', res.signature, 'at slot', res.slot);// 3. Get a signed transaction but submit it manually
const signedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'signed',
});
// Send via a different connection or RPC strategy
const rawSig = await someSolanaConnection.sendTransaction(signedTx);// 4. Prepare an unsigned transaction for an external signer
const preparedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'prepared',
});
// Hand off to an external signer (e.g. hardware wallet)
const externallySigned = await externalSigner.signTransaction(preparedTx);
const sig = await someSolanaConnection.sendTransaction(externallySigned);// 5. Build a raw transaction and fully customize it yourself
const rawTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'raw',
});
// Replace blockhash / fee payer and then sign + send using your own logicCall Signature
registerAccountForConfidentiality(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:677
Registers the user's Umbra account for confidentiality, with flexible control over how the resulting transaction is signed and forwarded.
Parameters
optionalData
opts
mode
"raw"
Returns
Promise<VersionedTransaction>
Remarks
This high-level method constructs the correct set of instructions to:
- Initialise the Arcium-encrypted user account (if not already initialised)
- Validate that the account is active (if already initialised)
- Convert the account from MXE-encrypted form to shared form (if required), using the client's Umbra wallet X25519 public key.
It then optionally:
- Populates fee payer and recent blockhash, and/or
- Signs with the client's
umbraWallet, and/or - Forwards via either the
connectionBasedForwarderor the configuredtxForwarder.
The behavior is controlled by the mode option:
-
Default /
'connection'(recommended for most users) Signs the transaction with the client'sumbraWalletand sends it viaconnectionBasedForwarder, returning aSolanaTransactionSignature. -
'forwarder'Signs with the client'sumbraWalletand forwards viatxForwarder, returning the generic typeT. This is useful when using a relayer or custom forwarding strategy. -
'signed'Signs with the client'sumbraWalletand returns the signedVersionedTransactionwithout sending it. Use this when you want to control submission yourself. -
'prepared'Returns an unsignedVersionedTransactionwith fee payer and recent blockhash populated. Use this when the signing key is external (e.g. hardware wallet, mobile signer) but you still want the client to prepare the transaction. -
'raw'Returns an unsignedVersionedTransactionbuilt only from the instructions, with a placeholder blockhash. No real fee payer / blockhash setup is performed, and the caller is expected to update the message before signing and sending.
In all modes, an Umbra wallet must be set on the client via setUmbraWallet.
Examples
// 1. Simple usage: sign and send via connectionBasedForwarder
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
await client.setUmbraWallet(signer);
const optionalData: Sha3Hash = /* application-specific data */;
const signature = await client.registerAccountForConfidentiality(optionalData);
console.log('Transaction sent, signature:', signature);// 2. Forward via a relayer / custom forwarder (generic T)
type ForwardResponse = { signature: string; slot: number };
const client = UmbraClient<ForwardResponse>.create(connection);
client.txForwarder = await UmbraClient.getRandomRelayerForwarder();
await client.setUmbraWallet(signer);
const res = await client.registerAccountForConfidentiality(optionalData, {
mode: 'forwarder',
});
console.log('Forwarder response:', res.signature, 'at slot', res.slot);// 3. Get a signed transaction but submit it manually
const signedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'signed',
});
// Send via a different connection or RPC strategy
const rawSig = await someSolanaConnection.sendTransaction(signedTx);// 4. Prepare an unsigned transaction for an external signer
const preparedTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'prepared',
});
// Hand off to an external signer (e.g. hardware wallet)
const externallySigned = await externalSigner.signTransaction(preparedTx);
const sig = await someSolanaConnection.sendTransaction(externallySigned);// 5. Build a raw transaction and fully customize it yourself
const rawTx = await client.registerAccountForConfidentiality(optionalData, {
mode: 'raw',
});
// Replace blockhash / fee payer and then sign + send using your own logicregisterAccountForConfidentialityAndAnonymity()
Call Signature
registerAccountForConfidentialityAndAnonymity(
optionalData):Promise<string|VersionedTransaction|T>
Defined in: src/client/umbra-client.ts:983
Registers the user's Umbra account for both confidentiality and anonymity in a single transaction.
Parameters
optionalData
Returns
Promise<string | VersionedTransaction | T>
Remarks
This method combines the behavior of registerAccountForConfidentiality and registerAccountForAnonymity:
- Ensures the Arcium-encrypted user account is initialised and active
- Converts the account from MXE-encrypted form to shared form if required
- Registers the master viewing key and its blinding factors on-chain via a Groth16 proof
All operations are encoded as a single transaction, with the master viewing key registration instruction appended last.
The same mode options as the other registration methods are supported:
'connection'(default),'forwarder','signed','prepared','raw'.
Call Signature
registerAccountForConfidentialityAndAnonymity(
optionalData,opts):Promise<string>
Defined in: src/client/umbra-client.ts:986
Registers the user's Umbra account for both confidentiality and anonymity in a single transaction.
Parameters
optionalData
opts
mode
"connection"
Returns
Promise<string>
Remarks
This method combines the behavior of registerAccountForConfidentiality and registerAccountForAnonymity:
- Ensures the Arcium-encrypted user account is initialised and active
- Converts the account from MXE-encrypted form to shared form if required
- Registers the master viewing key and its blinding factors on-chain via a Groth16 proof
All operations are encoded as a single transaction, with the master viewing key registration instruction appended last.
The same mode options as the other registration methods are supported:
'connection'(default),'forwarder','signed','prepared','raw'.
Call Signature
registerAccountForConfidentialityAndAnonymity(
optionalData,opts):Promise<T>
Defined in: src/client/umbra-client.ts:990
Registers the user's Umbra account for both confidentiality and anonymity in a single transaction.
Parameters
optionalData
opts
mode
"forwarder"
Returns
Promise<T>
Remarks
This method combines the behavior of registerAccountForConfidentiality and registerAccountForAnonymity:
- Ensures the Arcium-encrypted user account is initialised and active
- Converts the account from MXE-encrypted form to shared form if required
- Registers the master viewing key and its blinding factors on-chain via a Groth16 proof
All operations are encoded as a single transaction, with the master viewing key registration instruction appended last.
The same mode options as the other registration methods are supported:
'connection'(default),'forwarder','signed','prepared','raw'.
Call Signature
registerAccountForConfidentialityAndAnonymity(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:994
Registers the user's Umbra account for both confidentiality and anonymity in a single transaction.
Parameters
optionalData
opts
mode
"signed"
Returns
Promise<VersionedTransaction>
Remarks
This method combines the behavior of registerAccountForConfidentiality and registerAccountForAnonymity:
- Ensures the Arcium-encrypted user account is initialised and active
- Converts the account from MXE-encrypted form to shared form if required
- Registers the master viewing key and its blinding factors on-chain via a Groth16 proof
All operations are encoded as a single transaction, with the master viewing key registration instruction appended last.
The same mode options as the other registration methods are supported:
'connection'(default),'forwarder','signed','prepared','raw'.
Call Signature
registerAccountForConfidentialityAndAnonymity(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:998
Registers the user's Umbra account for both confidentiality and anonymity in a single transaction.
Parameters
optionalData
opts
mode
"prepared"
Returns
Promise<VersionedTransaction>
Remarks
This method combines the behavior of registerAccountForConfidentiality and registerAccountForAnonymity:
- Ensures the Arcium-encrypted user account is initialised and active
- Converts the account from MXE-encrypted form to shared form if required
- Registers the master viewing key and its blinding factors on-chain via a Groth16 proof
All operations are encoded as a single transaction, with the master viewing key registration instruction appended last.
The same mode options as the other registration methods are supported:
'connection'(default),'forwarder','signed','prepared','raw'.
Call Signature
registerAccountForConfidentialityAndAnonymity(
optionalData,opts):Promise<VersionedTransaction>
Defined in: src/client/umbra-client.ts:1002
Registers the user's Umbra account for both confidentiality and anonymity in a single transaction.
Parameters
optionalData
opts
mode
"raw"
Returns
Promise<VersionedTransaction>
Remarks
This method combines the behavior of registerAccountForConfidentiality and registerAccountForAnonymity:
- Ensures the Arcium-encrypted user account is initialised and active
- Converts the account from MXE-encrypted form to shared form if required
- Registers the master viewing key and its blinding factors on-chain via a Groth16 proof
All operations are encoded as a single transaction, with the master viewing key registration instruction appended last.
The same mode options as the other registration methods are supported:
'connection'(default),'forwarder','signed','prepared','raw'.
setUmbraWallet()
Internal
Implementation of setUmbraWallet that handles all overloads.
Call Signature
setUmbraWallet(
umbraWallet):Promise<void>
Defined in: src/client/umbra-client.ts:450
Sets the Umbra wallet on the client from an existing UmbraWallet instance.
Parameters
umbraWallet
An existing UmbraWallet instance to set on the client
Returns
Promise<void>
A promise that resolves when the wallet is successfully set
Throws
UmbraWalletAdditionError When the wallet is null, undefined, or invalid
Remarks
Use this overload when you already have a created UmbraWallet instance and want to associate it with the client. This is useful when you've created the wallet separately and want to manage it through the client.
Wallet Management:
Once added, the wallet is stored in the client's umbraWallet field and can be
accessed for cryptographic operations, transaction signing, and encryption.
Example
// Create wallet separately
const wallet = await UmbraWallet.fromSigner(signer);
// Set on client
await client.setUmbraWallet(wallet);Call Signature
setUmbraWallet(
signer):Promise<void>
Defined in: src/client/umbra-client.ts:485
Sets the Umbra wallet on the client by creating it from an ISigner.
Parameters
signer
An ISigner instance to create the UmbraWallet from
Returns
Promise<void>
A promise that resolves when the wallet is successfully created and set
Throws
UmbraWalletAdditionError When wallet creation fails due to signer errors, key derivation failures, or initialization issues
Remarks
Use this overload when you have a signer and want the client to automatically create the UmbraWallet for you and associate it with the client. This is the most convenient approach as it handles all wallet initialization internally.
Wallet Creation Process:
The wallet is created using UmbraWallet.fromSigner, which:
- Signs a default message to obtain a master signature seed
- Derives X25519 key pair for Rescue cipher operations
- Generates master viewing key for compliance and transaction linking
- Initializes Rescue ciphers for encryption/decryption
Signer Requirements:
The signer must be fully initialized and capable of signing messages. If the signer
is unavailable or fails to sign, a UmbraWalletAdditionError will be thrown.
Example
// Create wallet from signer directly and set on client
await client.setUmbraWallet(signer);
// Access the created wallet
const wallet = client.umbraWallet;setZkProver()
Call Signature
setZkProver(
prover):void
Defined in: src/client/umbra-client.ts:284
Configures the zero-knowledge prover used by this client.
Parameters
prover
Returns
void
Remarks
This method supports two configuration styles:
-
Pass an existing IZkProver instance:
const prover = new WasmZkProver({ masterViewingKeyRegistration: true }); client.setZkProver(prover); -
Use the
'wasm'shorthand to construct a WasmZkProver:client.setZkProver('wasm', { masterViewingKeyRegistration: true, createSplDepositWithHiddenAmount: true, });
Methods that rely on ZK proof generation (such as registerAccountForAnonymity) will throw an UmbraClientError if a prover has not been configured.
Call Signature
setZkProver(
type,config):void
Defined in: src/client/umbra-client.ts:285
Configures the zero-knowledge prover used by this client.
Parameters
type
"wasm"
config
Returns
void
Remarks
This method supports two configuration styles:
-
Pass an existing IZkProver instance:
const prover = new WasmZkProver({ masterViewingKeyRegistration: true }); client.setZkProver(prover); -
Use the
'wasm'shorthand to construct a WasmZkProver:client.setZkProver('wasm', { masterViewingKeyRegistration: true, createSplDepositWithHiddenAmount: true, });
Methods that rely on ZK proof generation (such as registerAccountForAnonymity) will throw an UmbraClientError if a prover has not been configured.
create()
Internal
Implementation of create that handles all overloads.
Call Signature
staticcreate(connectionBasedForwarder):UmbraClient
Defined in: src/client/umbra-client.ts:321
Creates an UmbraClient from a ConnectionBasedForwarder instance.
Parameters
connectionBasedForwarder
An existing ConnectionBasedForwarder instance that contains a Solana Connection
Returns
UmbraClient
A new UmbraClient instance
Remarks
Use this overload when you already have a configured ConnectionBasedForwarder instance and want to reuse it. This is useful when you need fine-grained control over the connection configuration or want to share a forwarder across multiple clients.
Connection Requirement: The ConnectionBasedForwarder must contain a valid Solana Connection, as all on-chain data fetching and transaction sending operations will use this connection.
Example
const forwarder = ConnectionBasedForwarder.fromConnection(connection);
const client = UmbraClient.create(forwarder);Call Signature
staticcreate(connection):UmbraClient
Defined in: src/client/umbra-client.ts:349
Creates an UmbraClient from a Solana Connection instance.
Parameters
connection
Connection
The Solana Connection instance to use for all on-chain operations
Returns
UmbraClient
A new UmbraClient instance
Remarks
Use this overload when you already have a Connection instance configured with your desired RPC endpoint, commitment level, or other connection settings. The client will create a ConnectionBasedForwarder internally using this connection.
Connection Requirement: This connection is absolutely necessary and will be used for:
- Fetching on-chain account data and program state
- Sending transactions to the network
- Confirming transaction status
- All other blockchain interactions
Example
const connection = new Connection('https://api.mainnet-beta.solana.com', {
commitment: 'confirmed'
});
const client = UmbraClient.create(connection);Call Signature
staticcreate(rpcUrl):UmbraClient
Defined in: src/client/umbra-client.ts:387
Creates an UmbraClient from an RPC URL.
Parameters
rpcUrl
string
The RPC endpoint URL (e.g., 'https://api.mainnet-beta.solana.com')
Returns
UmbraClient
A new UmbraClient instance
Remarks
This is the simplest way to create an UmbraClient. Just provide an RPC endpoint URL and the client will handle all connection setup internally. This is recommended for most use cases where you don't need custom connection configuration.
Connection Requirement: The RPC URL is absolutely necessary and will be used to create a Solana Connection that handles all on-chain operations:
- Fetching account data and program state from the blockchain
- Sending transactions to the network
- Confirming transaction status
- Querying transaction history and account information
The client will automatically:
- Create a Connection instance with the provided RPC URL
- Create a ConnectionBasedForwarder for transaction submission
- Initialize without an Umbra wallet (to be added later via
addUmbraWallet)
Example
// Mainnet
const client = UmbraClient.create('https://api.mainnet-beta.solana.com');
// Devnet
const client = UmbraClient.create('https://api.devnet.solana.com');
// Custom RPC
const client = UmbraClient.create('https://your-rpc-endpoint.com');getFeesConfigurationForClaimDepositConfidentiallyFromMixerPool()
staticgetFeesConfigurationForClaimDepositConfidentiallyFromMixerPool(_mintAddress,_amount):Promise<{commissionFees:U16;commissionFeesLowerBound:U128;commissionFeesUpperBound:U128; }>
Defined in: src/client/umbra-client.ts:3742
Retrieves the commission-fee slab configuration for confidential mixer-claim transactions.
Parameters
_mintAddress
SPL mint whose configuration should be fetched.
_amount
Claimed amount that determines which fee slab applies.
Returns
Promise<{ commissionFees: U16; commissionFeesLowerBound: U128; commissionFeesUpperBound: U128; }>
A promise that resolves to the commission fee metadata (basis points plus lower/ upper bounds) once implemented.
Remarks
The confidential-claim path requires the relayer to know the commission fee percentage (expressed in basis points) as well as the amount range (lower and upper bounds) that correspond to the slab being used. This helper will eventually return that metadata so callers can:
- Embed the same values inside the zero-knowledge proof inputs.
- Ensure the on-chain program enforces the same configuration when validating the proof.
The current implementation is a placeholder and always throws because the indexed fee configuration service has not been implemented yet.
Throws
UmbraClientError Always for now, until the configuration source exists.
getFeesConfigurationForPublicDepositIntoMixerPoolSol()
staticgetFeesConfigurationForPublicDepositIntoMixerPoolSol(_amount):Promise<{commissionFees:U16;commissionFeesLowerBound:U128;commissionFeesUpperBound:U128;relayerFees:U128; }>
Defined in: src/client/umbra-client.ts:2460
Returns the fee configuration for a public SOL deposit into the mixer pool.
Parameters
_amount
The intended deposit amount, used to determine the applicable fee slab.
Returns
Promise<{ commissionFees: U16; commissionFeesLowerBound: U128; commissionFeesUpperBound: U128; relayerFees: U128; }>
An object containing:
relayerFees: Absolute fee amount paid to the relayer.commissionFees: Commission fee in basis points (bps) applied to the net amount after relayer fees.commissionFeesLowerBound: Lower bound of the commission-fee slab for informational purposes.commissionFeesUpperBound: Upper bound of the commission-fee slab for informational purposes.
Remarks
In a production deployment this method is expected to look up fee slabs from an indexed
data source (or on-chain configuration) based on the provided _amount. The current
implementation is a placeholder that returns zero fees for all fields.
Example
const amount: Amount = 1_000_000_000n as Amount; // 1 SOL in lamports, for example
const fees = await UmbraClient.getFeesConfigurationForPublicDepositIntoMixerPoolSol(amount);
console.log(fees.relayerFees.toString());
console.log(fees.commissionFees.toString());getMerkleSiblingPathElements()
staticgetMerkleSiblingPathElements(_index): [U256LeBytes[], (0|1)[],U256LeBytes]
Defined in: src/client/umbra-client.ts:3949
Parameters
_index
Returns
[U256LeBytes[], (0 | 1)[], U256LeBytes]
getRandomRelayerForwarder()
staticgetRandomRelayerForwarder():Promise<RelayerForwarder>
Defined in: src/client/umbra-client.ts:553
Creates a relayer-based transaction forwarder using a randomly selected relayer.
Returns
Promise<RelayerForwarder>
A promise resolving to a RelayerForwarder instance.
Remarks
This method delegates to RelayerForwarder.getRandomRelayerForwarder, which queries
the Umbra relayer discovery service to obtain a suitable relayer public key.
getRelayerForwarder()
staticgetRelayerForwarder(relayerPublicKey):RelayerForwarder
Defined in: src/client/umbra-client.ts:540