@b3dotfun/sdk 0.0.70-alpha.1 → 0.0.70
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/index.d.ts +0 -1
- package/dist/cjs/anyspend/index.js +0 -1
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/cjs/anyspend/react/components/AnySpend.js +1 -13
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +1 -3
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +2 -6
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +1 -3
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -16
- package/dist/cjs/anyspend/services/anyspend.d.ts +1 -2
- package/dist/cjs/anyspend/services/anyspend.js +1 -2
- package/dist/cjs/anyspend/types/api.d.ts +0 -295
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -4
- package/dist/esm/anyspend/index.d.ts +0 -1
- package/dist/esm/anyspend/index.js +0 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/esm/anyspend/react/components/AnySpend.js +1 -13
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +1 -3
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +2 -6
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -1
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +1 -3
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +1 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +1 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +1 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -16
- package/dist/esm/anyspend/services/anyspend.d.ts +1 -2
- package/dist/esm/anyspend/services/anyspend.js +1 -2
- package/dist/esm/anyspend/types/api.d.ts +0 -295
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -4
- package/dist/types/anyspend/index.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +0 -6
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +1 -3
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +0 -1
- package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +0 -2
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -2
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +0 -1
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -16
- package/dist/types/anyspend/services/anyspend.d.ts +1 -2
- package/dist/types/anyspend/types/api.d.ts +0 -295
- package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -4
- package/package.json +1 -1
- package/src/anyspend/index.ts +0 -1
- package/src/anyspend/react/components/AnySpend.tsx +0 -23
- package/src/anyspend/react/components/AnySpendBondKit.tsx +1 -3
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +0 -3
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -8
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +0 -4
- package/src/anyspend/react/components/AnySpendDepositUpside.tsx +0 -3
- package/src/anyspend/react/components/AnySpendNFT.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +0 -3
- package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +0 -3
- package/src/anyspend/react/components/AnySpendTournament.tsx +0 -3
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +0 -3
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +0 -3
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +0 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +1 -13
- package/src/anyspend/services/anyspend.ts +0 -3
- package/src/anyspend/types/api.ts +0 -295
- package/src/global-account/react/stores/useModalStore.ts +0 -4
- package/dist/cjs/anyspend/utils/validation.d.ts +0 -67
- package/dist/cjs/anyspend/utils/validation.js +0 -157
- package/dist/esm/anyspend/utils/validation.d.ts +0 -67
- package/dist/esm/anyspend/utils/validation.js +0 -153
- package/dist/types/anyspend/utils/validation.d.ts +0 -67
- package/src/anyspend/utils/validation.ts +0 -209
|
@@ -122,8 +122,6 @@ export interface AnySpendModalProps extends BaseModalProps {
|
|
|
122
122
|
destinationTokenChainId?: number;
|
|
123
123
|
/** Custom USD input values for quick amount buttons in fiat onramp */
|
|
124
124
|
customUsdInputValues?: string[];
|
|
125
|
-
/** Client-provided reference ID for tracking orders */
|
|
126
|
-
clientReferenceId?: string;
|
|
127
125
|
}
|
|
128
126
|
/**
|
|
129
127
|
* Props for the AnySpend NFT modal
|
|
@@ -138,8 +136,6 @@ export interface AnySpendNftProps extends BaseModalProps {
|
|
|
138
136
|
recipientAddress?: string;
|
|
139
137
|
/** Callback function called when the NFT is successfully transferred */
|
|
140
138
|
onSuccess?: (txHash?: string) => void;
|
|
141
|
-
/** Client-provided reference ID for tracking orders */
|
|
142
|
-
clientReferenceId?: string;
|
|
143
139
|
}
|
|
144
140
|
/**
|
|
145
141
|
* Props for the AnySpend tournament modal
|
|
@@ -6,7 +6,6 @@ export * from "./utils/json";
|
|
|
6
6
|
export * from "./utils/number";
|
|
7
7
|
export * from "./utils/string";
|
|
8
8
|
export * from "./utils/token";
|
|
9
|
-
export * from "./utils/validation";
|
|
10
9
|
export * from "./constants";
|
|
11
10
|
export * from "./abis/abiUsdcBase";
|
|
12
11
|
export * from "./abis/erc20Staking";
|
|
@@ -34,10 +34,4 @@ export declare function AnySpend(props: {
|
|
|
34
34
|
}) => void;
|
|
35
35
|
onSuccess?: (txHash?: string) => void;
|
|
36
36
|
customUsdInputValues?: string[];
|
|
37
|
-
/**
|
|
38
|
-
* Client-provided reference ID for tracking orders.
|
|
39
|
-
* Must be alphanumeric with optional hyphens, underscores, and dots (max 255 chars).
|
|
40
|
-
* Auto-generates UUID if not provided.
|
|
41
|
-
*/
|
|
42
|
-
clientReferenceId?: string;
|
|
43
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { getDefaultToken, USDC_BASE } from "../../../anyspend/index.js";
|
|
4
4
|
import { useAnyspendCreateOnrampOrder, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote, useGeoOnrampOptions, } from "../../../anyspend/react/index.js";
|
|
5
|
-
import { Validators } from "../../../anyspend/utils/validation.js";
|
|
6
5
|
import { Button, ShinyButton, StyleRoot, TransitionPanel, useAccountWallet, useProfile, useRouter, useSearchParamsSSR, useTokenBalanceDirect, useTokenData, useTokenFromUrl, } from "../../../global-account/react/index.js";
|
|
7
6
|
import { cn } from "../../../shared/utils/cn.js";
|
|
8
7
|
import { formatTokenAmount } from "../../../shared/utils/number.js";
|
|
@@ -49,18 +48,9 @@ export function AnySpend(props) {
|
|
|
49
48
|
const fingerprintConfig = getFingerprintConfig();
|
|
50
49
|
return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendInner, { ...props }) }));
|
|
51
50
|
}
|
|
52
|
-
function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues,
|
|
51
|
+
function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps, onTokenSelect, onSuccess, customUsdInputValues, }) {
|
|
53
52
|
const searchParams = useSearchParamsSSR();
|
|
54
53
|
const router = useRouter();
|
|
55
|
-
// Validate and clean clientReferenceId
|
|
56
|
-
const validatedClientReferenceId = useMemo(() => {
|
|
57
|
-
const validation = Validators.clientReferenceId(clientReferenceIdFromProps);
|
|
58
|
-
if (!validation.isValid) {
|
|
59
|
-
console.error(`[AnySpend] Invalid clientReferenceId: ${validation.error || "Validation failed"}. Will be set to undefined.`);
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
return validation.cleaned;
|
|
63
|
-
}, [clientReferenceIdFromProps]);
|
|
64
54
|
// Determine if we're in "buy mode" based on whether destination token props are provided
|
|
65
55
|
const isBuyMode = !!(destinationTokenAddress && destinationTokenChainId);
|
|
66
56
|
// Add refs to track URL state
|
|
@@ -648,7 +638,6 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
648
638
|
srcAmount: srcAmountBigInt.toString(),
|
|
649
639
|
expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount || "0",
|
|
650
640
|
creatorAddress: globalAddress,
|
|
651
|
-
clientReferenceId: validatedClientReferenceId,
|
|
652
641
|
});
|
|
653
642
|
}
|
|
654
643
|
catch (err) {
|
|
@@ -713,7 +702,6 @@ function AnySpendInner({ destinationTokenAddress, destinationTokenChainId, mode
|
|
|
713
702
|
},
|
|
714
703
|
expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount?.toString() || "0",
|
|
715
704
|
creatorAddress: globalAddress,
|
|
716
|
-
clientReferenceId: validatedClientReferenceId,
|
|
717
705
|
});
|
|
718
706
|
}
|
|
719
707
|
catch (err) {
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { AnySpendBondKitProps } from "../../../global-account/react/stores/useModalStore";
|
|
2
|
-
export declare function AnySpendBondKit({ mode, recipientAddress, contractAddress, minTokensOut, imageUrl, b3Amount: initialB3Amount, onSuccess,
|
|
3
|
-
clientReferenceId?: string;
|
|
4
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function AnySpendBondKit({ mode, recipientAddress, contractAddress, minTokensOut, imageUrl, b3Amount: initialB3Amount, onSuccess, }: AnySpendBondKitProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,7 +20,7 @@ function formatNumberWithCommas(x) {
|
|
|
20
20
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
21
21
|
return parts.join(".");
|
|
22
22
|
}
|
|
23
|
-
export function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, minTokensOut = "0", imageUrl, b3Amount: initialB3Amount, onSuccess,
|
|
23
|
+
export function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, minTokensOut = "0", imageUrl, b3Amount: initialB3Amount, onSuccess, }) {
|
|
24
24
|
const hasMounted = useHasMounted();
|
|
25
25
|
const [showAmountPrompt, setShowAmountPrompt] = useState(!initialB3Amount);
|
|
26
26
|
const [b3Amount, setB3Amount] = useState(initialB3Amount || "");
|
|
@@ -200,5 +200,5 @@ export function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddr
|
|
|
200
200
|
});
|
|
201
201
|
return (_jsx(AnySpendCustom, { mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: baseMainnet.id, dstToken: dstToken, dstAmount: parseEther(b3Amount).toString(), contractAddress: contractAddress, encodedData: encodedData, metadata: {
|
|
202
202
|
action: "BondKit Buy",
|
|
203
|
-
}, header: header, onSuccess: onSuccess, showRecipient: true
|
|
203
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
204
204
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess,
|
|
1
|
+
export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
spinwheelContractAddress: string;
|
|
@@ -6,5 +6,4 @@ export declare function AnySpendBuySpin({ loadOrder, mode, spinwheelContractAddr
|
|
|
6
6
|
recipientAddress: string;
|
|
7
7
|
prefillQuantity?: string;
|
|
8
8
|
onSuccess?: (txHash?: string) => void;
|
|
9
|
-
clientReferenceId?: string;
|
|
10
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -85,7 +85,7 @@ const basePublicClient = createPublicClient({
|
|
|
85
85
|
chain: baseMainnet,
|
|
86
86
|
transport: http(PUBLIC_BASE_RPC_URL),
|
|
87
87
|
});
|
|
88
|
-
export function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess,
|
|
88
|
+
export function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAddress, chainId, recipientAddress, prefillQuantity, onSuccess, }) {
|
|
89
89
|
const hasMounted = useHasMounted();
|
|
90
90
|
const { setB3ModalOpen } = useModalStore();
|
|
91
91
|
// Payment config state
|
|
@@ -391,5 +391,5 @@ export function AnySpendBuySpin({ loadOrder, mode = "modal", spinwheelContractAd
|
|
|
391
391
|
const encodedData = generateEncodedDataForBuyEntriesAndSpin(address || "", userSpinQuantity);
|
|
392
392
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chainId, dstToken: B3_TOKEN, dstAmount: totalCost.toString(), contractAddress: spinwheelContractAddress, spenderAddress: paymentConfig.entryModule, encodedData: encodedData, metadata: {
|
|
393
393
|
action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
|
|
394
|
-
}, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false
|
|
394
|
+
}, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false }));
|
|
395
395
|
}
|
|
@@ -108,7 +108,7 @@ export function AnySpendCustom(props) {
|
|
|
108
108
|
const fingerprintConfig = getFingerprintConfig();
|
|
109
109
|
return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomInner, { ...props }) }));
|
|
110
110
|
}
|
|
111
|
-
function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail,
|
|
111
|
+
function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabProps = "crypto", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, onShowPointsDetail, }) {
|
|
112
112
|
const hasMounted = useHasMounted();
|
|
113
113
|
const featureFlags = useFeatureFlags();
|
|
114
114
|
const searchParams = useSearchParamsSSR();
|
|
@@ -351,14 +351,10 @@ function AnySpendCustomInner({ loadOrder, mode = "modal", activeTab: activeTabPr
|
|
|
351
351
|
: window.location.origin,
|
|
352
352
|
},
|
|
353
353
|
expectedDstAmount: anyspendQuote?.data?.currencyOut?.amount?.toString() || "0",
|
|
354
|
-
clientReferenceId: clientReferenceId,
|
|
355
354
|
});
|
|
356
355
|
}
|
|
357
356
|
else {
|
|
358
|
-
void createRegularOrder(
|
|
359
|
-
...createOrderParams,
|
|
360
|
-
clientReferenceId: clientReferenceId,
|
|
361
|
-
});
|
|
357
|
+
void createRegularOrder(createOrderParams);
|
|
362
358
|
}
|
|
363
359
|
}
|
|
364
360
|
catch (err) {
|
|
@@ -31,7 +31,6 @@ export interface AnySpendCustomExactInProps {
|
|
|
31
31
|
anyspendPrice: GetQuoteResponse | undefined;
|
|
32
32
|
isLoadingAnyspendPrice: boolean;
|
|
33
33
|
}) => React.JSX.Element;
|
|
34
|
-
clientReferenceId?: string;
|
|
35
34
|
}
|
|
36
35
|
export declare function AnySpendCustomExactIn(props: AnySpendCustomExactInProps): import("react/jsx-runtime").JSX.Element;
|
|
37
36
|
export {};
|
|
@@ -25,7 +25,7 @@ export function AnySpendCustomExactIn(props) {
|
|
|
25
25
|
const fingerprintConfig = getFingerprintConfig();
|
|
26
26
|
return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(AnySpendCustomExactInInner, { ...props }) }));
|
|
27
27
|
}
|
|
28
|
-
function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, orderType = "custom_exact_in", minDestinationAmount, header,
|
|
28
|
+
function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, destinationToken, destinationChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, customExactInConfig, orderType = "custom_exact_in", minDestinationAmount, header, }) {
|
|
29
29
|
const actionLabel = customExactInConfig?.action ?? "Custom Execution";
|
|
30
30
|
const DESTINATION_TOKEN_DETAILS = {
|
|
31
31
|
SYMBOL: destinationToken.symbol ?? "TOKEN",
|
|
@@ -189,7 +189,6 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
|
|
|
189
189
|
expectedDstAmount: expectedDstAmountRaw,
|
|
190
190
|
creatorAddress: globalAddress,
|
|
191
191
|
payload,
|
|
192
|
-
clientReferenceId: clientReferenceId,
|
|
193
192
|
});
|
|
194
193
|
}
|
|
195
194
|
catch (err) {
|
|
@@ -242,7 +241,6 @@ function AnySpendCustomExactInInner({ loadOrder, mode = "modal", recipientAddres
|
|
|
242
241
|
expectedDstAmount: expectedDstAmountRaw,
|
|
243
242
|
creatorAddress: globalAddress,
|
|
244
243
|
payload,
|
|
245
|
-
clientReferenceId: clientReferenceId,
|
|
246
244
|
});
|
|
247
245
|
}
|
|
248
246
|
catch (err) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { components } from "../../../anyspend/types/api";
|
|
2
|
-
export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess,
|
|
2
|
+
export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
recipientAddress: string;
|
|
@@ -8,5 +8,4 @@ export declare function AnySpendDepositUpside({ loadOrder, mode, recipientAddres
|
|
|
8
8
|
depositContractAddress: string;
|
|
9
9
|
token: components["schemas"]["Token"];
|
|
10
10
|
onSuccess?: (amount: string) => void;
|
|
11
|
-
clientReferenceId?: string;
|
|
12
11
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -22,7 +22,7 @@ const DEPOSIT_FOR_FUNCTION_ABI = JSON.stringify([
|
|
|
22
22
|
type: "function",
|
|
23
23
|
},
|
|
24
24
|
]);
|
|
25
|
-
export function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess,
|
|
25
|
+
export function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, depositContractAddress, token, onSuccess, }) {
|
|
26
26
|
if (!recipientAddress)
|
|
27
27
|
return null;
|
|
28
28
|
const header = () => (_jsx(_Fragment, { children: _jsx("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Deposit ", token.symbol] }) }) }) }));
|
|
@@ -34,5 +34,5 @@ export function AnySpendDepositUpside({ loadOrder, mode = "modal", recipientAddr
|
|
|
34
34
|
spenderAddress: depositContractAddress,
|
|
35
35
|
action: `deposit ${token.symbol}`,
|
|
36
36
|
};
|
|
37
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess
|
|
37
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
|
|
38
38
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { components } from "../../../anyspend/types/api";
|
|
2
|
-
export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail,
|
|
2
|
+
export declare function AnySpendNFT({ loadOrder, mode, recipientAddress, nftContract, onSuccess, onShowPointsDetail, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
recipientAddress?: string;
|
|
6
6
|
nftContract: components["schemas"]["NftContract"];
|
|
7
7
|
onSuccess?: (txHash?: string) => void;
|
|
8
8
|
onShowPointsDetail?: () => void;
|
|
9
|
-
clientReferenceId?: string;
|
|
10
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,7 +26,7 @@ const CONTRACT_URI_ABI = [
|
|
|
26
26
|
type: "function",
|
|
27
27
|
},
|
|
28
28
|
];
|
|
29
|
-
export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail,
|
|
29
|
+
export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftContract, onSuccess, onShowPointsDetail, }) {
|
|
30
30
|
const [imageUrlWithFallback, setFallbackImageUrl] = useState(nftContract.imageUrl);
|
|
31
31
|
const [isLoadingFallback, setIsLoadingFallback] = useState(false);
|
|
32
32
|
// Fetch contract metadata when imageUrl is empty
|
|
@@ -86,7 +86,7 @@ export function AnySpendNFT({ loadOrder, mode = "modal", recipientAddress, nftCo
|
|
|
86
86
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, activeTab: "fiat", recipientAddress: recipientAddress, orderType: "mint_nft", dstChainId: nftContract.chainId, dstToken: nftContract.currency, dstAmount: nftContract.price, contractAddress: nftContract.contractAddress, encodedData: "0x", metadata: {
|
|
87
87
|
type: "mint_nft",
|
|
88
88
|
nftContract: nftContract,
|
|
89
|
-
}, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail
|
|
89
|
+
}, header: header, onSuccess: onSuccess, onShowPointsDetail: onShowPointsDetail }));
|
|
90
90
|
}
|
|
91
91
|
function DropdownMenu({ nftContract }) {
|
|
92
92
|
const [open, setOpen] = useState(false);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess,
|
|
1
|
+
export declare function AnySpendStakeB3({ loadOrder, mode, recipientAddress, stakeAmount, onSuccess, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
recipientAddress: string;
|
|
5
5
|
stakeAmount?: string;
|
|
6
6
|
onSuccess?: () => void;
|
|
7
|
-
clientReferenceId?: string;
|
|
8
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,7 +29,7 @@ function generateEncodedDataForStakingB3(amount, beneficiary) {
|
|
|
29
29
|
});
|
|
30
30
|
return encodedData;
|
|
31
31
|
}
|
|
32
|
-
export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmount, onSuccess,
|
|
32
|
+
export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmount, onSuccess, }) {
|
|
33
33
|
const hasMounted = useHasMounted();
|
|
34
34
|
const { setB3ModalOpen } = useModalStore();
|
|
35
35
|
// Wagmi hooks for direct staking
|
|
@@ -271,5 +271,5 @@ export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, s
|
|
|
271
271
|
const encodedData = generateEncodedDataForStakingB3(userStakeAmount, recipientAddress);
|
|
272
272
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: base.id, dstToken: B3_TOKEN, dstAmount: userStakeAmount, contractAddress: ERC20Staking, encodedData: encodedData, metadata: {
|
|
273
273
|
action: "stake B3",
|
|
274
|
-
}, header: header, onSuccess: onSuccess, showRecipient: true
|
|
274
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
275
275
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess,
|
|
1
|
+
export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, }: {
|
|
2
2
|
loadOrder?: string;
|
|
3
3
|
mode?: "modal" | "page";
|
|
4
4
|
sourceTokenAddress?: string;
|
|
@@ -6,5 +6,4 @@ export declare function AnySpendStakeB3ExactIn({ loadOrder, mode, sourceTokenAdd
|
|
|
6
6
|
recipientAddress: string;
|
|
7
7
|
stakeAmount?: string;
|
|
8
8
|
onSuccess?: (amount: string) => void;
|
|
9
|
-
clientReferenceId?: string;
|
|
10
9
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -32,7 +32,7 @@ const STAKE_FUNCTION_ABI = JSON.stringify([
|
|
|
32
32
|
outputs: [],
|
|
33
33
|
},
|
|
34
34
|
]);
|
|
35
|
-
export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess,
|
|
35
|
+
export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress, sourceTokenChainId, recipientAddress, stakeAmount, onSuccess, }) {
|
|
36
36
|
const hasMounted = useHasMounted();
|
|
37
37
|
const { setB3ModalOpen } = useModalStore();
|
|
38
38
|
// Wagmi hooks for direct staking
|
|
@@ -281,5 +281,5 @@ export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenA
|
|
|
281
281
|
onSuccess?.(formatTokenAmount(BigInt(userStakeAmount), 18) ?? "");
|
|
282
282
|
}, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
|
|
283
283
|
}
|
|
284
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: B3_TOKEN, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess
|
|
284
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: B3_TOKEN, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
|
|
285
285
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { components } from "../../../anyspend/types/api";
|
|
2
|
-
export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab,
|
|
2
|
+
export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
beneficiaryAddress: string;
|
|
@@ -8,5 +8,4 @@ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddres
|
|
|
8
8
|
token: components["schemas"]["Token"];
|
|
9
9
|
onSuccess?: () => void;
|
|
10
10
|
activeTab?: "crypto" | "fiat";
|
|
11
|
-
clientReferenceId?: string;
|
|
12
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,7 @@ function generateEncodedDataForStaking(amount, beneficiary) {
|
|
|
14
14
|
args: [beneficiary, BigInt(amount)],
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab,
|
|
17
|
+
export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, onSuccess, activeTab, }) {
|
|
18
18
|
const header = () => (_jsx(_Fragment, { children: _jsxs("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [_jsx("div", { className: "h-[60px] w-full" }), _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", stakeAmount ? formatTokenAmount(BigInt(stakeAmount), token.decimals) : "", " ", token.symbol] }) })] }) }));
|
|
19
19
|
// Only generate encoded data if we have a valid beneficiary address
|
|
20
20
|
// This is used for the AnySpendCustom swap & stake flow
|
|
@@ -24,5 +24,5 @@ export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddr
|
|
|
24
24
|
const encodedData = generateEncodedDataForStaking(stakeAmount, beneficiaryAddress);
|
|
25
25
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: beneficiaryAddress, orderType: "custom", dstChainId: base.id, dstToken: token, dstAmount: stakeAmount, contractAddress: stakingContractAddress, encodedData: encodedData, metadata: {
|
|
26
26
|
action: `stake ${token.symbol}`,
|
|
27
|
-
}, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab
|
|
27
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab }));
|
|
28
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { components } from "../../../anyspend/types/api";
|
|
2
|
-
export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess,
|
|
2
|
+
export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
recipientAddress: string;
|
|
@@ -8,5 +8,4 @@ export declare function AnySpendStakeUpsideExactIn({ loadOrder, mode, recipientA
|
|
|
8
8
|
stakingContractAddress: string;
|
|
9
9
|
token: components["schemas"]["Token"];
|
|
10
10
|
onSuccess?: (amount: string) => void;
|
|
11
|
-
clientReferenceId?: string;
|
|
12
11
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -14,7 +14,7 @@ const STAKE_FOR_FUNCTION_ABI = JSON.stringify([
|
|
|
14
14
|
outputs: [],
|
|
15
15
|
},
|
|
16
16
|
]);
|
|
17
|
-
export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess,
|
|
17
|
+
export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipientAddress, sourceTokenAddress, sourceTokenChainId, stakingContractAddress, token, onSuccess, }) {
|
|
18
18
|
if (!recipientAddress)
|
|
19
19
|
return null;
|
|
20
20
|
const header = () => (_jsx(_Fragment, { children: _jsx("div", { className: "from-b3-react-background to-as-on-surface-1 w-full rounded-t-lg bg-gradient-to-t", children: _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", token.symbol, " (Exact In)"] }) }) }) }));
|
|
@@ -26,5 +26,5 @@ export function AnySpendStakeUpsideExactIn({ loadOrder, mode = "modal", recipien
|
|
|
26
26
|
spenderAddress: stakingContractAddress,
|
|
27
27
|
action: `stake ${token.symbol}`,
|
|
28
28
|
};
|
|
29
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess
|
|
29
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: token, destinationChainId: base.id, customExactInConfig: customExactInConfig, header: header, onSuccess: onSuccess }));
|
|
30
30
|
}
|
|
@@ -10,7 +10,6 @@ type AnySpendTournamentProps = {
|
|
|
10
10
|
tournamentEntryToken: components["schemas"]["Token"];
|
|
11
11
|
tournamentEntryFee: string;
|
|
12
12
|
onSuccess?: () => void;
|
|
13
|
-
clientReferenceId?: string;
|
|
14
13
|
} | {
|
|
15
14
|
mode?: "modal" | "page";
|
|
16
15
|
action: "fund";
|
|
@@ -21,7 +20,6 @@ type AnySpendTournamentProps = {
|
|
|
21
20
|
tournamentFundToken: components["schemas"]["Token"];
|
|
22
21
|
tournamentFundAmount: string;
|
|
23
22
|
onSuccess?: () => void;
|
|
24
|
-
clientReferenceId?: string;
|
|
25
23
|
};
|
|
26
24
|
export declare function AnySpendTournament(props: AnySpendTournamentProps): import("react/jsx-runtime").JSX.Element;
|
|
27
25
|
export {};
|
|
@@ -13,5 +13,5 @@ export function AnySpendTournament(props) {
|
|
|
13
13
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: action === "join" ? props.joinFor : undefined, orderType: action === "join" ? "join_tournament" : "fund_tournament", dstChainId: tournamentChainId, dstToken: dstToken, dstAmount: dstAmount, contractAddress: tournamentContractAddress, encodedData: "0x", metadata: {
|
|
14
14
|
type: action === "join" ? "join_tournament" : "fund_tournament",
|
|
15
15
|
tournament: tournamentMetadata,
|
|
16
|
-
}, header: header, onSuccess: onSuccess, showRecipient: action === "join"
|
|
16
|
+
}, header: header, onSuccess: onSuccess, showRecipient: action === "join" }));
|
|
17
17
|
}
|
|
@@ -21,6 +21,5 @@ export interface AnySpendDepositHypeProps {
|
|
|
21
21
|
}) => void;
|
|
22
22
|
customUsdInputValues?: string[];
|
|
23
23
|
preferEoa?: boolean;
|
|
24
|
-
clientReferenceId?: string;
|
|
25
24
|
}
|
|
26
|
-
export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa,
|
|
25
|
+
export declare function AnySpendDepositHype({ loadOrder, mode, recipientAddress, paymentType, sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }: AnySpendDepositHypeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,7 +6,7 @@ export const HYPE_TOKEN_DETAILS = {
|
|
|
6
6
|
SYMBOL: "HYPE",
|
|
7
7
|
LOGO_URI: "https://cdn.hypeduel.com/hypes-coin.svg",
|
|
8
8
|
};
|
|
9
|
-
export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa,
|
|
9
|
+
export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddress, paymentType = "crypto", sourceTokenAddress, sourceTokenChainId, onSuccess, mainFooter, onTokenSelect, customUsdInputValues, preferEoa, }) {
|
|
10
10
|
if (!recipientAddress)
|
|
11
11
|
return null;
|
|
12
12
|
const header = () => (_jsx("div", { className: "mb-4 flex flex-col items-center gap-3 text-center", children: _jsx("div", { children: _jsx("h1", { className: "text-as-primary text-xl font-bold", children: paymentType === "crypto" ? "Deposit Crypto" : "Fund with Fiat" }) }) }));
|
|
@@ -19,5 +19,5 @@ export function AnySpendDepositHype({ loadOrder, mode = "modal", recipientAddres
|
|
|
19
19
|
logoURI: HYPE_TOKEN_DETAILS.LOGO_URI,
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
|
-
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: hypeToken, destinationChainId: base.id, orderType: "hype_duel", minDestinationAmount: 10, header: header, onSuccess: onSuccess, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa
|
|
22
|
+
return (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: sourceTokenChainId, destinationToken: hypeToken, destinationChainId: base.id, orderType: "hype_duel", minDestinationAmount: 10, header: header, onSuccess: onSuccess, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa }));
|
|
23
23
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { GenerateSigMintResponse } from "../../types/signatureMint";
|
|
2
|
-
export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData, imageUrl, onSuccess,
|
|
2
|
+
export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData, imageUrl, onSuccess, }: {
|
|
3
3
|
loadOrder?: string;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
5
|
signatureData: GenerateSigMintResponse;
|
|
6
6
|
imageUrl?: string;
|
|
7
7
|
onSuccess?: (txHash?: string) => void;
|
|
8
|
-
clientReferenceId?: string;
|
|
9
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,7 +35,7 @@ function generateEncodedDataForSignatureMint(signatureData) {
|
|
|
35
35
|
});
|
|
36
36
|
return encodedData;
|
|
37
37
|
}
|
|
38
|
-
export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess,
|
|
38
|
+
export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess, }) {
|
|
39
39
|
// Get token data
|
|
40
40
|
const { data: tokenData, isError: isTokenError, isLoading, } = useTokenData(signatureData.collection.chainId, signatureData.collection.signatureRequestBody?.currency);
|
|
41
41
|
// Convert token data to AnySpend Token type
|
|
@@ -68,5 +68,5 @@ export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData
|
|
|
68
68
|
const price = parseEther(signatureData.payload.price?.toString() || "0");
|
|
69
69
|
return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType: "custom", dstChainId: signatureData.collection.chainId, dstToken: dstToken, dstAmount: price.toString(), contractAddress: signatureData.collection.address || "", encodedData: encodedData, metadata: {
|
|
70
70
|
action: "Signature Mint",
|
|
71
|
-
}, header: header, onSuccess: onSuccess, showRecipient: true
|
|
71
|
+
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
72
72
|
}
|
|
@@ -19,7 +19,7 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
19
19
|
};
|
|
20
20
|
const { mutate: createOrder, isPending } = useMutation({
|
|
21
21
|
mutationFn: async (params) => {
|
|
22
|
-
const { recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId,
|
|
22
|
+
const { recipientAddress, orderType, dstChain, dstToken, srcFiatAmount, onramp, creatorAddress, expectedDstAmount, nft, tournament, payload, partnerId, } = params;
|
|
23
23
|
try {
|
|
24
24
|
// Validate required onramp fields
|
|
25
25
|
if (!onramp.vendor || !onramp.country) {
|
|
@@ -62,7 +62,6 @@ export function useAnyspendCreateOnrampOrder({ onSuccess, onError } = {}) {
|
|
|
62
62
|
}),
|
|
63
63
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
64
64
|
partnerId,
|
|
65
|
-
clientReferenceId,
|
|
66
65
|
visitorData,
|
|
67
66
|
});
|
|
68
67
|
}
|
|
@@ -17,7 +17,7 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
17
17
|
};
|
|
18
18
|
const { mutate: createOrder, isPending } = useMutation({
|
|
19
19
|
mutationFn: async (params) => {
|
|
20
|
-
const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress
|
|
20
|
+
const { recipientAddress, orderType, srcChain, dstChain, srcToken, dstToken, srcAmount, creatorAddress } = params;
|
|
21
21
|
try {
|
|
22
22
|
return await anyspendService.createOrder({
|
|
23
23
|
recipientAddress: normalizeAddress(recipientAddress),
|
|
@@ -50,7 +50,6 @@ export function useAnyspendCreateOrder({ onSuccess, onError } = {}) {
|
|
|
50
50
|
},
|
|
51
51
|
}),
|
|
52
52
|
creatorAddress: creatorAddress ? normalizeAddress(creatorAddress) : undefined,
|
|
53
|
-
clientReferenceId,
|
|
54
53
|
visitorData,
|
|
55
54
|
});
|
|
56
55
|
}
|