@eco-foundation/api-schemas 0.15.0 → 0.16.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 (31) hide show
  1. package/README.md +11 -34
  2. package/dist/fixtures/index.js +12 -10
  3. package/dist/fixtures/index.js.map +1 -1
  4. package/dist/fixtures/v1/intents-status.response.gasless-handoff.json +30 -0
  5. package/dist/fixtures/v1/intents-status.response.intent-filled.json +21 -0
  6. package/dist/fixtures/v1/intents-status.response.quote-enriched.json +63 -0
  7. package/dist/fixtures/v1/intents-status.response.quote-filled-detail.json +60 -0
  8. package/dist/fixtures/v1/intents-status.response.unknown.json +20 -0
  9. package/dist/fixtures/v1/intents-status.response.wallet-page.json +27 -0
  10. package/dist/generated/build-digest.json +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/v1/endpoints/registry.d.ts +113 -123
  13. package/dist/v1/endpoints/registry.js +3 -4
  14. package/dist/v1/endpoints/registry.js.map +1 -1
  15. package/dist/v1/endpoints/status.d.ts +70 -2
  16. package/dist/v1/endpoints/status.js +11 -1
  17. package/dist/v1/endpoints/status.js.map +1 -1
  18. package/dist/v1/index.d.ts +0 -1
  19. package/dist/v1/index.js +0 -1
  20. package/dist/v1/index.js.map +1 -1
  21. package/dist/v1/types.d.ts +8 -87
  22. package/openapi/v1.json +477 -705
  23. package/package.json +2 -1
  24. package/dist/fixtures/v1/intents-status.response.completed-fulfilled.json +0 -117
  25. package/dist/fixtures/v1/intents-status.response.completed-refunded.json +0 -101
  26. package/dist/fixtures/v1/intents-status.response.empty.json +0 -13
  27. package/dist/fixtures/v1/intents-status.response.pending-fulfillment.json +0 -101
  28. package/dist/fixtures/v1/intents-status.response.unlinked-intent.json +0 -81
  29. package/dist/v1/endpoints/transfer-status.d.ts +0 -488
  30. package/dist/v1/endpoints/transfer-status.js +0 -197
  31. package/dist/v1/endpoints/transfer-status.js.map +0 -1
@@ -1,488 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const TRANSFER_STATUSES: readonly ["pending", "completed"];
3
- export declare const TransferStatus: z.ZodEnum<{
4
- pending: "pending";
5
- completed: "completed";
6
- }>;
7
- export type TransferStatus = z.infer<typeof TransferStatus>;
8
- export declare const TRANSFER_SUBSTATUSES: readonly ["waiting_for_funding", "waiting_for_fulfillment", "waiting_for_refund", "fulfilled", "refunded"];
9
- export declare const TransferSubstatus: z.ZodEnum<{
10
- refunded: "refunded";
11
- fulfilled: "fulfilled";
12
- waiting_for_funding: "waiting_for_funding";
13
- waiting_for_fulfillment: "waiting_for_fulfillment";
14
- waiting_for_refund: "waiting_for_refund";
15
- }>;
16
- export type TransferSubstatus = z.infer<typeof TransferSubstatus>;
17
- export declare const TRANSFER_STATUS_BY_SUBSTATUS: Readonly<Record<TransferSubstatus, TransferStatus>>;
18
- export declare const TRANSFER_TOKEN_TYPES: readonly ["native", "token", "hypercore_perps", "hypercore_spot"];
19
- export declare const TransferTokenType: z.ZodEnum<{
20
- token: "token";
21
- native: "native";
22
- hypercore_perps: "hypercore_perps";
23
- hypercore_spot: "hypercore_spot";
24
- }>;
25
- export type TransferTokenType = z.infer<typeof TransferTokenType>;
26
- export declare const TRANSFER_STEP_TYPES: readonly ["swap", "bridge", "transfer", "call", "refund"];
27
- export declare const TransferStepType: z.ZodEnum<{
28
- swap: "swap";
29
- bridge: "bridge";
30
- transfer: "transfer";
31
- call: "call";
32
- refund: "refund";
33
- }>;
34
- export type TransferStepType = z.infer<typeof TransferStepType>;
35
- export declare const TRANSFER_TX_TYPES: readonly ["funding", "burn", "mint", "execution", "refund"];
36
- export declare const TransferTxType: z.ZodEnum<{
37
- execution: "execution";
38
- refund: "refund";
39
- funding: "funding";
40
- burn: "burn";
41
- mint: "mint";
42
- }>;
43
- export type TransferTxType = z.infer<typeof TransferTxType>;
44
- export declare const TransferTokenSchema: z.ZodObject<{
45
- type: z.ZodEnum<{
46
- token: "token";
47
- native: "native";
48
- hypercore_perps: "hypercore_perps";
49
- hypercore_spot: "hypercore_spot";
50
- }>;
51
- address: z.ZodNullable<z.ZodString>;
52
- symbol: z.ZodNullable<z.ZodString>;
53
- decimals: z.ZodNullable<z.ZodNumber>;
54
- }, z.core.$loose>;
55
- export type TransferToken = z.input<typeof TransferTokenSchema>;
56
- export declare const TransferSourceSchema: z.ZodObject<{
57
- sender: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
58
- status: z.ZodEnum<{
59
- pending: "pending";
60
- completed: "completed";
61
- }>;
62
- chainId: z.ZodNullable<z.ZodNumber>;
63
- txHash: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>>;
64
- timestamp: z.ZodNullable<z.ZodNumber>;
65
- token: z.ZodNullable<z.ZodObject<{
66
- type: z.ZodEnum<{
67
- token: "token";
68
- native: "native";
69
- hypercore_perps: "hypercore_perps";
70
- hypercore_spot: "hypercore_spot";
71
- }>;
72
- address: z.ZodNullable<z.ZodString>;
73
- symbol: z.ZodNullable<z.ZodString>;
74
- decimals: z.ZodNullable<z.ZodNumber>;
75
- }, z.core.$loose>>;
76
- amount: z.ZodNullable<z.ZodString>;
77
- }, z.core.$loose>;
78
- export type TransferSource = z.input<typeof TransferSourceSchema>;
79
- export declare const TransferDestinationSchema: z.ZodObject<{
80
- recipient: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
81
- status: z.ZodEnum<{
82
- pending: "pending";
83
- completed: "completed";
84
- }>;
85
- chainId: z.ZodNullable<z.ZodNumber>;
86
- txHash: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>>;
87
- timestamp: z.ZodNullable<z.ZodNumber>;
88
- token: z.ZodNullable<z.ZodObject<{
89
- type: z.ZodEnum<{
90
- token: "token";
91
- native: "native";
92
- hypercore_perps: "hypercore_perps";
93
- hypercore_spot: "hypercore_spot";
94
- }>;
95
- address: z.ZodNullable<z.ZodString>;
96
- symbol: z.ZodNullable<z.ZodString>;
97
- decimals: z.ZodNullable<z.ZodNumber>;
98
- }, z.core.$loose>>;
99
- amount: z.ZodNullable<z.ZodString>;
100
- }, z.core.$loose>;
101
- export type TransferDestination = z.input<typeof TransferDestinationSchema>;
102
- export declare const TransferTransactionSchema: z.ZodObject<{
103
- chainId: z.ZodNumber;
104
- txHash: z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>;
105
- txLink: z.ZodNullable<z.ZodURL>;
106
- timestamp: z.ZodNullable<z.ZodNumber>;
107
- type: z.ZodEnum<{
108
- execution: "execution";
109
- refund: "refund";
110
- funding: "funding";
111
- burn: "burn";
112
- mint: "mint";
113
- }>;
114
- sender: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
115
- recipient: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
116
- token: z.ZodNullable<z.ZodObject<{
117
- type: z.ZodEnum<{
118
- token: "token";
119
- native: "native";
120
- hypercore_perps: "hypercore_perps";
121
- hypercore_spot: "hypercore_spot";
122
- }>;
123
- address: z.ZodNullable<z.ZodString>;
124
- symbol: z.ZodNullable<z.ZodString>;
125
- decimals: z.ZodNullable<z.ZodNumber>;
126
- }, z.core.$loose>>;
127
- amount: z.ZodNullable<z.ZodString>;
128
- }, z.core.$loose>;
129
- export type TransferTransaction = z.input<typeof TransferTransactionSchema>;
130
- export declare const TransferRelatedIntentSchema: z.ZodObject<{
131
- chainId: z.ZodNumber;
132
- intentHash: z.ZodString;
133
- status: z.ZodEnum<{
134
- pending: "pending";
135
- completed: "completed";
136
- }>;
137
- substatus: z.ZodEnum<{
138
- refunded: "refunded";
139
- fulfilled: "fulfilled";
140
- waiting_for_funding: "waiting_for_funding";
141
- waiting_for_fulfillment: "waiting_for_fulfillment";
142
- waiting_for_refund: "waiting_for_refund";
143
- }>;
144
- }, z.core.$loose>;
145
- export type TransferRelatedIntent = z.input<typeof TransferRelatedIntentSchema>;
146
- export declare const TransferStepSchema: z.ZodObject<{
147
- id: z.ZodString;
148
- type: z.ZodEnum<{
149
- swap: "swap";
150
- bridge: "bridge";
151
- transfer: "transfer";
152
- call: "call";
153
- refund: "refund";
154
- }>;
155
- provider: z.ZodNullable<z.ZodString>;
156
- relatedIntents: z.ZodArray<z.ZodObject<{
157
- chainId: z.ZodNumber;
158
- intentHash: z.ZodString;
159
- status: z.ZodEnum<{
160
- pending: "pending";
161
- completed: "completed";
162
- }>;
163
- substatus: z.ZodEnum<{
164
- refunded: "refunded";
165
- fulfilled: "fulfilled";
166
- waiting_for_funding: "waiting_for_funding";
167
- waiting_for_fulfillment: "waiting_for_fulfillment";
168
- waiting_for_refund: "waiting_for_refund";
169
- }>;
170
- }, z.core.$loose>>;
171
- status: z.ZodEnum<{
172
- pending: "pending";
173
- completed: "completed";
174
- }>;
175
- substatus: z.ZodEnum<{
176
- refunded: "refunded";
177
- fulfilled: "fulfilled";
178
- waiting_for_funding: "waiting_for_funding";
179
- waiting_for_fulfillment: "waiting_for_fulfillment";
180
- waiting_for_refund: "waiting_for_refund";
181
- }>;
182
- transactions: z.ZodArray<z.ZodObject<{
183
- chainId: z.ZodNumber;
184
- txHash: z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>;
185
- txLink: z.ZodNullable<z.ZodURL>;
186
- timestamp: z.ZodNullable<z.ZodNumber>;
187
- type: z.ZodEnum<{
188
- execution: "execution";
189
- refund: "refund";
190
- funding: "funding";
191
- burn: "burn";
192
- mint: "mint";
193
- }>;
194
- sender: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
195
- recipient: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
196
- token: z.ZodNullable<z.ZodObject<{
197
- type: z.ZodEnum<{
198
- token: "token";
199
- native: "native";
200
- hypercore_perps: "hypercore_perps";
201
- hypercore_spot: "hypercore_spot";
202
- }>;
203
- address: z.ZodNullable<z.ZodString>;
204
- symbol: z.ZodNullable<z.ZodString>;
205
- decimals: z.ZodNullable<z.ZodNumber>;
206
- }, z.core.$loose>>;
207
- amount: z.ZodNullable<z.ZodString>;
208
- }, z.core.$loose>>;
209
- }, z.core.$loose>;
210
- export type TransferStep = z.input<typeof TransferStepSchema>;
211
- export declare const TransferStatusEntrySchema: z.ZodObject<{
212
- id: z.ZodNullable<z.ZodString>;
213
- status: z.ZodEnum<{
214
- pending: "pending";
215
- completed: "completed";
216
- }>;
217
- substatus: z.ZodEnum<{
218
- refunded: "refunded";
219
- fulfilled: "fulfilled";
220
- waiting_for_funding: "waiting_for_funding";
221
- waiting_for_fulfillment: "waiting_for_fulfillment";
222
- waiting_for_refund: "waiting_for_refund";
223
- }>;
224
- createdAt: z.ZodNullable<z.ZodNumber>;
225
- updatedAt: z.ZodNullable<z.ZodNumber>;
226
- refundAddress: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
227
- source: z.ZodObject<{
228
- sender: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
229
- status: z.ZodEnum<{
230
- pending: "pending";
231
- completed: "completed";
232
- }>;
233
- chainId: z.ZodNullable<z.ZodNumber>;
234
- txHash: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>>;
235
- timestamp: z.ZodNullable<z.ZodNumber>;
236
- token: z.ZodNullable<z.ZodObject<{
237
- type: z.ZodEnum<{
238
- token: "token";
239
- native: "native";
240
- hypercore_perps: "hypercore_perps";
241
- hypercore_spot: "hypercore_spot";
242
- }>;
243
- address: z.ZodNullable<z.ZodString>;
244
- symbol: z.ZodNullable<z.ZodString>;
245
- decimals: z.ZodNullable<z.ZodNumber>;
246
- }, z.core.$loose>>;
247
- amount: z.ZodNullable<z.ZodString>;
248
- }, z.core.$loose>;
249
- destination: z.ZodObject<{
250
- recipient: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
251
- status: z.ZodEnum<{
252
- pending: "pending";
253
- completed: "completed";
254
- }>;
255
- chainId: z.ZodNullable<z.ZodNumber>;
256
- txHash: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>>;
257
- timestamp: z.ZodNullable<z.ZodNumber>;
258
- token: z.ZodNullable<z.ZodObject<{
259
- type: z.ZodEnum<{
260
- token: "token";
261
- native: "native";
262
- hypercore_perps: "hypercore_perps";
263
- hypercore_spot: "hypercore_spot";
264
- }>;
265
- address: z.ZodNullable<z.ZodString>;
266
- symbol: z.ZodNullable<z.ZodString>;
267
- decimals: z.ZodNullable<z.ZodNumber>;
268
- }, z.core.$loose>>;
269
- amount: z.ZodNullable<z.ZodString>;
270
- }, z.core.$loose>;
271
- steps: z.ZodArray<z.ZodObject<{
272
- id: z.ZodString;
273
- type: z.ZodEnum<{
274
- swap: "swap";
275
- bridge: "bridge";
276
- transfer: "transfer";
277
- call: "call";
278
- refund: "refund";
279
- }>;
280
- provider: z.ZodNullable<z.ZodString>;
281
- relatedIntents: z.ZodArray<z.ZodObject<{
282
- chainId: z.ZodNumber;
283
- intentHash: z.ZodString;
284
- status: z.ZodEnum<{
285
- pending: "pending";
286
- completed: "completed";
287
- }>;
288
- substatus: z.ZodEnum<{
289
- refunded: "refunded";
290
- fulfilled: "fulfilled";
291
- waiting_for_funding: "waiting_for_funding";
292
- waiting_for_fulfillment: "waiting_for_fulfillment";
293
- waiting_for_refund: "waiting_for_refund";
294
- }>;
295
- }, z.core.$loose>>;
296
- status: z.ZodEnum<{
297
- pending: "pending";
298
- completed: "completed";
299
- }>;
300
- substatus: z.ZodEnum<{
301
- refunded: "refunded";
302
- fulfilled: "fulfilled";
303
- waiting_for_funding: "waiting_for_funding";
304
- waiting_for_fulfillment: "waiting_for_fulfillment";
305
- waiting_for_refund: "waiting_for_refund";
306
- }>;
307
- transactions: z.ZodArray<z.ZodObject<{
308
- chainId: z.ZodNumber;
309
- txHash: z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>;
310
- txLink: z.ZodNullable<z.ZodURL>;
311
- timestamp: z.ZodNullable<z.ZodNumber>;
312
- type: z.ZodEnum<{
313
- execution: "execution";
314
- refund: "refund";
315
- funding: "funding";
316
- burn: "burn";
317
- mint: "mint";
318
- }>;
319
- sender: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
320
- recipient: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
321
- token: z.ZodNullable<z.ZodObject<{
322
- type: z.ZodEnum<{
323
- token: "token";
324
- native: "native";
325
- hypercore_perps: "hypercore_perps";
326
- hypercore_spot: "hypercore_spot";
327
- }>;
328
- address: z.ZodNullable<z.ZodString>;
329
- symbol: z.ZodNullable<z.ZodString>;
330
- decimals: z.ZodNullable<z.ZodNumber>;
331
- }, z.core.$loose>>;
332
- amount: z.ZodNullable<z.ZodString>;
333
- }, z.core.$loose>>;
334
- }, z.core.$loose>>;
335
- }, z.core.$loose>;
336
- export type TransferStatusEntry = z.input<typeof TransferStatusEntrySchema>;
337
- export declare const TransferStatusResponseSchema: z.ZodObject<{
338
- results: z.ZodArray<z.ZodObject<{
339
- id: z.ZodNullable<z.ZodString>;
340
- status: z.ZodEnum<{
341
- pending: "pending";
342
- completed: "completed";
343
- }>;
344
- substatus: z.ZodEnum<{
345
- refunded: "refunded";
346
- fulfilled: "fulfilled";
347
- waiting_for_funding: "waiting_for_funding";
348
- waiting_for_fulfillment: "waiting_for_fulfillment";
349
- waiting_for_refund: "waiting_for_refund";
350
- }>;
351
- createdAt: z.ZodNullable<z.ZodNumber>;
352
- updatedAt: z.ZodNullable<z.ZodNumber>;
353
- refundAddress: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
354
- source: z.ZodObject<{
355
- sender: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
356
- status: z.ZodEnum<{
357
- pending: "pending";
358
- completed: "completed";
359
- }>;
360
- chainId: z.ZodNullable<z.ZodNumber>;
361
- txHash: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>>;
362
- timestamp: z.ZodNullable<z.ZodNumber>;
363
- token: z.ZodNullable<z.ZodObject<{
364
- type: z.ZodEnum<{
365
- token: "token";
366
- native: "native";
367
- hypercore_perps: "hypercore_perps";
368
- hypercore_spot: "hypercore_spot";
369
- }>;
370
- address: z.ZodNullable<z.ZodString>;
371
- symbol: z.ZodNullable<z.ZodString>;
372
- decimals: z.ZodNullable<z.ZodNumber>;
373
- }, z.core.$loose>>;
374
- amount: z.ZodNullable<z.ZodString>;
375
- }, z.core.$loose>;
376
- destination: z.ZodObject<{
377
- recipient: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
378
- status: z.ZodEnum<{
379
- pending: "pending";
380
- completed: "completed";
381
- }>;
382
- chainId: z.ZodNullable<z.ZodNumber>;
383
- txHash: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>>;
384
- timestamp: z.ZodNullable<z.ZodNumber>;
385
- token: z.ZodNullable<z.ZodObject<{
386
- type: z.ZodEnum<{
387
- token: "token";
388
- native: "native";
389
- hypercore_perps: "hypercore_perps";
390
- hypercore_spot: "hypercore_spot";
391
- }>;
392
- address: z.ZodNullable<z.ZodString>;
393
- symbol: z.ZodNullable<z.ZodString>;
394
- decimals: z.ZodNullable<z.ZodNumber>;
395
- }, z.core.$loose>>;
396
- amount: z.ZodNullable<z.ZodString>;
397
- }, z.core.$loose>;
398
- steps: z.ZodArray<z.ZodObject<{
399
- id: z.ZodString;
400
- type: z.ZodEnum<{
401
- swap: "swap";
402
- bridge: "bridge";
403
- transfer: "transfer";
404
- call: "call";
405
- refund: "refund";
406
- }>;
407
- provider: z.ZodNullable<z.ZodString>;
408
- relatedIntents: z.ZodArray<z.ZodObject<{
409
- chainId: z.ZodNumber;
410
- intentHash: z.ZodString;
411
- status: z.ZodEnum<{
412
- pending: "pending";
413
- completed: "completed";
414
- }>;
415
- substatus: z.ZodEnum<{
416
- refunded: "refunded";
417
- fulfilled: "fulfilled";
418
- waiting_for_funding: "waiting_for_funding";
419
- waiting_for_fulfillment: "waiting_for_fulfillment";
420
- waiting_for_refund: "waiting_for_refund";
421
- }>;
422
- }, z.core.$loose>>;
423
- status: z.ZodEnum<{
424
- pending: "pending";
425
- completed: "completed";
426
- }>;
427
- substatus: z.ZodEnum<{
428
- refunded: "refunded";
429
- fulfilled: "fulfilled";
430
- waiting_for_funding: "waiting_for_funding";
431
- waiting_for_fulfillment: "waiting_for_fulfillment";
432
- waiting_for_refund: "waiting_for_refund";
433
- }>;
434
- transactions: z.ZodArray<z.ZodObject<{
435
- chainId: z.ZodNumber;
436
- txHash: z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>;
437
- txLink: z.ZodNullable<z.ZodURL>;
438
- timestamp: z.ZodNullable<z.ZodNumber>;
439
- type: z.ZodEnum<{
440
- execution: "execution";
441
- refund: "refund";
442
- funding: "funding";
443
- burn: "burn";
444
- mint: "mint";
445
- }>;
446
- sender: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
447
- recipient: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
448
- token: z.ZodNullable<z.ZodObject<{
449
- type: z.ZodEnum<{
450
- token: "token";
451
- native: "native";
452
- hypercore_perps: "hypercore_perps";
453
- hypercore_spot: "hypercore_spot";
454
- }>;
455
- address: z.ZodNullable<z.ZodString>;
456
- symbol: z.ZodNullable<z.ZodString>;
457
- decimals: z.ZodNullable<z.ZodNumber>;
458
- }, z.core.$loose>>;
459
- amount: z.ZodNullable<z.ZodString>;
460
- }, z.core.$loose>>;
461
- }, z.core.$loose>>;
462
- }, z.core.$loose>>;
463
- nextPage: z.ZodNullable<z.ZodNumber>;
464
- }, z.core.$loose>;
465
- export type TransferStatusResponse = z.input<typeof TransferStatusResponseSchema>;
466
- export declare const TRANSFER_STATUS_SELECTORS: readonly ["txHash", "intentHash", "quoteId", "jobId", "wallet"];
467
- export type TransferStatusSelector = (typeof TRANSFER_STATUS_SELECTORS)[number];
468
- export declare const LegacyQuoteResponseId: z.ZodString;
469
- export declare const TransferQuoteIdParam: z.ZodUnion<readonly [z.ZodUUID, z.ZodString, z.ZodString]>;
470
- export declare const TRANSFER_STATUS_QUERY_SHAPE: {
471
- txHash: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>>;
472
- intentHash: z.ZodOptional<z.ZodString>;
473
- quoteId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodString, z.ZodString]>>;
474
- jobId: z.ZodOptional<z.ZodUUID>;
475
- wallet: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
476
- page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
477
- limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
478
- };
479
- export declare const TransferStatusQuerySchema: z.ZodObject<{
480
- txHash: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>>;
481
- intentHash: z.ZodOptional<z.ZodString>;
482
- quoteId: z.ZodOptional<z.ZodUnion<readonly [z.ZodUUID, z.ZodString, z.ZodString]>>;
483
- jobId: z.ZodOptional<z.ZodUUID>;
484
- wallet: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
485
- page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
486
- limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
487
- }, z.core.$strict>;
488
- export type TransferStatusQuery = z.output<typeof TransferStatusQuerySchema>;
@@ -1,197 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TransferStatusQuerySchema = exports.TRANSFER_STATUS_QUERY_SHAPE = exports.TransferQuoteIdParam = exports.LegacyQuoteResponseId = exports.TRANSFER_STATUS_SELECTORS = exports.TransferStatusResponseSchema = exports.TransferStatusEntrySchema = exports.TransferStepSchema = exports.TransferRelatedIntentSchema = exports.TransferTransactionSchema = exports.TransferDestinationSchema = exports.TransferSourceSchema = exports.TransferTokenSchema = exports.TransferTxType = exports.TRANSFER_TX_TYPES = exports.TransferStepType = exports.TRANSFER_STEP_TYPES = exports.TransferTokenType = exports.TRANSFER_TOKEN_TYPES = exports.TRANSFER_STATUS_BY_SUBSTATUS = exports.TransferSubstatus = exports.TRANSFER_SUBSTATUSES = exports.TransferStatus = exports.TRANSFER_STATUSES = void 0;
4
- const zod_1 = require("zod");
5
- const primitives_1 = require("../primitives");
6
- const status_1 = require("./status");
7
- exports.TRANSFER_STATUSES = ['pending', 'completed'];
8
- exports.TransferStatus = zod_1.z.enum(exports.TRANSFER_STATUSES);
9
- exports.TRANSFER_SUBSTATUSES = [
10
- 'waiting_for_funding',
11
- 'waiting_for_fulfillment',
12
- 'waiting_for_refund',
13
- 'fulfilled',
14
- 'refunded',
15
- ];
16
- exports.TransferSubstatus = zod_1.z.enum(exports.TRANSFER_SUBSTATUSES);
17
- exports.TRANSFER_STATUS_BY_SUBSTATUS = {
18
- waiting_for_funding: 'pending',
19
- waiting_for_fulfillment: 'pending',
20
- waiting_for_refund: 'pending',
21
- fulfilled: 'completed',
22
- refunded: 'completed',
23
- };
24
- exports.TRANSFER_TOKEN_TYPES = [
25
- 'native',
26
- 'token',
27
- 'hypercore_perps',
28
- 'hypercore_spot',
29
- ];
30
- exports.TransferTokenType = zod_1.z.enum(exports.TRANSFER_TOKEN_TYPES);
31
- exports.TRANSFER_STEP_TYPES = ['swap', 'bridge', 'transfer', 'call', 'refund'];
32
- exports.TransferStepType = zod_1.z.enum(exports.TRANSFER_STEP_TYPES);
33
- exports.TRANSFER_TX_TYPES = ['funding', 'burn', 'mint', 'execution', 'refund'];
34
- exports.TransferTxType = zod_1.z.enum(exports.TRANSFER_TX_TYPES);
35
- const PAIR_MESSAGE = 'status and substatus must be one of pending/waiting_for_funding, ' +
36
- 'pending/waiting_for_fulfillment, pending/waiting_for_refund, completed/fulfilled, ' +
37
- 'completed/refunded';
38
- function refineStatusPair(value, ctx) {
39
- if (exports.TRANSFER_STATUS_BY_SUBSTATUS[value.substatus] !== value.status) {
40
- ctx.addIssue({ code: 'custom', path: ['substatus'], message: PAIR_MESSAGE });
41
- }
42
- }
43
- function refinePendingSide(side, ctx) {
44
- if (side.status !== 'pending')
45
- return;
46
- for (const key of ['txHash', 'timestamp', 'amount']) {
47
- if (side[key] !== null) {
48
- ctx.addIssue({
49
- code: 'custom',
50
- path: [key],
51
- message: `a pending side carries no ${key}; it must be null`,
52
- });
53
- }
54
- }
55
- }
56
- exports.TransferTokenSchema = zod_1.z
57
- .looseObject({
58
- type: exports.TransferTokenType,
59
- address: zod_1.z.string().min(1).nullable(),
60
- symbol: zod_1.z.string().nullable(),
61
- decimals: zod_1.z.number().int().min(0).nullable(),
62
- })
63
- .superRefine((token, ctx) => {
64
- if ((token.type === 'native') !== (token.address === null)) {
65
- ctx.addIssue({
66
- code: 'custom',
67
- path: ['address'],
68
- message: 'address is null exactly when type is native',
69
- });
70
- }
71
- })
72
- .describe('A token. `address` is null exactly when `type` is `native`.');
73
- const SIDE_FIELDS = {
74
- status: exports.TransferStatus,
75
- chainId: primitives_1.ChainId.nullable(),
76
- txHash: primitives_1.TxHash.nullable(),
77
- timestamp: primitives_1.UnixSeconds.nullable(),
78
- token: exports.TransferTokenSchema.nullable(),
79
- amount: primitives_1.PositiveUintString.nullable(),
80
- };
81
- exports.TransferSourceSchema = zod_1.z
82
- .looseObject({ ...SIDE_FIELDS, sender: primitives_1.AnyAddress.nullable() })
83
- .superRefine(refinePendingSide)
84
- .describe('Where the transfer was funded. A pending side has null txHash, timestamp and amount; a ' +
85
- 'completed side may have a null txHash when several payments funded it.');
86
- exports.TransferDestinationSchema = zod_1.z
87
- .looseObject({ ...SIDE_FIELDS, recipient: primitives_1.AnyAddress.nullable() })
88
- .superRefine(refinePendingSide)
89
- .describe('Where the transfer was (or will be) delivered; on a refund, where it was returned. A ' +
90
- 'pending side has null txHash, timestamp and amount.');
91
- exports.TransferTransactionSchema = zod_1.z
92
- .looseObject({
93
- chainId: primitives_1.ChainId,
94
- txHash: primitives_1.TxHash,
95
- txLink: zod_1.z.url({ protocol: /^https?$/ }).nullable(),
96
- timestamp: primitives_1.UnixSeconds.nullable(),
97
- type: exports.TransferTxType,
98
- sender: primitives_1.AnyAddress.nullable(),
99
- recipient: primitives_1.AnyAddress.nullable(),
100
- token: exports.TransferTokenSchema.nullable(),
101
- amount: primitives_1.PositiveUintString.nullable(),
102
- })
103
- .describe('A transaction of a step. `txLink` is a block-explorer URL when one is known.');
104
- exports.TransferRelatedIntentSchema = zod_1.z
105
- .looseObject({
106
- chainId: primitives_1.ChainId,
107
- intentHash: primitives_1.Bytes32,
108
- status: exports.TransferStatus,
109
- substatus: exports.TransferSubstatus,
110
- })
111
- .superRefine(refineStatusPair)
112
- .describe('An intent behind a step. Its pair reflects the intent itself, not delivery: a fulfilled ' +
113
- 'burn is completed/fulfilled. Only the five allowed status/substatus pairs occur.');
114
- exports.TransferStepSchema = zod_1.z
115
- .looseObject({
116
- id: zod_1.z.string().min(1),
117
- type: exports.TransferStepType,
118
- provider: zod_1.z.string().min(1).nullable(),
119
- relatedIntents: zod_1.z.array(exports.TransferRelatedIntentSchema),
120
- status: exports.TransferStatus,
121
- substatus: exports.TransferSubstatus,
122
- transactions: zod_1.z.array(exports.TransferTransactionSchema),
123
- })
124
- .superRefine(refineStatusPair)
125
- .describe('One step of the transfer. `id` is `<type>-<n>`, counting steps of that type from 1. Only ' +
126
- 'the five allowed status/substatus pairs occur.');
127
- exports.TransferStatusEntrySchema = zod_1.z
128
- .looseObject({
129
- id: primitives_1.QuoteId.nullable(),
130
- status: exports.TransferStatus,
131
- substatus: exports.TransferSubstatus,
132
- createdAt: primitives_1.UnixSeconds.nullable(),
133
- updatedAt: primitives_1.UnixSeconds.nullable(),
134
- refundAddress: primitives_1.AnyAddress.nullable(),
135
- source: exports.TransferSourceSchema,
136
- destination: exports.TransferDestinationSchema,
137
- steps: zod_1.z.array(exports.TransferStepSchema),
138
- })
139
- .superRefine(refineStatusPair)
140
- .describe('One transfer. `id` is the prefixed quote id, or null when the transfer is not linked to a ' +
141
- 'quote. Only the five allowed status/substatus pairs occur: pending/waiting_for_funding, ' +
142
- 'pending/waiting_for_fulfillment, pending/waiting_for_refund, completed/fulfilled, ' +
143
- 'completed/refunded.');
144
- exports.TransferStatusResponseSchema = zod_1.z
145
- .looseObject({
146
- results: zod_1.z.array(exports.TransferStatusEntrySchema).max(status_1.STATUS_PAGE_MAX_LIMIT),
147
- nextPage: zod_1.z.number().int().min(2).nullable(),
148
- })
149
- .describe('A page of transfers. `nextPage` is null on the last page, otherwise an integer >= 2.');
150
- exports.TRANSFER_STATUS_SELECTORS = [
151
- 'txHash',
152
- 'intentHash',
153
- 'quoteId',
154
- 'jobId',
155
- 'wallet',
156
- ];
157
- const UUID_PATTERN = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';
158
- exports.LegacyQuoteResponseId = zod_1.z
159
- .string()
160
- .regex(new RegExp(`^quoteResponse:${UUID_PATTERN}$`), 'quoteResponse:<uuid>');
161
- exports.TransferQuoteIdParam = zod_1.z.union([zod_1.z.uuid(), primitives_1.QuoteId, exports.LegacyQuoteResponseId]);
162
- exports.TRANSFER_STATUS_QUERY_SHAPE = {
163
- txHash: primitives_1.TxHash.optional().describe('A transaction hash in the transfer (EVM 0x + 64 hex, Tron 64 hex, Solana base58). Creation and fulfilment transactions are indexed today; refund and CCTP mint hashes are not yet and return no results.'),
164
- intentHash: primitives_1.Bytes32.optional().describe('An intent hash.'),
165
- quoteId: exports.TransferQuoteIdParam.optional().describe('A quote id: a bare uuid, `quote:<uuid>` or `quoteResponse:<uuid>`.'),
166
- jobId: zod_1.z.uuid().optional().describe('A submit job id.'),
167
- wallet: primitives_1.AnyAddress.optional().describe('A wallet address (funder, destination recipient or refund recipient); returns its transfers from the last 7 days, newest first.'),
168
- page: zod_1.z.coerce.number().int().min(1).optional().describe('Page number, default 1.'),
169
- limit: zod_1.z.coerce
170
- .number()
171
- .int()
172
- .min(1)
173
- .max(status_1.STATUS_PAGE_MAX_LIMIT)
174
- .optional()
175
- .describe('Default 20, maximum 50. A deployment may publish a lower maximum and default in /v1/chains; a value above the maximum is rejected, never clamped.'),
176
- };
177
- exports.TransferStatusQuerySchema = zod_1.z
178
- .strictObject(exports.TRANSFER_STATUS_QUERY_SHAPE)
179
- .superRefine((query, ctx) => {
180
- const present = exports.TRANSFER_STATUS_SELECTORS.filter((key) => query[key] !== undefined);
181
- if (present.length !== 1) {
182
- ctx.addIssue({
183
- code: 'custom',
184
- message: 'exactly one of txHash, intentHash, quoteId, jobId, wallet is required',
185
- });
186
- return;
187
- }
188
- const [selector] = present;
189
- const paged = query.page !== undefined || query.limit !== undefined;
190
- if (paged && (selector === 'intentHash' || selector === 'quoteId')) {
191
- ctx.addIssue({
192
- code: 'custom',
193
- message: 'page and limit are not accepted with intentHash or quoteId; they return at most one transfer',
194
- });
195
- }
196
- });
197
- //# sourceMappingURL=transfer-status.js.map