@b3dotfun/sdk 0.0.8-alpha.7 → 0.0.8-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/types/api.d.ts +1550 -0
- package/dist/cjs/anyspend/types/api.js +6 -0
- package/dist/esm/anyspend/types/api.d.ts +1550 -0
- package/dist/esm/anyspend/types/api.js +5 -0
- package/dist/types/anyspend/types/api.d.ts +1550 -0
- package/package.json +2 -1
- package/src/anyspend/types/api.ts +1566 -0
|
@@ -0,0 +1,1550 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
export interface paths {
|
|
6
|
+
"/chains/{chainId}/tokens": {
|
|
7
|
+
/**
|
|
8
|
+
* Get tokens for a chain
|
|
9
|
+
* @description Retrieves available tokens for a specific blockchain
|
|
10
|
+
*/
|
|
11
|
+
get: {
|
|
12
|
+
parameters: {
|
|
13
|
+
query?: {
|
|
14
|
+
/**
|
|
15
|
+
* @description Search term to filter tokens
|
|
16
|
+
* @example USDC
|
|
17
|
+
*/
|
|
18
|
+
term?: string;
|
|
19
|
+
/** @description Maximum number of tokens to return */
|
|
20
|
+
limit?: number;
|
|
21
|
+
};
|
|
22
|
+
path: {
|
|
23
|
+
/**
|
|
24
|
+
* @description Blockchain chain ID
|
|
25
|
+
* @example 1
|
|
26
|
+
*/
|
|
27
|
+
chainId: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
responses: {
|
|
31
|
+
/** @description Tokens retrieved successfully */
|
|
32
|
+
200: {
|
|
33
|
+
content: {
|
|
34
|
+
"application/json": {
|
|
35
|
+
/** @example true */
|
|
36
|
+
success?: boolean;
|
|
37
|
+
/** @example Tokens retrieved successfully */
|
|
38
|
+
message?: string;
|
|
39
|
+
/** @description Array of tokens */
|
|
40
|
+
data?: {
|
|
41
|
+
/** @description Chain ID */
|
|
42
|
+
chainId?: number;
|
|
43
|
+
/** @description Token contract address */
|
|
44
|
+
address?: string;
|
|
45
|
+
/** @description Token symbol */
|
|
46
|
+
symbol?: string;
|
|
47
|
+
/** @description Token name */
|
|
48
|
+
name?: string;
|
|
49
|
+
/** @description Token decimals */
|
|
50
|
+
decimals?: number;
|
|
51
|
+
metadata?: {
|
|
52
|
+
/** @description Token logo URI */
|
|
53
|
+
logoURI?: string;
|
|
54
|
+
/** @description Whether token is verified */
|
|
55
|
+
verified?: boolean;
|
|
56
|
+
/** @description Whether token is native to chain */
|
|
57
|
+
isNative?: boolean;
|
|
58
|
+
};
|
|
59
|
+
}[];
|
|
60
|
+
/** @example 200 */
|
|
61
|
+
statusCode?: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/** @description Bad request */
|
|
66
|
+
400: {
|
|
67
|
+
content: {
|
|
68
|
+
"application/json": {
|
|
69
|
+
/** @example false */
|
|
70
|
+
success?: boolean;
|
|
71
|
+
/** @example Bad request */
|
|
72
|
+
message?: string;
|
|
73
|
+
/** @example 400 */
|
|
74
|
+
statusCode?: number;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
"/health-check": {
|
|
82
|
+
/**
|
|
83
|
+
* Health check
|
|
84
|
+
* @description Returns the health status of the AnySpend service
|
|
85
|
+
*/
|
|
86
|
+
get: {
|
|
87
|
+
responses: {
|
|
88
|
+
/** @description Service is healthy */
|
|
89
|
+
200: {
|
|
90
|
+
content: {
|
|
91
|
+
"application/json": {
|
|
92
|
+
/** @example true */
|
|
93
|
+
success?: boolean;
|
|
94
|
+
/** @example Service is healthy */
|
|
95
|
+
message?: string;
|
|
96
|
+
/** @example null */
|
|
97
|
+
data?: Record<string, never>;
|
|
98
|
+
/** @example 200 */
|
|
99
|
+
statusCode?: number;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
"/onramp/coinbase/options": {
|
|
107
|
+
/**
|
|
108
|
+
* Get Coinbase onramp options
|
|
109
|
+
* @description Retrieves available Coinbase onramp configuration options.
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
112
|
+
get: {
|
|
113
|
+
parameters: {
|
|
114
|
+
query: {
|
|
115
|
+
/**
|
|
116
|
+
* @description Country code for onramp options
|
|
117
|
+
* @example US
|
|
118
|
+
*/
|
|
119
|
+
country: string;
|
|
120
|
+
/**
|
|
121
|
+
* @description Optional subdivision (state/province) code
|
|
122
|
+
* @example CA
|
|
123
|
+
*/
|
|
124
|
+
subdivision?: string;
|
|
125
|
+
/**
|
|
126
|
+
* @description Optional payment method filter
|
|
127
|
+
* @example USD
|
|
128
|
+
*/
|
|
129
|
+
payment_method?: string;
|
|
130
|
+
/**
|
|
131
|
+
* @description Optional array of chain IDs to filter by
|
|
132
|
+
* @example [
|
|
133
|
+
* "1",
|
|
134
|
+
* "8453"
|
|
135
|
+
* ]
|
|
136
|
+
*/
|
|
137
|
+
chainIds?: string[];
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
responses: {
|
|
141
|
+
/** @description Coinbase options retrieved successfully */
|
|
142
|
+
200: {
|
|
143
|
+
content: {
|
|
144
|
+
"application/json": {
|
|
145
|
+
/** @example true */
|
|
146
|
+
success?: boolean;
|
|
147
|
+
/** @example Coinbase options retrieved successfully */
|
|
148
|
+
message?: string;
|
|
149
|
+
data?: {
|
|
150
|
+
/** @description Available payment currencies */
|
|
151
|
+
paymentCurrencies?: {
|
|
152
|
+
/**
|
|
153
|
+
* @description Payment currency identifier
|
|
154
|
+
* @example USD
|
|
155
|
+
*/
|
|
156
|
+
id?: string;
|
|
157
|
+
/** @description Payment limits for this currency */
|
|
158
|
+
limits?: {
|
|
159
|
+
/**
|
|
160
|
+
* @description Payment method identifier
|
|
161
|
+
* @example CARD
|
|
162
|
+
*/
|
|
163
|
+
id?: string;
|
|
164
|
+
/**
|
|
165
|
+
* @description Minimum payment amount
|
|
166
|
+
* @example 2
|
|
167
|
+
*/
|
|
168
|
+
min?: string;
|
|
169
|
+
/**
|
|
170
|
+
* @description Maximum payment amount
|
|
171
|
+
* @example 7500
|
|
172
|
+
*/
|
|
173
|
+
max?: string;
|
|
174
|
+
}[];
|
|
175
|
+
}[];
|
|
176
|
+
/** @description Available purchase currencies */
|
|
177
|
+
purchaseCurrencies?: {
|
|
178
|
+
/**
|
|
179
|
+
* @description Currency identifier (UUID)
|
|
180
|
+
* @example 2b92315d-eab7-5bef-84fa-089a131333f5
|
|
181
|
+
*/
|
|
182
|
+
id?: string;
|
|
183
|
+
/**
|
|
184
|
+
* @description Currency full name
|
|
185
|
+
* @example USD Coin
|
|
186
|
+
*/
|
|
187
|
+
name?: string;
|
|
188
|
+
/**
|
|
189
|
+
* @description Currency symbol
|
|
190
|
+
* @example USDC
|
|
191
|
+
*/
|
|
192
|
+
symbol?: string;
|
|
193
|
+
/**
|
|
194
|
+
* @description Currency icon URL
|
|
195
|
+
* @example https://dynamic-assets.coinbase.com/3c15df5e2ac7d4abbe9499ed9335041f00c620f28e8de2f93474a9f432058742cdf4674bd43f309e69778a26969dbc009429d4bd59cc5b85b2c6c8a6dc0b57f1/asset_icons/80422be4be5aa1bb4deb72d9f0e9d0f33e05ce6b8fb7c24bb9e14e4adacdf20c.png
|
|
196
|
+
*/
|
|
197
|
+
iconUrl?: string;
|
|
198
|
+
/** @description Available networks for this currency */
|
|
199
|
+
networks?: {
|
|
200
|
+
/**
|
|
201
|
+
* @description Network name
|
|
202
|
+
* @example ethereum
|
|
203
|
+
*/
|
|
204
|
+
name?: string;
|
|
205
|
+
/**
|
|
206
|
+
* @description Network display name
|
|
207
|
+
* @example Ethereum
|
|
208
|
+
*/
|
|
209
|
+
displayName?: string;
|
|
210
|
+
/**
|
|
211
|
+
* @description Token contract address on this network
|
|
212
|
+
* @example 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
|
|
213
|
+
*/
|
|
214
|
+
contractAddress?: string;
|
|
215
|
+
/**
|
|
216
|
+
* @description Chain ID for this network
|
|
217
|
+
* @example 1
|
|
218
|
+
*/
|
|
219
|
+
chainId?: string;
|
|
220
|
+
/**
|
|
221
|
+
* @description Network display name (snake_case version)
|
|
222
|
+
* @example Ethereum
|
|
223
|
+
*/
|
|
224
|
+
display_name?: string;
|
|
225
|
+
/**
|
|
226
|
+
* @description Token contract address (snake_case version)
|
|
227
|
+
* @example 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
|
|
228
|
+
*/
|
|
229
|
+
contract_address?: string;
|
|
230
|
+
/**
|
|
231
|
+
* @description Chain ID (snake_case version)
|
|
232
|
+
* @example 1
|
|
233
|
+
*/
|
|
234
|
+
chain_id?: string;
|
|
235
|
+
}[];
|
|
236
|
+
}[];
|
|
237
|
+
};
|
|
238
|
+
/** @example 200 */
|
|
239
|
+
statusCode?: number;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
/** @description Bad request */
|
|
244
|
+
400: {
|
|
245
|
+
content: {
|
|
246
|
+
"application/json": {
|
|
247
|
+
/** @example false */
|
|
248
|
+
success?: boolean;
|
|
249
|
+
/** @example Bad request */
|
|
250
|
+
message?: string;
|
|
251
|
+
/** @example 400 */
|
|
252
|
+
statusCode?: number;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
"/onramp/stripe/supported": {
|
|
260
|
+
/**
|
|
261
|
+
* Check Stripe support
|
|
262
|
+
* @description Checks if Stripe onramp and Stripe Web2 are supported based on IP address location and optional transaction amount
|
|
263
|
+
*/
|
|
264
|
+
get: {
|
|
265
|
+
parameters: {
|
|
266
|
+
query: {
|
|
267
|
+
/**
|
|
268
|
+
* @description IP address to check location-based support
|
|
269
|
+
* @example 192.168.1.1
|
|
270
|
+
*/
|
|
271
|
+
ipAddress: string;
|
|
272
|
+
/**
|
|
273
|
+
* @description Optional USD amount for transaction limit checks
|
|
274
|
+
* @example 100.00
|
|
275
|
+
*/
|
|
276
|
+
usdAmount?: string;
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
responses: {
|
|
280
|
+
/** @description Stripe support status retrieved successfully */
|
|
281
|
+
200: {
|
|
282
|
+
content: {
|
|
283
|
+
"application/json": {
|
|
284
|
+
/** @example true */
|
|
285
|
+
success?: boolean;
|
|
286
|
+
/** @example Stripe support status retrieved successfully */
|
|
287
|
+
message?: string;
|
|
288
|
+
data?: {
|
|
289
|
+
/**
|
|
290
|
+
* @description Whether Stripe onramp is supported for this location/amount
|
|
291
|
+
* @example true
|
|
292
|
+
*/
|
|
293
|
+
stripeOnramp?: boolean;
|
|
294
|
+
/**
|
|
295
|
+
* @description Whether Stripe Web2 onramp is supported for this location/amount
|
|
296
|
+
* @example false
|
|
297
|
+
*/
|
|
298
|
+
stripeWeb2?: boolean;
|
|
299
|
+
};
|
|
300
|
+
/** @example 200 */
|
|
301
|
+
statusCode?: number;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
/** @description Bad request */
|
|
306
|
+
400: {
|
|
307
|
+
content: {
|
|
308
|
+
"application/json": {
|
|
309
|
+
/** @example false */
|
|
310
|
+
success?: boolean;
|
|
311
|
+
/** @example Bad request */
|
|
312
|
+
message?: string;
|
|
313
|
+
/** @example 400 */
|
|
314
|
+
statusCode?: number;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
"/orders": {
|
|
322
|
+
/**
|
|
323
|
+
* Get orders by creator
|
|
324
|
+
* @description Retrieves all orders created by a specific address
|
|
325
|
+
*/
|
|
326
|
+
get: {
|
|
327
|
+
parameters: {
|
|
328
|
+
query?: {
|
|
329
|
+
/**
|
|
330
|
+
* @description Optional address of the order creator (if not provided, returns all orders)
|
|
331
|
+
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
332
|
+
*/
|
|
333
|
+
creatorAddress?: string;
|
|
334
|
+
/**
|
|
335
|
+
* @description Maximum number of orders to return
|
|
336
|
+
* @example 20
|
|
337
|
+
*/
|
|
338
|
+
limit?: string;
|
|
339
|
+
/**
|
|
340
|
+
* @description Number of orders to skip
|
|
341
|
+
* @example 0
|
|
342
|
+
*/
|
|
343
|
+
offset?: string;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
responses: {
|
|
347
|
+
/** @description Orders retrieved successfully */
|
|
348
|
+
200: {
|
|
349
|
+
content: {
|
|
350
|
+
"application/json": {
|
|
351
|
+
/** @example true */
|
|
352
|
+
success?: boolean;
|
|
353
|
+
/** @example Get orders by creator successfully */
|
|
354
|
+
message?: string;
|
|
355
|
+
/** @description Array of orders */
|
|
356
|
+
data?: {
|
|
357
|
+
/**
|
|
358
|
+
* Format: uuid
|
|
359
|
+
* @description Unique order identifier
|
|
360
|
+
* @example 51d4889c-9733-4941-a9ed-98c0f336d188
|
|
361
|
+
*/
|
|
362
|
+
id?: string;
|
|
363
|
+
/**
|
|
364
|
+
* @description Order type
|
|
365
|
+
* @example swap
|
|
366
|
+
* @enum {string}
|
|
367
|
+
*/
|
|
368
|
+
type?: "swap" | "custom";
|
|
369
|
+
/**
|
|
370
|
+
* @description Address to receive tokens/NFT/etc
|
|
371
|
+
* @example 0x58241893ef1f86c9fbd8109cd44ea961fdb474e1
|
|
372
|
+
*/
|
|
373
|
+
recipientAddress?: string;
|
|
374
|
+
/**
|
|
375
|
+
* @description Global wallet address handling the order
|
|
376
|
+
* @example 0xc6608544a3e16c2e94ca1b8c80c842765d0f3ee0
|
|
377
|
+
*/
|
|
378
|
+
globalAddress?: string;
|
|
379
|
+
/**
|
|
380
|
+
* @description Source chain ID
|
|
381
|
+
* @example 8453
|
|
382
|
+
*/
|
|
383
|
+
srcChain?: number;
|
|
384
|
+
/**
|
|
385
|
+
* @description Destination chain ID
|
|
386
|
+
* @example 8453
|
|
387
|
+
*/
|
|
388
|
+
dstChain?: number;
|
|
389
|
+
/**
|
|
390
|
+
* @description Source token contract address
|
|
391
|
+
* @example 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
|
|
392
|
+
*/
|
|
393
|
+
srcTokenAddress?: string;
|
|
394
|
+
/**
|
|
395
|
+
* @description Destination token contract address
|
|
396
|
+
* @example 0x0000000000000000000000000000000000000000
|
|
397
|
+
*/
|
|
398
|
+
dstTokenAddress?: string;
|
|
399
|
+
/**
|
|
400
|
+
* @description Source amount
|
|
401
|
+
* @example 10000000000000
|
|
402
|
+
*/
|
|
403
|
+
srcAmount?: string;
|
|
404
|
+
/**
|
|
405
|
+
* @description Current order status
|
|
406
|
+
* @example executed
|
|
407
|
+
*/
|
|
408
|
+
status?: string;
|
|
409
|
+
/**
|
|
410
|
+
* @description Error details if order failed
|
|
411
|
+
* @example null
|
|
412
|
+
*/
|
|
413
|
+
errorDetails?: string | null;
|
|
414
|
+
/**
|
|
415
|
+
* @description Creation timestamp
|
|
416
|
+
* @example 1752576294028
|
|
417
|
+
*/
|
|
418
|
+
createdAt?: number;
|
|
419
|
+
/**
|
|
420
|
+
* @description Expiration timestamp
|
|
421
|
+
* @example 1752577194028
|
|
422
|
+
*/
|
|
423
|
+
expiredAt?: number;
|
|
424
|
+
/**
|
|
425
|
+
* @description Order type specific payload
|
|
426
|
+
* @example {
|
|
427
|
+
* "expectedDstAmount": "1667766525695385",
|
|
428
|
+
* "actualDstAmount": null
|
|
429
|
+
* }
|
|
430
|
+
*/
|
|
431
|
+
payload?: Record<string, never>;
|
|
432
|
+
/**
|
|
433
|
+
* @description Display metadata including token information
|
|
434
|
+
* @example {
|
|
435
|
+
* "srcToken": {
|
|
436
|
+
* "chainId": 8453,
|
|
437
|
+
* "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
438
|
+
* "symbol": "USDC",
|
|
439
|
+
* "name": "USD Coin",
|
|
440
|
+
* "decimals": 6,
|
|
441
|
+
* "metadata": {
|
|
442
|
+
* "logoURI": "https://polygonscan.com/token/images/usdc_32.png"
|
|
443
|
+
* }
|
|
444
|
+
* },
|
|
445
|
+
* "dstToken": {
|
|
446
|
+
* "chainId": 8453,
|
|
447
|
+
* "address": "0x0000000000000000000000000000000000000000",
|
|
448
|
+
* "symbol": "ETH",
|
|
449
|
+
* "name": "Ether",
|
|
450
|
+
* "decimals": 18,
|
|
451
|
+
* "metadata": {
|
|
452
|
+
* "logoURI": "https://assets.relay.link/icons/1/light.png"
|
|
453
|
+
* }
|
|
454
|
+
* }
|
|
455
|
+
* }
|
|
456
|
+
*/
|
|
457
|
+
metadata?: Record<string, never>;
|
|
458
|
+
/**
|
|
459
|
+
* @description Optional creator address
|
|
460
|
+
* @example 0x58241893ef1f86c9fbd8109cd44ea961fdb474e1
|
|
461
|
+
*/
|
|
462
|
+
creatorAddress?: string | null;
|
|
463
|
+
/**
|
|
464
|
+
* @description Optional partner identifier
|
|
465
|
+
* @example null
|
|
466
|
+
*/
|
|
467
|
+
partnerId?: string | null;
|
|
468
|
+
/**
|
|
469
|
+
* @description Onramp configuration if used
|
|
470
|
+
* @example {
|
|
471
|
+
* "country": "SG",
|
|
472
|
+
* "vendor": "stripe-web2",
|
|
473
|
+
* "paymentMethod": "",
|
|
474
|
+
* "ipAddress": "103.216.223.204",
|
|
475
|
+
* "redirectUrl": "https://www.anyspend.com",
|
|
476
|
+
* "stripeAmountInCents": 500
|
|
477
|
+
* }
|
|
478
|
+
*/
|
|
479
|
+
onrampMetadata?: Record<string, never>;
|
|
480
|
+
/**
|
|
481
|
+
* @description Quick purchase URL if available
|
|
482
|
+
* @example null
|
|
483
|
+
*/
|
|
484
|
+
oneClickBuyUrl?: string | null;
|
|
485
|
+
/**
|
|
486
|
+
* @description Stripe payment intent ID if using Stripe
|
|
487
|
+
* @example null
|
|
488
|
+
*/
|
|
489
|
+
stripePaymentIntentId?: string | null;
|
|
490
|
+
}[];
|
|
491
|
+
/** @example 200 */
|
|
492
|
+
statusCode?: number;
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
/** @description Bad request */
|
|
497
|
+
400: {
|
|
498
|
+
content: {
|
|
499
|
+
"application/json": {
|
|
500
|
+
/** @example false */
|
|
501
|
+
success?: boolean;
|
|
502
|
+
/** @example Bad request */
|
|
503
|
+
message?: string;
|
|
504
|
+
/** @example 400 */
|
|
505
|
+
statusCode?: number;
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
/**
|
|
512
|
+
* Create a new order
|
|
513
|
+
* @description Creates a new order for token transactions across chains
|
|
514
|
+
*/
|
|
515
|
+
post: {
|
|
516
|
+
requestBody: {
|
|
517
|
+
content: {
|
|
518
|
+
"application/json": {
|
|
519
|
+
/**
|
|
520
|
+
* @description Order type for swap
|
|
521
|
+
* @enum {string}
|
|
522
|
+
*/
|
|
523
|
+
type: "swap";
|
|
524
|
+
/**
|
|
525
|
+
* @description Address to receive the destination tokens
|
|
526
|
+
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
527
|
+
*/
|
|
528
|
+
recipientAddress: string;
|
|
529
|
+
/**
|
|
530
|
+
* @description Source chain ID
|
|
531
|
+
* @example 1
|
|
532
|
+
*/
|
|
533
|
+
srcChain: number;
|
|
534
|
+
/**
|
|
535
|
+
* @description Destination chain ID
|
|
536
|
+
* @example 8453
|
|
537
|
+
*/
|
|
538
|
+
dstChain: number;
|
|
539
|
+
/**
|
|
540
|
+
* @description Source token contract address
|
|
541
|
+
* @example 0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234
|
|
542
|
+
*/
|
|
543
|
+
srcTokenAddress: string;
|
|
544
|
+
/**
|
|
545
|
+
* @description Destination token contract address
|
|
546
|
+
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
547
|
+
*/
|
|
548
|
+
dstTokenAddress: string;
|
|
549
|
+
/**
|
|
550
|
+
* @description Amount of source tokens to swap
|
|
551
|
+
* @example 1000000
|
|
552
|
+
*/
|
|
553
|
+
srcAmount: string;
|
|
554
|
+
/** @description Swap-specific payload */
|
|
555
|
+
payload: {
|
|
556
|
+
/**
|
|
557
|
+
* @description Expected amount of destination tokens
|
|
558
|
+
* @example 990000
|
|
559
|
+
*/
|
|
560
|
+
expectedDstAmount: string;
|
|
561
|
+
/**
|
|
562
|
+
* @description Actual received amount (null for new orders)
|
|
563
|
+
* @example null
|
|
564
|
+
*/
|
|
565
|
+
actualDstAmount: string | null;
|
|
566
|
+
};
|
|
567
|
+
/** @description Swap metadata for display purposes */
|
|
568
|
+
metadata: {
|
|
569
|
+
/** @description Source token details */
|
|
570
|
+
srcToken?: {
|
|
571
|
+
/**
|
|
572
|
+
* @description Token chain ID
|
|
573
|
+
* @example 8453
|
|
574
|
+
*/
|
|
575
|
+
chainId?: number;
|
|
576
|
+
/**
|
|
577
|
+
* @description Token contract address
|
|
578
|
+
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
579
|
+
*/
|
|
580
|
+
address?: string;
|
|
581
|
+
/**
|
|
582
|
+
* @description Token symbol
|
|
583
|
+
* @example USDC
|
|
584
|
+
*/
|
|
585
|
+
symbol?: string;
|
|
586
|
+
/**
|
|
587
|
+
* @description Token name
|
|
588
|
+
* @example USD Coin
|
|
589
|
+
*/
|
|
590
|
+
name?: string;
|
|
591
|
+
/**
|
|
592
|
+
* @description Token decimals
|
|
593
|
+
* @example 6
|
|
594
|
+
*/
|
|
595
|
+
decimals?: number;
|
|
596
|
+
metadata?: {
|
|
597
|
+
/**
|
|
598
|
+
* @description Token logo URI
|
|
599
|
+
* @example https://polygonscan.com/token/images/usdc_32.png
|
|
600
|
+
*/
|
|
601
|
+
logoURI?: string;
|
|
602
|
+
};
|
|
603
|
+
};
|
|
604
|
+
/** @description Destination token details */
|
|
605
|
+
dstToken?: {
|
|
606
|
+
/**
|
|
607
|
+
* @description Token chain ID
|
|
608
|
+
* @example 8453
|
|
609
|
+
*/
|
|
610
|
+
chainId?: number;
|
|
611
|
+
/**
|
|
612
|
+
* @description Token contract address
|
|
613
|
+
* @example 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
|
|
614
|
+
*/
|
|
615
|
+
address?: string;
|
|
616
|
+
/**
|
|
617
|
+
* @description Token symbol
|
|
618
|
+
* @example USDC
|
|
619
|
+
*/
|
|
620
|
+
symbol?: string;
|
|
621
|
+
/**
|
|
622
|
+
* @description Token name
|
|
623
|
+
* @example USD Coin
|
|
624
|
+
*/
|
|
625
|
+
name?: string;
|
|
626
|
+
/**
|
|
627
|
+
* @description Token decimals
|
|
628
|
+
* @example 6
|
|
629
|
+
*/
|
|
630
|
+
decimals?: number;
|
|
631
|
+
metadata?: {
|
|
632
|
+
/**
|
|
633
|
+
* @description Token logo URI
|
|
634
|
+
* @example https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694
|
|
635
|
+
*/
|
|
636
|
+
logoURI?: string;
|
|
637
|
+
};
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
/** @description Optional partner identifier */
|
|
641
|
+
partnerId?: string;
|
|
642
|
+
/** @description Optional onramp configuration */
|
|
643
|
+
onramp?: {
|
|
644
|
+
/**
|
|
645
|
+
* @description Onramp vendor
|
|
646
|
+
* @enum {string}
|
|
647
|
+
*/
|
|
648
|
+
vendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
649
|
+
/**
|
|
650
|
+
* @description Payment method for onramp
|
|
651
|
+
* @example
|
|
652
|
+
*/
|
|
653
|
+
paymentMethod?: string;
|
|
654
|
+
/**
|
|
655
|
+
* @description Country code for the user
|
|
656
|
+
* @example SG
|
|
657
|
+
*/
|
|
658
|
+
country?: string;
|
|
659
|
+
/**
|
|
660
|
+
* @description User's IP address
|
|
661
|
+
* @example 149.88.23.87
|
|
662
|
+
*/
|
|
663
|
+
ipAddress?: string;
|
|
664
|
+
/**
|
|
665
|
+
* @description URL to redirect after payment
|
|
666
|
+
* @example https://www.anyspend.com
|
|
667
|
+
*/
|
|
668
|
+
redirectUrl?: string;
|
|
669
|
+
};
|
|
670
|
+
/**
|
|
671
|
+
* @description Optional address of the order creator
|
|
672
|
+
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
673
|
+
*/
|
|
674
|
+
creatorAddress?: string;
|
|
675
|
+
} | {
|
|
676
|
+
/**
|
|
677
|
+
* @description Order type for custom execution
|
|
678
|
+
* @enum {string}
|
|
679
|
+
*/
|
|
680
|
+
type: "custom";
|
|
681
|
+
/**
|
|
682
|
+
* @description Address to receive any tokens or execute transaction
|
|
683
|
+
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
684
|
+
*/
|
|
685
|
+
recipientAddress: string;
|
|
686
|
+
/**
|
|
687
|
+
* @description Source chain ID for payment
|
|
688
|
+
* @example 1
|
|
689
|
+
*/
|
|
690
|
+
srcChain: number;
|
|
691
|
+
/**
|
|
692
|
+
* @description Destination chain ID where custom execution will occur
|
|
693
|
+
* @example 8453
|
|
694
|
+
*/
|
|
695
|
+
dstChain: number;
|
|
696
|
+
/**
|
|
697
|
+
* @description Payment token contract address
|
|
698
|
+
* @example 0xA0b86a33E6441E8A91DEF8f5663ACb4C9B4a1234
|
|
699
|
+
*/
|
|
700
|
+
srcTokenAddress: string;
|
|
701
|
+
/**
|
|
702
|
+
* @description Token to be used in custom execution
|
|
703
|
+
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
704
|
+
*/
|
|
705
|
+
dstTokenAddress: string;
|
|
706
|
+
/**
|
|
707
|
+
* @description Payment amount
|
|
708
|
+
* @example 1000000
|
|
709
|
+
*/
|
|
710
|
+
srcAmount: string;
|
|
711
|
+
/** @description Custom execution payload */
|
|
712
|
+
payload: {
|
|
713
|
+
/**
|
|
714
|
+
* @description Encoded transaction data
|
|
715
|
+
* @example 0x1234567890abcdef...
|
|
716
|
+
*/
|
|
717
|
+
data: string;
|
|
718
|
+
/**
|
|
719
|
+
* @description Target contract address
|
|
720
|
+
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
721
|
+
*/
|
|
722
|
+
to: string;
|
|
723
|
+
/**
|
|
724
|
+
* @description Optional spender address for token approval
|
|
725
|
+
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
726
|
+
*/
|
|
727
|
+
spenderAddress?: string;
|
|
728
|
+
/**
|
|
729
|
+
* @description Amount for the custom operation
|
|
730
|
+
* @example 1000000
|
|
731
|
+
*/
|
|
732
|
+
amount: string;
|
|
733
|
+
};
|
|
734
|
+
/** @description Custom metadata for display purposes */
|
|
735
|
+
metadata: Record<string, never>;
|
|
736
|
+
/** @description Optional partner identifier */
|
|
737
|
+
partnerId?: string;
|
|
738
|
+
/** @description Optional onramp configuration */
|
|
739
|
+
onramp?: {
|
|
740
|
+
/**
|
|
741
|
+
* @description Onramp vendor
|
|
742
|
+
* @enum {string}
|
|
743
|
+
*/
|
|
744
|
+
vendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
745
|
+
/**
|
|
746
|
+
* @description Payment method for onramp
|
|
747
|
+
* @example
|
|
748
|
+
*/
|
|
749
|
+
paymentMethod?: string;
|
|
750
|
+
/**
|
|
751
|
+
* @description Country code for the user
|
|
752
|
+
* @example SG
|
|
753
|
+
*/
|
|
754
|
+
country?: string;
|
|
755
|
+
/**
|
|
756
|
+
* @description User's IP address
|
|
757
|
+
* @example 149.88.23.87
|
|
758
|
+
*/
|
|
759
|
+
ipAddress?: string;
|
|
760
|
+
/**
|
|
761
|
+
* @description URL to redirect after payment
|
|
762
|
+
* @example https://www.anyspend.com
|
|
763
|
+
*/
|
|
764
|
+
redirectUrl?: string;
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* @description Optional address of the order creator
|
|
768
|
+
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
769
|
+
*/
|
|
770
|
+
creatorAddress?: string;
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
};
|
|
774
|
+
responses: {
|
|
775
|
+
/** @description Order created successfully */
|
|
776
|
+
200: {
|
|
777
|
+
content: {
|
|
778
|
+
"application/json": {
|
|
779
|
+
/** @example true */
|
|
780
|
+
success?: boolean;
|
|
781
|
+
/** @example Created order successfully */
|
|
782
|
+
message?: string;
|
|
783
|
+
/** @description Complete order object */
|
|
784
|
+
data?: {
|
|
785
|
+
/**
|
|
786
|
+
* Format: uuid
|
|
787
|
+
* @description Unique order identifier
|
|
788
|
+
*/
|
|
789
|
+
id?: string;
|
|
790
|
+
/**
|
|
791
|
+
* @description Order type
|
|
792
|
+
* @enum {string}
|
|
793
|
+
*/
|
|
794
|
+
type?: "swap" | "custom";
|
|
795
|
+
/** @description Address to receive tokens/NFT/etc */
|
|
796
|
+
recipientAddress?: string;
|
|
797
|
+
/** @description Global wallet address handling the order */
|
|
798
|
+
globalAddress?: string;
|
|
799
|
+
/** @description Source chain ID */
|
|
800
|
+
srcChain?: number;
|
|
801
|
+
/** @description Destination chain ID */
|
|
802
|
+
dstChain?: number;
|
|
803
|
+
/** @description Source token contract address */
|
|
804
|
+
srcTokenAddress?: string;
|
|
805
|
+
/** @description Destination token contract address */
|
|
806
|
+
dstTokenAddress?: string;
|
|
807
|
+
/** @description Source amount */
|
|
808
|
+
srcAmount?: string;
|
|
809
|
+
/**
|
|
810
|
+
* @description Current order status
|
|
811
|
+
* @example waiting_stripe_payment
|
|
812
|
+
* @enum {string}
|
|
813
|
+
*/
|
|
814
|
+
status?: "waiting_stripe_payment" | "pending" | "executed" | "failed" | "expired" | "refunding" | "refunded";
|
|
815
|
+
/** @description Error details if order failed */
|
|
816
|
+
errorDetails?: string | null;
|
|
817
|
+
/** @description Creation timestamp */
|
|
818
|
+
createdAt?: number;
|
|
819
|
+
/** @description Expiration timestamp */
|
|
820
|
+
expiredAt?: number;
|
|
821
|
+
/** @description Order type specific payload */
|
|
822
|
+
payload?: Record<string, never>;
|
|
823
|
+
/** @description Display metadata */
|
|
824
|
+
metadata?: Record<string, never>;
|
|
825
|
+
/** @description Optional creator address */
|
|
826
|
+
creatorAddress?: string | null;
|
|
827
|
+
/** @description Optional partner identifier */
|
|
828
|
+
partnerId?: string | null;
|
|
829
|
+
/** @description Onramp configuration if used */
|
|
830
|
+
onrampMetadata?: {
|
|
831
|
+
/**
|
|
832
|
+
* @description Country code
|
|
833
|
+
* @example SG
|
|
834
|
+
*/
|
|
835
|
+
country?: string;
|
|
836
|
+
/**
|
|
837
|
+
* @description Onramp vendor used
|
|
838
|
+
* @example stripe-web2
|
|
839
|
+
*/
|
|
840
|
+
vendor?: string;
|
|
841
|
+
/**
|
|
842
|
+
* @description Payment method used
|
|
843
|
+
* @example
|
|
844
|
+
*/
|
|
845
|
+
paymentMethod?: string;
|
|
846
|
+
/**
|
|
847
|
+
* @description User's IP address
|
|
848
|
+
* @example 149.88.23.82
|
|
849
|
+
*/
|
|
850
|
+
ipAddress?: string;
|
|
851
|
+
/**
|
|
852
|
+
* @description Redirect URL after payment
|
|
853
|
+
* @example https://www.anyspend.com
|
|
854
|
+
*/
|
|
855
|
+
redirectUrl?: string;
|
|
856
|
+
/**
|
|
857
|
+
* @description Stripe payment amount in cents
|
|
858
|
+
* @example 500
|
|
859
|
+
*/
|
|
860
|
+
stripeAmountInCents?: number;
|
|
861
|
+
} | null;
|
|
862
|
+
/** @description Quick purchase URL if available */
|
|
863
|
+
oneClickBuyUrl?: string | null;
|
|
864
|
+
/** @description Stripe payment intent ID if using Stripe */
|
|
865
|
+
stripePaymentIntentId?: string | null;
|
|
866
|
+
};
|
|
867
|
+
/** @example 200 */
|
|
868
|
+
statusCode?: number;
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
/** @description Bad request */
|
|
873
|
+
400: {
|
|
874
|
+
content: {
|
|
875
|
+
"application/json": {
|
|
876
|
+
/** @example false */
|
|
877
|
+
success?: boolean;
|
|
878
|
+
/** @example Bad request */
|
|
879
|
+
message?: string;
|
|
880
|
+
/** @example 400 */
|
|
881
|
+
statusCode?: number;
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
};
|
|
888
|
+
"/orders/{orderId}": {
|
|
889
|
+
/**
|
|
890
|
+
* Get order and transactions
|
|
891
|
+
* @description Retrieves order details along with associated transactions
|
|
892
|
+
*/
|
|
893
|
+
get: {
|
|
894
|
+
parameters: {
|
|
895
|
+
path: {
|
|
896
|
+
/**
|
|
897
|
+
* @description Unique order identifier
|
|
898
|
+
* @example 5392f7a7-d472-4d6b-9848-bd07117fb82d
|
|
899
|
+
*/
|
|
900
|
+
orderId: string;
|
|
901
|
+
};
|
|
902
|
+
};
|
|
903
|
+
responses: {
|
|
904
|
+
/** @description Order and transactions retrieved successfully */
|
|
905
|
+
200: {
|
|
906
|
+
content: {
|
|
907
|
+
"application/json": {
|
|
908
|
+
/** @example true */
|
|
909
|
+
success?: boolean;
|
|
910
|
+
/** @example Get order and transactions successfully */
|
|
911
|
+
message?: string;
|
|
912
|
+
data?: {
|
|
913
|
+
/** @description Complete order details */
|
|
914
|
+
order?: {
|
|
915
|
+
/**
|
|
916
|
+
* Format: uuid
|
|
917
|
+
* @description Unique order identifier
|
|
918
|
+
* @example 5392f7a7-d472-4d6b-9848-bd07117fb82d
|
|
919
|
+
*/
|
|
920
|
+
id?: string;
|
|
921
|
+
/**
|
|
922
|
+
* @description Order type
|
|
923
|
+
* @example swap
|
|
924
|
+
* @enum {string}
|
|
925
|
+
*/
|
|
926
|
+
type?: "swap" | "custom";
|
|
927
|
+
/**
|
|
928
|
+
* @description Address to receive tokens/NFT/etc
|
|
929
|
+
* @example 0xb34facb90a200251318e8841c05102366f2158cf
|
|
930
|
+
*/
|
|
931
|
+
recipientAddress?: string;
|
|
932
|
+
/**
|
|
933
|
+
* @description Global wallet address handling the order
|
|
934
|
+
* @example 0xa640beaa78eeb64bb269f2baf8202b9a7316e123
|
|
935
|
+
*/
|
|
936
|
+
globalAddress?: string;
|
|
937
|
+
/**
|
|
938
|
+
* @description Source chain ID
|
|
939
|
+
* @example 8453
|
|
940
|
+
*/
|
|
941
|
+
srcChain?: number;
|
|
942
|
+
/**
|
|
943
|
+
* @description Destination chain ID
|
|
944
|
+
* @example 8453
|
|
945
|
+
*/
|
|
946
|
+
dstChain?: number;
|
|
947
|
+
/**
|
|
948
|
+
* @description Source token contract address
|
|
949
|
+
* @example 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
|
|
950
|
+
*/
|
|
951
|
+
srcTokenAddress?: string;
|
|
952
|
+
/**
|
|
953
|
+
* @description Destination token contract address
|
|
954
|
+
* @example 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
|
|
955
|
+
*/
|
|
956
|
+
dstTokenAddress?: string;
|
|
957
|
+
/**
|
|
958
|
+
* @description Source amount
|
|
959
|
+
* @example 93354000
|
|
960
|
+
*/
|
|
961
|
+
srcAmount?: string;
|
|
962
|
+
/**
|
|
963
|
+
* @description Current order status
|
|
964
|
+
* @example executed
|
|
965
|
+
*/
|
|
966
|
+
status?: string;
|
|
967
|
+
/**
|
|
968
|
+
* @description Error details if order failed
|
|
969
|
+
* @example null
|
|
970
|
+
*/
|
|
971
|
+
errorDetails?: string | null;
|
|
972
|
+
/**
|
|
973
|
+
* @description Creation timestamp
|
|
974
|
+
* @example 1752505794679
|
|
975
|
+
*/
|
|
976
|
+
createdAt?: number;
|
|
977
|
+
/**
|
|
978
|
+
* @description Expiration timestamp
|
|
979
|
+
* @example 1752506694679
|
|
980
|
+
*/
|
|
981
|
+
expiredAt?: number;
|
|
982
|
+
/**
|
|
983
|
+
* @description Order type specific payload
|
|
984
|
+
* @example {
|
|
985
|
+
* "expectedDstAmount": "99000000",
|
|
986
|
+
* "actualDstAmount": "93354000"
|
|
987
|
+
* }
|
|
988
|
+
*/
|
|
989
|
+
payload?: Record<string, never>;
|
|
990
|
+
/**
|
|
991
|
+
* @description Display metadata including token information
|
|
992
|
+
* @example {
|
|
993
|
+
* "srcToken": {
|
|
994
|
+
* "chainId": 8453,
|
|
995
|
+
* "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
996
|
+
* "symbol": "USDC",
|
|
997
|
+
* "name": "USD Coin",
|
|
998
|
+
* "decimals": 6,
|
|
999
|
+
* "metadata": {
|
|
1000
|
+
* "logoURI": "https://polygonscan.com/token/images/usdc_32.png"
|
|
1001
|
+
* }
|
|
1002
|
+
* },
|
|
1003
|
+
* "dstToken": {
|
|
1004
|
+
* "chainId": 8453,
|
|
1005
|
+
* "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
1006
|
+
* "symbol": "USDC",
|
|
1007
|
+
* "name": "USD Coin",
|
|
1008
|
+
* "decimals": 6,
|
|
1009
|
+
* "metadata": {
|
|
1010
|
+
* "logoURI": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"
|
|
1011
|
+
* }
|
|
1012
|
+
* }
|
|
1013
|
+
* }
|
|
1014
|
+
*/
|
|
1015
|
+
metadata?: Record<string, never>;
|
|
1016
|
+
/**
|
|
1017
|
+
* @description Optional creator address
|
|
1018
|
+
* @example 0xb34facb90a200251318e8841c05102366f2158cf
|
|
1019
|
+
*/
|
|
1020
|
+
creatorAddress?: string | null;
|
|
1021
|
+
/**
|
|
1022
|
+
* @description Optional partner identifier
|
|
1023
|
+
* @example null
|
|
1024
|
+
*/
|
|
1025
|
+
partnerId?: string | null;
|
|
1026
|
+
/**
|
|
1027
|
+
* @description Onramp configuration if used
|
|
1028
|
+
* @example {
|
|
1029
|
+
* "country": "US",
|
|
1030
|
+
* "vendor": "stripe-web2",
|
|
1031
|
+
* "paymentMethod": "",
|
|
1032
|
+
* "ipAddress": "96.225.86.216",
|
|
1033
|
+
* "redirectUrl": "https://www.anyspend.com",
|
|
1034
|
+
* "stripeAmountInCents": 9900
|
|
1035
|
+
* }
|
|
1036
|
+
*/
|
|
1037
|
+
onrampMetadata?: Record<string, never>;
|
|
1038
|
+
/**
|
|
1039
|
+
* @description Quick purchase URL if available
|
|
1040
|
+
* @example null
|
|
1041
|
+
*/
|
|
1042
|
+
oneClickBuyUrl?: string | null;
|
|
1043
|
+
/**
|
|
1044
|
+
* @description Stripe payment intent ID if using Stripe
|
|
1045
|
+
* @example pi_3Rko0sJnoDg53PsP0PDLsHkR
|
|
1046
|
+
*/
|
|
1047
|
+
stripePaymentIntentId?: string | null;
|
|
1048
|
+
};
|
|
1049
|
+
/**
|
|
1050
|
+
* @description Deposit transactions (payment from user)
|
|
1051
|
+
* @example [
|
|
1052
|
+
* {
|
|
1053
|
+
* "orderId": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
|
|
1054
|
+
* "chain": 8453,
|
|
1055
|
+
* "from": "0xa7539e73700B1726aBA29526606442A491Ef5747",
|
|
1056
|
+
* "txHash": "0x60ece99a645201668d20db6775a6b3d30967433ff0750b356cdad46d3e13f9c8",
|
|
1057
|
+
* "amount": "93354000",
|
|
1058
|
+
* "createdAt": 1752505811105
|
|
1059
|
+
* }
|
|
1060
|
+
* ]
|
|
1061
|
+
*/
|
|
1062
|
+
depositTxs?: {
|
|
1063
|
+
/**
|
|
1064
|
+
* Format: uuid
|
|
1065
|
+
* @description Associated order ID
|
|
1066
|
+
* @example 5392f7a7-d472-4d6b-9848-bd07117fb82d
|
|
1067
|
+
*/
|
|
1068
|
+
orderId?: string;
|
|
1069
|
+
/**
|
|
1070
|
+
* @description Chain where transaction occurred
|
|
1071
|
+
* @example 8453
|
|
1072
|
+
*/
|
|
1073
|
+
chain?: number;
|
|
1074
|
+
/**
|
|
1075
|
+
* @description Sender address
|
|
1076
|
+
* @example 0xa7539e73700B1726aBA29526606442A491Ef5747
|
|
1077
|
+
*/
|
|
1078
|
+
from?: string;
|
|
1079
|
+
/**
|
|
1080
|
+
* @description Transaction hash
|
|
1081
|
+
* @example 0x60ece99a645201668d20db6775a6b3d30967433ff0750b356cdad46d3e13f9c8
|
|
1082
|
+
*/
|
|
1083
|
+
txHash?: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* @description Transaction amount
|
|
1086
|
+
* @example 93354000
|
|
1087
|
+
*/
|
|
1088
|
+
amount?: string;
|
|
1089
|
+
/**
|
|
1090
|
+
* @description Transaction timestamp
|
|
1091
|
+
* @example 1752505811105
|
|
1092
|
+
*/
|
|
1093
|
+
createdAt?: number;
|
|
1094
|
+
}[] | null;
|
|
1095
|
+
/**
|
|
1096
|
+
* @description Cross-chain relay transaction
|
|
1097
|
+
* @example {
|
|
1098
|
+
* "orderId": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
|
|
1099
|
+
* "chain": 8453,
|
|
1100
|
+
* "txHash": "0x9df917e14bb089f74763d1d2662761d75c97a5a068b8a9e411c3d384c9c40d19",
|
|
1101
|
+
* "status": "success",
|
|
1102
|
+
* "createdAt": 1752505817654
|
|
1103
|
+
* }
|
|
1104
|
+
*/
|
|
1105
|
+
relayTx?: {
|
|
1106
|
+
/**
|
|
1107
|
+
* Format: uuid
|
|
1108
|
+
* @description Associated order ID
|
|
1109
|
+
* @example 5392f7a7-d472-4d6b-9848-bd07117fb82d
|
|
1110
|
+
*/
|
|
1111
|
+
orderId?: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* @description Chain where relay occurred
|
|
1114
|
+
* @example 8453
|
|
1115
|
+
*/
|
|
1116
|
+
chain?: number;
|
|
1117
|
+
/**
|
|
1118
|
+
* @description Relay transaction hash
|
|
1119
|
+
* @example 0x9df917e14bb089f74763d1d2662761d75c97a5a068b8a9e411c3d384c9c40d19
|
|
1120
|
+
*/
|
|
1121
|
+
txHash?: string;
|
|
1122
|
+
/**
|
|
1123
|
+
* @description Relay transaction status
|
|
1124
|
+
* @example success
|
|
1125
|
+
*/
|
|
1126
|
+
status?: string;
|
|
1127
|
+
/**
|
|
1128
|
+
* @description Relay timestamp
|
|
1129
|
+
* @example 1752505817654
|
|
1130
|
+
*/
|
|
1131
|
+
createdAt?: number;
|
|
1132
|
+
} | null;
|
|
1133
|
+
/**
|
|
1134
|
+
* @description Final execution transaction (NFT mint, tournament join, etc)
|
|
1135
|
+
* @example null
|
|
1136
|
+
*/
|
|
1137
|
+
executeTx?: {
|
|
1138
|
+
/**
|
|
1139
|
+
* Format: uuid
|
|
1140
|
+
* @description Associated order ID
|
|
1141
|
+
*/
|
|
1142
|
+
orderId?: string;
|
|
1143
|
+
/** @description Chain where execution occurred */
|
|
1144
|
+
chain?: number;
|
|
1145
|
+
/** @description Execution transaction hash */
|
|
1146
|
+
txHash?: string;
|
|
1147
|
+
/** @description Execution timestamp */
|
|
1148
|
+
createdAt?: number;
|
|
1149
|
+
} | null;
|
|
1150
|
+
/**
|
|
1151
|
+
* @description Refund transactions if order failed
|
|
1152
|
+
* @example null
|
|
1153
|
+
*/
|
|
1154
|
+
refundTxs?: {
|
|
1155
|
+
/**
|
|
1156
|
+
* Format: uuid
|
|
1157
|
+
* @description Associated order ID
|
|
1158
|
+
*/
|
|
1159
|
+
orderId?: string;
|
|
1160
|
+
/** @description Chain where refund occurred */
|
|
1161
|
+
chain?: number;
|
|
1162
|
+
/** @description Refund transaction hash */
|
|
1163
|
+
txHash?: string;
|
|
1164
|
+
/** @description Refunded amount */
|
|
1165
|
+
amount?: string;
|
|
1166
|
+
/** @description Refund status */
|
|
1167
|
+
status?: string;
|
|
1168
|
+
/** @description Refund timestamp */
|
|
1169
|
+
createdAt?: number;
|
|
1170
|
+
}[] | null;
|
|
1171
|
+
};
|
|
1172
|
+
/** @example 200 */
|
|
1173
|
+
statusCode?: number;
|
|
1174
|
+
};
|
|
1175
|
+
};
|
|
1176
|
+
};
|
|
1177
|
+
/** @description Bad request */
|
|
1178
|
+
400: {
|
|
1179
|
+
content: {
|
|
1180
|
+
"application/json": {
|
|
1181
|
+
/** @example false */
|
|
1182
|
+
success?: boolean;
|
|
1183
|
+
/** @example Bad request */
|
|
1184
|
+
message?: string;
|
|
1185
|
+
/** @example 400 */
|
|
1186
|
+
statusCode?: number;
|
|
1187
|
+
};
|
|
1188
|
+
};
|
|
1189
|
+
};
|
|
1190
|
+
/** @description Order not found */
|
|
1191
|
+
404: {
|
|
1192
|
+
content: {
|
|
1193
|
+
"application/json": {
|
|
1194
|
+
/** @example false */
|
|
1195
|
+
success?: boolean;
|
|
1196
|
+
/** @example Order not found */
|
|
1197
|
+
message?: string;
|
|
1198
|
+
/** @example 404 */
|
|
1199
|
+
statusCode?: number;
|
|
1200
|
+
};
|
|
1201
|
+
};
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1204
|
+
};
|
|
1205
|
+
};
|
|
1206
|
+
"/orders/quote": {
|
|
1207
|
+
/**
|
|
1208
|
+
* Get anyspend quote
|
|
1209
|
+
* @description Retrieves a quote for cross-chain token relay
|
|
1210
|
+
*/
|
|
1211
|
+
post: {
|
|
1212
|
+
requestBody: {
|
|
1213
|
+
content: {
|
|
1214
|
+
"application/json": {
|
|
1215
|
+
/**
|
|
1216
|
+
* @description Order type for swap
|
|
1217
|
+
* @enum {string}
|
|
1218
|
+
*/
|
|
1219
|
+
type: "swap";
|
|
1220
|
+
/**
|
|
1221
|
+
* @description Source chain ID
|
|
1222
|
+
* @example 1
|
|
1223
|
+
*/
|
|
1224
|
+
srcChain: number;
|
|
1225
|
+
/**
|
|
1226
|
+
* @description Destination chain ID
|
|
1227
|
+
* @example 8453
|
|
1228
|
+
*/
|
|
1229
|
+
dstChain: number;
|
|
1230
|
+
/**
|
|
1231
|
+
* @description Source token contract address
|
|
1232
|
+
* @example 0x0000000000000000000000000000000000000000
|
|
1233
|
+
*/
|
|
1234
|
+
srcTokenAddress: string;
|
|
1235
|
+
/**
|
|
1236
|
+
* @description Destination token contract address
|
|
1237
|
+
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
1238
|
+
*/
|
|
1239
|
+
dstTokenAddress: string;
|
|
1240
|
+
/**
|
|
1241
|
+
* @description Type of trade execution
|
|
1242
|
+
* @enum {string}
|
|
1243
|
+
*/
|
|
1244
|
+
tradeType: "EXACT_INPUT" | "EXPECTED_OUTPUT" | "EXACT_OUTPUT";
|
|
1245
|
+
/**
|
|
1246
|
+
* @description Amount to quote
|
|
1247
|
+
* @example 1000000000000000000
|
|
1248
|
+
*/
|
|
1249
|
+
amount: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* @description Optional onramp vendor
|
|
1252
|
+
* @enum {string}
|
|
1253
|
+
*/
|
|
1254
|
+
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
1255
|
+
} | {
|
|
1256
|
+
/**
|
|
1257
|
+
* @description Order type for custom execution
|
|
1258
|
+
* @enum {string}
|
|
1259
|
+
*/
|
|
1260
|
+
type: "custom";
|
|
1261
|
+
/**
|
|
1262
|
+
* @description Source chain ID
|
|
1263
|
+
* @example 1
|
|
1264
|
+
*/
|
|
1265
|
+
srcChain: number;
|
|
1266
|
+
/**
|
|
1267
|
+
* @description Destination chain ID
|
|
1268
|
+
* @example 8453
|
|
1269
|
+
*/
|
|
1270
|
+
dstChain: number;
|
|
1271
|
+
/**
|
|
1272
|
+
* @description Source token contract address
|
|
1273
|
+
* @example 0x0000000000000000000000000000000000000000
|
|
1274
|
+
*/
|
|
1275
|
+
srcTokenAddress: string;
|
|
1276
|
+
/**
|
|
1277
|
+
* @description Destination token contract address
|
|
1278
|
+
* @example 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
|
|
1279
|
+
*/
|
|
1280
|
+
dstTokenAddress: string;
|
|
1281
|
+
/** @description Custom payload for execution */
|
|
1282
|
+
payload: {
|
|
1283
|
+
/** @description Encoded transaction data */
|
|
1284
|
+
data: string;
|
|
1285
|
+
/** @description Target contract address */
|
|
1286
|
+
to: string;
|
|
1287
|
+
/** @description Optional spender address for token approval */
|
|
1288
|
+
spenderAddress?: string;
|
|
1289
|
+
/** @description Amount for the custom operation */
|
|
1290
|
+
amount: string;
|
|
1291
|
+
};
|
|
1292
|
+
/**
|
|
1293
|
+
* @description Optional onramp vendor
|
|
1294
|
+
* @enum {string}
|
|
1295
|
+
*/
|
|
1296
|
+
onrampVendor?: "coinbase" | "stripe" | "stripe-web2";
|
|
1297
|
+
};
|
|
1298
|
+
};
|
|
1299
|
+
};
|
|
1300
|
+
responses: {
|
|
1301
|
+
/** @description Quote retrieved successfully */
|
|
1302
|
+
200: {
|
|
1303
|
+
content: {
|
|
1304
|
+
"application/json": {
|
|
1305
|
+
/** @example true */
|
|
1306
|
+
success?: boolean;
|
|
1307
|
+
/** @example Get quote successfully */
|
|
1308
|
+
message?: string;
|
|
1309
|
+
data?: {
|
|
1310
|
+
/**
|
|
1311
|
+
* @description Type of operation
|
|
1312
|
+
* @example swap
|
|
1313
|
+
*/
|
|
1314
|
+
operation?: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* @description Sender address for the operation
|
|
1317
|
+
* @example 0x15846E6A7C839A208765a0B4754C2dd15E879990
|
|
1318
|
+
*/
|
|
1319
|
+
sender?: string;
|
|
1320
|
+
/**
|
|
1321
|
+
* @description Recipient address for the operation
|
|
1322
|
+
* @example 0xaF1ae1B78bc767DaEBB91196Adf982E9d560AAB9
|
|
1323
|
+
*/
|
|
1324
|
+
recipient?: string;
|
|
1325
|
+
/** @description Input currency details */
|
|
1326
|
+
currencyIn?: {
|
|
1327
|
+
currency?: {
|
|
1328
|
+
/** @example 1 */
|
|
1329
|
+
chainId?: number;
|
|
1330
|
+
/** @example 0x0000000000000000000000000000000000000000 */
|
|
1331
|
+
address?: string;
|
|
1332
|
+
/** @example ETH */
|
|
1333
|
+
symbol?: string;
|
|
1334
|
+
/** @example Ether */
|
|
1335
|
+
name?: string;
|
|
1336
|
+
/** @example 18 */
|
|
1337
|
+
decimals?: number;
|
|
1338
|
+
metadata?: {
|
|
1339
|
+
/** @example https://assets.relay.link/icons/1/light.png */
|
|
1340
|
+
logoURI?: string;
|
|
1341
|
+
/** @example true */
|
|
1342
|
+
verified?: boolean;
|
|
1343
|
+
};
|
|
1344
|
+
};
|
|
1345
|
+
/**
|
|
1346
|
+
* @description Raw amount
|
|
1347
|
+
* @example 1000000000000000000
|
|
1348
|
+
*/
|
|
1349
|
+
amount?: string;
|
|
1350
|
+
/**
|
|
1351
|
+
* @description Human-readable formatted amount
|
|
1352
|
+
* @example 1.0
|
|
1353
|
+
*/
|
|
1354
|
+
amountFormatted?: string;
|
|
1355
|
+
/**
|
|
1356
|
+
* @description USD value of the amount
|
|
1357
|
+
* @example 3229.715818
|
|
1358
|
+
*/
|
|
1359
|
+
amountUsd?: string;
|
|
1360
|
+
/**
|
|
1361
|
+
* @description Minimum required amount
|
|
1362
|
+
* @example 1000000000000000000
|
|
1363
|
+
*/
|
|
1364
|
+
minimumAmount?: string;
|
|
1365
|
+
};
|
|
1366
|
+
/** @description Output currency details */
|
|
1367
|
+
currencyOut?: {
|
|
1368
|
+
currency?: {
|
|
1369
|
+
/** @example 8453 */
|
|
1370
|
+
chainId?: number;
|
|
1371
|
+
/** @example 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 */
|
|
1372
|
+
address?: string;
|
|
1373
|
+
/** @example USDC */
|
|
1374
|
+
symbol?: string;
|
|
1375
|
+
/** @example USD Coin */
|
|
1376
|
+
name?: string;
|
|
1377
|
+
/** @example 6 */
|
|
1378
|
+
decimals?: number;
|
|
1379
|
+
metadata?: {
|
|
1380
|
+
/** @example https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694 */
|
|
1381
|
+
logoURI?: string;
|
|
1382
|
+
/** @example true */
|
|
1383
|
+
verified?: boolean;
|
|
1384
|
+
};
|
|
1385
|
+
};
|
|
1386
|
+
/**
|
|
1387
|
+
* @description Raw output amount
|
|
1388
|
+
* @example 3224805862
|
|
1389
|
+
*/
|
|
1390
|
+
amount?: string;
|
|
1391
|
+
/**
|
|
1392
|
+
* @description Human-readable formatted output amount
|
|
1393
|
+
* @example 3224.805862
|
|
1394
|
+
*/
|
|
1395
|
+
amountFormatted?: string;
|
|
1396
|
+
/**
|
|
1397
|
+
* @description USD value of output amount
|
|
1398
|
+
* @example 3224.512405
|
|
1399
|
+
*/
|
|
1400
|
+
amountUsd?: string;
|
|
1401
|
+
/**
|
|
1402
|
+
* @description Minimum guaranteed output amount
|
|
1403
|
+
* @example 3192557803
|
|
1404
|
+
*/
|
|
1405
|
+
minimumAmount?: string;
|
|
1406
|
+
};
|
|
1407
|
+
/** @description Total price impact of the trade */
|
|
1408
|
+
totalImpact?: {
|
|
1409
|
+
/**
|
|
1410
|
+
* @description USD impact amount
|
|
1411
|
+
* @example -5.203413
|
|
1412
|
+
*/
|
|
1413
|
+
usd?: string;
|
|
1414
|
+
/**
|
|
1415
|
+
* @description Percentage impact
|
|
1416
|
+
* @example -0.16
|
|
1417
|
+
*/
|
|
1418
|
+
percent?: string;
|
|
1419
|
+
};
|
|
1420
|
+
/** @description Price impact from the swap portion */
|
|
1421
|
+
swapImpact?: {
|
|
1422
|
+
/**
|
|
1423
|
+
* @description USD swap impact
|
|
1424
|
+
* @example -4.102797
|
|
1425
|
+
*/
|
|
1426
|
+
usd?: string;
|
|
1427
|
+
/**
|
|
1428
|
+
* @description Percentage swap impact
|
|
1429
|
+
* @example -0.13
|
|
1430
|
+
*/
|
|
1431
|
+
percent?: string;
|
|
1432
|
+
};
|
|
1433
|
+
/**
|
|
1434
|
+
* @description Exchange rate
|
|
1435
|
+
* @example 3224.805862
|
|
1436
|
+
*/
|
|
1437
|
+
rate?: string;
|
|
1438
|
+
/** @description Slippage tolerance settings */
|
|
1439
|
+
slippageTolerance?: {
|
|
1440
|
+
origin?: {
|
|
1441
|
+
/** @example 0.000000 */
|
|
1442
|
+
usd?: string;
|
|
1443
|
+
/** @example 0 */
|
|
1444
|
+
value?: string;
|
|
1445
|
+
/** @example 0.00 */
|
|
1446
|
+
percent?: string;
|
|
1447
|
+
};
|
|
1448
|
+
destination?: {
|
|
1449
|
+
/** @example 32.245124 */
|
|
1450
|
+
usd?: string;
|
|
1451
|
+
/** @example 32248059 */
|
|
1452
|
+
value?: string;
|
|
1453
|
+
/** @example 1.00 */
|
|
1454
|
+
percent?: string;
|
|
1455
|
+
};
|
|
1456
|
+
};
|
|
1457
|
+
/**
|
|
1458
|
+
* @description Estimated completion time in seconds
|
|
1459
|
+
* @example 24
|
|
1460
|
+
*/
|
|
1461
|
+
timeEstimate?: number;
|
|
1462
|
+
/**
|
|
1463
|
+
* @description User's current balance
|
|
1464
|
+
* @example 0
|
|
1465
|
+
*/
|
|
1466
|
+
userBalance?: string;
|
|
1467
|
+
};
|
|
1468
|
+
/** @example 200 */
|
|
1469
|
+
statusCode?: number;
|
|
1470
|
+
};
|
|
1471
|
+
};
|
|
1472
|
+
};
|
|
1473
|
+
/** @description Bad request */
|
|
1474
|
+
400: {
|
|
1475
|
+
content: {
|
|
1476
|
+
"application/json": {
|
|
1477
|
+
/** @example false */
|
|
1478
|
+
success?: boolean;
|
|
1479
|
+
/** @example Bad request */
|
|
1480
|
+
message?: string;
|
|
1481
|
+
/** @example 400 */
|
|
1482
|
+
statusCode?: number;
|
|
1483
|
+
};
|
|
1484
|
+
};
|
|
1485
|
+
};
|
|
1486
|
+
};
|
|
1487
|
+
};
|
|
1488
|
+
};
|
|
1489
|
+
"/stripe/clientSecret": {
|
|
1490
|
+
/**
|
|
1491
|
+
* Get Stripe client secret
|
|
1492
|
+
* @description Retrieves a Stripe client secret for payment processing using a payment intent ID
|
|
1493
|
+
*/
|
|
1494
|
+
get: {
|
|
1495
|
+
parameters: {
|
|
1496
|
+
query: {
|
|
1497
|
+
/**
|
|
1498
|
+
* @description Stripe payment intent ID to retrieve client secret for
|
|
1499
|
+
* @example pi_3RlHbVJnoDg53PsP1349cXlR
|
|
1500
|
+
*/
|
|
1501
|
+
paymentIntentId: string;
|
|
1502
|
+
};
|
|
1503
|
+
};
|
|
1504
|
+
responses: {
|
|
1505
|
+
/** @description Client secret retrieved successfully */
|
|
1506
|
+
200: {
|
|
1507
|
+
content: {
|
|
1508
|
+
"application/json": {
|
|
1509
|
+
/** @example true */
|
|
1510
|
+
success?: boolean;
|
|
1511
|
+
/** @example Client secret retrieved */
|
|
1512
|
+
message?: string;
|
|
1513
|
+
/**
|
|
1514
|
+
* @description Stripe client secret for the payment intent
|
|
1515
|
+
* @example pi_3RlHbVJnoDg53PsP1349cXlR_secret_084W7pxxba11lTUHWbmeZlXi0
|
|
1516
|
+
*/
|
|
1517
|
+
data?: string;
|
|
1518
|
+
/** @example 200 */
|
|
1519
|
+
statusCode?: number;
|
|
1520
|
+
};
|
|
1521
|
+
};
|
|
1522
|
+
};
|
|
1523
|
+
/** @description Bad request - PaymentIntentId is required or invalid */
|
|
1524
|
+
400: {
|
|
1525
|
+
content: {
|
|
1526
|
+
"application/json": {
|
|
1527
|
+
/** @example false */
|
|
1528
|
+
success?: boolean;
|
|
1529
|
+
/** @example PaymentIntentId is required */
|
|
1530
|
+
message?: string;
|
|
1531
|
+
/** @example 400 */
|
|
1532
|
+
statusCode?: number;
|
|
1533
|
+
};
|
|
1534
|
+
};
|
|
1535
|
+
};
|
|
1536
|
+
};
|
|
1537
|
+
};
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
export type webhooks = Record<string, never>;
|
|
1541
|
+
export interface components {
|
|
1542
|
+
schemas: never;
|
|
1543
|
+
responses: never;
|
|
1544
|
+
parameters: never;
|
|
1545
|
+
requestBodies: never;
|
|
1546
|
+
headers: never;
|
|
1547
|
+
pathItems: never;
|
|
1548
|
+
}
|
|
1549
|
+
export type $defs = Record<string, never>;
|
|
1550
|
+
export type operations = Record<string, never>;
|