@b3dotfun/sdk 0.0.33 → 0.0.34-alpha.0

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 (95) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +2 -2
  2. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -1
  3. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +0 -1
  4. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +5 -36
  5. package/dist/cjs/anyspend/react/components/common/InsufficientDepositPayment.d.ts +12 -0
  6. package/dist/cjs/anyspend/react/components/common/InsufficientDepositPayment.js +25 -0
  7. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +3 -3
  8. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +65 -60
  9. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
  10. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -4
  11. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +4 -2
  12. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +6 -6
  13. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +54 -10
  14. package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.js +1 -1
  15. package/dist/cjs/anyspend/types/api.d.ts +130 -14
  16. package/dist/cjs/anyspend/utils/chain.js +1 -1
  17. package/dist/cjs/anyspend/utils/format.js +1 -0
  18. package/dist/cjs/anyspend/utils/orderPayload.js +7 -0
  19. package/dist/cjs/global-account/react/components/B3DynamicModal.js +1 -4
  20. package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +14 -0
  21. package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
  22. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +17 -1
  23. package/dist/cjs/global-account/react/components/index.d.ts +8 -9
  24. package/dist/cjs/global-account/react/components/index.js +25 -28
  25. package/dist/cjs/global-account/react/index.native.d.ts +2 -1
  26. package/dist/cjs/global-account/react/index.native.js +5 -3
  27. package/dist/cjs/global-account/react/stores/index.d.ts +1 -1
  28. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +2 -22
  29. package/dist/esm/anyspend/react/components/AnySpend.js +2 -2
  30. package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
  31. package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +0 -1
  32. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +6 -37
  33. package/dist/esm/anyspend/react/components/common/InsufficientDepositPayment.d.ts +12 -0
  34. package/dist/esm/anyspend/react/components/common/InsufficientDepositPayment.js +22 -0
  35. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +3 -3
  36. package/dist/esm/anyspend/react/components/common/OrderDetails.js +48 -43
  37. package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
  38. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -4
  39. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +4 -2
  40. package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +6 -6
  41. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +54 -10
  42. package/dist/esm/anyspend/react/hooks/useAnyspendQuote.js +1 -1
  43. package/dist/esm/anyspend/types/api.d.ts +130 -14
  44. package/dist/esm/anyspend/utils/chain.js +1 -1
  45. package/dist/esm/anyspend/utils/format.js +1 -0
  46. package/dist/esm/anyspend/utils/orderPayload.js +7 -0
  47. package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -4
  48. package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +11 -0
  49. package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +2 -2
  50. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +17 -1
  51. package/dist/esm/global-account/react/components/index.d.ts +8 -9
  52. package/dist/esm/global-account/react/components/index.js +8 -10
  53. package/dist/esm/global-account/react/index.native.d.ts +2 -1
  54. package/dist/esm/global-account/react/index.native.js +2 -1
  55. package/dist/esm/global-account/react/stores/index.d.ts +1 -1
  56. package/dist/esm/global-account/react/stores/useModalStore.d.ts +2 -22
  57. package/dist/styles/index.css +1 -1
  58. package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +0 -1
  59. package/dist/types/anyspend/react/components/common/InsufficientDepositPayment.d.ts +12 -0
  60. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +3 -3
  61. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +4 -4
  62. package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +6 -6
  63. package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +54 -10
  64. package/dist/types/anyspend/types/api.d.ts +130 -14
  65. package/dist/types/global-account/react/components/index.d.ts +8 -9
  66. package/dist/types/global-account/react/index.native.d.ts +2 -1
  67. package/dist/types/global-account/react/stores/index.d.ts +1 -1
  68. package/dist/types/global-account/react/stores/useModalStore.d.ts +2 -22
  69. package/package.json +2 -4
  70. package/src/anyspend/react/components/AnySpend.tsx +2 -1
  71. package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
  72. package/src/anyspend/react/components/AnyspendDepositHype.tsx +5 -43
  73. package/src/anyspend/react/components/common/InsufficientDepositPayment.tsx +144 -0
  74. package/src/anyspend/react/components/common/OrderDetails.tsx +95 -71
  75. package/src/anyspend/react/components/common/OrderStatus.tsx +2 -2
  76. package/src/anyspend/react/hooks/useAnyspendFlow.ts +5 -3
  77. package/src/anyspend/react/hooks/useAnyspendQuote.ts +1 -1
  78. package/src/anyspend/types/api.ts +131 -11
  79. package/src/anyspend/utils/chain.ts +1 -1
  80. package/src/anyspend/utils/format.ts +1 -0
  81. package/src/anyspend/utils/orderPayload.ts +7 -0
  82. package/src/global-account/react/components/B3DynamicModal.tsx +0 -4
  83. package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +10 -0
  84. package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +6 -6
  85. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +17 -1
  86. package/src/global-account/react/components/index.ts +13 -16
  87. package/src/global-account/react/index.native.ts +2 -1
  88. package/src/global-account/react/stores/index.ts +1 -2
  89. package/src/global-account/react/stores/useModalStore.ts +1 -23
  90. package/dist/cjs/global-account/react/components/Transak/TransakModal.d.ts +0 -1
  91. package/dist/cjs/global-account/react/components/Transak/TransakModal.js +0 -110
  92. package/dist/esm/global-account/react/components/Transak/TransakModal.d.ts +0 -1
  93. package/dist/esm/global-account/react/components/Transak/TransakModal.js +0 -104
  94. package/dist/types/global-account/react/components/Transak/TransakModal.d.ts +0 -1
  95. package/src/global-account/react/components/Transak/TransakModal.tsx +0 -131
@@ -1,12 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { ALL_CHAINS, DEPOSIT_HYPE_ACTION, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, RELAY_ETH_ADDRESS, RELAY_SOLANA_MAINNET_CHAIN_ID, } from "../../../../anyspend/index.js";
4
- import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useModalStore, useProfile, useUnifiedChainSwitchAndExecute, } from "../../../../global-account/react/index.js";
4
+ import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useB3, useModalStore, useProfile, useUnifiedChainSwitchAndExecute, } from "../../../../global-account/react/index.js";
5
5
  import { useRouter, useSearchParams } from "../../../../shared/react/hooks/index.js";
6
6
  import { cn } from "../../../../shared/utils/index.js";
7
7
  import centerTruncate from "../../../../shared/utils/centerTruncate.js";
8
8
  import { formatTokenAmount } from "../../../../shared/utils/number.js";
9
- import { useColorMode } from "@chakra-ui/react";
10
9
  import { createAssociatedTokenAccountInstruction, createTransferCheckedInstruction, getAssociatedTokenAddressSync, } from "@solana/spl-token";
11
10
  import { ComputeBudgetProgram, Connection, PublicKey, SystemProgram, Transaction } from "@solana/web3.js";
12
11
  import { WalletCoinbase, WalletMetamask, WalletPhantom, WalletTrust, WalletWalletConnect } from "@web3icons/react";
@@ -22,6 +21,7 @@ import { useWaitForTransactionReceipt, useWalletClient } from "wagmi";
22
21
  import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./Accordion.js";
23
22
  import ConnectWalletPayment from "./ConnectWalletPayment.js";
24
23
  import { CryptoPaymentMethodType } from "./CryptoPaymentMethod.js";
24
+ import { InsufficientDepositPayment } from "./InsufficientDepositPayment.js";
25
25
  import { OrderDetailsCollapsible } from "./OrderDetailsCollapsible.js";
26
26
  import PaymentVendorUI from "./PaymentVendorUI.js";
27
27
  import { TransferCryptoDetails } from "./TransferCryptoDetails.js";
@@ -48,6 +48,9 @@ function getOrderSuccessText({ order, tournament, formattedActualDstAmount, dstT
48
48
  }
49
49
  actionText = order.metadata.action || `executed contract`;
50
50
  return `Successfully ${actionText}`;
51
+ case "hype_duel":
52
+ actionText = `deposited ${formattedActualDstAmount || "--"} HYPE`;
53
+ return `Successfully ${actionText} to ${recipient}`;
51
54
  default:
52
55
  throw new Error("Invalid order type");
53
56
  }
@@ -124,9 +127,12 @@ function roundTokenAmount(amount) {
124
127
  const roundedDecimalPart = digits.join("");
125
128
  return `${wholePart}.${roundedDecimalPart}`;
126
129
  }
127
- export const OrderDetails = memo(function OrderDetails({ mode = "modal", order, depositTxs, relayTx, executeTx, refundTxs, cryptoPaymentMethod, onBack, disableUrlParamManagement = false, }) {
130
+ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, onBack, disableUrlParamManagement = false, }) {
128
131
  const router = useRouter();
129
132
  const searchParams = useSearchParams();
133
+ // Get theme from B3Provider context
134
+ const { theme } = useB3();
135
+ const colorMode = theme || "light";
130
136
  // Read crypto payment method from URL parameters
131
137
  const cryptoPaymentMethodFromUrl = searchParams.get("cryptoPaymentMethod");
132
138
  const effectiveCryptoPaymentMethod = cryptoPaymentMethod || cryptoPaymentMethodFromUrl || CryptoPaymentMethodType.NONE;
@@ -143,7 +149,6 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
143
149
  const [showQRCode, setShowQRCode] = useState(false);
144
150
  const { isLoading: txLoading, isSuccess: txSuccess } = useWaitForTransactionReceipt({ hash: txHash });
145
151
  const { switchChainAndExecuteWithEOA, isSwitchingOrExecuting } = useUnifiedChainSwitchAndExecute();
146
- const { colorMode } = useColorMode();
147
152
  const roundedUpSrcAmount = useMemo(() => {
148
153
  // Display the full transfer amount without rounding since users need to see the exact value they're transferring.
149
154
  // Use 21 significant digits (max allowed by Intl.NumberFormat)
@@ -152,22 +157,37 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
152
157
  : undefined;
153
158
  return roundTokenAmount(formattedSrcAmount);
154
159
  }, [order.srcAmount, srcToken]);
160
+ // Calculate deposit amounts - moved here to be used in useCallback hooks
161
+ const depositedAmount = useMemo(() => {
162
+ return depositTxs ? depositTxs.reduce((acc, curr) => acc + BigInt(curr.amount), BigInt(0)) : BigInt(0);
163
+ }, [depositTxs]);
164
+ const depositDeficit = useMemo(() => {
165
+ return BigInt(order.srcAmount) - depositedAmount;
166
+ }, [order.srcAmount, depositedAmount]);
167
+ const depositEnoughAmount = useMemo(() => {
168
+ return depositDeficit <= BigInt(0);
169
+ }, [depositDeficit]);
170
+ const formattedDepositDeficit = useMemo(() => {
171
+ return formatTokenAmount(BigInt(depositDeficit), srcToken.decimals);
172
+ }, [depositDeficit, srcToken.decimals]);
155
173
  // Unified payment handler for both EOA and AA wallets
156
174
  const handleUnifiedPaymentProcess = useCallback(async () => {
157
175
  let txData;
158
176
  let value;
159
177
  let to;
178
+ // Use the existing depositDeficit calculation to determine amount to send
179
+ const amountToSend = depositDeficit > BigInt(0) ? depositDeficit : BigInt(order.srcAmount);
160
180
  if (isNativeToken(order.srcTokenAddress)) {
161
181
  // Native token transfer
162
182
  to = order.globalAddress;
163
- value = BigInt(order.srcAmount);
183
+ value = amountToSend;
164
184
  }
165
185
  else {
166
186
  // ERC20 token transfer - encode the transfer function call using proper ABI
167
187
  txData = encodeFunctionData({
168
188
  abi: erc20Abi,
169
189
  functionName: "transfer",
170
- args: [order.globalAddress, BigInt(order.srcAmount)],
190
+ args: [order.globalAddress, amountToSend],
171
191
  });
172
192
  to = order.srcTokenAddress;
173
193
  value = BigInt(0);
@@ -176,12 +196,14 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
176
196
  if (txHash) {
177
197
  setTxHash(txHash);
178
198
  }
179
- }, [order, switchChainAndExecuteWithEOA]);
199
+ }, [order, switchChainAndExecuteWithEOA, depositDeficit]);
180
200
  // Main payment handler that triggers chain switch and payment
181
201
  const handlePayment = async () => {
182
202
  console.log("Initiating payment process. Target chain:", order.srcChain, "Current chain:", walletClient?.chain?.id);
183
203
  if (order.srcChain === RELAY_SOLANA_MAINNET_CHAIN_ID) {
184
- await initiatePhantomTransfer(order.srcAmount, order.srcTokenAddress, order.globalAddress);
204
+ // Use the existing depositDeficit calculation to determine amount to send
205
+ const amountToSend = depositDeficit > BigInt(0) ? depositDeficit.toString() : order.srcAmount;
206
+ await initiatePhantomTransfer(amountToSend, order.srcTokenAddress, order.globalAddress);
185
207
  }
186
208
  else {
187
209
  // Use unified payment process for both EOA and AA wallets
@@ -254,12 +276,6 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
254
276
  const formattedActualDstAmount = actualDstAmount
255
277
  ? formatTokenAmount(BigInt(actualDstAmount), dstToken.decimals)
256
278
  : undefined;
257
- const depositedAmount = depositTxs
258
- ? depositTxs.reduce((acc, curr) => acc + BigInt(curr.amount), BigInt(0))
259
- : BigInt(0);
260
- const depositDeficit = BigInt(order.srcAmount) - depositedAmount;
261
- const depositEnoughAmount = depositDeficit <= BigInt(0);
262
- const formattedDepositDeficit = formatTokenAmount(BigInt(depositDeficit), srcToken.decimals);
263
279
  const { text: statusText, status: statusDisplay } = getStatusDisplay(order);
264
280
  const initiatePhantomTransfer = async (amountLamports, tokenAddress, recipientAddress) => {
265
281
  try {
@@ -392,8 +408,8 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
392
408
  }
393
409
  }
394
410
  };
395
- if (refundTxs) {
396
- return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "refund-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
411
+ if (refundTxs.length > 0) {
412
+ return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "refund-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { className: "pl-2", children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
397
413
  ? depositTxs.map(dTx => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
398
414
  ? `Received payment`
399
415
  : `Received ${formatTokenAmount(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
@@ -402,11 +418,13 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
402
418
  : null] }) })] }) }), order.errorDetails && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-as-primary/50 text-center text-sm", style: { maxWidth: "40ch" }, children: getErrorDisplay(order.errorDetails) }) })), _jsx("button", { className: "order-close-button 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" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") })] }));
403
419
  }
404
420
  if (executeTx) {
405
- return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "execute-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
421
+ return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "execute-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { className: "pl-2", children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
406
422
  ? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
407
423
  ? `Received payment`
408
424
  : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
409
- : null, _jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, tx: relayTx, delay: 0.5, isProcessing: false }), _jsx(TransactionDetails, { title: order.type === "swap"
425
+ : null, relayTxs
426
+ ? relayTxs.map(relayTx => (_jsx(TransactionDetails, { title: "Processed Transaction", chainId: relayTx.chain, tx: relayTx, delay: 0.5, isProcessing: false }, relayTx.txHash)))
427
+ : null, _jsx(TransactionDetails, { title: order.type === "swap"
410
428
  ? "Processed Swap"
411
429
  : order.type === "mint_nft"
412
430
  ? "Minted NFT"
@@ -423,40 +441,27 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
423
441
  centerTruncate,
424
442
  }), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && (_jsx("button", { className: "order-close-button 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" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
425
443
  }
426
- if (relayTx && relayTx.status === "success") {
427
- return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "more-details", children: [_jsx(AccordionTrigger, { children: "More Details" }), _jsx(AccordionContent, { children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
444
+ if (relayTxs.length > 0 && relayTxs.every(tx => tx.status === "success")) {
445
+ return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "more-details", children: [_jsx(AccordionTrigger, { children: "More Details" }), _jsx(AccordionContent, { className: "pl-2", children: _jsxs("div", { className: "relative flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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
428
446
  ? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
429
447
  ? `Received payment`
430
448
  : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
431
- : null, order.srcChain === order.dstChain ? (_jsx(TransactionDetails, { title: order.type === "swap"
432
- ? "Processed Swap"
449
+ : null, relayTxs.map(relayTx => (_jsx(TransactionDetails, { title: "Processed Transaction", chainId: relayTx.chain, isProcessing: false, tx: relayTx, delay: 0.5 }))), order.status === "executing" && (_jsx(TransactionDetails, { title: order.type === "swap"
450
+ ? "Processing Swap"
433
451
  : order.type === "mint_nft"
434
- ? "Minted NFT"
452
+ ? "Minting NFT"
435
453
  : order.type === "join_tournament"
436
- ? "Joined Tournament"
454
+ ? "Joining Tournament"
437
455
  : order.type === "fund_tournament"
438
- ? "Funded Tournament"
439
- : "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 })) : (_jsxs(_Fragment, { children: [_jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 }), _jsx(TransactionDetails, { title: order.type === "swap"
440
- ? "Processing Swap"
441
- : order.type === "mint_nft"
442
- ? "Minting NFT"
443
- : order.type === "join_tournament"
444
- ? "Joining Tournament"
445
- : order.type === "fund_tournament"
446
- ? "Funding Tournament"
447
- : "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: executeTx, delay: 1 })] }))] }) })] }) }), _jsx("div", { className: "flex w-full flex-col gap-8", children: _jsx(Button, { variant: "link", asChild: true, children: _jsxs("a", { href: getExplorerTxUrl(order.dstChain, relayTx.txHash), target: "_blank", className: "order-success-text text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
448
- order,
449
- tournament,
450
- formattedActualDstAmount,
451
- dstToken,
452
- recipientName,
453
- centerTruncate,
454
- }), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && (_jsx("button", { className: "order-close-button 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" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
456
+ ? "Funding Tournament"
457
+ : order.type === "hype_duel"
458
+ ? "Depositing Hype Duel"
459
+ : "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: null, delay: 1 }))] }) })] }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && (_jsx("button", { className: "order-close-button 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" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
455
460
  }
456
461
  // This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
457
462
  const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
458
463
  if (depositTxs?.length || waitingForDeposit) {
459
- return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "deposit-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { children: _jsxs("div", { className: "relative flex w-full flex-col gap-6", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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) => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
464
+ return (_jsxs(_Fragment, { children: [_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount }), _jsx(Accordion, { type: "single", collapsible: true, className: "w-full", children: _jsxs(AccordionItem, { value: "deposit-details", children: [_jsx(AccordionTrigger, { children: "Transaction Details" }), _jsx(AccordionContent, { className: "pl-2", children: _jsxs("div", { className: "relative flex w-full flex-col gap-6", children: [_jsx("div", { className: "bg-as-surface-secondary absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(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) => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
460
465
  ? `Received payment`
461
466
  : `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? (_jsx(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? (_jsx(TransactionDetails, { title: order.type === "swap"
462
467
  ? "Processing Swap"
@@ -468,7 +473,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
468
473
  ? "Funding Tournament"
469
474
  : "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
470
475
  ? `Waiting for payment`
471
- : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) })] }));
476
+ : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), !depositEnoughAmount && order.status !== "expired" && (_jsx(InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment }))] }));
472
477
  }
473
478
  return (_jsxs(_Fragment, { children: [statusDisplay === "processing" && (_jsx(_Fragment, { children: order.onrampMetadata ? (_jsx(PaymentVendorUI, { order: order, dstTokenSymbol: dstToken.symbol })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ? (_jsx(ConnectWalletPayment, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
474
479
  // Transfer Crypto Payment Method - Show new card-based UI
@@ -29,10 +29,10 @@ export const OrderStatus = memo(function OrderStatus({ order, selectedCryptoPaym
29
29
  return _jsx(StepProgress, { steps: paymentSteps, currentStepIndex: 0 });
30
30
  }
31
31
  }
32
- if (["relay", "sending_token_from_vault"].includes(order.status)) {
32
+ if (["relay", "executing", "sending_token_from_vault"].includes(order.status)) {
33
33
  return _jsx(StepProgress, { steps: paymentSteps, currentStepIndex: 1 });
34
34
  }
35
- if (!isComplete && displayStatus !== "failure") {
35
+ if (selectedCryptoPaymentMethod === "transfer_crypto" && order.status === "scanning_deposit_transaction") {
36
36
  return null;
37
37
  }
38
38
  return (_jsx("div", { className: "flex items-center justify-center gap-2", children: isComplete ? (_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("div", { className: `bg-as-success-secondary relative flex h-10 w-10 items-center justify-center rounded-full`, children: _jsx(Check, { className: "text-as-content-icon-success h-6 w-6" }) }), _jsx("h2", { className: "text-as-primary mt-4 text-xl font-semibold", children: text }), _jsx("div", { className: "text-as-tertiarry mt-1 text-center", children: description })] })) : (_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("div", { className: "bg-as-error-secondary flex h-10 w-10 items-center justify-center rounded-full text-base", children: _jsx(X, { className: "text-as-content-icon-error h-5 w-5" }) }), _jsx("div", { className: "font-sf-rounded text-as-content-primary mt-4 text-lg font-semibold", children: text }), _jsx("div", { className: "text-as-tertiarry text-center", style: { whiteSpace: "normal" }, children: description })] })) }));
@@ -15,7 +15,7 @@ interface UseAnyspendFlowProps {
15
15
  loadOrder?: string;
16
16
  isDepositMode?: boolean;
17
17
  onOrderSuccess?: (orderId: string) => void;
18
- onTransactionSuccess?: () => void;
18
+ onTransactionSuccess?: (amount?: string) => void;
19
19
  sourceTokenAddress?: string;
20
20
  sourceTokenChainId?: number;
21
21
  slippage?: number;
@@ -31,10 +31,10 @@ export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrd
31
31
  message: string;
32
32
  data: {
33
33
  order: components["schemas"]["Order"];
34
- depositTxs: components["schemas"]["DepositTx"][] | null;
35
- relayTx: components["schemas"]["RelayTx"] | null;
34
+ depositTxs: components["schemas"]["DepositTx"][];
35
+ relayTxs: components["schemas"]["RelayTx"][];
36
36
  executeTx: components["schemas"]["ExecuteTx"] | null;
37
- refundTxs: components["schemas"]["RefundTx"][] | null;
37
+ refundTxs: components["schemas"]["RefundTx"][];
38
38
  };
39
39
  statusCode: number;
40
40
  } | undefined;
@@ -186,9 +186,11 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
186
186
  useEffect(() => {
187
187
  if (oat?.data?.order.status === "executed") {
188
188
  console.log("Order executed successfully");
189
- onTransactionSuccess?.();
189
+ // just get the payload.amount if available from custompayload
190
+ const amount = oat.data.order.payload?.amount;
191
+ onTransactionSuccess?.(amount);
190
192
  }
191
- }, [oat?.data?.order.status, onTransactionSuccess]);
193
+ }, [oat?.data?.order.status, oat?.data?.order.payload, onTransactionSuccess]);
192
194
  return {
193
195
  // State
194
196
  activePanel,
@@ -4,10 +4,10 @@ export declare function useAnyspendOrderAndTransactions(orderId: string | undefi
4
4
  message: string;
5
5
  data: {
6
6
  order: import("../..").components["schemas"]["Order"];
7
- depositTxs: import("../..").components["schemas"]["DepositTx"][] | null;
8
- relayTx: import("../..").components["schemas"]["RelayTx"] | null;
7
+ depositTxs: import("../..").components["schemas"]["DepositTx"][];
8
+ relayTxs: import("../..").components["schemas"]["RelayTx"][];
9
9
  executeTx: import("../..").components["schemas"]["ExecuteTx"] | null;
10
- refundTxs: import("../..").components["schemas"]["RefundTx"][] | null;
10
+ refundTxs: import("../..").components["schemas"]["RefundTx"][];
11
11
  };
12
12
  statusCode: number;
13
13
  } | undefined;
@@ -18,10 +18,10 @@ export declare function useAnyspendOrderAndTransactions(orderId: string | undefi
18
18
  message: string;
19
19
  data: {
20
20
  order: import("../..").components["schemas"]["Order"];
21
- depositTxs: import("../..").components["schemas"]["DepositTx"][] | null;
22
- relayTx: import("../..").components["schemas"]["RelayTx"] | null;
21
+ depositTxs: import("../..").components["schemas"]["DepositTx"][];
22
+ relayTxs: import("../..").components["schemas"]["RelayTx"][];
23
23
  executeTx: import("../..").components["schemas"]["ExecuteTx"] | null;
24
- refundTxs: import("../..").components["schemas"]["RefundTx"][] | null;
24
+ refundTxs: import("../..").components["schemas"]["RefundTx"][];
25
25
  };
26
26
  statusCode: number;
27
27
  }, Error>>;
@@ -8,7 +8,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
8
8
  srcTokenAddress: string;
9
9
  dstTokenAddress: string;
10
10
  srcAmount: string;
11
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
11
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
12
12
  errorDetails: string | null;
13
13
  createdAt: number;
14
14
  expiredAt: number;
@@ -30,7 +30,29 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
30
30
  srcTokenAddress: string;
31
31
  dstTokenAddress: string;
32
32
  srcAmount: string;
33
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
33
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
34
+ errorDetails: string | null;
35
+ createdAt: number;
36
+ expiredAt: number;
37
+ creatorAddress: string | null;
38
+ partnerId: string | null;
39
+ onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
40
+ oneClickBuyUrl: string | null;
41
+ stripePaymentIntentId: string | null;
42
+ } & {
43
+ type: "hype_duel";
44
+ payload: import("../..").components["schemas"]["HypeDuelPayload"];
45
+ metadata: import("../..").components["schemas"]["HypeDuelMetadata"];
46
+ }) | ({
47
+ id: string;
48
+ recipientAddress: string;
49
+ globalAddress: string;
50
+ srcChain: number;
51
+ dstChain: number;
52
+ srcTokenAddress: string;
53
+ dstTokenAddress: string;
54
+ srcAmount: string;
55
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
34
56
  errorDetails: string | null;
35
57
  createdAt: number;
36
58
  expiredAt: number;
@@ -52,7 +74,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
52
74
  srcTokenAddress: string;
53
75
  dstTokenAddress: string;
54
76
  srcAmount: string;
55
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
77
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
56
78
  errorDetails: string | null;
57
79
  createdAt: number;
58
80
  expiredAt: number;
@@ -74,7 +96,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
74
96
  srcTokenAddress: string;
75
97
  dstTokenAddress: string;
76
98
  srcAmount: string;
77
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
99
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
78
100
  errorDetails: string | null;
79
101
  createdAt: number;
80
102
  expiredAt: number;
@@ -96,7 +118,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
96
118
  srcTokenAddress: string;
97
119
  dstTokenAddress: string;
98
120
  srcAmount: string;
99
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
121
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
100
122
  errorDetails: string | null;
101
123
  createdAt: number;
102
124
  expiredAt: number;
@@ -121,7 +143,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
121
143
  srcTokenAddress: string;
122
144
  dstTokenAddress: string;
123
145
  srcAmount: string;
124
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
146
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
125
147
  errorDetails: string | null;
126
148
  createdAt: number;
127
149
  expiredAt: number;
@@ -143,7 +165,29 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
143
165
  srcTokenAddress: string;
144
166
  dstTokenAddress: string;
145
167
  srcAmount: string;
146
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
168
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
169
+ errorDetails: string | null;
170
+ createdAt: number;
171
+ expiredAt: number;
172
+ creatorAddress: string | null;
173
+ partnerId: string | null;
174
+ onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
175
+ oneClickBuyUrl: string | null;
176
+ stripePaymentIntentId: string | null;
177
+ } & {
178
+ type: "hype_duel";
179
+ payload: import("../..").components["schemas"]["HypeDuelPayload"];
180
+ metadata: import("../..").components["schemas"]["HypeDuelMetadata"];
181
+ }) | ({
182
+ id: string;
183
+ recipientAddress: string;
184
+ globalAddress: string;
185
+ srcChain: number;
186
+ dstChain: number;
187
+ srcTokenAddress: string;
188
+ dstTokenAddress: string;
189
+ srcAmount: string;
190
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
147
191
  errorDetails: string | null;
148
192
  createdAt: number;
149
193
  expiredAt: number;
@@ -165,7 +209,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
165
209
  srcTokenAddress: string;
166
210
  dstTokenAddress: string;
167
211
  srcAmount: string;
168
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
212
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
169
213
  errorDetails: string | null;
170
214
  createdAt: number;
171
215
  expiredAt: number;
@@ -187,7 +231,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
187
231
  srcTokenAddress: string;
188
232
  dstTokenAddress: string;
189
233
  srcAmount: string;
190
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
234
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
191
235
  errorDetails: string | null;
192
236
  createdAt: number;
193
237
  expiredAt: number;
@@ -209,7 +253,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
209
253
  srcTokenAddress: string;
210
254
  dstTokenAddress: string;
211
255
  srcAmount: string;
212
- status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
256
+ status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executing" | "executed" | "refunding" | "refunded" | "failure";
213
257
  errorDetails: string | null;
214
258
  createdAt: number;
215
259
  expiredAt: number;
@@ -11,7 +11,7 @@ export function useAnyspendQuote(req) {
11
11
  req.dstChain &&
12
12
  req.srcTokenAddress &&
13
13
  req.dstTokenAddress &&
14
- BigInt(req.type === "swap"
14
+ BigInt(req.type === "swap" || req.type === "hype_duel"
15
15
  ? req.amount
16
16
  : req.type === "mint_nft"
17
17
  ? req.price