getUmbraClientFromSigner
Import:@umbra-privacy/sdk
IUmbraClient that all factory functions consume.
By default this immediately prompts the wallet to sign the master seed derivation message. Pass deferMasterSeedSignature: true to skip that prompt at construction time - it will be requested on the first operation that requires key material.
GetUmbraClientFromSignerArgs
signer: IUmbraSigner- Connected wallet. Must implementsignMessageandsignTransaction.network: Network-"mainnet"|"devnet"|"localnet".rpcUrl: string- HTTPS RPC endpoint URL for the Solana cluster.rpcSubscriptionsUrl: string- WebSocket RPC endpoint URL for transaction confirmation.indexerApiEndpoint?: string- Base URL for the Umbra indexer (e.g."https://acqzie0a1h.execute-api.eu-central-1.amazonaws.com"). Required for mixer operations (getFetchClaimableUtxosFunction).commitment?: "processed" | "confirmed" | "finalized"- Commitment level for RPC calls. Defaults to"confirmed".deferMasterSeedSignature?: boolean- Skip the master seed signature prompt at construction time. Defaults tofalse.versions?- Override version specifiers. Leave unset to use SDK defaults.protocol?: ProtocolVersionSpecifierFunctionalgorithm?: AlgorithmVersionSpecifierFunctionscheme?: SchemeVersionSpecifierFunction
offsets?- Per-key derivation path offsets (U512). Used for key rotation - leave unset unless rotating.masterViewingKey?: U512poseidonPrivateKey?: U512x25519UserAccountPrivateKey?: U512x25519MasterViewingKeyEncryptingPrivateKey?: U512mintX25519PrivateKey?: U512rescueCommitmentBlindingFactor?: U512randomCommitmentFactor?: U512
GetUmbraClientFromSignerDeps
All fields are optional. Provide overrides for custom infrastructure or testing.accountInfoProvider?: AccountInfoProviderFunction- Override the default RPC-based account fetcher.blockhashProvider?: GetLatestBlockhash- Override the default blockhash fetcher.transactionForwarder?: TransactionForwarder- Override transaction broadcasting (e.g. for Jito bundles or custom retry logic).epochInfoProvider?: GetEpochInfo- Override the epoch info fetcher (used for Token-2022 fee schedules).masterSeedStorage?- Override master seed persistence.load?: MasterSeedLoaderFunction- Load the cached master seed (e.g. from encrypted local storage).store?: MasterSeedStorerFunction- Persist the master seed after derivation.generate?: MasterSeedGeneratorFunction- Derive the master seed from a wallet signature (override the default KMAC256-based derivation).
Returns
Promise<IUmbraClient> - The client configuration object. Pass client to every factory function.
Example
IUmbraClient
The read-only configuration object produced bygetUmbraClientFromSigner. All factory functions accept it as args.client. Do not call methods on it directly.
signer: IUmbraSigner- The connected wallet.network: Network- The configured network.networkConfig: NetworkConfig- On-chain program IDs and addresses for the configured network.versions: ResolvedVersions- Resolved protocol, algorithm, and scheme version identifiers.offsets: ResolvedOffsets- Resolved key derivation offsets.commitment: "processed" | "confirmed" | "finalized"- Configured commitment level.accountInfoProvider: AccountInfoProviderFunction- Account data fetcher (RPC-based or overridden).blockhashProvider: GetLatestBlockhash- Blockhash fetcher (RPC-based or overridden).transactionForwarder: TransactionForwarder- Transaction broadcaster (WebSocket-based or overridden).epochInfoProvider: GetEpochInfo- Epoch info fetcher (RPC-based or overridden).fetchMerkleProof?: FetchMerkleProofFunction- Indexer-based Merkle proof fetcher. Present only whenindexerApiEndpointis set.fetchUtxoData?: FetchUtxoDataFunction- Indexer-based UTXO discovery fetcher. Present only whenindexerApiEndpointis set.masterSeed: { load, store, generate, getMasterSeed }- Master seed storage operations.loadattempts to load an existing seed,storepersists it,generatederives a new seed via signature, andgetMasterSeedis a convenience method combining load and generate.
IUmbraSigner
The wallet interface the SDK requires. Any connected wallet that can sign messages and transactions satisfies this interface.address
The base58-encoded Ed25519 public key that uniquely identifies this signer on the Solana network. Used as the account owner, fee payer identifier, and key lookup in signed transactions.address: Address- Read-only public address.
signTransaction
Signs a compiled Solana versioned transaction.transaction: SignableTransaction- The versioned transaction to sign.- Returns:
Promise<SignedTransaction>- The signed transaction ready for network submission.
signTransactions
Signs multiple transactions in a batch. Returns them in the same order with signatures added.transactions: readonly SignableTransaction[]- Array of transactions to sign.- Returns:
Promise<SignedTransaction[]>- The signed transactions in the same order as input.
signMessage
Signs an arbitrary byte sequence. Used once per session to derive the master seed - this is the only non-transaction signature the user sees.message: Uint8Array- The bytes to sign. The SDK passes a deterministic human-readable message encoding the derivation intent.- Returns:
Promise<SignedMessage>- Contains the original message bytes, the 64-byte Ed25519 signature, and the signer’s address.
Network
GetUmbraClientFromSignerArgs.network.