@b3dotfun/sdk 0.0.87-alpha.1 → 0.0.87

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 (90) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -5
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +49 -59
  3. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  4. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +2 -1
  5. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +12 -17
  6. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +0 -2
  7. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +5 -12
  8. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
  9. package/dist/cjs/anyspend/react/components/index.d.ts +0 -2
  10. package/dist/cjs/anyspend/react/components/index.js +1 -3
  11. package/dist/cjs/anyspend/react/hooks/index.d.ts +0 -1
  12. package/dist/cjs/anyspend/react/hooks/index.js +0 -1
  13. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  14. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +11 -35
  15. package/dist/cjs/anyspend/utils/format.js +5 -28
  16. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -4
  17. package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -5
  18. package/dist/esm/anyspend/react/components/AnySpend.js +49 -59
  19. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  20. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +2 -1
  21. package/dist/esm/anyspend/react/components/common/OrderDetails.js +12 -17
  22. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +0 -2
  23. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +5 -12
  24. package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
  25. package/dist/esm/anyspend/react/components/index.d.ts +0 -2
  26. package/dist/esm/anyspend/react/components/index.js +0 -1
  27. package/dist/esm/anyspend/react/hooks/index.d.ts +0 -1
  28. package/dist/esm/anyspend/react/hooks/index.js +0 -1
  29. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  30. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +11 -35
  31. package/dist/esm/anyspend/utils/format.js +5 -28
  32. package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -4
  33. package/dist/styles/index.css +1 -1
  34. package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -5
  35. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  36. package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +0 -2
  37. package/dist/types/anyspend/react/components/index.d.ts +0 -2
  38. package/dist/types/anyspend/react/hooks/index.d.ts +0 -1
  39. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  40. package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -4
  41. package/package.json +1 -1
  42. package/src/anyspend/react/components/AnySpend.tsx +45 -68
  43. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +3 -2
  44. package/src/anyspend/react/components/common/OrderDetails.tsx +8 -26
  45. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +8 -20
  46. package/src/anyspend/react/components/common/OrderStatus.tsx +2 -2
  47. package/src/anyspend/react/components/index.ts +0 -2
  48. package/src/anyspend/react/hooks/index.ts +0 -1
  49. package/src/anyspend/react/hooks/useAnyspendFlow.ts +12 -37
  50. package/src/anyspend/utils/format.ts +5 -33
  51. package/src/global-account/react/stores/useModalStore.ts +0 -4
  52. package/src/styles/index.css +0 -2
  53. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +0 -122
  54. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +0 -190
  55. package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +0 -43
  56. package/dist/cjs/anyspend/react/components/QRDeposit.js +0 -146
  57. package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +0 -32
  58. package/dist/cjs/anyspend/react/components/common/WarningText.js +0 -36
  59. package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.d.ts +0 -6
  60. package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.js +0 -6
  61. package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.d.ts +0 -6
  62. package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.js +0 -6
  63. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +0 -24
  64. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +0 -86
  65. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +0 -122
  66. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +0 -187
  67. package/dist/esm/anyspend/react/components/QRDeposit.d.ts +0 -43
  68. package/dist/esm/anyspend/react/components/QRDeposit.js +0 -143
  69. package/dist/esm/anyspend/react/components/common/WarningText.d.ts +0 -32
  70. package/dist/esm/anyspend/react/components/common/WarningText.js +0 -32
  71. package/dist/esm/anyspend/react/components/icons/CreditCardIcon.d.ts +0 -6
  72. package/dist/esm/anyspend/react/components/icons/CreditCardIcon.js +0 -2
  73. package/dist/esm/anyspend/react/components/icons/QrCodeIcon.d.ts +0 -6
  74. package/dist/esm/anyspend/react/components/icons/QrCodeIcon.js +0 -2
  75. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +0 -24
  76. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +0 -83
  77. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +0 -122
  78. package/dist/types/anyspend/react/components/QRDeposit.d.ts +0 -43
  79. package/dist/types/anyspend/react/components/common/WarningText.d.ts +0 -32
  80. package/dist/types/anyspend/react/components/icons/CreditCardIcon.d.ts +0 -6
  81. package/dist/types/anyspend/react/components/icons/QrCodeIcon.d.ts +0 -6
  82. package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +0 -24
  83. package/src/anyspend/react/components/AnySpendDeposit.tsx +0 -578
  84. package/src/anyspend/react/components/QRDeposit.tsx +0 -348
  85. package/src/anyspend/react/components/common/WarningText.tsx +0 -52
  86. package/src/anyspend/react/components/icons/CreditCardIcon.tsx +0 -25
  87. package/src/anyspend/react/components/icons/QrCodeIcon.tsx +0 -25
  88. package/src/anyspend/react/components/icons/credit-card.svg +0 -5
  89. package/src/anyspend/react/components/icons/qr-code.svg +0 -5
  90. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +0 -110
@@ -20,7 +20,6 @@ export declare enum PanelView {
20
20
  export declare function AnySpend(props: {
21
21
  mode?: "page" | "modal";
22
22
  defaultActiveTab?: "crypto" | "fiat";
23
- sourceChainId?: number;
24
23
  destinationTokenAddress?: string;
25
24
  destinationTokenChainId?: number;
26
25
  recipientAddress?: string;
@@ -35,8 +34,4 @@ export declare function AnySpend(props: {
35
34
  }) => void;
36
35
  onSuccess?: (txHash?: string) => void;
37
36
  customUsdInputValues?: string[];
38
- hideHeader?: boolean;
39
- hideBottomNavigation?: boolean;
40
- /** When true, disables URL parameter management for swap configuration */
41
- disableUrlParamManagement?: boolean;
42
37
  }): import("react/jsx-runtime").JSX.Element;
@@ -57,7 +57,7 @@ function AnySpend(props) {
57
57
  const fingerprintConfig = (0, AnySpendFingerprintWrapper_1.getFingerprintConfig)();
58
58
  return ((0, jsx_runtime_1.jsx)(AnySpendFingerprintWrapper_1.AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: (0, jsx_runtime_1.jsx)(AnySpendInner, { ...props }) }));
59
59
  }
60
- function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, }) {
60
+ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, }) {
61
61
  const searchParams = (0, react_2.useSearchParamsSSR)();
62
62
  const router = (0, react_2.useRouter)();
63
63
  const { partnerId } = (0, react_2.useB3)();
@@ -97,7 +97,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
97
97
  // const [newRecipientAddress, setNewRecipientAddress] = useState("");
98
98
  // const recipientInputRef = useRef<HTMLInputElement>(null);
99
99
  // Get initial chain IDs from URL or defaults
100
- const initialSrcChainId = sourceChainId || parseInt(searchParams.get("fromChainId") || "0") || chains_1.mainnet.id;
100
+ const initialSrcChainId = parseInt(searchParams.get("fromChainId") || "0") || chains_1.mainnet.id;
101
101
  const initialDstChainId = parseInt(searchParams.get("toChainId") || "0") || (isBuyMode ? destinationTokenChainId : chains_1.base.id);
102
102
  // State for source chain/token selection
103
103
  const [selectedSrcChainId, setSelectedSrcChainId] = (0, react_4.useState)(initialSrcChainId);
@@ -190,8 +190,8 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
190
190
  }, [selectedDstToken.address, selectedDstToken.chainId]);
191
191
  // Load swap configuration from URL on initial render
192
192
  (0, react_4.useEffect)(() => {
193
- // Skip if we've already processed the URL, if we have an order to load, or if URL param management is disabled
194
- if (initialUrlProcessed.current || loadOrder || disableUrlParamManagement)
193
+ // Skip if we've already processed the URL or if we have an order to load
194
+ if (initialUrlProcessed.current || loadOrder)
195
195
  return;
196
196
  try {
197
197
  const tabParam = searchParams.get("tab");
@@ -224,7 +224,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
224
224
  }
225
225
  // Mark that we've processed the initial URL
226
226
  initialUrlProcessed.current = true;
227
- }, [searchParams, loadOrder, disableUrlParamManagement]);
227
+ }, [searchParams, loadOrder]);
228
228
  // Update URL when swap configuration changes - but not on initial load
229
229
  const updateSwapParamsInURL = (0, react_4.useCallback)(() => {
230
230
  // Skip if:
@@ -235,8 +235,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
235
235
  activePanel !== PanelView.MAIN ||
236
236
  !initialUrlProcessed.current ||
237
237
  searchParams.has("orderId") ||
238
- mode === "modal" ||
239
- disableUrlParamManagement)
238
+ mode === "modal")
240
239
  return;
241
240
  // Create a representation of the current state
242
241
  const currentState = {
@@ -296,7 +295,6 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
296
295
  dstAmount,
297
296
  router,
298
297
  srcAmountOnRamp,
299
- disableUrlParamManagement,
300
298
  ]);
301
299
  // Update URL when relevant state changes - but only after initial render
302
300
  (0, react_4.useEffect)(() => {
@@ -482,20 +480,20 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
482
480
  setOrderId(orderId);
483
481
  // setNewRecipientAddress("");
484
482
  navigateToPanel(PanelView.ORDER_DETAILS, "forward");
485
- if (!disableUrlParamManagement) {
486
- // Debug: Check payment method before setting URL
487
- console.log("Creating order - selectedCryptoPaymentMethod:", selectedCryptoPaymentMethod);
488
- // Add orderId and payment method to URL for persistence
489
- const params = new URLSearchParams(searchParams.toString()); // Preserve existing params
490
- params.set("orderId", orderId);
491
- if (effectiveCryptoPaymentMethod !== CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE) {
492
- params.set("cryptoPaymentMethod", effectiveCryptoPaymentMethod);
493
- }
494
- else {
495
- console.log("Payment method is NONE, not setting in URL");
496
- }
497
- router.push(`${window.location.pathname}?${params.toString()}`);
483
+ // Debug: Check payment method before setting URL
484
+ console.log("Creating order - selectedCryptoPaymentMethod:", selectedCryptoPaymentMethod);
485
+ // Add orderId and payment method to URL for persistence
486
+ const params = new URLSearchParams(searchParams.toString()); // Preserve existing params
487
+ params.set("orderId", orderId);
488
+ if (effectiveCryptoPaymentMethod !== CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE) {
489
+ console.log("Setting cryptoPaymentMethod in URL:", effectiveCryptoPaymentMethod);
490
+ params.set("cryptoPaymentMethod", effectiveCryptoPaymentMethod);
491
+ }
492
+ else {
493
+ console.log("Payment method is NONE, not setting in URL");
498
494
  }
495
+ console.log("Final URL params:", params.toString());
496
+ router.push(`${window.location.pathname}?${params.toString()}`);
499
497
  },
500
498
  onError: error => {
501
499
  console.error(error);
@@ -508,13 +506,11 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
508
506
  const orderId = data.data.id;
509
507
  setOrderId(orderId);
510
508
  navigateToPanel(PanelView.ORDER_DETAILS, "forward");
511
- if (!disableUrlParamManagement) {
512
- // Add orderId and payment method to URL for persistence
513
- const params = new URLSearchParams(searchParams.toString());
514
- params.set("orderId", orderId);
515
- params.set("paymentMethod", "fiat");
516
- router.push(`${window.location.pathname}?${params.toString()}`);
517
- }
509
+ // Add orderId and payment method to URL for persistence
510
+ const params = new URLSearchParams(searchParams.toString());
511
+ params.set("orderId", orderId);
512
+ params.set("paymentMethod", "fiat");
513
+ router.push(`${window.location.pathname}?${params.toString()}`);
518
514
  },
519
515
  onError: error => {
520
516
  console.error(error);
@@ -642,13 +638,11 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
642
638
  type: "anySpendOrderHistory",
643
639
  showBackButton: false,
644
640
  });
645
- if (!disableUrlParamManagement) {
646
- // Remove orderId and paymentMethod from URL when going back to history
647
- const params = new URLSearchParams(searchParams.toString());
648
- params.delete("orderId");
649
- params.delete("paymentMethod");
650
- router.push(`${window.location.pathname}?${params.toString()}`);
651
- }
641
+ // Remove orderId and paymentMethod from URL when going back to history
642
+ const params = new URLSearchParams(searchParams.toString());
643
+ params.delete("orderId");
644
+ params.delete("paymentMethod");
645
+ router.push(`${window.location.pathname}?${params.toString()}`);
652
646
  };
653
647
  // Handle crypto swap creation
654
648
  const handleCryptoSwap = async (method) => {
@@ -757,24 +751,22 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
757
751
  // const setDynamicModalContentType = useModalStore(state => state.setB3ModalContentType);
758
752
  // Update useEffect for URL parameter to not override loadOrder
759
753
  (0, react_4.useEffect)(() => {
760
- if (loadOrder || disableUrlParamManagement)
761
- return; // Skip if we have a loadOrder or URL param management is disabled
754
+ if (loadOrder)
755
+ return; // Skip if we have a loadOrder
762
756
  const orderIdParam = searchParams.get("orderId");
763
757
  if (orderIdParam) {
764
758
  setOrderId(orderIdParam);
765
759
  setActivePanel(PanelView.ORDER_DETAILS);
766
760
  }
767
- }, [searchParams, loadOrder, disableUrlParamManagement]);
761
+ }, [searchParams, loadOrder]);
768
762
  const onSelectOrder = (selectedOrderId) => {
769
763
  setOrderId(selectedOrderId);
770
764
  navigateToPanel(PanelView.ORDER_DETAILS, "forward");
771
- if (!disableUrlParamManagement) {
772
- // Update URL with the new orderId and preserve existing parameters
773
- const params = new URLSearchParams(searchParams.toString());
774
- params.set("orderId", selectedOrderId);
775
- // Keep existing paymentMethod if present
776
- router.push(`${window.location.pathname}?${params.toString()}`);
777
- }
765
+ // Update URL with the new orderId and preserve existing parameters
766
+ const params = new URLSearchParams(searchParams.toString());
767
+ params.set("orderId", selectedOrderId);
768
+ // Keep existing paymentMethod if present
769
+ router.push(`${window.location.pathname}?${params.toString()}`);
778
770
  };
779
771
  // Save custom recipients to local storage when they change
780
772
  (0, react_4.useEffect)(() => {
@@ -826,7 +818,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
826
818
  // Reset payment methods when going back
827
819
  resetPaymentMethods();
828
820
  } })) }) }));
829
- const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2 pt-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && !hideHeader && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), (0, jsx_runtime_1.jsx)(TabSection_1.TabSection, { activeTab: activeTab, setActiveTab: tab => {
821
+ const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2 pt-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), (0, jsx_runtime_1.jsx)(TabSection_1.TabSection, { activeTab: activeTab, setActiveTab: tab => {
830
822
  setActiveTab(tab);
831
823
  // Reset payment methods when switching tabs
832
824
  resetPaymentMethods();
@@ -881,23 +873,21 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
881
873
  type: "anySpend",
882
874
  });
883
875
  }
884
- }, children: mode !== "page" && !hideBottomNavigation && (0, jsx_runtime_1.jsx)(BottomNavigation_1.default, {}) }) })] }));
876
+ }, children: mode !== "page" && (0, jsx_runtime_1.jsx)(BottomNavigation_1.default, {}) }) })] }));
885
877
  const onrampPaymentView = ((0, jsx_runtime_1.jsx)(PanelOnrampPayment_1.PanelOnrampPayment, { srcAmountOnRamp: srcAmountOnRamp, recipientName: recipientName || undefined, recipientAddress: effectiveRecipientAddress, isBuyMode: isBuyMode, destinationTokenChainId: destinationTokenChainId, destinationTokenAddress: destinationTokenAddress, selectedDstChainId: selectedDstChainId, selectedDstToken: selectedDstToken, orderType: "swap", anyspendQuote: anyspendQuote, globalAddress: globalAddress, onOrderCreated: orderId => {
886
878
  setOrderId(orderId);
887
879
  navigateToPanel(PanelView.ORDER_DETAILS, "forward");
888
- if (!disableUrlParamManagement) {
889
- // Add orderId and payment method to URL for persistence
890
- const params = new URLSearchParams(searchParams.toString()); // Preserve existing params
891
- params.set("orderId", orderId);
892
- // For fiat payments, the payment method is always fiat (but we use the active tab context)
893
- if (activeTab === "fiat") {
894
- params.set("paymentMethod", "fiat");
895
- }
896
- else if (selectedCryptoPaymentMethod !== CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE) {
897
- params.set("paymentMethod", selectedCryptoPaymentMethod);
898
- }
899
- router.push(`${window.location.pathname}?${params.toString()}`);
880
+ // Add orderId and payment method to URL for persistence
881
+ const params = new URLSearchParams(searchParams.toString()); // Preserve existing params
882
+ params.set("orderId", orderId);
883
+ // For fiat payments, the payment method is always fiat (but we use the active tab context)
884
+ if (activeTab === "fiat") {
885
+ params.set("paymentMethod", "fiat");
886
+ }
887
+ else if (selectedCryptoPaymentMethod !== CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE) {
888
+ params.set("paymentMethod", selectedCryptoPaymentMethod);
900
889
  }
890
+ router.push(`${window.location.pathname}?${params.toString()}`);
901
891
  }, onBack: navigateBack, recipientEnsName: globalWallet?.ensName, recipientImageUrl: globalWalletImage }));
902
892
  const recipientSelectionView = ((0, jsx_runtime_1.jsx)(RecipientSelection_1.RecipientSelection, { initialValue: effectiveRecipientAddress || "", onBack: navigateBack, onConfirm: address => {
903
893
  // User manually selected a recipient
@@ -26,7 +26,7 @@ export interface AnySpendCustomExactInProps {
26
26
  customUsdInputValues?: string[];
27
27
  preferEoa?: boolean;
28
28
  customExactInConfig?: CustomExactInConfig;
29
- orderType?: "hype_duel" | "custom_exact_in" | "swap";
29
+ orderType?: "hype_duel" | "custom_exact_in";
30
30
  minDestinationAmount?: number;
31
31
  header?: ({ anyspendPrice, isLoadingAnyspendPrice, }: {
32
32
  anyspendPrice: GetQuoteResponse | undefined;
@@ -41,6 +41,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
41
41
  paymentType,
42
42
  recipientAddress,
43
43
  loadOrder,
44
+ isDepositMode: true,
44
45
  onTransactionSuccess: onSuccess,
45
46
  sourceTokenAddress,
46
47
  sourceTokenChainId,
@@ -181,7 +182,7 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
181
182
  }
182
183
  };
183
184
  const headerContent = header ? (header({ anyspendPrice: anyspendQuote, isLoadingAnyspendPrice: isLoadingAnyspendQuote })) : ((0, jsx_runtime_1.jsx)("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-as-primary text-xl font-bold", children: actionLabel }), (0, jsx_runtime_1.jsx)("p", { className: "text-as-secondary text-sm", children: "Pay from any token to execute a custom exact-in transaction." })] }) }));
184
- const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-custom-exact-in-container mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [headerContent, (0, jsx_runtime_1.jsx)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? ((0, jsx_runtime_1.jsx)(CryptoPaySection_1.CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, isSrcInputDirty: isSrcInputDirty, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(useAnyspendFlow_1.PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect })) : ((0, jsx_runtime_1.jsx)(react_2.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: (0, jsx_runtime_1.jsx)(PanelOnramp_1.PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: selectedRecipientOrDefault, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: useAnyspendFlow_1.PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.FEE_DETAIL), customUsdInputValues: customUsdInputValues }) })), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "ghost", className: (0, cn_1.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: (0, jsx_runtime_1.jsx)("div", { className: "relative flex items-center justify-center transition-opacity", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && ((0, jsx_runtime_1.jsx)(CryptoReceiveSection_1.CryptoReceiveSection, { isDepositMode: false, isBuyMode: true, effectiveRecipientAddress: selectedRecipientOrDefault, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: selectedDstToken, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: DESTINATION_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
185
+ const mainView = ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2", children: [headerContent, (0, jsx_runtime_1.jsx)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2", children: [paymentType === "crypto" ? ((0, jsx_runtime_1.jsx)(CryptoPaySection_1.CryptoPaySection, { selectedSrcChainId: selectedSrcChainId, setSelectedSrcChainId: setSelectedSrcChainId, selectedSrcToken: selectedSrcToken, setSelectedSrcToken: setSelectedSrcToken, srcAmount: srcAmount, setSrcAmount: setSrcAmount, isSrcInputDirty: isSrcInputDirty, setIsSrcInputDirty: setIsSrcInputDirty, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod, onSelectCryptoPaymentMethod: () => setActivePanel(useAnyspendFlow_1.PanelView.CRYPTO_PAYMENT_METHOD), anyspendQuote: anyspendQuote, onTokenSelect: onTokenSelect })) : ((0, jsx_runtime_1.jsx)(react_2.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: (0, jsx_runtime_1.jsx)(PanelOnramp_1.PanelOnramp, { srcAmountOnRamp: srcAmount, setSrcAmountOnRamp: setSrcAmount, selectedPaymentMethod: selectedFiatPaymentMethod, setActivePanel: setActivePanel, _recipientAddress: selectedRecipientOrDefault, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, hideDstToken: true, destinationAmount: dstAmount, onDestinationTokenChange: () => { }, onDestinationChainChange: () => { }, fiatPaymentMethodIndex: useAnyspendFlow_1.PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.FEE_DETAIL), customUsdInputValues: customUsdInputValues }) })), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("relative -my-1 flex h-0 items-center justify-center", paymentType === "fiat" && "hidden"), children: (0, jsx_runtime_1.jsx)(react_1.Button, { variant: "ghost", className: (0, cn_1.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: (0, jsx_runtime_1.jsx)("div", { className: "relative flex items-center justify-center transition-opacity", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) }), paymentType === "crypto" && ((0, jsx_runtime_1.jsx)(CryptoReceiveSection_1.CryptoReceiveSection, { isDepositMode: false, isBuyMode: true, effectiveRecipientAddress: selectedRecipientOrDefault, recipientName: recipientName || undefined, onSelectRecipient: () => setActivePanel(useAnyspendFlow_1.PanelView.RECIPIENT_SELECTION), dstAmount: dstAmount, dstToken: selectedDstToken, dstTokenSymbol: DESTINATION_TOKEN_DETAILS.SYMBOL, dstTokenLogoURI: DESTINATION_TOKEN_DETAILS.LOGO_URI, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: () => { }, setSelectedDstToken: () => { }, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
185
186
  setIsSrcInputDirty(false);
186
187
  setSrcAmount(value);
187
188
  }, anyspendQuote: anyspendQuote, onShowPointsDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.POINTS_DETAIL), onShowFeeDetail: () => setActivePanel(useAnyspendFlow_1.PanelView.FEE_DETAIL) }))] }) }), (0, jsx_runtime_1.jsx)(react_2.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: (0, cn_1.cn)("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (0, cn_1.cn)("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: (0, cn_1.cn)(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }) }), mainFooter ? mainFooter : null] }));
@@ -37,7 +37,6 @@ function getOrderSuccessText({ order, tournament, formattedActualDstAmount, form
37
37
  let actionText = "";
38
38
  switch (order.type) {
39
39
  case "swap":
40
- case "deposit_first":
41
40
  actionText = `sent ${formattedActualDstAmount || "--"} ${dstToken.symbol}`;
42
41
  return `Successfully ${actionText} to ${recipient}`;
43
42
  case "mint_nft":
@@ -159,7 +158,6 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
159
158
  const { data: walletClient } = (0, wagmi_1.useWalletClient)();
160
159
  const [txHash, setTxHash] = (0, react_5.useState)();
161
160
  const [showQRCode, setShowQRCode] = (0, react_5.useState)(false);
162
- const [orderDetailsOpen, setOrderDetailsOpen] = (0, react_5.useState)(true);
163
161
  const { isLoading: txLoading, isSuccess: txSuccess } = (0, wagmi_1.useWaitForTransactionReceipt)({ hash: txHash });
164
162
  const { switchChainAndExecuteWithEOA, switchChainAndExecute, isSwitchingOrExecuting } = (0, react_1.useUnifiedChainSwitchAndExecute)();
165
163
  // Track if auto-payment was attempted to avoid re-triggering
@@ -328,8 +326,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
328
326
  const expectedDstAmount = order.type === "mint_nft" ||
329
327
  order.type === "join_tournament" ||
330
328
  order.type === "fund_tournament" ||
331
- order.type === "custom" ||
332
- order.type === "deposit_first"
329
+ order.type === "custom"
333
330
  ? "0"
334
331
  : order.payload.expectedDstAmount.toString();
335
332
  const formattedExpectedDstAmount = (0, number_1.formatTokenAmount)(BigInt(expectedDstAmount), dstToken.decimals);
@@ -338,7 +335,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
338
335
  ? (0, number_1.formatTokenAmount)(BigInt(actualDstAmount), dstToken.decimals)
339
336
  : undefined;
340
337
  if (refundTxs.length > 0) {
341
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "refund-details", className: "order-details-refund-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
338
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "refund-details", className: "order-details-refund-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
342
339
  ? depositTxs.map(dTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
343
340
  ? `Received payment`
344
341
  : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
@@ -347,13 +344,13 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
347
344
  : null] }) })] }) }), order.errorDetails && ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: (0, anyspend_1.getErrorDisplay)(order.errorDetails) }) })), (0, jsx_runtime_1.jsx)("button", { className: "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Return to Home ", (0, jsx_runtime_1.jsx)(lucide_react_1.Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") })] }));
348
345
  }
349
346
  if (executeTx) {
350
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "execute-details", className: "order-details-execute-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
347
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "execute-details", className: "order-details-execute-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
351
348
  ? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
352
349
  ? `Received payment`
353
350
  : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
354
351
  : null, relayTxs
355
- ? relayTxs.map(relayTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: "Processed Swap", chainId: relayTx.chain, tx: relayTx, delay: 0.5, isProcessing: false }, relayTx.txHash)))
356
- : null, (0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap" || order.type === "deposit_first"
352
+ ? relayTxs.map(relayTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: "Processed Transaction", chainId: relayTx.chain, tx: relayTx, delay: 0.5, isProcessing: false }, relayTx.txHash)))
353
+ : null, (0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
357
354
  ? "Processed Swap"
358
355
  : order.type === "mint_nft"
359
356
  ? "Minted NFT"
@@ -372,14 +369,12 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
372
369
  }), (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && ((0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4", children: "Continue to Tournament" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && ((0, jsx_runtime_1.jsx)("button", { className: "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Return to Home ", (0, jsx_runtime_1.jsx)(lucide_react_1.Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
373
370
  }
374
371
  if (relayTxs.length > 0 && relayTxs.every(tx => tx.status === "success")) {
375
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "more-details", className: "order-details-more-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "More Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
372
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "more-details", className: "order-details-more-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "More Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-border-primary absolute left-[2px] top-0 z-10 w-[3px]", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
376
373
  ? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
377
374
  ? `Received payment`
378
375
  : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
379
- : null, relayTxs.map(relayTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: relayTx.chain === order.srcChain
380
- ? `Process swap on ${(0, anyspend_1.getChainName)(relayTx.chain)}`
381
- : `Received on ${(0, anyspend_1.getChainName)(relayTx.chain)}`, chainId: relayTx.chain, isProcessing: false, tx: relayTx, delay: 0.5 }, relayTx.txHash))), order.status === "executing" && ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap" || order.type === "x402_swap" || order.type === "deposit_first"
382
- ? "Processing swap"
376
+ : null, relayTxs.map(relayTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: "Processed Transaction", chainId: relayTx.chain, isProcessing: false, tx: relayTx, delay: 0.5 }))), order.status === "executing" && ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap" || order.type === "x402_swap"
377
+ ? "Processing Swap"
383
378
  : order.type === "mint_nft"
384
379
  ? "Minting NFT"
385
380
  : order.type === "join_tournament"
@@ -395,10 +390,10 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
395
390
  // This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
396
391
  const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
397
392
  if (depositTxs?.length || waitingForDeposit) {
398
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "deposit-details", className: "order-details-deposit-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1, ease: "easeInOut" } }) }), (depositTxs || []).map((dTxs, index) => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
393
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points }), (0, jsx_runtime_1.jsx)(Accordion_1.Accordion, { type: "single", collapsible: true, className: "order-details-accordion w-full", children: (0, jsx_runtime_1.jsxs)(Accordion_1.AccordionItem, { value: "deposit-details", className: "order-details-deposit-item", children: [(0, jsx_runtime_1.jsx)(Accordion_1.AccordionTrigger, { className: "accordion-trigger", children: "Transaction Details" }), (0, jsx_runtime_1.jsx)(Accordion_1.AccordionContent, { className: "accordion-content pl-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: (0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1, ease: "easeInOut" } }) }), (depositTxs || []).map((dTxs, index) => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
399
394
  ? `Received payment`
400
- : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap" || order.type === "deposit_first"
401
- ? "Processing swap"
395
+ : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.type === "swap"
396
+ ? "Processing Swap"
402
397
  : order.type === "mint_nft"
403
398
  ? "Minting NFT"
404
399
  : order.type === "join_tournament"
@@ -422,7 +417,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
422
417
  ? (0, centerTruncate_1.default)(phantomWalletAddress, 6)
423
418
  : (0, centerTruncate_1.default)(account?.address || "", 6)] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsxs)(react_1.ShinyButton, { accentColor: colorMode === "dark" ? "#ffffff" : "#000000", className: "flex w-5/6 items-center gap-2 sm:px-0", onClick: () => setShowQRCode(true), children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4 text-lg md:text-sm", children: "Pay from a different wallet" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_3.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletTrust, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletWalletConnect, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)("span", { className: "label-style text-as-primary/30 text-xs", children: "& more" })] })] })] }) })) : (
424
419
  // Default case - existing QR code flow
425
- (0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-qr-container mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [(0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: (0, anyspend_1.getPaymentUrl)(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === anyspend_1.ZERO_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "order-details-qr-code max-w-[200px]" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-qr-wallets mt-3 flex items-center justify-center gap-2 text-sm", children: [(0, jsx_runtime_1.jsx)("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), (0, jsx_runtime_1.jsxs)(react_1.TextLoop, { interval: 3, children: [(0, jsx_runtime_1.jsx)(react_3.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-time-remaining flex w-full items-center justify-center gap-1 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/30 order-details-time-label", children: "Time remaining:" }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary order-details-time-value", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : ((0, jsx_runtime_1.jsx)(react_timeago_1.default, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && ((0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen })), (0, jsx_runtime_1.jsxs)("button", { className: "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
420
+ (0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-qr-container mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [(0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: (0, anyspend_1.getPaymentUrl)(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === anyspend_1.ZERO_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "order-details-qr-code max-w-[200px]" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-qr-wallets mt-3 flex items-center justify-center gap-2 text-sm", children: [(0, jsx_runtime_1.jsx)("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), (0, jsx_runtime_1.jsxs)(react_1.TextLoop, { interval: 3, children: [(0, jsx_runtime_1.jsx)(react_3.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_3.WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-time-remaining flex w-full items-center justify-center gap-1 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/30 order-details-time-label", children: "Time remaining:" }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary order-details-time-value", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : ((0, jsx_runtime_1.jsx)(react_timeago_1.default, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && ((0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points })), (0, jsx_runtime_1.jsxs)("button", { className: "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
426
421
  });
427
422
  function TransactionDetails({ title, chainId, tx, isProcessing, delay, }) {
428
423
  return ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-transaction-item relative flex w-full flex-1 items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-details-transaction-content flex grow items-center gap-4", children: [(0, jsx_runtime_1.jsx)(react_4.motion.div, { className: "bg-as-surface-secondary relative h-10 w-10 rounded-full", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeInOut", delay }, className: "border-as-border-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border-2 shadow-lg backdrop-blur-sm", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }) })) : ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeOut", delay }, className: "bg-as-success-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border border-white/30 shadow-lg backdrop-blur-sm", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckIcon, { className: "text-as-content-icon-success h-4 w-4" }) })) }), (0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay }, className: "shrink-0 text-base", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_1.TextShimmer, { duration: 1, children: title })) : ((0, jsx_runtime_1.jsx)("span", { className: "text-as-primary", children: title })) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-1", children: tx ? ((0, jsx_runtime_1.jsx)(react_4.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay: (delay || 0) + 0.3 }, className: "flex items-center gap-3", children: (0, jsx_runtime_1.jsx)("a", { href: (0, anyspend_1.getExplorerTxUrl)(chainId, tx.txHash), target: "_blank", children: (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/30 font-mono text-xs", children: (0, centerTruncate_1.default)(tx?.txHash, 6) }) }) })) : null })] }));
@@ -14,8 +14,6 @@ interface OrderDetailsCollapsibleProps {
14
14
  showTotal?: boolean;
15
15
  totalAmount?: string;
16
16
  points?: number;
17
- isOpen?: boolean;
18
- onOpenChange?: (isOpen: boolean) => void;
19
17
  }
20
18
  export declare const OrderDetailsCollapsible: import("react").NamedExoticComponent<OrderDetailsCollapsibleProps>;
21
19
  export {};
@@ -16,26 +16,19 @@ const lucide_react_1 = require("lucide-react");
16
16
  const react_2 = require("motion/react");
17
17
  const react_3 = require("react");
18
18
  const chains_1 = require("viem/chains");
19
- exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollapsible({ order, dstToken, tournament, nft, recipientName, formattedExpectedDstAmount, className, showTotal = false, totalAmount, points, isOpen, onOpenChange, }) {
20
- const [internalOpen, setInternalOpen] = (0, react_3.useState)(true);
21
- // Use controlled mode if isOpen is provided, otherwise use internal state
22
- const showOrderDetails = isOpen !== undefined ? isOpen : internalOpen;
23
- const setShowOrderDetails = onOpenChange || setInternalOpen;
19
+ exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollapsible({ order, dstToken, tournament, nft, recipientName, formattedExpectedDstAmount, className, showTotal = false, totalAmount, points, }) {
20
+ const [showOrderDetails, setShowOrderDetails] = (0, react_3.useState)(true);
24
21
  // Calculate expected amount if not provided
25
22
  const expectedDstAmount = order.type === "mint_nft" ||
26
23
  order.type === "join_tournament" ||
27
24
  order.type === "fund_tournament" ||
28
- order.type === "custom" ||
29
- order.type === "deposit_first"
25
+ order.type === "custom"
30
26
  ? "0"
31
27
  : order.payload.expectedDstAmount.toString();
32
28
  const finalFormattedExpectedDstAmount = formattedExpectedDstAmount || (0, number_1.formatTokenAmount)(BigInt(expectedDstAmount), dstToken.decimals);
33
29
  return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("order-details-collapsible bg-as-surface-secondary border-as-border-secondary rounded-xl border px-4 py-2", className), children: showOrderDetails ? ((0, jsx_runtime_1.jsx)(react_2.motion.div, { className: "order-details-expanded w-full", 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: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-content flex w-full flex-col items-center gap-3 whitespace-nowrap py-2 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-details-recipient-section flex w-full justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-recipient-label text-as-tertiarry", children: "Recipient" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-recipient-info flex flex-col items-end gap-1", children: [recipientName && ((0, jsx_runtime_1.jsx)("div", { className: "order-details-recipient-name text-as-primary font-semibold", children: recipientName })), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: order.recipientAddress, onCopy: () => {
34
30
  react_1.toast.success("Copied recipient address to clipboard");
35
- }, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-recipient-address text-as-primary flex items-center gap-2", children: [(0, centerTruncate_1.default)(order.recipientAddress, 10), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "order-details-recipient-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 cursor-pointer transition-all duration-200" })] }) })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-expected-section flex w-full items-start justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-expected-label text-as-tertiarry shrink-0", children: order.type === "swap" ||
36
- order.type === "deposit_first" ||
37
- order.type === "mint_nft" ||
38
- order.type === "hype_duel"
31
+ }, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-recipient-address text-as-primary flex items-center gap-2", children: [(0, centerTruncate_1.default)(order.recipientAddress, 10), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "order-details-recipient-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 cursor-pointer transition-all duration-200" })] }) })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-expected-section flex w-full items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-expected-label text-as-tertiarry", children: order.type === "swap" || order.type === "mint_nft" || order.type === "hype_duel"
39
32
  ? "Expected to receive"
40
33
  : order.type === "join_tournament"
41
34
  ? "Join tournament"
@@ -45,5 +38,5 @@ exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollaps
45
38
  ? order.metadata.action
46
39
  ? (0, anyspend_1.capitalizeFirstLetter)(order.metadata.action)
47
40
  : "Contract execution"
48
- : "" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-expected-value flex flex-wrap items-center justify-end gap-2", children: [order.type === "swap" || order.type === "deposit_first" ? ((0, jsx_runtime_1.jsx)("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : order.type === "mint_nft" ? ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-nft-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: nft?.imageUrl, alt: nft?.name || "NFT", className: "order-details-nft-image h-5 w-5" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-nft-name", children: nft?.name || "NFT" })] })) : order.type === "join_tournament" || order.type === "fund_tournament" ? ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-tournament-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: tournament?.imageUrl, alt: tournament?.name || "Tournament", className: "order-details-tournament-image h-5 w-5" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-tournament-name", children: tournament?.name || "Tournament" })] })) : order.type === "hype_duel" ? ((0, jsx_runtime_1.jsx)("div", { className: "order-details-hype-info flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-hype-amount", children: [(0, number_1.formatTokenAmount)(BigInt(order.payload.expectedDstAmount), dstToken.decimals), " HYPE"] }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "order-details-chain-info text-as-primary/50 flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "order-details-chain-text", children: ["on ", order.dstChain !== chains_1.b3.id && (0, anyspend_1.getChainName)(order.dstChain)] }), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.dstChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.dstChain), className: (0, utils_1.cn)("order-details-chain-logo h-3", order.dstChain !== chains_1.b3.id && "w-3 rounded-full", order.dstChain === chains_1.b3.id && "h-4") })] })] })] }), points !== undefined && points !== null && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-points-section flex w-full justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-points-label text-as-tertiarry", children: "Points" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-points-value text-as-brand font-semibold", children: ["+", (0, formatNumber_1.formatNumber)(points), " pts"] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-id-total-section flex w-full justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-id-total-label text-as-tertiarry", children: showTotal ? "Total (included fee)" : "Order ID" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-id-total-value text-as-primary overflow-hidden text-ellipsis whitespace-nowrap", children: showTotal && totalAmount ? totalAmount : order.id })] })] }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-collapsed flex w-full items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-collapsed-divider divider w-full" }), (0, jsx_runtime_1.jsx)("button", { className: "order-details-collapsed-button whitespace-nowrap text-sm", onClick: () => setShowOrderDetails(true), children: "Order Details" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "order-details-collapsed-chevron text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-collapsed-divider divider w-full" })] })) }));
41
+ : "" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-expected-value flex items-end gap-2", children: [order.type === "swap" ? (`~${finalFormattedExpectedDstAmount} ${dstToken.symbol}`) : order.type === "mint_nft" ? ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-nft-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: nft?.imageUrl, alt: nft?.name || "NFT", className: "order-details-nft-image h-5 w-5" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-nft-name", children: nft?.name || "NFT" })] })) : order.type === "join_tournament" || order.type === "fund_tournament" ? ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-tournament-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: tournament?.imageUrl, alt: tournament?.name || "Tournament", className: "order-details-tournament-image h-5 w-5" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-tournament-name", children: tournament?.name || "Tournament" })] })) : order.type === "hype_duel" ? ((0, jsx_runtime_1.jsx)("div", { className: "order-details-hype-info flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-hype-amount", children: [(0, number_1.formatTokenAmount)(BigInt(order.payload.expectedDstAmount), dstToken.decimals), " HYPE"] }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "order-details-chain-info text-as-primary/50 flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "order-details-chain-text", children: ["on ", order.dstChain !== chains_1.b3.id && (0, anyspend_1.getChainName)(order.dstChain)] }), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.dstChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.dstChain), className: (0, utils_1.cn)("order-details-chain-logo h-3", order.dstChain !== chains_1.b3.id && "w-3 rounded-full", order.dstChain === chains_1.b3.id && "h-4") })] })] })] }), points !== undefined && points !== null && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-points-section flex w-full justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-points-label text-as-tertiarry", children: "Points" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-points-value text-as-brand font-semibold", children: ["+", (0, formatNumber_1.formatNumber)(points), " pts"] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-id-total-section flex w-full justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-id-total-label text-as-tertiarry", children: showTotal ? "Total (included fee)" : "Order ID" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-id-total-value text-as-primary overflow-hidden text-ellipsis whitespace-nowrap", children: showTotal && totalAmount ? totalAmount : order.id })] })] }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-collapsed flex w-full items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-collapsed-divider divider w-full" }), (0, jsx_runtime_1.jsx)("button", { className: "order-details-collapsed-button whitespace-nowrap text-sm", onClick: () => setShowOrderDetails(true), children: "Order Details" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "order-details-collapsed-chevron text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-collapsed-divider divider w-full" })] })) }));
49
42
  });
@@ -8,7 +8,7 @@ const lucide_react_1 = require("lucide-react");
8
8
  const react_2 = require("react");
9
9
  const StepProgress_1 = require("./StepProgress");
10
10
  exports.OrderStatus = (0, react_2.memo)(function OrderStatus({ order, selectedCryptoPaymentMethod, }) {
11
- const showCheck = order.status === "executed" || order.status === "quoting_after_deposit";
11
+ const isComplete = order.status === "executed";
12
12
  const { text, status: displayStatus, description } = (0, anyspend_1.getStatusDisplay)(order);
13
13
  const searchParams = (0, react_1.useSearchParams)();
14
14
  const cryptoPaymentMethod = selectedCryptoPaymentMethod || searchParams.get("cryptoPaymentMethod");
@@ -38,5 +38,5 @@ exports.OrderStatus = (0, react_2.memo)(function OrderStatus({ order, selectedCr
38
38
  if (selectedCryptoPaymentMethod === "transfer_crypto" && order.status === "scanning_deposit_transaction") {
39
39
  return null;
40
40
  }
41
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center gap-2", children: showCheck ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: `bg-as-success-secondary relative flex h-10 w-10 items-center justify-center rounded-full`, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "text-as-content-icon-success h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary mt-4 text-xl font-semibold", children: text }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-tertiarry mt-1 text-center", children: description })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-error-secondary flex h-10 w-10 items-center justify-center rounded-full text-base", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "text-as-content-icon-error h-5 w-5" }) }), (0, jsx_runtime_1.jsx)("div", { className: "font-sf-rounded text-as-content-primary mt-4 text-lg font-semibold", children: text }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-tertiarry text-center", style: { whiteSpace: "normal" }, children: description })] })) }));
41
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center gap-2", children: isComplete ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: `bg-as-success-secondary relative flex h-10 w-10 items-center justify-center rounded-full`, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "text-as-content-icon-success h-6 w-6" }) }), (0, jsx_runtime_1.jsx)("h2", { className: "text-as-primary mt-4 text-xl font-semibold", children: text }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-tertiarry mt-1 text-center", children: description })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-error-secondary flex h-10 w-10 items-center justify-center rounded-full text-base", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "text-as-content-icon-error h-5 w-5" }) }), (0, jsx_runtime_1.jsx)("div", { className: "font-sf-rounded text-as-content-primary mt-4 text-lg font-semibold", children: text }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-tertiarry text-center", style: { whiteSpace: "normal" }, children: description })] })) }));
42
42
  });
@@ -4,8 +4,6 @@ export { AnySpendBuySpin } from "./AnySpendBuySpin";
4
4
  export { AnySpendCollectorClubPurchase } from "./AnySpendCollectorClubPurchase";
5
5
  export { AnySpendCustom } from "./AnySpendCustom";
6
6
  export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
7
- export { AnySpendDeposit } from "./AnySpendDeposit";
8
- export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
9
7
  export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
10
8
  export * from "./AnySpendFingerprintWrapper";
11
9
  export { AnySpendNFT } from "./AnySpendNFT";
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.WebviewOnrampPayment = exports.WebviewOnrampOrderStatus = exports.TransferCryptoDetails = exports.TokenBalance = exports.StepProgress = exports.RecipientSelection = exports.OrderTokenAmount = exports.OrderToken = exports.OrderStatus = exports.OrderHistoryItem = exports.OrderHistory = exports.OrderDetailsCollapsible = exports.OrderDetails = exports.CryptoReceiveSection = exports.CryptoPaySection = exports.ChainTokenIcon = exports.AnySpendNFTButton = exports.AnySpendTournament = exports.AnySpendStakeUpsideExactIn = exports.AnySpendStakeUpside = exports.AnySpendStakeB3ExactIn = exports.AnySpendStakeB3 = exports.AnyspendSignatureMint = exports.AnySpendNFT = exports.HYPE_TOKEN_DETAILS = exports.AnySpendDepositHype = exports.AnySpendDeposit = exports.AnySpendCustomExactIn = exports.AnySpendCustom = exports.AnySpendCollectorClubPurchase = exports.AnySpendBuySpin = exports.AnySpendBondKit = exports.AnySpend = void 0;
17
+ exports.WebviewOnrampPayment = exports.WebviewOnrampOrderStatus = exports.TransferCryptoDetails = exports.TokenBalance = exports.StepProgress = exports.RecipientSelection = exports.OrderTokenAmount = exports.OrderToken = exports.OrderStatus = exports.OrderHistoryItem = exports.OrderHistory = exports.OrderDetailsCollapsible = exports.OrderDetails = exports.CryptoReceiveSection = exports.CryptoPaySection = exports.ChainTokenIcon = exports.AnySpendNFTButton = exports.AnySpendTournament = exports.AnySpendStakeUpsideExactIn = exports.AnySpendStakeUpside = exports.AnySpendStakeB3ExactIn = exports.AnySpendStakeB3 = exports.AnyspendSignatureMint = exports.AnySpendNFT = exports.HYPE_TOKEN_DETAILS = exports.AnySpendDepositHype = exports.AnySpendCustomExactIn = exports.AnySpendCustom = exports.AnySpendCollectorClubPurchase = exports.AnySpendBuySpin = exports.AnySpendBondKit = exports.AnySpend = void 0;
18
18
  // Components
19
19
  var AnySpend_1 = require("./AnySpend");
20
20
  Object.defineProperty(exports, "AnySpend", { enumerable: true, get: function () { return AnySpend_1.AnySpend; } });
@@ -28,8 +28,6 @@ var AnySpendCustom_1 = require("./AnySpendCustom");
28
28
  Object.defineProperty(exports, "AnySpendCustom", { enumerable: true, get: function () { return AnySpendCustom_1.AnySpendCustom; } });
29
29
  var AnySpendCustomExactIn_1 = require("./AnySpendCustomExactIn");
30
30
  Object.defineProperty(exports, "AnySpendCustomExactIn", { enumerable: true, get: function () { return AnySpendCustomExactIn_1.AnySpendCustomExactIn; } });
31
- var AnySpendDeposit_1 = require("./AnySpendDeposit");
32
- Object.defineProperty(exports, "AnySpendDeposit", { enumerable: true, get: function () { return AnySpendDeposit_1.AnySpendDeposit; } });
33
31
  var AnyspendDepositHype_1 = require("./AnyspendDepositHype");
34
32
  Object.defineProperty(exports, "AnySpendDepositHype", { enumerable: true, get: function () { return AnyspendDepositHype_1.AnySpendDepositHype; } });
35
33
  Object.defineProperty(exports, "HYPE_TOKEN_DETAILS", { enumerable: true, get: function () { return AnyspendDepositHype_1.HYPE_TOKEN_DETAILS; } });
@@ -1,6 +1,5 @@
1
1
  export * from "./useAnyspendCreateOnrampOrder";
2
2
  export * from "./useAnyspendCreateOrder";
3
- export * from "./useCreateDepositFirstOrder";
4
3
  export * from "./useAnyspendOrderAndTransactions";
5
4
  export * from "./useAnyspendOrderHistory";
6
5
  export * from "./useAnyspendQuote";
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./useAnyspendCreateOnrampOrder"), exports);
18
18
  __exportStar(require("./useAnyspendCreateOrder"), exports);
19
- __exportStar(require("./useCreateDepositFirstOrder"), exports);
20
19
  __exportStar(require("./useAnyspendOrderAndTransactions"), exports);
21
20
  __exportStar(require("./useAnyspendOrderHistory"), exports);
22
21
  __exportStar(require("./useAnyspendQuote"), exports);
@@ -24,9 +24,9 @@ interface UseAnyspendFlowProps {
24
24
  destinationTokenChainId?: number;
25
25
  slippage?: number;
26
26
  disableUrlParamManagement?: boolean;
27
- orderType?: "hype_duel" | "custom_exact_in" | "swap";
27
+ orderType?: "hype_duel" | "custom_exact_in";
28
28
  }
29
- export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrder, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, destinationTokenAddress, destinationTokenChainId, slippage, disableUrlParamManagement, orderType, }: UseAnyspendFlowProps): {
29
+ export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrder, isDepositMode, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, destinationTokenAddress, destinationTokenChainId, slippage, disableUrlParamManagement, orderType, }: UseAnyspendFlowProps): {
30
30
  activePanel: PanelView;
31
31
  setActivePanel: import("react").Dispatch<import("react").SetStateAction<PanelView>>;
32
32
  orderId: string | undefined;