@waiaas/core 2.0.0-rc.1

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 (173) hide show
  1. package/dist/enums/audit.d.ts +5 -0
  2. package/dist/enums/audit.d.ts.map +1 -0
  3. package/dist/enums/audit.js +31 -0
  4. package/dist/enums/audit.js.map +1 -0
  5. package/dist/enums/chain.d.ts +50 -0
  6. package/dist/enums/chain.d.ts.map +1 -0
  7. package/dist/enums/chain.js +123 -0
  8. package/dist/enums/chain.js.map +1 -0
  9. package/dist/enums/index.d.ts +10 -0
  10. package/dist/enums/index.d.ts.map +1 -0
  11. package/dist/enums/index.js +10 -0
  12. package/dist/enums/index.js.map +1 -0
  13. package/dist/enums/notification.d.ts +8 -0
  14. package/dist/enums/notification.d.ts.map +1 -0
  15. package/dist/enums/notification.js +34 -0
  16. package/dist/enums/notification.js.map +1 -0
  17. package/dist/enums/owner.d.ts +5 -0
  18. package/dist/enums/owner.d.ts.map +1 -0
  19. package/dist/enums/owner.js +5 -0
  20. package/dist/enums/owner.js.map +1 -0
  21. package/dist/enums/policy.d.ts +8 -0
  22. package/dist/enums/policy.d.ts.map +1 -0
  23. package/dist/enums/policy.js +19 -0
  24. package/dist/enums/policy.js.map +1 -0
  25. package/dist/enums/session.d.ts +5 -0
  26. package/dist/enums/session.d.ts.map +1 -0
  27. package/dist/enums/session.js +5 -0
  28. package/dist/enums/session.js.map +1 -0
  29. package/dist/enums/system.d.ts +5 -0
  30. package/dist/enums/system.d.ts.map +1 -0
  31. package/dist/enums/system.js +4 -0
  32. package/dist/enums/system.js.map +1 -0
  33. package/dist/enums/transaction.d.ts +8 -0
  34. package/dist/enums/transaction.d.ts.map +1 -0
  35. package/dist/enums/transaction.js +25 -0
  36. package/dist/enums/transaction.js.map +1 -0
  37. package/dist/enums/wallet.d.ts +5 -0
  38. package/dist/enums/wallet.d.ts.map +1 -0
  39. package/dist/enums/wallet.js +10 -0
  40. package/dist/enums/wallet.js.map +1 -0
  41. package/dist/errors/base-error.d.ts +25 -0
  42. package/dist/errors/base-error.d.ts.map +1 -0
  43. package/dist/errors/base-error.js +33 -0
  44. package/dist/errors/base-error.js.map +1 -0
  45. package/dist/errors/chain-error.d.ts +48 -0
  46. package/dist/errors/chain-error.d.ts.map +1 -0
  47. package/dist/errors/chain-error.js +83 -0
  48. package/dist/errors/chain-error.js.map +1 -0
  49. package/dist/errors/error-codes.d.ts +667 -0
  50. package/dist/errors/error-codes.d.ts.map +1 -0
  51. package/dist/errors/error-codes.js +671 -0
  52. package/dist/errors/error-codes.js.map +1 -0
  53. package/dist/errors/index.d.ts +4 -0
  54. package/dist/errors/index.d.ts.map +1 -0
  55. package/dist/errors/index.js +4 -0
  56. package/dist/errors/index.js.map +1 -0
  57. package/dist/events/event-bus.d.ts +36 -0
  58. package/dist/events/event-bus.d.ts.map +1 -0
  59. package/dist/events/event-bus.js +74 -0
  60. package/dist/events/event-bus.js.map +1 -0
  61. package/dist/events/event-types.d.ts +59 -0
  62. package/dist/events/event-types.d.ts.map +1 -0
  63. package/dist/events/event-types.js +16 -0
  64. package/dist/events/event-types.js.map +1 -0
  65. package/dist/events/index.d.ts +3 -0
  66. package/dist/events/index.d.ts.map +1 -0
  67. package/dist/events/index.js +3 -0
  68. package/dist/events/index.js.map +1 -0
  69. package/dist/i18n/en.d.ts +57 -0
  70. package/dist/i18n/en.d.ts.map +1 -0
  71. package/dist/i18n/en.js +194 -0
  72. package/dist/i18n/en.js.map +1 -0
  73. package/dist/i18n/index.d.ts +5 -0
  74. package/dist/i18n/index.d.ts.map +1 -0
  75. package/dist/i18n/index.js +7 -0
  76. package/dist/i18n/index.js.map +1 -0
  77. package/dist/i18n/ko.d.ts +3 -0
  78. package/dist/i18n/ko.d.ts.map +1 -0
  79. package/dist/i18n/ko.js +194 -0
  80. package/dist/i18n/ko.js.map +1 -0
  81. package/dist/index.d.ts +14 -0
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/index.js +26 -0
  84. package/dist/index.js.map +1 -0
  85. package/dist/interfaces/IChainAdapter.d.ts +61 -0
  86. package/dist/interfaces/IChainAdapter.d.ts.map +1 -0
  87. package/dist/interfaces/IChainAdapter.js +2 -0
  88. package/dist/interfaces/IChainAdapter.js.map +1 -0
  89. package/dist/interfaces/ILocalKeyStore.d.ts +24 -0
  90. package/dist/interfaces/ILocalKeyStore.d.ts.map +1 -0
  91. package/dist/interfaces/ILocalKeyStore.js +2 -0
  92. package/dist/interfaces/ILocalKeyStore.js.map +1 -0
  93. package/dist/interfaces/INotificationChannel.d.ts +32 -0
  94. package/dist/interfaces/INotificationChannel.d.ts.map +1 -0
  95. package/dist/interfaces/INotificationChannel.js +2 -0
  96. package/dist/interfaces/INotificationChannel.js.map +1 -0
  97. package/dist/interfaces/IPolicyEngine.d.ts +44 -0
  98. package/dist/interfaces/IPolicyEngine.d.ts.map +1 -0
  99. package/dist/interfaces/IPolicyEngine.js +2 -0
  100. package/dist/interfaces/IPolicyEngine.js.map +1 -0
  101. package/dist/interfaces/action-provider.types.d.ts +123 -0
  102. package/dist/interfaces/action-provider.types.d.ts.map +1 -0
  103. package/dist/interfaces/action-provider.types.js +65 -0
  104. package/dist/interfaces/action-provider.types.js.map +1 -0
  105. package/dist/interfaces/chain-adapter.types.d.ts +216 -0
  106. package/dist/interfaces/chain-adapter.types.d.ts.map +1 -0
  107. package/dist/interfaces/chain-adapter.types.js +2 -0
  108. package/dist/interfaces/chain-adapter.types.js.map +1 -0
  109. package/dist/interfaces/forex-rate.types.d.ts +63 -0
  110. package/dist/interfaces/forex-rate.types.d.ts.map +1 -0
  111. package/dist/interfaces/forex-rate.types.js +41 -0
  112. package/dist/interfaces/forex-rate.types.js.map +1 -0
  113. package/dist/interfaces/index.d.ts +15 -0
  114. package/dist/interfaces/index.d.ts.map +1 -0
  115. package/dist/interfaces/index.js +5 -0
  116. package/dist/interfaces/index.js.map +1 -0
  117. package/dist/interfaces/price-oracle.types.d.ts +99 -0
  118. package/dist/interfaces/price-oracle.types.d.ts.map +1 -0
  119. package/dist/interfaces/price-oracle.types.js +48 -0
  120. package/dist/interfaces/price-oracle.types.js.map +1 -0
  121. package/dist/interfaces/x402.types.d.ts +112 -0
  122. package/dist/interfaces/x402.types.d.ts.map +1 -0
  123. package/dist/interfaces/x402.types.js +69 -0
  124. package/dist/interfaces/x402.types.js.map +1 -0
  125. package/dist/schemas/asset.schema.d.ts +32 -0
  126. package/dist/schemas/asset.schema.d.ts.map +1 -0
  127. package/dist/schemas/asset.schema.js +15 -0
  128. package/dist/schemas/asset.schema.js.map +1 -0
  129. package/dist/schemas/config.schema.d.ts +58 -0
  130. package/dist/schemas/config.schema.d.ts.map +1 -0
  131. package/dist/schemas/config.schema.js +23 -0
  132. package/dist/schemas/config.schema.js.map +1 -0
  133. package/dist/schemas/index.d.ts +7 -0
  134. package/dist/schemas/index.d.ts.map +1 -0
  135. package/dist/schemas/index.js +9 -0
  136. package/dist/schemas/index.js.map +1 -0
  137. package/dist/schemas/policy.schema.d.ts +192 -0
  138. package/dist/schemas/policy.schema.d.ts.map +1 -0
  139. package/dist/schemas/policy.schema.js +157 -0
  140. package/dist/schemas/policy.schema.js.map +1 -0
  141. package/dist/schemas/session.schema.d.ts +51 -0
  142. package/dist/schemas/session.schema.d.ts.map +1 -0
  143. package/dist/schemas/session.schema.js +19 -0
  144. package/dist/schemas/session.schema.js.map +1 -0
  145. package/dist/schemas/transaction.schema.d.ts +834 -0
  146. package/dist/schemas/transaction.schema.d.ts.map +1 -0
  147. package/dist/schemas/transaction.schema.js +112 -0
  148. package/dist/schemas/transaction.schema.js.map +1 -0
  149. package/dist/schemas/wallet.schema.d.ts +54 -0
  150. package/dist/schemas/wallet.schema.d.ts.map +1 -0
  151. package/dist/schemas/wallet.schema.js +21 -0
  152. package/dist/schemas/wallet.schema.js.map +1 -0
  153. package/dist/testing/chain-adapter-contract.d.ts +42 -0
  154. package/dist/testing/chain-adapter-contract.d.ts.map +1 -0
  155. package/dist/testing/chain-adapter-contract.js +370 -0
  156. package/dist/testing/chain-adapter-contract.js.map +1 -0
  157. package/dist/testing/index.d.ts +8 -0
  158. package/dist/testing/index.d.ts.map +1 -0
  159. package/dist/testing/index.js +7 -0
  160. package/dist/testing/index.js.map +1 -0
  161. package/dist/utils/format-amount.d.ts +41 -0
  162. package/dist/utils/format-amount.d.ts.map +1 -0
  163. package/dist/utils/format-amount.js +60 -0
  164. package/dist/utils/format-amount.js.map +1 -0
  165. package/dist/utils/format-currency.d.ts +42 -0
  166. package/dist/utils/format-currency.d.ts.map +1 -0
  167. package/dist/utils/format-currency.js +92 -0
  168. package/dist/utils/format-currency.js.map +1 -0
  169. package/dist/utils/index.d.ts +3 -0
  170. package/dist/utils/index.d.ts.map +1 -0
  171. package/dist/utils/index.js +5 -0
  172. package/dist/utils/index.js.map +1 -0
  173. package/package.json +50 -0
@@ -0,0 +1,667 @@
1
+ export type ErrorDomain = 'AUTH' | 'SESSION' | 'TX' | 'POLICY' | 'OWNER' | 'SYSTEM' | 'WALLET' | 'WITHDRAW' | 'ACTION' | 'ADMIN' | 'X402';
2
+ export interface ErrorCodeEntry {
3
+ code: string;
4
+ domain: ErrorDomain;
5
+ httpStatus: number;
6
+ retryable: boolean;
7
+ message: string;
8
+ }
9
+ /**
10
+ * 74 error codes from SS10.12 unified error code matrix.
11
+ * SSoT: 37-rest-api-complete-spec.md section 10.12
12
+ */
13
+ export declare const ERROR_CODES: {
14
+ readonly INVALID_TOKEN: {
15
+ readonly code: "INVALID_TOKEN";
16
+ readonly domain: "AUTH";
17
+ readonly httpStatus: 401;
18
+ readonly retryable: false;
19
+ readonly message: "Invalid authentication token";
20
+ };
21
+ readonly TOKEN_EXPIRED: {
22
+ readonly code: "TOKEN_EXPIRED";
23
+ readonly domain: "AUTH";
24
+ readonly httpStatus: 401;
25
+ readonly retryable: false;
26
+ readonly message: "Authentication token has expired";
27
+ };
28
+ readonly SESSION_REVOKED: {
29
+ readonly code: "SESSION_REVOKED";
30
+ readonly domain: "AUTH";
31
+ readonly httpStatus: 401;
32
+ readonly retryable: false;
33
+ readonly message: "Session has been revoked";
34
+ };
35
+ readonly INVALID_SIGNATURE: {
36
+ readonly code: "INVALID_SIGNATURE";
37
+ readonly domain: "AUTH";
38
+ readonly httpStatus: 401;
39
+ readonly retryable: false;
40
+ readonly message: "Invalid cryptographic signature";
41
+ };
42
+ readonly INVALID_NONCE: {
43
+ readonly code: "INVALID_NONCE";
44
+ readonly domain: "AUTH";
45
+ readonly httpStatus: 401;
46
+ readonly retryable: false;
47
+ readonly message: "Invalid or expired nonce";
48
+ };
49
+ readonly INVALID_MASTER_PASSWORD: {
50
+ readonly code: "INVALID_MASTER_PASSWORD";
51
+ readonly domain: "AUTH";
52
+ readonly httpStatus: 401;
53
+ readonly retryable: false;
54
+ readonly message: "Invalid master password";
55
+ };
56
+ readonly MASTER_PASSWORD_LOCKED: {
57
+ readonly code: "MASTER_PASSWORD_LOCKED";
58
+ readonly domain: "AUTH";
59
+ readonly httpStatus: 429;
60
+ readonly retryable: false;
61
+ readonly message: "Master password locked due to too many failed attempts";
62
+ };
63
+ readonly SYSTEM_LOCKED: {
64
+ readonly code: "SYSTEM_LOCKED";
65
+ readonly domain: "AUTH";
66
+ readonly httpStatus: 503;
67
+ readonly retryable: false;
68
+ readonly message: "System is locked";
69
+ };
70
+ readonly SESSION_NOT_FOUND: {
71
+ readonly code: "SESSION_NOT_FOUND";
72
+ readonly domain: "SESSION";
73
+ readonly httpStatus: 404;
74
+ readonly retryable: false;
75
+ readonly message: "Session not found";
76
+ };
77
+ readonly SESSION_EXPIRED: {
78
+ readonly code: "SESSION_EXPIRED";
79
+ readonly domain: "SESSION";
80
+ readonly httpStatus: 401;
81
+ readonly retryable: false;
82
+ readonly message: "Session has expired";
83
+ };
84
+ readonly SESSION_LIMIT_EXCEEDED: {
85
+ readonly code: "SESSION_LIMIT_EXCEEDED";
86
+ readonly domain: "SESSION";
87
+ readonly httpStatus: 403;
88
+ readonly retryable: false;
89
+ readonly message: "Maximum session limit exceeded";
90
+ };
91
+ readonly CONSTRAINT_VIOLATED: {
92
+ readonly code: "CONSTRAINT_VIOLATED";
93
+ readonly domain: "SESSION";
94
+ readonly httpStatus: 403;
95
+ readonly retryable: false;
96
+ readonly message: "Session constraint violated";
97
+ };
98
+ readonly RENEWAL_LIMIT_REACHED: {
99
+ readonly code: "RENEWAL_LIMIT_REACHED";
100
+ readonly domain: "SESSION";
101
+ readonly httpStatus: 403;
102
+ readonly retryable: false;
103
+ readonly message: "Session renewal limit reached";
104
+ };
105
+ readonly SESSION_ABSOLUTE_LIFETIME_EXCEEDED: {
106
+ readonly code: "SESSION_ABSOLUTE_LIFETIME_EXCEEDED";
107
+ readonly domain: "SESSION";
108
+ readonly httpStatus: 403;
109
+ readonly retryable: false;
110
+ readonly message: "Session absolute lifetime exceeded";
111
+ };
112
+ readonly RENEWAL_TOO_EARLY: {
113
+ readonly code: "RENEWAL_TOO_EARLY";
114
+ readonly domain: "SESSION";
115
+ readonly httpStatus: 403;
116
+ readonly retryable: true;
117
+ readonly message: "Session renewal attempted too early";
118
+ };
119
+ readonly SESSION_RENEWAL_MISMATCH: {
120
+ readonly code: "SESSION_RENEWAL_MISMATCH";
121
+ readonly domain: "SESSION";
122
+ readonly httpStatus: 403;
123
+ readonly retryable: false;
124
+ readonly message: "Session renewal count mismatch";
125
+ };
126
+ readonly PIPELINE_HALTED: {
127
+ readonly code: "PIPELINE_HALTED";
128
+ readonly domain: "TX";
129
+ readonly httpStatus: 409;
130
+ readonly retryable: false;
131
+ readonly message: "Pipeline halted (transaction queued for delay or approval)";
132
+ };
133
+ readonly INSUFFICIENT_BALANCE: {
134
+ readonly code: "INSUFFICIENT_BALANCE";
135
+ readonly domain: "TX";
136
+ readonly httpStatus: 400;
137
+ readonly retryable: false;
138
+ readonly message: "Insufficient balance for transaction";
139
+ };
140
+ readonly INVALID_ADDRESS: {
141
+ readonly code: "INVALID_ADDRESS";
142
+ readonly domain: "TX";
143
+ readonly httpStatus: 400;
144
+ readonly retryable: false;
145
+ readonly message: "Invalid blockchain address";
146
+ };
147
+ readonly TX_NOT_FOUND: {
148
+ readonly code: "TX_NOT_FOUND";
149
+ readonly domain: "TX";
150
+ readonly httpStatus: 404;
151
+ readonly retryable: false;
152
+ readonly message: "Transaction not found";
153
+ };
154
+ readonly TX_EXPIRED: {
155
+ readonly code: "TX_EXPIRED";
156
+ readonly domain: "TX";
157
+ readonly httpStatus: 410;
158
+ readonly retryable: false;
159
+ readonly message: "Transaction has expired";
160
+ };
161
+ readonly TX_ALREADY_PROCESSED: {
162
+ readonly code: "TX_ALREADY_PROCESSED";
163
+ readonly domain: "TX";
164
+ readonly httpStatus: 409;
165
+ readonly retryable: false;
166
+ readonly message: "Transaction has already been processed";
167
+ };
168
+ readonly CHAIN_ERROR: {
169
+ readonly code: "CHAIN_ERROR";
170
+ readonly domain: "TX";
171
+ readonly httpStatus: 502;
172
+ readonly retryable: true;
173
+ readonly message: "Blockchain RPC error";
174
+ };
175
+ readonly SIMULATION_FAILED: {
176
+ readonly code: "SIMULATION_FAILED";
177
+ readonly domain: "TX";
178
+ readonly httpStatus: 422;
179
+ readonly retryable: false;
180
+ readonly message: "Transaction simulation failed";
181
+ };
182
+ readonly TOKEN_NOT_FOUND: {
183
+ readonly code: "TOKEN_NOT_FOUND";
184
+ readonly domain: "TX";
185
+ readonly httpStatus: 404;
186
+ readonly retryable: false;
187
+ readonly message: "Token not found";
188
+ };
189
+ readonly TOKEN_NOT_ALLOWED: {
190
+ readonly code: "TOKEN_NOT_ALLOWED";
191
+ readonly domain: "TX";
192
+ readonly httpStatus: 403;
193
+ readonly retryable: false;
194
+ readonly message: "Token not in allowed list";
195
+ };
196
+ readonly INSUFFICIENT_TOKEN_BALANCE: {
197
+ readonly code: "INSUFFICIENT_TOKEN_BALANCE";
198
+ readonly domain: "TX";
199
+ readonly httpStatus: 400;
200
+ readonly retryable: false;
201
+ readonly message: "Insufficient token balance";
202
+ };
203
+ readonly CONTRACT_CALL_DISABLED: {
204
+ readonly code: "CONTRACT_CALL_DISABLED";
205
+ readonly domain: "TX";
206
+ readonly httpStatus: 403;
207
+ readonly retryable: false;
208
+ readonly message: "Contract calls are disabled (no CONTRACT_WHITELIST configured)";
209
+ };
210
+ readonly CONTRACT_NOT_WHITELISTED: {
211
+ readonly code: "CONTRACT_NOT_WHITELISTED";
212
+ readonly domain: "TX";
213
+ readonly httpStatus: 403;
214
+ readonly retryable: false;
215
+ readonly message: "Contract address not whitelisted";
216
+ };
217
+ readonly METHOD_NOT_WHITELISTED: {
218
+ readonly code: "METHOD_NOT_WHITELISTED";
219
+ readonly domain: "TX";
220
+ readonly httpStatus: 403;
221
+ readonly retryable: false;
222
+ readonly message: "Method selector not whitelisted";
223
+ };
224
+ readonly APPROVE_DISABLED: {
225
+ readonly code: "APPROVE_DISABLED";
226
+ readonly domain: "TX";
227
+ readonly httpStatus: 403;
228
+ readonly retryable: false;
229
+ readonly message: "Token approvals are disabled (no APPROVED_SPENDERS configured)";
230
+ };
231
+ readonly SPENDER_NOT_APPROVED: {
232
+ readonly code: "SPENDER_NOT_APPROVED";
233
+ readonly domain: "TX";
234
+ readonly httpStatus: 403;
235
+ readonly retryable: false;
236
+ readonly message: "Spender address not in approved list";
237
+ };
238
+ readonly APPROVE_AMOUNT_EXCEEDED: {
239
+ readonly code: "APPROVE_AMOUNT_EXCEEDED";
240
+ readonly domain: "TX";
241
+ readonly httpStatus: 403;
242
+ readonly retryable: false;
243
+ readonly message: "Approve amount exceeds limit";
244
+ };
245
+ readonly UNLIMITED_APPROVE_BLOCKED: {
246
+ readonly code: "UNLIMITED_APPROVE_BLOCKED";
247
+ readonly domain: "TX";
248
+ readonly httpStatus: 403;
249
+ readonly retryable: false;
250
+ readonly message: "Unlimited token approval is blocked";
251
+ };
252
+ readonly BATCH_NOT_SUPPORTED: {
253
+ readonly code: "BATCH_NOT_SUPPORTED";
254
+ readonly domain: "TX";
255
+ readonly httpStatus: 400;
256
+ readonly retryable: false;
257
+ readonly message: "Batch transactions not supported on this chain";
258
+ };
259
+ readonly BATCH_SIZE_EXCEEDED: {
260
+ readonly code: "BATCH_SIZE_EXCEEDED";
261
+ readonly domain: "TX";
262
+ readonly httpStatus: 400;
263
+ readonly retryable: false;
264
+ readonly message: "Batch instruction count exceeds maximum (20)";
265
+ };
266
+ readonly BATCH_POLICY_VIOLATION: {
267
+ readonly code: "BATCH_POLICY_VIOLATION";
268
+ readonly domain: "TX";
269
+ readonly httpStatus: 403;
270
+ readonly retryable: false;
271
+ readonly message: "Policy violation in batch transaction";
272
+ };
273
+ readonly ENVIRONMENT_NETWORK_MISMATCH: {
274
+ readonly code: "ENVIRONMENT_NETWORK_MISMATCH";
275
+ readonly domain: "TX";
276
+ readonly httpStatus: 400;
277
+ readonly retryable: false;
278
+ readonly message: "Network is not allowed in this wallet's environment";
279
+ };
280
+ readonly INVALID_TRANSACTION: {
281
+ readonly code: "INVALID_TRANSACTION";
282
+ readonly domain: "TX";
283
+ readonly httpStatus: 400;
284
+ readonly retryable: false;
285
+ readonly message: "Invalid raw transaction format";
286
+ };
287
+ readonly WALLET_NOT_SIGNER: {
288
+ readonly code: "WALLET_NOT_SIGNER";
289
+ readonly domain: "TX";
290
+ readonly httpStatus: 400;
291
+ readonly retryable: false;
292
+ readonly message: "Wallet is not a signer in this transaction";
293
+ };
294
+ readonly UNSUPPORTED_TX_TYPE: {
295
+ readonly code: "UNSUPPORTED_TX_TYPE";
296
+ readonly domain: "TX";
297
+ readonly httpStatus: 400;
298
+ readonly retryable: false;
299
+ readonly message: "Unsupported transaction type";
300
+ };
301
+ readonly CHAIN_ID_MISMATCH: {
302
+ readonly code: "CHAIN_ID_MISMATCH";
303
+ readonly domain: "TX";
304
+ readonly httpStatus: 400;
305
+ readonly retryable: false;
306
+ readonly message: "Transaction chain ID does not match requested network";
307
+ };
308
+ readonly ABI_ENCODING_FAILED: {
309
+ readonly code: "ABI_ENCODING_FAILED";
310
+ readonly domain: "TX";
311
+ readonly httpStatus: 400;
312
+ readonly retryable: false;
313
+ readonly message: "ABI encoding failed";
314
+ };
315
+ readonly POLICY_NOT_FOUND: {
316
+ readonly code: "POLICY_NOT_FOUND";
317
+ readonly domain: "POLICY";
318
+ readonly httpStatus: 404;
319
+ readonly retryable: false;
320
+ readonly message: "Policy not found";
321
+ };
322
+ readonly POLICY_DENIED: {
323
+ readonly code: "POLICY_DENIED";
324
+ readonly domain: "POLICY";
325
+ readonly httpStatus: 403;
326
+ readonly retryable: false;
327
+ readonly message: "Transaction denied by policy";
328
+ };
329
+ readonly SPENDING_LIMIT_EXCEEDED: {
330
+ readonly code: "SPENDING_LIMIT_EXCEEDED";
331
+ readonly domain: "POLICY";
332
+ readonly httpStatus: 403;
333
+ readonly retryable: false;
334
+ readonly message: "Spending limit exceeded";
335
+ };
336
+ readonly RATE_LIMIT_EXCEEDED: {
337
+ readonly code: "RATE_LIMIT_EXCEEDED";
338
+ readonly domain: "POLICY";
339
+ readonly httpStatus: 429;
340
+ readonly retryable: true;
341
+ readonly message: "Rate limit exceeded";
342
+ };
343
+ readonly WHITELIST_DENIED: {
344
+ readonly code: "WHITELIST_DENIED";
345
+ readonly domain: "POLICY";
346
+ readonly httpStatus: 403;
347
+ readonly retryable: false;
348
+ readonly message: "Address not in whitelist";
349
+ };
350
+ readonly OWNER_ALREADY_CONNECTED: {
351
+ readonly code: "OWNER_ALREADY_CONNECTED";
352
+ readonly domain: "OWNER";
353
+ readonly httpStatus: 409;
354
+ readonly retryable: false;
355
+ readonly message: "Owner wallet already connected";
356
+ };
357
+ readonly OWNER_NOT_CONNECTED: {
358
+ readonly code: "OWNER_NOT_CONNECTED";
359
+ readonly domain: "OWNER";
360
+ readonly httpStatus: 404;
361
+ readonly retryable: false;
362
+ readonly message: "Owner wallet not connected";
363
+ };
364
+ readonly OWNER_NOT_FOUND: {
365
+ readonly code: "OWNER_NOT_FOUND";
366
+ readonly domain: "OWNER";
367
+ readonly httpStatus: 404;
368
+ readonly retryable: false;
369
+ readonly message: "Owner not found";
370
+ };
371
+ readonly APPROVAL_TIMEOUT: {
372
+ readonly code: "APPROVAL_TIMEOUT";
373
+ readonly domain: "OWNER";
374
+ readonly httpStatus: 410;
375
+ readonly retryable: false;
376
+ readonly message: "Approval request has timed out";
377
+ };
378
+ readonly APPROVAL_NOT_FOUND: {
379
+ readonly code: "APPROVAL_NOT_FOUND";
380
+ readonly domain: "OWNER";
381
+ readonly httpStatus: 404;
382
+ readonly retryable: false;
383
+ readonly message: "Approval request not found";
384
+ };
385
+ readonly OWNER_NOT_SET: {
386
+ readonly code: "OWNER_NOT_SET";
387
+ readonly domain: "OWNER";
388
+ readonly httpStatus: 400;
389
+ readonly retryable: false;
390
+ readonly message: "Owner address must be set before this operation";
391
+ };
392
+ readonly OWNER_ADDRESS_MISMATCH: {
393
+ readonly code: "OWNER_ADDRESS_MISMATCH";
394
+ readonly domain: "OWNER";
395
+ readonly httpStatus: 403;
396
+ readonly retryable: false;
397
+ readonly message: "Connected wallet address does not match registered owner";
398
+ };
399
+ readonly KILL_SWITCH_ACTIVE: {
400
+ readonly code: "KILL_SWITCH_ACTIVE";
401
+ readonly domain: "SYSTEM";
402
+ readonly httpStatus: 409;
403
+ readonly retryable: false;
404
+ readonly message: "Kill switch is active, all operations suspended";
405
+ };
406
+ readonly KILL_SWITCH_NOT_ACTIVE: {
407
+ readonly code: "KILL_SWITCH_NOT_ACTIVE";
408
+ readonly domain: "SYSTEM";
409
+ readonly httpStatus: 409;
410
+ readonly retryable: false;
411
+ readonly message: "Kill switch is not active";
412
+ };
413
+ readonly KILL_SWITCH_ALREADY_ACTIVE: {
414
+ readonly code: "KILL_SWITCH_ALREADY_ACTIVE";
415
+ readonly domain: "SYSTEM";
416
+ readonly httpStatus: 409;
417
+ readonly retryable: false;
418
+ readonly message: "Kill switch transition conflict";
419
+ };
420
+ readonly INVALID_STATE_TRANSITION: {
421
+ readonly code: "INVALID_STATE_TRANSITION";
422
+ readonly domain: "SYSTEM";
423
+ readonly httpStatus: 409;
424
+ readonly retryable: false;
425
+ readonly message: "Invalid kill switch state transition";
426
+ };
427
+ readonly KEYSTORE_LOCKED: {
428
+ readonly code: "KEYSTORE_LOCKED";
429
+ readonly domain: "SYSTEM";
430
+ readonly httpStatus: 503;
431
+ readonly retryable: true;
432
+ readonly message: "Keystore is locked";
433
+ };
434
+ readonly CHAIN_NOT_SUPPORTED: {
435
+ readonly code: "CHAIN_NOT_SUPPORTED";
436
+ readonly domain: "SYSTEM";
437
+ readonly httpStatus: 400;
438
+ readonly retryable: false;
439
+ readonly message: "Blockchain chain type not supported";
440
+ };
441
+ readonly SHUTTING_DOWN: {
442
+ readonly code: "SHUTTING_DOWN";
443
+ readonly domain: "SYSTEM";
444
+ readonly httpStatus: 503;
445
+ readonly retryable: false;
446
+ readonly message: "System is shutting down";
447
+ };
448
+ readonly ADAPTER_NOT_AVAILABLE: {
449
+ readonly code: "ADAPTER_NOT_AVAILABLE";
450
+ readonly domain: "SYSTEM";
451
+ readonly httpStatus: 503;
452
+ readonly retryable: true;
453
+ readonly message: "Chain adapter not available";
454
+ };
455
+ readonly SKILL_NOT_FOUND: {
456
+ readonly code: "SKILL_NOT_FOUND";
457
+ readonly domain: "SYSTEM";
458
+ readonly httpStatus: 404;
459
+ readonly retryable: false;
460
+ readonly message: "Skill not found";
461
+ };
462
+ readonly SCHEMA_INCOMPATIBLE: {
463
+ readonly code: "SCHEMA_INCOMPATIBLE";
464
+ readonly domain: "SYSTEM";
465
+ readonly httpStatus: 503;
466
+ readonly retryable: false;
467
+ readonly message: "Database schema version is incompatible with this code version";
468
+ };
469
+ readonly WALLET_NOT_FOUND: {
470
+ readonly code: "WALLET_NOT_FOUND";
471
+ readonly domain: "WALLET";
472
+ readonly httpStatus: 404;
473
+ readonly retryable: false;
474
+ readonly message: "Wallet not found";
475
+ };
476
+ readonly WALLET_SUSPENDED: {
477
+ readonly code: "WALLET_SUSPENDED";
478
+ readonly domain: "WALLET";
479
+ readonly httpStatus: 409;
480
+ readonly retryable: false;
481
+ readonly message: "Wallet is suspended";
482
+ };
483
+ readonly WALLET_TERMINATED: {
484
+ readonly code: "WALLET_TERMINATED";
485
+ readonly domain: "WALLET";
486
+ readonly httpStatus: 410;
487
+ readonly retryable: false;
488
+ readonly message: "Wallet has been terminated";
489
+ };
490
+ readonly WC_SESSION_EXISTS: {
491
+ readonly code: "WC_SESSION_EXISTS";
492
+ readonly domain: "WALLET";
493
+ readonly httpStatus: 409;
494
+ readonly retryable: false;
495
+ readonly message: "Wallet already has an active WC session";
496
+ };
497
+ readonly WC_SESSION_NOT_FOUND: {
498
+ readonly code: "WC_SESSION_NOT_FOUND";
499
+ readonly domain: "WALLET";
500
+ readonly httpStatus: 404;
501
+ readonly retryable: false;
502
+ readonly message: "No active WC session for this wallet";
503
+ };
504
+ readonly WC_NOT_CONFIGURED: {
505
+ readonly code: "WC_NOT_CONFIGURED";
506
+ readonly domain: "SYSTEM";
507
+ readonly httpStatus: 503;
508
+ readonly retryable: false;
509
+ readonly message: "WalletConnect is not configured";
510
+ };
511
+ readonly WC_SIGNING_FAILED: {
512
+ readonly code: "WC_SIGNING_FAILED";
513
+ readonly domain: "SYSTEM";
514
+ readonly httpStatus: 502;
515
+ readonly retryable: true;
516
+ readonly message: "WalletConnect signing request failed";
517
+ };
518
+ readonly NO_OWNER: {
519
+ readonly code: "NO_OWNER";
520
+ readonly domain: "WITHDRAW";
521
+ readonly httpStatus: 404;
522
+ readonly retryable: false;
523
+ readonly message: "No owner connected for withdrawal";
524
+ };
525
+ readonly WITHDRAW_LOCKED_ONLY: {
526
+ readonly code: "WITHDRAW_LOCKED_ONLY";
527
+ readonly domain: "WITHDRAW";
528
+ readonly httpStatus: 403;
529
+ readonly retryable: false;
530
+ readonly message: "Withdrawal only available in LOCKED owner state";
531
+ };
532
+ readonly SWEEP_TOTAL_FAILURE: {
533
+ readonly code: "SWEEP_TOTAL_FAILURE";
534
+ readonly domain: "WITHDRAW";
535
+ readonly httpStatus: 500;
536
+ readonly retryable: true;
537
+ readonly message: "All sweep operations failed";
538
+ };
539
+ readonly INSUFFICIENT_FOR_FEE: {
540
+ readonly code: "INSUFFICIENT_FOR_FEE";
541
+ readonly domain: "TX";
542
+ readonly httpStatus: 400;
543
+ readonly retryable: false;
544
+ readonly message: "Insufficient balance for transaction fee";
545
+ };
546
+ readonly ACTION_NOT_FOUND: {
547
+ readonly code: "ACTION_NOT_FOUND";
548
+ readonly domain: "ACTION";
549
+ readonly httpStatus: 404;
550
+ readonly retryable: false;
551
+ readonly message: "Action not found";
552
+ };
553
+ readonly API_KEY_REQUIRED: {
554
+ readonly code: "API_KEY_REQUIRED";
555
+ readonly domain: "ACTION";
556
+ readonly httpStatus: 403;
557
+ readonly retryable: false;
558
+ readonly message: "API key required for this action provider";
559
+ };
560
+ readonly ACTION_VALIDATION_FAILED: {
561
+ readonly code: "ACTION_VALIDATION_FAILED";
562
+ readonly domain: "ACTION";
563
+ readonly httpStatus: 400;
564
+ readonly retryable: false;
565
+ readonly message: "Action input validation failed";
566
+ };
567
+ readonly ACTION_RESOLVE_FAILED: {
568
+ readonly code: "ACTION_RESOLVE_FAILED";
569
+ readonly domain: "ACTION";
570
+ readonly httpStatus: 502;
571
+ readonly retryable: true;
572
+ readonly message: "Action resolve failed (external API error)";
573
+ };
574
+ readonly ACTION_RETURN_INVALID: {
575
+ readonly code: "ACTION_RETURN_INVALID";
576
+ readonly domain: "ACTION";
577
+ readonly httpStatus: 500;
578
+ readonly retryable: false;
579
+ readonly message: "Action resolve return value schema validation failed";
580
+ };
581
+ readonly ACTION_PLUGIN_LOAD_FAILED: {
582
+ readonly code: "ACTION_PLUGIN_LOAD_FAILED";
583
+ readonly domain: "ACTION";
584
+ readonly httpStatus: 500;
585
+ readonly retryable: false;
586
+ readonly message: "Action plugin failed to load";
587
+ };
588
+ readonly ACTION_NAME_CONFLICT: {
589
+ readonly code: "ACTION_NAME_CONFLICT";
590
+ readonly domain: "ACTION";
591
+ readonly httpStatus: 409;
592
+ readonly retryable: false;
593
+ readonly message: "Action name already registered";
594
+ };
595
+ readonly ACTION_CHAIN_MISMATCH: {
596
+ readonly code: "ACTION_CHAIN_MISMATCH";
597
+ readonly domain: "ACTION";
598
+ readonly httpStatus: 400;
599
+ readonly retryable: false;
600
+ readonly message: "Request chain does not match action provider supported chains";
601
+ };
602
+ readonly ROTATION_TOO_RECENT: {
603
+ readonly code: "ROTATION_TOO_RECENT";
604
+ readonly domain: "ADMIN";
605
+ readonly httpStatus: 429;
606
+ readonly retryable: false;
607
+ readonly message: "Key rotation attempted too recently";
608
+ };
609
+ readonly X402_DISABLED: {
610
+ readonly code: "X402_DISABLED";
611
+ readonly domain: "X402";
612
+ readonly httpStatus: 403;
613
+ readonly retryable: false;
614
+ readonly message: "x402 payments are disabled";
615
+ };
616
+ readonly X402_DOMAIN_NOT_ALLOWED: {
617
+ readonly code: "X402_DOMAIN_NOT_ALLOWED";
618
+ readonly domain: "X402";
619
+ readonly httpStatus: 403;
620
+ readonly retryable: false;
621
+ readonly message: "Domain not allowed for x402 payments";
622
+ };
623
+ readonly X402_SSRF_BLOCKED: {
624
+ readonly code: "X402_SSRF_BLOCKED";
625
+ readonly domain: "X402";
626
+ readonly httpStatus: 403;
627
+ readonly retryable: false;
628
+ readonly message: "Request blocked: target resolves to private/reserved IP";
629
+ };
630
+ readonly X402_UNSUPPORTED_SCHEME: {
631
+ readonly code: "X402_UNSUPPORTED_SCHEME";
632
+ readonly domain: "X402";
633
+ readonly httpStatus: 400;
634
+ readonly retryable: false;
635
+ readonly message: "Unsupported x402 payment scheme or network";
636
+ };
637
+ readonly X402_PAYMENT_REJECTED: {
638
+ readonly code: "X402_PAYMENT_REJECTED";
639
+ readonly domain: "X402";
640
+ readonly httpStatus: 402;
641
+ readonly retryable: false;
642
+ readonly message: "x402 payment was rejected by the resource server";
643
+ };
644
+ readonly X402_DELAY_TIMEOUT: {
645
+ readonly code: "X402_DELAY_TIMEOUT";
646
+ readonly domain: "X402";
647
+ readonly httpStatus: 408;
648
+ readonly retryable: true;
649
+ readonly message: "x402 payment exceeds request timeout (DELAY tier)";
650
+ };
651
+ readonly X402_APPROVAL_REQUIRED: {
652
+ readonly code: "X402_APPROVAL_REQUIRED";
653
+ readonly domain: "X402";
654
+ readonly httpStatus: 403;
655
+ readonly retryable: false;
656
+ readonly message: "x402 payment requires owner approval (amount too high)";
657
+ };
658
+ readonly X402_SERVER_ERROR: {
659
+ readonly code: "X402_SERVER_ERROR";
660
+ readonly domain: "X402";
661
+ readonly httpStatus: 502;
662
+ readonly retryable: true;
663
+ readonly message: "Resource server error after x402 payment";
664
+ };
665
+ };
666
+ export type ErrorCode = keyof typeof ERROR_CODES;
667
+ //# sourceMappingURL=error-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/errors/error-codes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,SAAS,GACT,IAAI,GACJ,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqqB2B,CAAC;AAEpD,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC"}