@b3dotfun/sdk 0.0.44-alpha.0 → 0.0.44-alpha.2

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 (42) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +12 -13
  2. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +13 -14
  3. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +1 -6
  4. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +2 -2
  5. package/dist/cjs/anyspend/react/components/common/OrderHistoryItem.js +7 -9
  6. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +1 -0
  7. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +3 -3
  8. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +2 -0
  9. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +36 -0
  10. package/dist/cjs/anyspend/types/api.d.ts +189 -10
  11. package/dist/cjs/anyspend/utils/orderPayload.js +0 -4
  12. package/dist/esm/anyspend/react/components/AnySpend.js +13 -14
  13. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +14 -15
  14. package/dist/esm/anyspend/react/components/common/OrderDetails.js +1 -6
  15. package/dist/esm/anyspend/react/components/common/OrderHistory.js +2 -2
  16. package/dist/esm/anyspend/react/components/common/OrderHistoryItem.js +9 -11
  17. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +1 -0
  18. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +3 -3
  19. package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +2 -0
  20. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +36 -0
  21. package/dist/esm/anyspend/types/api.d.ts +189 -10
  22. package/dist/esm/anyspend/utils/orderPayload.js +0 -4
  23. package/dist/styles/index.css +1 -1
  24. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +1 -0
  25. package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +2 -0
  26. package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +36 -0
  27. package/dist/types/anyspend/types/api.d.ts +189 -10
  28. package/package.json +2 -1
  29. package/src/anyspend/react/components/AnySpend.tsx +20 -18
  30. package/src/anyspend/react/components/AnyspendDepositHype.tsx +21 -20
  31. package/src/anyspend/react/components/common/OrderDetails.tsx +1 -7
  32. package/src/anyspend/react/components/common/OrderHistory.tsx +11 -11
  33. package/src/anyspend/react/components/common/OrderHistoryItem.tsx +105 -137
  34. package/src/anyspend/react/hooks/useAnyspendFlow.ts +3 -3
  35. package/src/anyspend/types/api.ts +189 -10
  36. package/src/anyspend/utils/orderPayload.ts +0 -4
  37. package/dist/cjs/anyspend/react/components/common/ErrorSection.d.ts +0 -6
  38. package/dist/cjs/anyspend/react/components/common/ErrorSection.js +0 -12
  39. package/dist/esm/anyspend/react/components/common/ErrorSection.d.ts +0 -6
  40. package/dist/esm/anyspend/react/components/common/ErrorSection.js +0 -9
  41. package/dist/types/anyspend/react/components/common/ErrorSection.d.ts +0 -6
  42. package/src/anyspend/react/components/common/ErrorSection.tsx +0 -21
@@ -5,6 +5,12 @@
5
5
 
6
6
  export interface paths {
7
7
  "/chains/{chainId}/tokens": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
8
14
  /**
9
15
  * Get tokens for a chain
10
16
  * @description Retrieves available tokens for a specific blockchain
@@ -20,6 +26,7 @@ export interface paths {
20
26
  /** @description Maximum number of tokens to return */
21
27
  limit?: number;
22
28
  };
29
+ header?: never;
23
30
  path: {
24
31
  /**
25
32
  * @description Blockchain chain ID
@@ -27,10 +34,15 @@ export interface paths {
27
34
  */
28
35
  chainId: number;
29
36
  };
37
+ cookie?: never;
30
38
  };
39
+ requestBody?: never;
31
40
  responses: {
32
41
  /** @description Tokens retrieved successfully */
33
42
  200: {
43
+ headers: {
44
+ [name: string]: unknown;
45
+ };
34
46
  content: {
35
47
  "application/json": {
36
48
  /** @example true */
@@ -61,6 +73,9 @@ export interface paths {
61
73
  };
62
74
  /** @description Bad request */
63
75
  400: {
76
+ headers: {
77
+ [name: string]: unknown;
78
+ };
64
79
  content: {
65
80
  "application/json": {
66
81
  /** @example false */
@@ -74,8 +89,21 @@ export interface paths {
74
89
  };
75
90
  };
76
91
  };
92
+ put?: never;
93
+ post?: never;
94
+ delete?: never;
95
+ options?: never;
96
+ head?: never;
97
+ patch?: never;
98
+ trace?: never;
77
99
  };
78
100
  "/onramp/coinbase/options": {
101
+ parameters: {
102
+ query?: never;
103
+ header?: never;
104
+ path?: never;
105
+ cookie?: never;
106
+ };
79
107
  /**
80
108
  * Get Coinbase onramp options
81
109
  * @description Retrieves available Coinbase onramp configuration options.
@@ -108,10 +136,17 @@ export interface paths {
108
136
  */
109
137
  chainIds?: string[];
110
138
  };
139
+ header?: never;
140
+ path?: never;
141
+ cookie?: never;
111
142
  };
143
+ requestBody?: never;
112
144
  responses: {
113
145
  /** @description Coinbase options retrieved successfully */
114
146
  200: {
147
+ headers: {
148
+ [name: string]: unknown;
149
+ };
115
150
  content: {
116
151
  "application/json": {
117
152
  /** @example true */
@@ -214,6 +249,9 @@ export interface paths {
214
249
  };
215
250
  /** @description Bad request */
216
251
  400: {
252
+ headers: {
253
+ [name: string]: unknown;
254
+ };
217
255
  content: {
218
256
  "application/json": {
219
257
  /** @example false */
@@ -227,8 +265,21 @@ export interface paths {
227
265
  };
228
266
  };
229
267
  };
268
+ put?: never;
269
+ post?: never;
270
+ delete?: never;
271
+ options?: never;
272
+ head?: never;
273
+ patch?: never;
274
+ trace?: never;
230
275
  };
231
276
  "/onramp/stripe/supported": {
277
+ parameters: {
278
+ query?: never;
279
+ header?: never;
280
+ path?: never;
281
+ cookie?: never;
282
+ };
232
283
  /**
233
284
  * Check Stripe support
234
285
  * @description Checks if Stripe onramp and Stripe Web2 are supported based on IP address location and optional transaction amount
@@ -242,10 +293,17 @@ export interface paths {
242
293
  */
243
294
  usdAmount?: string;
244
295
  };
296
+ header?: never;
297
+ path?: never;
298
+ cookie?: never;
245
299
  };
300
+ requestBody?: never;
246
301
  responses: {
247
302
  /** @description Stripe support status retrieved successfully */
248
303
  200: {
304
+ headers: {
305
+ [name: string]: unknown;
306
+ };
249
307
  content: {
250
308
  "application/json": {
251
309
  /** @example true */
@@ -268,6 +326,9 @@ export interface paths {
268
326
  };
269
327
  /** @description Bad request */
270
328
  400: {
329
+ headers: {
330
+ [name: string]: unknown;
331
+ };
271
332
  content: {
272
333
  "application/json": {
273
334
  /** @example false */
@@ -281,8 +342,21 @@ export interface paths {
281
342
  };
282
343
  };
283
344
  };
345
+ put?: never;
346
+ post?: never;
347
+ delete?: never;
348
+ options?: never;
349
+ head?: never;
350
+ patch?: never;
351
+ trace?: never;
284
352
  };
285
353
  "/orders": {
354
+ parameters: {
355
+ query?: never;
356
+ header?: never;
357
+ path?: never;
358
+ cookie?: never;
359
+ };
286
360
  /**
287
361
  * Get orders by creator
288
362
  * @description Retrieves all orders created by a specific address
@@ -306,10 +380,17 @@ export interface paths {
306
380
  */
307
381
  offset?: string;
308
382
  };
383
+ header?: never;
384
+ path?: never;
385
+ cookie?: never;
309
386
  };
387
+ requestBody?: never;
310
388
  responses: {
311
389
  /** @description Orders retrieved successfully */
312
390
  200: {
391
+ headers: {
392
+ [name: string]: unknown;
393
+ };
313
394
  content: {
314
395
  "application/json": {
315
396
  /** @example true */
@@ -325,6 +406,9 @@ export interface paths {
325
406
  };
326
407
  /** @description Bad request */
327
408
  400: {
409
+ headers: {
410
+ [name: string]: unknown;
411
+ };
328
412
  content: {
329
413
  "application/json": {
330
414
  /** @example false */
@@ -338,11 +422,18 @@ export interface paths {
338
422
  };
339
423
  };
340
424
  };
425
+ put?: never;
341
426
  /**
342
427
  * Create a new order
343
428
  * @description Creates a new order for token transactions across chains
344
429
  */
345
430
  post: {
431
+ parameters: {
432
+ query?: never;
433
+ header?: never;
434
+ path?: never;
435
+ cookie?: never;
436
+ };
346
437
  requestBody: {
347
438
  content: {
348
439
  "application/json": components["schemas"]["OrderRequest"];
@@ -351,6 +442,9 @@ export interface paths {
351
442
  responses: {
352
443
  /** @description Order created successfully */
353
444
  200: {
445
+ headers: {
446
+ [name: string]: unknown;
447
+ };
354
448
  content: {
355
449
  "application/json": {
356
450
  /** @example true */
@@ -365,6 +459,9 @@ export interface paths {
365
459
  };
366
460
  /** @description Bad request */
367
461
  400: {
462
+ headers: {
463
+ [name: string]: unknown;
464
+ };
368
465
  content: {
369
466
  "application/json": {
370
467
  /** @example false */
@@ -378,14 +475,27 @@ export interface paths {
378
475
  };
379
476
  };
380
477
  };
478
+ delete?: never;
479
+ options?: never;
480
+ head?: never;
481
+ patch?: never;
482
+ trace?: never;
381
483
  };
382
484
  "/orders/{orderId}": {
485
+ parameters: {
486
+ query?: never;
487
+ header?: never;
488
+ path?: never;
489
+ cookie?: never;
490
+ };
383
491
  /**
384
492
  * Get order and transactions
385
493
  * @description Retrieves order details along with associated transactions
386
494
  */
387
495
  get: {
388
496
  parameters: {
497
+ query?: never;
498
+ header?: never;
389
499
  path: {
390
500
  /**
391
501
  * @description Unique order identifier
@@ -393,10 +503,15 @@ export interface paths {
393
503
  */
394
504
  orderId: string;
395
505
  };
506
+ cookie?: never;
396
507
  };
508
+ requestBody?: never;
397
509
  responses: {
398
510
  /** @description Order and transactions retrieved successfully */
399
511
  200: {
512
+ headers: {
513
+ [name: string]: unknown;
514
+ };
400
515
  content: {
401
516
  "application/json": {
402
517
  /** @example true */
@@ -435,6 +550,11 @@ export interface paths {
435
550
  executeTx: components["schemas"]["ExecuteTx"] | null;
436
551
  /** @description Refund transactions if order failed */
437
552
  refundTxs: components["schemas"]["RefundTx"][];
553
+ /**
554
+ * @description Points awarded for this order (only present when order status is executed)
555
+ * @example 100
556
+ */
557
+ points: number | null;
438
558
  };
439
559
  /** @example 200 */
440
560
  statusCode: number;
@@ -443,6 +563,9 @@ export interface paths {
443
563
  };
444
564
  /** @description Bad request */
445
565
  400: {
566
+ headers: {
567
+ [name: string]: unknown;
568
+ };
446
569
  content: {
447
570
  "application/json": {
448
571
  /** @example false */
@@ -456,6 +579,9 @@ export interface paths {
456
579
  };
457
580
  /** @description Order not found */
458
581
  404: {
582
+ headers: {
583
+ [name: string]: unknown;
584
+ };
459
585
  content: {
460
586
  "application/json": {
461
587
  /** @example false */
@@ -469,13 +595,34 @@ export interface paths {
469
595
  };
470
596
  };
471
597
  };
598
+ put?: never;
599
+ post?: never;
600
+ delete?: never;
601
+ options?: never;
602
+ head?: never;
603
+ patch?: never;
604
+ trace?: never;
472
605
  };
473
606
  "/orders/quote": {
607
+ parameters: {
608
+ query?: never;
609
+ header?: never;
610
+ path?: never;
611
+ cookie?: never;
612
+ };
613
+ get?: never;
614
+ put?: never;
474
615
  /**
475
616
  * Get anyspend quote
476
617
  * @description Retrieves a quote to swap, execute contract, or participate in HypeDuel
477
618
  */
478
619
  post: {
620
+ parameters: {
621
+ query?: never;
622
+ header?: never;
623
+ path?: never;
624
+ cookie?: never;
625
+ };
479
626
  requestBody: {
480
627
  content: {
481
628
  "application/json":
@@ -675,6 +822,9 @@ export interface paths {
675
822
  responses: {
676
823
  /** @description Quote retrieved successfully */
677
824
  200: {
825
+ headers: {
826
+ [name: string]: unknown;
827
+ };
678
828
  content: {
679
829
  "application/json": {
680
830
  /** @example true */
@@ -853,6 +1003,9 @@ export interface paths {
853
1003
  };
854
1004
  /** @description Bad request */
855
1005
  400: {
1006
+ headers: {
1007
+ [name: string]: unknown;
1008
+ };
856
1009
  content: {
857
1010
  "application/json": {
858
1011
  /** @example false */
@@ -866,8 +1019,19 @@ export interface paths {
866
1019
  };
867
1020
  };
868
1021
  };
1022
+ delete?: never;
1023
+ options?: never;
1024
+ head?: never;
1025
+ patch?: never;
1026
+ trace?: never;
869
1027
  };
870
1028
  "/stripe/clientSecret": {
1029
+ parameters: {
1030
+ query?: never;
1031
+ header?: never;
1032
+ path?: never;
1033
+ cookie?: never;
1034
+ };
871
1035
  /**
872
1036
  * Get Stripe client secret
873
1037
  * @description Retrieves a Stripe client secret for payment processing using a payment intent ID
@@ -881,10 +1045,17 @@ export interface paths {
881
1045
  */
882
1046
  paymentIntentId: string;
883
1047
  };
1048
+ header?: never;
1049
+ path?: never;
1050
+ cookie?: never;
884
1051
  };
1052
+ requestBody?: never;
885
1053
  responses: {
886
1054
  /** @description Client secret retrieved successfully */
887
1055
  200: {
1056
+ headers: {
1057
+ [name: string]: unknown;
1058
+ };
888
1059
  content: {
889
1060
  "application/json": {
890
1061
  /** @example true */
@@ -903,6 +1074,9 @@ export interface paths {
903
1074
  };
904
1075
  /** @description Bad request - PaymentIntentId is required or invalid */
905
1076
  400: {
1077
+ headers: {
1078
+ [name: string]: unknown;
1079
+ };
906
1080
  content: {
907
1081
  "application/json": {
908
1082
  /** @example false */
@@ -916,6 +1090,13 @@ export interface paths {
916
1090
  };
917
1091
  };
918
1092
  };
1093
+ put?: never;
1094
+ post?: never;
1095
+ delete?: never;
1096
+ options?: never;
1097
+ head?: never;
1098
+ patch?: never;
1099
+ trace?: never;
919
1100
  };
920
1101
  }
921
1102
  export type webhooks = Record<string, never>;
@@ -1119,11 +1300,6 @@ export interface components {
1119
1300
  * @example 990000
1120
1301
  */
1121
1302
  expectedDstAmount: string;
1122
- /**
1123
- * @description Actual received amount (null for new orders)
1124
- * @example 990000
1125
- */
1126
- actualDstAmount: string | null;
1127
1303
  };
1128
1304
  /** @description HypeDuel-specific payload */
1129
1305
  HypeDuelPayload: {
@@ -1132,11 +1308,6 @@ export interface components {
1132
1308
  * @example 990000
1133
1309
  */
1134
1310
  expectedDstAmount: string;
1135
- /**
1136
- * @description Actual received amount (null for new orders)
1137
- * @example 990000
1138
- */
1139
- actualDstAmount: string | null;
1140
1311
  };
1141
1312
  /** @description Custom execution payload */
1142
1313
  CustomPayload: {
@@ -1332,6 +1503,14 @@ export interface components {
1332
1503
  * @example pi_3Rko0sJnoDg53PsP0PDLsHkR
1333
1504
  */
1334
1505
  stripePaymentIntentId: string | null;
1506
+ /** @description Settlement information for executed orders */
1507
+ settlement: {
1508
+ /**
1509
+ * @description Actual received amount after execution
1510
+ * @example 990000
1511
+ */
1512
+ actualDstAmount: string | null;
1513
+ } | null;
1335
1514
  };
1336
1515
  SwapOrder: components["schemas"]["BaseOrder"] & {
1337
1516
  /**
@@ -17,8 +17,6 @@ export const buildPayload = (orderType: components["schemas"]["Order"]["type"],
17
17
  case "swap":
18
18
  return {
19
19
  expectedDstAmount,
20
- actualDstAmount: null,
21
- amountInAfterFee: null,
22
20
  };
23
21
  case "mint_nft":
24
22
  if (nft?.type === "erc1155") {
@@ -53,8 +51,6 @@ export const buildPayload = (orderType: components["schemas"]["Order"]["type"],
53
51
  case "hype_duel":
54
52
  return {
55
53
  expectedDstAmount,
56
- actualDstAmount: null,
57
- amountInAfterFee: null,
58
54
  };
59
55
  default:
60
56
  throw new Error(`Invalid order type: ${orderType}`);
@@ -1,6 +0,0 @@
1
- interface ErrorSectionProps {
2
- error?: Error | null;
3
- message?: string;
4
- }
5
- export declare function ErrorSection({ error, message }: ErrorSectionProps): import("react/jsx-runtime").JSX.Element | null;
6
- export {};
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ErrorSection = ErrorSection;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const lucide_react_1 = require("lucide-react");
6
- function ErrorSection({ error, message }) {
7
- if (!error && !message) {
8
- return null;
9
- }
10
- const errorMessage = message || error?.message || "An error occurred";
11
- return ((0, jsx_runtime_1.jsxs)("div", { className: "error-section bg-as-on-surface-1 flex w-full max-w-[460px] items-center gap-2 rounded-2xl px-4 py-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleAlert, { className: "bg-as-red h-4 min-h-4 w-4 min-w-4 rounded-full p-0 text-sm font-medium text-white" }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-red text-sm", children: errorMessage })] }));
12
- }
@@ -1,6 +0,0 @@
1
- interface ErrorSectionProps {
2
- error?: Error | null;
3
- message?: string;
4
- }
5
- export declare function ErrorSection({ error, message }: ErrorSectionProps): import("react/jsx-runtime").JSX.Element | null;
6
- export {};
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CircleAlert } from "lucide-react";
3
- export function ErrorSection({ error, message }) {
4
- if (!error && !message) {
5
- return null;
6
- }
7
- const errorMessage = message || error?.message || "An error occurred";
8
- return (_jsxs("div", { className: "error-section bg-as-on-surface-1 flex w-full max-w-[460px] items-center gap-2 rounded-2xl px-4 py-2", children: [_jsx(CircleAlert, { className: "bg-as-red h-4 min-h-4 w-4 min-w-4 rounded-full p-0 text-sm font-medium text-white" }), _jsx("div", { className: "text-as-red text-sm", children: errorMessage })] }));
9
- }
@@ -1,6 +0,0 @@
1
- interface ErrorSectionProps {
2
- error?: Error | null;
3
- message?: string;
4
- }
5
- export declare function ErrorSection({ error, message }: ErrorSectionProps): import("react/jsx-runtime").JSX.Element | null;
6
- export {};
@@ -1,21 +0,0 @@
1
- import { CircleAlert } from "lucide-react";
2
-
3
- interface ErrorSectionProps {
4
- error?: Error | null;
5
- message?: string;
6
- }
7
-
8
- export function ErrorSection({ error, message }: ErrorSectionProps) {
9
- if (!error && !message) {
10
- return null;
11
- }
12
-
13
- const errorMessage = message || error?.message || "An error occurred";
14
-
15
- return (
16
- <div className="error-section bg-as-on-surface-1 flex w-full max-w-[460px] items-center gap-2 rounded-2xl px-4 py-2">
17
- <CircleAlert className="bg-as-red h-4 min-h-4 w-4 min-w-4 rounded-full p-0 text-sm font-medium text-white" />
18
- <div className="text-as-red text-sm">{errorMessage}</div>
19
- </div>
20
- );
21
- }