@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
@@ -4,6 +4,12 @@
4
4
  */
5
5
  export interface paths {
6
6
  "/chains/{chainId}/tokens": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
7
13
  /**
8
14
  * Get tokens for a chain
9
15
  * @description Retrieves available tokens for a specific blockchain
@@ -19,6 +25,7 @@ export interface paths {
19
25
  /** @description Maximum number of tokens to return */
20
26
  limit?: number;
21
27
  };
28
+ header?: never;
22
29
  path: {
23
30
  /**
24
31
  * @description Blockchain chain ID
@@ -26,10 +33,15 @@ export interface paths {
26
33
  */
27
34
  chainId: number;
28
35
  };
36
+ cookie?: never;
29
37
  };
38
+ requestBody?: never;
30
39
  responses: {
31
40
  /** @description Tokens retrieved successfully */
32
41
  200: {
42
+ headers: {
43
+ [name: string]: unknown;
44
+ };
33
45
  content: {
34
46
  "application/json": {
35
47
  /** @example true */
@@ -60,6 +72,9 @@ export interface paths {
60
72
  };
61
73
  /** @description Bad request */
62
74
  400: {
75
+ headers: {
76
+ [name: string]: unknown;
77
+ };
63
78
  content: {
64
79
  "application/json": {
65
80
  /** @example false */
@@ -73,8 +88,21 @@ export interface paths {
73
88
  };
74
89
  };
75
90
  };
91
+ put?: never;
92
+ post?: never;
93
+ delete?: never;
94
+ options?: never;
95
+ head?: never;
96
+ patch?: never;
97
+ trace?: never;
76
98
  };
77
99
  "/onramp/coinbase/options": {
100
+ parameters: {
101
+ query?: never;
102
+ header?: never;
103
+ path?: never;
104
+ cookie?: never;
105
+ };
78
106
  /**
79
107
  * Get Coinbase onramp options
80
108
  * @description Retrieves available Coinbase onramp configuration options.
@@ -107,10 +135,17 @@ export interface paths {
107
135
  */
108
136
  chainIds?: string[];
109
137
  };
138
+ header?: never;
139
+ path?: never;
140
+ cookie?: never;
110
141
  };
142
+ requestBody?: never;
111
143
  responses: {
112
144
  /** @description Coinbase options retrieved successfully */
113
145
  200: {
146
+ headers: {
147
+ [name: string]: unknown;
148
+ };
114
149
  content: {
115
150
  "application/json": {
116
151
  /** @example true */
@@ -213,6 +248,9 @@ export interface paths {
213
248
  };
214
249
  /** @description Bad request */
215
250
  400: {
251
+ headers: {
252
+ [name: string]: unknown;
253
+ };
216
254
  content: {
217
255
  "application/json": {
218
256
  /** @example false */
@@ -226,8 +264,21 @@ export interface paths {
226
264
  };
227
265
  };
228
266
  };
267
+ put?: never;
268
+ post?: never;
269
+ delete?: never;
270
+ options?: never;
271
+ head?: never;
272
+ patch?: never;
273
+ trace?: never;
229
274
  };
230
275
  "/onramp/stripe/supported": {
276
+ parameters: {
277
+ query?: never;
278
+ header?: never;
279
+ path?: never;
280
+ cookie?: never;
281
+ };
231
282
  /**
232
283
  * Check Stripe support
233
284
  * @description Checks if Stripe onramp and Stripe Web2 are supported based on IP address location and optional transaction amount
@@ -241,10 +292,17 @@ export interface paths {
241
292
  */
242
293
  usdAmount?: string;
243
294
  };
295
+ header?: never;
296
+ path?: never;
297
+ cookie?: never;
244
298
  };
299
+ requestBody?: never;
245
300
  responses: {
246
301
  /** @description Stripe support status retrieved successfully */
247
302
  200: {
303
+ headers: {
304
+ [name: string]: unknown;
305
+ };
248
306
  content: {
249
307
  "application/json": {
250
308
  /** @example true */
@@ -267,6 +325,9 @@ export interface paths {
267
325
  };
268
326
  /** @description Bad request */
269
327
  400: {
328
+ headers: {
329
+ [name: string]: unknown;
330
+ };
270
331
  content: {
271
332
  "application/json": {
272
333
  /** @example false */
@@ -280,8 +341,21 @@ export interface paths {
280
341
  };
281
342
  };
282
343
  };
344
+ put?: never;
345
+ post?: never;
346
+ delete?: never;
347
+ options?: never;
348
+ head?: never;
349
+ patch?: never;
350
+ trace?: never;
283
351
  };
284
352
  "/orders": {
353
+ parameters: {
354
+ query?: never;
355
+ header?: never;
356
+ path?: never;
357
+ cookie?: never;
358
+ };
285
359
  /**
286
360
  * Get orders by creator
287
361
  * @description Retrieves all orders created by a specific address
@@ -305,10 +379,17 @@ export interface paths {
305
379
  */
306
380
  offset?: string;
307
381
  };
382
+ header?: never;
383
+ path?: never;
384
+ cookie?: never;
308
385
  };
386
+ requestBody?: never;
309
387
  responses: {
310
388
  /** @description Orders retrieved successfully */
311
389
  200: {
390
+ headers: {
391
+ [name: string]: unknown;
392
+ };
312
393
  content: {
313
394
  "application/json": {
314
395
  /** @example true */
@@ -324,6 +405,9 @@ export interface paths {
324
405
  };
325
406
  /** @description Bad request */
326
407
  400: {
408
+ headers: {
409
+ [name: string]: unknown;
410
+ };
327
411
  content: {
328
412
  "application/json": {
329
413
  /** @example false */
@@ -337,11 +421,18 @@ export interface paths {
337
421
  };
338
422
  };
339
423
  };
424
+ put?: never;
340
425
  /**
341
426
  * Create a new order
342
427
  * @description Creates a new order for token transactions across chains
343
428
  */
344
429
  post: {
430
+ parameters: {
431
+ query?: never;
432
+ header?: never;
433
+ path?: never;
434
+ cookie?: never;
435
+ };
345
436
  requestBody: {
346
437
  content: {
347
438
  "application/json": components["schemas"]["OrderRequest"];
@@ -350,6 +441,9 @@ export interface paths {
350
441
  responses: {
351
442
  /** @description Order created successfully */
352
443
  200: {
444
+ headers: {
445
+ [name: string]: unknown;
446
+ };
353
447
  content: {
354
448
  "application/json": {
355
449
  /** @example true */
@@ -364,6 +458,9 @@ export interface paths {
364
458
  };
365
459
  /** @description Bad request */
366
460
  400: {
461
+ headers: {
462
+ [name: string]: unknown;
463
+ };
367
464
  content: {
368
465
  "application/json": {
369
466
  /** @example false */
@@ -377,14 +474,27 @@ export interface paths {
377
474
  };
378
475
  };
379
476
  };
477
+ delete?: never;
478
+ options?: never;
479
+ head?: never;
480
+ patch?: never;
481
+ trace?: never;
380
482
  };
381
483
  "/orders/{orderId}": {
484
+ parameters: {
485
+ query?: never;
486
+ header?: never;
487
+ path?: never;
488
+ cookie?: never;
489
+ };
382
490
  /**
383
491
  * Get order and transactions
384
492
  * @description Retrieves order details along with associated transactions
385
493
  */
386
494
  get: {
387
495
  parameters: {
496
+ query?: never;
497
+ header?: never;
388
498
  path: {
389
499
  /**
390
500
  * @description Unique order identifier
@@ -392,10 +502,15 @@ export interface paths {
392
502
  */
393
503
  orderId: string;
394
504
  };
505
+ cookie?: never;
395
506
  };
507
+ requestBody?: never;
396
508
  responses: {
397
509
  /** @description Order and transactions retrieved successfully */
398
510
  200: {
511
+ headers: {
512
+ [name: string]: unknown;
513
+ };
399
514
  content: {
400
515
  "application/json": {
401
516
  /** @example true */
@@ -434,6 +549,11 @@ export interface paths {
434
549
  executeTx: components["schemas"]["ExecuteTx"] | null;
435
550
  /** @description Refund transactions if order failed */
436
551
  refundTxs: components["schemas"]["RefundTx"][];
552
+ /**
553
+ * @description Points awarded for this order (only present when order status is executed)
554
+ * @example 100
555
+ */
556
+ points: number | null;
437
557
  };
438
558
  /** @example 200 */
439
559
  statusCode: number;
@@ -442,6 +562,9 @@ export interface paths {
442
562
  };
443
563
  /** @description Bad request */
444
564
  400: {
565
+ headers: {
566
+ [name: string]: unknown;
567
+ };
445
568
  content: {
446
569
  "application/json": {
447
570
  /** @example false */
@@ -455,6 +578,9 @@ export interface paths {
455
578
  };
456
579
  /** @description Order not found */
457
580
  404: {
581
+ headers: {
582
+ [name: string]: unknown;
583
+ };
458
584
  content: {
459
585
  "application/json": {
460
586
  /** @example false */
@@ -468,13 +594,34 @@ export interface paths {
468
594
  };
469
595
  };
470
596
  };
597
+ put?: never;
598
+ post?: never;
599
+ delete?: never;
600
+ options?: never;
601
+ head?: never;
602
+ patch?: never;
603
+ trace?: never;
471
604
  };
472
605
  "/orders/quote": {
606
+ parameters: {
607
+ query?: never;
608
+ header?: never;
609
+ path?: never;
610
+ cookie?: never;
611
+ };
612
+ get?: never;
613
+ put?: never;
473
614
  /**
474
615
  * Get anyspend quote
475
616
  * @description Retrieves a quote to swap, execute contract, or participate in HypeDuel
476
617
  */
477
618
  post: {
619
+ parameters: {
620
+ query?: never;
621
+ header?: never;
622
+ path?: never;
623
+ cookie?: never;
624
+ };
478
625
  requestBody: {
479
626
  content: {
480
627
  "application/json": {
@@ -668,6 +815,9 @@ export interface paths {
668
815
  responses: {
669
816
  /** @description Quote retrieved successfully */
670
817
  200: {
818
+ headers: {
819
+ [name: string]: unknown;
820
+ };
671
821
  content: {
672
822
  "application/json": {
673
823
  /** @example true */
@@ -846,6 +996,9 @@ export interface paths {
846
996
  };
847
997
  /** @description Bad request */
848
998
  400: {
999
+ headers: {
1000
+ [name: string]: unknown;
1001
+ };
849
1002
  content: {
850
1003
  "application/json": {
851
1004
  /** @example false */
@@ -859,8 +1012,19 @@ export interface paths {
859
1012
  };
860
1013
  };
861
1014
  };
1015
+ delete?: never;
1016
+ options?: never;
1017
+ head?: never;
1018
+ patch?: never;
1019
+ trace?: never;
862
1020
  };
863
1021
  "/stripe/clientSecret": {
1022
+ parameters: {
1023
+ query?: never;
1024
+ header?: never;
1025
+ path?: never;
1026
+ cookie?: never;
1027
+ };
864
1028
  /**
865
1029
  * Get Stripe client secret
866
1030
  * @description Retrieves a Stripe client secret for payment processing using a payment intent ID
@@ -874,10 +1038,17 @@ export interface paths {
874
1038
  */
875
1039
  paymentIntentId: string;
876
1040
  };
1041
+ header?: never;
1042
+ path?: never;
1043
+ cookie?: never;
877
1044
  };
1045
+ requestBody?: never;
878
1046
  responses: {
879
1047
  /** @description Client secret retrieved successfully */
880
1048
  200: {
1049
+ headers: {
1050
+ [name: string]: unknown;
1051
+ };
881
1052
  content: {
882
1053
  "application/json": {
883
1054
  /** @example true */
@@ -896,6 +1067,9 @@ export interface paths {
896
1067
  };
897
1068
  /** @description Bad request - PaymentIntentId is required or invalid */
898
1069
  400: {
1070
+ headers: {
1071
+ [name: string]: unknown;
1072
+ };
899
1073
  content: {
900
1074
  "application/json": {
901
1075
  /** @example false */
@@ -909,6 +1083,13 @@ export interface paths {
909
1083
  };
910
1084
  };
911
1085
  };
1086
+ put?: never;
1087
+ post?: never;
1088
+ delete?: never;
1089
+ options?: never;
1090
+ head?: never;
1091
+ patch?: never;
1092
+ trace?: never;
912
1093
  };
913
1094
  }
914
1095
  export type webhooks = Record<string, never>;
@@ -1112,11 +1293,6 @@ export interface components {
1112
1293
  * @example 990000
1113
1294
  */
1114
1295
  expectedDstAmount: string;
1115
- /**
1116
- * @description Actual received amount (null for new orders)
1117
- * @example 990000
1118
- */
1119
- actualDstAmount: string | null;
1120
1296
  };
1121
1297
  /** @description HypeDuel-specific payload */
1122
1298
  HypeDuelPayload: {
@@ -1125,11 +1301,6 @@ export interface components {
1125
1301
  * @example 990000
1126
1302
  */
1127
1303
  expectedDstAmount: string;
1128
- /**
1129
- * @description Actual received amount (null for new orders)
1130
- * @example 990000
1131
- */
1132
- actualDstAmount: string | null;
1133
1304
  };
1134
1305
  /** @description Custom execution payload */
1135
1306
  CustomPayload: {
@@ -1315,6 +1486,14 @@ export interface components {
1315
1486
  * @example pi_3Rko0sJnoDg53PsP0PDLsHkR
1316
1487
  */
1317
1488
  stripePaymentIntentId: string | null;
1489
+ /** @description Settlement information for executed orders */
1490
+ settlement: {
1491
+ /**
1492
+ * @description Actual received amount after execution
1493
+ * @example 990000
1494
+ */
1495
+ actualDstAmount: string | null;
1496
+ } | null;
1318
1497
  };
1319
1498
  SwapOrder: components["schemas"]["BaseOrder"] & {
1320
1499
  /**
@@ -8,8 +8,6 @@ const buildPayload = (orderType, params) => {
8
8
  case "swap":
9
9
  return {
10
10
  expectedDstAmount,
11
- actualDstAmount: null,
12
- amountInAfterFee: null,
13
11
  };
14
12
  case "mint_nft":
15
13
  if (nft?.type === "erc1155") {
@@ -46,8 +44,6 @@ const buildPayload = (orderType, params) => {
46
44
  case "hype_duel":
47
45
  return {
48
46
  expectedDstAmount,
49
- actualDstAmount: null,
50
- amountInAfterFee: null,
51
47
  };
52
48
  default:
53
49
  throw new Error(`Invalid order type: ${orderType}`);
@@ -6,7 +6,7 @@ import { Button, ShinyButton, StyleRoot, TransitionPanel, useAccountWallet, useP
6
6
  import { cn } from "../../../shared/utils/cn.js";
7
7
  import { formatTokenAmount } from "../../../shared/utils/number.js";
8
8
  import invariant from "invariant";
9
- import { ArrowDown, HistoryIcon } from "lucide-react";
9
+ import { ArrowDown, HistoryIcon, Loader2 } from "lucide-react";
10
10
  import { motion } from "motion/react";
11
11
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
12
12
  import { toast } from "sonner";
@@ -16,7 +16,6 @@ import { AnySpendFingerprintWrapper, getFingerprintConfig } from "./AnySpendFing
16
16
  import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPaymentMethod.js";
17
17
  import { CryptoPaySection } from "./common/CryptoPaySection.js";
18
18
  import { CryptoReceiveSection } from "./common/CryptoReceiveSection.js";
19
- import { ErrorSection } from "./common/ErrorSection.js";
20
19
  import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod.js";
21
20
  import { OrderDetails, OrderDetailsLoadingView } from "./common/OrderDetails.js";
22
21
  import { OrderHistory } from "./common/OrderHistory.js";
@@ -462,38 +461,38 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
462
461
  // Determine button state and text
463
462
  const btnInfo = useMemo(() => {
464
463
  if (activeInputAmountInWei === "0")
465
- return { text: "Enter an amount", disable: true, error: false };
464
+ return { text: "Enter an amount", disable: true, error: false, loading: false };
466
465
  if (isLoadingAnyspendQuote)
467
- return { text: "Loading...", disable: true, error: false };
466
+ return { text: "Loading quote...", disable: true, error: false, loading: true };
468
467
  if (!recipientAddress)
469
- return { text: "Select recipient", disable: false, error: false };
468
+ return { text: "Select recipient", disable: false, error: false, loading: false };
470
469
  if (isCreatingOrder || isCreatingOnrampOrder)
471
- return { text: "Creating order...", disable: true, error: false };
470
+ return { text: "Creating order...", disable: true, error: false, loading: true };
472
471
  if (!anyspendQuote || !anyspendQuote.success)
473
- return { text: "Get rate error", disable: true, error: true };
472
+ return { text: "No quote found", disable: true, error: false, loading: false };
474
473
  if (activeTab === "crypto") {
475
474
  // If no payment method selected, show "Choose payment method"
476
475
  if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.NONE) {
477
- return { text: "Choose payment method", disable: false, error: false };
476
+ return { text: "Choose payment method", disable: false, error: false, loading: false };
478
477
  }
479
478
  // If payment method selected, show appropriate action
480
479
  if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ||
481
480
  selectedCryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET) {
482
- return { text: "Swap", disable: false, error: false };
481
+ return { text: "Swap", disable: false, error: false, loading: false };
483
482
  }
484
483
  if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO) {
485
- return { text: "Continue to payment", disable: false, error: false };
484
+ return { text: "Continue to payment", disable: false, error: false, loading: false };
486
485
  }
487
486
  }
488
487
  if (activeTab === "fiat") {
489
488
  // If no fiat payment method selected, show "Select payment method"
490
489
  if (selectedFiatPaymentMethod === FiatPaymentMethod.NONE) {
491
- return { text: "Select payment method", disable: false, error: false };
490
+ return { text: "Select payment method", disable: false, error: false, loading: false };
492
491
  }
493
492
  // If payment method is selected, show "Buy"
494
- return { text: "Buy", disable: false, error: false };
493
+ return { text: "Buy", disable: false, error: false, loading: false };
495
494
  }
496
- return { text: "Buy", disable: false, error: false };
495
+ return { text: "Buy", disable: false, error: false, loading: false };
497
496
  }, [
498
497
  activeInputAmountInWei,
499
498
  isLoadingAnyspendQuote,
@@ -748,7 +747,7 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
748
747
  }, children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }), activeTab === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: isBuyMode, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward"), dstAmount: dstAmount, dstToken: selectedDstToken, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: setSelectedDstChainId, setSelectedDstToken: setSelectedDstToken, onChangeDstAmount: value => {
749
748
  setIsSrcInputDirty(false);
750
749
  setDstAmount(value);
751
- }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward") }))] }), _jsx(ErrorSection, { error: getAnyspendQuoteError }), _jsxs(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2", getAnyspendQuoteError && "mt-0"), children: [_jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: btnInfo.text }), !hideTransactionHistoryButton && (globalAddress || recipientAddress) ? (_jsxs(Button, { variant: "link", onClick: onClickHistory, className: "text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [_jsx(HistoryIcon, { className: "h-4 w-4" }), " ", _jsx("span", { className: "pr-4", children: "Transaction History" })] })) : null] })] }));
750
+ }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward") }))] }), _jsxs(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: [_jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && _jsx(Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }), !hideTransactionHistoryButton && (globalAddress || recipientAddress) ? (_jsxs(Button, { variant: "link", onClick: onClickHistory, className: "text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [_jsx(HistoryIcon, { className: "h-4 w-4" }), " ", _jsx("span", { className: "pr-4", children: "Transaction History" })] })) : null] })] }));
752
751
  const onrampPaymentView = (_jsx(PanelOnrampPayment, { srcAmountOnRamp: srcAmountOnRamp, recipientName: recipientName || undefined, recipientAddress: recipientAddress, isBuyMode: isBuyMode, destinationTokenChainId: destinationTokenChainId, destinationTokenAddress: destinationTokenAddress, selectedDstChainId: selectedDstChainId, selectedDstToken: selectedDstToken, orderType: "swap", anyspendQuote: anyspendQuote, globalAddress: globalAddress, onOrderCreated: orderId => {
753
752
  setOrderId(orderId);
754
753
  navigateToPanel(PanelView.ORDER_DETAILS, "forward");
@@ -12,12 +12,11 @@ import { AnySpendFingerprintWrapper, getFingerprintConfig } from "./AnySpendFing
12
12
  import { CryptoPaySection } from "./common/CryptoPaySection.js";
13
13
  import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPaymentMethod.js";
14
14
  import { CryptoReceiveSection } from "./common/CryptoReceiveSection.js";
15
- import { ErrorSection } from "./common/ErrorSection.js";
16
15
  import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod.js";
17
16
  import { OrderDetails } from "./common/OrderDetails.js";
18
17
  import { PointsDetailPanel } from "./common/PointsDetailPanel.js";
19
18
  import { RecipientSelection } from "./common/RecipientSelection.js";
20
- import { ArrowDown } from "lucide-react";
19
+ import { ArrowDown, Loader2 } from "lucide-react";
21
20
  import { PanelOnramp } from "./common/PanelOnramp.js";
22
21
  const SLIPPAGE_PERCENT = 3;
23
22
  export const HYPE_TOKEN_DETAILS = {
@@ -44,17 +43,17 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
44
43
  // Button state logic
45
44
  const btnInfo = useMemo(() => {
46
45
  if (activeInputAmountInWei === "0")
47
- return { text: "Enter an amount", disable: true, error: false };
46
+ return { text: "Enter an amount", disable: true, error: false, loading: false };
48
47
  if (isLoadingAnyspendQuote)
49
- return { text: "Loading quote...", disable: true, error: false };
48
+ return { text: "Loading quote...", disable: true, error: false, loading: true };
50
49
  if (isCreatingOrder || isCreatingOnrampOrder)
51
- return { text: "Creating order...", disable: true, error: false };
50
+ return { text: "Creating order...", disable: true, error: false, loading: true };
52
51
  if (!selectedRecipientAddress)
53
- return { text: "Select recipient", disable: false, error: false };
52
+ return { text: "Select recipient", disable: false, error: false, loading: false };
54
53
  if (!anyspendQuote || !anyspendQuote.success)
55
- return { text: "Get quote error", disable: true, error: true };
54
+ return { text: "Get quote error", disable: true, error: true, loading: false };
56
55
  if (!dstAmount)
57
- return { text: "No quote available", disable: true, error: true };
56
+ return { text: "No quote available", disable: true, error: true, loading: false };
58
57
  // Check minimum deposit amount (10 HYPE)
59
58
  // Use the raw amount from the quote instead of the formatted display string
60
59
  if (anyspendQuote.data?.currencyOut?.amount && anyspendQuote.data.currencyOut.currency?.decimals) {
@@ -62,22 +61,22 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
62
61
  const decimals = anyspendQuote.data.currencyOut.currency.decimals;
63
62
  const actualAmount = parseFloat(rawAmountInWei) / Math.pow(10, decimals);
64
63
  if (actualAmount < 10) {
65
- return { text: "Minimum 10 HYPE deposit", disable: true, error: true };
64
+ return { text: "Minimum 10 HYPE deposit", disable: true, error: true, loading: false };
66
65
  }
67
66
  }
68
67
  if (paymentType === "crypto") {
69
68
  if (selectedCryptoPaymentMethod === CryptoPaymentMethodType.NONE) {
70
- return { text: "Choose payment method", disable: false, error: false };
69
+ return { text: "Choose payment method", disable: false, error: false, loading: false };
71
70
  }
72
- return { text: "Continue to deposit", disable: false, error: false };
71
+ return { text: "Continue to deposit", disable: false, error: false, loading: false };
73
72
  }
74
73
  if (paymentType === "fiat") {
75
74
  if (selectedFiatPaymentMethod === FiatPaymentMethod.NONE) {
76
- return { text: "Select payment method", disable: false, error: false };
75
+ return { text: "Select payment method", disable: false, error: false, loading: false };
77
76
  }
78
- return { text: "Buy", disable: false, error: false };
77
+ return { text: "Buy", disable: false, error: false, loading: false };
79
78
  }
80
- return { text: "Continue to deposit", disable: false, error: false };
79
+ return { text: "Continue to deposit", disable: false, error: false, loading: false };
81
80
  }, [
82
81
  activeInputAmountInWei,
83
82
  isLoadingAnyspendQuote,
@@ -115,7 +114,7 @@ function AnySpendDepositHypeInner({ loadOrder, mode = "modal", recipientAddress,
115
114
  const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsx("div", { children: _jsx("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }), _jsx("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: _jsxs("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? (_jsx(CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: selectedCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect })) : (_jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsx(PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: recipientAddress, destinationToken: B3_TOKEN, destinationChainId: base.id, dstTokenSymbol: HYPE_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL), customUsdInputValues: customUsdInputValues }) })), _jsx("div", { className: cn("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: _jsx(Button, { variant: "ghost", className: cn("swap-direction-button border-as-stroke bg-as-surface-primary z-10 h-10 w-10 cursor-default rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl"), children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: true, selectedRecipientAddress: recipientAddress, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: B3_TOKEN, dstTokenSymbol: HYPE_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: HYPE_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: base.id, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, onChangeDstAmount: value => {
116
115
  setIsSrcInputDirty(false);
117
116
  setSrcAmount(value);
118
- }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL) }))] }) }), _jsx(ErrorSection, { error: getAnyspendQuoteError }), _jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2", getAnyspendQuoteError && "mt-0"), children: _jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: btnInfo.text }) }), mainFooter ? mainFooter : null] }));
117
+ }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(PanelView.POINTS_DETAIL) }))] }) }), _jsx(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: _jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && _jsx(Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }) }), mainFooter ? mainFooter : null] }));
119
118
  // Handle crypto order creation
120
119
  const handleCryptoOrder = async () => {
121
120
  try {
@@ -274,12 +274,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
274
274
  ? "0"
275
275
  : order.payload.expectedDstAmount.toString();
276
276
  const formattedExpectedDstAmount = formatTokenAmount(BigInt(expectedDstAmount), dstToken.decimals);
277
- const actualDstAmount = order.type === "mint_nft" ||
278
- order.type === "join_tournament" ||
279
- order.type === "fund_tournament" ||
280
- order.type === "custom"
281
- ? undefined
282
- : order.payload.actualDstAmount;
277
+ const actualDstAmount = order.settlement?.actualDstAmount;
283
278
  const formattedActualDstAmount = actualDstAmount
284
279
  ? formatTokenAmount(BigInt(actualDstAmount), dstToken.decimals)
285
280
  : undefined;