@b3dotfun/sdk 0.0.86 → 0.0.87-alpha.1

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 (97) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +5 -0
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +59 -49
  3. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  4. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
  5. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
  6. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +190 -0
  7. package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +43 -0
  8. package/dist/cjs/anyspend/react/components/QRDeposit.js +146 -0
  9. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +17 -12
  10. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  11. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
  12. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
  13. package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +32 -0
  14. package/dist/cjs/anyspend/react/components/common/WarningText.js +36 -0
  15. package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
  16. package/dist/cjs/anyspend/react/components/icons/CreditCardIcon.js +6 -0
  17. package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
  18. package/dist/cjs/anyspend/react/components/icons/QrCodeIcon.js +6 -0
  19. package/dist/cjs/anyspend/react/components/index.d.ts +2 -0
  20. package/dist/cjs/anyspend/react/components/index.js +3 -1
  21. package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
  22. package/dist/cjs/anyspend/react/hooks/index.js +1 -0
  23. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  24. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +35 -11
  25. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +76 -16
  26. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
  27. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.js +86 -0
  28. package/dist/cjs/anyspend/types/api.d.ts +65 -3
  29. package/dist/cjs/anyspend/utils/format.js +28 -5
  30. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -0
  31. package/dist/esm/anyspend/react/components/AnySpend.d.ts +5 -0
  32. package/dist/esm/anyspend/react/components/AnySpend.js +59 -49
  33. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  34. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -2
  35. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
  36. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +187 -0
  37. package/dist/esm/anyspend/react/components/QRDeposit.d.ts +43 -0
  38. package/dist/esm/anyspend/react/components/QRDeposit.js +143 -0
  39. package/dist/esm/anyspend/react/components/common/OrderDetails.js +17 -12
  40. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  41. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +12 -5
  42. package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
  43. package/dist/esm/anyspend/react/components/common/WarningText.d.ts +32 -0
  44. package/dist/esm/anyspend/react/components/common/WarningText.js +32 -0
  45. package/dist/esm/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
  46. package/dist/esm/anyspend/react/components/icons/CreditCardIcon.js +2 -0
  47. package/dist/esm/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
  48. package/dist/esm/anyspend/react/components/icons/QrCodeIcon.js +2 -0
  49. package/dist/esm/anyspend/react/components/index.d.ts +2 -0
  50. package/dist/esm/anyspend/react/components/index.js +1 -0
  51. package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
  52. package/dist/esm/anyspend/react/hooks/index.js +1 -0
  53. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  54. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +35 -11
  55. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +76 -16
  56. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
  57. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.js +83 -0
  58. package/dist/esm/anyspend/types/api.d.ts +65 -3
  59. package/dist/esm/anyspend/utils/format.js +28 -5
  60. package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -0
  61. package/dist/styles/index.css +1 -1
  62. package/dist/types/anyspend/react/components/AnySpend.d.ts +5 -0
  63. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +1 -1
  64. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +122 -0
  65. package/dist/types/anyspend/react/components/QRDeposit.d.ts +43 -0
  66. package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  67. package/dist/types/anyspend/react/components/common/WarningText.d.ts +32 -0
  68. package/dist/types/anyspend/react/components/icons/CreditCardIcon.d.ts +6 -0
  69. package/dist/types/anyspend/react/components/icons/QrCodeIcon.d.ts +6 -0
  70. package/dist/types/anyspend/react/components/index.d.ts +2 -0
  71. package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
  72. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -2
  73. package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +76 -16
  74. package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +24 -0
  75. package/dist/types/anyspend/types/api.d.ts +65 -3
  76. package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -0
  77. package/package.json +3 -3
  78. package/src/anyspend/react/components/AnySpend.tsx +68 -45
  79. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +2 -3
  80. package/src/anyspend/react/components/AnySpendDeposit.tsx +578 -0
  81. package/src/anyspend/react/components/QRDeposit.tsx +348 -0
  82. package/src/anyspend/react/components/common/OrderDetails.tsx +26 -8
  83. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +20 -8
  84. package/src/anyspend/react/components/common/OrderStatus.tsx +2 -2
  85. package/src/anyspend/react/components/common/WarningText.tsx +52 -0
  86. package/src/anyspend/react/components/icons/CreditCardIcon.tsx +25 -0
  87. package/src/anyspend/react/components/icons/QrCodeIcon.tsx +25 -0
  88. package/src/anyspend/react/components/icons/credit-card.svg +5 -0
  89. package/src/anyspend/react/components/icons/qr-code.svg +5 -0
  90. package/src/anyspend/react/components/index.ts +2 -0
  91. package/src/anyspend/react/hooks/index.ts +1 -0
  92. package/src/anyspend/react/hooks/useAnyspendFlow.ts +37 -12
  93. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +110 -0
  94. package/src/anyspend/types/api.ts +67 -2
  95. package/src/anyspend/utils/format.ts +33 -5
  96. package/src/global-account/react/stores/useModalStore.ts +4 -0
  97. package/src/styles/index.css +2 -0
@@ -0,0 +1,43 @@
1
+ import { components } from "../../../anyspend/types/api";
2
+ import { DepositContractConfig } from "./AnySpendDeposit";
3
+ export interface QRDepositProps {
4
+ /** Display mode */
5
+ mode?: "modal" | "page";
6
+ /** The recipient address (user's wallet) */
7
+ recipientAddress: string;
8
+ /** The source token to deposit (defaults to ETH on Base) */
9
+ sourceToken?: components["schemas"]["Token"];
10
+ /** The source chain ID (defaults to Base) */
11
+ sourceChainId?: number;
12
+ /** The destination token to receive */
13
+ destinationToken: components["schemas"]["Token"];
14
+ /** The destination chain ID */
15
+ destinationChainId: number;
16
+ /** Creator address (optional) */
17
+ creatorAddress?: string;
18
+ /** Contract config for custom execution after deposit */
19
+ depositContractConfig?: DepositContractConfig;
20
+ /** Callback when back button is clicked */
21
+ onBack?: () => void;
22
+ /** Callback when close button is clicked */
23
+ onClose?: () => void;
24
+ /** Callback when order is created successfully */
25
+ onOrderCreated?: (orderId: string) => void;
26
+ /** Callback when deposit is completed */
27
+ onSuccess?: (txHash?: string) => void;
28
+ }
29
+ /**
30
+ * A component for displaying QR code deposit functionality.
31
+ * Creates a deposit_first order on mount and shows a QR code that can be scanned to deposit tokens.
32
+ * Users can change the source token/chain using the TokenSelector.
33
+ *
34
+ * @example
35
+ * <QRDeposit
36
+ * recipientAddress={userAddress}
37
+ * destinationToken={usdcArbitrumToken}
38
+ * destinationChainId={42161}
39
+ * onBack={() => setStep("select-chain")}
40
+ * onSuccess={(txHash) => console.log("Deposit complete:", txHash)}
41
+ * />
42
+ */
43
+ export declare function QRDeposit({ mode, recipientAddress, sourceToken: sourceTokenProp, sourceChainId: sourceChainIdProp, destinationToken, destinationChainId, creatorAddress, depositContractConfig, onBack, onClose, onOrderCreated, onSuccess, }: QRDepositProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QRDeposit = QRDeposit;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const anyspend_1 = require("../../../anyspend");
6
+ const react_1 = require("../../../global-account/react");
7
+ const cn_1 = require("../../../shared/utils/cn");
8
+ const relay_kit_ui_1 = require("@relayprotocol/relay-kit-ui");
9
+ const lucide_react_1 = require("lucide-react");
10
+ const qrcode_react_1 = require("qrcode.react");
11
+ const react_2 = require("react");
12
+ const useAnyspendOrderAndTransactions_1 = require("../hooks/useAnyspendOrderAndTransactions");
13
+ const useCreateDepositFirstOrder_1 = require("../hooks/useCreateDepositFirstOrder");
14
+ const ChainTokenIcon_1 = require("./common/ChainTokenIcon");
15
+ const OrderDetails_1 = require("./common/OrderDetails");
16
+ const WarningText_1 = require("./common/WarningText");
17
+ // Default source token: ETH on Base
18
+ const DEFAULT_ETH_ON_BASE = {
19
+ chainId: 8453,
20
+ address: "0x0000000000000000000000000000000000000000",
21
+ symbol: "ETH",
22
+ name: "Ethereum",
23
+ decimals: 18,
24
+ metadata: {
25
+ logoURI: "https://assets.relay.link/icons/1/light.png",
26
+ },
27
+ };
28
+ /**
29
+ * A component for displaying QR code deposit functionality.
30
+ * Creates a deposit_first order on mount and shows a QR code that can be scanned to deposit tokens.
31
+ * Users can change the source token/chain using the TokenSelector.
32
+ *
33
+ * @example
34
+ * <QRDeposit
35
+ * recipientAddress={userAddress}
36
+ * destinationToken={usdcArbitrumToken}
37
+ * destinationChainId={42161}
38
+ * onBack={() => setStep("select-chain")}
39
+ * onSuccess={(txHash) => console.log("Deposit complete:", txHash)}
40
+ * />
41
+ */
42
+ function QRDeposit({ mode = "modal", recipientAddress, sourceToken: sourceTokenProp, sourceChainId: sourceChainIdProp, destinationToken, destinationChainId, creatorAddress, depositContractConfig, onBack, onClose, onOrderCreated, onSuccess, }) {
43
+ const [copied, setCopied] = (0, react_2.useState)(false);
44
+ const [orderId, setOrderId] = (0, react_2.useState)();
45
+ const [globalAddress, setGlobalAddress] = (0, react_2.useState)();
46
+ const orderCreatedRef = (0, react_2.useRef)(false);
47
+ const onSuccessCalled = (0, react_2.useRef)(false);
48
+ // Source token/chain as state (can be changed by user)
49
+ const [sourceChainId, setSourceChainId] = (0, react_2.useState)(sourceChainIdProp ?? 8453);
50
+ const [sourceToken, setSourceToken] = (0, react_2.useState)(sourceTokenProp ?? DEFAULT_ETH_ON_BASE);
51
+ // Handle token selection from TokenSelector
52
+ const handleTokenSelect = (newToken) => {
53
+ const token = {
54
+ address: newToken.address,
55
+ chainId: newToken.chainId,
56
+ decimals: newToken.decimals,
57
+ metadata: { logoURI: newToken.logoURI },
58
+ name: newToken.name,
59
+ symbol: newToken.symbol,
60
+ };
61
+ // Reset order state when token changes
62
+ setOrderId(undefined);
63
+ setGlobalAddress(undefined);
64
+ orderCreatedRef.current = false;
65
+ // Update token and chain
66
+ setSourceChainId(newToken.chainId);
67
+ setSourceToken(token);
68
+ };
69
+ // Create order hook
70
+ const { createOrder, isCreatingOrder } = (0, useCreateDepositFirstOrder_1.useCreateDepositFirstOrder)({
71
+ onSuccess: data => {
72
+ const newOrderId = data.data.id;
73
+ const newGlobalAddress = data.data.globalAddress;
74
+ setOrderId(newOrderId);
75
+ setGlobalAddress(newGlobalAddress);
76
+ onOrderCreated?.(newOrderId);
77
+ },
78
+ onError: error => {
79
+ console.error("Failed to create deposit order:", error);
80
+ react_1.toast.error("Failed to create deposit order: " + error.message);
81
+ },
82
+ });
83
+ // Fetch order status
84
+ const { orderAndTransactions: oat } = (0, useAnyspendOrderAndTransactions_1.useAnyspendOrderAndTransactions)(orderId);
85
+ // Create order on mount
86
+ (0, react_2.useEffect)(() => {
87
+ if (orderCreatedRef.current)
88
+ return;
89
+ orderCreatedRef.current = true;
90
+ createOrder({
91
+ recipientAddress,
92
+ srcChain: sourceChainId,
93
+ dstChain: destinationChainId,
94
+ srcToken: sourceToken,
95
+ dstToken: destinationToken,
96
+ creatorAddress,
97
+ contractConfig: depositContractConfig,
98
+ });
99
+ }, [
100
+ recipientAddress,
101
+ sourceChainId,
102
+ destinationChainId,
103
+ sourceToken,
104
+ destinationToken,
105
+ creatorAddress,
106
+ depositContractConfig,
107
+ createOrder,
108
+ ]);
109
+ // Call onSuccess when order is executed
110
+ (0, react_2.useEffect)(() => {
111
+ if (oat?.data?.order.status === "executed" && !onSuccessCalled.current) {
112
+ const txHash = oat?.data?.executeTx?.txHash;
113
+ onSuccess?.(txHash);
114
+ onSuccessCalled.current = true;
115
+ }
116
+ }, [oat?.data?.order.status, oat?.data?.executeTx?.txHash, onSuccess]);
117
+ // Reset onSuccess flag when orderId changes
118
+ (0, react_2.useEffect)(() => {
119
+ onSuccessCalled.current = false;
120
+ }, [orderId]);
121
+ const displayAddress = globalAddress || recipientAddress;
122
+ const handleCopyAddress = async () => {
123
+ if (displayAddress) {
124
+ await navigator.clipboard.writeText(displayAddress);
125
+ setCopied(true);
126
+ setTimeout(() => setCopied(false), 2000);
127
+ }
128
+ };
129
+ const handleBack = () => {
130
+ setCopied(false);
131
+ onBack?.();
132
+ };
133
+ const handleClose = () => {
134
+ setCopied(false);
135
+ onClose?.();
136
+ };
137
+ // Show order details if order has deposits or is being processed
138
+ if (oat?.data && oat.data.depositTxs && oat.data.depositTxs.length > 0) {
139
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-container anyspend-qr-order-details font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsx)("div", { className: "anyspend-qr-order-details-content relative flex flex-col gap-4", children: (0, jsx_runtime_1.jsx)(OrderDetails_1.OrderDetails, { mode: mode, order: oat.data.order, depositTxs: oat.data.depositTxs, relayTxs: oat.data.relayTxs, executeTx: oat.data.executeTx, refundTxs: oat.data.refundTxs, onBack: handleBack }) }) }));
140
+ }
141
+ // Show loading state while creating order (but not if we already have an orderId)
142
+ if (isCreatingOrder && !orderId) {
143
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-container anyspend-qr-loading font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-loading-content flex flex-col items-center justify-center gap-4 py-12", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "anyspend-qr-loading-spinner text-as-brand h-8 w-8 animate-spin" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-qr-loading-text text-as-secondary text-sm", children: "Creating deposit order..." })] }) }));
144
+ }
145
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-container anyspend-qr-deposit font-inter bg-as-surface-primary mx-auto w-full max-w-[460px] p-6", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-deposit-content flex flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-header flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleBack, className: "anyspend-qr-back-button text-as-secondary hover:text-as-primary", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }), (0, jsx_runtime_1.jsx)("h2", { className: "anyspend-qr-title text-as-primary text-base font-semibold", children: "Deposit" }), onClose ? ((0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "anyspend-qr-close-button text-as-secondary hover:text-as-primary", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "w-5" }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-token-selector flex flex-col gap-1.5", children: [(0, jsx_runtime_1.jsx)("label", { className: "anyspend-qr-token-label text-as-secondary text-sm", children: "Send" }), (0, jsx_runtime_1.jsx)(relay_kit_ui_1.TokenSelector, { chainIdsFilter: (0, anyspend_1.getAvailableChainIds)("from"), context: "from", fromChainWalletVMSupported: true, isValidAddress: true, lockedChainIds: (0, anyspend_1.getAvailableChainIds)("from"), multiWalletSupportEnabled: true, onAnalyticEvent: undefined, setToken: handleTokenSelect, supportedWalletVMs: ["evm"], token: undefined, trigger: (0, jsx_runtime_1.jsxs)(react_1.Button, { variant: "outline", role: "combobox", className: "anyspend-qr-token-trigger border-as-stroke bg-as-surface-secondary flex h-auto w-full items-center justify-between gap-2 rounded-xl border px-3 py-2.5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [sourceToken.metadata?.logoURI ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[sourceChainId]?.logoUrl, tokenUrl: sourceToken.metadata.logoURI, className: "h-8 min-h-8 w-8 min-w-8" })) : ((0, jsx_runtime_1.jsx)("div", { className: "h-8 w-8 rounded-full bg-gray-700" })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary font-semibold", children: sourceToken.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/70 text-xs", children: anyspend_1.ALL_CHAINS[sourceChainId]?.name ?? "Unknown" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-70" })] }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-content border-as-stroke flex items-start gap-4 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-code-container flex flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-qr-code rounded-lg bg-white p-2", children: (0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: displayAddress, size: 120, level: "M", marginSize: 0 }) }), (0, jsx_runtime_1.jsxs)("span", { className: "anyspend-qr-scan-hint text-as-secondary text-xs", children: ["SCAN WITH ", (0, jsx_runtime_1.jsx)("span", { className: "inline-block", children: "\uD83E\uDD8A" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-address-container flex flex-1 flex-col gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-qr-address-label text-as-secondary text-sm", children: "Deposit address:" }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-qr-address-row flex items-start gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-qr-address text-as-primary break-all font-mono text-sm leading-relaxed", children: displayAddress }), (0, jsx_runtime_1.jsx)("button", { onClick: handleCopyAddress, className: "anyspend-qr-copy-icon text-as-secondary hover:text-as-primary mt-0.5 shrink-0", children: copied ? (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "h-4 w-4" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "h-4 w-4" }) })] })] })] }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationChainId }), (0, jsx_runtime_1.jsxs)(WarningText_1.WarningText, { children: ["Only send ", sourceToken.symbol, " on ", anyspend_1.ALL_CHAINS[sourceChainId]?.name ?? "the specified chain", ". Other tokens will not be converted."] }), (0, jsx_runtime_1.jsx)("button", { onClick: handleCopyAddress, className: "anyspend-qr-copy-button flex w-full items-center justify-center gap-2 rounded-xl bg-blue-500 py-3.5 font-medium text-white transition-all hover:bg-blue-600", children: "Copy deposit address" })] }) }));
146
+ }
@@ -37,6 +37,7 @@ function getOrderSuccessText({ order, tournament, formattedActualDstAmount, form
37
37
  let actionText = "";
38
38
  switch (order.type) {
39
39
  case "swap":
40
+ case "deposit_first":
40
41
  actionText = `sent ${formattedActualDstAmount || "--"} ${dstToken.symbol}`;
41
42
  return `Successfully ${actionText} to ${recipient}`;
42
43
  case "mint_nft":
@@ -158,6 +159,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
158
159
  const { data: walletClient } = (0, wagmi_1.useWalletClient)();
159
160
  const [txHash, setTxHash] = (0, react_5.useState)();
160
161
  const [showQRCode, setShowQRCode] = (0, react_5.useState)(false);
162
+ const [orderDetailsOpen, setOrderDetailsOpen] = (0, react_5.useState)(true);
161
163
  const { isLoading: txLoading, isSuccess: txSuccess } = (0, wagmi_1.useWaitForTransactionReceipt)({ hash: txHash });
162
164
  const { switchChainAndExecuteWithEOA, switchChainAndExecute, isSwitchingOrExecuting } = (0, react_1.useUnifiedChainSwitchAndExecute)();
163
165
  // Track if auto-payment was attempted to avoid re-triggering
@@ -326,7 +328,8 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
326
328
  const expectedDstAmount = order.type === "mint_nft" ||
327
329
  order.type === "join_tournament" ||
328
330
  order.type === "fund_tournament" ||
329
- order.type === "custom"
331
+ order.type === "custom" ||
332
+ order.type === "deposit_first"
330
333
  ? "0"
331
334
  : order.payload.expectedDstAmount.toString();
332
335
  const formattedExpectedDstAmount = (0, number_1.formatTokenAmount)(BigInt(expectedDstAmount), dstToken.decimals);
@@ -335,7 +338,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
335
338
  ? (0, number_1.formatTokenAmount)(BigInt(actualDstAmount), dstToken.decimals)
336
339
  : undefined;
337
340
  if (refundTxs.length > 0) {
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
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
339
342
  ? depositTxs.map(dTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
340
343
  ? `Received payment`
341
344
  : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
@@ -344,13 +347,13 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
344
347
  : 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") })] }));
345
348
  }
346
349
  if (executeTx) {
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
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
348
351
  ? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
349
352
  ? `Received payment`
350
353
  : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
351
354
  : null, relayTxs
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"
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"
354
357
  ? "Processed Swap"
355
358
  : order.type === "mint_nft"
356
359
  ? "Minted NFT"
@@ -369,12 +372,14 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
369
372
  }), (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") }))] }));
370
373
  }
371
374
  if (relayTxs.length > 0 && relayTxs.every(tx => tx.status === "success")) {
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
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
373
376
  ? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
374
377
  ? `Received payment`
375
378
  : `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
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"
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"
378
383
  : order.type === "mint_nft"
379
384
  ? "Minting NFT"
380
385
  : order.type === "join_tournament"
@@ -390,10 +395,10 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
390
395
  // This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
391
396
  const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
392
397
  if (depositTxs?.length || waitingForDeposit) {
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"
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"
394
399
  ? `Received payment`
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"
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"
397
402
  : order.type === "mint_nft"
398
403
  ? "Minting NFT"
399
404
  : order.type === "join_tournament"
@@ -417,7 +422,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
417
422
  ? (0, centerTruncate_1.default)(phantomWalletAddress, 6)
418
423
  : (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" })] })] })] }) })) : (
419
424
  // Default case - existing QR code flow
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"] })] }));
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"] })] }));
421
426
  });
422
427
  function TransactionDetails({ title, chainId, tx, isProcessing, delay, }) {
423
428
  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,6 +14,8 @@ interface OrderDetailsCollapsibleProps {
14
14
  showTotal?: boolean;
15
15
  totalAmount?: string;
16
16
  points?: number;
17
+ isOpen?: boolean;
18
+ onOpenChange?: (isOpen: boolean) => void;
17
19
  }
18
20
  export declare const OrderDetailsCollapsible: import("react").NamedExoticComponent<OrderDetailsCollapsibleProps>;
19
21
  export {};
@@ -16,19 +16,26 @@ 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, }) {
20
- const [showOrderDetails, setShowOrderDetails] = (0, react_3.useState)(true);
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;
21
24
  // Calculate expected amount if not provided
22
25
  const expectedDstAmount = order.type === "mint_nft" ||
23
26
  order.type === "join_tournament" ||
24
27
  order.type === "fund_tournament" ||
25
- order.type === "custom"
28
+ order.type === "custom" ||
29
+ order.type === "deposit_first"
26
30
  ? "0"
27
31
  : order.payload.expectedDstAmount.toString();
28
32
  const finalFormattedExpectedDstAmount = formattedExpectedDstAmount || (0, number_1.formatTokenAmount)(BigInt(expectedDstAmount), dstToken.decimals);
29
33
  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: () => {
30
34
  react_1.toast.success("Copied recipient address to clipboard");
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"
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"
32
39
  ? "Expected to receive"
33
40
  : order.type === "join_tournament"
34
41
  ? "Join tournament"
@@ -38,5 +45,5 @@ exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollaps
38
45
  ? order.metadata.action
39
46
  ? (0, anyspend_1.capitalizeFirstLetter)(order.metadata.action)
40
47
  : "Contract execution"
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" })] })) }));
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" })] })) }));
42
49
  });
@@ -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 isComplete = order.status === "executed";
11
+ const showCheck = order.status === "executed" || order.status === "quoting_after_deposit";
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: 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 })] })) }));
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 })] })) }));
42
42
  });
@@ -0,0 +1,32 @@
1
+ export interface WarningTextProps {
2
+ /** The warning message content */
3
+ children: React.ReactNode;
4
+ /** Additional CSS classes */
5
+ className?: string;
6
+ }
7
+ /**
8
+ * A generic warning text component with consistent styling.
9
+ *
10
+ * @example
11
+ * <WarningText>
12
+ * Custom warning message
13
+ * </WarningText>
14
+ */
15
+ export declare function WarningText({ children, className }: WarningTextProps): import("react/jsx-runtime").JSX.Element;
16
+ export interface ChainWarningTextProps {
17
+ /** The chain ID to display warning for */
18
+ chainId: number;
19
+ /** Additional CSS classes */
20
+ className?: string;
21
+ }
22
+ /**
23
+ * A chain-aware warning text component that displays chain-specific warnings.
24
+ * Returns null if there's no warning for the given chain.
25
+ *
26
+ * @example
27
+ * <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
28
+ *
29
+ * @example
30
+ * <ChainWarningText chainId={destinationChainId} className="mt-4" />
31
+ */
32
+ export declare function ChainWarningText({ chainId, className }: ChainWarningTextProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WarningText = WarningText;
4
+ exports.ChainWarningText = ChainWarningText;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const anyspend_1 = require("../../../../anyspend");
7
+ const cn_1 = require("../../../../shared/utils/cn");
8
+ /**
9
+ * A generic warning text component with consistent styling.
10
+ *
11
+ * @example
12
+ * <WarningText>
13
+ * Custom warning message
14
+ * </WarningText>
15
+ */
16
+ function WarningText({ children, className }) {
17
+ return (0, jsx_runtime_1.jsx)("p", { className: (0, cn_1.cn)("anyspend-warning text-center text-xs italic text-red-500", className), children: children });
18
+ }
19
+ /**
20
+ * A chain-aware warning text component that displays chain-specific warnings.
21
+ * Returns null if there's no warning for the given chain.
22
+ *
23
+ * @example
24
+ * <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
25
+ *
26
+ * @example
27
+ * <ChainWarningText chainId={destinationChainId} className="mt-4" />
28
+ */
29
+ function ChainWarningText({ chainId, className }) {
30
+ // Chain-specific warning messages
31
+ if (chainId === anyspend_1.HYPERLIQUID_CHAIN_ID) {
32
+ return ((0, jsx_runtime_1.jsxs)(WarningText, { className: className, children: ["Minimum deposit amount: ", (0, jsx_runtime_1.jsx)("b", { children: "$1" })] }));
33
+ }
34
+ // No warning for this chain
35
+ return null;
36
+ }
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface CreditCardIconProps {
3
+ className?: string;
4
+ }
5
+ export declare const CreditCardIcon: React.FC<CreditCardIconProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreditCardIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const CreditCardIcon = ({ className }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: [(0, jsx_runtime_1.jsx)("path", { d: "M8 0.5H32C36.1421 0.5 39.5 3.85786 39.5 8V32C39.5 36.1421 36.1421 39.5 32 39.5H8C3.85786 39.5 0.5 36.1421 0.5 32V8C0.5 3.85786 3.85786 0.5 8 0.5Z", fill: "#F4F4F5" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 0.5H32C36.1421 0.5 39.5 3.85786 39.5 8V32C39.5 36.1421 36.1421 39.5 32 39.5H8C3.85786 39.5 0.5 36.1421 0.5 32V8C0.5 3.85786 3.85786 0.5 8 0.5Z", stroke: "#E4E4E7" }), (0, jsx_runtime_1.jsx)("path", { d: "M30 18H10M19 22H14M10 16.2L10 23.8C10 24.9201 10 25.4802 10.218 25.908C10.4097 26.2843 10.7157 26.5903 11.092 26.782C11.5198 27 12.0799 27 13.2 27L26.8 27C27.9201 27 28.4802 27 28.908 26.782C29.2843 26.5903 29.5903 26.2843 29.782 25.908C30 25.4802 30 24.9201 30 23.8V16.2C30 15.0799 30 14.5198 29.782 14.092C29.5903 13.7157 29.2843 13.4097 28.908 13.218C28.4802 13 27.9201 13 26.8 13L13.2 13C12.0799 13 11.5198 13 11.092 13.218C10.7157 13.4097 10.4097 13.7157 10.218 14.092C10 14.5198 10 15.0799 10 16.2Z", stroke: "#51525C", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] }));
6
+ exports.CreditCardIcon = CreditCardIcon;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface QrCodeIconProps {
3
+ className?: string;
4
+ }
5
+ export declare const QrCodeIcon: React.FC<QrCodeIconProps>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QrCodeIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const QrCodeIcon = ({ className }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: [(0, jsx_runtime_1.jsx)("path", { d: "M8 0.5H32C36.1421 0.5 39.5 3.85786 39.5 8V32C39.5 36.1421 36.1421 39.5 32 39.5H8C3.85786 39.5 0.5 36.1421 0.5 32V8C0.5 3.85786 3.85786 0.5 8 0.5Z", fill: "#F4F4F5" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 0.5H32C36.1421 0.5 39.5 3.85786 39.5 8V32C39.5 36.1421 36.1421 39.5 32 39.5H8C3.85786 39.5 0.5 36.1421 0.5 32V8C0.5 3.85786 3.85786 0.5 8 0.5Z", stroke: "#E4E4E7" }), (0, jsx_runtime_1.jsx)("path", { d: "M15 20H20V25M11.01 20H11M16.01 25H16M20.01 29H20M29.01 20H29M11 25H12.5M23.5 20H25.5M11 29H16M20 10V16M25.6 29H27.4C27.9601 29 28.2401 29 28.454 28.891C28.6422 28.7951 28.7951 28.6422 28.891 28.454C29 28.2401 29 27.9601 29 27.4V25.6C29 25.0399 29 24.7599 28.891 24.546C28.7951 24.3578 28.6422 24.2049 28.454 24.109C28.2401 24 27.9601 24 27.4 24H25.6C25.0399 24 24.7599 24 24.546 24.109C24.3578 24.2049 24.2049 24.3578 24.109 24.546C24 24.7599 24 25.0399 24 25.6V27.4C24 27.9601 24 28.2401 24.109 28.454C24.2049 28.6422 24.3578 28.7951 24.546 28.891C24.7599 29 25.0399 29 25.6 29ZM25.6 16H27.4C27.9601 16 28.2401 16 28.454 15.891C28.6422 15.7951 28.7951 15.6422 28.891 15.454C29 15.2401 29 14.9601 29 14.4V12.6C29 12.0399 29 11.7599 28.891 11.546C28.7951 11.3578 28.6422 11.2049 28.454 11.109C28.2401 11 27.9601 11 27.4 11H25.6C25.0399 11 24.7599 11 24.546 11.109C24.3578 11.2049 24.2049 11.3578 24.109 11.546C24 11.7599 24 12.0399 24 12.6V14.4C24 14.9601 24 15.2401 24.109 15.454C24.2049 15.6422 24.3578 15.7951 24.546 15.891C24.7599 16 25.0399 16 25.6 16ZM12.6 16H14.4C14.9601 16 15.2401 16 15.454 15.891C15.6422 15.7951 15.7951 15.6422 15.891 15.454C16 15.2401 16 14.9601 16 14.4V12.6C16 12.0399 16 11.7599 15.891 11.546C15.7951 11.3578 15.6422 11.2049 15.454 11.109C15.2401 11 14.9601 11 14.4 11H12.6C12.0399 11 11.7599 11 11.546 11.109C11.3578 11.2049 11.2049 11.3578 11.109 11.546C11 11.7599 11 12.0399 11 12.6V14.4C11 14.9601 11 15.2401 11.109 15.454C11.2049 15.6422 11.3578 15.7951 11.546 15.891C11.7599 16 12.0399 16 12.6 16Z", stroke: "#51525C", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] }));
6
+ exports.QrCodeIcon = QrCodeIcon;
@@ -4,6 +4,8 @@ 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";
7
9
  export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
8
10
  export * from "./AnySpendFingerprintWrapper";
9
11
  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.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.AnySpendDeposit = 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,6 +28,8 @@ 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; } });
31
33
  var AnyspendDepositHype_1 = require("./AnyspendDepositHype");
32
34
  Object.defineProperty(exports, "AnySpendDepositHype", { enumerable: true, get: function () { return AnyspendDepositHype_1.AnySpendDepositHype; } });
33
35
  Object.defineProperty(exports, "HYPE_TOKEN_DETAILS", { enumerable: true, get: function () { return AnyspendDepositHype_1.HYPE_TOKEN_DETAILS; } });
@@ -1,5 +1,6 @@
1
1
  export * from "./useAnyspendCreateOnrampOrder";
2
2
  export * from "./useAnyspendCreateOrder";
3
+ export * from "./useCreateDepositFirstOrder";
3
4
  export * from "./useAnyspendOrderAndTransactions";
4
5
  export * from "./useAnyspendOrderHistory";
5
6
  export * from "./useAnyspendQuote";
@@ -16,6 +16,7 @@ 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);
19
20
  __exportStar(require("./useAnyspendOrderAndTransactions"), exports);
20
21
  __exportStar(require("./useAnyspendOrderHistory"), exports);
21
22
  __exportStar(require("./useAnyspendQuote"), exports);