Import Path
Error Hierarchy
Staged Errors
Every major SDK operation throws a dedicated staged error. Thestage field pinpoints exactly where in the pipeline the failure occurred.
EncryptedDepositError
Thrown bygetDirectDepositIntoEncryptedBalanceFunction.
"initialization"- Factory construction failed. Missing required arguments."validation"- Invalid mint address, zero amount, or unregistered destination."mint-fetch"- Failed to fetch the mint account. Check RPC and mint address."fee-calculation"- Token-2022 transfer fee calculation failed. Epoch info issue."pda-derivation"- Failed to derive required PDAs."account-fetch"- Failed to fetch the destination user or token account."instruction-build"- Failed to construct the instruction. Protocol state mismatch."transaction-build"- Failed to assemble the transaction. Blockhash fetch failure."transaction-compile"- Failed to compile the transaction. Lookup table mismatch."transaction-sign"- Wallet rejected signing."transaction-validate"- Pre-flight simulation failed. Insufficient funds or account state mismatch."transaction-send"- Transaction sent but confirmation timed out. May still have landed.
EncryptedWithdrawalError
Thrown bygetDirectWithdrawIntoPublicBalanceV3Function.
"initialization"- Factory construction failed."validation"- Zero amount or no encrypted balance exists for this mint."mint-fetch"- Failed to fetch the mint account."pda-derivation"- Failed to derive required PDAs."instruction-build"- Failed to construct the instruction."transaction-build"- Blockhash fetch failure."transaction-compile"- Failed to compile the transaction."transaction-sign"- Wallet rejected signing."transaction-send"- Confirmation timed out. May still have landed.
RegistrationError
Thrown bygetUserRegistrationFunction.
"initialization"- Factory construction failed."master-seed-derivation"- User declined to sign the master seed derivation message."account-fetch"- Failed to fetch on-chain account state. RPC connectivity issue."key-derivation"- Cryptographic key derivation from master seed failed."zk-proof-generation"- Groth16 proof generation failed (anonymous step only)."pda-derivation"- Failed to derive required PDAs."instruction-build"- Failed to construct an instruction."transaction-build"- Blockhash fetch failure."transaction-compile"- Failed to compile the transaction."transaction-sign"- Wallet rejected signing."transaction-validate"- Pre-flight simulation failed."transaction-send"- Confirmation timed out. May still have landed.
ConversionError
Thrown bygetConvertToSharedEncryptionFunction and getRotateMintX25519EncryptionKeyFunction.
"initialization"- Factory construction failed."account-fetch"- Failed to fetch token account state."pda-derivation"- Failed to derive required PDAs."instruction-build"- Failed to construct the conversion instruction."transaction-build"- Blockhash fetch or transaction assembly failed."transaction-compile"- Failed to compile the transaction."transaction-sign"- Wallet rejected a per-mint transaction."transaction-validate"- Pre-flight simulation failed."transaction-send"- Confirmation timed out. Already-converted mints remain on-chain.
CreateUtxoError
Thrown by all four UTXO creation factory functions."initialization"- Factory construction failed."validation"- Invalid recipient, mint, or amount."account-fetch"- Failed to fetch the recipient’s on-chain account."mint-fetch"- Failed to fetch mint account data."fee-calculation"- Token-2022 transfer fee calculation failed."key-derivation"- Key derivation from master seed failed."zk-proof-generation"- Groth16 proof generation failed."pda-derivation"- Failed to derive required PDAs."instruction-build"- Failed to construct the instruction."transaction-build"- Blockhash fetch or transaction assembly failed."transaction-compile"- Failed to compile the transaction."transaction-sign"- Wallet rejected signing."transaction-validate"- Pre-flight simulation failed."transaction-send"- Confirmation timed out. May still have landed - check before retrying.
FetchUtxosError
Thrown bygetFetchClaimableUtxosFunction.
"initialization"- Factory construction failed.indexerApiEndpointnot configured."validation"- InvalidtreeIndexor insertion index parameters."key-derivation"- X25519 private key derivation from master seed failed."indexer-fetch"- Indexer HTTP call failed (unreachable, rate-limited, or error response)."proof-fetch"- Merkle proof HTTP call failed.
ClaimUtxoError
Thrown by all three claim factory functions."initialization"- Factory construction failed."validation"- Invalid UTXO data or parameters."key-derivation"- Key derivation from master seed failed."zk-proof-generation"- Groth16 proof generation failed."pda-derivation"- Failed to derive required PDAs."instruction-build"- Failed to construct the instruction."transaction-build"- Blockhash fetch or transaction assembly failed."transaction-compile"- Failed to compile the transaction."transaction-sign"- Wallet rejected signing."transaction-validate"- Pre-flight simulation failed. Often indicates a stale Merkle proof - fetch fresh UTXOs."transaction-send"- Confirmation timed out. Verify on-chain before retrying - the nullifier may have been burned.
QueryError
Thrown bygetQueryUserAccountFunction and getQueryEncryptedBalanceFunction.
"initialization"- Factory-level validation failed."pda-derivation"- PDA address generation failed."account-fetch"- RPC fetch failed (node unreachable or returned an error)."account-decode"- On-chain account data could not be decoded. Unexpected on-chain state."key-derivation"- X25519 key derivation failed (encrypted balance query only)."decryption"- Rescue cipher decryption failed (encrypted balance query only).
Base Error Primitives
These are the underlying error types. All staged errors extendUmbraError.
UmbraError
Base class for all SDK errors.CryptographyError
Thrown when a cryptographic operation fails - most commonly ZK proof generation or Rescue cipher encryption/decryption.InstructionError
Thrown when instruction construction fails - typically a protocol state mismatch or missing on-chain account.RpcError
Thrown when an RPC or indexer HTTP call fails.TransactionError
Thrown when a transaction fails on-chain (simulation rejection or network rejection).TransactionSigningError
Thrown when a wallet rejects a transaction signing request. ExtendsTransactionError.
MasterSeedSigningRejectedError
Thrown when the user declines to sign the master seed derivation message. ExtendsTransactionSigningError. Always has wasRejected: true. Error code: "MASTER_SEED_SIGNING_REJECTED".
This surfaces during the first operation that needs key material in a session - typically register(), or getUmbraClientFromSigner() in non-deferred mode.
Retry Strategy
"transaction-sign"/MasterSeedSigningRejectedError- Do not retry. User cancelled. Never auto-retry a wallet prompt rejection."transaction-send"with asignaturepresent - Check first. The transaction may have landed. Verify on-chain before submitting again to avoid double submissions."transaction-validate"- Fix inputs first. Pre-flight simulation failed. Diagnose the root cause before retrying."transaction-validate"for claims - May indicate a stale Merkle proof. Fetch fresh UTXOs before retrying.isRpcError- Safe to retry with exponential backoff. Transient network issue.- All other stages - Safe to retry with exponential backoff.