@b3dotfun/sdk 0.0.49-alpha.0 → 0.0.49-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 (66) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +2 -1
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +8 -4
  3. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +12 -3
  4. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +10 -3
  5. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  6. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +2 -2
  7. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  8. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +2 -2
  9. package/dist/cjs/anyspend/react/components/common/FeeBreakDown.d.ts +12 -0
  10. package/dist/cjs/anyspend/react/components/common/FeeBreakDown.js +19 -0
  11. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.d.ts +8 -0
  12. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +116 -0
  13. package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
  14. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +36 -21
  15. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +2 -1
  16. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -2
  17. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -1
  18. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +1 -0
  19. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -0
  20. package/dist/cjs/anyspend/types/api.d.ts +119 -176
  21. package/dist/cjs/global-account/react/components/ui/tooltip.js +1 -1
  22. package/dist/esm/anyspend/react/components/AnySpend.d.ts +2 -1
  23. package/dist/esm/anyspend/react/components/AnySpend.js +8 -4
  24. package/dist/esm/anyspend/react/components/AnySpendCustom.js +14 -5
  25. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +10 -3
  26. package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  27. package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +4 -4
  28. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  29. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +4 -4
  30. package/dist/esm/anyspend/react/components/common/FeeBreakDown.d.ts +12 -0
  31. package/dist/esm/anyspend/react/components/common/FeeBreakDown.js +16 -0
  32. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.d.ts +8 -0
  33. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +113 -0
  34. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
  35. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +38 -23
  36. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +2 -1
  37. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +2 -3
  38. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -1
  39. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +1 -0
  40. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -0
  41. package/dist/esm/anyspend/types/api.d.ts +119 -176
  42. package/dist/esm/global-account/react/components/ui/tooltip.js +1 -1
  43. package/dist/styles/index.css +1 -1
  44. package/dist/types/anyspend/react/components/AnySpend.d.ts +2 -1
  45. package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  46. package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  47. package/dist/types/anyspend/react/components/common/FeeBreakDown.d.ts +12 -0
  48. package/dist/types/anyspend/react/components/common/FeeDetailPanel.d.ts +8 -0
  49. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
  50. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -1
  51. package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -0
  52. package/dist/types/anyspend/types/api.d.ts +119 -176
  53. package/package.json +1 -1
  54. package/src/anyspend/react/components/AnySpend.tsx +20 -0
  55. package/src/anyspend/react/components/AnySpendCustom.tsx +69 -7
  56. package/src/anyspend/react/components/AnyspendDepositHype.tsx +23 -0
  57. package/src/anyspend/react/components/common/CryptoPaySection.tsx +14 -2
  58. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +14 -2
  59. package/src/anyspend/react/components/common/FeeBreakDown.tsx +105 -0
  60. package/src/anyspend/react/components/common/FeeDetailPanel.tsx +307 -0
  61. package/src/anyspend/react/components/common/PanelOnramp.tsx +58 -27
  62. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +18 -6
  63. package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -13
  64. package/src/anyspend/react/hooks/useAnyspendFlow.ts +1 -0
  65. package/src/anyspend/types/api.ts +121 -176
  66. package/src/global-account/react/components/ui/tooltip.tsx +11 -9
@@ -14,34 +14,38 @@ const FeatureFlagsContext_1 = require("../../contexts/FeatureFlagsContext");
14
14
  const FiatPaymentMethod_1 = require("./FiatPaymentMethod");
15
15
  const OrderTokenAmountFiat_1 = require("./OrderTokenAmountFiat");
16
16
  const PointsBadge_1 = require("./PointsBadge");
17
- function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken = false, anyspendQuote, onShowPointsDetail, customUsdInputValues = ["5", "10", "20", "25"], }) {
17
+ function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken = false, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues = ["5", "10", "20", "25"], }) {
18
18
  const featureFlags = (0, FeatureFlagsContext_1.useFeatureFlags)();
19
- // Get geo-based onramp options to access fee information
20
- const { stripeWeb2Support } = (0, react_1.useGeoOnrampOptions)(srcAmountOnRamp);
21
- // Helper function to get fees from API data
19
+ // Helper function to get fees from anyspend quote
22
20
  const getFeeFromApi = (paymentMethod) => {
21
+ // Try to get fee from anyspend quote first (most accurate)
22
+ if (anyspendQuote?.data?.fee) {
23
+ const fee = anyspendQuote.data.fee;
24
+ if (fee.type === "stripeweb2_fee") {
25
+ // Calculate total fee in USD from originalAmount - finalAmount
26
+ const originalAmount = Number(fee.originalAmount) / 1e6; // Convert from wei to USD
27
+ const finalAmount = Number(fee.finalAmount) / 1e6;
28
+ return originalAmount - finalAmount;
29
+ }
30
+ }
31
+ // Fallback to payment method defaults
23
32
  switch (paymentMethod) {
24
33
  case FiatPaymentMethod_1.FiatPaymentMethod.COINBASE_PAY:
25
- // Coinbase doesn't provide fee info in API, return 0
26
- return 0;
34
+ return 0; // Coinbase has no additional fees
27
35
  case FiatPaymentMethod_1.FiatPaymentMethod.STRIPE:
28
- // Get fee from Stripe API response
29
- if (stripeWeb2Support && "formattedFeeUsd" in stripeWeb2Support) {
30
- return parseFloat(stripeWeb2Support.formattedFeeUsd) || 0;
31
- }
32
- return null;
36
+ return null; // No quote available yet
33
37
  default:
34
- return null; // No fee when no payment method selected
38
+ return null;
35
39
  }
36
40
  };
37
41
  // Helper function to get total amount from API (for Stripe) or calculate it (for others)
38
42
  const getTotalAmount = (paymentMethod) => {
39
43
  const baseAmount = parseFloat(srcAmountOnRamp) || 5;
40
- const fee = getFeeFromApi(paymentMethod);
41
- if (paymentMethod === FiatPaymentMethod_1.FiatPaymentMethod.STRIPE && stripeWeb2Support && "formattedTotalUsd" in stripeWeb2Support) {
42
- // Use the total from Stripe API if available
43
- return parseFloat(stripeWeb2Support.formattedTotalUsd) || baseAmount;
44
+ // Try to get from anyspend quote first (most accurate)
45
+ if (anyspendQuote?.data?.fee?.type === "stripeweb2_fee") {
46
+ return Number(anyspendQuote.data.fee.originalAmount) / 1e6; // Convert from wei to USD
44
47
  }
48
+ const fee = getFeeFromApi(paymentMethod);
45
49
  // For Coinbase or when fee is available, calculate manually
46
50
  if (fee !== null) {
47
51
  return baseAmount + fee;
@@ -78,10 +82,21 @@ function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMetho
78
82
  .filter(v => !isNaN(Number(v)))
79
83
  .map(value => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleQuickAmount(value), className: `bg-as-surface-secondary border-as-border-secondary hover:border-as-border-secondary h-7 w-14 rounded-lg border text-sm font-medium transition-all duration-200 ${srcAmountOnRamp === value
80
84
  ? "border-as-border-secondary bg-as-surface-secondary"
81
- : "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && !hideDstToken && ((0, jsx_runtime_1.jsx)(OrderTokenAmountFiat_1.OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(recipientSelectionPanelIndex), children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: recipientName ? (0, utils_1.formatUsername)(recipientName) : (0, formatAddress_1.formatAddress)(_recipientAddress) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] })) : ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(5), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "text-as-brand", size: 16 }), "Select recipient", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: "Expected to receive" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: [destinationAmount || "0", " ", dstTokenSymbol || destinationToken?.symbol || ""] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["on ", destinationChainId ? chain_1.ALL_CHAINS[destinationChainId]?.name : ""] }), destinationToken && destinationChainId && destinationToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("img", { src: chain_1.ALL_CHAINS[destinationChainId]?.logoUrl, alt: "Chain", className: "h-4 w-4 rounded-full" }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: (() => {
82
- const fee = getFeeFromApi(selectedPaymentMethod || FiatPaymentMethod_1.FiatPaymentMethod.NONE);
83
- return fee !== null ? `Total (included $${fee.toFixed(2)} fee)` : "Total";
84
- })() }), featureFlags.showPoints &&
85
+ : "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && !hideDstToken && ((0, jsx_runtime_1.jsx)(OrderTokenAmountFiat_1.OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(recipientSelectionPanelIndex), children: [(0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: recipientName ? (0, utils_1.formatUsername)(recipientName) : (0, formatAddress_1.formatAddress)(_recipientAddress) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] })) : ((0, jsx_runtime_1.jsxs)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(5), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "text-as-brand", size: 16 }), "Select recipient", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { size: 16 })] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: "Expected to receive" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: [destinationAmount || "0", " ", dstTokenSymbol || destinationToken?.symbol || ""] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-tertiarry text-sm", children: ["on ", destinationChainId ? chain_1.ALL_CHAINS[destinationChainId]?.name : ""] }), destinationToken && destinationChainId && destinationToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("img", { src: chain_1.ALL_CHAINS[destinationChainId]?.logoUrl, alt: "Chain", className: "h-4 w-4 rounded-full" }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "divider w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-sm", children: "Total" }), anyspendQuote?.data?.fee && onShowFeeDetail && ((0, jsx_runtime_1.jsx)("button", { onClick: onShowFeeDetail, className: "text-as-primary/40 hover:text-as-primary/60 transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Info, { className: "h-4 w-4" }) })), featureFlags.showPoints &&
85
86
  anyspendQuote?.data?.pointsAmount &&
86
- anyspendQuote?.data?.pointsAmount > 0 && ((0, jsx_runtime_1.jsx)(PointsBadge_1.PointsBadge, { pointsAmount: anyspendQuote.data.pointsAmount, pointsMultiplier: anyspendQuote.data.pointsMultiplier, onClick: () => onShowPointsDetail?.() }))] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: ["$", getTotalAmount(selectedPaymentMethod || FiatPaymentMethod_1.FiatPaymentMethod.NONE).toFixed(2)] })] }) })] })] }));
87
+ anyspendQuote?.data?.pointsAmount > 0 && ((0, jsx_runtime_1.jsx)(PointsBadge_1.PointsBadge, { pointsAmount: anyspendQuote.data.pointsAmount, pointsMultiplier: anyspendQuote.data.pointsMultiplier, onClick: () => onShowPointsDetail?.() }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-0.5", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-as-primary font-semibold", children: ["$", getTotalAmount(selectedPaymentMethod || FiatPaymentMethod_1.FiatPaymentMethod.NONE).toFixed(2)] }), (() => {
88
+ // For fiat payments, show the fee from the payment method
89
+ const fiatFee = getFeeFromApi(selectedPaymentMethod || FiatPaymentMethod_1.FiatPaymentMethod.NONE);
90
+ if (fiatFee !== null && fiatFee > 0) {
91
+ return (0, jsx_runtime_1.jsxs)("span", { className: "text-as-secondary text-xs", children: ["incl. $", fiatFee.toFixed(2), " fee"] });
92
+ }
93
+ // For crypto payments (standard_fee), calculate from the quote
94
+ if (anyspendQuote?.data?.fee?.type === "standard_fee" && anyspendQuote.data.currencyIn?.amountUsd) {
95
+ const cryptoFee = (Number(anyspendQuote.data.currencyIn.amountUsd) * anyspendQuote.data.fee.finalFeeBps) / 10000;
96
+ if (cryptoFee > 0) {
97
+ return (0, jsx_runtime_1.jsxs)("span", { className: "text-as-secondary text-xs", children: ["incl. $", cryptoFee.toFixed(2), " fee"] });
98
+ }
99
+ }
100
+ return null;
101
+ })()] })] }) })] })] }));
87
102
  }
@@ -98,7 +98,8 @@ function PanelOnrampPaymentInner(props) {
98
98
  ? "Receive NFT at"
99
99
  : orderType === "join_tournament"
100
100
  ? "Join for"
101
- : "Recipient" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [recipientImageUrl && ((0, jsx_runtime_1.jsx)("img", { src: recipientImageUrl, alt: recipientImageUrl, className: "bg-b3-react-foreground size-7 rounded-full object-cover opacity-100" })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-1", children: [recipientEnsName && (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-foreground/80", children: ["@", recipientEnsName] }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-react-foreground/80", children: (0, centerTruncate_1.default)(recipientAddress) })] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: "border-b3-react-border border-t pt-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-foreground font-semibold", children: "Amount" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-b3-react-foreground hover:text-b3-react-foreground/80 cursor-pointer text-xl font-semibold transition-colors", onClick: onBack, children: ["$", parseFloat(srcAmountOnRamp).toFixed(2)] })] }) })] })] }), isCreatingOrder ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/70", children: "Creating onramp order..." })] })) : isLoading ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/70", children: "Loading payment options..." })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-lg font-semibold", children: "Payment method" }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: coinbaseAvailablePaymentMethods.length > 0 &&
101
+ : "Recipient" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [recipientImageUrl && ((0, jsx_runtime_1.jsx)("img", { src: recipientImageUrl, alt: recipientImageUrl, className: "bg-b3-react-foreground size-7 rounded-full object-cover opacity-100" })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-1", children: [recipientEnsName && (0, jsx_runtime_1.jsxs)("span", { className: "text-b3-react-foreground/80", children: ["@", recipientEnsName] }), (0, jsx_runtime_1.jsx)("span", { className: "text-b3-react-foreground/80", children: (0, centerTruncate_1.default)(recipientAddress) })] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: "border-b3-react-border border-t pt-3", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-b3-react-foreground font-semibold", children: "Amount" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end gap-0.5", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-b3-react-foreground hover:text-b3-react-foreground/80 cursor-pointer text-xl font-semibold transition-colors", onClick: onBack, children: ["$", parseFloat(srcAmountOnRamp).toFixed(2)] }), anyspendQuote?.data?.fee?.type === "standard_fee" && anyspendQuote.data.currencyIn?.amountUsd && ((0, jsx_runtime_1.jsxs)("p", { className: "text-b3-react-foreground/60 text-xs", children: ["incl. $", ((Number(anyspendQuote.data.currencyIn.amountUsd) * anyspendQuote.data.fee.finalFeeBps) /
102
+ 10000).toFixed(2), " ", "fee"] }))] })] }) })] })] }), isCreatingOrder ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/70", children: "Creating onramp order..." })] })) : isLoading ? ((0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "h-4 w-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/70", children: "Loading payment options..." })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-lg font-semibold", children: "Payment method" }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: coinbaseAvailablePaymentMethods.length > 0 &&
102
103
  (() => {
103
104
  const hasCard = coinbaseAvailablePaymentMethods.some(m => m.id === "CARD");
104
105
  const hasApplePay = coinbaseAvailablePaymentMethods.some(m => m.id === "APPLE_PAY");
@@ -7,8 +7,7 @@ exports.PointsDetailPanel = PointsDetailPanel;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("../../../../global-account/react");
9
9
  const cn_1 = require("../../../../shared/utils/cn");
10
- const lucide_react_1 = require("lucide-react");
11
10
  const link_1 = __importDefault(require("next/link"));
12
11
  function PointsDetailPanel({ pointsAmount = 0, onBack }) {
13
- return ((0, jsx_runtime_1.jsxs)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex w-full items-center justify-between", children: (0, jsx_runtime_1.jsxs)(react_1.Button, { variant: "ghost", onClick: onBack, className: "text-as-primary/70 hover:text-as-primary flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ArrowDown, { className: "h-4 w-4 rotate-90" }), "Back"] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-xl font-bold", children: "Earn Points with Every Swap" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-primary/70 text-balance text-sm leading-relaxed", children: ["You'll earn ", (0, jsx_runtime_1.jsxs)("span", { className: "text-as-brand font-semibold", children: ["+", pointsAmount.toLocaleString(), " points"] }), " ", "towards the", " ", (0, jsx_runtime_1.jsx)(link_1.default, { href: "https://anyspend.com/points", target: "_blank", className: "text-as-brand underline", children: "next AnySpend airdrop" }), " ", "when you complete this transaction."] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-primary border-as-border-secondary mt-2 w-full rounded-lg border p-4 text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary mb-2 font-semibold", children: "How it works:" }), (0, jsx_runtime_1.jsxs)("ul", { className: "text-as-primary/70 space-y-1 text-sm", children: [(0, jsx_runtime_1.jsx)("li", { children: "\u2022 Points are earned based on transaction volume" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Higher volume = more points" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Points contribute to future airdrops" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Keep swapping to maximize your rewards" })] })] }), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", onClick: onBack, className: (0, cn_1.cn)("as-main-button !bg-as-brand relative w-full"), textClassName: (0, cn_1.cn)("text-white"), children: "Back to Swap" })] })] }));
12
+ return ((0, jsx_runtime_1.jsx)("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-as-primary text-xl font-bold", children: "Earn Points with Every Swap" }), (0, jsx_runtime_1.jsxs)("p", { className: "text-as-primary/70 text-balance text-sm leading-relaxed", children: ["You'll earn ", (0, jsx_runtime_1.jsxs)("span", { className: "text-as-brand font-semibold", children: ["+", pointsAmount.toLocaleString(), " points"] }), " ", "towards the", " ", (0, jsx_runtime_1.jsx)(link_1.default, { href: "https://anyspend.com/points", target: "_blank", className: "text-as-brand underline", children: "next AnySpend airdrop" }), " ", "when you complete this transaction."] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-primary border-as-border-secondary mt-2 w-full rounded-lg border p-4 text-left", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-as-primary mb-2 font-semibold", children: "How it works:" }), (0, jsx_runtime_1.jsxs)("ul", { className: "text-as-primary/70 space-y-1 text-sm", children: [(0, jsx_runtime_1.jsx)("li", { children: "\u2022 Points are earned based on transaction volume" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Higher volume = more points" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Points contribute to future airdrops" }), (0, jsx_runtime_1.jsx)("li", { children: "\u2022 Keep swapping to maximize your rewards" })] })] }), (0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", onClick: onBack, className: (0, cn_1.cn)("as-main-button !bg-as-brand relative w-full"), textClassName: (0, cn_1.cn)("text-white"), children: "Back to Swap" })] }) }));
14
13
  }
@@ -8,7 +8,8 @@ export declare enum PanelView {
8
8
  RECIPIENT_SELECTION = 3,
9
9
  ORDER_DETAILS = 4,
10
10
  LOADING = 5,
11
- POINTS_DETAIL = 6
11
+ POINTS_DETAIL = 6,
12
+ FEE_DETAIL = 7
12
13
  }
13
14
  interface UseAnyspendFlowProps {
14
15
  paymentType?: "crypto" | "fiat";
@@ -144,6 +145,7 @@ export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrd
144
145
  userBalance?: string;
145
146
  pointsAmount?: number;
146
147
  pointsMultiplier?: number;
148
+ fee: components["schemas"]["Fee"];
147
149
  };
148
150
  statusCode: number;
149
151
  } | undefined;
@@ -23,6 +23,7 @@ var PanelView;
23
23
  PanelView[PanelView["ORDER_DETAILS"] = 4] = "ORDER_DETAILS";
24
24
  PanelView[PanelView["LOADING"] = 5] = "LOADING";
25
25
  PanelView[PanelView["POINTS_DETAIL"] = 6] = "POINTS_DETAIL";
26
+ PanelView[PanelView["FEE_DETAIL"] = 7] = "FEE_DETAIL";
26
27
  })(PanelView || (exports.PanelView = PanelView = {}));
27
28
  function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder, isDepositMode = false, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, slippage = 0, disableUrlParamManagement = false, }) {
28
29
  const searchParams = (0, react_2.useSearchParamsSSR)();
@@ -13,6 +13,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
13
13
  createdAt: number;
14
14
  expiredAt: number;
15
15
  filledAt: number | null;
16
+ receivedDepositAt: number | null;
16
17
  creatorAddress: string | null;
17
18
  partnerId: string | null;
18
19
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -21,6 +22,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
21
22
  settlement: {
22
23
  actualDstAmount: string | null;
23
24
  } | null;
25
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
24
26
  } & {
25
27
  type: "swap";
26
28
  payload: import("../..").components["schemas"]["SwapPayload"];
@@ -39,6 +41,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
39
41
  createdAt: number;
40
42
  expiredAt: number;
41
43
  filledAt: number | null;
44
+ receivedDepositAt: number | null;
42
45
  creatorAddress: string | null;
43
46
  partnerId: string | null;
44
47
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -47,6 +50,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
47
50
  settlement: {
48
51
  actualDstAmount: string | null;
49
52
  } | null;
53
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
50
54
  } & {
51
55
  type: "hype_duel";
52
56
  payload: import("../..").components["schemas"]["HypeDuelPayload"];
@@ -65,6 +69,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
65
69
  createdAt: number;
66
70
  expiredAt: number;
67
71
  filledAt: number | null;
72
+ receivedDepositAt: number | null;
68
73
  creatorAddress: string | null;
69
74
  partnerId: string | null;
70
75
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -73,6 +78,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
73
78
  settlement: {
74
79
  actualDstAmount: string | null;
75
80
  } | null;
81
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
76
82
  } & {
77
83
  type: "custom";
78
84
  payload: import("../..").components["schemas"]["CustomPayload"];
@@ -91,6 +97,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
91
97
  createdAt: number;
92
98
  expiredAt: number;
93
99
  filledAt: number | null;
100
+ receivedDepositAt: number | null;
94
101
  creatorAddress: string | null;
95
102
  partnerId: string | null;
96
103
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -99,6 +106,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
99
106
  settlement: {
100
107
  actualDstAmount: string | null;
101
108
  } | null;
109
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
102
110
  } & {
103
111
  type: "mint_nft";
104
112
  payload: import("../..").components["schemas"]["MintNftPayload"];
@@ -117,6 +125,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
117
125
  createdAt: number;
118
126
  expiredAt: number;
119
127
  filledAt: number | null;
128
+ receivedDepositAt: number | null;
120
129
  creatorAddress: string | null;
121
130
  partnerId: string | null;
122
131
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -125,6 +134,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
125
134
  settlement: {
126
135
  actualDstAmount: string | null;
127
136
  } | null;
137
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
128
138
  } & {
129
139
  type: "join_tournament";
130
140
  payload: import("../..").components["schemas"]["JoinTournamentPayload"];
@@ -143,6 +153,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
143
153
  createdAt: number;
144
154
  expiredAt: number;
145
155
  filledAt: number | null;
156
+ receivedDepositAt: number | null;
146
157
  creatorAddress: string | null;
147
158
  partnerId: string | null;
148
159
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -151,6 +162,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
151
162
  settlement: {
152
163
  actualDstAmount: string | null;
153
164
  } | null;
165
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
154
166
  } & {
155
167
  type: "fund_tournament";
156
168
  payload: import("../..").components["schemas"]["FundTournamentPayload"];
@@ -172,6 +184,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
172
184
  createdAt: number;
173
185
  expiredAt: number;
174
186
  filledAt: number | null;
187
+ receivedDepositAt: number | null;
175
188
  creatorAddress: string | null;
176
189
  partnerId: string | null;
177
190
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -180,6 +193,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
180
193
  settlement: {
181
194
  actualDstAmount: string | null;
182
195
  } | null;
196
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
183
197
  } & {
184
198
  type: "swap";
185
199
  payload: import("../..").components["schemas"]["SwapPayload"];
@@ -198,6 +212,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
198
212
  createdAt: number;
199
213
  expiredAt: number;
200
214
  filledAt: number | null;
215
+ receivedDepositAt: number | null;
201
216
  creatorAddress: string | null;
202
217
  partnerId: string | null;
203
218
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -206,6 +221,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
206
221
  settlement: {
207
222
  actualDstAmount: string | null;
208
223
  } | null;
224
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
209
225
  } & {
210
226
  type: "hype_duel";
211
227
  payload: import("../..").components["schemas"]["HypeDuelPayload"];
@@ -224,6 +240,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
224
240
  createdAt: number;
225
241
  expiredAt: number;
226
242
  filledAt: number | null;
243
+ receivedDepositAt: number | null;
227
244
  creatorAddress: string | null;
228
245
  partnerId: string | null;
229
246
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -232,6 +249,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
232
249
  settlement: {
233
250
  actualDstAmount: string | null;
234
251
  } | null;
252
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
235
253
  } & {
236
254
  type: "custom";
237
255
  payload: import("../..").components["schemas"]["CustomPayload"];
@@ -250,6 +268,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
250
268
  createdAt: number;
251
269
  expiredAt: number;
252
270
  filledAt: number | null;
271
+ receivedDepositAt: number | null;
253
272
  creatorAddress: string | null;
254
273
  partnerId: string | null;
255
274
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -258,6 +277,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
258
277
  settlement: {
259
278
  actualDstAmount: string | null;
260
279
  } | null;
280
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
261
281
  } & {
262
282
  type: "mint_nft";
263
283
  payload: import("../..").components["schemas"]["MintNftPayload"];
@@ -276,6 +296,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
276
296
  createdAt: number;
277
297
  expiredAt: number;
278
298
  filledAt: number | null;
299
+ receivedDepositAt: number | null;
279
300
  creatorAddress: string | null;
280
301
  partnerId: string | null;
281
302
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -284,6 +305,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
284
305
  settlement: {
285
306
  actualDstAmount: string | null;
286
307
  } | null;
308
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
287
309
  } & {
288
310
  type: "join_tournament";
289
311
  payload: import("../..").components["schemas"]["JoinTournamentPayload"];
@@ -302,6 +324,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
302
324
  createdAt: number;
303
325
  expiredAt: number;
304
326
  filledAt: number | null;
327
+ receivedDepositAt: number | null;
305
328
  creatorAddress: string | null;
306
329
  partnerId: string | null;
307
330
  onrampMetadata: import("../..").components["schemas"]["OnrampMetadata"] | null;
@@ -310,6 +333,7 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
310
333
  settlement: {
311
334
  actualDstAmount: string | null;
312
335
  } | null;
336
+ fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
313
337
  } & {
314
338
  type: "fund_tournament";
315
339
  payload: import("../..").components["schemas"]["FundTournamentPayload"];