Skip to main content
This reference covers the full public API surface of @umbra-privacy/sdk. Pages are organized by feature area - each section documents factory functions alongside their parameter types, result types, and associated errors.

Import Paths

  • @umbra-privacy/sdk - getUmbraClientFromSigner, all service factory functions, cryptographic primitives
  • @umbra-privacy/sdk/errors - All error classes, type guards, and stage union types
  • @umbra-privacy/sdk/types - Branded primitive types and assertion functions
  • @umbra-privacy/sdk/interfaces - TypeScript function type definitions
  • @umbra-privacy/sdk/utils - Converter utilities, PDA derivation helpers, address utilities
  • @umbra-privacy/sdk/constants - Network configs, program constants, domain separators

Factory Function Pattern

Every SDK operation follows the same two-step pattern:
// Step 1 - build the function once (at setup time)
const operation = getOperationFunction({ client }, deps?);

// Step 2 - call it at runtime
const result = await operation(/* runtime arguments */);
The factory (getOperationFunction) captures configuration and optional dependency overrides. The returned function is what you call per-operation. The optional deps argument accepts injectable overrides for RPC providers, key generators, and ZK provers - useful for unit testing or custom infrastructure (e.g. Jito bundles, hardware key storage).

Common Types

Types referenced across all pages:
  • Address - Base58-encoded Solana public key string (string branded).
  • TransactionSignature - Base58-encoded transaction signature string.
  • U64 - Branded bigint constrained to unsigned 64-bit range.
  • U128 - Branded bigint for unsigned 128-bit values.
  • U256 - Branded bigint for unsigned 256-bit values.
  • U512 - Branded bigint for unsigned 512-bit values.
  • X25519PublicKey - 32-byte Uint8Array Diffie-Hellman public key.
  • RcEncryptionNonce - Rescue cipher encryption nonce (branded Uint8Array).
  • OptionalData32 - 32-byte Uint8Array for caller-defined metadata attached to on-chain instructions. Defaults to 32 zero bytes when omitted.
  • TransactionCallbacks - { pre?: (tx: CompiledTransaction) => Promise<void>; post?: (tx: CompiledTransaction, sig: TransactionSignature) => Promise<void> }. Hooks invoked before signing and after confirmation.
  • IUmbraClient - The client configuration object produced by getUmbraClientFromSigner. Passed to every factory function as args.client.
  • Network - "mainnet" | "devnet" | "localnet".

Pages in This Reference

  • Client - getUmbraClientFromSigner, IUmbraClient, IUmbraSigner
  • Registration - User registration, key rotation, seed updates, staged fund recovery
  • Deposit - Direct deposit, self-claimable and receiver-claimable UTXO creation
  • Withdrawal - Direct withdrawal from encrypted balance to public balance
  • Query - User account and encrypted balance queries
  • Conversion - Convert to shared encryption, rotate per-mint X25519 key
  • Mixer - Fetch claimable UTXOs, claim into encrypted or public balance
  • Compliance - Compliance grants, re-encryption operations
  • Errors - All error classes, stage enums, type guards, and the error hierarchy