@b3dotfun/sdk 0.0.28-alpha.0 → 0.0.28-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/abis/escrow.d.ts +987 -0
- package/dist/cjs/anyspend/abis/escrow.js +1275 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +10 -168
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +10 -0
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +263 -0
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +17 -0
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +53 -0
- package/dist/cjs/anyspend/react/components/common/ErrorSection.d.ts +6 -0
- package/dist/cjs/anyspend/react/components/common/ErrorSection.js +12 -0
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PaySection.d.ts +20 -0
- package/dist/cjs/anyspend/react/components/common/PaySection.js +58 -0
- package/dist/cjs/anyspend/react/components/common/TabSection.d.ts +10 -0
- package/dist/cjs/anyspend/react/components/common/TabSection.js +18 -0
- package/dist/cjs/anyspend/react/components/index.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/index.js +5 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +165 -0
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +184 -0
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +2 -2
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +3 -0
- package/dist/cjs/global-account/react/components/custom/Button.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/button.d.ts +1 -1
- package/dist/cjs/global-account/react/components/ui/command.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useSiwe.native.d.ts +4 -0
- package/dist/cjs/global-account/react/hooks/useSiwe.native.js +40 -0
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +17 -1
- package/dist/cjs/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/cjs/shared/constants/chains/supported.d.ts +3 -3
- package/dist/esm/anyspend/abis/escrow.d.ts +987 -0
- package/dist/esm/anyspend/abis/escrow.js +1272 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +12 -170
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +3 -3
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +10 -0
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +257 -0
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +17 -0
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +50 -0
- package/dist/esm/anyspend/react/components/common/ErrorSection.d.ts +6 -0
- package/dist/esm/anyspend/react/components/common/ErrorSection.js +9 -0
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/esm/anyspend/react/components/common/PaySection.d.ts +20 -0
- package/dist/esm/anyspend/react/components/common/PaySection.js +55 -0
- package/dist/esm/anyspend/react/components/common/TabSection.d.ts +10 -0
- package/dist/esm/anyspend/react/components/common/TabSection.js +15 -0
- package/dist/esm/anyspend/react/components/index.d.ts +2 -0
- package/dist/esm/anyspend/react/components/index.js +2 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +165 -0
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +180 -0
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +2 -2
- package/dist/esm/global-account/react/components/B3DynamicModal.js +3 -0
- package/dist/esm/global-account/react/components/custom/Button.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/button.d.ts +1 -1
- package/dist/esm/global-account/react/components/ui/command.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useSiwe.native.d.ts +4 -0
- package/dist/esm/global-account/react/hooks/useSiwe.native.js +34 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +17 -1
- package/dist/esm/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/esm/shared/constants/chains/supported.d.ts +3 -3
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/abis/escrow.d.ts +987 -0
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +10 -0
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +17 -0
- package/dist/types/anyspend/react/components/common/ErrorSection.d.ts +6 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
- package/dist/types/anyspend/react/components/common/PaySection.d.ts +20 -0
- package/dist/types/anyspend/react/components/common/TabSection.d.ts +10 -0
- package/dist/types/anyspend/react/components/index.d.ts +2 -0
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +165 -0
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +2 -2
- package/dist/types/global-account/react/components/custom/Button.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/button.d.ts +1 -1
- package/dist/types/global-account/react/components/ui/command.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useSiwe.native.d.ts +4 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +17 -1
- package/dist/types/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/types/shared/constants/chains/supported.d.ts +3 -3
- package/package.json +13 -1
- package/src/anyspend/abis/escrow.ts +1272 -0
- package/src/anyspend/react/components/AnySpend.tsx +48 -389
- package/src/anyspend/react/components/AnySpendCustom.tsx +2 -10
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +525 -0
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +152 -0
- package/src/anyspend/react/components/common/ErrorSection.tsx +21 -0
- package/src/anyspend/react/components/common/PanelOnramp.tsx +4 -2
- package/src/anyspend/react/components/common/PaySection.tsx +222 -0
- package/src/anyspend/react/components/common/TabSection.tsx +58 -0
- package/src/anyspend/react/components/index.ts +2 -0
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +226 -0
- package/src/global-account/react/components/B3DynamicModal.tsx +3 -0
- package/src/global-account/react/hooks/useSiwe.native.tsx +40 -0
- package/src/global-account/react/stores/useModalStore.ts +19 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CryptoReceiveSection = CryptoReceiveSection;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const utils_1 = require("../../../../shared/utils");
|
|
6
|
+
const cn_1 = require("../../../../shared/utils/cn");
|
|
7
|
+
const formatAddress_1 = require("../../../../shared/utils/formatAddress");
|
|
8
|
+
const number_1 = require("../../../../shared/utils/number");
|
|
9
|
+
const lucide_react_1 = require("lucide-react");
|
|
10
|
+
const react_1 = require("motion/react");
|
|
11
|
+
const OrderTokenAmount_1 = require("./OrderTokenAmount");
|
|
12
|
+
function CryptoReceiveSection({ isDepositMode = false, isBuyMode = false, selectedRecipientAddress, recipientName, onSelectRecipient, dstAmount, dstToken, selectedDstChainId, setSelectedDstChainId, setSelectedDstToken, onChangeDstAmount, anyspendQuote, }) {
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.1, ease: "easeInOut" }, className: "receive-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-center justify-between", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 flex h-7 items-center text-sm", children: isDepositMode ? "Deposit" : "Receive" }), selectedRecipientAddress ? ((0, jsx_runtime_1.jsx)("button", { className: (0, cn_1.cn)("text-as-tertiarry flex h-7 items-center gap-2 rounded-lg"), onClick: onSelectRecipient, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center gap-1 text-sm", children: recipientName ? (0, utils_1.formatUsername)(recipientName) : (0, formatAddress_1.shortenAddress)(selectedRecipientAddress || "") }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] }) })) : ((0, jsx_runtime_1.jsx)("button", { className: "text-as-primary/70 flex items-center gap-1 rounded-lg", onClick: onSelectRecipient, children: (0, jsx_runtime_1.jsx)("div", { className: "text-sm font-medium", children: "Select recipient" }) }))] }), isBuyMode || isDepositMode ? (
|
|
14
|
+
// Fixed destination token display for buy mode and deposit mode
|
|
15
|
+
(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary text-2xl font-bold", children: dstAmount || "0" }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-brand/10 border-as-brand/30 flex items-center gap-3 rounded-xl border px-4 py-3", children: [dstToken.metadata?.logoURI && ((0, jsx_runtime_1.jsx)("img", { src: dstToken.metadata.logoURI, alt: dstToken.symbol, className: "h-8 w-8 rounded-full" })), (0, jsx_runtime_1.jsx)("span", { className: "text-as-brand text-lg font-bold", children: dstToken.symbol })] })] })) : (
|
|
16
|
+
// Token selection for regular swap mode
|
|
17
|
+
(0, jsx_runtime_1.jsx)(OrderTokenAmount_1.OrderTokenAmount, { address: selectedRecipientAddress, context: "to", inputValue: dstAmount, onChangeInput: onChangeDstAmount || (() => { }), chainId: selectedDstChainId || dstToken.chainId, setChainId: setSelectedDstChainId || (() => { }), token: dstToken, setToken: setSelectedDstToken || (() => { }) })), (0, jsx_runtime_1.jsxs)("div", { className: "text-as-primary/50 flex h-5 items-center text-sm", children: [(0, number_1.formatDisplayNumber)(anyspendQuote?.data?.currencyOut?.amountUsd, {
|
|
18
|
+
style: "currency",
|
|
19
|
+
fallback: "",
|
|
20
|
+
}), anyspendQuote?.data?.currencyIn?.amountUsd &&
|
|
21
|
+
anyspendQuote?.data?.currencyOut?.amountUsd &&
|
|
22
|
+
(() => {
|
|
23
|
+
const calculatePriceImpact = (inputUsd, outputUsd) => {
|
|
24
|
+
if (!inputUsd || !outputUsd) {
|
|
25
|
+
return { percentage: "0.00", isNegative: false };
|
|
26
|
+
}
|
|
27
|
+
const input = Number(inputUsd);
|
|
28
|
+
const output = Number(outputUsd);
|
|
29
|
+
// Handle edge cases
|
|
30
|
+
if (input === 0 || isNaN(input) || isNaN(output) || input <= output) {
|
|
31
|
+
return { percentage: "0.00", isNegative: false };
|
|
32
|
+
}
|
|
33
|
+
const percentageValue = ((output - input) / input) * 100;
|
|
34
|
+
// Handle the -0.00% case
|
|
35
|
+
if (percentageValue > -0.005 && percentageValue < 0) {
|
|
36
|
+
return { percentage: "0.00", isNegative: false };
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
percentage: Math.abs(percentageValue).toFixed(2),
|
|
40
|
+
isNegative: percentageValue < 0,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const { percentage, isNegative } = calculatePriceImpact(anyspendQuote.data.currencyIn.amountUsd, anyspendQuote.data.currencyOut.amountUsd);
|
|
44
|
+
// Parse the percentage as a number for comparison
|
|
45
|
+
const percentageNum = parseFloat(percentage);
|
|
46
|
+
// Don't show if less than 1%
|
|
47
|
+
if (percentageNum < 1) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
// Using inline style to ensure color displays
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: "ml-2", style: { color: percentageNum >= 10 ? "red" : "#FFD700" }, children: ["(", isNegative ? "-" : "", percentage, "%)"] }));
|
|
52
|
+
})()] })] }));
|
|
53
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorSection = ErrorSection;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const lucide_react_1 = require("lucide-react");
|
|
6
|
+
function ErrorSection({ error, message }) {
|
|
7
|
+
if (!error && !message) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
const errorMessage = message || error?.message || "An error occurred";
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "error-section bg-as-on-surface-1 flex w-full max-w-[460px] items-center gap-2 rounded-2xl px-4 py-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleAlert, { className: "bg-as-red h-4 min-h-4 w-4 min-w-4 rounded-full p-0 text-sm font-medium text-white" }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-red text-sm", children: errorMessage })] }));
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
3
|
-
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, }: {
|
|
3
|
+
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, }: {
|
|
4
4
|
srcAmountOnRamp: string;
|
|
5
5
|
setSrcAmountOnRamp: (amount: string) => void;
|
|
6
6
|
selectedPaymentMethod?: FiatPaymentMethod;
|
|
@@ -11,4 +11,5 @@ export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selec
|
|
|
11
11
|
destinationAmount?: string;
|
|
12
12
|
onDestinationTokenChange?: (token: components["schemas"]["Token"]) => void;
|
|
13
13
|
onDestinationChainChange?: (chainId: number) => void;
|
|
14
|
+
fiatPaymentMethodIndex: number;
|
|
14
15
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,7 +12,7 @@ const react_3 = require("react");
|
|
|
12
12
|
const sonner_1 = require("sonner");
|
|
13
13
|
const FiatPaymentMethod_1 = require("./FiatPaymentMethod");
|
|
14
14
|
const OrderTokenAmountFiat_1 = require("./OrderTokenAmountFiat");
|
|
15
|
-
function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, }) {
|
|
15
|
+
function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, }) {
|
|
16
16
|
// Get geo-based onramp options to access fee information
|
|
17
17
|
const { stripeWeb2Support } = (0, react_1.useGeoOnrampOptions)(srcAmountOnRamp);
|
|
18
18
|
// Helper function to get fees from API data
|
|
@@ -69,7 +69,7 @@ function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMetho
|
|
|
69
69
|
const handleQuickAmount = (value) => {
|
|
70
70
|
setSrcAmountOnRamp(value);
|
|
71
71
|
};
|
|
72
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-primary flex w-full flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex h-7 w-full items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm font-bold", children: "Pay" }), (0, jsx_runtime_1.jsx)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm", onClick: () => setActivePanel(
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "panel-onramp bg-as-surface-primary flex w-full flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex h-7 w-full items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry flex items-center text-sm font-bold", children: "Pay" }), (0, jsx_runtime_1.jsx)("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm", onClick: () => setActivePanel(fiatPaymentMethodIndex), children: selectedPaymentMethod === FiatPaymentMethod_1.FiatPaymentMethod.COINBASE_PAY ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-white", children: "C" }) }), "Coinbase Pay"] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : selectedPaymentMethod === FiatPaymentMethod_1.FiatPaymentMethod.STRIPE ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-white", children: "S" }) }), "Stripe"] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Select payment method", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center pb-2 pt-8", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-2xl font-bold", children: "$" }), (0, jsx_runtime_1.jsx)(react_2.Input, { ref: amountInputRef, type: "text", value: srcAmountOnRamp, onChange: handleAmountChange, placeholder: "5", className: "text-as-primary placeholder:text-as-primary/50 h-auto min-w-[70px] border-0 bg-transparent p-0 px-3 pt-1 text-4xl font-bold focus-visible:ring-0 focus-visible:ring-offset-0", style: {
|
|
73
73
|
width: `${Math.max(50, srcAmountOnRamp.length * 34)}px`,
|
|
74
74
|
} })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "mx-auto mb-6 inline-grid grid-cols-4 gap-2", children: ["5", "10", "20", "25"].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
|
|
75
75
|
? "border-as-border-secondary bg-as-surface-secondary"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { components } from "../../../types/api";
|
|
2
|
+
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
3
|
+
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
4
|
+
interface PaySectionProps {
|
|
5
|
+
paymentType: "crypto" | "fiat";
|
|
6
|
+
selectedSrcChainId: number;
|
|
7
|
+
setSelectedSrcChainId: (chainId: number) => void;
|
|
8
|
+
selectedSrcToken: components["schemas"]["Token"];
|
|
9
|
+
setSelectedSrcToken: (token: components["schemas"]["Token"]) => void;
|
|
10
|
+
srcAmount: string;
|
|
11
|
+
setSrcAmount: (amount: string) => void;
|
|
12
|
+
setIsSrcInputDirty: (dirty: boolean) => void;
|
|
13
|
+
selectedCryptoPaymentMethod: CryptoPaymentMethodType;
|
|
14
|
+
selectedFiatPaymentMethod: FiatPaymentMethod;
|
|
15
|
+
onSelectCryptoPaymentMethod: () => void;
|
|
16
|
+
onSelectFiatPaymentMethod: () => void;
|
|
17
|
+
anyspendQuote?: any;
|
|
18
|
+
}
|
|
19
|
+
export declare function PaySection({ paymentType, selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, setIsSrcInputDirty, selectedCryptoPaymentMethod, selectedFiatPaymentMethod, onSelectCryptoPaymentMethod, onSelectFiatPaymentMethod, anyspendQuote, }: PaySectionProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaySection = PaySection;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("../../../../global-account/react");
|
|
6
|
+
const utils_1 = require("../../../../shared/utils");
|
|
7
|
+
const formatAddress_1 = require("../../../../shared/utils/formatAddress");
|
|
8
|
+
const number_1 = require("../../../../shared/utils/number");
|
|
9
|
+
const lucide_react_1 = require("lucide-react");
|
|
10
|
+
const react_2 = require("motion/react");
|
|
11
|
+
const react_3 = require("react");
|
|
12
|
+
const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
|
|
13
|
+
const FiatPaymentMethod_1 = require("./FiatPaymentMethod");
|
|
14
|
+
const OrderTokenAmount_1 = require("./OrderTokenAmount");
|
|
15
|
+
const TokenBalance_1 = require("./TokenBalance");
|
|
16
|
+
function PaySection({ paymentType, selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, setIsSrcInputDirty, selectedCryptoPaymentMethod, selectedFiatPaymentMethod, onSelectCryptoPaymentMethod, onSelectFiatPaymentMethod, anyspendQuote, }) {
|
|
17
|
+
const { address: globalAddress, wallet: globalWallet, ensName: connectedName } = (0, react_1.useAccountWallet)();
|
|
18
|
+
const connectedAddress = globalWallet?.address;
|
|
19
|
+
const { data: srcTokenMetadata } = (0, react_1.useTokenData)(selectedSrcToken?.chainId, selectedSrcToken?.address);
|
|
20
|
+
// Add ref to track if we've applied metadata
|
|
21
|
+
const appliedSrcMetadataRef = (0, react_3.useRef)(false);
|
|
22
|
+
// Update source token with metadata
|
|
23
|
+
(0, react_3.useEffect)(() => {
|
|
24
|
+
if (selectedSrcToken && srcTokenMetadata && !appliedSrcMetadataRef.current) {
|
|
25
|
+
// Mark as applied
|
|
26
|
+
appliedSrcMetadataRef.current = true;
|
|
27
|
+
const enhancedToken = {
|
|
28
|
+
...selectedSrcToken,
|
|
29
|
+
decimals: srcTokenMetadata.decimals || selectedSrcToken.decimals,
|
|
30
|
+
symbol: srcTokenMetadata.symbol || selectedSrcToken.symbol,
|
|
31
|
+
name: srcTokenMetadata.name || selectedSrcToken.name,
|
|
32
|
+
metadata: {
|
|
33
|
+
...selectedSrcToken.metadata,
|
|
34
|
+
logoURI: srcTokenMetadata?.logoURI || selectedSrcToken.metadata.logoURI,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
setSelectedSrcToken(enhancedToken);
|
|
38
|
+
}
|
|
39
|
+
}, [srcTokenMetadata, selectedSrcToken, setSelectedSrcToken]);
|
|
40
|
+
// Reset source token ref when address/chain changes
|
|
41
|
+
(0, react_3.useEffect)(() => {
|
|
42
|
+
appliedSrcMetadataRef.current = false;
|
|
43
|
+
}, [selectedSrcToken.address, selectedSrcToken.chainId]);
|
|
44
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, className: "bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 flex h-7 items-center text-sm", children: "Pay" }), paymentType === "crypto" ? ((0, jsx_runtime_1.jsx)("button", { className: "text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors", onClick: onSelectCryptoPaymentMethod, children: selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.CONNECT_WALLET ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [globalAddress ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: connectedName ? (0, utils_1.formatUsername)(connectedName) : (0, formatAddress_1.shortenAddress)(connectedAddress || "") })) : ("Connect wallet"), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : selectedCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.TRANSFER_CRYPTO ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Transfer crypto", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Select payment method", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) })) : ((0, jsx_runtime_1.jsx)("button", { className: "text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors", onClick: onSelectFiatPaymentMethod, children: selectedFiatPaymentMethod === FiatPaymentMethod_1.FiatPaymentMethod.COINBASE_PAY ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-white", children: "C" }) }), "Coinbase Pay"] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : selectedFiatPaymentMethod === FiatPaymentMethod_1.FiatPaymentMethod.STRIPE ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-bold text-white", children: "S" }) }), "Credit/Debit Card"] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Select payment method", (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "h-4 w-4" })] })) }))] }), paymentType === "crypto" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderTokenAmount_1.OrderTokenAmount, { address: globalAddress, context: "from", inputValue: srcAmount, onChangeInput: value => {
|
|
45
|
+
setIsSrcInputDirty(true);
|
|
46
|
+
setSrcAmount(value);
|
|
47
|
+
}, chainId: selectedSrcChainId, setChainId: setSelectedSrcChainId, token: selectedSrcToken, setToken: setSelectedSrcToken }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary/50 flex h-5 items-center text-sm", children: (0, number_1.formatDisplayNumber)(anyspendQuote?.data?.currencyIn?.amountUsd, {
|
|
48
|
+
style: "currency",
|
|
49
|
+
fallback: "",
|
|
50
|
+
}) }), (0, jsx_runtime_1.jsx)(TokenBalance_1.TokenBalance, { token: selectedSrcToken, walletAddress: globalAddress, onChangeInput: value => {
|
|
51
|
+
setIsSrcInputDirty(true);
|
|
52
|
+
setSrcAmount(value);
|
|
53
|
+
} })] })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center pb-2 pt-8", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-tertiarry text-2xl font-bold", children: "$" }), (0, jsx_runtime_1.jsx)(react_1.Input, { type: "text", value: srcAmount, onChange: e => setSrcAmount(e.target.value.replace(/[^0-9.]/g, "")), placeholder: "5", className: "text-as-primary placeholder:text-as-primary/50 h-auto min-w-[70px] border-0 bg-transparent p-0 px-3 pt-1 text-4xl font-bold focus-visible:ring-0 focus-visible:ring-offset-0", style: {
|
|
54
|
+
width: `${Math.max(50, srcAmount.length * 34)}px`,
|
|
55
|
+
} })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "mx-auto mb-6 inline-grid grid-cols-4 gap-2", children: ["5", "10", "20", "25"].map(value => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => setSrcAmount(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 ${srcAmount === value
|
|
56
|
+
? "border-as-border-secondary bg-as-surface-secondary"
|
|
57
|
+
: "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) })] }))] }));
|
|
58
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
2
|
+
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
3
|
+
interface TabSectionProps {
|
|
4
|
+
activeTab: "crypto" | "fiat";
|
|
5
|
+
setActiveTab: (tab: "crypto" | "fiat") => void;
|
|
6
|
+
setSelectedCryptoPaymentMethod: (method: CryptoPaymentMethodType) => void;
|
|
7
|
+
setSelectedFiatPaymentMethod: (method: FiatPaymentMethod) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, }: TabSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TabSection = TabSection;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const cn_1 = require("../../../../shared/utils/cn");
|
|
6
|
+
const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
|
|
7
|
+
const FiatPaymentMethod_1 = require("./FiatPaymentMethod");
|
|
8
|
+
function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, }) {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "tab-section w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("bg-as-brand absolute bottom-0 left-0 top-0 z-0 rounded-xl transition-transform duration-100", "h-full w-1/2", activeTab === "fiat" ? "translate-x-full" : "translate-x-0"), style: { willChange: "transform" } }), (0, jsx_runtime_1.jsx)("button", { className: (0, cn_1.cn)("relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100", activeTab === "crypto" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent"), onClick: () => {
|
|
10
|
+
setActiveTab("crypto");
|
|
11
|
+
setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE); // Reset payment method when switching to crypto
|
|
12
|
+
setSelectedFiatPaymentMethod(FiatPaymentMethod_1.FiatPaymentMethod.NONE); // Reset fiat payment method when switching to crypto
|
|
13
|
+
}, children: "Pay with crypto" }), (0, jsx_runtime_1.jsx)("button", { className: (0, cn_1.cn)("relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium transition-colors duration-100", activeTab === "fiat" ? "text-white" : "text-as-primary/70 hover:bg-as-on-surface-2 bg-transparent"), onClick: () => {
|
|
14
|
+
setActiveTab("fiat");
|
|
15
|
+
setSelectedCryptoPaymentMethod(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE); // Reset crypto payment method when switching to fiat
|
|
16
|
+
setSelectedFiatPaymentMethod(FiatPaymentMethod_1.FiatPaymentMethod.NONE); // Reset fiat payment method when switching to fiat
|
|
17
|
+
}, children: "Pay with Fiat" })] }) }));
|
|
18
|
+
}
|
|
@@ -9,6 +9,7 @@ export { AnySpendStakeB3 } from "./AnySpendStakeB3";
|
|
|
9
9
|
export { AnySpendTournament } from "./AnySpendTournament";
|
|
10
10
|
export { AnySpendNFTButton } from "./common/AnySpendNFTButton";
|
|
11
11
|
export { ChainTokenIcon } from "./common/ChainTokenIcon";
|
|
12
|
+
export { CryptoReceiveSection } from "./common/CryptoReceiveSection";
|
|
12
13
|
export { OrderDetails } from "./common/OrderDetails";
|
|
13
14
|
export { OrderDetailsCollapsible } from "./common/OrderDetailsCollapsible";
|
|
14
15
|
export { OrderHistory } from "./common/OrderHistory";
|
|
@@ -16,6 +17,7 @@ export { OrderHistoryItem } from "./common/OrderHistoryItem";
|
|
|
16
17
|
export { OrderStatus } from "./common/OrderStatus";
|
|
17
18
|
export { OrderToken } from "./common/OrderToken";
|
|
18
19
|
export { OrderTokenAmount } from "./common/OrderTokenAmount";
|
|
20
|
+
export { PaySection } from "./common/PaySection";
|
|
19
21
|
export { RecipientSelection } from "./common/RecipientSelection";
|
|
20
22
|
export { StepProgress } from "./common/StepProgress";
|
|
21
23
|
export { TokenBalance } from "./common/TokenBalance";
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WebviewOnrampPayment = exports.WebviewOnrampOrderStatus = exports.TransferCryptoDetails = exports.TokenBalance = exports.StepProgress = exports.RecipientSelection = exports.OrderTokenAmount = exports.OrderToken = exports.OrderStatus = exports.OrderHistoryItem = exports.OrderHistory = exports.OrderDetailsCollapsible = exports.OrderDetails = exports.ChainTokenIcon = exports.AnySpendNFTButton = exports.AnySpendTournament = exports.AnySpendStakeB3 = exports.AnyspendSignatureMint = exports.AnySpendNFT = exports.AnySpendCustom = exports.AnySpendBuySpin = exports.AnySpendBondKit = exports.AnySpend = void 0;
|
|
17
|
+
exports.WebviewOnrampPayment = exports.WebviewOnrampOrderStatus = exports.TransferCryptoDetails = exports.TokenBalance = exports.StepProgress = exports.RecipientSelection = exports.PaySection = exports.OrderTokenAmount = exports.OrderToken = exports.OrderStatus = exports.OrderHistoryItem = exports.OrderHistory = exports.OrderDetailsCollapsible = exports.OrderDetails = exports.CryptoReceiveSection = exports.ChainTokenIcon = exports.AnySpendNFTButton = exports.AnySpendTournament = exports.AnySpendStakeB3 = exports.AnyspendSignatureMint = exports.AnySpendNFT = exports.AnySpendCustom = exports.AnySpendBuySpin = exports.AnySpendBondKit = exports.AnySpend = void 0;
|
|
18
18
|
// Components
|
|
19
19
|
var AnySpend_1 = require("./AnySpend");
|
|
20
20
|
Object.defineProperty(exports, "AnySpend", { enumerable: true, get: function () { return AnySpend_1.AnySpend; } });
|
|
@@ -38,6 +38,8 @@ Object.defineProperty(exports, "AnySpendNFTButton", { enumerable: true, get: fun
|
|
|
38
38
|
// Common Components
|
|
39
39
|
var ChainTokenIcon_1 = require("./common/ChainTokenIcon");
|
|
40
40
|
Object.defineProperty(exports, "ChainTokenIcon", { enumerable: true, get: function () { return ChainTokenIcon_1.ChainTokenIcon; } });
|
|
41
|
+
var CryptoReceiveSection_1 = require("./common/CryptoReceiveSection");
|
|
42
|
+
Object.defineProperty(exports, "CryptoReceiveSection", { enumerable: true, get: function () { return CryptoReceiveSection_1.CryptoReceiveSection; } });
|
|
41
43
|
var OrderDetails_1 = require("./common/OrderDetails");
|
|
42
44
|
Object.defineProperty(exports, "OrderDetails", { enumerable: true, get: function () { return OrderDetails_1.OrderDetails; } });
|
|
43
45
|
var OrderDetailsCollapsible_1 = require("./common/OrderDetailsCollapsible");
|
|
@@ -52,6 +54,8 @@ var OrderToken_1 = require("./common/OrderToken");
|
|
|
52
54
|
Object.defineProperty(exports, "OrderToken", { enumerable: true, get: function () { return OrderToken_1.OrderToken; } });
|
|
53
55
|
var OrderTokenAmount_1 = require("./common/OrderTokenAmount");
|
|
54
56
|
Object.defineProperty(exports, "OrderTokenAmount", { enumerable: true, get: function () { return OrderTokenAmount_1.OrderTokenAmount; } });
|
|
57
|
+
var PaySection_1 = require("./common/PaySection");
|
|
58
|
+
Object.defineProperty(exports, "PaySection", { enumerable: true, get: function () { return PaySection_1.PaySection; } });
|
|
55
59
|
var RecipientSelection_1 = require("./common/RecipientSelection");
|
|
56
60
|
Object.defineProperty(exports, "RecipientSelection", { enumerable: true, get: function () { return RecipientSelection_1.RecipientSelection; } });
|
|
57
61
|
var StepProgress_1 = require("./common/StepProgress");
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { components } from "../../types/api";
|
|
2
|
+
import { CryptoPaymentMethodType } from "../components/common/CryptoPaymentMethod";
|
|
3
|
+
import { FiatPaymentMethod } from "../components/common/FiatPaymentMethod";
|
|
4
|
+
export declare enum PanelView {
|
|
5
|
+
MAIN = 0,
|
|
6
|
+
CRYPTO_PAYMENT_METHOD = 1,
|
|
7
|
+
FIAT_PAYMENT_METHOD = 2,
|
|
8
|
+
RECIPIENT_SELECTION = 3,
|
|
9
|
+
ORDER_DETAILS = 4,
|
|
10
|
+
LOADING = 5
|
|
11
|
+
}
|
|
12
|
+
interface UseAnyspendFlowProps {
|
|
13
|
+
paymentType?: "crypto" | "fiat";
|
|
14
|
+
recipientAddress?: string;
|
|
15
|
+
loadOrder?: string;
|
|
16
|
+
isDepositMode?: boolean;
|
|
17
|
+
onOrderSuccess?: (orderId: string) => void;
|
|
18
|
+
onTransactionSuccess?: () => void;
|
|
19
|
+
sourceTokenAddress?: string;
|
|
20
|
+
sourceTokenChainId?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrder, isDepositMode, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, }: UseAnyspendFlowProps): {
|
|
23
|
+
activePanel: PanelView;
|
|
24
|
+
setActivePanel: import("react").Dispatch<import("react").SetStateAction<PanelView>>;
|
|
25
|
+
orderId: string | undefined;
|
|
26
|
+
setOrderId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
27
|
+
oat: {
|
|
28
|
+
success: boolean;
|
|
29
|
+
message: string;
|
|
30
|
+
data: {
|
|
31
|
+
order: components["schemas"]["Order"];
|
|
32
|
+
depositTxs: components["schemas"]["DepositTx"][] | null;
|
|
33
|
+
relayTx: components["schemas"]["RelayTx"] | null;
|
|
34
|
+
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
35
|
+
refundTxs: components["schemas"]["RefundTx"][] | null;
|
|
36
|
+
};
|
|
37
|
+
statusCode: number;
|
|
38
|
+
} | undefined;
|
|
39
|
+
selectedSrcChainId: number;
|
|
40
|
+
setSelectedSrcChainId: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
41
|
+
selectedDstChainId: number;
|
|
42
|
+
setSelectedDstChainId: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
43
|
+
selectedSrcToken: {
|
|
44
|
+
chainId: number;
|
|
45
|
+
address: string;
|
|
46
|
+
symbol: string;
|
|
47
|
+
name: string;
|
|
48
|
+
decimals: number;
|
|
49
|
+
metadata: {
|
|
50
|
+
logoURI?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
setSelectedSrcToken: import("react").Dispatch<import("react").SetStateAction<{
|
|
54
|
+
chainId: number;
|
|
55
|
+
address: string;
|
|
56
|
+
symbol: string;
|
|
57
|
+
name: string;
|
|
58
|
+
decimals: number;
|
|
59
|
+
metadata: {
|
|
60
|
+
logoURI?: string;
|
|
61
|
+
};
|
|
62
|
+
}>>;
|
|
63
|
+
srcAmount: string;
|
|
64
|
+
setSrcAmount: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
65
|
+
dstAmount: string;
|
|
66
|
+
setDstAmount: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
67
|
+
isSrcInputDirty: boolean;
|
|
68
|
+
setIsSrcInputDirty: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
69
|
+
selectedCryptoPaymentMethod: CryptoPaymentMethodType;
|
|
70
|
+
setSelectedCryptoPaymentMethod: import("react").Dispatch<import("react").SetStateAction<CryptoPaymentMethodType>>;
|
|
71
|
+
selectedFiatPaymentMethod: FiatPaymentMethod;
|
|
72
|
+
setSelectedFiatPaymentMethod: import("react").Dispatch<import("react").SetStateAction<FiatPaymentMethod>>;
|
|
73
|
+
selectedRecipientAddress: string | undefined;
|
|
74
|
+
setSelectedRecipientAddress: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
75
|
+
recipientName: string | null | undefined;
|
|
76
|
+
globalAddress: string | undefined;
|
|
77
|
+
anyspendQuote: {
|
|
78
|
+
success: boolean;
|
|
79
|
+
message: string;
|
|
80
|
+
data: {
|
|
81
|
+
operation?: string;
|
|
82
|
+
sender?: string;
|
|
83
|
+
recipient?: string;
|
|
84
|
+
currencyIn?: {
|
|
85
|
+
currency?: {
|
|
86
|
+
chainId?: number;
|
|
87
|
+
address?: string;
|
|
88
|
+
symbol?: string;
|
|
89
|
+
name?: string;
|
|
90
|
+
decimals?: number;
|
|
91
|
+
metadata?: {
|
|
92
|
+
logoURI?: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
amount?: string;
|
|
96
|
+
amountFormatted?: string;
|
|
97
|
+
amountUsd?: string;
|
|
98
|
+
minimumAmount?: string;
|
|
99
|
+
};
|
|
100
|
+
currencyOut?: {
|
|
101
|
+
currency?: {
|
|
102
|
+
chainId?: number;
|
|
103
|
+
address?: string;
|
|
104
|
+
symbol?: string;
|
|
105
|
+
name?: string;
|
|
106
|
+
decimals?: number;
|
|
107
|
+
metadata?: {
|
|
108
|
+
logoURI?: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
amount?: string;
|
|
112
|
+
amountFormatted?: string;
|
|
113
|
+
amountUsd?: string;
|
|
114
|
+
minimumAmount?: string;
|
|
115
|
+
};
|
|
116
|
+
totalImpact?: {
|
|
117
|
+
usd?: string;
|
|
118
|
+
percent?: string;
|
|
119
|
+
};
|
|
120
|
+
swapImpact?: {
|
|
121
|
+
usd?: string;
|
|
122
|
+
percent?: string;
|
|
123
|
+
};
|
|
124
|
+
rate?: string;
|
|
125
|
+
slippageTolerance?: {
|
|
126
|
+
origin?: {
|
|
127
|
+
usd?: string;
|
|
128
|
+
value?: string;
|
|
129
|
+
percent?: string;
|
|
130
|
+
};
|
|
131
|
+
destination?: {
|
|
132
|
+
usd?: string;
|
|
133
|
+
value?: string;
|
|
134
|
+
percent?: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
timeEstimate?: number;
|
|
138
|
+
userBalance?: string;
|
|
139
|
+
};
|
|
140
|
+
statusCode: number;
|
|
141
|
+
} | undefined;
|
|
142
|
+
isLoadingAnyspendQuote: boolean;
|
|
143
|
+
getAnyspendQuoteError: Error | null;
|
|
144
|
+
activeInputAmountInWei: string;
|
|
145
|
+
geoData: import("../../../anyspend/react").GeoData | undefined;
|
|
146
|
+
coinbaseAvailablePaymentMethods: {
|
|
147
|
+
id?: string;
|
|
148
|
+
min?: string;
|
|
149
|
+
max?: string;
|
|
150
|
+
}[];
|
|
151
|
+
stripeWeb2Support: {
|
|
152
|
+
isSupport: false;
|
|
153
|
+
} | {
|
|
154
|
+
isSupport: true;
|
|
155
|
+
formattedTotalUsd: string;
|
|
156
|
+
formattedOnrampUsd: string;
|
|
157
|
+
formattedFeeUsd: string;
|
|
158
|
+
};
|
|
159
|
+
getOnrampVendor: (paymentMethod: FiatPaymentMethod) => "coinbase" | "stripe" | "stripe-web2" | undefined;
|
|
160
|
+
createOrder: import("@tanstack/react-query").UseMutateFunction<any, Error, import("../../../anyspend/react").CreateOrderParams, unknown>;
|
|
161
|
+
isCreatingOrder: boolean;
|
|
162
|
+
createOnrampOrder: import("@tanstack/react-query").UseMutateFunction<any, Error, import("../../../anyspend/react").CreateOnrampOrderParams, unknown>;
|
|
163
|
+
isCreatingOnrampOrder: boolean;
|
|
164
|
+
};
|
|
165
|
+
export {};
|