@b3dotfun/sdk 0.0.29 → 0.0.30-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/constants/index.d.ts +1 -0
- package/dist/cjs/anyspend/constants/index.js +2 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +23 -24
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +4 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +17 -10
- package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +9 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +124 -41
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +6 -3
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +6 -4
- package/dist/cjs/anyspend/react/components/common/OrderStatus.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +1 -1
- 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.js +6 -4
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +34 -3
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/bondkit/abis/BondkitTokenABI.d.ts +62 -17
- package/dist/cjs/bondkit/abis/BondkitTokenABI.js +41 -9
- package/dist/cjs/bondkit/abis/BondkitTokenFactoryABI.d.ts +0 -25
- package/dist/cjs/bondkit/abis/BondkitTokenFactoryABI.js +0 -9
- package/dist/cjs/bondkit/constants.js +1 -1
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +28 -15
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +1 -1
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +2 -1
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -1
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +1 -0
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +4 -2
- package/dist/cjs/shared/constants/chains/b3Chain.d.ts +2 -2
- package/dist/cjs/shared/constants/chains/supported.d.ts +4 -4
- package/dist/cjs/shared/constants/index.d.ts +1 -0
- package/dist/cjs/shared/constants/index.js +2 -1
- package/dist/esm/anyspend/constants/index.d.ts +1 -0
- package/dist/esm/anyspend/constants/index.js +1 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +23 -24
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -1
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +4 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +19 -12
- package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +6 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +126 -43
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +7 -4
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +7 -5
- package/dist/esm/anyspend/react/components/common/OrderStatus.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +1 -1
- 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.js +7 -5
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +35 -4
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/bondkit/abis/BondkitTokenABI.d.ts +62 -17
- package/dist/esm/bondkit/abis/BondkitTokenABI.js +41 -9
- package/dist/esm/bondkit/abis/BondkitTokenFactoryABI.d.ts +0 -25
- package/dist/esm/bondkit/abis/BondkitTokenFactoryABI.js +0 -9
- package/dist/esm/bondkit/constants.js +1 -1
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +28 -15
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +1 -1
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +2 -1
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +2 -1
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +1 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +4 -2
- package/dist/esm/shared/constants/chains/b3Chain.d.ts +2 -2
- package/dist/esm/shared/constants/chains/supported.d.ts +4 -4
- package/dist/esm/shared/constants/index.d.ts +1 -0
- package/dist/esm/shared/constants/index.js +1 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/index.d.ts +1 -0
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +4 -2
- package/dist/types/anyspend/react/components/common/OrderStatus.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +2 -1
- package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +2 -1
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/bondkit/abis/BondkitTokenABI.d.ts +62 -17
- package/dist/types/bondkit/abis/BondkitTokenFactoryABI.d.ts +0 -25
- package/dist/types/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +4 -2
- package/dist/types/shared/constants/chains/b3Chain.d.ts +2 -2
- package/dist/types/shared/constants/chains/supported.d.ts +4 -4
- package/dist/types/shared/constants/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/anyspend/constants/index.ts +2 -0
- package/src/anyspend/react/components/AnySpend.tsx +2 -1
- package/src/anyspend/react/components/AnySpendBondKit.tsx +28 -28
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +2 -1
- package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +2 -1
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +143 -130
- package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +9 -0
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +243 -104
- package/src/anyspend/react/components/common/OrderDetails.tsx +7 -3
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +10 -4
- package/src/anyspend/react/components/common/OrderStatus.tsx +9 -2
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +2 -2
- package/src/anyspend/react/components/common/PanelOnramp.tsx +3 -1
- package/src/anyspend/react/components/common/PaySection.tsx +10 -8
- package/src/anyspend/react/hooks/useAnyspendFlow.ts +41 -3
- package/src/bondkit/abis/BondkitTokenABI.ts +41 -9
- package/src/bondkit/abis/BondkitTokenFactoryABI.ts +0 -9
- package/src/bondkit/constants.ts +1 -1
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +26 -10
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +5 -1
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +2 -1
- package/src/global-account/react/hooks/useNativeBalance.tsx +2 -1
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +1 -0
- package/src/global-account/react/stores/useModalStore.ts +4 -2
- package/src/shared/constants/index.ts +2 -0
- package/dist/cjs/anyspend/abis/bondKit.d.ts +0 -35
- package/dist/cjs/anyspend/abis/bondKit.js +0 -29
- package/dist/esm/anyspend/abis/bondKit.d.ts +0 -35
- package/dist/esm/anyspend/abis/bondKit.js +0 -26
- package/dist/types/anyspend/abis/bondKit.d.ts +0 -35
- package/src/anyspend/abis/bondKit.ts +0 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { ALL_CHAINS, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, RELAY_ETH_ADDRESS, RELAY_SOLANA_MAINNET_CHAIN_ID, } from "../../../../anyspend/index.js";
|
|
3
|
+
import { ALL_CHAINS, DEPOSIT_HYPE_ACTION, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, RELAY_ETH_ADDRESS, RELAY_SOLANA_MAINNET_CHAIN_ID, } from "../../../../anyspend/index.js";
|
|
4
4
|
import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useModalStore, useProfile, useUnifiedChainSwitchAndExecute, } from "../../../../global-account/react/index.js";
|
|
5
5
|
import { useRouter, useSearchParams } from "../../../../shared/react/hooks/index.js";
|
|
6
6
|
import { cn } from "../../../../shared/utils/index.js";
|
|
@@ -43,6 +43,9 @@ function getOrderSuccessText({ order, tournament, formattedActualDstAmount, dstT
|
|
|
43
43
|
actionText = `funded ${tournament?.name}`;
|
|
44
44
|
return `Successfully ${actionText}`;
|
|
45
45
|
case "custom":
|
|
46
|
+
if (order.metadata.action === DEPOSIT_HYPE_ACTION) {
|
|
47
|
+
return `Successfully deposited ${formatTokenAmount(BigInt(order.payload?.amount || "0"), 18)} HYPE to ${recipient}`;
|
|
48
|
+
}
|
|
46
49
|
actionText = order.metadata.action || `executed contract`;
|
|
47
50
|
return `Successfully ${actionText}`;
|
|
48
51
|
default:
|
|
@@ -139,7 +142,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
139
142
|
const [txHash, setTxHash] = useState();
|
|
140
143
|
const [showQRCode, setShowQRCode] = useState(false);
|
|
141
144
|
const { isLoading: txLoading, isSuccess: txSuccess } = useWaitForTransactionReceipt({ hash: txHash });
|
|
142
|
-
const {
|
|
145
|
+
const { switchChainAndExecuteWithEOA, isSwitchingOrExecuting } = useUnifiedChainSwitchAndExecute();
|
|
143
146
|
const { colorMode } = useColorMode();
|
|
144
147
|
const roundedUpSrcAmount = useMemo(() => {
|
|
145
148
|
// Display the full transfer amount without rounding since users need to see the exact value they're transferring.
|
|
@@ -169,11 +172,11 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
169
172
|
to = order.srcTokenAddress;
|
|
170
173
|
value = BigInt(0);
|
|
171
174
|
}
|
|
172
|
-
const txHash = await
|
|
175
|
+
const txHash = await switchChainAndExecuteWithEOA(order.srcChain, { to, data: txData, value });
|
|
173
176
|
if (txHash) {
|
|
174
177
|
setTxHash(txHash);
|
|
175
178
|
}
|
|
176
|
-
}, [order,
|
|
179
|
+
}, [order, switchChainAndExecuteWithEOA]);
|
|
177
180
|
// Main payment handler that triggers chain switch and payment
|
|
178
181
|
const handlePayment = async () => {
|
|
179
182
|
console.log("Initiating payment process. Target chain:", order.srcChain, "Current chain:", walletClient?.chain?.id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ALL_CHAINS, capitalizeFirstLetter, getChainName } from "../../../../anyspend/index.js";
|
|
3
|
+
import { ALL_CHAINS, capitalizeFirstLetter, DEPOSIT_HYPE_ACTION, getChainName } from "../../../../anyspend/index.js";
|
|
4
4
|
import { CopyToClipboard } from "../../../../global-account/react/index.js";
|
|
5
5
|
import { cn } from "../../../../shared/utils/index.js";
|
|
6
6
|
import centerTruncate from "../../../../shared/utils/centerTruncate.js";
|
|
@@ -29,8 +29,10 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({ o
|
|
|
29
29
|
: order.type === "fund_tournament"
|
|
30
30
|
? "Fund tournament"
|
|
31
31
|
: order.type === "custom"
|
|
32
|
-
? order.metadata.action
|
|
33
|
-
?
|
|
34
|
-
:
|
|
35
|
-
|
|
32
|
+
? order.metadata.action === DEPOSIT_HYPE_ACTION
|
|
33
|
+
? "Deposit HYPE"
|
|
34
|
+
: order.metadata.action
|
|
35
|
+
? capitalizeFirstLetter(order.metadata.action)
|
|
36
|
+
: "Contract execution"
|
|
37
|
+
: "" }), _jsxs("div", { className: "flex items-end gap-2", children: [order.type === "swap" ? (`~${finalFormattedExpectedDstAmount} ${dstToken.symbol}`) : order.type === "mint_nft" ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("img", { src: nft?.imageUrl, alt: nft?.name || "NFT", className: "h-5 w-5" }), _jsx("div", { children: nft?.name || "NFT" })] })) : order.type === "join_tournament" || order.type === "fund_tournament" ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("img", { src: tournament?.imageUrl, alt: tournament?.name || "Tournament", className: "h-5 w-5" }), _jsx("div", { children: tournament?.name || "Tournament" })] })) : order.type === "custom" && order.metadata.action === DEPOSIT_HYPE_ACTION ? (_jsx("div", { className: "flex items-center gap-2", children: _jsxs("div", { children: [formatTokenAmount(BigInt(order.payload.amount), dstToken.decimals), " HYPE"] }) })) : null, _jsxs("div", { className: "text-as-primary/50 flex items-center gap-2", children: [_jsxs("span", { children: ["on ", order.dstChain !== b3.id && getChainName(order.dstChain)] }), _jsx("img", { src: ALL_CHAINS[order.dstChain].logoUrl, alt: getChainName(order.dstChain), className: cn("h-3", order.dstChain !== b3.id && "w-3 rounded-full", order.dstChain === b3.id && "h-4") })] })] })] }), _jsx("div", { className: "divider w-full" }), _jsxs("div", { className: "flex w-full justify-between gap-4", children: [_jsx("div", { className: "text-as-tertiarry", children: showTotal ? "Total (included fee)" : "Order ID" }), _jsx("div", { className: "text-as-primary overflow-hidden text-ellipsis whitespace-nowrap", children: showTotal && totalAmount ? totalAmount : order.id })] })] }) })) : (_jsxs("div", { className: "flex w-full items-center", children: [_jsx("div", { className: "divider w-full" }), _jsx("button", { className: "whitespace-nowrap text-sm", onClick: () => setShowOrderDetails(true), children: "Order Details" }), _jsx(ChevronDown, { className: "text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" }), _jsx("div", { className: "divider w-full" })] })) }));
|
|
36
38
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
|
+
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
2
3
|
export declare const OrderStatus: import("react").NamedExoticComponent<{
|
|
3
4
|
order: components["schemas"]["Order"];
|
|
5
|
+
selectedCryptoPaymentMethod?: CryptoPaymentMethodType;
|
|
4
6
|
}>;
|
|
@@ -4,11 +4,11 @@ import { useSearchParams } from "../../../../shared/react/index.js";
|
|
|
4
4
|
import { Check, X } from "lucide-react";
|
|
5
5
|
import { memo } from "react";
|
|
6
6
|
import { StepProgress } from "./StepProgress.js";
|
|
7
|
-
export const OrderStatus = memo(function OrderStatus({ order }) {
|
|
7
|
+
export const OrderStatus = memo(function OrderStatus({ order, selectedCryptoPaymentMethod, }) {
|
|
8
8
|
const isComplete = order.status === "executed";
|
|
9
9
|
const { text, status: displayStatus, description } = getStatusDisplay(order);
|
|
10
10
|
const searchParams = useSearchParams();
|
|
11
|
-
const cryptoPaymentMethod = searchParams.get("cryptoPaymentMethod");
|
|
11
|
+
const cryptoPaymentMethod = selectedCryptoPaymentMethod || searchParams.get("cryptoPaymentMethod");
|
|
12
12
|
console.log("OrderStatus", displayStatus);
|
|
13
13
|
console.log("OrderStatus", order);
|
|
14
14
|
const paymentSteps = [
|
|
@@ -43,5 +43,5 @@ export function OrderTokenAmount({ disabled, inputValue, onChangeInput, context,
|
|
|
43
43
|
onChangeInput("0.01");
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
return (_jsx("div", { className: cn("border-as-stroke flex w-full flex-col gap-2 rounded-xl", className), children: _jsxs("div", { className: cn("flex items-center justify-between gap-3", innerClassName), children: [!canEditAmount ? (_jsx("h2", { className: cn("text-3xl font-medium text-white", amountClassName), children: inputValue || "--" })) : (_jsx(NumericFormat, { decimalSeparator: ".", allowedDecimalSeparators: [","], thousandSeparator: true, inputMode: "decimal", autoComplete: "off", autoCorrect: "off", type: "text", placeholder: "0.00", minLength: 1, maxLength: 30, spellCheck: "false", className: cn("placeholder:text-as-primary/70 disabled:text-as-primary/70 text-as-primary w-full bg-transparent text-4xl font-semibold leading-[42px] outline-none sm:text-[30px]", amountClassName), pattern: "^[0-9]*[.,]?[0-9]*$", disabled: disabled, value: inputValue, allowNegative: false, onChange: e => onChangeInput(e.currentTarget.value) }, `input-${token.address}-${chainId}`)), !hideTokenSelect && (_jsx(TokenSelector, { address: address, chainIdsFilter: Object.values(ALL_CHAINS).map(chain => chain.id), context: context, fromChainWalletVMSupported: true, isValidAddress: true, lockedChainIds: Object.values(ALL_CHAINS).map(chain => chain.id), multiWalletSupportEnabled: true, onAnalyticEvent: undefined, popularChainIds: [1, 8453, RELAY_SOLANA_MAINNET_CHAIN_ID], setToken: handleTokenSelect, supportedWalletVMs: ["evm", "svm"], token: undefined, trigger: _jsxs(Button, { variant: "outline", role: "combobox", className: cn("bg-b3-react-background border-as-stroke flex h-auto w-fit shrink-0 items-center justify-center gap-2 rounded-xl border-2 px-2 py-1 pr-2 text-center", tokenSelectClassName), children: [token.metadata.logoURI ? (_jsx(ChainTokenIcon, { chainUrl: ALL_CHAINS[chainId].logoUrl, tokenUrl: token.metadata.logoURI, className: "h-8 min-h-8 w-8 min-w-8" })) : (_jsx("div", { className: "h-8 w-8 rounded-full bg-gray-700" })), _jsxs("div", { className: "flex flex-col items-start gap-0", children: [_jsx("div", { className: "text-as-primary font-semibold", children: token.symbol }), _jsx("div", { className: "text-as-primary/70 text-xs", children: ALL_CHAINS[chainId].name })] }), _jsx(ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-70" })] }) }, `selector-${context}-${token.address}-${chainId}`))] }) }, `${context}-${token.address}-${chainId}`));
|
|
46
|
+
return (_jsx("div", { className: cn("border-as-stroke flex w-full flex-col gap-2 rounded-xl", className), children: _jsxs("div", { className: cn("flex items-center justify-between gap-3", innerClassName), children: [!canEditAmount ? (_jsx("h2", { className: cn("text-3xl font-medium text-white", amountClassName), children: inputValue || "--" })) : (_jsx(NumericFormat, { decimalSeparator: ".", allowedDecimalSeparators: [","], thousandSeparator: true, inputMode: "decimal", autoComplete: "off", autoCorrect: "off", type: "text", placeholder: "0.00", minLength: 1, maxLength: 30, spellCheck: "false", className: cn("placeholder:text-as-primary/70 disabled:text-as-primary/70 text-as-primary w-full bg-transparent text-4xl font-semibold leading-[42px] outline-none sm:text-[30px]", amountClassName), pattern: "^[0-9]*[.,]?[0-9]*$", disabled: disabled, value: inputValue, allowNegative: false, onChange: e => onChangeInput(e.currentTarget.value) }, `input-${token.address}-${chainId}`)), !hideTokenSelect && (_jsx(TokenSelector, { address: address, chainIdsFilter: Object.values(ALL_CHAINS).map(chain => chain.id), context: context, fromChainWalletVMSupported: true, isValidAddress: true, lockedChainIds: Object.values(ALL_CHAINS).map(chain => chain.id), multiWalletSupportEnabled: true, onAnalyticEvent: undefined, popularChainIds: [1, 8453, RELAY_SOLANA_MAINNET_CHAIN_ID], setToken: handleTokenSelect, supportedWalletVMs: ["evm", "svm"], token: undefined, trigger: _jsxs(Button, { variant: "outline", role: "combobox", className: cn("token-selector-button bg-b3-react-background border-as-stroke flex h-auto w-fit shrink-0 items-center justify-center gap-2 rounded-xl border-2 px-2 py-1 pr-2 text-center", tokenSelectClassName), children: [token.metadata.logoURI ? (_jsx(ChainTokenIcon, { chainUrl: ALL_CHAINS[chainId].logoUrl, tokenUrl: token.metadata.logoURI, className: "h-8 min-h-8 w-8 min-w-8" })) : (_jsx("div", { className: "h-8 w-8 rounded-full bg-gray-700" })), _jsxs("div", { className: "flex flex-col items-start gap-0", children: [_jsx("div", { className: "text-as-primary font-semibold", children: token.symbol }), _jsx("div", { className: "text-as-primary/70 text-xs", children: ALL_CHAINS[chainId].name })] }), _jsx(ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-70" })] }) }, `selector-${context}-${token.address}-${chainId}`))] }) }, `${context}-${token.address}-${chainId}`));
|
|
47
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
3
|
-
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, }: {
|
|
3
|
+
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, }: {
|
|
4
4
|
srcAmountOnRamp: string;
|
|
5
5
|
setSrcAmountOnRamp: (amount: string) => void;
|
|
6
6
|
selectedPaymentMethod?: FiatPaymentMethod;
|
|
@@ -12,4 +12,5 @@ export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selec
|
|
|
12
12
|
onDestinationTokenChange?: (token: components["schemas"]["Token"]) => void;
|
|
13
13
|
onDestinationChainChange?: (chainId: number) => void;
|
|
14
14
|
fiatPaymentMethodIndex: number;
|
|
15
|
+
recipientSelectionPanelIndex: number;
|
|
15
16
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,7 @@ import { useRef } from "react";
|
|
|
9
9
|
import { toast } from "sonner";
|
|
10
10
|
import { FiatPaymentMethod } from "./FiatPaymentMethod.js";
|
|
11
11
|
import { OrderTokenAmountFiat } from "./OrderTokenAmountFiat.js";
|
|
12
|
-
export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, }) {
|
|
12
|
+
export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, }) {
|
|
13
13
|
// Get geo-based onramp options to access fee information
|
|
14
14
|
const { stripeWeb2Support } = useGeoOnrampOptions(srcAmountOnRamp);
|
|
15
15
|
// Helper function to get fees from API data
|
|
@@ -70,7 +70,7 @@ export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPayme
|
|
|
70
70
|
width: `${Math.max(50, srcAmountOnRamp.length * 34)}px`,
|
|
71
71
|
} })] }) }), _jsx("div", { className: "mx-auto mb-6 inline-grid grid-cols-4 gap-2", children: ["5", "10", "20", "25"].map(value => (_jsxs("button", { onClick: () => handleQuickAmount(value), className: `bg-as-surface-secondary border-as-border-secondary hover:border-as-border-secondary h-7 w-14 rounded-lg border text-sm font-medium transition-all duration-200 ${srcAmountOnRamp === value
|
|
72
72
|
? "border-as-border-secondary bg-as-surface-secondary"
|
|
73
|
-
: "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && (_jsx(OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), _jsxs("div", { className: "border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4", children: [_jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? (_jsxs("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(
|
|
73
|
+
: "bg-as-surface-secondary hover:bg-as-surface-secondary"}`, children: ["$", value] }, value))) }), destinationToken && destinationChainId && (_jsx(OrderTokenAmountFiat, { address: _recipientAddress, context: "to", inputValue: destinationAmount || "0", onChangeInput: () => { }, chainId: destinationChainId, setChainId: onDestinationChainChange || (() => { }), token: destinationToken, setToken: onDestinationTokenChange || (() => { }) }))] }), _jsxs("div", { className: "border-as-border-secondary bg-as-surface-secondary mt-4 flex w-full flex-col gap-3 rounded-xl border p-4", children: [_jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm", children: "Recipient" }), _recipientAddress ? (_jsxs("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(recipientSelectionPanelIndex), children: [_jsx("span", { className: "text-sm", children: recipientName ? formatUsername(recipientName) : formatAddress(_recipientAddress) }), _jsx(ChevronRight, { size: 16 })] })) : (_jsxs("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm transition-colors hover:text-blue-700", onClick: () => setActivePanel(5), children: [_jsx(Wallet, { className: "text-as-brand", size: 16 }), "Select recipient", _jsx(ChevronRight, { size: 16 })] }))] }), _jsx("div", { className: "divider w-full" }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-as-tertiarry text-sm", children: "Expected to receive" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("span", { className: "text-as-primary font-semibold", children: [destinationAmount || "0", " ", destinationToken?.symbol || ""] }), _jsxs("span", { className: "text-as-tertiarry text-sm", children: ["on ", destinationChainId ? ALL_CHAINS[destinationChainId]?.name : ""] }), destinationToken && destinationChainId && destinationToken.metadata?.logoURI && (_jsx("img", { src: ALL_CHAINS[destinationChainId]?.logoUrl, alt: "Chain", className: "h-4 w-4 rounded-full" }))] })] }), _jsx("div", { className: "divider w-full" }), _jsx("div", { className: "", children: _jsx("div", { className: "flex items-center justify-between", children: (() => {
|
|
74
74
|
const currentPaymentMethod = selectedPaymentMethod || FiatPaymentMethod.NONE;
|
|
75
75
|
const fee = getFeeFromApi(currentPaymentMethod);
|
|
76
76
|
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-as-tertiarry text-sm", children: fee !== null ? `Total (included $${fee.toFixed(2)} fee)` : "Total" }), _jsxs("span", { className: "text-as-primary font-semibold", children: ["$", getTotalAmount(currentPaymentMethod).toFixed(2)] })] }));
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Input,
|
|
2
|
+
import { Input, useProfile, useTokenData } from "../../../../global-account/react/index.js";
|
|
3
3
|
import { formatUsername } from "../../../../shared/utils/index.js";
|
|
4
4
|
import { shortenAddress } from "../../../../shared/utils/formatAddress.js";
|
|
5
5
|
import { formatDisplayNumber } from "../../../../shared/utils/number.js";
|
|
6
6
|
import { ChevronRight } from "lucide-react";
|
|
7
7
|
import { motion } from "motion/react";
|
|
8
8
|
import { useEffect, useRef } from "react";
|
|
9
|
+
import { useAccount } from "wagmi";
|
|
9
10
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod.js";
|
|
10
11
|
import { FiatPaymentMethod } from "./FiatPaymentMethod.js";
|
|
11
12
|
import { OrderTokenAmount } from "./OrderTokenAmount.js";
|
|
12
13
|
import { TokenBalance } from "./TokenBalance.js";
|
|
13
14
|
export function PaySection({ paymentType, selectedSrcChainId, setSelectedSrcChainId, selectedSrcToken, setSelectedSrcToken, srcAmount, setSrcAmount, setIsSrcInputDirty, selectedCryptoPaymentMethod, selectedFiatPaymentMethod, onSelectCryptoPaymentMethod, onSelectFiatPaymentMethod, anyspendQuote, }) {
|
|
14
|
-
const { address:
|
|
15
|
-
const
|
|
15
|
+
const { address: connectedAddress, isConnected } = useAccount();
|
|
16
|
+
const { data: profileData } = useProfile({ address: connectedAddress });
|
|
17
|
+
const connectedName = profileData?.displayName;
|
|
16
18
|
const { data: srcTokenMetadata } = useTokenData(selectedSrcToken?.chainId, selectedSrcToken?.address);
|
|
17
19
|
// Add ref to track if we've applied metadata
|
|
18
20
|
const appliedSrcMetadataRef = useRef(false);
|
|
@@ -38,13 +40,13 @@ export function PaySection({ paymentType, selectedSrcChainId, setSelectedSrcChai
|
|
|
38
40
|
useEffect(() => {
|
|
39
41
|
appliedSrcMetadataRef.current = false;
|
|
40
42
|
}, [selectedSrcToken.address, selectedSrcToken.chainId]);
|
|
41
|
-
return (_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, ease: "easeInOut" }, className: "bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-as-primary/50 flex h-7 items-center text-sm", children: "Pay" }), paymentType === "crypto" ? (_jsx("button", { className: "text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors", onClick: onSelectCryptoPaymentMethod, children: selectedCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ? (_jsxs(_Fragment, { children: [
|
|
43
|
+
return (_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, ease: "easeInOut" }, className: "pay-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-as-primary/50 flex h-7 items-center text-sm", children: "Pay" }), paymentType === "crypto" ? (_jsx("button", { className: "text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors focus:!outline-none", onClick: onSelectCryptoPaymentMethod, children: selectedCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ? (_jsxs(_Fragment, { children: [isConnected ? (_jsx("div", { className: "flex items-center gap-1", children: connectedName ? formatUsername(connectedName) : shortenAddress(connectedAddress || "") })) : ("Connect wallet"), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : selectedCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO ? (_jsxs(_Fragment, { children: ["Transfer crypto", _jsx(ChevronRight, { className: "h-4 w-4" })] })) : (_jsxs(_Fragment, { children: ["Select payment method", _jsx(ChevronRight, { className: "h-4 w-4" })] })) })) : (_jsx("button", { className: "text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors", onClick: onSelectFiatPaymentMethod, children: selectedFiatPaymentMethod === FiatPaymentMethod.COINBASE_PAY ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: "C" }) }), "Coinbase Pay"] }), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : selectedFiatPaymentMethod === FiatPaymentMethod.STRIPE ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: "S" }) }), "Credit/Debit Card"] }), _jsx(ChevronRight, { className: "h-4 w-4" })] })) : (_jsxs(_Fragment, { children: ["Select payment method", _jsx(ChevronRight, { className: "h-4 w-4" })] })) }))] }), paymentType === "crypto" ? (_jsxs(_Fragment, { children: [_jsx(OrderTokenAmount, { address: connectedAddress, context: "from", inputValue: srcAmount, onChangeInput: value => {
|
|
42
44
|
setIsSrcInputDirty(true);
|
|
43
45
|
setSrcAmount(value);
|
|
44
46
|
}, chainId: selectedSrcChainId, setChainId: setSelectedSrcChainId, token: selectedSrcToken, setToken: setSelectedSrcToken }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "text-as-primary/50 flex h-5 items-center text-sm", children: formatDisplayNumber(anyspendQuote?.data?.currencyIn?.amountUsd, {
|
|
45
47
|
style: "currency",
|
|
46
48
|
fallback: "",
|
|
47
|
-
}) }), _jsx(TokenBalance, { token: selectedSrcToken, walletAddress:
|
|
49
|
+
}) }), _jsx(TokenBalance, { token: selectedSrcToken, walletAddress: connectedAddress, onChangeInput: value => {
|
|
48
50
|
setIsSrcInputDirty(true);
|
|
49
51
|
setSrcAmount(value);
|
|
50
52
|
} })] })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center justify-center pb-2 pt-8", children: _jsxs("div", { className: "flex gap-1", children: [_jsx("span", { className: "text-as-tertiarry text-2xl font-bold", children: "$" }), _jsx(Input, { type: "text", value: srcAmount, onChange: e => setSrcAmount(e.target.value.replace(/[^0-9.]/g, "")), placeholder: "5", className: "text-as-primary placeholder:text-as-primary/50 h-auto min-w-[70px] border-0 bg-transparent p-0 px-3 pt-1 text-4xl font-bold focus-visible:ring-0 focus-visible:ring-offset-0", style: {
|
|
@@ -18,8 +18,9 @@ interface UseAnyspendFlowProps {
|
|
|
18
18
|
onTransactionSuccess?: () => void;
|
|
19
19
|
sourceTokenAddress?: string;
|
|
20
20
|
sourceTokenChainId?: number;
|
|
21
|
+
slippage?: number;
|
|
21
22
|
}
|
|
22
|
-
export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrder, isDepositMode, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, }: UseAnyspendFlowProps): {
|
|
23
|
+
export declare function useAnyspendFlow({ paymentType, recipientAddress, loadOrder, isDepositMode, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, slippage, }: UseAnyspendFlowProps): {
|
|
23
24
|
activePanel: PanelView;
|
|
24
25
|
setActivePanel: import("react").Dispatch<import("react").SetStateAction<PanelView>>;
|
|
25
26
|
orderId: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { B3_TOKEN, getDefaultToken, USDC_BASE } from "../../../anyspend/index.js";
|
|
2
2
|
import { useAnyspendCreateOnrampOrder, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote, useGeoOnrampOptions, } from "../../../anyspend/react/index.js";
|
|
3
3
|
import { anyspendService } from "../../../anyspend/services/anyspend.js";
|
|
4
|
-
import { useAccountWallet, useProfile } from "../../../global-account/react/index.js";
|
|
4
|
+
import { useAccountWallet, useProfile, useRouter, useSearchParamsSSR } from "../../../global-account/react/index.js";
|
|
5
5
|
import { formatTokenAmount, formatUnits } from "../../../shared/utils/number.js";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
import { toast } from "sonner";
|
|
@@ -18,7 +18,9 @@ export var PanelView;
|
|
|
18
18
|
PanelView[PanelView["ORDER_DETAILS"] = 4] = "ORDER_DETAILS";
|
|
19
19
|
PanelView[PanelView["LOADING"] = 5] = "LOADING";
|
|
20
20
|
})(PanelView || (PanelView = {}));
|
|
21
|
-
export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder, isDepositMode = false, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, }) {
|
|
21
|
+
export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder, isDepositMode = false, onOrderSuccess, onTransactionSuccess, sourceTokenAddress, sourceTokenChainId, slippage = 0, }) {
|
|
22
|
+
const searchParams = useSearchParamsSSR();
|
|
23
|
+
const router = useRouter();
|
|
22
24
|
// Panel and order state
|
|
23
25
|
const [activePanel, setActivePanel] = useState(loadOrder ? PanelView.ORDER_DETAILS : PanelView.MAIN);
|
|
24
26
|
const [orderId, setOrderId] = useState(loadOrder);
|
|
@@ -45,6 +47,11 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
|
|
|
45
47
|
setSelectedRecipientAddress(globalAddress);
|
|
46
48
|
}
|
|
47
49
|
}, [selectedRecipientAddress, globalAddress]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (paymentType === "crypto") {
|
|
52
|
+
setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
|
|
53
|
+
}
|
|
54
|
+
}, [paymentType]);
|
|
48
55
|
// Fetch specific token when sourceTokenAddress and sourceTokenChainId are provided
|
|
49
56
|
useEffect(() => {
|
|
50
57
|
const fetchSourceToken = async () => {
|
|
@@ -92,13 +99,25 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
|
|
|
92
99
|
if (anyspendQuote?.data?.currencyOut?.amount && anyspendQuote.data.currencyOut.currency?.decimals) {
|
|
93
100
|
const amount = anyspendQuote.data.currencyOut.amount;
|
|
94
101
|
const decimals = anyspendQuote.data.currencyOut.currency.decimals;
|
|
95
|
-
|
|
102
|
+
// Apply slippage (0-100) - reduce amount by slippage percentageFixed slippage value
|
|
103
|
+
const amountWithSlippage = (BigInt(amount) * BigInt(100 - slippage)) / BigInt(100);
|
|
104
|
+
const formattedAmount = formatTokenAmount(amountWithSlippage, decimals, 6, false);
|
|
96
105
|
setDstAmount(formattedAmount);
|
|
97
106
|
}
|
|
98
107
|
else {
|
|
99
108
|
setDstAmount("");
|
|
100
109
|
}
|
|
101
|
-
}, [anyspendQuote]);
|
|
110
|
+
}, [anyspendQuote, slippage]);
|
|
111
|
+
// Update useEffect for URL parameter to not override loadOrder
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (loadOrder)
|
|
114
|
+
return; // Skip if we have a loadOrder
|
|
115
|
+
const orderIdParam = searchParams.get("orderId");
|
|
116
|
+
if (orderIdParam) {
|
|
117
|
+
setOrderId(orderIdParam);
|
|
118
|
+
setActivePanel(PanelView.ORDER_DETAILS);
|
|
119
|
+
}
|
|
120
|
+
}, [searchParams, loadOrder]);
|
|
102
121
|
// Order creation hooks
|
|
103
122
|
const { createOrder, isCreatingOrder } = useAnyspendCreateOrder({
|
|
104
123
|
onSuccess: data => {
|
|
@@ -106,6 +125,18 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
|
|
|
106
125
|
setOrderId(newOrderId);
|
|
107
126
|
setActivePanel(PanelView.ORDER_DETAILS);
|
|
108
127
|
onOrderSuccess?.(newOrderId);
|
|
128
|
+
// Add orderId and payment method to URL for persistence
|
|
129
|
+
const params = new URLSearchParams(searchParams.toString()); // Preserve existing params
|
|
130
|
+
params.set("orderId", newOrderId);
|
|
131
|
+
if (selectedCryptoPaymentMethod !== CryptoPaymentMethodType.NONE) {
|
|
132
|
+
console.log("Setting cryptoPaymentMethod in URL:", selectedCryptoPaymentMethod);
|
|
133
|
+
params.set("cryptoPaymentMethod", selectedCryptoPaymentMethod);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
console.log("Payment method is NONE, not setting in URL");
|
|
137
|
+
}
|
|
138
|
+
console.log("Final URL params:", params.toString());
|
|
139
|
+
router.push(`${window.location.pathname}?${params.toString()}`);
|
|
109
140
|
},
|
|
110
141
|
onError: error => {
|
|
111
142
|
console.error(error);
|
|
@@ -286,14 +286,6 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
286
286
|
}];
|
|
287
287
|
readonly name: "ValidationInvalidLPSplitRatio";
|
|
288
288
|
readonly type: "error";
|
|
289
|
-
}, {
|
|
290
|
-
readonly inputs: readonly [{
|
|
291
|
-
readonly internalType: "address";
|
|
292
|
-
readonly name: "providedAddress";
|
|
293
|
-
readonly type: "address";
|
|
294
|
-
}];
|
|
295
|
-
readonly name: "ValidationInvalidMigrationAdminAddress";
|
|
296
|
-
readonly type: "error";
|
|
297
289
|
}, {
|
|
298
290
|
readonly inputs: readonly [{
|
|
299
291
|
readonly internalType: "uint24";
|
|
@@ -330,6 +322,21 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
330
322
|
}];
|
|
331
323
|
readonly name: "Approval";
|
|
332
324
|
readonly type: "event";
|
|
325
|
+
}, {
|
|
326
|
+
readonly anonymous: false;
|
|
327
|
+
readonly inputs: readonly [{
|
|
328
|
+
readonly indexed: true;
|
|
329
|
+
readonly internalType: "address";
|
|
330
|
+
readonly name: "previousAdmin";
|
|
331
|
+
readonly type: "address";
|
|
332
|
+
}, {
|
|
333
|
+
readonly indexed: true;
|
|
334
|
+
readonly internalType: "address";
|
|
335
|
+
readonly name: "newAdmin";
|
|
336
|
+
readonly type: "address";
|
|
337
|
+
}];
|
|
338
|
+
readonly name: "B3AdminUpdated";
|
|
339
|
+
readonly type: "event";
|
|
333
340
|
}, {
|
|
334
341
|
readonly anonymous: false;
|
|
335
342
|
readonly inputs: readonly [{
|
|
@@ -465,6 +472,21 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
465
472
|
}];
|
|
466
473
|
readonly name: "BondkitTokenMigrated";
|
|
467
474
|
readonly type: "event";
|
|
475
|
+
}, {
|
|
476
|
+
readonly anonymous: false;
|
|
477
|
+
readonly inputs: readonly [{
|
|
478
|
+
readonly indexed: false;
|
|
479
|
+
readonly internalType: "uint256";
|
|
480
|
+
readonly name: "totalRaisedBonding";
|
|
481
|
+
readonly type: "uint256";
|
|
482
|
+
}, {
|
|
483
|
+
readonly indexed: false;
|
|
484
|
+
readonly internalType: "uint256";
|
|
485
|
+
readonly name: "targetAmount";
|
|
486
|
+
readonly type: "uint256";
|
|
487
|
+
}];
|
|
488
|
+
readonly name: "DexTriggerThresholdMet";
|
|
489
|
+
readonly type: "event";
|
|
468
490
|
}, {
|
|
469
491
|
readonly anonymous: false;
|
|
470
492
|
readonly inputs: readonly [{
|
|
@@ -591,6 +613,16 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
591
613
|
}];
|
|
592
614
|
readonly stateMutability: "nonpayable";
|
|
593
615
|
readonly type: "function";
|
|
616
|
+
}, {
|
|
617
|
+
readonly inputs: readonly [];
|
|
618
|
+
readonly name: "b3Admin";
|
|
619
|
+
readonly outputs: readonly [{
|
|
620
|
+
readonly internalType: "address";
|
|
621
|
+
readonly name: "";
|
|
622
|
+
readonly type: "address";
|
|
623
|
+
}];
|
|
624
|
+
readonly stateMutability: "view";
|
|
625
|
+
readonly type: "function";
|
|
594
626
|
}, {
|
|
595
627
|
readonly inputs: readonly [{
|
|
596
628
|
readonly internalType: "address";
|
|
@@ -627,7 +659,7 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
627
659
|
}];
|
|
628
660
|
readonly name: "buy";
|
|
629
661
|
readonly outputs: readonly [];
|
|
630
|
-
readonly stateMutability: "
|
|
662
|
+
readonly stateMutability: "nonpayable";
|
|
631
663
|
readonly type: "function";
|
|
632
664
|
}, {
|
|
633
665
|
readonly inputs: readonly [{
|
|
@@ -645,7 +677,7 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
645
677
|
}];
|
|
646
678
|
readonly name: "buyFor";
|
|
647
679
|
readonly outputs: readonly [];
|
|
648
|
-
readonly stateMutability: "
|
|
680
|
+
readonly stateMutability: "nonpayable";
|
|
649
681
|
readonly type: "function";
|
|
650
682
|
}, {
|
|
651
683
|
readonly inputs: readonly [];
|
|
@@ -743,6 +775,16 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
743
775
|
}];
|
|
744
776
|
readonly stateMutability: "view";
|
|
745
777
|
readonly type: "function";
|
|
778
|
+
}, {
|
|
779
|
+
readonly inputs: readonly [];
|
|
780
|
+
readonly name: "getB3Admin";
|
|
781
|
+
readonly outputs: readonly [{
|
|
782
|
+
readonly internalType: "address";
|
|
783
|
+
readonly name: "";
|
|
784
|
+
readonly type: "address";
|
|
785
|
+
}];
|
|
786
|
+
readonly stateMutability: "view";
|
|
787
|
+
readonly type: "function";
|
|
746
788
|
}, {
|
|
747
789
|
readonly inputs: readonly [];
|
|
748
790
|
readonly name: "getBondingCurveConfig";
|
|
@@ -979,10 +1021,6 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
979
1021
|
readonly internalType: "address";
|
|
980
1022
|
readonly name: "tradingToken";
|
|
981
1023
|
readonly type: "address";
|
|
982
|
-
}, {
|
|
983
|
-
readonly internalType: "address";
|
|
984
|
-
readonly name: "migrationAdminAddress";
|
|
985
|
-
readonly type: "address";
|
|
986
1024
|
}, {
|
|
987
1025
|
readonly internalType: "address";
|
|
988
1026
|
readonly name: "bondingPhaseSplitter";
|
|
@@ -1182,6 +1220,16 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
1182
1220
|
readonly outputs: readonly [];
|
|
1183
1221
|
readonly stateMutability: "nonpayable";
|
|
1184
1222
|
readonly type: "function";
|
|
1223
|
+
}, {
|
|
1224
|
+
readonly inputs: readonly [{
|
|
1225
|
+
readonly internalType: "address";
|
|
1226
|
+
readonly name: "_newAdmin";
|
|
1227
|
+
readonly type: "address";
|
|
1228
|
+
}];
|
|
1229
|
+
readonly name: "updateB3Admin";
|
|
1230
|
+
readonly outputs: readonly [];
|
|
1231
|
+
readonly stateMutability: "nonpayable";
|
|
1232
|
+
readonly type: "function";
|
|
1185
1233
|
}, {
|
|
1186
1234
|
readonly inputs: readonly [{
|
|
1187
1235
|
readonly internalType: "address";
|
|
@@ -1242,7 +1290,4 @@ export declare const BondkitTokenABI: readonly [{
|
|
|
1242
1290
|
}];
|
|
1243
1291
|
readonly stateMutability: "view";
|
|
1244
1292
|
readonly type: "function";
|
|
1245
|
-
}, {
|
|
1246
|
-
readonly stateMutability: "payable";
|
|
1247
|
-
readonly type: "receive";
|
|
1248
1293
|
}];
|
|
@@ -158,11 +158,6 @@ export const BondkitTokenABI = [
|
|
|
158
158
|
name: "ValidationInvalidLPSplitRatio",
|
|
159
159
|
type: "error",
|
|
160
160
|
},
|
|
161
|
-
{
|
|
162
|
-
inputs: [{ internalType: "address", name: "providedAddress", type: "address" }],
|
|
163
|
-
name: "ValidationInvalidMigrationAdminAddress",
|
|
164
|
-
type: "error",
|
|
165
|
-
},
|
|
166
161
|
{
|
|
167
162
|
inputs: [{ internalType: "uint24", name: "value", type: "uint24" }],
|
|
168
163
|
name: "ValidationInvalidV4PoolFee",
|
|
@@ -183,6 +178,15 @@ export const BondkitTokenABI = [
|
|
|
183
178
|
name: "Approval",
|
|
184
179
|
type: "event",
|
|
185
180
|
},
|
|
181
|
+
{
|
|
182
|
+
anonymous: false,
|
|
183
|
+
inputs: [
|
|
184
|
+
{ indexed: true, internalType: "address", name: "previousAdmin", type: "address" },
|
|
185
|
+
{ indexed: true, internalType: "address", name: "newAdmin", type: "address" },
|
|
186
|
+
],
|
|
187
|
+
name: "B3AdminUpdated",
|
|
188
|
+
type: "event",
|
|
189
|
+
},
|
|
186
190
|
{
|
|
187
191
|
anonymous: false,
|
|
188
192
|
inputs: [
|
|
@@ -234,6 +238,15 @@ export const BondkitTokenABI = [
|
|
|
234
238
|
name: "BondkitTokenMigrated",
|
|
235
239
|
type: "event",
|
|
236
240
|
},
|
|
241
|
+
{
|
|
242
|
+
anonymous: false,
|
|
243
|
+
inputs: [
|
|
244
|
+
{ indexed: false, internalType: "uint256", name: "totalRaisedBonding", type: "uint256" },
|
|
245
|
+
{ indexed: false, internalType: "uint256", name: "targetAmount", type: "uint256" },
|
|
246
|
+
],
|
|
247
|
+
name: "DexTriggerThresholdMet",
|
|
248
|
+
type: "event",
|
|
249
|
+
},
|
|
237
250
|
{
|
|
238
251
|
anonymous: false,
|
|
239
252
|
inputs: [
|
|
@@ -302,6 +315,13 @@ export const BondkitTokenABI = [
|
|
|
302
315
|
stateMutability: "nonpayable",
|
|
303
316
|
type: "function",
|
|
304
317
|
},
|
|
318
|
+
{
|
|
319
|
+
inputs: [],
|
|
320
|
+
name: "b3Admin",
|
|
321
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
322
|
+
stateMutability: "view",
|
|
323
|
+
type: "function",
|
|
324
|
+
},
|
|
305
325
|
{
|
|
306
326
|
inputs: [{ internalType: "address", name: "account", type: "address" }],
|
|
307
327
|
name: "balanceOf",
|
|
@@ -323,7 +343,7 @@ export const BondkitTokenABI = [
|
|
|
323
343
|
],
|
|
324
344
|
name: "buy",
|
|
325
345
|
outputs: [],
|
|
326
|
-
stateMutability: "
|
|
346
|
+
stateMutability: "nonpayable",
|
|
327
347
|
type: "function",
|
|
328
348
|
},
|
|
329
349
|
{
|
|
@@ -334,7 +354,7 @@ export const BondkitTokenABI = [
|
|
|
334
354
|
],
|
|
335
355
|
name: "buyFor",
|
|
336
356
|
outputs: [],
|
|
337
|
-
stateMutability: "
|
|
357
|
+
stateMutability: "nonpayable",
|
|
338
358
|
type: "function",
|
|
339
359
|
},
|
|
340
360
|
{
|
|
@@ -397,6 +417,13 @@ export const BondkitTokenABI = [
|
|
|
397
417
|
stateMutability: "view",
|
|
398
418
|
type: "function",
|
|
399
419
|
},
|
|
420
|
+
{
|
|
421
|
+
inputs: [],
|
|
422
|
+
name: "getB3Admin",
|
|
423
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
424
|
+
stateMutability: "view",
|
|
425
|
+
type: "function",
|
|
426
|
+
},
|
|
400
427
|
{
|
|
401
428
|
inputs: [],
|
|
402
429
|
name: "getBondingCurveConfig",
|
|
@@ -539,7 +566,6 @@ export const BondkitTokenABI = [
|
|
|
539
566
|
{ internalType: "uint256", name: "lpSplitRatioFeeRecipientBps", type: "uint256" },
|
|
540
567
|
{ internalType: "uint256", name: "targetAmount", type: "uint256" },
|
|
541
568
|
{ internalType: "address", name: "tradingToken", type: "address" },
|
|
542
|
-
{ internalType: "address", name: "migrationAdminAddress", type: "address" },
|
|
543
569
|
{ internalType: "address", name: "bondingPhaseSplitter", type: "address" },
|
|
544
570
|
{ internalType: "address", name: "v4PoolManager", type: "address" },
|
|
545
571
|
{ internalType: "address", name: "v4Hook", type: "address" },
|
|
@@ -659,6 +685,13 @@ export const BondkitTokenABI = [
|
|
|
659
685
|
stateMutability: "nonpayable",
|
|
660
686
|
type: "function",
|
|
661
687
|
},
|
|
688
|
+
{
|
|
689
|
+
inputs: [{ internalType: "address", name: "_newAdmin", type: "address" }],
|
|
690
|
+
name: "updateB3Admin",
|
|
691
|
+
outputs: [],
|
|
692
|
+
stateMutability: "nonpayable",
|
|
693
|
+
type: "function",
|
|
694
|
+
},
|
|
662
695
|
{
|
|
663
696
|
inputs: [{ internalType: "address", name: "_bondingPhaseSplitter", type: "address" }],
|
|
664
697
|
name: "updateSplitter",
|
|
@@ -701,5 +734,4 @@ export const BondkitTokenABI = [
|
|
|
701
734
|
stateMutability: "view",
|
|
702
735
|
type: "function",
|
|
703
736
|
},
|
|
704
|
-
{ stateMutability: "payable", type: "receive" },
|
|
705
737
|
];
|
|
@@ -106,14 +106,6 @@ export declare const BondkitTokenFactoryABI: readonly [{
|
|
|
106
106
|
}];
|
|
107
107
|
readonly name: "ValidationInvalidLPSplitRatio";
|
|
108
108
|
readonly type: "error";
|
|
109
|
-
}, {
|
|
110
|
-
readonly inputs: readonly [{
|
|
111
|
-
readonly internalType: "address";
|
|
112
|
-
readonly name: "providedAddress";
|
|
113
|
-
readonly type: "address";
|
|
114
|
-
}];
|
|
115
|
-
readonly name: "ValidationInvalidMigrationAdminAddress";
|
|
116
|
-
readonly type: "error";
|
|
117
109
|
}, {
|
|
118
110
|
readonly inputs: readonly [{
|
|
119
111
|
readonly internalType: "uint24";
|
|
@@ -157,11 +149,6 @@ export declare const BondkitTokenFactoryABI: readonly [{
|
|
|
157
149
|
readonly internalType: "address";
|
|
158
150
|
readonly name: "feeRecipient";
|
|
159
151
|
readonly type: "address";
|
|
160
|
-
}, {
|
|
161
|
-
readonly indexed: false;
|
|
162
|
-
readonly internalType: "address";
|
|
163
|
-
readonly name: "migrationAdmin";
|
|
164
|
-
readonly type: "address";
|
|
165
152
|
}];
|
|
166
153
|
readonly name: "BondkitTokenCreated";
|
|
167
154
|
readonly type: "event";
|
|
@@ -259,10 +246,6 @@ export declare const BondkitTokenFactoryABI: readonly [{
|
|
|
259
246
|
readonly internalType: "address";
|
|
260
247
|
readonly name: "tradingToken";
|
|
261
248
|
readonly type: "address";
|
|
262
|
-
}, {
|
|
263
|
-
readonly internalType: "address";
|
|
264
|
-
readonly name: "migrationAdminAddress";
|
|
265
|
-
readonly type: "address";
|
|
266
249
|
}, {
|
|
267
250
|
readonly internalType: "address";
|
|
268
251
|
readonly name: "bondingPhaseSplitter";
|
|
@@ -350,10 +333,6 @@ export declare const BondkitTokenFactoryABI: readonly [{
|
|
|
350
333
|
readonly internalType: "address";
|
|
351
334
|
readonly name: "tradingToken";
|
|
352
335
|
readonly type: "address";
|
|
353
|
-
}, {
|
|
354
|
-
readonly internalType: "address";
|
|
355
|
-
readonly name: "migrationAdminAddress";
|
|
356
|
-
readonly type: "address";
|
|
357
336
|
}, {
|
|
358
337
|
readonly internalType: "address";
|
|
359
338
|
readonly name: "bondingPhaseSplitter";
|
|
@@ -461,10 +440,6 @@ export declare const BondkitTokenFactoryABI: readonly [{
|
|
|
461
440
|
readonly internalType: "address";
|
|
462
441
|
readonly name: "tradingToken";
|
|
463
442
|
readonly type: "address";
|
|
464
|
-
}, {
|
|
465
|
-
readonly internalType: "address";
|
|
466
|
-
readonly name: "migrationAdminAddress";
|
|
467
|
-
readonly type: "address";
|
|
468
443
|
}, {
|
|
469
444
|
readonly internalType: "address";
|
|
470
445
|
readonly name: "bondingPhaseSplitter";
|