@umbra-privacy/sdk@5.x (V18). Pages are organised by feature area — each section documents factory functions alongside their parameter types, result types, and associated errors.
Main barrel + subpaths
The main@umbra-privacy/sdk barrel re-exports a small, stable surface — getUmbraClient, the four signer factories, the full error hierarchy, the Result<T,E> helpers, and everything from infrastructure/{arcium, indexer, relayer, solana, zk-prover}. Operation factories require named subpath imports.
| Subpath | Contents |
|---|---|
@umbra-privacy/sdk | getUmbraClient, signers, errors, Result<T,E>, indexer + relayer + zk-prover + solana + arcium infra |
@umbra-privacy/sdk/client | IUmbraClient, IUmbraSigner interfaces |
@umbra-privacy/sdk/shared | UMBRA_MESSAGE_TO_SIGN and protocol-wide constants |
@umbra-privacy/sdk/registration | getUserRegistrationFunction, executors, build helpers |
@umbra-privacy/sdk/deposit | Direct ATA→ETA deposit + 4 Stealth Pool Note creators (ATA/ETA × self/receiver) |
@umbra-privacy/sdk/withdrawal | ETA→ATA withdrawer |
@umbra-privacy/sdk/transfer | getTransferorFunction — ETA-to-ETA direct transfer, 8 variants |
@umbra-privacy/sdk/burn | Note scanner + 3 burner factories + enrichWithMerkleProof |
@umbra-privacy/sdk/query | Encrypted-balance + user-account queriers |
@umbra-privacy/sdk/conversion | MXE-only → Shared converter |
@umbra-privacy/sdk/compliance | Grant issuer / revoker / 3 reencryptors / 3 queriers |
@umbra-privacy/sdk/account | Staged-token recoverers, key rotators, maintenance |
@umbra-privacy/sdk/zk-prover | One factory per Groth16 circuit |
@umbra-privacy/sdk/zk-prover/cdn | getCdnZkAssetProvider |
@umbra-privacy/sdk/store-adapters | createBrowserStorageBackend, createFileStorageBackend, sharded + in-memory UTXO + nullifier stores |
@umbra-privacy/sdk/store | Base store interfaces |
@umbra-privacy/sdk/indexer, …/indexer/utxo, …/indexer/nullifier | Typed indexer clients |
@umbra-privacy/sdk/errors | Error classes + is* type guards |
@umbra-privacy/sdk/types | Branded primitives (U64, Address, …) + create* helpers |
@umbra-privacy/sdk/constants | BPS_DIVISOR, mint lists, domain separators |
@umbra-privacy/sdk/crypto, …/crypto/poseidon, …/crypto/rescue, …/crypto/aes, …/crypto/key-derivation, …/crypto/challenges, …/crypto/commitment | Cryptographic primitives |
@umbra-privacy/sdk/converters | Encoding / byte-conversion utilities |
@umbra-privacy/sdk/arcium | Arcium MPC types + helpers + generateRandomNonce (also re-exported from main barrel) |
@umbra-privacy/sdk/temporal, …/validation, …/hooks, …/pipeline, …/fee-provider, …/math | Utilities |
@umbra-privacy/sdk/pda, …/solana, …/token | Solana / PDA / token helpers |
@umbra-privacy/sdk/arcium | Arcium types + helpers |
Factory Function Pattern
Every SDK operation follows the same two-step pattern:getOperationFunction) captures configuration and optional dependency overrides. The optional deps argument accepts injectable overrides for RPC providers, key generators, ZK provers, and (for burners) relayer adapters — 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— Brandedbigintconstrained to the unsigned 64-bit range.U128— Brandedbigintfor unsigned 128-bit values.U256— Brandedbigintfor unsigned 256-bit values.U512— Brandedbigintfor unsigned 512-bit values.X25519PublicKey— 32-byteUint8ArrayDiffie-Hellman public key.RescueCipherEncryptionNonce— Rescue cipher encryption nonce (brandedUint8Array).OptionalData32— 32-byteUint8Arrayfor caller-defined metadata attached to on-chain instructions. Defaults to 32 zero bytes when omitted. Must be pre-hashed or pre-encrypted — never store plaintext identifiers.IUmbraClient— The client configuration object produced bygetUmbraClient. Passed to every factory asargs.client.Network—"mainnet" | "devnet" | "localnet".DecryptedStealthPoolNoteData— A decrypted note returned by the scanner. Passed directly to a burner factory.ScannedStealthPoolNoteResult— The scanner’s return value; four buckets of notes by(kind, source)plusscannedTreesprogress.
Pages in this reference
- Client —
getUmbraClient,IUmbraClient,IUmbraSigner. - Registration —
getUserRegistrationFunction, sub-step executors. - Deposit — Direct ATA→ETA deposit + 4 Stealth Pool Note creators.
- Withdrawal — Direct ETA→ATA withdrawal.
- Query — User-account and encrypted-balance queriers.
- Conversion — MXE-only → Shared converter.
- Stealth Pool (Mixer) — Note scanner + 3 burner factories.
- Compliance — Grants, re-encryption, viewing-key derivers.
- Errors — All error classes, stage enums, type guards, and the error hierarchy.