@umbra-privacy/sdk 1.0.0 → 2.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.
Files changed (181) hide show
  1. package/README.md +104 -25
  2. package/dist/{addresses-Brzgurv_.d.ts → addresses-B7HybtbJ.d.ts} +2 -1
  3. package/dist/{addresses-D_0YAS6B.d.cts → addresses-CTVY1oi7.d.cts} +2 -1
  4. package/dist/arcium-BXXlryfe.d.cts +20 -0
  5. package/dist/arcium-BXXlryfe.d.ts +20 -0
  6. package/dist/chunk-4RHXVBNI.js +203 -0
  7. package/dist/chunk-4RHXVBNI.js.map +1 -0
  8. package/dist/chunk-4TZVXB5G.js +324 -0
  9. package/dist/chunk-4TZVXB5G.js.map +1 -0
  10. package/dist/chunk-5GUSMQ74.cjs +549 -0
  11. package/dist/chunk-5GUSMQ74.cjs.map +1 -0
  12. package/dist/chunk-5KPQXPQM.js +36 -0
  13. package/dist/chunk-5KPQXPQM.js.map +1 -0
  14. package/dist/chunk-AXD7LXYY.cjs +405 -0
  15. package/dist/chunk-AXD7LXYY.cjs.map +1 -0
  16. package/dist/{chunk-HOEXDXRC.cjs → chunk-BL6WXLPV.cjs} +32 -360
  17. package/dist/chunk-BL6WXLPV.cjs.map +1 -0
  18. package/dist/chunk-CFFLOE7D.cjs +598 -0
  19. package/dist/chunk-CFFLOE7D.cjs.map +1 -0
  20. package/dist/{chunk-BM7N6N7E.js → chunk-CFTW5WNG.js} +3 -325
  21. package/dist/chunk-CFTW5WNG.js.map +1 -0
  22. package/dist/chunk-DD2WCK4C.js +327 -0
  23. package/dist/chunk-DD2WCK4C.js.map +1 -0
  24. package/dist/chunk-DMPMQ74B.cjs +246 -0
  25. package/dist/chunk-DMPMQ74B.cjs.map +1 -0
  26. package/dist/{chunk-2Q75CQQJ.js → chunk-EEKF4553.js} +2 -2
  27. package/dist/chunk-EEKF4553.js.map +1 -0
  28. package/dist/chunk-ENVYYEM4.cjs +113 -0
  29. package/dist/chunk-ENVYYEM4.cjs.map +1 -0
  30. package/dist/chunk-FQX6ZYGJ.js +500 -0
  31. package/dist/chunk-FQX6ZYGJ.js.map +1 -0
  32. package/dist/chunk-FSK2ICMB.cjs +39 -0
  33. package/dist/chunk-FSK2ICMB.cjs.map +1 -0
  34. package/dist/chunk-FZYWLQAF.cjs +355 -0
  35. package/dist/chunk-FZYWLQAF.cjs.map +1 -0
  36. package/dist/chunk-GP26R377.js +436 -0
  37. package/dist/chunk-GP26R377.js.map +1 -0
  38. package/dist/chunk-HA5FLM63.js +393 -0
  39. package/dist/chunk-HA5FLM63.js.map +1 -0
  40. package/dist/chunk-INJ73LXQ.js +1107 -0
  41. package/dist/chunk-INJ73LXQ.js.map +1 -0
  42. package/dist/chunk-JPDF7BIT.cjs +10892 -0
  43. package/dist/chunk-JPDF7BIT.cjs.map +1 -0
  44. package/dist/{chunk-MDFSBU5W.cjs → chunk-LTCKPTZC.cjs} +2 -351
  45. package/dist/chunk-LTCKPTZC.cjs.map +1 -0
  46. package/dist/chunk-MKNCBUFA.js +564 -0
  47. package/dist/chunk-MKNCBUFA.js.map +1 -0
  48. package/dist/chunk-NKVMSABR.cjs +207 -0
  49. package/dist/chunk-NKVMSABR.cjs.map +1 -0
  50. package/dist/chunk-OFDWNWCL.js +70 -0
  51. package/dist/chunk-OFDWNWCL.js.map +1 -0
  52. package/dist/chunk-QJAUUYZU.cjs +331 -0
  53. package/dist/chunk-QJAUUYZU.cjs.map +1 -0
  54. package/dist/chunk-RVUYPKKD.js +10750 -0
  55. package/dist/chunk-RVUYPKKD.js.map +1 -0
  56. package/dist/chunk-TLR7A64G.js +103 -0
  57. package/dist/chunk-TLR7A64G.js.map +1 -0
  58. package/dist/{chunk-MVKTV3FT.cjs → chunk-TQQZGNOI.cjs} +2 -2
  59. package/dist/chunk-TQQZGNOI.cjs.map +1 -0
  60. package/dist/chunk-UOFYS6M3.js +219 -0
  61. package/dist/chunk-UOFYS6M3.js.map +1 -0
  62. package/dist/chunk-UXMQI6B7.js +2406 -0
  63. package/dist/chunk-UXMQI6B7.js.map +1 -0
  64. package/dist/chunk-WN75ORDT.js +571 -0
  65. package/dist/chunk-WN75ORDT.js.map +1 -0
  66. package/dist/chunk-Y55PYKXH.cjs +595 -0
  67. package/dist/chunk-Y55PYKXH.cjs.map +1 -0
  68. package/dist/chunk-YEZBTYCP.cjs +77 -0
  69. package/dist/chunk-YEZBTYCP.cjs.map +1 -0
  70. package/dist/chunk-ZQOIYCGA.cjs +1126 -0
  71. package/dist/chunk-ZQOIYCGA.cjs.map +1 -0
  72. package/dist/chunk-ZY3TSHMJ.cjs +2665 -0
  73. package/dist/chunk-ZY3TSHMJ.cjs.map +1 -0
  74. package/dist/client-DkVBHMWb.d.cts +2613 -0
  75. package/dist/client-V4AF6Bz9.d.ts +2613 -0
  76. package/dist/common/pda/index.cjs +145 -0
  77. package/dist/common/pda/index.cjs.map +1 -0
  78. package/dist/common/pda/index.d.cts +1250 -0
  79. package/dist/common/pda/index.d.ts +1250 -0
  80. package/dist/common/pda/index.js +8 -0
  81. package/dist/common/pda/index.js.map +1 -0
  82. package/dist/constants/index.cjs +38 -164
  83. package/dist/constants/index.cjs.map +1 -1
  84. package/dist/constants/index.d.cts +8 -425
  85. package/dist/constants/index.d.ts +8 -425
  86. package/dist/constants/index.js +15 -124
  87. package/dist/constants/index.js.map +1 -1
  88. package/dist/crypto/index.cjs +583 -0
  89. package/dist/crypto/index.cjs.map +1 -0
  90. package/dist/crypto/index.d.cts +6731 -0
  91. package/dist/crypto/index.d.ts +6731 -0
  92. package/dist/crypto/index.js +14 -0
  93. package/dist/crypto/index.js.map +1 -0
  94. package/dist/{cryptography-BTGC72u-.d.ts → cryptography-BFSJcvi6.d.ts} +3 -2465
  95. package/dist/{cryptography-BTGC72u-.d.cts → cryptography-D6tPDh-Y.d.cts} +3 -2465
  96. package/dist/errors/index.cjs +64 -54
  97. package/dist/errors/index.d.cts +7 -797
  98. package/dist/errors/index.d.ts +7 -797
  99. package/dist/errors/index.js +3 -1
  100. package/dist/errors-B9EoPeWV.d.cts +593 -0
  101. package/dist/errors-B9EoPeWV.d.ts +593 -0
  102. package/dist/errors-DAIrstEL.d.cts +300 -0
  103. package/dist/errors-DPNMfyh0.d.ts +300 -0
  104. package/dist/index-BG0yjL7C.d.cts +6006 -0
  105. package/dist/index-ByynoyBO.d.ts +6006 -0
  106. package/dist/index.cjs +5126 -16118
  107. package/dist/index.cjs.map +1 -1
  108. package/dist/index.d.cts +1031 -7685
  109. package/dist/index.d.ts +1031 -7685
  110. package/dist/index.js +3219 -14905
  111. package/dist/index.js.map +1 -1
  112. package/dist/interfaces/index.d.cts +14 -6
  113. package/dist/interfaces/index.d.ts +14 -6
  114. package/dist/interfaces-43cReBcS.d.cts +3346 -0
  115. package/dist/interfaces-B8xKNl_6.d.ts +997 -0
  116. package/dist/interfaces-D2NO6kDD.d.cts +997 -0
  117. package/dist/interfaces-z_xYJlgV.d.ts +3346 -0
  118. package/dist/math/index.cjs +115 -0
  119. package/dist/math/index.cjs.map +1 -0
  120. package/dist/math/index.d.cts +1327 -0
  121. package/dist/math/index.d.ts +1327 -0
  122. package/dist/math/index.js +10 -0
  123. package/dist/math/index.js.map +1 -0
  124. package/dist/networks-RMd3abPE.d.ts +44 -0
  125. package/dist/networks-yAoO8peQ.d.cts +44 -0
  126. package/dist/relayer-NRRMSMNB.js +4 -0
  127. package/dist/relayer-NRRMSMNB.js.map +1 -0
  128. package/dist/relayer-RJHEIXJG.cjs +21 -0
  129. package/dist/relayer-RJHEIXJG.cjs.map +1 -0
  130. package/dist/solana/index.cjs +56 -0
  131. package/dist/solana/index.cjs.map +1 -0
  132. package/dist/solana/index.d.cts +105 -0
  133. package/dist/solana/index.d.ts +105 -0
  134. package/dist/solana/index.js +7 -0
  135. package/dist/solana/index.js.map +1 -0
  136. package/dist/{index-CLj_zWSD.d.ts → temporal-BbRaEPoO.d.ts} +1 -1
  137. package/dist/{index-CX6_pIRS.d.cts → temporal-oUj7iCaq.d.cts} +1 -1
  138. package/dist/transaction-forwarder-5mAMTjw6.d.ts +1155 -0
  139. package/dist/transaction-forwarder-C6gMUG7a.d.cts +1155 -0
  140. package/dist/types/index.cjs +232 -231
  141. package/dist/types/index.d.cts +15 -1485
  142. package/dist/types/index.d.ts +15 -1485
  143. package/dist/types/index.js +2 -1
  144. package/dist/types-BohhvPth.d.cts +87 -0
  145. package/dist/types-CW0oTT0j.d.ts +87 -0
  146. package/dist/types-C_V_CaKK.d.cts +2468 -0
  147. package/dist/types-C_V_CaKK.d.ts +2468 -0
  148. package/dist/types-Ca7frykr.d.ts +793 -0
  149. package/dist/types-CuKeoI19.d.cts +1296 -0
  150. package/dist/types-CxfTIpN9.d.ts +1052 -0
  151. package/dist/{types-n-sHFcgr.d.ts → types-D1jDUjfN.d.ts} +2 -2
  152. package/dist/types-DKEDUlH9.d.ts +1296 -0
  153. package/dist/types-EKuIfxTz.d.cts +1052 -0
  154. package/dist/{types-BBuELtY8.d.cts → types-IMGYmlv-.d.cts} +2 -2
  155. package/dist/types-PwNLi_2k.d.cts +793 -0
  156. package/dist/utils/index.cjs +823 -525
  157. package/dist/utils/index.d.cts +1711 -4021
  158. package/dist/utils/index.d.ts +1711 -4021
  159. package/dist/utils/index.js +9 -3
  160. package/dist/{versions-D9PqsEvj.d.cts → versions-BRlR36EA.d.cts} +1 -0
  161. package/dist/{versions-D9PqsEvj.d.ts → versions-BRlR36EA.d.ts} +1 -0
  162. package/package.json +79 -18
  163. package/dist/chunk-2Q75CQQJ.js.map +0 -1
  164. package/dist/chunk-BM7N6N7E.js.map +0 -1
  165. package/dist/chunk-GXKSUB2U.cjs +0 -4416
  166. package/dist/chunk-GXKSUB2U.cjs.map +0 -1
  167. package/dist/chunk-HOEXDXRC.cjs.map +0 -1
  168. package/dist/chunk-MDFSBU5W.cjs.map +0 -1
  169. package/dist/chunk-MQY7HDIA.js +0 -600
  170. package/dist/chunk-MQY7HDIA.js.map +0 -1
  171. package/dist/chunk-MVKTV3FT.cjs.map +0 -1
  172. package/dist/chunk-PG2J6V6Y.js +0 -4094
  173. package/dist/chunk-PG2J6V6Y.js.map +0 -1
  174. package/dist/chunk-VEGLTTYQ.cjs +0 -621
  175. package/dist/chunk-VEGLTTYQ.cjs.map +0 -1
  176. package/dist/chunk-WVHQ46DD.js +0 -758
  177. package/dist/chunk-WVHQ46DD.js.map +0 -1
  178. package/dist/index-B9pDY73x.d.ts +0 -12933
  179. package/dist/index-D33yo0qB.d.cts +0 -12933
  180. package/dist/networks-C-orpSFW.d.ts +0 -65
  181. package/dist/networks-FxYERGD1.d.cts +0 -65
@@ -1,758 +0,0 @@
1
- import { __name } from './chunk-7QVYU63E.js';
2
-
3
- // src/common/errors.ts
4
- var UmbraError = class _UmbraError extends Error {
5
- static {
6
- __name(this, "UmbraError");
7
- }
8
- /**
9
- * A machine-readable error code for programmatic error handling.
10
- *
11
- * @remarks
12
- * Defaults to `"UMBRA_ERROR"` when no code is supplied in the constructor options.
13
- * Sub-classes or specific throw sites should supply a more specific code to allow
14
- * callers to branch on error identity without string-matching `message`.
15
- *
16
- * @readonly
17
- */
18
- code;
19
- /**
20
- * Additional context about the error.
21
- *
22
- * @remarks
23
- * A free-form key-value map of diagnostic data attached to the error at the throw site.
24
- * Useful for logging and debugging — consumers should not rely on specific keys for
25
- * control flow; use `code` for programmatic branching instead.
26
- *
27
- * Will be `undefined` when no context was provided to the constructor.
28
- *
29
- * @readonly
30
- */
31
- context;
32
- /**
33
- * The original error that caused this error, if any.
34
- *
35
- * @remarks
36
- * When an SDK function wraps a lower-level error (e.g., a failed RPC call or a
37
- * cryptographic library error), it sets `cause` to the original thrown value so
38
- * callers can inspect the full error chain.
39
- *
40
- * Will be `undefined` when there is no underlying cause.
41
- *
42
- * @readonly
43
- */
44
- cause;
45
- /**
46
- * Creates a new UmbraError.
47
- *
48
- * @param message - Human-readable description of what went wrong. Should be
49
- * actionable and specific enough for a developer to understand the failure
50
- * without reading source code.
51
- * @param options - Optional structured metadata attached to the error.
52
- * @param options.code - Machine-readable error code for programmatic branching.
53
- * Defaults to `"UMBRA_ERROR"` if omitted.
54
- * @param options.context - Free-form diagnostic key-value pairs. Omit or set to
55
- * `undefined` to leave the `context` property unset.
56
- * @param options.cause - The original error that triggered this one. Enables
57
- * full error-chain inspection. Omit or set to `undefined` when there is no
58
- * underlying cause.
59
- *
60
- * @defaultValue `options` — `undefined` (all options optional)
61
- * @defaultValue `options.code` — `"UMBRA_ERROR"`
62
- */
63
- constructor(message, options) {
64
- super(message);
65
- this.name = "UmbraError";
66
- this.code = options?.code ?? "UMBRA_ERROR";
67
- if (options?.context !== void 0) {
68
- this.context = options.context;
69
- }
70
- if (options?.cause !== void 0) {
71
- this.cause = options.cause;
72
- }
73
- Error.captureStackTrace(this, _UmbraError);
74
- }
75
- };
76
- function isUmbraError(error) {
77
- return error instanceof UmbraError;
78
- }
79
- __name(isUmbraError, "isUmbraError");
80
- var MathematicsAssertionError = class _MathematicsAssertionError extends Error {
81
- static {
82
- __name(this, "MathematicsAssertionError");
83
- }
84
- /**
85
- * The actual value that failed the assertion.
86
- *
87
- * @remarks
88
- * The runtime type reflects what was actually passed to the assertion function:
89
- * - `bigint` for integer assertions (`assertU8`, `assertU256`, etc.)
90
- * - `Uint8Array` for byte-array assertions (`assertU256LeBytes`, `assertU32LeBytes`, etc.)
91
- * - Any other type when a non-numeric value was passed unexpectedly
92
- *
93
- * @readonly
94
- */
95
- value;
96
- /**
97
- * The type that was expected.
98
- *
99
- * @remarks
100
- * Contains the branded type name exactly as it appears in the SDK type system,
101
- * e.g., `"U8"`, `"U256"`, `"U32LeBytes"`. Use this for structured logging or
102
- * to build user-facing error messages without parsing the `message` string.
103
- *
104
- * @readonly
105
- */
106
- expectedType;
107
- /**
108
- * Description of the constraint that was violated.
109
- *
110
- * @remarks
111
- * Is `undefined` when only a type check failed (e.g., a `string` was passed where a
112
- * `bigint` was expected). Contains a human-readable inequality or length rule when a
113
- * value of the correct type was out of the allowed range.
114
- *
115
- * @example
116
- * - `"0 <= value <= 255"` — U8 range violation
117
- * - `"length === 32"` — U256LeBytes length violation
118
- * - `"value >= 0"` — negative value passed to an unsigned integer assertion
119
- *
120
- * @readonly
121
- */
122
- constraint;
123
- /**
124
- * Creates a new MathematicsAssertionError.
125
- *
126
- * @param message - Human-readable description of the assertion failure. Should name
127
- * the assertion function, the expected type, and the constraint that was violated.
128
- * @param options - Structured diagnostic details attached to the error.
129
- * @param options.value - The actual value that was supplied and failed the assertion.
130
- * @param options.expectedType - The name of the branded type that was expected
131
- * (e.g., `"U8"`, `"U256LeBytes"`).
132
- * @param options.constraint - Optional human-readable constraint description
133
- * (e.g., `"0 <= value <= 255"`). Omit when the failure is a type mismatch rather
134
- * than a range violation.
135
- */
136
- constructor(message, options) {
137
- super(message);
138
- this.name = "MathematicsAssertionError";
139
- this.value = options.value;
140
- this.expectedType = options.expectedType;
141
- this.constraint = options.constraint;
142
- Error.captureStackTrace(this, _MathematicsAssertionError);
143
- Object.setPrototypeOf(this, _MathematicsAssertionError.prototype);
144
- }
145
- };
146
- var CryptographyAssertionError = class _CryptographyAssertionError extends Error {
147
- static {
148
- __name(this, "CryptographyAssertionError");
149
- }
150
- /**
151
- * The actual value that failed the assertion.
152
- *
153
- * @remarks
154
- * The runtime type reflects what was actually passed to the assertion function:
155
- * - `bigint` for field element assertions (`assertBn254FieldElement`, etc.)
156
- * - `Uint8Array` for byte-array assertions (`assertAesKey`, `assertX25519PrivateKey`, etc.)
157
- * - Any other type when an entirely wrong value type was supplied
158
- *
159
- * @readonly
160
- */
161
- value;
162
- /**
163
- * The type that was expected (e.g., `"Bn254FieldElement"`, `"PoseidonKey"`, `"AesKey"`).
164
- *
165
- * @remarks
166
- * Contains the branded type name exactly as it appears in the SDK type system.
167
- * Use this property for structured logging without parsing the `message` string.
168
- *
169
- * @readonly
170
- */
171
- expectedType;
172
- /**
173
- * Description of the constraint that was violated.
174
- *
175
- * @remarks
176
- * Is `undefined` for pure type-mismatch failures (e.g., `string` instead of `bigint`).
177
- * Contains a human-readable constraint description for range and length violations
178
- * (e.g., `"value < BN254_FIELD_PRIME"`, `"length === 32"`).
179
- *
180
- * @readonly
181
- */
182
- constraint;
183
- /**
184
- * Creates a new CryptographyAssertionError.
185
- *
186
- * @param message - Human-readable description of the assertion failure. Should name
187
- * the assertion function, the expected type, and the constraint that was violated.
188
- * @param options - Structured diagnostic details attached to the error.
189
- * @param options.value - The actual value that was supplied and failed the assertion.
190
- * @param options.expectedType - The name of the branded cryptographic type that was
191
- * expected (e.g., `"Bn254FieldElement"`, `"AesKey"`).
192
- * @param options.constraint - Optional human-readable constraint description.
193
- * Omit when the failure is a type mismatch rather than a range or length violation.
194
- */
195
- constructor(message, options) {
196
- super(message);
197
- this.name = "CryptographyAssertionError";
198
- this.value = options.value;
199
- this.expectedType = options.expectedType;
200
- this.constraint = options.constraint;
201
- Error.captureStackTrace(this, _CryptographyAssertionError);
202
- Object.setPrototypeOf(this, _CryptographyAssertionError.prototype);
203
- }
204
- };
205
- var SolanaAssertionError = class _SolanaAssertionError extends Error {
206
- static {
207
- __name(this, "SolanaAssertionError");
208
- }
209
- /**
210
- * The actual value that failed the assertion.
211
- *
212
- * @remarks
213
- * The runtime type reflects what was actually passed to the assertion function:
214
- * - `string` for Base58-encoded assertions (`assertTransactionSignature`, etc.)
215
- * - `Uint8Array` for byte-array assertions (`assertSignatureBytes`, etc.)
216
- * - Any other type when a completely wrong value type was supplied
217
- *
218
- * @readonly
219
- */
220
- value;
221
- /**
222
- * The type that was expected (e.g., `"TransactionSignature"`, `"SignatureBytes"`).
223
- *
224
- * @remarks
225
- * Contains the branded type name exactly as it appears in the SDK type system.
226
- * Use this for structured logging without parsing the `message` string.
227
- *
228
- * @readonly
229
- */
230
- expectedType;
231
- /**
232
- * Description of the constraint that was violated.
233
- *
234
- * @remarks
235
- * Is `undefined` for pure type-mismatch failures. Contains a human-readable rule
236
- * for encoding or length violations (e.g., `"valid Base58"`, `"length === 64"`).
237
- *
238
- * @readonly
239
- */
240
- constraint;
241
- /**
242
- * Creates a new SolanaAssertionError.
243
- *
244
- * @param message - Human-readable description of the assertion failure. Should name
245
- * the assertion function, the expected type, and the constraint that was violated.
246
- * @param options - Structured diagnostic details attached to the error.
247
- * @param options.value - The actual value that was supplied and failed the assertion.
248
- * @param options.expectedType - The name of the branded Solana type that was expected
249
- * (e.g., `"TransactionSignature"`, `"SignatureBytes"`).
250
- * @param options.constraint - Optional human-readable constraint description.
251
- * Omit when the failure is a type mismatch rather than an encoding or length violation.
252
- */
253
- constructor(message, options) {
254
- super(message);
255
- this.name = "SolanaAssertionError";
256
- this.value = options.value;
257
- this.expectedType = options.expectedType;
258
- this.constraint = options.constraint;
259
- Error.captureStackTrace(this, _SolanaAssertionError);
260
- Object.setPrototypeOf(this, _SolanaAssertionError.prototype);
261
- }
262
- };
263
- var TemporalAssertionError = class extends Error {
264
- static {
265
- __name(this, "TemporalAssertionError");
266
- }
267
- /**
268
- * The actual value that failed the assertion.
269
- *
270
- * @remarks
271
- * Will be a `bigint` for all temporal assertions since the temporal types are
272
- * BigInt-backed branded types (e.g., `Year`, `Month`, `Day`). May also be any
273
- * other type when a non-bigint value was supplied unexpectedly.
274
- *
275
- * @readonly
276
- */
277
- value;
278
- /**
279
- * The type that was expected (e.g., `"Year"`, `"Month"`, `"Hour"`).
280
- *
281
- * @remarks
282
- * Contains the branded temporal type name exactly as it appears in the SDK type system.
283
- * Use this for structured logging without parsing the `message` string.
284
- *
285
- * @readonly
286
- */
287
- expectedType;
288
- /**
289
- * Description of the constraint that was violated.
290
- *
291
- * @remarks
292
- * Contains a human-readable range rule for out-of-range values
293
- * (e.g., `"1 <= value <= 12"` for a month violation). Is `undefined` only for
294
- * pure type-mismatch failures (e.g., a `string` passed where a `bigint` was expected),
295
- * which should not occur in normal usage.
296
- *
297
- * @readonly
298
- */
299
- constraint;
300
- /**
301
- * Creates a new TemporalAssertionError.
302
- *
303
- * @param message - Human-readable description of the assertion failure. Should name
304
- * the assertion function, the expected type, and the violated range constraint.
305
- * @param details - Structured diagnostic details attached to the error.
306
- * @param details.value - The actual `bigint` value (or other type) that was supplied
307
- * and failed the temporal assertion.
308
- * @param details.expectedType - The name of the branded temporal type that was expected
309
- * (e.g., `"Year"`, `"Month"`, `"Hour"`).
310
- * @param details.constraint - Optional human-readable range description
311
- * (e.g., `"1 <= value <= 12"`). Omit when the failure is a type mismatch.
312
- */
313
- constructor(message, details) {
314
- super(message);
315
- this.name = "TemporalAssertionError";
316
- this.value = details.value;
317
- this.expectedType = details.expectedType;
318
- this.constraint = details.constraint;
319
- }
320
- };
321
-
322
- // src/crypto/errors.ts
323
- var CryptographyError = class extends UmbraError {
324
- static {
325
- __name(this, "CryptographyError");
326
- }
327
- /**
328
- * The cryptographic operation that failed.
329
- */
330
- operation;
331
- constructor(message, options) {
332
- super(message, {
333
- code: options?.code ?? "CRYPTOGRAPHY_ERROR",
334
- ...options?.context !== void 0 && {
335
- context: options.context
336
- },
337
- ...options?.cause !== void 0 && {
338
- cause: options.cause
339
- }
340
- });
341
- this.name = "CryptographyError";
342
- if (options?.operation !== void 0) {
343
- this.operation = options.operation;
344
- }
345
- }
346
- };
347
- function isCryptographyError(error) {
348
- return error instanceof CryptographyError;
349
- }
350
- __name(isCryptographyError, "isCryptographyError");
351
-
352
- // src/solana/errors.ts
353
- var InstructionError = class extends UmbraError {
354
- static {
355
- __name(this, "InstructionError");
356
- }
357
- /**
358
- * The name of the instruction that failed during construction or validation.
359
- *
360
- * @remarks
361
- * Matches the Anchor instruction name (camelCase), e.g. `"encryptedDeposit"`,
362
- * `"initUserAccount"`. May be `undefined` if the failing instruction could
363
- * not be identified at the throw site.
364
- */
365
- instructionName;
366
- /**
367
- * Creates a new `InstructionError`.
368
- *
369
- * @param message - Human-readable description of the instruction failure.
370
- * @param options - Optional structured metadata.
371
- * @param options.code - Error code string. Defaults to `"INSTRUCTION_ERROR"`.
372
- * @param options.instructionName - The name of the failing instruction.
373
- * @param options.context - Arbitrary key-value pairs for diagnostic context.
374
- * @param options.cause - The underlying error that caused this failure, if any.
375
- */
376
- constructor(message, options) {
377
- super(message, {
378
- code: options?.code ?? "INSTRUCTION_ERROR",
379
- ...options?.context !== void 0 && {
380
- context: options.context
381
- },
382
- ...options?.cause !== void 0 && {
383
- cause: options.cause
384
- }
385
- });
386
- this.name = "InstructionError";
387
- if (options?.instructionName !== void 0) {
388
- this.instructionName = options.instructionName;
389
- }
390
- }
391
- };
392
- var RpcError = class extends UmbraError {
393
- static {
394
- __name(this, "RpcError");
395
- }
396
- /**
397
- * The RPC endpoint URL that was called when the error occurred.
398
- *
399
- * @remarks
400
- * May be `undefined` if the endpoint was not known at the throw site (e.g.,
401
- * when the error originates deep within `@solana/kit` internals).
402
- */
403
- endpoint;
404
- /**
405
- * The HTTP status code returned by the RPC node, if applicable.
406
- *
407
- * @remarks
408
- * `undefined` for network-level failures (e.g., DNS resolution failure,
409
- * connection refused) where no HTTP response was received.
410
- */
411
- statusCode;
412
- /**
413
- * The JSON-RPC error code from the response body, if any.
414
- *
415
- * @remarks
416
- * Set when the RPC node returns a well-formed JSON-RPC error object with a
417
- * numeric `code` field. `undefined` for HTTP-level failures or when the node
418
- * returns a malformed response body.
419
- */
420
- rpcErrorCode;
421
- /**
422
- * Creates a new `RpcError`.
423
- *
424
- * @param message - Human-readable description of the RPC failure.
425
- * @param options - Optional structured metadata.
426
- * @param options.code - Error code string. Defaults to `"RPC_ERROR"`.
427
- * @param options.endpoint - The RPC endpoint URL that was called.
428
- * @param options.statusCode - HTTP status code from the response, if any.
429
- * @param options.rpcErrorCode - JSON-RPC error code from the response, if any.
430
- * @param options.context - Arbitrary key-value pairs for diagnostic context.
431
- * @param options.cause - The underlying error that caused this failure, if any.
432
- */
433
- constructor(message, options) {
434
- super(message, {
435
- code: options?.code ?? "RPC_ERROR",
436
- ...options?.context !== void 0 && {
437
- context: options.context
438
- },
439
- ...options?.cause !== void 0 && {
440
- cause: options.cause
441
- }
442
- });
443
- this.name = "RpcError";
444
- if (options?.endpoint !== void 0) {
445
- this.endpoint = options.endpoint;
446
- }
447
- if (options?.statusCode !== void 0) {
448
- this.statusCode = options.statusCode;
449
- }
450
- if (options?.rpcErrorCode !== void 0) {
451
- this.rpcErrorCode = options.rpcErrorCode;
452
- }
453
- }
454
- };
455
- var TransactionError = class extends UmbraError {
456
- static {
457
- __name(this, "TransactionError");
458
- }
459
- /**
460
- * The transaction signature, if available.
461
- *
462
- * @remarks
463
- * Base58-encoded signature string. Present when the transaction was submitted
464
- * to the network but failed during execution. Use this to look up the failed
465
- * transaction in a block explorer.
466
- */
467
- signature;
468
- /**
469
- * Simulation log output from the transaction preflight, if available.
470
- *
471
- * @remarks
472
- * Each entry in the array is one line of program log output (e.g.,
473
- * `"Program log: ..."` or `"Program <address> failed: ..."`). Anchor programs
474
- * emit error codes and names here when constraints are violated.
475
- */
476
- simulationLogs;
477
- /**
478
- * Creates a new `TransactionError`.
479
- *
480
- * @param message - Human-readable description of the transaction failure.
481
- * @param options - Optional structured metadata.
482
- * @param options.code - Error code string. Defaults to `"TRANSACTION_ERROR"`.
483
- * @param options.signature - Base58-encoded transaction signature, if available.
484
- * @param options.simulationLogs - Program log output from preflight simulation.
485
- * @param options.context - Arbitrary key-value pairs for diagnostic context.
486
- * @param options.cause - The underlying error that caused this failure, if any.
487
- */
488
- constructor(message, options) {
489
- super(message, {
490
- code: options?.code ?? "TRANSACTION_ERROR",
491
- ...options?.context !== void 0 && {
492
- context: options.context
493
- },
494
- ...options?.cause !== void 0 && {
495
- cause: options.cause
496
- }
497
- });
498
- this.name = "TransactionError";
499
- if (options?.signature !== void 0) {
500
- this.signature = options.signature;
501
- }
502
- if (options?.simulationLogs !== void 0) {
503
- this.simulationLogs = options.simulationLogs;
504
- }
505
- }
506
- };
507
- var TransactionSigningError = class extends TransactionError {
508
- static {
509
- __name(this, "TransactionSigningError");
510
- }
511
- /**
512
- * Whether the signing was explicitly rejected by the user.
513
- *
514
- * @remarks
515
- * `true` when the wallet UI presented a sign request and the user actively
516
- * clicked "Reject" or equivalent. `false` when the failure was due to a
517
- * technical issue (disconnected device, timeout, missing key).
518
- *
519
- * @defaultValue `false`
520
- */
521
- wasRejected;
522
- /**
523
- * The address of the signer that failed to produce a signature.
524
- *
525
- * @remarks
526
- * Base58-encoded public key string. May be `undefined` if the failing signer
527
- * could not be identified at the throw site.
528
- */
529
- signerAddress;
530
- /**
531
- * Creates a new `TransactionSigningError`.
532
- *
533
- * @param message - Human-readable description of the signing failure.
534
- * @param options - Optional structured metadata.
535
- * @param options.code - Error code string. Defaults to `"TRANSACTION_SIGNING_ERROR"`.
536
- * @param options.wasRejected - Whether the user deliberately rejected. Defaults to `false`.
537
- * @param options.signerAddress - Base58 address of the signer that failed.
538
- * @param options.signature - Transaction signature, if the transaction was partially signed.
539
- * @param options.context - Arbitrary key-value pairs for diagnostic context.
540
- * @param options.cause - The underlying error that caused this failure, if any.
541
- */
542
- constructor(message, options) {
543
- super(message, {
544
- code: options?.code ?? "TRANSACTION_SIGNING_ERROR",
545
- ...options?.signature !== void 0 && {
546
- signature: options.signature
547
- },
548
- ...options?.context !== void 0 && {
549
- context: options.context
550
- },
551
- ...options?.cause !== void 0 && {
552
- cause: options.cause
553
- }
554
- });
555
- this.name = "TransactionSigningError";
556
- this.wasRejected = options?.wasRejected ?? false;
557
- if (options?.signerAddress !== void 0) {
558
- this.signerAddress = options.signerAddress;
559
- }
560
- }
561
- };
562
- var MasterSeedSigningRejectedError = class extends TransactionSigningError {
563
- static {
564
- __name(this, "MasterSeedSigningRejectedError");
565
- }
566
- /**
567
- * Creates a new `MasterSeedSigningRejectedError`.
568
- *
569
- * @param message - Human-readable description. Defaults to a standard rejection
570
- * message explaining that the user declined the required derivation signature.
571
- * @param options - Optional structured metadata.
572
- * @param options.signerAddress - Base58 address of the wallet that rejected.
573
- * @param options.context - Arbitrary key-value pairs for diagnostic context.
574
- * @param options.cause - The underlying error that caused this failure, if any.
575
- */
576
- constructor(message = "Master seed derivation was rejected. The user declined to sign the required message.", options) {
577
- super(message, {
578
- code: "MASTER_SEED_SIGNING_REJECTED",
579
- wasRejected: true,
580
- ...options?.signerAddress !== void 0 && {
581
- signerAddress: options.signerAddress
582
- },
583
- ...options?.context !== void 0 && {
584
- context: options.context
585
- },
586
- ...options?.cause !== void 0 && {
587
- cause: options.cause
588
- }
589
- });
590
- this.name = "MasterSeedSigningRejectedError";
591
- }
592
- };
593
- function isInstructionError(error) {
594
- return error instanceof InstructionError;
595
- }
596
- __name(isInstructionError, "isInstructionError");
597
- function isRpcError(error) {
598
- return error instanceof RpcError;
599
- }
600
- __name(isRpcError, "isRpcError");
601
- function isTransactionError(error) {
602
- return error instanceof TransactionError;
603
- }
604
- __name(isTransactionError, "isTransactionError");
605
- function isTransactionSigningError(error) {
606
- return error instanceof TransactionSigningError;
607
- }
608
- __name(isTransactionSigningError, "isTransactionSigningError");
609
-
610
- // src/umbra/errors.ts
611
- var EncryptedDepositError = class extends UmbraError {
612
- static {
613
- __name(this, "EncryptedDepositError");
614
- }
615
- stage;
616
- constructor(stage, message, cause) {
617
- super(message, {
618
- code: `ENCRYPTED_DEPOSIT_${stage.toUpperCase().replaceAll("-", "_")}`,
619
- cause
620
- });
621
- this.name = "EncryptedDepositError";
622
- this.stage = stage;
623
- }
624
- };
625
- function isEncryptedDepositError(error) {
626
- return error instanceof EncryptedDepositError;
627
- }
628
- __name(isEncryptedDepositError, "isEncryptedDepositError");
629
- var EncryptedWithdrawalError = class extends UmbraError {
630
- static {
631
- __name(this, "EncryptedWithdrawalError");
632
- }
633
- stage;
634
- constructor(stage, message, cause) {
635
- super(message, {
636
- code: `ENCRYPTED_WITHDRAWAL_${stage.toUpperCase().replaceAll("-", "_")}`,
637
- cause
638
- });
639
- this.name = "EncryptedWithdrawalError";
640
- this.stage = stage;
641
- }
642
- };
643
- function isEncryptedWithdrawalError(error) {
644
- return error instanceof EncryptedWithdrawalError;
645
- }
646
- __name(isEncryptedWithdrawalError, "isEncryptedWithdrawalError");
647
- var RegistrationError = class extends UmbraError {
648
- static {
649
- __name(this, "RegistrationError");
650
- }
651
- stage;
652
- constructor(stage, message, cause) {
653
- super(message, {
654
- code: `REGISTRATION_${stage.toUpperCase().replaceAll("-", "_")}`,
655
- cause
656
- });
657
- this.name = "RegistrationError";
658
- this.stage = stage;
659
- }
660
- };
661
- function isRegistrationError(error) {
662
- return error instanceof RegistrationError;
663
- }
664
- __name(isRegistrationError, "isRegistrationError");
665
- var ConversionError = class extends UmbraError {
666
- static {
667
- __name(this, "ConversionError");
668
- }
669
- stage;
670
- constructor(stage, message, cause) {
671
- super(message, {
672
- code: `CONVERSION_${stage.toUpperCase().replaceAll("-", "_")}`,
673
- cause
674
- });
675
- this.name = "ConversionError";
676
- this.stage = stage;
677
- }
678
- };
679
- function isConversionError(error) {
680
- return error instanceof ConversionError;
681
- }
682
- __name(isConversionError, "isConversionError");
683
- var CreateUtxoError = class extends UmbraError {
684
- static {
685
- __name(this, "CreateUtxoError");
686
- }
687
- stage;
688
- constructor(stage, message, cause) {
689
- super(message, {
690
- code: `CREATE_UTXO_${stage.toUpperCase().replaceAll("-", "_")}`,
691
- cause
692
- });
693
- this.name = "CreateUtxoError";
694
- this.stage = stage;
695
- }
696
- };
697
- function isCreateUtxoError(error) {
698
- return error instanceof CreateUtxoError;
699
- }
700
- __name(isCreateUtxoError, "isCreateUtxoError");
701
- var FetchUtxosError = class extends UmbraError {
702
- static {
703
- __name(this, "FetchUtxosError");
704
- }
705
- stage;
706
- constructor(stage, message, cause) {
707
- super(message, {
708
- code: `FETCH_UTXOS_${stage.toUpperCase().replaceAll("-", "_")}`,
709
- cause
710
- });
711
- this.name = "FetchUtxosError";
712
- this.stage = stage;
713
- }
714
- };
715
- function isFetchUtxosError(error) {
716
- return error instanceof FetchUtxosError;
717
- }
718
- __name(isFetchUtxosError, "isFetchUtxosError");
719
- var ClaimUtxoError = class extends UmbraError {
720
- static {
721
- __name(this, "ClaimUtxoError");
722
- }
723
- stage;
724
- constructor(stage, message, cause) {
725
- super(message, {
726
- code: `CLAIM_UTXO_${stage.toUpperCase().replaceAll("-", "_")}`,
727
- cause
728
- });
729
- this.name = "ClaimUtxoError";
730
- this.stage = stage;
731
- }
732
- };
733
- function isClaimUtxoError(error) {
734
- return error instanceof ClaimUtxoError;
735
- }
736
- __name(isClaimUtxoError, "isClaimUtxoError");
737
- var QueryError = class extends UmbraError {
738
- static {
739
- __name(this, "QueryError");
740
- }
741
- stage;
742
- constructor(stage, message, cause) {
743
- super(message, {
744
- code: `QUERY_${stage.toUpperCase().replaceAll("-", "_")}`,
745
- cause
746
- });
747
- this.name = "QueryError";
748
- this.stage = stage;
749
- }
750
- };
751
- function isQueryError(error) {
752
- return error instanceof QueryError;
753
- }
754
- __name(isQueryError, "isQueryError");
755
-
756
- export { ClaimUtxoError, ConversionError, CreateUtxoError, CryptographyAssertionError, CryptographyError, EncryptedDepositError, EncryptedWithdrawalError, FetchUtxosError, InstructionError, MasterSeedSigningRejectedError, MathematicsAssertionError, QueryError, RegistrationError, RpcError, SolanaAssertionError, TemporalAssertionError, TransactionError, TransactionSigningError, UmbraError, isClaimUtxoError, isConversionError, isCreateUtxoError, isCryptographyError, isEncryptedDepositError, isEncryptedWithdrawalError, isFetchUtxosError, isInstructionError, isQueryError, isRegistrationError, isRpcError, isTransactionError, isTransactionSigningError, isUmbraError };
757
- //# sourceMappingURL=chunk-WVHQ46DD.js.map
758
- //# sourceMappingURL=chunk-WVHQ46DD.js.map