@b3dotfun/sdk 0.1.2-alpha.0 → 0.1.2-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 +3 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +12 -6
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +10 -4
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +19 -4
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/QRDeposit.js +12 -4
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +7 -5
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +15 -6
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +7 -4
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +3 -2
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +2 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +3 -2
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +5 -2
- package/dist/cjs/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/TabSection.js +16 -7
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
- package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/cjs/anyspend/react/components/common/WarningText.js +5 -6
- package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/cjs/anyspend/react/components/types/classes.js +6 -0
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +12 -6
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +10 -4
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +19 -4
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/esm/anyspend/react/components/QRDeposit.js +12 -4
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +7 -5
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +15 -6
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +7 -4
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +3 -2
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +2 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +3 -2
- package/dist/esm/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/esm/anyspend/react/components/common/RecipientSelection.js +5 -2
- package/dist/esm/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/TabSection.js +16 -7
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
- package/dist/esm/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/esm/anyspend/react/components/common/WarningText.js +5 -6
- package/dist/esm/anyspend/react/components/index.d.ts +1 -0
- package/dist/esm/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/esm/anyspend/react/components/types/classes.js +5 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/types/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/types/anyspend/react/components/index.d.ts +1 -0
- package/dist/types/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +3 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +41 -20
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +31 -13
- package/src/anyspend/react/components/AnySpendDeposit.tsx +171 -52
- package/src/anyspend/react/components/QRDeposit.tsx +91 -35
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +31 -19
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +14 -4
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +43 -23
- package/src/anyspend/react/components/common/FeeDetailPanel.tsx +53 -32
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +26 -13
- package/src/anyspend/react/components/common/OrderDetails.tsx +16 -3
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +5 -1
- package/src/anyspend/react/components/common/OrderHistory.tsx +2 -1
- package/src/anyspend/react/components/common/PanelOnramp.tsx +4 -1
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +118 -40
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +28 -14
- package/src/anyspend/react/components/common/RecipientSelection.tsx +20 -5
- package/src/anyspend/react/components/common/TabSection.tsx +21 -12
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +12 -4
- package/src/anyspend/react/components/common/WarningText.tsx +10 -10
- package/src/anyspend/react/components/index.ts +16 -0
- package/src/anyspend/react/components/types/classes.ts +476 -0
- package/src/global-account/react/stores/useModalStore.ts +3 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
3
|
+
import type { TransferCryptoDetailsClasses } from "../types/classes";
|
|
3
4
|
type Order = components["schemas"]["Order"];
|
|
4
5
|
type Token = components["schemas"]["Token"];
|
|
5
6
|
type Tournament = components["schemas"]["Tournament"];
|
|
@@ -13,6 +14,7 @@ interface TransferCryptoDetailsProps {
|
|
|
13
14
|
onBack: () => void;
|
|
14
15
|
recipientName?: string;
|
|
15
16
|
onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void;
|
|
17
|
+
classes?: TransferCryptoDetailsClasses;
|
|
16
18
|
}
|
|
17
19
|
export declare const TransferCryptoDetails: import("react").NamedExoticComponent<TransferCryptoDetailsProps>;
|
|
18
20
|
export {};
|
|
@@ -15,7 +15,7 @@ const chains_1 = require("viem/chains");
|
|
|
15
15
|
const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
|
|
16
16
|
const OrderDetailsCollapsible_1 = require("./OrderDetailsCollapsible");
|
|
17
17
|
const PaymentMethodSwitch_1 = require("./PaymentMethodSwitch");
|
|
18
|
-
exports.TransferCryptoDetails = (0, react_3.memo)(function TransferCryptoDetails({ order, srcToken, dstToken, tournament, nft, onBack, recipientName, onPaymentMethodChange, }) {
|
|
18
|
+
exports.TransferCryptoDetails = (0, react_3.memo)(function TransferCryptoDetails({ order, srcToken, dstToken, tournament, nft, onBack, recipientName, onPaymentMethodChange, classes, }) {
|
|
19
19
|
const [timeLeft, setTimeLeft] = (0, react_3.useState)(0);
|
|
20
20
|
(0, react_3.useEffect)(() => {
|
|
21
21
|
const calculateTimeLeft = () => {
|
|
@@ -66,7 +66,8 @@ exports.TransferCryptoDetails = (0, react_3.memo)(function TransferCryptoDetails
|
|
|
66
66
|
navigator.clipboard.writeText(order.globalAddress);
|
|
67
67
|
react_1.toast.success("Deposit address copied to clipboard");
|
|
68
68
|
};
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-header flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className:
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: classes?.container || "order-transfer-crypto flex w-full flex-col gap-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: classes?.header || "order-transfer-crypto-header flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onBack, className: classes?.backButton ||
|
|
70
|
+
"order-transfer-crypto-back-btn text-as-primary/60 hover:text-as-primary flex h-10 w-10 items-center justify-center rounded-full transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { size: 24, className: "text-as-quaternary" }) }), (0, jsx_runtime_1.jsx)("h2", { className: classes?.title || "order-transfer-crypto-title text-as-primary text-lg font-semibold", children: "Transfer crypto" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-timer relative flex h-11 w-11 items-center justify-center", children: [(0, jsx_runtime_1.jsxs)("svg", { className: "order-transfer-crypto-timer-svg h-11 w-11 -rotate-90", viewBox: "0 0 44 44", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "22", cy: "22", r: "18", stroke: "currentColor", strokeWidth: "3", fill: "none", className: "order-transfer-crypto-timer-bg text-gray-200" }), (0, jsx_runtime_1.jsx)("circle", { cx: "22", cy: "22", r: "18", stroke: "currentColor", strokeWidth: "3", fill: "none", strokeLinecap: "round", className: "order-transfer-crypto-timer-progress text-blue-500", strokeDasharray: `${2 * Math.PI * 18}`, strokeDashoffset: `${2 * Math.PI * 18 * (1 - timeLeft / totalTime)}`, style: {
|
|
70
71
|
transition: "stroke-dashoffset 1s linear",
|
|
71
72
|
} })] }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-timer-text absolute inset-0 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary text-[10px] font-semibold", children: formatTime(timeLeft) }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-content flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-cards flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-amount-card w-full", children: [(0, jsx_runtime_1.jsx)("span", { className: "order-transfer-crypto-amount-label text-as-content-secondary text-sm font-medium", children: "Amount" }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-amount-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: roundedUpSrcAmount || "", onCopy: () => {
|
|
72
73
|
react_1.toast.success("Amount copied to clipboard");
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ChainWarningTextClasses, WarningTextClasses } from "../types/classes";
|
|
1
2
|
export interface WarningTextProps {
|
|
2
3
|
/** The warning message content */
|
|
3
4
|
children: React.ReactNode;
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/** Custom classes for styling */
|
|
6
|
+
classes?: WarningTextClasses;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* A generic warning text component with consistent styling.
|
|
@@ -12,12 +13,12 @@ export interface WarningTextProps {
|
|
|
12
13
|
* Custom warning message
|
|
13
14
|
* </WarningText>
|
|
14
15
|
*/
|
|
15
|
-
export declare function WarningText({ children,
|
|
16
|
+
export declare function WarningText({ children, classes }: WarningTextProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export interface ChainWarningTextProps {
|
|
17
18
|
/** The chain ID to display warning for */
|
|
18
19
|
chainId: number;
|
|
19
|
-
/**
|
|
20
|
-
|
|
20
|
+
/** Custom classes for styling */
|
|
21
|
+
classes?: ChainWarningTextClasses;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* A chain-aware warning text component that displays chain-specific warnings.
|
|
@@ -27,6 +28,6 @@ export interface ChainWarningTextProps {
|
|
|
27
28
|
* <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
|
-
* <ChainWarningText chainId={destinationChainId}
|
|
31
|
+
* <ChainWarningText chainId={destinationChainId} classes={{ root: "my-custom-class" }} />
|
|
31
32
|
*/
|
|
32
|
-
export declare function ChainWarningText({ chainId,
|
|
33
|
+
export declare function ChainWarningText({ chainId, classes }: ChainWarningTextProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -4,7 +4,6 @@ exports.WarningText = WarningText;
|
|
|
4
4
|
exports.ChainWarningText = ChainWarningText;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const anyspend_1 = require("../../../../anyspend");
|
|
7
|
-
const cn_1 = require("../../../../shared/utils/cn");
|
|
8
7
|
/**
|
|
9
8
|
* A generic warning text component with consistent styling.
|
|
10
9
|
*
|
|
@@ -13,8 +12,8 @@ const cn_1 = require("../../../../shared/utils/cn");
|
|
|
13
12
|
* Custom warning message
|
|
14
13
|
* </WarningText>
|
|
15
14
|
*/
|
|
16
|
-
function WarningText({ children,
|
|
17
|
-
return (0, jsx_runtime_1.jsx)("p", { className:
|
|
15
|
+
function WarningText({ children, classes }) {
|
|
16
|
+
return (0, jsx_runtime_1.jsx)("p", { className: classes?.root || "anyspend-warning text-center text-xs italic text-red-500", children: children });
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* A chain-aware warning text component that displays chain-specific warnings.
|
|
@@ -24,12 +23,12 @@ function WarningText({ children, className }) {
|
|
|
24
23
|
* <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
|
|
25
24
|
*
|
|
26
25
|
* @example
|
|
27
|
-
* <ChainWarningText chainId={destinationChainId}
|
|
26
|
+
* <ChainWarningText chainId={destinationChainId} classes={{ root: "my-custom-class" }} />
|
|
28
27
|
*/
|
|
29
|
-
function ChainWarningText({ chainId,
|
|
28
|
+
function ChainWarningText({ chainId, classes }) {
|
|
30
29
|
// Chain-specific warning messages
|
|
31
30
|
if (chainId === anyspend_1.HYPERLIQUID_CHAIN_ID) {
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(WarningText, {
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(WarningText, { classes: classes, children: ["Minimum deposit amount: ", (0, jsx_runtime_1.jsx)("b", { children: "$1" })] }));
|
|
33
32
|
}
|
|
34
33
|
// No warning for this chain
|
|
35
34
|
return null;
|
|
@@ -6,6 +6,7 @@ export { AnySpendCustom } from "./AnySpendCustom";
|
|
|
6
6
|
export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
7
7
|
export { AnySpendDeposit } from "./AnySpendDeposit";
|
|
8
8
|
export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
|
|
9
|
+
export type { AnySpendAllClasses, AnySpendClasses, AnySpendCustomExactInClasses, AnySpendDepositClasses, CryptoPaymentMethodClasses, CryptoPaySectionClasses, CryptoReceiveSectionClasses, FiatPaymentMethodClasses, OrderDetailsClasses, PanelOnrampClasses, QRDepositClasses, RecipientSelectionClasses, } from "./types/classes";
|
|
9
10
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
|
|
10
11
|
export * from "./AnySpendFingerprintWrapper";
|
|
11
12
|
export { AnySpendNFT } from "./AnySpendNFT";
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classes prop types for AnySpend components customization.
|
|
3
|
+
* Use these to override default styling of specific elements.
|
|
4
|
+
*/
|
|
5
|
+
/** Classes for AnySpendDeposit component */
|
|
6
|
+
export interface AnySpendDepositClasses {
|
|
7
|
+
root?: string;
|
|
8
|
+
chainSelection?: string;
|
|
9
|
+
form?: string;
|
|
10
|
+
formContent?: string;
|
|
11
|
+
closeButton?: string;
|
|
12
|
+
balanceContainer?: string;
|
|
13
|
+
balanceLabel?: string;
|
|
14
|
+
balanceValue?: string;
|
|
15
|
+
optionsContainer?: string;
|
|
16
|
+
chainsSkeleton?: string;
|
|
17
|
+
skeletonItem?: string;
|
|
18
|
+
chainsContainer?: string;
|
|
19
|
+
chainButton?: string;
|
|
20
|
+
chainContent?: string;
|
|
21
|
+
chainInfo?: string;
|
|
22
|
+
chainName?: string;
|
|
23
|
+
chainIcon?: string;
|
|
24
|
+
chainBalance?: string;
|
|
25
|
+
chainChevron?: string;
|
|
26
|
+
generalOptions?: string;
|
|
27
|
+
optionButton?: string;
|
|
28
|
+
cryptoButton?: string;
|
|
29
|
+
qrButton?: string;
|
|
30
|
+
fiatButton?: string;
|
|
31
|
+
optionContent?: string;
|
|
32
|
+
optionInfo?: string;
|
|
33
|
+
optionTitle?: string;
|
|
34
|
+
optionDescription?: string;
|
|
35
|
+
optionIcon?: string;
|
|
36
|
+
optionChevron?: string;
|
|
37
|
+
divider?: string;
|
|
38
|
+
dividerLine?: string;
|
|
39
|
+
dividerText?: string;
|
|
40
|
+
backButton?: string;
|
|
41
|
+
backIcon?: string;
|
|
42
|
+
backText?: string;
|
|
43
|
+
header?: string;
|
|
44
|
+
title?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Classes for AnySpend component */
|
|
47
|
+
export interface AnySpendClasses {
|
|
48
|
+
root?: string;
|
|
49
|
+
container?: string;
|
|
50
|
+
header?: string;
|
|
51
|
+
headerLogo?: string;
|
|
52
|
+
headerTitle?: string;
|
|
53
|
+
tabSection?: string;
|
|
54
|
+
tabList?: string;
|
|
55
|
+
tabTrigger?: string;
|
|
56
|
+
tabTriggerActive?: string;
|
|
57
|
+
mainContent?: string;
|
|
58
|
+
inputSection?: string;
|
|
59
|
+
swapDirectionButton?: string;
|
|
60
|
+
mainButton?: string;
|
|
61
|
+
mainButtonDisabled?: string;
|
|
62
|
+
mainButtonError?: string;
|
|
63
|
+
historyButton?: string;
|
|
64
|
+
bottomNavigation?: string;
|
|
65
|
+
gasIndicator?: string;
|
|
66
|
+
}
|
|
67
|
+
/** Classes for AnySpendCustomExactIn component */
|
|
68
|
+
export interface AnySpendCustomExactInClasses {
|
|
69
|
+
root?: string;
|
|
70
|
+
container?: string;
|
|
71
|
+
header?: string;
|
|
72
|
+
headerTitle?: string;
|
|
73
|
+
headerDescription?: string;
|
|
74
|
+
contentArea?: string;
|
|
75
|
+
inputSection?: string;
|
|
76
|
+
swapDirectionButton?: string;
|
|
77
|
+
mainButton?: string;
|
|
78
|
+
mainButtonDisabled?: string;
|
|
79
|
+
mainButtonError?: string;
|
|
80
|
+
footer?: string;
|
|
81
|
+
gasIndicator?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Classes for CryptoPaySection component */
|
|
84
|
+
export interface CryptoPaySectionClasses {
|
|
85
|
+
root?: string;
|
|
86
|
+
container?: string;
|
|
87
|
+
label?: string;
|
|
88
|
+
inputContainer?: string;
|
|
89
|
+
input?: string;
|
|
90
|
+
tokenSelector?: string;
|
|
91
|
+
tokenIcon?: string;
|
|
92
|
+
tokenSymbol?: string;
|
|
93
|
+
chainBadge?: string;
|
|
94
|
+
balanceRow?: string;
|
|
95
|
+
balanceLabel?: string;
|
|
96
|
+
balanceValue?: string;
|
|
97
|
+
maxButton?: string;
|
|
98
|
+
paymentMethodButton?: string;
|
|
99
|
+
feeRow?: string;
|
|
100
|
+
}
|
|
101
|
+
/** Classes for CryptoReceiveSection component */
|
|
102
|
+
export interface CryptoReceiveSectionClasses {
|
|
103
|
+
root?: string;
|
|
104
|
+
container?: string;
|
|
105
|
+
label?: string;
|
|
106
|
+
inputContainer?: string;
|
|
107
|
+
input?: string;
|
|
108
|
+
tokenSelector?: string;
|
|
109
|
+
tokenIcon?: string;
|
|
110
|
+
tokenSymbol?: string;
|
|
111
|
+
chainBadge?: string;
|
|
112
|
+
recipientRow?: string;
|
|
113
|
+
recipientLabel?: string;
|
|
114
|
+
recipientValue?: string;
|
|
115
|
+
recipientButton?: string;
|
|
116
|
+
pointsRow?: string;
|
|
117
|
+
feeRow?: string;
|
|
118
|
+
}
|
|
119
|
+
/** Classes for PanelOnramp component */
|
|
120
|
+
export interface PanelOnrampClasses {
|
|
121
|
+
root?: string;
|
|
122
|
+
container?: string;
|
|
123
|
+
amountInput?: string;
|
|
124
|
+
presetButtons?: string;
|
|
125
|
+
presetButton?: string;
|
|
126
|
+
paymentMethodRow?: string;
|
|
127
|
+
recipientRow?: string;
|
|
128
|
+
destinationRow?: string;
|
|
129
|
+
feeRow?: string;
|
|
130
|
+
pointsRow?: string;
|
|
131
|
+
}
|
|
132
|
+
/** Classes for OrderDetails component */
|
|
133
|
+
export interface OrderDetailsClasses {
|
|
134
|
+
root?: string;
|
|
135
|
+
container?: string;
|
|
136
|
+
header?: string;
|
|
137
|
+
statusBadge?: string;
|
|
138
|
+
statusPending?: string;
|
|
139
|
+
statusSuccess?: string;
|
|
140
|
+
statusFailed?: string;
|
|
141
|
+
amountSection?: string;
|
|
142
|
+
detailsSection?: string;
|
|
143
|
+
detailRow?: string;
|
|
144
|
+
detailLabel?: string;
|
|
145
|
+
detailValue?: string;
|
|
146
|
+
transactionLink?: string;
|
|
147
|
+
actionButton?: string;
|
|
148
|
+
backButton?: string;
|
|
149
|
+
returnButton?: string;
|
|
150
|
+
}
|
|
151
|
+
/** Classes for RecipientSelection component */
|
|
152
|
+
export interface RecipientSelectionClasses {
|
|
153
|
+
root?: string;
|
|
154
|
+
container?: string;
|
|
155
|
+
header?: string;
|
|
156
|
+
searchInput?: string;
|
|
157
|
+
recipientList?: string;
|
|
158
|
+
recipientItem?: string;
|
|
159
|
+
recipientItemActive?: string;
|
|
160
|
+
recipientAvatar?: string;
|
|
161
|
+
recipientName?: string;
|
|
162
|
+
recipientAddress?: string;
|
|
163
|
+
confirmButton?: string;
|
|
164
|
+
backButton?: string;
|
|
165
|
+
}
|
|
166
|
+
/** Classes for CryptoPaymentMethod component */
|
|
167
|
+
export interface CryptoPaymentMethodClasses {
|
|
168
|
+
root?: string;
|
|
169
|
+
container?: string;
|
|
170
|
+
header?: string;
|
|
171
|
+
optionsList?: string;
|
|
172
|
+
optionItem?: string;
|
|
173
|
+
optionItemActive?: string;
|
|
174
|
+
optionIcon?: string;
|
|
175
|
+
optionLabel?: string;
|
|
176
|
+
optionDescription?: string;
|
|
177
|
+
backButton?: string;
|
|
178
|
+
}
|
|
179
|
+
/** Classes for FiatPaymentMethod component */
|
|
180
|
+
export interface FiatPaymentMethodClasses {
|
|
181
|
+
root?: string;
|
|
182
|
+
container?: string;
|
|
183
|
+
header?: string;
|
|
184
|
+
optionsList?: string;
|
|
185
|
+
optionItem?: string;
|
|
186
|
+
optionItemActive?: string;
|
|
187
|
+
optionIcon?: string;
|
|
188
|
+
optionLabel?: string;
|
|
189
|
+
optionDescription?: string;
|
|
190
|
+
backButton?: string;
|
|
191
|
+
}
|
|
192
|
+
/** Classes for WarningText component */
|
|
193
|
+
export interface WarningTextClasses {
|
|
194
|
+
root?: string;
|
|
195
|
+
}
|
|
196
|
+
/** Classes for ChainWarningText component */
|
|
197
|
+
export interface ChainWarningTextClasses {
|
|
198
|
+
root?: string;
|
|
199
|
+
}
|
|
200
|
+
/** Classes for TabSection component */
|
|
201
|
+
export interface TabSectionClasses {
|
|
202
|
+
root?: string;
|
|
203
|
+
container?: string;
|
|
204
|
+
tabIndicator?: string;
|
|
205
|
+
tabButton?: string;
|
|
206
|
+
tabButtonActive?: string;
|
|
207
|
+
}
|
|
208
|
+
/** Classes for FeeDetailPanel component */
|
|
209
|
+
export interface FeeDetailPanelClasses {
|
|
210
|
+
root?: string;
|
|
211
|
+
container?: string;
|
|
212
|
+
title?: string;
|
|
213
|
+
tierCard?: string;
|
|
214
|
+
tierCardTitle?: string;
|
|
215
|
+
tierRow?: string;
|
|
216
|
+
tierRowActive?: string;
|
|
217
|
+
tierLabel?: string;
|
|
218
|
+
tierValue?: string;
|
|
219
|
+
expandButton?: string;
|
|
220
|
+
summaryCard?: string;
|
|
221
|
+
summaryRow?: string;
|
|
222
|
+
summaryLabel?: string;
|
|
223
|
+
summaryValue?: string;
|
|
224
|
+
summaryDivider?: string;
|
|
225
|
+
totalRow?: string;
|
|
226
|
+
totalLabel?: string;
|
|
227
|
+
totalValue?: string;
|
|
228
|
+
backButton?: string;
|
|
229
|
+
}
|
|
230
|
+
/** Classes for PointsDetailPanel component */
|
|
231
|
+
export interface PointsDetailPanelClasses {
|
|
232
|
+
root?: string;
|
|
233
|
+
container?: string;
|
|
234
|
+
title?: string;
|
|
235
|
+
description?: string;
|
|
236
|
+
highlightText?: string;
|
|
237
|
+
link?: string;
|
|
238
|
+
infoCard?: string;
|
|
239
|
+
infoCardTitle?: string;
|
|
240
|
+
infoList?: string;
|
|
241
|
+
infoListItem?: string;
|
|
242
|
+
backButton?: string;
|
|
243
|
+
}
|
|
244
|
+
/** Classes for PanelOnrampPayment component */
|
|
245
|
+
export interface PanelOnrampPaymentClasses {
|
|
246
|
+
root?: string;
|
|
247
|
+
container?: string;
|
|
248
|
+
summaryTitle?: string;
|
|
249
|
+
summaryCard?: string;
|
|
250
|
+
summaryRow?: string;
|
|
251
|
+
summaryLabel?: string;
|
|
252
|
+
summaryValue?: string;
|
|
253
|
+
summaryDivider?: string;
|
|
254
|
+
amountRow?: string;
|
|
255
|
+
amountValue?: string;
|
|
256
|
+
feeText?: string;
|
|
257
|
+
loadingContainer?: string;
|
|
258
|
+
loadingSpinner?: string;
|
|
259
|
+
loadingText?: string;
|
|
260
|
+
paymentMethodTitle?: string;
|
|
261
|
+
paymentMethodIcons?: string;
|
|
262
|
+
paymentOption?: string;
|
|
263
|
+
paymentOptionIcon?: string;
|
|
264
|
+
paymentOptionContent?: string;
|
|
265
|
+
paymentOptionTitle?: string;
|
|
266
|
+
paymentOptionDescription?: string;
|
|
267
|
+
paymentOptionFee?: string;
|
|
268
|
+
paymentOptionChevron?: string;
|
|
269
|
+
backButton?: string;
|
|
270
|
+
}
|
|
271
|
+
/** Classes for OrderDetailsCollapsible component */
|
|
272
|
+
export interface OrderDetailsCollapsibleClasses {
|
|
273
|
+
root?: string;
|
|
274
|
+
container?: string;
|
|
275
|
+
expandedContent?: string;
|
|
276
|
+
recipientSection?: string;
|
|
277
|
+
recipientLabel?: string;
|
|
278
|
+
recipientInfo?: string;
|
|
279
|
+
recipientName?: string;
|
|
280
|
+
recipientAddress?: string;
|
|
281
|
+
recipientCopyIcon?: string;
|
|
282
|
+
divider?: string;
|
|
283
|
+
expectedSection?: string;
|
|
284
|
+
expectedLabel?: string;
|
|
285
|
+
expectedValue?: string;
|
|
286
|
+
expectedAmount?: string;
|
|
287
|
+
chainInfo?: string;
|
|
288
|
+
chainText?: string;
|
|
289
|
+
chainLogo?: string;
|
|
290
|
+
pointsSection?: string;
|
|
291
|
+
pointsLabel?: string;
|
|
292
|
+
pointsValue?: string;
|
|
293
|
+
idSection?: string;
|
|
294
|
+
idLabel?: string;
|
|
295
|
+
idValue?: string;
|
|
296
|
+
collapsedContainer?: string;
|
|
297
|
+
collapsedButton?: string;
|
|
298
|
+
collapsedChevron?: string;
|
|
299
|
+
}
|
|
300
|
+
/** Classes for TransferCryptoDetails component */
|
|
301
|
+
export interface TransferCryptoDetailsClasses {
|
|
302
|
+
root?: string;
|
|
303
|
+
container?: string;
|
|
304
|
+
header?: string;
|
|
305
|
+
backButton?: string;
|
|
306
|
+
title?: string;
|
|
307
|
+
timer?: string;
|
|
308
|
+
timerSvg?: string;
|
|
309
|
+
timerBackground?: string;
|
|
310
|
+
timerProgress?: string;
|
|
311
|
+
timerText?: string;
|
|
312
|
+
cardsContainer?: string;
|
|
313
|
+
amountCard?: string;
|
|
314
|
+
amountLabel?: string;
|
|
315
|
+
amountContainer?: string;
|
|
316
|
+
amountText?: string;
|
|
317
|
+
amountCopyIcon?: string;
|
|
318
|
+
chainCard?: string;
|
|
319
|
+
chainLabel?: string;
|
|
320
|
+
chainContainer?: string;
|
|
321
|
+
chainLogo?: string;
|
|
322
|
+
chainName?: string;
|
|
323
|
+
qrDepositCard?: string;
|
|
324
|
+
qrSection?: string;
|
|
325
|
+
qrWrapper?: string;
|
|
326
|
+
qrContainer?: string;
|
|
327
|
+
qrCode?: string;
|
|
328
|
+
walletHint?: string;
|
|
329
|
+
walletText?: string;
|
|
330
|
+
walletIcon?: string;
|
|
331
|
+
addressSection?: string;
|
|
332
|
+
addressLabel?: string;
|
|
333
|
+
addressCopyContainer?: string;
|
|
334
|
+
addressText?: string;
|
|
335
|
+
addressCopyIcon?: string;
|
|
336
|
+
actionsContainer?: string;
|
|
337
|
+
copyButton?: string;
|
|
338
|
+
}
|
|
339
|
+
/** Classes for QRDeposit component */
|
|
340
|
+
export interface QRDepositClasses {
|
|
341
|
+
root?: string;
|
|
342
|
+
container?: string;
|
|
343
|
+
content?: string;
|
|
344
|
+
header?: string;
|
|
345
|
+
backButton?: string;
|
|
346
|
+
title?: string;
|
|
347
|
+
closeButton?: string;
|
|
348
|
+
tokenSelectorContainer?: string;
|
|
349
|
+
tokenSelectorLabel?: string;
|
|
350
|
+
tokenSelectorTrigger?: string;
|
|
351
|
+
qrContent?: string;
|
|
352
|
+
qrCodeContainer?: string;
|
|
353
|
+
qrCode?: string;
|
|
354
|
+
qrScanHint?: string;
|
|
355
|
+
addressContainer?: string;
|
|
356
|
+
addressLabel?: string;
|
|
357
|
+
addressRow?: string;
|
|
358
|
+
address?: string;
|
|
359
|
+
addressCopyIcon?: string;
|
|
360
|
+
watchingIndicator?: string;
|
|
361
|
+
copyButton?: string;
|
|
362
|
+
loadingContainer?: string;
|
|
363
|
+
loadingContent?: string;
|
|
364
|
+
loadingSpinner?: string;
|
|
365
|
+
loadingText?: string;
|
|
366
|
+
orderDetailsContainer?: string;
|
|
367
|
+
orderDetailsContent?: string;
|
|
368
|
+
}
|
|
369
|
+
/** Combined classes for all AnySpend-related components */
|
|
370
|
+
export interface AnySpendAllClasses {
|
|
371
|
+
deposit?: AnySpendDepositClasses;
|
|
372
|
+
anySpend?: AnySpendClasses;
|
|
373
|
+
customExactIn?: AnySpendCustomExactInClasses;
|
|
374
|
+
cryptoPaySection?: CryptoPaySectionClasses;
|
|
375
|
+
cryptoReceiveSection?: CryptoReceiveSectionClasses;
|
|
376
|
+
panelOnramp?: PanelOnrampClasses;
|
|
377
|
+
orderDetails?: OrderDetailsClasses;
|
|
378
|
+
recipientSelection?: RecipientSelectionClasses;
|
|
379
|
+
cryptoPaymentMethod?: CryptoPaymentMethodClasses;
|
|
380
|
+
fiatPaymentMethod?: FiatPaymentMethodClasses;
|
|
381
|
+
qrDeposit?: QRDepositClasses;
|
|
382
|
+
warningText?: WarningTextClasses;
|
|
383
|
+
chainWarningText?: ChainWarningTextClasses;
|
|
384
|
+
tabSection?: TabSectionClasses;
|
|
385
|
+
feeDetailPanel?: FeeDetailPanelClasses;
|
|
386
|
+
pointsDetailPanel?: PointsDetailPanelClasses;
|
|
387
|
+
panelOnrampPayment?: PanelOnrampPaymentClasses;
|
|
388
|
+
orderDetailsCollapsible?: OrderDetailsCollapsibleClasses;
|
|
389
|
+
transferCryptoDetails?: TransferCryptoDetailsClasses;
|
|
390
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnySpendAllClasses } from "../../../anyspend/react";
|
|
1
2
|
import { components } from "../../../anyspend/types/api";
|
|
2
3
|
import { GenerateSigMintResponse } from "../../../anyspend/types/signatureMint";
|
|
3
4
|
import { AllowedStrategy } from "../../../global-account/react";
|
|
@@ -541,6 +542,8 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
541
542
|
returnHomeLabel?: string;
|
|
542
543
|
/** Whether the deposit requires a custom function (uses AnySpendCustomExactIn). Defaults to false. */
|
|
543
544
|
isCustomDeposit?: boolean;
|
|
545
|
+
/** Custom class names for styling specific elements */
|
|
546
|
+
classes?: AnySpendAllClasses;
|
|
544
547
|
}
|
|
545
548
|
/**
|
|
546
549
|
* Union type of all possible modal content types
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { components } from "../../types/api";
|
|
2
|
+
import type { AnySpendClasses } from "./types/classes";
|
|
2
3
|
export interface RecipientOption {
|
|
3
4
|
address: string;
|
|
4
5
|
icon?: string;
|
|
@@ -45,4 +46,6 @@ export declare function AnySpend(props: {
|
|
|
45
46
|
customRecipientLabel?: string;
|
|
46
47
|
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
47
48
|
returnHomeLabel?: string;
|
|
49
|
+
/** Custom class names for styling specific elements */
|
|
50
|
+
classes?: AnySpendClasses;
|
|
48
51
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -51,7 +51,7 @@ export function AnySpend(props) {
|
|
|
51
51
|
const fingerprintConfig = getFingerprintConfig();
|
|
52
52
|
return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendInner, { ...props }) }));
|
|
53
53
|
}
|
|
54
|
-
function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, }) {
|
|
54
|
+
function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, hideHeader, hideBottomNavigation = false, disableUrlParamManagement = false, returnToHomeUrl, customRecipientLabel, returnHomeLabel, classes, }) {
|
|
55
55
|
const searchParams = useSearchParamsSSR();
|
|
56
56
|
const router = useRouter();
|
|
57
57
|
const { partnerId } = useB3Config();
|
|
@@ -825,7 +825,7 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
|
|
|
825
825
|
// Reset payment methods when going back
|
|
826
826
|
resetPaymentMethods();
|
|
827
827
|
}, returnToHomeUrl: returnToHomeUrl, returnHomeLabel: returnHomeLabel, disableUrlParamManagement: disableUrlParamManagement })) }) }));
|
|
828
|
-
const mainView = (_jsxs("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2 pt-5", children: [_jsxs("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && !hideHeader && (_jsxs("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && (_jsx("div", { className: "relative", children: _jsx("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), _jsx("div", { children: _jsxs("h1", { className: "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), _jsx(TabSection, { activeTab: activeTab, setActiveTab: tab => {
|
|
828
|
+
const mainView = (_jsxs("div", { className: classes?.mainContent || "mx-auto flex w-[460px] max-w-full flex-col items-center gap-2 pt-5", children: [_jsxs("div", { className: "flex w-full max-w-full flex-col items-center gap-2 px-5", children: [isBuyMode && !hideHeader && (_jsxs("div", { className: classes?.header || "mb-4 flex flex-col items-center gap-3 text-center", children: [selectedDstToken.metadata?.logoURI && (_jsx("div", { className: "relative", children: _jsx("img", { src: selectedDstToken.metadata.logoURI, alt: selectedDstToken.symbol, className: classes?.headerLogo || "border-as-stroke h-12 w-12 rounded-full border-2 shadow-md" }) })), _jsx("div", { children: _jsxs("h1", { className: classes?.headerTitle || "text-as-primary text-xl font-bold", children: ["Buy ", selectedDstToken.symbol] }) })] })), _jsx(TabSection, { activeTab: activeTab, setActiveTab: tab => {
|
|
829
829
|
setActiveTab(tab);
|
|
830
830
|
// Reset payment methods when switching tabs
|
|
831
831
|
resetPaymentMethods();
|
|
@@ -839,7 +839,8 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
|
|
|
839
839
|
else {
|
|
840
840
|
setActivePanel(panelIndex);
|
|
841
841
|
}
|
|
842
|
-
}, _recipientAddress: effectiveRecipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), customUsdInputValues: customUsdInputValues, customRecipientLabel: customRecipientLabel }) })), activeTab === "crypto" && (_jsx("div", { className: "z-10 -my-6 flex justify-center", children: _jsx(Button, { variant: "ghost", className:
|
|
842
|
+
}, _recipientAddress: effectiveRecipientAddress, destinationToken: selectedDstToken, destinationChainId: selectedDstChainId, destinationAmount: dstAmount, onDestinationTokenChange: setSelectedDstToken, onDestinationChainChange: setSelectedDstChainId, fiatPaymentMethodIndex: PanelView.FIAT_PAYMENT_METHOD, recipientSelectionPanelIndex: PanelView.RECIPIENT_SELECTION, hideDstToken: isBuyMode, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward"), customUsdInputValues: customUsdInputValues, customRecipientLabel: customRecipientLabel }) })), activeTab === "crypto" && (_jsx("div", { className: "z-10 -my-6 flex justify-center", children: _jsx(Button, { variant: "ghost", className: classes?.swapDirectionButton ||
|
|
843
|
+
cn("border-as-stroke bg-as-surface-primary h-10 w-10 rounded-xl border-2 sm:h-8 sm:w-8 sm:rounded-xl", isBuyMode && "cursor-default", selectedDstChainId === HYPERLIQUID_CHAIN_ID && "cursor-not-allowed opacity-50"), onClick: () => {
|
|
843
844
|
if (isBuyMode) {
|
|
844
845
|
return;
|
|
845
846
|
}
|
|
@@ -859,7 +860,11 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
|
|
|
859
860
|
}, children: _jsx("div", { className: "relative flex items-center justify-center transition-opacity", children: _jsx(ArrowDown, { className: "text-as-primary/50 h-5 w-5" }) }) }) })), activeTab === "crypto" && (_jsx(CryptoReceiveSection, { isDepositMode: false, isBuyMode: isBuyMode, effectiveRecipientAddress: effectiveRecipientAddress, recipientName: recipientName || undefined, customRecipientLabel: customRecipientLabel, onSelectRecipient: () => navigateToPanel(PanelView.RECIPIENT_SELECTION, "forward"), dstAmount: dstAmount, dstToken: selectedDstToken, selectedDstChainId: selectedDstChainId, setSelectedDstChainId: setSelectedDstChainId, setSelectedDstToken: setSelectedDstToken, isSrcInputDirty: isSrcInputDirty, onChangeDstAmount: value => {
|
|
860
861
|
setIsSrcInputDirty(false);
|
|
861
862
|
setDstAmount(value);
|
|
862
|
-
}, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward") }))] }), gasPriceData && !isLoadingGas && activeTab === "crypto" && (_jsx(GasIndicator, { gasPrice: gasPriceData, className: "mt-2 w-full" })), _jsxs(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: [_jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className:
|
|
863
|
+
}, anyspendQuote: anyspendQuote, onShowPointsDetail: () => navigateToPanel(PanelView.POINTS_DETAIL, "forward"), onShowFeeDetail: () => navigateToPanel(PanelView.FEE_DETAIL, "forward") }))] }), gasPriceData && !isLoadingGas && activeTab === "crypto" && (_jsx(GasIndicator, { gasPrice: gasPriceData, className: classes?.gasIndicator || "mt-2 w-full" })), _jsxs(motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: cn("mt-4 flex w-full max-w-[460px] flex-col gap-2"), children: [_jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (btnInfo.error && classes?.mainButtonError) ||
|
|
864
|
+
(btnInfo.disable && classes?.mainButtonDisabled) ||
|
|
865
|
+
classes?.mainButton ||
|
|
866
|
+
cn("as-main-button relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: cn(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [btnInfo.loading && _jsx(Loader2, { className: "h-4 w-4 animate-spin" }), btnInfo.text] }) }), !hideTransactionHistoryButton && (globalAddress || effectiveRecipientAddress) ? (_jsxs(Button, { variant: "link", onClick: onClickHistory, className: classes?.historyButton ||
|
|
867
|
+
"text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [_jsx(HistoryIcon, { className: "h-4 w-4" }), " ", _jsx("span", { className: "pr-4", children: "Transaction History" })] })) : null] })] }), _jsx("div", { className: "w-full", children: _jsx(TabsPrimitive, { defaultValue: "swap", onValueChange: value => {
|
|
863
868
|
if (value === "settings" || value === "home") {
|
|
864
869
|
setB3ModalContentType({
|
|
865
870
|
type: "manageAccount",
|
|
@@ -912,8 +917,9 @@ function AnySpendInner({ sourceChainId, destinationTokenAddress, destinationToke
|
|
|
912
917
|
const pointsDetailView = (_jsx(PointsDetailPanel, { pointsAmount: anyspendQuote?.data?.pointsAmount || 0, onBack: navigateBack }));
|
|
913
918
|
const feeDetailView = anyspendQuote?.data?.fee ? (_jsx(FeeDetailPanel, { fee: anyspendQuote.data.fee, transactionAmountUsd: activeTab === "crypto" ? Number(anyspendQuote.data.currencyIn?.amountUsd) : parseFloat(srcAmountOnRamp), onBack: navigateBack })) : null;
|
|
914
919
|
// Add tabs to the main component when no order is loaded
|
|
915
|
-
return (_jsx(StyleRoot, { children: _jsx("div", { className:
|
|
916
|
-
"
|
|
920
|
+
return (_jsx(StyleRoot, { children: _jsx("div", { className: classes?.container ||
|
|
921
|
+
cn("anyspend-container font-inter mx-auto w-full max-w-[460px]", mode === "page" &&
|
|
922
|
+
"bg-as-surface-primary border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: _jsx(TransitionPanel, { activeIndex: orderId
|
|
917
923
|
? oat
|
|
918
924
|
? PanelView.ORDER_DETAILS
|
|
919
925
|
: PanelView.LOADING
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { components } from "../../../anyspend/types/api";
|
|
2
2
|
import { GetQuoteResponse } from "../../../anyspend/types/api_req_res";
|
|
3
|
+
import type { AnySpendCustomExactInClasses } from "./types/classes";
|
|
3
4
|
type CustomExactInConfig = {
|
|
4
5
|
functionAbi: string;
|
|
5
6
|
functionName: string;
|
|
@@ -38,6 +39,8 @@ export interface AnySpendCustomExactInProps {
|
|
|
38
39
|
customRecipientLabel?: string;
|
|
39
40
|
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
40
41
|
returnHomeLabel?: string;
|
|
42
|
+
/** Custom class names for styling specific elements */
|
|
43
|
+
classes?: AnySpendCustomExactInClasses;
|
|
41
44
|
}
|
|
42
45
|
export declare function AnySpendCustomExactIn(props: AnySpendCustomExactInProps): import("react/jsx-runtime").JSX.Element;
|
|
43
46
|
export {};
|