@umbra-privacy/sdk 2.1.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GP26R377.js → chunk-AUNYA6JP.js} +2 -2
- package/dist/chunk-AUNYA6JP.js.map +1 -0
- package/dist/{chunk-BL6WXLPV.cjs → chunk-KCHHJKQN.cjs} +2 -2
- package/dist/chunk-KCHHJKQN.cjs.map +1 -0
- package/dist/{chunk-KMRROOME.js → chunk-YA66JLHI.js} +9 -4
- package/dist/chunk-YA66JLHI.js.map +1 -0
- package/dist/{chunk-3LS5P32X.cjs → chunk-YFUGKMNS.cjs} +9 -4
- package/dist/chunk-YFUGKMNS.cjs.map +1 -0
- package/dist/{client-Cb53GYes.d.cts → client-Baxe29tj.d.cts} +128 -51
- package/dist/{client-CJ5S6Qln.d.ts → client-Cqv_5hHQ.d.ts} +128 -51
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/crypto/index.cjs +142 -142
- package/dist/crypto/index.d.cts +1 -1
- package/dist/crypto/index.d.ts +1 -1
- package/dist/crypto/index.js +1 -1
- package/dist/errors/index.cjs +28 -28
- package/dist/errors/index.d.cts +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/{errors-DAIrstEL.d.cts → errors-BqAlwXfh.d.cts} +3 -5
- package/dist/{errors-DPNMfyh0.d.ts → errors-Crx4Jf9K.d.ts} +3 -5
- package/dist/{index-B5wNTNZr.d.cts → index-BRLHQNe9.d.cts} +27 -12
- package/dist/{index-Cd76ZBHA.d.ts → index-gpTrCX61.d.ts} +27 -12
- package/dist/index.cjs +816 -1072
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -263
- package/dist/index.d.ts +12 -263
- package/dist/index.js +321 -573
- package/dist/index.js.map +1 -1
- package/dist/indexer-NHZDFABY.js +311 -0
- package/dist/indexer-NHZDFABY.js.map +1 -0
- package/dist/indexer-XOUBVRNU.cjs +316 -0
- package/dist/indexer-XOUBVRNU.cjs.map +1 -0
- package/dist/interfaces/index.d.cts +2 -2
- package/dist/interfaces/index.d.ts +2 -2
- package/dist/solana/index.d.cts +2 -2
- package/dist/solana/index.d.ts +2 -2
- package/dist/{transaction-forwarder-Dme9whAc.d.ts → transaction-forwarder-Cv3OlsaZ.d.ts} +1 -1
- package/dist/{transaction-forwarder-0GZRKXIr.d.cts → transaction-forwarder-DH07CEkG.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-3LS5P32X.cjs.map +0 -1
- package/dist/chunk-BL6WXLPV.cjs.map +0 -1
- package/dist/chunk-GP26R377.js.map +0 -1
- package/dist/chunk-KMRROOME.js.map +0 -1
|
@@ -432,5 +432,5 @@ function isQueryError(error) {
|
|
|
432
432
|
__name(isQueryError, "isQueryError");
|
|
433
433
|
|
|
434
434
|
export { ClaimUtxoError, ComputationMonitorError, ConversionError, CreateUtxoError, EncryptedDepositError, EncryptedWithdrawalError, FetchUtxosError, InstructionError, MasterSeedSigningRejectedError, QueryError, RegistrationError, RpcError, TransactionError, TransactionSigningError, isClaimUtxoError, isComputationMonitorError, isConversionError, isCreateUtxoError, isEncryptedDepositError, isEncryptedWithdrawalError, isFetchUtxosError, isInstructionError, isQueryError, isRegistrationError, isRpcError, isTransactionError, isTransactionSigningError };
|
|
435
|
-
//# sourceMappingURL=chunk-
|
|
436
|
-
//# sourceMappingURL=chunk-
|
|
435
|
+
//# sourceMappingURL=chunk-AUNYA6JP.js.map
|
|
436
|
+
//# sourceMappingURL=chunk-AUNYA6JP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/arcium/errors.ts","../src/solana/errors.ts","../src/umbra/errors.ts"],"names":[],"mappings":";;;;AAwEO,IAAM,uBAAA,GAAN,cAAsC,UAAA,CAAW;AAAA,EAxExD;AAwEwD,IAAA,MAAA,CAAA,IAAA,EAAA,yBAAA,CAAA;AAAA;AAAA;AAAA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A,EAAM,SAAS,KAAA,CAAM,WAAA,GAAc,UAAA,CAAW,GAAA,EAAK,GAAG,CAAC,CAAA,CAAA;AAAA,MACvD;AAAA,KACD,CAAA;AACD,IAAA,IAAA,CAAK,IAAA,GAAO,YAAA;AACZ,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF;AAGO,SAAS,aAAa,KAAA,EAAqC;AAChE,EAAA,OAAO,KAAA,YAAiB,UAAA;AAC1B;AAFgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA","file":"chunk-AUNYA6JP.js","sourcesContent":["/**\n * Arcium Error Classes\n *\n * Provides error classes for Arcium MPC computation monitoring failures.\n * Each error carries a {@link ComputationMonitorStage} field that identifies\n * exactly where in the monitoring pipeline the failure occurred.\n *\n * @module arcium/errors\n * @since 2.0.0\n */\n\nimport { UmbraError } from \"../common/errors\";\n\n// =============================================================================\n// COMPUTATION MONITOR\n// =============================================================================\n\n/**\n * Stage of the computation monitoring operation where an error occurred.\n *\n * @remarks\n * Each stage represents a distinct phase in the monitoring flow:\n *\n * - `subscription` — WebSocket subscription setup or notification stream failed\n * - `account-fetch` — HTTP RPC fetch of the ComputationAccount failed\n * - `account-decode` — Failed to decode the ComputationAccount from raw bytes\n * - `timeout` — Monitoring timed out before the computation finalized\n * - `signature-retrieval` — `getSignaturesForAddress` call failed after finalization\n *\n * @since 2.0.0\n * @public\n */\nexport type ComputationMonitorStage =\n | \"subscription\"\n | \"account-fetch\"\n | \"account-decode\"\n | \"timeout\"\n | \"signature-retrieval\";\n\n/**\n * Error thrown when a computation monitoring operation fails.\n *\n * @remarks\n * Thrown by {@link ComputationMonitor} implementations when the monitoring\n * loop encounters an unrecoverable failure. The {@link stage} field identifies\n * exactly where in the monitoring pipeline the failure occurred, enabling\n * callers to implement targeted recovery strategies.\n *\n * The error code follows the format `COMPUTATION_MONITOR_{STAGE}` where\n * `{STAGE}` is the uppercase, underscore-delimited stage name.\n *\n * @example\n * ```typescript\n * try {\n * const prepared = await monitor.prepareMonitor(computationAddress, {\n * safetyTimeoutMs: 60_000,\n * });\n * const result = await prepared.awaitComputation();\n * } catch (error) {\n * if (isComputationMonitorError(error)) {\n * switch (error.stage) {\n * case \"subscription\":\n * console.log(\"WebSocket connection failed — try polling monitor\");\n * break;\n * }\n * }\n * }\n * ```\n *\n * @since 2.0.0\n * @public\n */\nexport class ComputationMonitorError extends UmbraError {\n /** The monitoring stage where the failure occurred. */\n readonly stage: ComputationMonitorStage;\n\n /**\n * @param stage - The monitoring pipeline stage where the failure occurred.\n * @param message - A human-readable description of the error.\n * @param cause - The underlying error that caused this failure, if any.\n */\n constructor(stage: ComputationMonitorStage, message: string, cause?: Error) {\n super(message, {\n code: `COMPUTATION_MONITOR_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"ComputationMonitorError\";\n this.stage = stage;\n }\n}\n\n/**\n * Type guard to check if a value is a {@link ComputationMonitorError}.\n *\n * @param error - The value to test.\n * @returns `true` and narrows `error` to {@link ComputationMonitorError} when\n * the value is an instance of `ComputationMonitorError`.\n *\n * @example\n * ```typescript\n * catch (error) {\n * if (isComputationMonitorError(error)) {\n * console.log(error.stage); // TypeScript knows this is ComputationMonitorStage\n * }\n * }\n * ```\n *\n * @since 2.0.0\n * @public\n */\nexport function isComputationMonitorError(error: unknown): error is ComputationMonitorError {\n return error instanceof ComputationMonitorError;\n}\n","/**\n * Solana-Specific Error Classes.\n *\n * This module defines the structured error hierarchy for Solana-related failures\n * in the Umbra SDK. All classes extend `UmbraError` from `../common/errors` and\n * carry structured context that makes programmatic error handling and logging\n * straightforward.\n *\n * @remarks\n * The error hierarchy is:\n * ```\n * UmbraError (base)\n * ├── InstructionError — instruction build/validation failures\n * ├── RpcError — JSON-RPC request failures\n * └── TransactionError — transaction lifecycle failures\n * ├── TransactionSigningError — signing-phase failures\n * │ └── MasterSeedSigningRejectedError — master seed derivation rejection\n * ```\n *\n * **Type guards** — Each concrete error class has a matching `is*` type guard\n * function ({@link isInstructionError}, {@link isRpcError},\n * {@link isTransactionError}, {@link isTransactionSigningError}). Prefer these\n * over `instanceof` checks in code that may cross module or bundle boundaries,\n * where `instanceof` can fail due to different class references.\n *\n * **Recovery strategies by error type:**\n *\n * - `InstructionError` — inspect `instructionName` and `context` to determine\n * which account is missing or which parameter is invalid; fix the call site.\n *\n * - `RpcError` — check `statusCode` (HTTP) and `rpcErrorCode` (JSON-RPC) to\n * distinguish rate limiting (429), node overload (503), or invalid request\n * (400). Transient errors are typically retryable.\n *\n * - `TransactionError` — check `simulationLogs` for program error messages that\n * identify the on-chain failure. If `signature` is set, the transaction landed\n * on-chain but was reverted.\n *\n * - `TransactionSigningError` — check `wasRejected` to distinguish a deliberate\n * user rejection from a hardware wallet communication failure.\n *\n * - `MasterSeedSigningRejectedError` — the user declined the master seed\n * derivation message; prompt the user and retry with `getUmbraClient`.\n *\n * @packageDocumentation\n */\n\nimport { UmbraError } from \"../common/errors\";\n\n/**\n * Error thrown when building or validating a Solana instruction fails.\n *\n * This error is raised during the instruction-construction phase — before any\n * RPC or network interaction occurs. Common causes include missing required\n * accounts, invalid parameter values, PDA derivation failures, and instruction\n * serialization errors.\n *\n * @remarks\n * The `instructionName` field identifies which instruction failed, which is\n * particularly useful when a single SDK operation constructs multiple\n * instructions. The `context` field (inherited from `UmbraError`) carries\n * arbitrary key-value pairs for additional diagnostic information, such as\n * the list of missing accounts or the conflicting parameter values.\n *\n * **Default error code** — `\"INSTRUCTION_ERROR\"`. Sub-classes or callers may\n * override this via the `code` option.\n *\n * @example\n * Catching and inspecting an instruction build failure:\n * ```typescript\n * import { isInstructionError } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const instruction = buildRegisterInstruction(params);\n * } catch (error) {\n * if (isInstructionError(error)) {\n * console.error(`Instruction \"${error.instructionName}\" failed: ${error.message}`);\n * console.error(\"Context:\", error.context);\n * }\n * }\n * ```\n *\n * @example\n * Throwing an `InstructionError` from a builder:\n * ```typescript\n * import { InstructionError } from \"@umbra-privacy/sdk\";\n *\n * throw new InstructionError(\"Required account 'poolConfig' not found\", {\n * instructionName: \"encryptedDeposit\",\n * context: { missingAccounts: [\"poolConfig\"], providedMint: mint.toString() },\n * });\n * ```\n *\n * @see {@link isInstructionError} for the corresponding type guard\n * @public\n */\nexport class InstructionError extends UmbraError {\n /**\n * The name of the instruction that failed during construction or validation.\n *\n * @remarks\n * Matches the Anchor instruction name (camelCase), e.g. `\"encryptedDeposit\"`,\n * `\"initUserAccount\"`. May be `undefined` if the failing instruction could\n * not be identified at the throw site.\n */\n readonly instructionName?: string;\n\n /**\n * Creates a new `InstructionError`.\n *\n * @param message - Human-readable description of the instruction failure.\n * @param options - Optional structured metadata.\n * @param options.code - Error code string. Defaults to `\"INSTRUCTION_ERROR\"`.\n * @param options.instructionName - The name of the failing instruction.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message: string,\n options?: {\n code?: string;\n instructionName?: string;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"INSTRUCTION_ERROR\",\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"InstructionError\";\n if (options?.instructionName !== undefined) {\n this.instructionName = options.instructionName;\n }\n }\n}\n\n/**\n * Error thrown when a Solana JSON-RPC request fails.\n *\n * This error covers all network-level and protocol-level failures that occur\n * while communicating with a Solana RPC node: unreachable endpoints, HTTP\n * errors, rate limiting, malformed responses, and JSON-RPC error objects\n * returned by the node.\n *\n * @remarks\n * **HTTP errors** — Use `statusCode` to check for common HTTP failure modes:\n * - `429` — rate limited; back off and retry with exponential delay\n * - `503` — node overloaded or temporarily unavailable; retry after a pause\n * - `400` — malformed request; usually a client bug, not retryable\n *\n * **JSON-RPC errors** — Use `rpcErrorCode` to distinguish Solana-specific\n * error codes returned in the `error.code` field of an RPC response body.\n * Common codes: `-32002` (transaction not found), `-32005` (node behind),\n * `-32007` (slot skipped).\n *\n * **Retryability** — `statusCode >= 500` or `statusCode === 429` generally\n * indicates a transient error. Client-side errors (`statusCode === 400`) are\n * not retryable without fixing the request.\n *\n * **Default error code** — `\"RPC_ERROR\"`.\n *\n * @example\n * Distinguishing rate-limit errors from other RPC failures:\n * ```typescript\n * import { isRpcError } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const account = await rpc.getAccountInfo(address);\n * } catch (error) {\n * if (isRpcError(error)) {\n * if (error.statusCode === 429) {\n * console.warn(\"Rate limited — retry after delay\");\n * } else {\n * console.error(`RPC failure at ${error.endpoint}: ${error.message}`);\n * }\n * }\n * }\n * ```\n *\n * @example\n * Constructing an `RpcError`:\n * ```typescript\n * import { RpcError } from \"@umbra-privacy/sdk\";\n *\n * throw new RpcError(\"Failed to fetch account\", {\n * endpoint: \"https://api.mainnet-beta.solana.com\",\n * statusCode: 503,\n * cause: originalError,\n * });\n * ```\n *\n * @see {@link isRpcError} for the corresponding type guard\n * @public\n */\nexport class RpcError extends UmbraError {\n /**\n * The RPC endpoint URL that was called when the error occurred.\n *\n * @remarks\n * May be `undefined` if the endpoint was not known at the throw site (e.g.,\n * when the error originates deep within `@solana/kit` internals).\n */\n readonly endpoint?: string;\n\n /**\n * The HTTP status code returned by the RPC node, if applicable.\n *\n * @remarks\n * `undefined` for network-level failures (e.g., DNS resolution failure,\n * connection refused) where no HTTP response was received.\n */\n readonly statusCode?: number;\n\n /**\n * The JSON-RPC error code from the response body, if any.\n *\n * @remarks\n * Set when the RPC node returns a well-formed JSON-RPC error object with a\n * numeric `code` field. `undefined` for HTTP-level failures or when the node\n * returns a malformed response body.\n */\n readonly rpcErrorCode?: number;\n\n /**\n * Creates a new `RpcError`.\n *\n * @param message - Human-readable description of the RPC failure.\n * @param options - Optional structured metadata.\n * @param options.code - Error code string. Defaults to `\"RPC_ERROR\"`.\n * @param options.endpoint - The RPC endpoint URL that was called.\n * @param options.statusCode - HTTP status code from the response, if any.\n * @param options.rpcErrorCode - JSON-RPC error code from the response, if any.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message: string,\n options?: {\n code?: string;\n endpoint?: string;\n statusCode?: number;\n rpcErrorCode?: number;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"RPC_ERROR\",\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"RpcError\";\n if (options?.endpoint !== undefined) {\n this.endpoint = options.endpoint;\n }\n if (options?.statusCode !== undefined) {\n this.statusCode = options.statusCode;\n }\n if (options?.rpcErrorCode !== undefined) {\n this.rpcErrorCode = options.rpcErrorCode;\n }\n }\n}\n\n/**\n * Error thrown when a transaction operation fails.\n *\n * This error covers failures across the full transaction lifecycle: building the\n * transaction message, running preflight simulation, submitting to the network,\n * and waiting for confirmation. It is the base class for more specific\n * transaction-related errors.\n *\n * @remarks\n * **Simulation logs** — When available, `simulationLogs` contain the program\n * log output from a failed preflight simulation. These logs often include the\n * Anchor error code and a human-readable message describing why the on-chain\n * program rejected the transaction.\n *\n * **Signature** — When `signature` is present, the transaction was accepted by\n * the network and executed but the execution itself failed (on-chain error).\n * When `signature` is absent, the transaction was rejected before reaching the\n * network (e.g., preflight failure, malformed transaction).\n *\n * **Default error code** — `\"TRANSACTION_ERROR\"`.\n *\n * @example\n * Inspecting simulation logs on failure:\n * ```typescript\n * import { isTransactionError } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const signatures = await forwarder.forwardSequentially([signedTx]);\n * } catch (error) {\n * if (isTransactionError(error)) {\n * console.error(\"Transaction failed:\", error.message);\n * if (error.simulationLogs) {\n * console.error(\"Simulation logs:\");\n * for (const log of error.simulationLogs) {\n * console.error(\" \", log);\n * }\n * }\n * if (error.signature) {\n * console.error(\"Failed signature:\", error.signature);\n * }\n * }\n * }\n * ```\n *\n * @example\n * Constructing a `TransactionError`:\n * ```typescript\n * import { TransactionError } from \"@umbra-privacy/sdk\";\n *\n * throw new TransactionError(\"Transaction simulation failed\", {\n * simulationLogs: [\"Program log: AnchorError: Error Code: 6001\"],\n * cause: originalError,\n * });\n * ```\n *\n * @see {@link isTransactionError} for the corresponding type guard\n * @see {@link TransactionSigningError} for signing-phase failures\n * @public\n */\nexport class TransactionError extends UmbraError {\n /**\n * The transaction signature, if available.\n *\n * @remarks\n * Base58-encoded signature string. Present when the transaction was submitted\n * to the network but failed during execution. Use this to look up the failed\n * transaction in a block explorer.\n */\n readonly signature?: string;\n\n /**\n * Simulation log output from the transaction preflight, if available.\n *\n * @remarks\n * Each entry in the array is one line of program log output (e.g.,\n * `\"Program log: ...\"` or `\"Program <address> failed: ...\"`). Anchor programs\n * emit error codes and names here when constraints are violated.\n */\n readonly simulationLogs?: string[];\n\n /**\n * Creates a new `TransactionError`.\n *\n * @param message - Human-readable description of the transaction failure.\n * @param options - Optional structured metadata.\n * @param options.code - Error code string. Defaults to `\"TRANSACTION_ERROR\"`.\n * @param options.signature - Base58-encoded transaction signature, if available.\n * @param options.simulationLogs - Program log output from preflight simulation.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message: string,\n options?: {\n code?: string;\n signature?: string;\n simulationLogs?: string[];\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"TRANSACTION_ERROR\",\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"TransactionError\";\n if (options?.signature !== undefined) {\n this.signature = options.signature;\n }\n if (options?.simulationLogs !== undefined) {\n this.simulationLogs = options.simulationLogs;\n }\n }\n}\n\n/**\n * Error thrown when transaction signing fails.\n *\n * This is a specific sub-class of {@link TransactionError} that occurs during\n * the signing phase — after the transaction is built but before it is submitted\n * to the network. Common causes include explicit user rejection in a wallet UI,\n * hardware wallet disconnection or timeout, and missing key material.\n *\n * @remarks\n * **User rejection** — When `wasRejected` is `true`, the user deliberately\n * declined to sign in the wallet prompt. This is not an error condition in the\n * traditional sense — the user made an intentional choice. UIs should catch this\n * and show a user-friendly cancellation message rather than an error dialog.\n *\n * **Hardware wallet issues** — When `wasRejected` is `false`, the failure was\n * not deliberate. It may indicate a disconnected Ledger, a timeout waiting for\n * the user to confirm on-device, or an incompatible app version on the device.\n *\n * **Signer address** — `signerAddress` identifies which signer's key was needed\n * at the time of failure. In multi-signer flows this helps identify which party\n * must re-sign.\n *\n * **Default error code** — `\"TRANSACTION_SIGNING_ERROR\"`.\n *\n * @example\n * Handling user rejection gracefully:\n * ```typescript\n * import { isTransactionSigningError } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const signedTx = await walletSigner.signTransaction(tx);\n * } catch (error) {\n * if (isTransactionSigningError(error)) {\n * if (error.wasRejected) {\n * showToast(\"Transaction cancelled by user\");\n * } else {\n * showToast(`Signing failed: ${error.message}`);\n * }\n * }\n * }\n * ```\n *\n * @example\n * Constructing a `TransactionSigningError`:\n * ```typescript\n * import { TransactionSigningError } from \"@umbra-privacy/sdk\";\n *\n * throw new TransactionSigningError(\"User rejected the transaction\", {\n * wasRejected: true,\n * signerAddress: wallet.publicKey.toString(),\n * });\n * ```\n *\n * @see {@link isTransactionSigningError} for the corresponding type guard\n * @see {@link MasterSeedSigningRejectedError} for the master seed rejection sub-class\n * @public\n */\nexport class TransactionSigningError extends TransactionError {\n /**\n * Whether the signing was explicitly rejected by the user.\n *\n * @remarks\n * `true` when the wallet UI presented a sign request and the user actively\n * clicked \"Reject\" or equivalent. `false` when the failure was due to a\n * technical issue (disconnected device, timeout, missing key).\n *\n * @defaultValue `false`\n */\n readonly wasRejected: boolean;\n\n /**\n * The address of the signer that failed to produce a signature.\n *\n * @remarks\n * Base58-encoded public key string. May be `undefined` if the failing signer\n * could not be identified at the throw site.\n */\n readonly signerAddress?: string;\n\n /**\n * Creates a new `TransactionSigningError`.\n *\n * @param message - Human-readable description of the signing failure.\n * @param options - Optional structured metadata.\n * @param options.code - Error code string. Defaults to `\"TRANSACTION_SIGNING_ERROR\"`.\n * @param options.wasRejected - Whether the user deliberately rejected. Defaults to `false`.\n * @param options.signerAddress - Base58 address of the signer that failed.\n * @param options.signature - Transaction signature, if the transaction was partially signed.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message: string,\n options?: {\n code?: string;\n wasRejected?: boolean;\n signerAddress?: string;\n signature?: string;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"TRANSACTION_SIGNING_ERROR\",\n ...(options?.signature !== undefined && {\n signature: options.signature,\n }),\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"TransactionSigningError\";\n this.wasRejected = options?.wasRejected ?? false;\n if (options?.signerAddress !== undefined) {\n this.signerAddress = options.signerAddress;\n }\n }\n}\n\n/**\n * Error thrown when master seed signing is rejected by the user.\n *\n * The Umbra privacy protocol derives a deterministic master seed by asking the\n * user's wallet to sign a fixed message. This seed is the root of the key\n * hierarchy used for encrypting and decrypting confidential balances. If the\n * user declines to sign this message, no Umbra operations that require private\n * key material can proceed.\n *\n * @remarks\n * This error always has `wasRejected: true` because it is only thrown when the\n * user deliberately declines — hardware wallet failures or timeouts during the\n * seed derivation flow produce a generic {@link TransactionSigningError} instead.\n *\n * **Recovery** — Prompt the user to explain that the Umbra seed derivation\n * signature is used only to derive encryption keys locally and is never\n * broadcast to the network. Then call `getUmbraClient` again.\n *\n * **Default error code** — `\"MASTER_SEED_SIGNING_REJECTED\"`.\n *\n * @example\n * Distinguishing master seed rejection from other signing errors:\n * ```typescript\n * import {\n * MasterSeedSigningRejectedError,\n * isTransactionSigningError,\n * } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const client = await getUmbraClient({ signer });\n * } catch (error) {\n * if (error instanceof MasterSeedSigningRejectedError) {\n * showModal(\n * \"Umbra needs a signature to derive your private keys locally. \" +\n * \"This signature is never sent to the network.\",\n * );\n * } else if (isTransactionSigningError(error)) {\n * showToast(`Signing error: ${error.message}`);\n * }\n * }\n * ```\n *\n * @see {@link TransactionSigningError} for the parent class\n * @public\n */\nexport class MasterSeedSigningRejectedError extends TransactionSigningError {\n /**\n * Creates a new `MasterSeedSigningRejectedError`.\n *\n * @param message - Human-readable description. Defaults to a standard rejection\n * message explaining that the user declined the required derivation signature.\n * @param options - Optional structured metadata.\n * @param options.signerAddress - Base58 address of the wallet that rejected.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message = \"Master seed derivation was rejected. The user declined to sign the required message.\",\n options?: {\n signerAddress?: string;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: \"MASTER_SEED_SIGNING_REJECTED\",\n wasRejected: true,\n ...(options?.signerAddress !== undefined && {\n signerAddress: options.signerAddress,\n }),\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"MasterSeedSigningRejectedError\";\n }\n}\n\n/**\n * Type guard to check whether an unknown value is an {@link InstructionError}.\n *\n * @remarks\n * Prefer this function over `instanceof InstructionError` in code that may\n * cross module or bundle boundaries where the class reference might differ.\n *\n * @param error - The value to test.\n * @returns `true` if `error` is an instance of `InstructionError`, narrowing\n * the type accordingly.\n *\n * @example\n * ```typescript\n * if (isInstructionError(error)) {\n * console.error(\"Instruction:\", error.instructionName);\n * }\n * ```\n *\n * @see {@link InstructionError}\n * @public\n */\nexport function isInstructionError(error: unknown): error is InstructionError {\n return error instanceof InstructionError;\n}\n\n/**\n * Type guard to check whether an unknown value is an {@link RpcError}.\n *\n * @remarks\n * Prefer this function over `instanceof RpcError` in code that may cross\n * module or bundle boundaries where the class reference might differ.\n *\n * @param error - The value to test.\n * @returns `true` if `error` is an instance of `RpcError`, narrowing the type\n * accordingly.\n *\n * @example\n * ```typescript\n * if (isRpcError(error) && error.statusCode === 429) {\n * await sleep(backoffMs);\n * return retry();\n * }\n * ```\n *\n * @see {@link RpcError}\n * @public\n */\nexport function isRpcError(error: unknown): error is RpcError {\n return error instanceof RpcError;\n}\n\n/**\n * Type guard to check whether an unknown value is a {@link TransactionError}.\n *\n * @remarks\n * Because {@link TransactionSigningError} and {@link MasterSeedSigningRejectedError}\n * extend `TransactionError`, this guard returns `true` for those sub-classes as\n * well. Use the more specific guards ({@link isTransactionSigningError}) when the\n * sub-type matters.\n *\n * @param error - The value to test.\n * @returns `true` if `error` is an instance of `TransactionError` or any of its\n * sub-classes, narrowing the type accordingly.\n *\n * @example\n * ```typescript\n * if (isTransactionError(error) && error.simulationLogs) {\n * console.error(\"Simulation logs:\", error.simulationLogs.join(\"\\n\"));\n * }\n * ```\n *\n * @see {@link TransactionError}\n * @see {@link isTransactionSigningError}\n * @public\n */\nexport function isTransactionError(error: unknown): error is TransactionError {\n return error instanceof TransactionError;\n}\n\n/**\n * Type guard to check whether an unknown value is a {@link TransactionSigningError}.\n *\n * @remarks\n * Because {@link MasterSeedSigningRejectedError} extends `TransactionSigningError`,\n * this guard returns `true` for that sub-class as well.\n *\n * @param error - The value to test.\n * @returns `true` if `error` is an instance of `TransactionSigningError` or any\n * of its sub-classes, narrowing the type accordingly.\n *\n * @example\n * ```typescript\n * if (isTransactionSigningError(error) && error.wasRejected) {\n * showCancellationMessage();\n * }\n * ```\n *\n * @see {@link TransactionSigningError}\n * @see {@link MasterSeedSigningRejectedError}\n * @public\n */\nexport function isTransactionSigningError(error: unknown): error is TransactionSigningError {\n return error instanceof TransactionSigningError;\n}\n","/**\n * Umbra Error Classes\n *\n * This module provides error classes for all Umbra SDK operation failures,\n * each carrying a `stage` field that identifies exactly where in the pipeline\n * the failure occurred.\n *\n * @since 2.0.0\n * @module umbra/errors\n */\n\nimport { UmbraError } from \"../common/errors\";\n\n// =============================================================================\n// DEPOSIT\n// =============================================================================\n\n/**\n * Stage of the encrypted deposit operation where an error occurred.\n *\n * Each stage represents a distinct phase in the deposit flow:\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `validation` | Input parameter validation failed |\n * | `mint-fetch` | Failed to fetch mint account data |\n * | `fee-calculation` | Failed to calculate transfer fee |\n * | `pda-derivation` | PDA address generation failed |\n * | `account-fetch` | Failed to fetch account data from RPC |\n * | `instruction-build` | Failed to build the deposit instruction |\n * | `transaction-build` | Failed to build transaction message |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Failed to sign the transaction |\n * | `transaction-validate` | Transaction validation failed |\n * | `transaction-send` | Failed to send or confirm the transaction |\n */\nexport type EncryptedDepositStage =\n | \"initialization\"\n | \"validation\"\n | \"mint-fetch\"\n | \"fee-calculation\"\n | \"pda-derivation\"\n | \"account-fetch\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when an encrypted deposit operation fails. */\nexport class EncryptedDepositError extends UmbraError {\n readonly stage: EncryptedDepositStage;\n\n constructor(stage: EncryptedDepositStage, message: string, cause?: Error) {\n super(message, {\n code: `ENCRYPTED_DEPOSIT_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"EncryptedDepositError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is an EncryptedDepositError. */\nexport function isEncryptedDepositError(error: unknown): error is EncryptedDepositError {\n return error instanceof EncryptedDepositError;\n}\n\n// =============================================================================\n// WITHDRAWAL\n// =============================================================================\n\n/**\n * Stage of the encrypted withdrawal operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `validation` | Input parameter validation failed |\n * | `mint-fetch` | Failed to fetch mint account data |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build the withdrawal instruction |\n * | `transaction-build` | Failed to build transaction message |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Failed to sign the transaction |\n * | `transaction-send` | Failed to send or confirm the transaction |\n */\nexport type EncryptedWithdrawalStage =\n | \"initialization\"\n | \"validation\"\n | \"mint-fetch\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-send\";\n\n/** Error thrown when an encrypted withdrawal operation fails. */\nexport class EncryptedWithdrawalError extends UmbraError {\n readonly stage: EncryptedWithdrawalStage;\n\n constructor(stage: EncryptedWithdrawalStage, message: string, cause?: Error) {\n super(message, {\n code: `ENCRYPTED_WITHDRAWAL_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"EncryptedWithdrawalError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is an EncryptedWithdrawalError. */\nexport function isEncryptedWithdrawalError(error: unknown): error is EncryptedWithdrawalError {\n return error instanceof EncryptedWithdrawalError;\n}\n\n// =============================================================================\n// REGISTRATION\n// =============================================================================\n\n/**\n * Stage of the user registration operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `master-seed-derivation` | Master seed signing was rejected or failed |\n * | `account-fetch` | RPC call to read existing registration state failed |\n * | `key-derivation` | Cryptographic key derivation from master seed failed |\n * | `zk-proof-generation` | Groth16 proof generation failed (anonymous step) |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build an instruction |\n * | `transaction-build` | Blockhash fetch or transaction assembly failed |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Wallet rejected signing |\n * | `transaction-validate` | Pre-flight simulation failed |\n * | `transaction-send` | Transaction sent but confirmation timed out |\n */\nexport type RegistrationStage =\n | \"initialization\"\n | \"master-seed-derivation\"\n | \"account-fetch\"\n | \"key-derivation\"\n | \"zk-proof-generation\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when a user registration operation fails. */\nexport class RegistrationError extends UmbraError {\n readonly stage: RegistrationStage;\n\n constructor(stage: RegistrationStage, message: string, cause?: unknown) {\n super(message, {\n code: `REGISTRATION_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"RegistrationError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a RegistrationError. */\nexport function isRegistrationError(error: unknown): error is RegistrationError {\n return error instanceof RegistrationError;\n}\n\n// =============================================================================\n// CONVERSION\n// =============================================================================\n\n/**\n * Stage of the MXE-to-Shared conversion operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `account-fetch` | Batch RPC fetch of token account PDAs failed |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build a conversion instruction |\n * | `transaction-build` | Blockhash fetch or transaction assembly failed |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Wallet rejected signing for a per-mint transaction |\n * | `transaction-validate` | Pre-flight simulation failed |\n * | `transaction-send` | Transaction sent but confirmation timed out |\n */\nexport type ConversionStage =\n | \"initialization\"\n | \"account-fetch\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when an MXE-to-Shared conversion operation fails. */\nexport class ConversionError extends UmbraError {\n readonly stage: ConversionStage;\n\n constructor(stage: ConversionStage, message: string, cause?: unknown) {\n super(message, {\n code: `CONVERSION_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"ConversionError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a ConversionError. */\nexport function isConversionError(error: unknown): error is ConversionError {\n return error instanceof ConversionError;\n}\n\n// =============================================================================\n// CREATE UTXO\n// =============================================================================\n\n/**\n * Stage of a UTXO creation operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `validation` | Input parameter validation failed |\n * | `account-fetch` | Failed to fetch recipient or token account data |\n * | `mint-fetch` | Failed to fetch mint account data |\n * | `fee-calculation` | Token-2022 transfer fee calculation failed |\n * | `key-derivation` | Key derivation from master seed failed |\n * | `zk-proof-generation` | Groth16 proof generation failed |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build an instruction |\n * | `transaction-build` | Blockhash fetch or transaction assembly failed |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Wallet rejected signing |\n * | `transaction-validate` | Pre-flight simulation failed |\n * | `transaction-send` | Transaction sent but confirmation timed out |\n */\nexport type CreateUtxoStage =\n | \"initialization\"\n | \"validation\"\n | \"account-fetch\"\n | \"mint-fetch\"\n | \"fee-calculation\"\n | \"key-derivation\"\n | \"zk-proof-generation\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when a UTXO creation operation fails. */\nexport class CreateUtxoError extends UmbraError {\n readonly stage: CreateUtxoStage;\n\n constructor(stage: CreateUtxoStage, message: string, cause?: unknown) {\n super(message, {\n code: `CREATE_UTXO_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"CreateUtxoError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a CreateUtxoError. */\nexport function isCreateUtxoError(error: unknown): error is CreateUtxoError {\n return error instanceof CreateUtxoError;\n}\n\n// =============================================================================\n// FETCH UTXOS\n// =============================================================================\n\n/**\n * Stage of a UTXO fetch operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory construction failed — missing indexerApiEndpoint |\n * | `validation` | Invalid tree index or insertion index parameters |\n * | `key-derivation` | X25519 private key derivation from master seed failed |\n * | `indexer-fetch` | Indexer HTTP call failed |\n * | `proof-fetch` | Merkle proof HTTP call failed |\n */\nexport type FetchUtxosStage =\n | \"initialization\"\n | \"validation\"\n | \"key-derivation\"\n | \"indexer-fetch\"\n | \"proof-fetch\"\n | \"proof-enrichment\";\n\n/** Error thrown when a UTXO fetch operation fails. */\nexport class FetchUtxosError extends UmbraError {\n readonly stage: FetchUtxosStage;\n\n constructor(stage: FetchUtxosStage, message: string, cause?: unknown) {\n super(message, {\n code: `FETCH_UTXOS_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"FetchUtxosError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a FetchUtxosError. */\nexport function isFetchUtxosError(error: unknown): error is FetchUtxosError {\n return error instanceof FetchUtxosError;\n}\n\n// =============================================================================\n// CLAIM UTXO\n// =============================================================================\n\n/**\n * Stage of a UTXO claim operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `validation` | Invalid UTXO data or Merkle proof parameters |\n * | `key-derivation` | Key derivation from master seed failed |\n * | `zk-proof-generation` | Groth16 proof generation failed |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build an instruction |\n * | `transaction-build` | Blockhash fetch or transaction assembly failed |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Wallet rejected signing |\n * | `transaction-validate` | Pre-flight simulation failed — also surfaces stale Merkle proof |\n * | `transaction-send` | Transaction sent but confirmation timed out |\n */\nexport type ClaimUtxoStage =\n | \"initialization\"\n | \"validation\"\n | \"key-derivation\"\n | \"zk-proof-generation\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when a UTXO claim operation fails. */\nexport class ClaimUtxoError extends UmbraError {\n readonly stage: ClaimUtxoStage;\n\n constructor(stage: ClaimUtxoStage, message: string, cause?: unknown) {\n super(message, {\n code: `CLAIM_UTXO_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"ClaimUtxoError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a ClaimUtxoError. */\nexport function isClaimUtxoError(error: unknown): error is ClaimUtxoError {\n return error instanceof ClaimUtxoError;\n}\n\n// =============================================================================\n// QUERY\n// =============================================================================\n\n/**\n * Stage of a query operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `pda-derivation` | PDA address generation failed |\n * | `account-fetch` | RPC fetch failed |\n * | `account-decode` | On-chain account data could not be decoded |\n * | `key-derivation` | X25519 key derivation failed (encrypted balance query) |\n * | `decryption` | Rescue cipher decryption failed (encrypted balance query) |\n */\nexport type QueryStage =\n | \"initialization\"\n | \"pda-derivation\"\n | \"account-fetch\"\n | \"account-decode\"\n | \"key-derivation\"\n | \"decryption\";\n\n/** Error thrown when a query operation fails. */\nexport class QueryError extends UmbraError {\n readonly stage: QueryStage;\n\n constructor(stage: QueryStage, message: string, cause?: unknown) {\n super(message, {\n code: `QUERY_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"QueryError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a QueryError. */\nexport function isQueryError(error: unknown): error is QueryError {\n return error instanceof QueryError;\n}\n"]}
|
|
@@ -460,5 +460,5 @@ exports.isRegistrationError = isRegistrationError;
|
|
|
460
460
|
exports.isRpcError = isRpcError;
|
|
461
461
|
exports.isTransactionError = isTransactionError;
|
|
462
462
|
exports.isTransactionSigningError = isTransactionSigningError;
|
|
463
|
-
//# sourceMappingURL=chunk-
|
|
464
|
-
//# sourceMappingURL=chunk-
|
|
463
|
+
//# sourceMappingURL=chunk-KCHHJKQN.cjs.map
|
|
464
|
+
//# sourceMappingURL=chunk-KCHHJKQN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/arcium/errors.ts","../src/solana/errors.ts","../src/umbra/errors.ts"],"names":["UmbraError","__name"],"mappings":";;;;;;AAwEO,IAAM,uBAAA,GAAN,cAAsCA,4BAAA,CAAW;AAAA,EAxExD;AAwEwD,IAAAC,wBAAA,CAAA,IAAA,EAAA,yBAAA,CAAA;AAAA;AAAA;AAAA,EAE7C,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOT,WAAA,CAAY,KAAA,EAAgC,OAAA,EAAiB,KAAA,EAAe;AAC1E,IAAA,KAAA,CAAM,OAAA,EAAS;AAAA,MACb,IAAA,EAAM,uBAAuB,KAAA,CAAM,WAAA,GAAc,UAAA,CAAW,GAAA,EAAK,GAAG,CAAC,CAAA,CAAA;AAAA,MACrE;AAAA,KACD,CAAA;AACD,IAAA,IAAA,CAAK,IAAA,GAAO,yBAAA;AACZ,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF;AAqBO,SAAS,0BAA0B,KAAA,EAAkD;AAC1F,EAAA,OAAO,KAAA,YAAiB,uBAAA;AAC1B;AAFgBA,wBAAA,CAAA,yBAAA,EAAA,2BAAA,CAAA;;;ACdT,IAAM,gBAAA,GAAN,cAA+BD,4BAAA,CAAW;AAAA,EAhGjD;AAgGiD,IAAAC,wBAAA,CAAA,IAAA,EAAA,kBAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStC,eAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYT,WAAA,CACE,SACA,OAAA,EAMA;AACA,IAAA,KAAA,CAAM,OAAA,EAAS;AAAA,MACb,IAAA,EAAM,SAAS,IAAA,IAAQ,mBAAA;AAA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AAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF;AAGO,SAAS,iBAAiB,KAAA,EAAyC;AACxE,EAAA,OAAO,KAAA,YAAiB,cAAA;AAC1B;AAFgBA,wBAAA,CAAA,gBAAA,EAAA,kBAAA,CAAA;AA6BT,IAAM,UAAA,GAAN,cAAyBD,4BAAA,CAAW;AAAA,EAlZ3C;AAkZ2C,IAAAC,wBAAA,CAAA,IAAA,EAAA,YAAA,CAAA;AAAA;AAAA,EAChC,KAAA;AAAA,EAET,WAAA,CAAY,KAAA,EAAmB,OAAA,EAAiB,KAAA,EAAiB;AAC/D,IAAA,KAAA,CAAM,OAAA,EAAS;AAAA,MACb,IAAA,EAAM,SAAS,KAAA,CAAM,WAAA,GAAc,UAAA,CAAW,GAAA,EAAK,GAAG,CAAC,CAAA,CAAA;AAAA,MACvD;AAAA,KACD,CAAA;AACD,IAAA,IAAA,CAAK,IAAA,GAAO,YAAA;AACZ,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA,EACf;AACF;AAGO,SAAS,aAAa,KAAA,EAAqC;AAChE,EAAA,OAAO,KAAA,YAAiB,UAAA;AAC1B;AAFgBA,wBAAA,CAAA,YAAA,EAAA,cAAA,CAAA","file":"chunk-KCHHJKQN.cjs","sourcesContent":["/**\n * Arcium Error Classes\n *\n * Provides error classes for Arcium MPC computation monitoring failures.\n * Each error carries a {@link ComputationMonitorStage} field that identifies\n * exactly where in the monitoring pipeline the failure occurred.\n *\n * @module arcium/errors\n * @since 2.0.0\n */\n\nimport { UmbraError } from \"../common/errors\";\n\n// =============================================================================\n// COMPUTATION MONITOR\n// =============================================================================\n\n/**\n * Stage of the computation monitoring operation where an error occurred.\n *\n * @remarks\n * Each stage represents a distinct phase in the monitoring flow:\n *\n * - `subscription` — WebSocket subscription setup or notification stream failed\n * - `account-fetch` — HTTP RPC fetch of the ComputationAccount failed\n * - `account-decode` — Failed to decode the ComputationAccount from raw bytes\n * - `timeout` — Monitoring timed out before the computation finalized\n * - `signature-retrieval` — `getSignaturesForAddress` call failed after finalization\n *\n * @since 2.0.0\n * @public\n */\nexport type ComputationMonitorStage =\n | \"subscription\"\n | \"account-fetch\"\n | \"account-decode\"\n | \"timeout\"\n | \"signature-retrieval\";\n\n/**\n * Error thrown when a computation monitoring operation fails.\n *\n * @remarks\n * Thrown by {@link ComputationMonitor} implementations when the monitoring\n * loop encounters an unrecoverable failure. The {@link stage} field identifies\n * exactly where in the monitoring pipeline the failure occurred, enabling\n * callers to implement targeted recovery strategies.\n *\n * The error code follows the format `COMPUTATION_MONITOR_{STAGE}` where\n * `{STAGE}` is the uppercase, underscore-delimited stage name.\n *\n * @example\n * ```typescript\n * try {\n * const prepared = await monitor.prepareMonitor(computationAddress, {\n * safetyTimeoutMs: 60_000,\n * });\n * const result = await prepared.awaitComputation();\n * } catch (error) {\n * if (isComputationMonitorError(error)) {\n * switch (error.stage) {\n * case \"subscription\":\n * console.log(\"WebSocket connection failed — try polling monitor\");\n * break;\n * }\n * }\n * }\n * ```\n *\n * @since 2.0.0\n * @public\n */\nexport class ComputationMonitorError extends UmbraError {\n /** The monitoring stage where the failure occurred. */\n readonly stage: ComputationMonitorStage;\n\n /**\n * @param stage - The monitoring pipeline stage where the failure occurred.\n * @param message - A human-readable description of the error.\n * @param cause - The underlying error that caused this failure, if any.\n */\n constructor(stage: ComputationMonitorStage, message: string, cause?: Error) {\n super(message, {\n code: `COMPUTATION_MONITOR_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"ComputationMonitorError\";\n this.stage = stage;\n }\n}\n\n/**\n * Type guard to check if a value is a {@link ComputationMonitorError}.\n *\n * @param error - The value to test.\n * @returns `true` and narrows `error` to {@link ComputationMonitorError} when\n * the value is an instance of `ComputationMonitorError`.\n *\n * @example\n * ```typescript\n * catch (error) {\n * if (isComputationMonitorError(error)) {\n * console.log(error.stage); // TypeScript knows this is ComputationMonitorStage\n * }\n * }\n * ```\n *\n * @since 2.0.0\n * @public\n */\nexport function isComputationMonitorError(error: unknown): error is ComputationMonitorError {\n return error instanceof ComputationMonitorError;\n}\n","/**\n * Solana-Specific Error Classes.\n *\n * This module defines the structured error hierarchy for Solana-related failures\n * in the Umbra SDK. All classes extend `UmbraError` from `../common/errors` and\n * carry structured context that makes programmatic error handling and logging\n * straightforward.\n *\n * @remarks\n * The error hierarchy is:\n * ```\n * UmbraError (base)\n * ├── InstructionError — instruction build/validation failures\n * ├── RpcError — JSON-RPC request failures\n * └── TransactionError — transaction lifecycle failures\n * ├── TransactionSigningError — signing-phase failures\n * │ └── MasterSeedSigningRejectedError — master seed derivation rejection\n * ```\n *\n * **Type guards** — Each concrete error class has a matching `is*` type guard\n * function ({@link isInstructionError}, {@link isRpcError},\n * {@link isTransactionError}, {@link isTransactionSigningError}). Prefer these\n * over `instanceof` checks in code that may cross module or bundle boundaries,\n * where `instanceof` can fail due to different class references.\n *\n * **Recovery strategies by error type:**\n *\n * - `InstructionError` — inspect `instructionName` and `context` to determine\n * which account is missing or which parameter is invalid; fix the call site.\n *\n * - `RpcError` — check `statusCode` (HTTP) and `rpcErrorCode` (JSON-RPC) to\n * distinguish rate limiting (429), node overload (503), or invalid request\n * (400). Transient errors are typically retryable.\n *\n * - `TransactionError` — check `simulationLogs` for program error messages that\n * identify the on-chain failure. If `signature` is set, the transaction landed\n * on-chain but was reverted.\n *\n * - `TransactionSigningError` — check `wasRejected` to distinguish a deliberate\n * user rejection from a hardware wallet communication failure.\n *\n * - `MasterSeedSigningRejectedError` — the user declined the master seed\n * derivation message; prompt the user and retry with `getUmbraClient`.\n *\n * @packageDocumentation\n */\n\nimport { UmbraError } from \"../common/errors\";\n\n/**\n * Error thrown when building or validating a Solana instruction fails.\n *\n * This error is raised during the instruction-construction phase — before any\n * RPC or network interaction occurs. Common causes include missing required\n * accounts, invalid parameter values, PDA derivation failures, and instruction\n * serialization errors.\n *\n * @remarks\n * The `instructionName` field identifies which instruction failed, which is\n * particularly useful when a single SDK operation constructs multiple\n * instructions. The `context` field (inherited from `UmbraError`) carries\n * arbitrary key-value pairs for additional diagnostic information, such as\n * the list of missing accounts or the conflicting parameter values.\n *\n * **Default error code** — `\"INSTRUCTION_ERROR\"`. Sub-classes or callers may\n * override this via the `code` option.\n *\n * @example\n * Catching and inspecting an instruction build failure:\n * ```typescript\n * import { isInstructionError } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const instruction = buildRegisterInstruction(params);\n * } catch (error) {\n * if (isInstructionError(error)) {\n * console.error(`Instruction \"${error.instructionName}\" failed: ${error.message}`);\n * console.error(\"Context:\", error.context);\n * }\n * }\n * ```\n *\n * @example\n * Throwing an `InstructionError` from a builder:\n * ```typescript\n * import { InstructionError } from \"@umbra-privacy/sdk\";\n *\n * throw new InstructionError(\"Required account 'poolConfig' not found\", {\n * instructionName: \"encryptedDeposit\",\n * context: { missingAccounts: [\"poolConfig\"], providedMint: mint.toString() },\n * });\n * ```\n *\n * @see {@link isInstructionError} for the corresponding type guard\n * @public\n */\nexport class InstructionError extends UmbraError {\n /**\n * The name of the instruction that failed during construction or validation.\n *\n * @remarks\n * Matches the Anchor instruction name (camelCase), e.g. `\"encryptedDeposit\"`,\n * `\"initUserAccount\"`. May be `undefined` if the failing instruction could\n * not be identified at the throw site.\n */\n readonly instructionName?: string;\n\n /**\n * Creates a new `InstructionError`.\n *\n * @param message - Human-readable description of the instruction failure.\n * @param options - Optional structured metadata.\n * @param options.code - Error code string. Defaults to `\"INSTRUCTION_ERROR\"`.\n * @param options.instructionName - The name of the failing instruction.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message: string,\n options?: {\n code?: string;\n instructionName?: string;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"INSTRUCTION_ERROR\",\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"InstructionError\";\n if (options?.instructionName !== undefined) {\n this.instructionName = options.instructionName;\n }\n }\n}\n\n/**\n * Error thrown when a Solana JSON-RPC request fails.\n *\n * This error covers all network-level and protocol-level failures that occur\n * while communicating with a Solana RPC node: unreachable endpoints, HTTP\n * errors, rate limiting, malformed responses, and JSON-RPC error objects\n * returned by the node.\n *\n * @remarks\n * **HTTP errors** — Use `statusCode` to check for common HTTP failure modes:\n * - `429` — rate limited; back off and retry with exponential delay\n * - `503` — node overloaded or temporarily unavailable; retry after a pause\n * - `400` — malformed request; usually a client bug, not retryable\n *\n * **JSON-RPC errors** — Use `rpcErrorCode` to distinguish Solana-specific\n * error codes returned in the `error.code` field of an RPC response body.\n * Common codes: `-32002` (transaction not found), `-32005` (node behind),\n * `-32007` (slot skipped).\n *\n * **Retryability** — `statusCode >= 500` or `statusCode === 429` generally\n * indicates a transient error. Client-side errors (`statusCode === 400`) are\n * not retryable without fixing the request.\n *\n * **Default error code** — `\"RPC_ERROR\"`.\n *\n * @example\n * Distinguishing rate-limit errors from other RPC failures:\n * ```typescript\n * import { isRpcError } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const account = await rpc.getAccountInfo(address);\n * } catch (error) {\n * if (isRpcError(error)) {\n * if (error.statusCode === 429) {\n * console.warn(\"Rate limited — retry after delay\");\n * } else {\n * console.error(`RPC failure at ${error.endpoint}: ${error.message}`);\n * }\n * }\n * }\n * ```\n *\n * @example\n * Constructing an `RpcError`:\n * ```typescript\n * import { RpcError } from \"@umbra-privacy/sdk\";\n *\n * throw new RpcError(\"Failed to fetch account\", {\n * endpoint: \"https://api.mainnet-beta.solana.com\",\n * statusCode: 503,\n * cause: originalError,\n * });\n * ```\n *\n * @see {@link isRpcError} for the corresponding type guard\n * @public\n */\nexport class RpcError extends UmbraError {\n /**\n * The RPC endpoint URL that was called when the error occurred.\n *\n * @remarks\n * May be `undefined` if the endpoint was not known at the throw site (e.g.,\n * when the error originates deep within `@solana/kit` internals).\n */\n readonly endpoint?: string;\n\n /**\n * The HTTP status code returned by the RPC node, if applicable.\n *\n * @remarks\n * `undefined` for network-level failures (e.g., DNS resolution failure,\n * connection refused) where no HTTP response was received.\n */\n readonly statusCode?: number;\n\n /**\n * The JSON-RPC error code from the response body, if any.\n *\n * @remarks\n * Set when the RPC node returns a well-formed JSON-RPC error object with a\n * numeric `code` field. `undefined` for HTTP-level failures or when the node\n * returns a malformed response body.\n */\n readonly rpcErrorCode?: number;\n\n /**\n * Creates a new `RpcError`.\n *\n * @param message - Human-readable description of the RPC failure.\n * @param options - Optional structured metadata.\n * @param options.code - Error code string. Defaults to `\"RPC_ERROR\"`.\n * @param options.endpoint - The RPC endpoint URL that was called.\n * @param options.statusCode - HTTP status code from the response, if any.\n * @param options.rpcErrorCode - JSON-RPC error code from the response, if any.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message: string,\n options?: {\n code?: string;\n endpoint?: string;\n statusCode?: number;\n rpcErrorCode?: number;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"RPC_ERROR\",\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"RpcError\";\n if (options?.endpoint !== undefined) {\n this.endpoint = options.endpoint;\n }\n if (options?.statusCode !== undefined) {\n this.statusCode = options.statusCode;\n }\n if (options?.rpcErrorCode !== undefined) {\n this.rpcErrorCode = options.rpcErrorCode;\n }\n }\n}\n\n/**\n * Error thrown when a transaction operation fails.\n *\n * This error covers failures across the full transaction lifecycle: building the\n * transaction message, running preflight simulation, submitting to the network,\n * and waiting for confirmation. It is the base class for more specific\n * transaction-related errors.\n *\n * @remarks\n * **Simulation logs** — When available, `simulationLogs` contain the program\n * log output from a failed preflight simulation. These logs often include the\n * Anchor error code and a human-readable message describing why the on-chain\n * program rejected the transaction.\n *\n * **Signature** — When `signature` is present, the transaction was accepted by\n * the network and executed but the execution itself failed (on-chain error).\n * When `signature` is absent, the transaction was rejected before reaching the\n * network (e.g., preflight failure, malformed transaction).\n *\n * **Default error code** — `\"TRANSACTION_ERROR\"`.\n *\n * @example\n * Inspecting simulation logs on failure:\n * ```typescript\n * import { isTransactionError } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const signatures = await forwarder.forwardSequentially([signedTx]);\n * } catch (error) {\n * if (isTransactionError(error)) {\n * console.error(\"Transaction failed:\", error.message);\n * if (error.simulationLogs) {\n * console.error(\"Simulation logs:\");\n * for (const log of error.simulationLogs) {\n * console.error(\" \", log);\n * }\n * }\n * if (error.signature) {\n * console.error(\"Failed signature:\", error.signature);\n * }\n * }\n * }\n * ```\n *\n * @example\n * Constructing a `TransactionError`:\n * ```typescript\n * import { TransactionError } from \"@umbra-privacy/sdk\";\n *\n * throw new TransactionError(\"Transaction simulation failed\", {\n * simulationLogs: [\"Program log: AnchorError: Error Code: 6001\"],\n * cause: originalError,\n * });\n * ```\n *\n * @see {@link isTransactionError} for the corresponding type guard\n * @see {@link TransactionSigningError} for signing-phase failures\n * @public\n */\nexport class TransactionError extends UmbraError {\n /**\n * The transaction signature, if available.\n *\n * @remarks\n * Base58-encoded signature string. Present when the transaction was submitted\n * to the network but failed during execution. Use this to look up the failed\n * transaction in a block explorer.\n */\n readonly signature?: string;\n\n /**\n * Simulation log output from the transaction preflight, if available.\n *\n * @remarks\n * Each entry in the array is one line of program log output (e.g.,\n * `\"Program log: ...\"` or `\"Program <address> failed: ...\"`). Anchor programs\n * emit error codes and names here when constraints are violated.\n */\n readonly simulationLogs?: string[];\n\n /**\n * Creates a new `TransactionError`.\n *\n * @param message - Human-readable description of the transaction failure.\n * @param options - Optional structured metadata.\n * @param options.code - Error code string. Defaults to `\"TRANSACTION_ERROR\"`.\n * @param options.signature - Base58-encoded transaction signature, if available.\n * @param options.simulationLogs - Program log output from preflight simulation.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message: string,\n options?: {\n code?: string;\n signature?: string;\n simulationLogs?: string[];\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"TRANSACTION_ERROR\",\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"TransactionError\";\n if (options?.signature !== undefined) {\n this.signature = options.signature;\n }\n if (options?.simulationLogs !== undefined) {\n this.simulationLogs = options.simulationLogs;\n }\n }\n}\n\n/**\n * Error thrown when transaction signing fails.\n *\n * This is a specific sub-class of {@link TransactionError} that occurs during\n * the signing phase — after the transaction is built but before it is submitted\n * to the network. Common causes include explicit user rejection in a wallet UI,\n * hardware wallet disconnection or timeout, and missing key material.\n *\n * @remarks\n * **User rejection** — When `wasRejected` is `true`, the user deliberately\n * declined to sign in the wallet prompt. This is not an error condition in the\n * traditional sense — the user made an intentional choice. UIs should catch this\n * and show a user-friendly cancellation message rather than an error dialog.\n *\n * **Hardware wallet issues** — When `wasRejected` is `false`, the failure was\n * not deliberate. It may indicate a disconnected Ledger, a timeout waiting for\n * the user to confirm on-device, or an incompatible app version on the device.\n *\n * **Signer address** — `signerAddress` identifies which signer's key was needed\n * at the time of failure. In multi-signer flows this helps identify which party\n * must re-sign.\n *\n * **Default error code** — `\"TRANSACTION_SIGNING_ERROR\"`.\n *\n * @example\n * Handling user rejection gracefully:\n * ```typescript\n * import { isTransactionSigningError } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const signedTx = await walletSigner.signTransaction(tx);\n * } catch (error) {\n * if (isTransactionSigningError(error)) {\n * if (error.wasRejected) {\n * showToast(\"Transaction cancelled by user\");\n * } else {\n * showToast(`Signing failed: ${error.message}`);\n * }\n * }\n * }\n * ```\n *\n * @example\n * Constructing a `TransactionSigningError`:\n * ```typescript\n * import { TransactionSigningError } from \"@umbra-privacy/sdk\";\n *\n * throw new TransactionSigningError(\"User rejected the transaction\", {\n * wasRejected: true,\n * signerAddress: wallet.publicKey.toString(),\n * });\n * ```\n *\n * @see {@link isTransactionSigningError} for the corresponding type guard\n * @see {@link MasterSeedSigningRejectedError} for the master seed rejection sub-class\n * @public\n */\nexport class TransactionSigningError extends TransactionError {\n /**\n * Whether the signing was explicitly rejected by the user.\n *\n * @remarks\n * `true` when the wallet UI presented a sign request and the user actively\n * clicked \"Reject\" or equivalent. `false` when the failure was due to a\n * technical issue (disconnected device, timeout, missing key).\n *\n * @defaultValue `false`\n */\n readonly wasRejected: boolean;\n\n /**\n * The address of the signer that failed to produce a signature.\n *\n * @remarks\n * Base58-encoded public key string. May be `undefined` if the failing signer\n * could not be identified at the throw site.\n */\n readonly signerAddress?: string;\n\n /**\n * Creates a new `TransactionSigningError`.\n *\n * @param message - Human-readable description of the signing failure.\n * @param options - Optional structured metadata.\n * @param options.code - Error code string. Defaults to `\"TRANSACTION_SIGNING_ERROR\"`.\n * @param options.wasRejected - Whether the user deliberately rejected. Defaults to `false`.\n * @param options.signerAddress - Base58 address of the signer that failed.\n * @param options.signature - Transaction signature, if the transaction was partially signed.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message: string,\n options?: {\n code?: string;\n wasRejected?: boolean;\n signerAddress?: string;\n signature?: string;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: options?.code ?? \"TRANSACTION_SIGNING_ERROR\",\n ...(options?.signature !== undefined && {\n signature: options.signature,\n }),\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"TransactionSigningError\";\n this.wasRejected = options?.wasRejected ?? false;\n if (options?.signerAddress !== undefined) {\n this.signerAddress = options.signerAddress;\n }\n }\n}\n\n/**\n * Error thrown when master seed signing is rejected by the user.\n *\n * The Umbra privacy protocol derives a deterministic master seed by asking the\n * user's wallet to sign a fixed message. This seed is the root of the key\n * hierarchy used for encrypting and decrypting confidential balances. If the\n * user declines to sign this message, no Umbra operations that require private\n * key material can proceed.\n *\n * @remarks\n * This error always has `wasRejected: true` because it is only thrown when the\n * user deliberately declines — hardware wallet failures or timeouts during the\n * seed derivation flow produce a generic {@link TransactionSigningError} instead.\n *\n * **Recovery** — Prompt the user to explain that the Umbra seed derivation\n * signature is used only to derive encryption keys locally and is never\n * broadcast to the network. Then call `getUmbraClient` again.\n *\n * **Default error code** — `\"MASTER_SEED_SIGNING_REJECTED\"`.\n *\n * @example\n * Distinguishing master seed rejection from other signing errors:\n * ```typescript\n * import {\n * MasterSeedSigningRejectedError,\n * isTransactionSigningError,\n * } from \"@umbra-privacy/sdk\";\n *\n * try {\n * const client = await getUmbraClient({ signer });\n * } catch (error) {\n * if (error instanceof MasterSeedSigningRejectedError) {\n * showModal(\n * \"Umbra needs a signature to derive your private keys locally. \" +\n * \"This signature is never sent to the network.\",\n * );\n * } else if (isTransactionSigningError(error)) {\n * showToast(`Signing error: ${error.message}`);\n * }\n * }\n * ```\n *\n * @see {@link TransactionSigningError} for the parent class\n * @public\n */\nexport class MasterSeedSigningRejectedError extends TransactionSigningError {\n /**\n * Creates a new `MasterSeedSigningRejectedError`.\n *\n * @param message - Human-readable description. Defaults to a standard rejection\n * message explaining that the user declined the required derivation signature.\n * @param options - Optional structured metadata.\n * @param options.signerAddress - Base58 address of the wallet that rejected.\n * @param options.context - Arbitrary key-value pairs for diagnostic context.\n * @param options.cause - The underlying error that caused this failure, if any.\n */\n constructor(\n message = \"Master seed derivation was rejected. The user declined to sign the required message.\",\n options?: {\n signerAddress?: string;\n context?: Record<string, unknown>;\n cause?: unknown;\n },\n ) {\n super(message, {\n code: \"MASTER_SEED_SIGNING_REJECTED\",\n wasRejected: true,\n ...(options?.signerAddress !== undefined && {\n signerAddress: options.signerAddress,\n }),\n ...(options?.context !== undefined && {\n context: options.context,\n }),\n ...(options?.cause !== undefined && {\n cause: options.cause,\n }),\n });\n this.name = \"MasterSeedSigningRejectedError\";\n }\n}\n\n/**\n * Type guard to check whether an unknown value is an {@link InstructionError}.\n *\n * @remarks\n * Prefer this function over `instanceof InstructionError` in code that may\n * cross module or bundle boundaries where the class reference might differ.\n *\n * @param error - The value to test.\n * @returns `true` if `error` is an instance of `InstructionError`, narrowing\n * the type accordingly.\n *\n * @example\n * ```typescript\n * if (isInstructionError(error)) {\n * console.error(\"Instruction:\", error.instructionName);\n * }\n * ```\n *\n * @see {@link InstructionError}\n * @public\n */\nexport function isInstructionError(error: unknown): error is InstructionError {\n return error instanceof InstructionError;\n}\n\n/**\n * Type guard to check whether an unknown value is an {@link RpcError}.\n *\n * @remarks\n * Prefer this function over `instanceof RpcError` in code that may cross\n * module or bundle boundaries where the class reference might differ.\n *\n * @param error - The value to test.\n * @returns `true` if `error` is an instance of `RpcError`, narrowing the type\n * accordingly.\n *\n * @example\n * ```typescript\n * if (isRpcError(error) && error.statusCode === 429) {\n * await sleep(backoffMs);\n * return retry();\n * }\n * ```\n *\n * @see {@link RpcError}\n * @public\n */\nexport function isRpcError(error: unknown): error is RpcError {\n return error instanceof RpcError;\n}\n\n/**\n * Type guard to check whether an unknown value is a {@link TransactionError}.\n *\n * @remarks\n * Because {@link TransactionSigningError} and {@link MasterSeedSigningRejectedError}\n * extend `TransactionError`, this guard returns `true` for those sub-classes as\n * well. Use the more specific guards ({@link isTransactionSigningError}) when the\n * sub-type matters.\n *\n * @param error - The value to test.\n * @returns `true` if `error` is an instance of `TransactionError` or any of its\n * sub-classes, narrowing the type accordingly.\n *\n * @example\n * ```typescript\n * if (isTransactionError(error) && error.simulationLogs) {\n * console.error(\"Simulation logs:\", error.simulationLogs.join(\"\\n\"));\n * }\n * ```\n *\n * @see {@link TransactionError}\n * @see {@link isTransactionSigningError}\n * @public\n */\nexport function isTransactionError(error: unknown): error is TransactionError {\n return error instanceof TransactionError;\n}\n\n/**\n * Type guard to check whether an unknown value is a {@link TransactionSigningError}.\n *\n * @remarks\n * Because {@link MasterSeedSigningRejectedError} extends `TransactionSigningError`,\n * this guard returns `true` for that sub-class as well.\n *\n * @param error - The value to test.\n * @returns `true` if `error` is an instance of `TransactionSigningError` or any\n * of its sub-classes, narrowing the type accordingly.\n *\n * @example\n * ```typescript\n * if (isTransactionSigningError(error) && error.wasRejected) {\n * showCancellationMessage();\n * }\n * ```\n *\n * @see {@link TransactionSigningError}\n * @see {@link MasterSeedSigningRejectedError}\n * @public\n */\nexport function isTransactionSigningError(error: unknown): error is TransactionSigningError {\n return error instanceof TransactionSigningError;\n}\n","/**\n * Umbra Error Classes\n *\n * This module provides error classes for all Umbra SDK operation failures,\n * each carrying a `stage` field that identifies exactly where in the pipeline\n * the failure occurred.\n *\n * @since 2.0.0\n * @module umbra/errors\n */\n\nimport { UmbraError } from \"../common/errors\";\n\n// =============================================================================\n// DEPOSIT\n// =============================================================================\n\n/**\n * Stage of the encrypted deposit operation where an error occurred.\n *\n * Each stage represents a distinct phase in the deposit flow:\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `validation` | Input parameter validation failed |\n * | `mint-fetch` | Failed to fetch mint account data |\n * | `fee-calculation` | Failed to calculate transfer fee |\n * | `pda-derivation` | PDA address generation failed |\n * | `account-fetch` | Failed to fetch account data from RPC |\n * | `instruction-build` | Failed to build the deposit instruction |\n * | `transaction-build` | Failed to build transaction message |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Failed to sign the transaction |\n * | `transaction-validate` | Transaction validation failed |\n * | `transaction-send` | Failed to send or confirm the transaction |\n */\nexport type EncryptedDepositStage =\n | \"initialization\"\n | \"validation\"\n | \"mint-fetch\"\n | \"fee-calculation\"\n | \"pda-derivation\"\n | \"account-fetch\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when an encrypted deposit operation fails. */\nexport class EncryptedDepositError extends UmbraError {\n readonly stage: EncryptedDepositStage;\n\n constructor(stage: EncryptedDepositStage, message: string, cause?: Error) {\n super(message, {\n code: `ENCRYPTED_DEPOSIT_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"EncryptedDepositError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is an EncryptedDepositError. */\nexport function isEncryptedDepositError(error: unknown): error is EncryptedDepositError {\n return error instanceof EncryptedDepositError;\n}\n\n// =============================================================================\n// WITHDRAWAL\n// =============================================================================\n\n/**\n * Stage of the encrypted withdrawal operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `validation` | Input parameter validation failed |\n * | `mint-fetch` | Failed to fetch mint account data |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build the withdrawal instruction |\n * | `transaction-build` | Failed to build transaction message |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Failed to sign the transaction |\n * | `transaction-send` | Failed to send or confirm the transaction |\n */\nexport type EncryptedWithdrawalStage =\n | \"initialization\"\n | \"validation\"\n | \"mint-fetch\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-send\";\n\n/** Error thrown when an encrypted withdrawal operation fails. */\nexport class EncryptedWithdrawalError extends UmbraError {\n readonly stage: EncryptedWithdrawalStage;\n\n constructor(stage: EncryptedWithdrawalStage, message: string, cause?: Error) {\n super(message, {\n code: `ENCRYPTED_WITHDRAWAL_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"EncryptedWithdrawalError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is an EncryptedWithdrawalError. */\nexport function isEncryptedWithdrawalError(error: unknown): error is EncryptedWithdrawalError {\n return error instanceof EncryptedWithdrawalError;\n}\n\n// =============================================================================\n// REGISTRATION\n// =============================================================================\n\n/**\n * Stage of the user registration operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `master-seed-derivation` | Master seed signing was rejected or failed |\n * | `account-fetch` | RPC call to read existing registration state failed |\n * | `key-derivation` | Cryptographic key derivation from master seed failed |\n * | `zk-proof-generation` | Groth16 proof generation failed (anonymous step) |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build an instruction |\n * | `transaction-build` | Blockhash fetch or transaction assembly failed |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Wallet rejected signing |\n * | `transaction-validate` | Pre-flight simulation failed |\n * | `transaction-send` | Transaction sent but confirmation timed out |\n */\nexport type RegistrationStage =\n | \"initialization\"\n | \"master-seed-derivation\"\n | \"account-fetch\"\n | \"key-derivation\"\n | \"zk-proof-generation\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when a user registration operation fails. */\nexport class RegistrationError extends UmbraError {\n readonly stage: RegistrationStage;\n\n constructor(stage: RegistrationStage, message: string, cause?: unknown) {\n super(message, {\n code: `REGISTRATION_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"RegistrationError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a RegistrationError. */\nexport function isRegistrationError(error: unknown): error is RegistrationError {\n return error instanceof RegistrationError;\n}\n\n// =============================================================================\n// CONVERSION\n// =============================================================================\n\n/**\n * Stage of the MXE-to-Shared conversion operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `account-fetch` | Batch RPC fetch of token account PDAs failed |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build a conversion instruction |\n * | `transaction-build` | Blockhash fetch or transaction assembly failed |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Wallet rejected signing for a per-mint transaction |\n * | `transaction-validate` | Pre-flight simulation failed |\n * | `transaction-send` | Transaction sent but confirmation timed out |\n */\nexport type ConversionStage =\n | \"initialization\"\n | \"account-fetch\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when an MXE-to-Shared conversion operation fails. */\nexport class ConversionError extends UmbraError {\n readonly stage: ConversionStage;\n\n constructor(stage: ConversionStage, message: string, cause?: unknown) {\n super(message, {\n code: `CONVERSION_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"ConversionError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a ConversionError. */\nexport function isConversionError(error: unknown): error is ConversionError {\n return error instanceof ConversionError;\n}\n\n// =============================================================================\n// CREATE UTXO\n// =============================================================================\n\n/**\n * Stage of a UTXO creation operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `validation` | Input parameter validation failed |\n * | `account-fetch` | Failed to fetch recipient or token account data |\n * | `mint-fetch` | Failed to fetch mint account data |\n * | `fee-calculation` | Token-2022 transfer fee calculation failed |\n * | `key-derivation` | Key derivation from master seed failed |\n * | `zk-proof-generation` | Groth16 proof generation failed |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build an instruction |\n * | `transaction-build` | Blockhash fetch or transaction assembly failed |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Wallet rejected signing |\n * | `transaction-validate` | Pre-flight simulation failed |\n * | `transaction-send` | Transaction sent but confirmation timed out |\n */\nexport type CreateUtxoStage =\n | \"initialization\"\n | \"validation\"\n | \"account-fetch\"\n | \"mint-fetch\"\n | \"fee-calculation\"\n | \"key-derivation\"\n | \"zk-proof-generation\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when a UTXO creation operation fails. */\nexport class CreateUtxoError extends UmbraError {\n readonly stage: CreateUtxoStage;\n\n constructor(stage: CreateUtxoStage, message: string, cause?: unknown) {\n super(message, {\n code: `CREATE_UTXO_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"CreateUtxoError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a CreateUtxoError. */\nexport function isCreateUtxoError(error: unknown): error is CreateUtxoError {\n return error instanceof CreateUtxoError;\n}\n\n// =============================================================================\n// FETCH UTXOS\n// =============================================================================\n\n/**\n * Stage of a UTXO fetch operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory construction failed — missing indexerApiEndpoint |\n * | `validation` | Invalid tree index or insertion index parameters |\n * | `key-derivation` | X25519 private key derivation from master seed failed |\n * | `indexer-fetch` | Indexer HTTP call failed |\n * | `proof-fetch` | Merkle proof HTTP call failed |\n */\nexport type FetchUtxosStage =\n | \"initialization\"\n | \"validation\"\n | \"key-derivation\"\n | \"indexer-fetch\"\n | \"proof-fetch\"\n | \"proof-enrichment\";\n\n/** Error thrown when a UTXO fetch operation fails. */\nexport class FetchUtxosError extends UmbraError {\n readonly stage: FetchUtxosStage;\n\n constructor(stage: FetchUtxosStage, message: string, cause?: unknown) {\n super(message, {\n code: `FETCH_UTXOS_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"FetchUtxosError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a FetchUtxosError. */\nexport function isFetchUtxosError(error: unknown): error is FetchUtxosError {\n return error instanceof FetchUtxosError;\n}\n\n// =============================================================================\n// CLAIM UTXO\n// =============================================================================\n\n/**\n * Stage of a UTXO claim operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `validation` | Invalid UTXO data or Merkle proof parameters |\n * | `key-derivation` | Key derivation from master seed failed |\n * | `zk-proof-generation` | Groth16 proof generation failed |\n * | `pda-derivation` | PDA address generation failed |\n * | `instruction-build` | Failed to build an instruction |\n * | `transaction-build` | Blockhash fetch or transaction assembly failed |\n * | `transaction-compile` | Failed to compile the transaction |\n * | `transaction-sign` | Wallet rejected signing |\n * | `transaction-validate` | Pre-flight simulation failed — also surfaces stale Merkle proof |\n * | `transaction-send` | Transaction sent but confirmation timed out |\n */\nexport type ClaimUtxoStage =\n | \"initialization\"\n | \"validation\"\n | \"key-derivation\"\n | \"zk-proof-generation\"\n | \"pda-derivation\"\n | \"instruction-build\"\n | \"transaction-build\"\n | \"transaction-compile\"\n | \"transaction-sign\"\n | \"transaction-validate\"\n | \"transaction-send\";\n\n/** Error thrown when a UTXO claim operation fails. */\nexport class ClaimUtxoError extends UmbraError {\n readonly stage: ClaimUtxoStage;\n\n constructor(stage: ClaimUtxoStage, message: string, cause?: unknown) {\n super(message, {\n code: `CLAIM_UTXO_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"ClaimUtxoError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a ClaimUtxoError. */\nexport function isClaimUtxoError(error: unknown): error is ClaimUtxoError {\n return error instanceof ClaimUtxoError;\n}\n\n// =============================================================================\n// QUERY\n// =============================================================================\n\n/**\n * Stage of a query operation where an error occurred.\n *\n * | Stage | Description |\n * |-------|-------------|\n * | `initialization` | Factory-level validation failed |\n * | `pda-derivation` | PDA address generation failed |\n * | `account-fetch` | RPC fetch failed |\n * | `account-decode` | On-chain account data could not be decoded |\n * | `key-derivation` | X25519 key derivation failed (encrypted balance query) |\n * | `decryption` | Rescue cipher decryption failed (encrypted balance query) |\n */\nexport type QueryStage =\n | \"initialization\"\n | \"pda-derivation\"\n | \"account-fetch\"\n | \"account-decode\"\n | \"key-derivation\"\n | \"decryption\";\n\n/** Error thrown when a query operation fails. */\nexport class QueryError extends UmbraError {\n readonly stage: QueryStage;\n\n constructor(stage: QueryStage, message: string, cause?: unknown) {\n super(message, {\n code: `QUERY_${stage.toUpperCase().replaceAll(\"-\", \"_\")}`,\n cause,\n });\n this.name = \"QueryError\";\n this.stage = stage;\n }\n}\n\n/** Type guard to check if an error is a QueryError. */\nexport function isQueryError(error: unknown): error is QueryError {\n return error instanceof QueryError;\n}\n"]}
|
|
@@ -2,10 +2,9 @@ import { splitAddressToLowHigh, createBn254FieldElement, generateRandomNonce, cr
|
|
|
2
2
|
import { BN254_FIELD_PRIME, getBn254ModularAdder, getBn254ModularSubtractor, bn254FieldElementSampler, curve25519FieldElementSampler, curve25519ModuloPow, curve25519ModuloInv, curve25519ModuloMul, curve25519ModuloSub, curve25519ModuloAdd, CURVE25519_FIELD_PRIME, getCurve25519ModularMulFunction, getCurve25519ModularAddFunction } from './chunk-WN75ORDT.js';
|
|
3
3
|
import { encodeU128ToU128LeBytes, decodeU256LeBytesToU256, encodeU256ToU256LeBytes } from './chunk-FQX6ZYGJ.js';
|
|
4
4
|
import { CryptographyAssertionError } from './chunk-4TZVXB5G.js';
|
|
5
|
-
import { assertAesKey, assertAesPlaintext,
|
|
5
|
+
import { assertAesKey, assertAesPlaintext, AES_AUTH_TAG_LENGTH, AES_IV_LENGTH, assertAesCiphertextWithMetadata, U256_BYTE_LENGTH, U512_BYTE_LENGTH, assertBn254FieldElement, assertPoseidonCounter, assertPoseidonKey, assertPoseidonKeystream, assertPoseidonPlaintext, assertPoseidonCiphertext, assertU512BeBytes, assertMasterSeed, CryptographyAssertionError as CryptographyAssertionError$1, assertMasterViewingKey, assertMintViewingKey, assertYearlyViewingKey, assertMonthlyViewingKey, assertDailyViewingKey, assertHourlyViewingKey, assertMinuteViewingKey, assertSecondViewingKey, assertX25519PrivateKey, assertSharedSecret, assertX25519PublicKey, assertRcCiphertext, U128_MAX, CURVE25519_FIELD_PRIME as CURVE25519_FIELD_PRIME$1, assertCurve25519FieldElement, assertRcPlaintext, assertU256LeBytes, assertRcEncryptionNonce, assertRcCounter, assertRcKey } from './chunk-CFTW5WNG.js';
|
|
6
6
|
import { __name } from './chunk-7QVYU63E.js';
|
|
7
7
|
import { gcm } from '@noble/ciphers/aes.js';
|
|
8
|
-
import { randomBytes } from 'crypto';
|
|
9
8
|
import { splitConstants, poseidon } from '@noble/curves/abstract/poseidon.js';
|
|
10
9
|
import { bn254_Fr } from '@noble/curves/bn254.js';
|
|
11
10
|
import { kmac256 } from '@noble/hashes/sha3-addons.js';
|
|
@@ -13,6 +12,12 @@ import { keccak_512, shake256, keccak_256 } from '@noble/hashes/sha3.js';
|
|
|
13
12
|
import { sha512 } from '@noble/hashes/sha2.js';
|
|
14
13
|
import { ed25519, x25519 } from '@noble/curves/ed25519.js';
|
|
15
14
|
|
|
15
|
+
function randomBytes(length) {
|
|
16
|
+
const bytes = new Uint8Array(length);
|
|
17
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
18
|
+
return bytes;
|
|
19
|
+
}
|
|
20
|
+
__name(randomBytes, "randomBytes");
|
|
16
21
|
function getAesEncryptor() {
|
|
17
22
|
return async (key, plaintext) => {
|
|
18
23
|
assertAesKey(key);
|
|
@@ -10746,5 +10751,5 @@ function getUserCommitmentGeneratorFunction(deps) {
|
|
|
10746
10751
|
__name(getUserCommitmentGeneratorFunction, "getUserCommitmentGeneratorFunction");
|
|
10747
10752
|
|
|
10748
10753
|
export { AES_AUTH_TAG_LENGTH2 as AES_AUTH_TAG_LENGTH, AES_IV_LENGTH2 as AES_IV_LENGTH, AES_KEY_LENGTH, AES_METADATA_OVERHEAD, ALPHA, ALPHA_INVERSE, BASE85_LIMB_MAX, BLOCK_SIZE, CIPHER_ROUND_COUNT, FIELD_ELEMENT_BYTE_LENGTH, FIELD_PRIME, GROTH16_G1_BYTE_LENGTH, GROTH16_G2_BYTE_LENGTH, HASH_CAPACITY, HASH_DIGEST_LENGTH, HASH_RATE, HASH_ROUND_COUNT, HASH_STATE_SIZE, MASTER_VIEWING_KEY_MAX, MAX_AGGREGATOR_INPUTS, MAX_POSEIDON_INPUTS, MAX_PRF_SEEDS, NONCE_BYTES, OPTIONAL_DATA_BYTE_LENGTH, PRECOMPUTED_FIELD_INVERSES, REDUCTION_CONST, SAMPLE_BUFFER_BYTE_LENGTH, SECRET_BYTES, SHAKE256_CIPHER_SEED, X25519_BYTE_LENGTH, ZK_PROOF_BYTE_LENGTH, assertAesCiphertextWithMetadata2 as assertAesCiphertextWithMetadata, assertAesKey2 as assertAesKey, assertAesPlaintext2 as assertAesPlaintext, assertBase85Limb, assertCurve25519KeypairResult, assertDailyViewingKey2 as assertDailyViewingKey, assertEd25519Keypair, assertGenerationSeed, assertGroth16ProofA, assertGroth16ProofB, assertGroth16ProofC, assertHourlyViewingKey2 as assertHourlyViewingKey, assertKeccak256Hash, assertKeccak512Hash, assertMasterSeed2 as assertMasterSeed, assertMasterViewingKey2 as assertMasterViewingKey, assertMintViewingKey2 as assertMintViewingKey, assertMinuteViewingKey2 as assertMinuteViewingKey, assertMonthlyViewingKey2 as assertMonthlyViewingKey, assertOptionalData32, assertPoseidonCiphertext2 as assertPoseidonCiphertext, assertPoseidonCounter2 as assertPoseidonCounter, assertPoseidonHash, assertPoseidonKey2 as assertPoseidonKey, assertPoseidonKeystream2 as assertPoseidonKeystream, assertPoseidonPlaintext2 as assertPoseidonPlaintext, assertRcCiphertext2 as assertRcCiphertext, assertRcCounter2 as assertRcCounter, assertRcEncryptionNonce2 as assertRcEncryptionNonce, assertRcKey2 as assertRcKey, assertRcPlaintext2 as assertRcPlaintext, assertSecondViewingKey2 as assertSecondViewingKey, assertSharedSecret2 as assertSharedSecret, assertX25519Bytes, assertX25519Keypair, assertX25519PrivateKey2 as assertX25519PrivateKey, assertX25519PublicKey2 as assertX25519PublicKey, assertYearlyViewingKey2 as assertYearlyViewingKey, assertZkProofBytes, buildPersonalizationString, defaultAesDecryptor, defaultAesEncryptor, deriveBn254FieldElementFromKeccak512, deriveEphemeralMasterViewingKey, deriveEphemeralMasterViewingKeyBlindingFactor, deriveEphemeralPoseidonPrivateKey, deriveEphemeralPoseidonPrivateKeyBlindingFactor, deriveKeystreamBlindingFactor, deriveModifiedGenerationIndexForReceiverClaim, deriveModifiedGenerationIndexForSenderClaim, deriveNullifierFromModifiedGenerationIndex, deriveProofAccountOffsetFromModifiedGenerationIndex, deriveRandomFactorForPolynomialCommitmentFromModifiedGenerationIndex, deriveRandomSecretFromModifiedGenerationIndex, deriveRescueEncryptionCommitmentBlindingFactorFromModifiedGenerationIndex, expandModifiedGenerationIndex, getAesDecryptor, getAesEncryptor, getBn254FieldElementFromKeccak512Deriver, getChallengePowersFunction, getDailyViewingKeyDeriver, getEphemeralMasterSeedDeriver, getEphemeralRescueCommitmentBlindingFactorDeriver, getEphemeralUtxoH2RandomSecretDeriver, getEphemeralUtxoMasterViewingKeyBlindingFactorDeriver, getEphemeralUtxoMasterViewingKeyDeriver, getEphemeralUtxoNullifierDeriver, getEphemeralUtxoPoseidonPrivateKeyBlindingFactorDeriver, getEphemeralUtxoPoseidonPrivateKeyDeriver, getFiatShamirChallengeGeneratorFunction, getFieldArithmetic, getHourlyViewingKeyDeriver, getKeystreamCommitmentGenerator, getMasterSeedBasedFieldElementDeriver, getMasterViewingKeyBlindingFactorDeriver, getMasterViewingKeyDeriver, getMasterViewingKeyX25519KeypairDeriver, getMintViewingKeyDeriver, getMintX25519KeypairDeriver, getMinuteViewingKeyDeriver, getModuloPowCurve25519Function, getMonthlyViewingKeyDeriver, getPersonalizationStringBuilder, getPolynomialCommitmentFactorDeriver, getPolynomialEvaluatorFunction, getPoseidonAggregator, getPoseidonBlindingFactorDeriver, getPoseidonDecryptor, getPoseidonEncryptor, getPoseidonHasher, getPoseidonKeystreamBlindingFactorDeriver, getPoseidonKeystreamGenerator, getPoseidonPrf, getPoseidonPrivateKeyDeriver, getPseudorandomU512Deriver, getRescueCipher, getRescueCipherFromKeyPair, getRescueCipherInstance, getRescueCommitmentBlindingFactorDeriver, getRescueCommitmentGenerator, getRescueDecryptorFromPrivateKey, getRescueEncryptorFromPrivateKey, getRescueEncryptorWithNonceFromPrivateKey, getRescueKeyGeneratorFromPrivateKey, getRescuePrimeHashFunction, getSecondViewingKeyDeriver, getUserAccountX25519KeypairDeriver, getUserCommitmentGeneratorFunction, getUtxoCommitmentHashGenerator, getYearlyViewingKeyDeriver };
|
|
10749
|
-
//# sourceMappingURL=chunk-
|
|
10750
|
-
//# sourceMappingURL=chunk-
|
|
10754
|
+
//# sourceMappingURL=chunk-YA66JLHI.js.map
|
|
10755
|
+
//# sourceMappingURL=chunk-YA66JLHI.js.map
|