Skip to main content

Documentation Index

Fetch the complete documentation index at: https://sdk.umbraprivacy.com/llms.txt

Use this file to discover all available pages before exploring further.

getPublicBalanceToEncryptedBalanceDirectDepositorFunction

Import: @umbra-privacy/sdk
function getPublicBalanceToEncryptedBalanceDirectDepositorFunction(
  args: GetPublicBalanceToEncryptedBalanceDirectDepositorFunctionArgs,
  deps?: GetPublicBalanceToEncryptedBalanceDirectDepositorFunctionDeps,
): PublicBalanceToEncryptedBalanceDirectDepositorFunction
Transfers tokens from a public associated token account (ATA) into a destination address’s encrypted balance. The destination must be registered on Umbra. This is the primary deposit path - no ZK proof required. Follows the dual-instruction pattern.

GetPublicBalanceToEncryptedBalanceDirectDepositorFunctionArgs

  • client: IUmbraClient

GetPublicBalanceToEncryptedBalanceDirectDepositorFunctionDeps

  • accountInfoProvider?: AccountInfoProviderFunction
  • getLatestBlockhash?: GetLatestBlockhash
  • transactionForwarder?: TransactionForwarder
  • getEpochInfo?: GetEpochInfo - Required for Token-2022 transfer fee calculation.

Returns

PublicBalanceToEncryptedBalanceDirectDepositorFunction
type PublicBalanceToEncryptedBalanceDirectDepositorFunction = (
  destinationAddress: Address,
  mint: Address,
  transferAmount: U64,
  options?: DepositIntoEncryptedBalanceOptions,
) => Promise<DepositResult>
  • destinationAddress: Address - The Umbra-registered recipient.
  • mint: Address - Token mint address.
  • transferAmount: U64 - Amount in base token units.

DepositIntoEncryptedBalanceOptions

  • priorityFees?: U64 - Compute unit price in micro-lamports. Default: 0n.
  • purpose?: number - Caller-defined purpose tag stored on-chain. Default: 0.
  • optionalData?: OptionalData32 - 32-byte caller metadata. Default: 32 zero bytes.
  • awaitCallback?: boolean - Whether to wait for the MPC callback. Default: true.
  • skipPreflight?: boolean - Skip Solana preflight simulation. Default: false.
  • maxRetries?: number - Max RPC retry attempts for transaction sending.
  • accountInfoCommitment?: Commitment - Per-call commitment for RPC account reads. Default: "confirmed".
  • epochInfoCommitment?: Commitment - Per-call commitment for epoch info fetches. Default: "confirmed".

DepositResult

interface DepositResult {
  queueSignature: TransactionSignature;
  callbackStatus?: "finalized" | "pruned" | "timed-out";
  callbackSignature?: TransactionSignature;
  callbackElapsedMs?: number;
  rentClaimSignature?: TransactionSignature;
  rentClaimError?: string;
}
  • queueSignature - Signature of the handler (queue computation) transaction.
  • callbackStatus - The outcome of computation monitoring: "finalized", "pruned", or "timed-out". Present when awaitCallback is true.
  • callbackSignature - Signature of the Arcium MPC callback. Present when callbackStatus is "finalized".
  • callbackElapsedMs - Milliseconds spent waiting for the callback.
  • rentClaimSignature - Signature for reclaiming rent from the computation account. Attempted regardless of callback outcome.
  • rentClaimError - Error from rent reclaim attempt, if any. The deposit itself still succeeded.

Errors

Throws EncryptedDepositError. See Errors.

Example

import { getPublicBalanceToEncryptedBalanceDirectDepositorFunction } from "@umbra-privacy/sdk";

const deposit = getPublicBalanceToEncryptedBalanceDirectDepositorFunction({ client });
const result = await deposit(recipientAddress, mintAddress, 1_000_000n);
console.log("Queue signature:", result.queueSignature);

getEncryptedBalanceToSelfClaimableUtxoCreatorFunction

Import: @umbra-privacy/sdk
function getEncryptedBalanceToSelfClaimableUtxoCreatorFunction(
  args: GetCreateSelfClaimableUtxoFromEncryptedBalanceFunctionArgs,
  deps: GetCreateSelfClaimableUtxoFromEncryptedBalanceFunctionDeps,
): CreateSelfClaimableUtxoFromEncryptedBalanceFunction
Creates a self-claimable UTXO in the mixer funded from the caller’s encrypted balance (encrypted balance -> Mixer). The created UTXO can only be claimed by the creator. Requires a ZK proof - deps.zkProver is required.

GetCreateSelfClaimableUtxoFromEncryptedBalanceFunctionArgs

  • client: IUmbraClient

GetCreateSelfClaimableUtxoFromEncryptedBalanceFunctionDeps

  • zkProver: IZkProverForSelfClaimableUtxo - Required. ZK proof generator for UTXO commitments. Use getCreateSelfClaimableUtxoFromEncryptedBalanceProver from @umbra-privacy/web-zk-prover — see ZK Provers. This operation submits two transactions: a proof account creation followed by the UTXO instruction.
  • blockhashProvider?: GetLatestBlockhash
  • accountInfoProvider?: AccountInfoProviderFunction
  • transactionForwarder?: TransactionForwarder
  • getEpochInfo?: GetEpochInfo
  • Additional cryptographic dependency overrides (key derivation, Poseidon, AES, commitment generators - all optional, default to SDK implementations).

Returns

CreateSelfClaimableUtxoFromEncryptedBalanceFunction
type CreateSelfClaimableUtxoFromEncryptedBalanceFunction = (
  args: CreateUtxoArgs,
  options?: CreateUtxoOptions,
) => Promise<TransactionSignature[]>
Returns two signatures: [proofAccountSignature, utxoCreationSignature].

CreateUtxoArgs

  • amount: U64 - Token amount in base units to lock into the UTXO.
  • destinationAddress: Address - The Umbra-registered owner of the UTXO (must equal the caller for self-claimable).
  • mint: Address - Token mint address.

CreateUtxoOptions

  • generationIndex?: U256 - Override the generation index used for key derivation. Defaults to the on-chain value.
  • optionalData?: OptionalData32 - 32-byte caller metadata.
  • createProofAccount?: TransactionCallbacks - Lifecycle hooks for the proof account creation transaction.
  • createUtxo?: TransactionCallbacks - Lifecycle hooks for the UTXO creation transaction.

Errors

Throws CreateUtxoError. See Errors.

getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction

Import: @umbra-privacy/sdk
function getEncryptedBalanceToReceiverClaimableUtxoCreatorFunction(
  args: GetCreateReceiverClaimableUtxoFromEncryptedBalanceFunctionArgs,
  deps: GetCreateReceiverClaimableUtxoFromEncryptedBalanceFunctionDeps,
): CreateReceiverClaimableUtxoFromEncryptedBalanceFunction
Creates a receiver-claimable UTXO in the mixer funded from the caller’s encrypted balance (encrypted balance -> Mixer). The UTXO is encrypted for the recipient’s X25519 key - only the recipient can claim it. Requires deps.zkProver (required).

GetCreateReceiverClaimableUtxoFromEncryptedBalanceFunctionArgs

  • client: IUmbraClient

GetCreateReceiverClaimableUtxoFromEncryptedBalanceFunctionDeps

  • zkProver: IZkProverForReceiverClaimableUtxo - Required. Use getCreateReceiverClaimableUtxoFromEncryptedBalanceProver from @umbra-privacy/web-zk-prover — see ZK Provers.
  • blockhashProvider?: GetLatestBlockhash
  • accountInfoProvider?: AccountInfoProviderFunction
  • transactionForwarder?: TransactionForwarder
  • getEpochInfo?: GetEpochInfo
  • Additional cryptographic dependency overrides (all optional).

Returns

CreateReceiverClaimableUtxoFromEncryptedBalanceFunction
type CreateReceiverClaimableUtxoFromEncryptedBalanceFunction = (
  args: CreateUtxoArgs,
  options?: CreateUtxoOptions,
) => Promise<TransactionSignature[]>
See CreateUtxoArgs and CreateUtxoOptions above.

Errors

Throws CreateUtxoError. See Errors.

getPublicBalanceToSelfClaimableUtxoCreatorFunction

Import: @umbra-privacy/sdk
function getPublicBalanceToSelfClaimableUtxoCreatorFunction(
  args: GetCreateSelfClaimableUtxoFromPublicBalanceFunctionArgs,
  deps: GetCreateSelfClaimableUtxoFromPublicBalanceFunctionDeps,
): CreateSelfClaimableUtxoFromPublicBalanceFunction
Creates a self-claimable UTXO in the mixer funded from a public ATA (ATA -> Mixer). No MPC required - the ZK proof is generated client-side. deps.zkProver is required.

GetCreateSelfClaimableUtxoFromPublicBalanceFunctionArgs

  • client: IUmbraClient

GetCreateSelfClaimableUtxoFromPublicBalanceFunctionDeps

  • zkProver: ZkProverForSelfClaimableUtxoFromPublicBalance - Required. Use getCreateSelfClaimableUtxoFromPublicBalanceProver from @umbra-privacy/web-zk-prover — see ZK Provers.
  • blockhashProvider?: GetLatestBlockhash
  • accountInfoProvider?: AccountInfoProviderFunction
  • transactionForwarder?: TransactionForwarder
  • getEpochInfo?: GetEpochInfo
  • masterViewingKeyGenerator?: MasterViewingKeyGeneratorFunction
  • masterViewingKeyBlindingFactorGenerator?: MasterViewingKeyBlindingFactorGeneratorFunction
  • poseidonPrivateKeyGenerator?: PoseidonPrivateKeyGeneratorFunction
  • poseidonBlindingFactorGenerator?: PoseidonBlindingFactorGeneratorFunction
  • userAccountX25519KeypairGenerator?: Curve25519KeypairGeneratorFunction
  • secondViewingKeyGenerator?: SecondViewingKeyGeneratorFunction
  • ephemeralUtxoMasterViewingKeyGenerator?: EphemeralUtxoMasterViewingKeyGeneratorFunction
  • ephemeralUtxoMasterViewingKeyBlindingFactorGenerator?: EphemeralUtxoMasterViewingKeyBlindingFactorGeneratorFunction
  • ephemeralUtxoPoseidonKeyGenerator?: EphemeralUtxoPoseidonPrivateKeyGeneratorFunction
  • ephemeralUtxoPoseidonKeyBlindingFactorGenerator?: EphemeralUtxoPoseidonPrivateKeyBlindingFactorGeneratorFunction
  • poseidonKeystreamBlindingFactorGenerator?: PoseidonKeystreamBlindingFactorGeneratorFunction
  • poseidonHasher?: PoseidonHashFunction
  • aesEncryptor?: AesEncryptorFunction
  • userCommitmentGenerator?: UserCommitmentGeneratorFunction
  • h2Generator?: H2GeneratorFns
  • keystreamCommitmentGenerator?: KeystreamCommitmentFunction
  • poseidonEncryptor?: PoseidonEncryptorFunction
  • poseidonKeystreamGenerator?: PoseidonKeystreamGeneratorFunction
  • getUtcNow?: () => UtcTimestampComponents

Returns

CreateSelfClaimableUtxoFromPublicBalanceFunction
type CreateSelfClaimableUtxoFromPublicBalanceFunction = (
  args: CreateUtxoArgs,
  options?: CreateUtxoFromPublicBalanceOptions,
) => Promise<TransactionSignature[]>

CreateUtxoFromPublicBalanceOptions

  • generationIndex?: U256
  • optionalData?: OptionalData32
  • createUtxo?: TransactionCallbacks - Lifecycle hooks for the single UTXO creation transaction.

Errors

Throws CreateUtxoError. See Errors.

getPublicBalanceToReceiverClaimableUtxoCreatorFunction

Import: @umbra-privacy/sdk
function getPublicBalanceToReceiverClaimableUtxoCreatorFunction(
  args: GetCreateReceiverClaimableUtxoFromPublicBalanceFunctionArgs,
  deps: GetCreateReceiverClaimableUtxoFromPublicBalanceFunctionDeps,
): CreateReceiverClaimableUtxoFromPublicBalanceFunction
Creates a receiver-claimable UTXO funded from a public ATA (ATA -> Mixer). The UTXO is encrypted for the recipient - only they can claim it. deps.zkProver is required.

GetCreateReceiverClaimableUtxoFromPublicBalanceFunctionArgs

  • client: IUmbraClient

GetCreateReceiverClaimableUtxoFromPublicBalanceFunctionDeps

  • zkProver: ZkProverForReceiverClaimableUtxoFromPublicBalance - Required. Use getCreateReceiverClaimableUtxoFromPublicBalanceProver from @umbra-privacy/web-zk-prover — see ZK Provers.
  • blockhashProvider?: GetLatestBlockhash
  • accountInfoProvider?: AccountInfoProviderFunction
  • transactionForwarder?: TransactionForwarder
  • getEpochInfo?: GetEpochInfo
  • Additional cryptographic dependency overrides (all optional).

Returns

CreateReceiverClaimableUtxoFromPublicBalanceFunction
type CreateReceiverClaimableUtxoFromPublicBalanceFunction = (
  args: CreateUtxoArgs,
  options?: CreateReceiverClaimableUtxoFromPublicBalanceOptions,
) => Promise<TransactionSignature[]>

CreateReceiverClaimableUtxoFromPublicBalanceOptions

  • generationIndex?: U256
  • optionalData?: OptionalData32
  • createUtxo?: TransactionCallbacks

Errors

Throws CreateUtxoError. See Errors.

EncryptedDepositError

Thrown by getPublicBalanceToEncryptedBalanceDirectDepositorFunction. Stage values: "initialization" | "validation" | "mint-fetch" | "fee-calculation" | "pda-derivation" | "account-fetch" | "instruction-build" | "transaction-build" | "transaction-compile" | "transaction-sign" | "transaction-validate" | "transaction-send" See Errors for full documentation.

CreateUtxoError

Thrown by all four UTXO creation functions. Stage values: "initialization" | "validation" | "account-fetch" | "mint-fetch" | "fee-calculation" | "key-derivation" | "zk-proof-generation" | "pda-derivation" | "instruction-build" | "transaction-build" | "transaction-compile" | "transaction-sign" | "transaction-validate" | "transaction-send" See Errors for full documentation.