@b3dotfun/sdk 0.0.49-alpha.0 → 0.0.49-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +8 -4
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +12 -3
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +11 -4
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +2 -2
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +17 -11
- package/dist/cjs/anyspend/react/components/common/FeeBreakDown.d.ts +12 -0
- package/dist/cjs/anyspend/react/components/common/FeeBreakDown.js +19 -0
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.d.ts +8 -0
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +116 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +6 -6
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +36 -21
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +2 -1
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -0
- package/dist/cjs/anyspend/types/api.d.ts +119 -176
- package/dist/cjs/global-account/react/components/ui/tooltip.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +8 -4
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +14 -5
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +11 -4
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +4 -4
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +19 -13
- package/dist/esm/anyspend/react/components/common/FeeBreakDown.d.ts +12 -0
- package/dist/esm/anyspend/react/components/common/FeeBreakDown.js +16 -0
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.d.ts +8 -0
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +113 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +1 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +6 -6
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +1 -0
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +3 -3
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +38 -23
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +2 -1
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +2 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +1 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -0
- package/dist/esm/anyspend/types/api.d.ts +119 -176
- package/dist/esm/global-account/react/components/ui/tooltip.js +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +2 -1
- package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FeeBreakDown.d.ts +12 -0
- package/dist/types/anyspend/react/components/common/FeeDetailPanel.d.ts +8 -0
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +1 -0
- package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +1 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +3 -1
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -0
- package/dist/types/anyspend/types/api.d.ts +119 -176
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +20 -0
- package/src/anyspend/react/components/AnySpendCustom.tsx +69 -7
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +24 -0
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +14 -2
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +31 -11
- package/src/anyspend/react/components/common/FeeBreakDown.tsx +105 -0
- package/src/anyspend/react/components/common/FeeDetailPanel.tsx +334 -0
- package/src/anyspend/react/components/common/OrderDetails.tsx +7 -0
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +13 -0
- package/src/anyspend/react/components/common/PanelOnramp.tsx +58 -27
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +18 -6
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +1 -13
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +1 -0
- package/src/anyspend/types/api.ts +121 -176
- package/src/global-account/react/components/ui/tooltip.tsx +11 -9
|
@@ -12,6 +12,7 @@ interface OrderDetailsProps {
|
|
|
12
12
|
onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void;
|
|
13
13
|
onBack?: () => void;
|
|
14
14
|
disableUrlParamManagement?: boolean;
|
|
15
|
+
points?: number | undefined;
|
|
15
16
|
}
|
|
16
17
|
export declare const OrderDetails: import("react").NamedExoticComponent<OrderDetailsProps>;
|
|
17
18
|
export declare const OrderDetailsLoadingView: import("react/jsx-runtime").JSX.Element;
|
|
@@ -131,7 +131,7 @@ function roundTokenAmount(amount) {
|
|
|
131
131
|
const roundedDecimalPart = digits.join("");
|
|
132
132
|
return `${wholePart}.${roundedDecimalPart}`;
|
|
133
133
|
}
|
|
134
|
-
exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, }) {
|
|
134
|
+
exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points, }) {
|
|
135
135
|
const router = (0, hooks_1.useRouter)();
|
|
136
136
|
const searchParams = (0, hooks_1.useSearchParams)();
|
|
137
137
|
// Get theme from B3Provider context
|
|
@@ -417,7 +417,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
419
|
if (refundTxs.length > 0) {
|
|
420
|
-
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 }), (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_3.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
|
|
420
|
+
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_3.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
421
|
? depositTxs.map(dTx => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
422
422
|
? `Received payment`
|
|
423
423
|
: `Received ${(0, number_1.formatTokenAmount)(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
|
|
@@ -426,7 +426,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
426
426
|
: 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") })] }));
|
|
427
427
|
}
|
|
428
428
|
if (executeTx) {
|
|
429
|
-
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 }), (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_3.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
|
|
429
|
+
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_3.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
|
|
430
430
|
? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
431
431
|
? `Received payment`
|
|
432
432
|
: `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
|
|
@@ -451,7 +451,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
451
451
|
}), (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") }))] }));
|
|
452
452
|
}
|
|
453
453
|
if (relayTxs.length > 0 && relayTxs.every(tx => tx.status === "success")) {
|
|
454
|
-
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 }), (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_3.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
|
|
454
|
+
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_3.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
|
|
455
455
|
? depositTxs.map(dTxs => ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
456
456
|
? `Received payment`
|
|
457
457
|
: `Received ${(0, number_1.formatTokenAmount)(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
|
|
@@ -470,7 +470,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
470
470
|
// This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
|
|
471
471
|
const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
|
|
472
472
|
if (depositTxs?.length || waitingForDeposit) {
|
|
473
|
-
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 }), (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_3.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"
|
|
473
|
+
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_3.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"
|
|
474
474
|
? `Received payment`
|
|
475
475
|
: `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"
|
|
476
476
|
? "Processing Swap"
|
|
@@ -497,7 +497,7 @@ exports.OrderDetails = (0, react_4.memo)(function OrderDetails({ mode = "modal",
|
|
|
497
497
|
? (0, centerTruncate_1.default)(phantomWalletAddress, 6)
|
|
498
498
|
: (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_2.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletTrust, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.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" })] })] })] }) })) : (
|
|
499
499
|
// Default case - existing QR code flow
|
|
500
|
-
(0, jsx_runtime_1.jsx)(react_3.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.RELAY_ETH_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_2.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.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 })), (0, jsx_runtime_1.jsxs)("button", { className: "order-details-cancel-btn flex w-full items-center justify-center gap-2", onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
|
|
500
|
+
(0, jsx_runtime_1.jsx)(react_3.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.RELAY_ETH_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_2.WalletMetamask, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletPhantom, { className: "h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.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: "order-details-cancel-btn flex w-full items-center justify-center gap-2", onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
|
|
501
501
|
});
|
|
502
502
|
function TransactionDetails({ title, chainId, tx, isProcessing, delay, }) {
|
|
503
503
|
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_3.motion.div, { className: "bg-as-surface-secondary relative h-10 w-10 rounded-full", children: isProcessing ? ((0, jsx_runtime_1.jsx)(react_3.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_3.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_3.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_3.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 })] }));
|
|
@@ -13,6 +13,7 @@ interface OrderDetailsCollapsibleProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
showTotal?: boolean;
|
|
15
15
|
totalAmount?: string;
|
|
16
|
+
points?: number;
|
|
16
17
|
}
|
|
17
18
|
export declare const OrderDetailsCollapsible: import("react").NamedExoticComponent<OrderDetailsCollapsibleProps>;
|
|
18
19
|
export {};
|
|
@@ -16,7 +16,7 @@ const react_2 = require("motion/react");
|
|
|
16
16
|
const react_3 = require("react");
|
|
17
17
|
const sonner_1 = require("sonner");
|
|
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, }) {
|
|
19
|
+
exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollapsible({ order, dstToken, tournament, nft, recipientName, formattedExpectedDstAmount, className, showTotal = false, totalAmount, points, }) {
|
|
20
20
|
const [showOrderDetails, setShowOrderDetails] = (0, react_3.useState)(true);
|
|
21
21
|
// Calculate expected amount if not provided
|
|
22
22
|
const expectedDstAmount = order.type === "mint_nft" ||
|
|
@@ -39,5 +39,5 @@ exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollaps
|
|
|
39
39
|
? order.metadata.action
|
|
40
40
|
? (0, anyspend_1.capitalizeFirstLetter)(order.metadata.action)
|
|
41
41
|
: "Contract execution"
|
|
42
|
-
: "" }), (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") })] })] })] }), (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
|
+
: "" }), (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 && points > 0 && ((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: ["+", 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" })] })) }));
|
|
43
43
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { GetQuoteResponse } from "../../../../anyspend/types/api_req_res";
|
|
3
3
|
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
4
|
-
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken, anyspendQuote, onShowPointsDetail, customUsdInputValues, }: {
|
|
4
|
+
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues, }: {
|
|
5
5
|
srcAmountOnRamp: string;
|
|
6
6
|
setSrcAmountOnRamp: (amount: string) => void;
|
|
7
7
|
selectedPaymentMethod?: FiatPaymentMethod;
|
|
@@ -18,5 +18,6 @@ export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selec
|
|
|
18
18
|
hideDstToken?: boolean;
|
|
19
19
|
anyspendQuote?: GetQuoteResponse;
|
|
20
20
|
onShowPointsDetail?: () => void;
|
|
21
|
+
onShowFeeDetail?: () => void;
|
|
21
22
|
customUsdInputValues?: string[];
|
|
22
23
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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
|
-
//
|
|
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
|
|
26
|
-
return 0;
|
|
34
|
+
return 0; // Coinbase has no additional fees
|
|
27
35
|
case FiatPaymentMethod_1.FiatPaymentMethod.STRIPE:
|
|
28
|
-
|
|
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;
|
|
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
|
-
|
|
41
|
-
if (
|
|
42
|
-
|
|
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-
|
|
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)] })
|
|
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.
|
|
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"];
|