@b3dotfun/sdk 0.0.28-alpha.0 → 0.0.28-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/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/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 +1 -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/stores/useModalStore.ts +19 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanelView = void 0;
|
|
4
|
+
exports.useAnyspendFlow = useAnyspendFlow;
|
|
5
|
+
const anyspend_1 = require("../../../anyspend");
|
|
6
|
+
const react_1 = require("../../../anyspend/react");
|
|
7
|
+
const anyspend_2 = require("../../../anyspend/services/anyspend");
|
|
8
|
+
const react_2 = require("../../../global-account/react");
|
|
9
|
+
const number_1 = require("../../../shared/utils/number");
|
|
10
|
+
const react_3 = require("react");
|
|
11
|
+
const sonner_1 = require("sonner");
|
|
12
|
+
const viem_1 = require("viem");
|
|
13
|
+
const chains_1 = require("viem/chains");
|
|
14
|
+
const CryptoPaymentMethod_1 = require("../components/common/CryptoPaymentMethod");
|
|
15
|
+
const FiatPaymentMethod_1 = require("../components/common/FiatPaymentMethod");
|
|
16
|
+
var PanelView;
|
|
17
|
+
(function (PanelView) {
|
|
18
|
+
PanelView[PanelView["MAIN"] = 0] = "MAIN";
|
|
19
|
+
PanelView[PanelView["CRYPTO_PAYMENT_METHOD"] = 1] = "CRYPTO_PAYMENT_METHOD";
|
|
20
|
+
PanelView[PanelView["FIAT_PAYMENT_METHOD"] = 2] = "FIAT_PAYMENT_METHOD";
|
|
21
|
+
PanelView[PanelView["RECIPIENT_SELECTION"] = 3] = "RECIPIENT_SELECTION";
|
|
22
|
+
PanelView[PanelView["ORDER_DETAILS"] = 4] = "ORDER_DETAILS";
|
|
23
|
+
PanelView[PanelView["LOADING"] = 5] = "LOADING";
|
|
24
|
+
})(PanelView || (exports.PanelView = PanelView = {}));
|
|
25
|
+
function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder, isDepositMode = false, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, }) {
|
|
26
|
+
// Panel and order state
|
|
27
|
+
const [activePanel, setActivePanel] = (0, react_3.useState)(loadOrder ? PanelView.ORDER_DETAILS : PanelView.MAIN);
|
|
28
|
+
const [orderId, setOrderId] = (0, react_3.useState)(loadOrder);
|
|
29
|
+
const { orderAndTransactions: oat } = (0, react_1.useAnyspendOrderAndTransactions)(orderId);
|
|
30
|
+
// Token selection state - use provided sourceTokenChainId if available
|
|
31
|
+
const [selectedSrcChainId, setSelectedSrcChainId] = (0, react_3.useState)(sourceTokenChainId || (paymentType === "fiat" ? chains_1.base.id : chains_1.mainnet.id));
|
|
32
|
+
const [selectedDstChainId, setSelectedDstChainId] = (0, react_3.useState)(chains_1.base.id); // Default to Base for cross-chain swaps
|
|
33
|
+
const defaultSrcToken = paymentType === "fiat" ? anyspend_1.USDC_BASE : (0, anyspend_1.getDefaultToken)(selectedSrcChainId);
|
|
34
|
+
const [selectedSrcToken, setSelectedSrcToken] = (0, react_3.useState)(defaultSrcToken);
|
|
35
|
+
const [srcAmount, setSrcAmount] = (0, react_3.useState)(paymentType === "fiat" ? "5" : "0.1");
|
|
36
|
+
const [dstAmount, setDstAmount] = (0, react_3.useState)("");
|
|
37
|
+
const [isSrcInputDirty, setIsSrcInputDirty] = (0, react_3.useState)(true);
|
|
38
|
+
// Payment method state
|
|
39
|
+
const [selectedCryptoPaymentMethod, setSelectedCryptoPaymentMethod] = (0, react_3.useState)(CryptoPaymentMethod_1.CryptoPaymentMethodType.NONE);
|
|
40
|
+
const [selectedFiatPaymentMethod, setSelectedFiatPaymentMethod] = (0, react_3.useState)(FiatPaymentMethod_1.FiatPaymentMethod.NONE);
|
|
41
|
+
// Recipient state
|
|
42
|
+
const { address: globalAddress } = (0, react_2.useAccountWallet)();
|
|
43
|
+
const [selectedRecipientAddress, setSelectedRecipientAddress] = (0, react_3.useState)(recipientAddress);
|
|
44
|
+
const recipientProfile = (0, react_2.useProfile)({ address: selectedRecipientAddress, fresh: true });
|
|
45
|
+
const recipientName = recipientProfile.data?.name;
|
|
46
|
+
// Set default recipient address when wallet changes
|
|
47
|
+
(0, react_3.useEffect)(() => {
|
|
48
|
+
if (!selectedRecipientAddress && globalAddress) {
|
|
49
|
+
setSelectedRecipientAddress(globalAddress);
|
|
50
|
+
}
|
|
51
|
+
}, [selectedRecipientAddress, globalAddress]);
|
|
52
|
+
// Fetch specific token when sourceTokenAddress and sourceTokenChainId are provided
|
|
53
|
+
(0, react_3.useEffect)(() => {
|
|
54
|
+
const fetchSourceToken = async () => {
|
|
55
|
+
if (sourceTokenAddress && sourceTokenChainId) {
|
|
56
|
+
try {
|
|
57
|
+
const token = await anyspend_2.anyspendService.getToken(sourceTokenChainId, sourceTokenAddress);
|
|
58
|
+
setSelectedSrcToken(token);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.error("Failed to fetch source token:", error);
|
|
62
|
+
sonner_1.toast.error(`Failed to load token ${sourceTokenAddress} on chain ${sourceTokenChainId}`);
|
|
63
|
+
// Keep the default token on error
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
fetchSourceToken();
|
|
68
|
+
}, [sourceTokenAddress, sourceTokenChainId]);
|
|
69
|
+
// Helper function for onramp vendor mapping
|
|
70
|
+
const getOnrampVendor = (paymentMethod) => {
|
|
71
|
+
switch (paymentMethod) {
|
|
72
|
+
case FiatPaymentMethod_1.FiatPaymentMethod.COINBASE_PAY:
|
|
73
|
+
return "coinbase";
|
|
74
|
+
case FiatPaymentMethod_1.FiatPaymentMethod.STRIPE:
|
|
75
|
+
return "stripe-web2";
|
|
76
|
+
default:
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
// Get quote
|
|
81
|
+
const activeInputAmountInWei = (0, viem_1.parseUnits)(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals).toString();
|
|
82
|
+
const { anyspendQuote, isLoadingAnyspendQuote, getAnyspendQuoteError } = (0, react_1.useAnyspendQuote)({
|
|
83
|
+
srcChain: paymentType === "fiat" ? chains_1.base.id : selectedSrcChainId,
|
|
84
|
+
dstChain: isDepositMode ? chains_1.base.id : selectedDstChainId, // For deposits, always Base; for swaps, use selected destination
|
|
85
|
+
srcTokenAddress: paymentType === "fiat" ? anyspend_1.USDC_BASE.address : selectedSrcToken.address,
|
|
86
|
+
dstTokenAddress: isDepositMode ? anyspend_1.B3_TOKEN.address : selectedSrcToken.address, // For deposits, always B3
|
|
87
|
+
type: "swap",
|
|
88
|
+
tradeType: "EXACT_INPUT",
|
|
89
|
+
amount: activeInputAmountInWei,
|
|
90
|
+
onrampVendor: paymentType === "fiat" ? getOnrampVendor(selectedFiatPaymentMethod) : undefined,
|
|
91
|
+
});
|
|
92
|
+
// Get geo options for fiat
|
|
93
|
+
const { geoData, coinbaseAvailablePaymentMethods, stripeWeb2Support } = (0, react_1.useGeoOnrampOptions)(paymentType === "fiat" ? (0, number_1.formatUnits)(activeInputAmountInWei, anyspend_1.USDC_BASE.decimals) : "0");
|
|
94
|
+
// Update destination amount when quote changes
|
|
95
|
+
(0, react_3.useEffect)(() => {
|
|
96
|
+
if (anyspendQuote?.data?.currencyOut?.amount && anyspendQuote.data.currencyOut.currency?.decimals) {
|
|
97
|
+
const amount = anyspendQuote.data.currencyOut.amount;
|
|
98
|
+
const decimals = anyspendQuote.data.currencyOut.currency.decimals;
|
|
99
|
+
const formattedAmount = (0, number_1.formatTokenAmount)(BigInt(amount), decimals, 6, false);
|
|
100
|
+
setDstAmount(formattedAmount);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
setDstAmount("");
|
|
104
|
+
}
|
|
105
|
+
}, [anyspendQuote]);
|
|
106
|
+
// Order creation hooks
|
|
107
|
+
const { createOrder, isCreatingOrder } = (0, react_1.useAnyspendCreateOrder)({
|
|
108
|
+
onSuccess: data => {
|
|
109
|
+
const newOrderId = data.data.id;
|
|
110
|
+
setOrderId(newOrderId);
|
|
111
|
+
setActivePanel(PanelView.ORDER_DETAILS);
|
|
112
|
+
onOrderSuccess?.(newOrderId);
|
|
113
|
+
},
|
|
114
|
+
onError: error => {
|
|
115
|
+
console.error(error);
|
|
116
|
+
sonner_1.toast.error("Failed to create order: " + error.message);
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
const { createOrder: createOnrampOrder, isCreatingOrder: isCreatingOnrampOrder } = (0, react_1.useAnyspendCreateOnrampOrder)({
|
|
120
|
+
onSuccess: data => {
|
|
121
|
+
const newOrderId = data.data.id;
|
|
122
|
+
setOrderId(newOrderId);
|
|
123
|
+
setActivePanel(PanelView.ORDER_DETAILS);
|
|
124
|
+
onOrderSuccess?.(newOrderId);
|
|
125
|
+
},
|
|
126
|
+
onError: error => {
|
|
127
|
+
console.error(error);
|
|
128
|
+
sonner_1.toast.error("Failed to create order: " + error.message);
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
// Handle order completion
|
|
132
|
+
(0, react_3.useEffect)(() => {
|
|
133
|
+
if (oat?.data?.order.status === "executed") {
|
|
134
|
+
console.log("Order executed successfully");
|
|
135
|
+
onTransactionSuccess?.();
|
|
136
|
+
}
|
|
137
|
+
}, [oat?.data?.order.status, onTransactionSuccess]);
|
|
138
|
+
return {
|
|
139
|
+
// State
|
|
140
|
+
activePanel,
|
|
141
|
+
setActivePanel,
|
|
142
|
+
orderId,
|
|
143
|
+
setOrderId,
|
|
144
|
+
oat,
|
|
145
|
+
// Token state
|
|
146
|
+
selectedSrcChainId,
|
|
147
|
+
setSelectedSrcChainId,
|
|
148
|
+
selectedDstChainId,
|
|
149
|
+
setSelectedDstChainId,
|
|
150
|
+
selectedSrcToken,
|
|
151
|
+
setSelectedSrcToken,
|
|
152
|
+
srcAmount,
|
|
153
|
+
setSrcAmount,
|
|
154
|
+
dstAmount,
|
|
155
|
+
setDstAmount,
|
|
156
|
+
isSrcInputDirty,
|
|
157
|
+
setIsSrcInputDirty,
|
|
158
|
+
// Payment methods
|
|
159
|
+
selectedCryptoPaymentMethod,
|
|
160
|
+
setSelectedCryptoPaymentMethod,
|
|
161
|
+
selectedFiatPaymentMethod,
|
|
162
|
+
setSelectedFiatPaymentMethod,
|
|
163
|
+
// Recipient
|
|
164
|
+
selectedRecipientAddress,
|
|
165
|
+
setSelectedRecipientAddress,
|
|
166
|
+
recipientName,
|
|
167
|
+
globalAddress,
|
|
168
|
+
// Quote data
|
|
169
|
+
anyspendQuote,
|
|
170
|
+
isLoadingAnyspendQuote,
|
|
171
|
+
getAnyspendQuoteError,
|
|
172
|
+
activeInputAmountInWei,
|
|
173
|
+
// Geo/onramp data
|
|
174
|
+
geoData,
|
|
175
|
+
coinbaseAvailablePaymentMethods,
|
|
176
|
+
stripeWeb2Support,
|
|
177
|
+
getOnrampVendor,
|
|
178
|
+
// Order creation
|
|
179
|
+
createOrder,
|
|
180
|
+
isCreatingOrder,
|
|
181
|
+
createOnrampOrder,
|
|
182
|
+
isCreatingOnrampOrder,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
@@ -28,10 +28,10 @@ export declare const useGenerateSigMintData: ({ recipientAddress, contractAddres
|
|
|
28
28
|
description?: string | undefined;
|
|
29
29
|
properties?: any;
|
|
30
30
|
image?: string | undefined;
|
|
31
|
+
backgroundColor?: string | undefined;
|
|
31
32
|
externalLink?: string | undefined;
|
|
32
33
|
appUri?: string | undefined;
|
|
33
34
|
attributes?: any;
|
|
34
|
-
backgroundColor?: string | undefined;
|
|
35
35
|
promptImageUrl?: string | undefined;
|
|
36
36
|
};
|
|
37
37
|
} | undefined;
|
|
@@ -48,8 +48,8 @@ export declare const useGenerateSigMintData: ({ recipientAddress, contractAddres
|
|
|
48
48
|
creatorMap?: {} | undefined;
|
|
49
49
|
chainId: number;
|
|
50
50
|
address: string;
|
|
51
|
-
title: string;
|
|
52
51
|
_id: string | {};
|
|
52
|
+
title: string;
|
|
53
53
|
};
|
|
54
54
|
} | null;
|
|
55
55
|
error: Error | null;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.B3DynamicModal = B3DynamicModal;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("../../../anyspend/react");
|
|
6
|
+
const AnyspendDepositHype_1 = require("../../../anyspend/react/components/AnyspendDepositHype");
|
|
6
7
|
const react_2 = require("../../../global-account/react");
|
|
7
8
|
const cn_1 = require("../../../shared/utils/cn");
|
|
8
9
|
const debug_1 = require("../../../shared/utils/debug");
|
|
@@ -86,6 +87,8 @@ function B3DynamicModal() {
|
|
|
86
87
|
return (0, jsx_runtime_1.jsx)(react_1.AnySpendBondKit, { ...contentType });
|
|
87
88
|
case "linkAccount":
|
|
88
89
|
return (0, jsx_runtime_1.jsx)(LinkAccount_1.LinkAccount, { ...contentType });
|
|
90
|
+
case "anySpendDepositHype":
|
|
91
|
+
return (0, jsx_runtime_1.jsx)(AnyspendDepositHype_1.AnySpendDepositHype, { ...contentType, mode: "modal" });
|
|
89
92
|
// Add other modal types here
|
|
90
93
|
default:
|
|
91
94
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
declare const buttonVariants: (props?: ({
|
|
3
3
|
variant?: "link" | "default" | "b3" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
4
|
-
size?: "default" | "
|
|
4
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
6
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
7
|
variant?: "default" | "outline";
|
|
@@ -2,7 +2,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
-
size?: "default" | "
|
|
5
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
asChild?: boolean;
|
|
@@ -23,7 +23,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
|
|
|
23
23
|
ref?: React.Ref<HTMLInputElement>;
|
|
24
24
|
} & {
|
|
25
25
|
asChild?: boolean;
|
|
26
|
-
}, "key" |
|
|
26
|
+
}, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "asChild">, "type" | "value" | "onChange"> & {
|
|
27
27
|
value?: string;
|
|
28
28
|
onValueChange?: (search: string) => void;
|
|
29
29
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -67,7 +67,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
|
67
67
|
ref?: React.Ref<HTMLDivElement>;
|
|
68
68
|
} & {
|
|
69
69
|
asChild?: boolean;
|
|
70
|
-
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "
|
|
70
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "onSelect" | "disabled"> & {
|
|
71
71
|
disabled?: boolean;
|
|
72
72
|
onSelect?: (value: string) => void;
|
|
73
73
|
value?: string;
|
|
@@ -287,10 +287,26 @@ export interface LinkAccountModalProps extends BaseModalProps {
|
|
|
287
287
|
partnerId: string;
|
|
288
288
|
chain: Chain;
|
|
289
289
|
}
|
|
290
|
+
export interface AnySpendDepositHypeProps extends BaseModalProps {
|
|
291
|
+
/** Modal type identifier */
|
|
292
|
+
type: "anySpendDepositHype";
|
|
293
|
+
/** Recipient address to receive the tokens */
|
|
294
|
+
recipientAddress: string;
|
|
295
|
+
/** Destination token address */
|
|
296
|
+
sourceTokenAddress?: string;
|
|
297
|
+
/** Source token chain ID */
|
|
298
|
+
sourceTokenChainId?: number;
|
|
299
|
+
/** Payment type - crypto or fiat */
|
|
300
|
+
paymentType?: "crypto" | "fiat";
|
|
301
|
+
/** Deposit contract address */
|
|
302
|
+
depositContractAddress: string;
|
|
303
|
+
/** Callback function called when the deposit is successful */
|
|
304
|
+
onSuccess?: () => void;
|
|
305
|
+
}
|
|
290
306
|
/**
|
|
291
307
|
* Union type of all possible modal content types
|
|
292
308
|
*/
|
|
293
|
-
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | TransakProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps;
|
|
309
|
+
export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | TransakProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | AnySpendDepositHypeProps;
|
|
294
310
|
/**
|
|
295
311
|
* State interface for the modal store
|
|
296
312
|
*/
|
|
@@ -10,9 +10,9 @@ export declare const supportedChainNetworks: {
|
|
|
10
10
|
testnet?: boolean | undefined;
|
|
11
11
|
fees?: Record<string, any> | undefined;
|
|
12
12
|
formatters?: Record<string, any> | undefined;
|
|
13
|
-
color?: string | undefined;
|
|
14
13
|
testnetConfigID?: number | undefined;
|
|
15
14
|
badge?: string | undefined;
|
|
15
|
+
color?: string | undefined;
|
|
16
16
|
enabledFeatures?: string[] | undefined;
|
|
17
17
|
blockExplorers: {
|
|
18
18
|
default: string;
|
|
@@ -35,13 +35,13 @@ export declare const supportedChainNetworks: {
|
|
|
35
35
|
uri: string;
|
|
36
36
|
}[];
|
|
37
37
|
};
|
|
38
|
+
_id: string | {};
|
|
38
39
|
icon: {
|
|
39
40
|
format: string;
|
|
40
41
|
url: string;
|
|
41
|
-
height: number;
|
|
42
42
|
width: number;
|
|
43
|
+
height: number;
|
|
43
44
|
};
|
|
44
|
-
_id: string | {};
|
|
45
45
|
}[];
|
|
46
46
|
export declare const coingeckoChains: Record<number, {
|
|
47
47
|
coingecko_id: string;
|