@b3dotfun/sdk 0.1.69-alpha.16 → 0.1.69-alpha.17
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/rpc.d.ts +1 -1
- package/dist/cjs/anyspend/constants/rpc.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +3 -3
- package/dist/cjs/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
- package/dist/cjs/anyspend/utils/chain.js +8 -7
- 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/shared/constants/chains/b3Chain.d.ts +7 -7
- package/dist/cjs/shared/constants/chains/b3Chain.js +4 -4
- package/dist/cjs/shared/constants/chains/b3Viem.d.ts +6 -0
- package/dist/cjs/shared/constants/chains/b3Viem.js +19 -0
- package/dist/cjs/shared/constants/chains/supported.d.ts +1 -1
- package/dist/cjs/shared/generated/chain-networks.json +2 -2
- package/dist/cjs/shared/utils/chains.d.ts +1 -1
- package/dist/cjs/shared/utils/chains.js +2 -2
- package/dist/esm/anyspend/constants/rpc.d.ts +1 -1
- package/dist/esm/anyspend/constants/rpc.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +3 -3
- package/dist/esm/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
- package/dist/esm/anyspend/utils/chain.js +10 -9
- 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/shared/constants/chains/b3Chain.d.ts +7 -7
- package/dist/esm/shared/constants/chains/b3Chain.js +4 -4
- package/dist/esm/shared/constants/chains/b3Viem.d.ts +6 -0
- package/dist/esm/shared/constants/chains/b3Viem.js +16 -0
- package/dist/esm/shared/constants/chains/supported.d.ts +1 -1
- package/dist/esm/shared/generated/chain-networks.json +2 -2
- package/dist/esm/shared/utils/chains.d.ts +1 -1
- package/dist/esm/shared/utils/chains.js +2 -2
- package/dist/types/anyspend/constants/rpc.d.ts +1 -1
- 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/shared/constants/chains/b3Chain.d.ts +7 -7
- package/dist/types/shared/constants/chains/b3Viem.d.ts +6 -0
- package/dist/types/shared/constants/chains/supported.d.ts +1 -1
- package/dist/types/shared/utils/chains.d.ts +1 -1
- package/package.json +1 -1
- package/src/anyspend/constants/rpc.ts +2 -1
- package/src/anyspend/react/components/AnySpendNFT.tsx +2 -2
- package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +3 -3
- package/src/anyspend/react/components/common/InsufficientDepositPayment.tsx +2 -2
- package/src/anyspend/react/components/common/OrderDetails.tsx +2 -2
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +4 -4
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +2 -2
- package/src/anyspend/utils/chain.ts +9 -8
- package/src/shared/constants/chains/b3Chain.ts +5 -5
- package/src/shared/constants/chains/b3Viem.ts +18 -0
- package/src/shared/generated/chain-networks.json +2 -2
- package/src/shared/utils/chains.ts +3 -2
|
@@ -13,7 +13,7 @@ export declare const OPTIMISM_PUBLIC_RPC = "https://optimism-rpc.publicnode.com"
|
|
|
13
13
|
export declare const POLYGON_PUBLIC_RPC = "https://polygon-bor-rpc.publicnode.com";
|
|
14
14
|
export declare const AVALANCHE_PUBLIC_RPC = "https://avalanche-c-chain-rpc.publicnode.com";
|
|
15
15
|
export declare const BSC_PUBLIC_RPC = "https://bsc-rpc.publicnode.com";
|
|
16
|
-
export declare const B3_PUBLIC_RPC = "https://
|
|
16
|
+
export declare const B3_PUBLIC_RPC = "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/";
|
|
17
17
|
export declare const ABSTRACT_PUBLIC_RPC = "https://api.mainnet.abs.xyz";
|
|
18
18
|
export declare const HYPEREVM_PUBLIC_RPC = "https://rpc.hyperliquid.xyz/evm";
|
|
19
19
|
/**
|
|
@@ -18,7 +18,7 @@ exports.POLYGON_PUBLIC_RPC = "https://polygon-bor-rpc.publicnode.com";
|
|
|
18
18
|
exports.AVALANCHE_PUBLIC_RPC = "https://avalanche-c-chain-rpc.publicnode.com";
|
|
19
19
|
exports.BSC_PUBLIC_RPC = "https://bsc-rpc.publicnode.com";
|
|
20
20
|
// Chain-specific public endpoints
|
|
21
|
-
exports.B3_PUBLIC_RPC = "https://
|
|
21
|
+
exports.B3_PUBLIC_RPC = "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/";
|
|
22
22
|
exports.ABSTRACT_PUBLIC_RPC = "https://api.mainnet.abs.xyz";
|
|
23
23
|
exports.HYPEREVM_PUBLIC_RPC = "https://rpc.hyperliquid.xyz/evm";
|
|
24
24
|
/**
|
|
@@ -10,7 +10,7 @@ const number_1 = require("../../../shared/utils/number");
|
|
|
10
10
|
const lucide_react_1 = require("lucide-react");
|
|
11
11
|
const react_2 = require("motion/react");
|
|
12
12
|
const react_3 = require("react");
|
|
13
|
-
const
|
|
13
|
+
const b3Viem_1 = require("../../../shared/constants/chains/b3Viem");
|
|
14
14
|
const AnySpendCustom_1 = require("./AnySpendCustom");
|
|
15
15
|
// ABI for contractURI and uri functions
|
|
16
16
|
const CONTRACT_URI_ABI = [
|
|
@@ -92,5 +92,5 @@ function DropdownMenu({ nftContract }) {
|
|
|
92
92
|
const [open, setOpen] = (0, react_3.useState)(false);
|
|
93
93
|
const chain = anyspend_1.ALL_CHAINS[nftContract.chainId];
|
|
94
94
|
const nftUrl = (0, anyspend_1.getExplorerAddressUrl)(nftContract.chainId, nftContract.contractAddress);
|
|
95
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Popover, { open: open, onOpenChange: setOpen, children: [(0, jsx_runtime_1.jsx)(react_1.PopoverTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)("button", { className: "absolute bottom-3 right-3 z-10 flex items-center justify-center rounded-full bg-black/20 p-1 text-white hover:bg-black/30", "aria-label": "Open NFT menu", children: (0, jsx_runtime_1.jsx)(lucide_react_1.MoreVertical, { className: "h-3 w-3" }) }) }), (0, jsx_runtime_1.jsx)(react_1.PopoverContent, { align: "end", className: "bg-b3-react-background border-b3-react-border min-w-48 rounded-lg border p-0 shadow-md backdrop-blur-sm", children: (0, jsx_runtime_1.jsxs)("div", { className: "pointer-events-auto flex w-full flex-col gap-2 py-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2 text-sm", children: ["Native mint price:", (0, jsx_runtime_1.jsxs)("span", { className: "font-semibold", children: [(0, number_1.formatTokenAmount)(BigInt(nftContract.price), nftContract.currency.decimals, 6, false), " ", nftContract.currency.symbol] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2", children: [(0, jsx_runtime_1.jsx)("img", { src: chain?.logoUrl, className: (0, utils_1.cn)("h-5 w-5", nftContract.chainId !==
|
|
95
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Popover, { open: open, onOpenChange: setOpen, children: [(0, jsx_runtime_1.jsx)(react_1.PopoverTrigger, { asChild: true, children: (0, jsx_runtime_1.jsx)("button", { className: "absolute bottom-3 right-3 z-10 flex items-center justify-center rounded-full bg-black/20 p-1 text-white hover:bg-black/30", "aria-label": "Open NFT menu", children: (0, jsx_runtime_1.jsx)(lucide_react_1.MoreVertical, { className: "h-3 w-3" }) }) }), (0, jsx_runtime_1.jsx)(react_1.PopoverContent, { align: "end", className: "bg-b3-react-background border-b3-react-border min-w-48 rounded-lg border p-0 shadow-md backdrop-blur-sm", children: (0, jsx_runtime_1.jsxs)("div", { className: "pointer-events-auto flex w-full flex-col gap-2 py-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2 text-sm", children: ["Native mint price:", (0, jsx_runtime_1.jsxs)("span", { className: "font-semibold", children: [(0, number_1.formatTokenAmount)(BigInt(nftContract.price), nftContract.currency.decimals, 6, false), " ", nftContract.currency.symbol] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2", children: [(0, jsx_runtime_1.jsx)("img", { src: chain?.logoUrl, className: (0, utils_1.cn)("h-5 w-5", nftContract.chainId !== b3Viem_1.b3Viem.id && "rounded-full") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-sm", children: ["Minted on ", (0, jsx_runtime_1.jsx)("span", { className: "font-semibold", children: chain ? (0, anyspend_1.getChainName)(nftContract.chainId) : "Unknown" })] })] }), (0, jsx_runtime_1.jsx)("a", { href: nftUrl, target: "_blank", rel: "noopener noreferrer", className: "hover:bg-as-on-surface-3 text-as-primary flex items-center gap-2 rounded px-2 text-sm", children: "View NFT onchain" })] }) })] }));
|
|
96
96
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.CheckoutSuccess = CheckoutSuccess;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const anyspend_1 = require("../../../../anyspend");
|
|
7
|
-
const
|
|
7
|
+
const b3Viem_1 = require("../../../../shared/constants/chains/b3Viem");
|
|
8
8
|
const cn_1 = require("../../../../shared/utils/cn");
|
|
9
9
|
const lucide_react_1 = require("lucide-react");
|
|
10
10
|
const react_1 = require("motion/react");
|
|
@@ -20,7 +20,7 @@ function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel,
|
|
|
20
20
|
: "Your payment has been processed successfully.",
|
|
21
21
|
txHash,
|
|
22
22
|
orderId,
|
|
23
|
-
explorerUrl: txHash ? (0, anyspend_1.getExplorerTxUrl)(dstChainId ??
|
|
23
|
+
explorerUrl: txHash ? (0, anyspend_1.getExplorerTxUrl)(dstChainId ?? b3Viem_1.b3Viem.id, txHash) : undefined,
|
|
24
24
|
onDone: () => {
|
|
25
25
|
if (returnUrl)
|
|
26
26
|
window.location.href = returnUrl;
|
|
@@ -29,5 +29,5 @@ function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel,
|
|
|
29
29
|
returnLabel: content.returnButtonLabel || returnLabel,
|
|
30
30
|
}) }));
|
|
31
31
|
}
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-success-icon mb-4", children: (0, jsx_runtime_1.jsx)(AnimatedCheckmark_1.AnimatedCheckmark, { className: "h-16 w-16" }) }), (0, jsx_runtime_1.jsx)(react_1.motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), (0, jsx_runtime_1.jsx)(react_1.motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && ((0, jsx_runtime_1.jsxs)(react_1.motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: (0, anyspend_1.getExplorerTxUrl)(dstChainId ??
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-success-icon mb-4", children: (0, jsx_runtime_1.jsx)(AnimatedCheckmark_1.AnimatedCheckmark, { className: "h-16 w-16" }) }), (0, jsx_runtime_1.jsx)(react_1.motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), (0, jsx_runtime_1.jsx)(react_1.motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && ((0, jsx_runtime_1.jsxs)(react_1.motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: (0, anyspend_1.getExplorerTxUrl)(dstChainId ?? b3Viem_1.b3Viem.id, txHash), target: "_blank", rel: "noopener noreferrer", className: "anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400", children: ["View Transaction", (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "h-3.5 w-3.5" })] })), !txHash && orderId && ((0, jsx_runtime_1.jsxs)(react_1.motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, className: "anyspend-success-order-id mt-4 text-xs text-gray-400 dark:text-gray-500", children: ["Order ID: ", orderId] })), returnUrl && ((0, jsx_runtime_1.jsx)(react_1.motion.a, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 0.6, ease: "easeOut" }, href: returnUrl, className: (0, cn_1.cn)("anyspend-success-return-btn mt-6 inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors", classes?.returnButton), style: { backgroundColor: "#111827", color: "#fff" }, children: content.returnButtonLabel || returnLabel || "Return to Store" }))] }));
|
|
33
33
|
}
|
|
@@ -6,7 +6,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const anyspend_1 = require("../../../../anyspend");
|
|
7
7
|
const react_1 = require("../../../../global-account/react");
|
|
8
8
|
const utils_1 = require("../../../../shared/utils");
|
|
9
|
-
const
|
|
9
|
+
const b3Viem_1 = require("../../../../shared/constants/chains/b3Viem");
|
|
10
10
|
const react_2 = require("../../../../global-account/react");
|
|
11
11
|
const number_1 = require("../../../../shared/utils/number");
|
|
12
12
|
const react_3 = require("@web3icons/react");
|
|
@@ -17,7 +17,7 @@ function InsufficientDepositPayment({ order, srcToken, depositDeficit, phantomWa
|
|
|
17
17
|
const depositDeficitAmount = (0, number_1.formatUnits)(depositDeficit.toString(), srcToken.decimals);
|
|
18
18
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "insufficient-deposit-payment relative flex w-full flex-1 flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "insufficient-deposit-payment-text text-as-primary/50", children: "Please send remaining" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-wrap items-center gap-6 sm:justify-between sm:gap-0", children: [(0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: depositDeficitAmount, onCopy: () => {
|
|
19
19
|
react_2.toast.success("Copied to clipboard");
|
|
20
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("strong", { className: "border-as-brand text-as-primary border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [depositDeficitAmount, " ", srcToken.symbol] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "text-as-primary/50 hover:text-as-primary h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (0, jsx_runtime_1.jsxs)(react_1.Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", (0, anyspend_1.getChainName)(order.srcChain), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.srcChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.srcChain), className: (0, utils_1.cn)("h-6 rounded-full", order.srcChain ===
|
|
20
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("strong", { className: "border-as-brand text-as-primary border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [depositDeficitAmount, " ", srcToken.symbol] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "text-as-primary/50 hover:text-as-primary h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (0, jsx_runtime_1.jsxs)(react_1.Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", (0, anyspend_1.getChainName)(order.srcChain), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.srcChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.srcChain), className: (0, utils_1.cn)("h-6 rounded-full", order.srcChain === b3Viem_1.b3Viem.id && "h-5 rounded-none") })] })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 mb-1 mt-2", children: " to the address:" })] }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: order.globalAddress, onCopy: () => {
|
|
21
21
|
react_2.toast.success("Copied to clipboard");
|
|
22
22
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "payment-address bg-b3-react-background border-b3-react-border hover:border-as-brand group flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-3 px-4 shadow-md transition-all duration-200", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary overflow-hidden text-ellipsis whitespace-nowrap text-sm", children: order.globalAddress }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "group-hover:text-as-brand text-as-primary/50 h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "payment-buttons mt-4 flex w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-5/6 max-w-[400px] items-center gap-2 sm:px-0", disabled: txLoading || isSwitchingOrExecuting, onClick: onPayment, children: txLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Transaction Pending", (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "ml-2 h-5 w-5 animate-spin" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "whitespace-nowrap pl-4 text-lg md:text-sm", children: order.srcChain === anyspend_1.RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
23
23
|
? "Pay from Phantom Wallet"
|
|
@@ -20,7 +20,7 @@ const qrcode_react_1 = require("qrcode.react");
|
|
|
20
20
|
const react_5 = require("react");
|
|
21
21
|
const react_timeago_1 = __importDefault(require("react-timeago"));
|
|
22
22
|
const viem_1 = require("viem");
|
|
23
|
-
const
|
|
23
|
+
const b3Viem_1 = require("../../../../shared/constants/chains/b3Viem");
|
|
24
24
|
const wagmi_1 = require("wagmi");
|
|
25
25
|
const usePhantomTransfer_1 = require("../../hooks/usePhantomTransfer");
|
|
26
26
|
const Accordion_1 = require("./Accordion");
|
|
@@ -466,7 +466,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
|
|
|
466
466
|
// Transfer Crypto Payment Method - Show new card-based UI
|
|
467
467
|
(0, jsx_runtime_1.jsx)(TransferCryptoDetails_1.TransferCryptoDetails, { order: order, recipientName: recipientName, srcToken: srcToken, dstToken: dstToken, tournament: tournament, nft: nft, onBack: handleBack, onPaymentMethodChange: onPaymentMethodChange })) : ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-payment-section relative flex w-full flex-1 flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-details-amount-section flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 order-details-amount-label", children: "Please send" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-amount-container flex w-full flex-wrap items-center gap-6 sm:justify-between sm:gap-0", children: [(0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: roundedUpSrcAmount, onCopy: () => {
|
|
468
468
|
react_2.toast.success("Copied to clipboard");
|
|
469
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-amount-display flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("strong", { className: "border-as-brand text-as-primary order-details-amount-text border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "text-as-primary/50 hover:text-as-primary order-details-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (0, jsx_runtime_1.jsxs)(react_1.Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", (0, anyspend_1.getChainName)(order.srcChain), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.srcChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.srcChain), className: (0, utils_1.cn)("h-6 rounded-full", order.srcChain ===
|
|
469
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-amount-display flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("strong", { className: "border-as-brand text-as-primary order-details-amount-text border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "text-as-primary/50 hover:text-as-primary order-details-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (0, jsx_runtime_1.jsxs)(react_1.Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", (0, anyspend_1.getChainName)(order.srcChain), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.srcChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.srcChain), className: (0, utils_1.cn)("h-6 rounded-full", order.srcChain === b3Viem_1.b3Viem.id && "h-5 rounded-none") })] })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary/50 order-details-address-label mb-1 mt-2", children: " to the address:" })] }), (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: order.globalAddress, onCopy: () => {
|
|
470
470
|
react_2.toast.success("Copied to clipboard");
|
|
471
471
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-b3-react-background border-b3-react-border hover:border-as-brand order-details-address-container group flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-3 px-4 shadow-md transition-all duration-200", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-as-primary order-details-address-text overflow-hidden text-ellipsis whitespace-nowrap text-sm", children: order.globalAddress }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "group-hover:text-as-brand text-as-primary/50 order-details-address-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (account?.address || phantomWalletAddress) && !showQRCode ? ((0, jsx_runtime_1.jsx)("div", { className: "mb-4 mt-8 flex w-full flex-col items-center gap-4", children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative flex w-full flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-5/6 items-center gap-2 sm:px-0", disabled: txLoading || isSwitchingOrExecuting, onClick: handlePayment, children: txLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Transaction Pending", (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "ml-2 h-5 w-5 animate-spin" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "pl-4 text-lg md:text-sm", children: order.srcChain === anyspend_1.RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
472
472
|
? "Pay from Phantom Wallet"
|
|
@@ -15,7 +15,7 @@ const number_1 = require("../../../../shared/utils/number");
|
|
|
15
15
|
const lucide_react_1 = require("lucide-react");
|
|
16
16
|
const react_2 = require("motion/react");
|
|
17
17
|
const react_3 = require("react");
|
|
18
|
-
const
|
|
18
|
+
const b3Viem_1 = require("../../../../shared/constants/chains/b3Viem");
|
|
19
19
|
exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollapsible({ order, dstToken, tournament, nft, recipientName, formattedExpectedDstAmount, className, showTotal = false, totalAmount, points, isOpen, onOpenChange, classes, }) {
|
|
20
20
|
const [internalOpen, setInternalOpen] = (0, react_3.useState)(true);
|
|
21
21
|
// Use controlled mode if isOpen is provided, otherwise use internal state
|
|
@@ -45,5 +45,5 @@ exports.OrderDetailsCollapsible = (0, react_3.memo)(function OrderDetailsCollaps
|
|
|
45
45
|
? order.metadata.action
|
|
46
46
|
? (0, anyspend_1.capitalizeFirstLetter)(order.metadata.action)
|
|
47
47
|
: "Contract execution"
|
|
48
|
-
: "" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-expected-value flex flex-wrap items-center justify-end gap-2", children: [order.type === "swap" || order.type === "deposit_first" ? ((0, jsx_runtime_1.jsx)("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : order.type === "mint_nft" ? ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-nft-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: nft?.imageUrl, alt: nft?.name || "NFT", className: "order-details-nft-image h-5 w-5" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-nft-name", children: nft?.name || "NFT" })] })) : order.type === "join_tournament" || order.type === "fund_tournament" ? ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-tournament-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: tournament?.imageUrl, alt: tournament?.name || "Tournament", className: "order-details-tournament-image h-5 w-5" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-tournament-name", children: tournament?.name || "Tournament" })] })) : order.type === "hype_duel" ? ((0, jsx_runtime_1.jsx)("div", { className: "order-details-hype-info flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-hype-amount", children: [(0, number_1.formatTokenAmount)(BigInt(order.payload.expectedDstAmount), dstToken.decimals), " HYPE"] }) })) : order.type === "custom" || order.type === "custom_exact_in" ? ((0, jsx_runtime_1.jsx)("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "order-details-chain-info text-as-primary/50 flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "order-details-chain-text", children: ["on ", order.dstChain !==
|
|
48
|
+
: "" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-expected-value flex flex-wrap items-center justify-end gap-2", children: [order.type === "swap" || order.type === "deposit_first" ? ((0, jsx_runtime_1.jsx)("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : order.type === "mint_nft" ? ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-nft-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: nft?.imageUrl, alt: nft?.name || "NFT", className: "order-details-nft-image h-5 w-5" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-nft-name", children: nft?.name || "NFT" })] })) : order.type === "join_tournament" || order.type === "fund_tournament" ? ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-tournament-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: tournament?.imageUrl, alt: tournament?.name || "Tournament", className: "order-details-tournament-image h-5 w-5" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-tournament-name", children: tournament?.name || "Tournament" })] })) : order.type === "hype_duel" ? ((0, jsx_runtime_1.jsx)("div", { className: "order-details-hype-info flex items-center gap-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-details-hype-amount", children: [(0, number_1.formatTokenAmount)(BigInt(order.payload.expectedDstAmount), dstToken.decimals), " HYPE"] }) })) : order.type === "custom" || order.type === "custom_exact_in" ? ((0, jsx_runtime_1.jsx)("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "order-details-chain-info text-as-primary/50 flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "order-details-chain-text", children: ["on ", order.dstChain !== b3Viem_1.b3Viem.id && (0, anyspend_1.getChainName)(order.dstChain)] }), (0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.dstChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.dstChain), className: (0, utils_1.cn)("order-details-chain-logo h-3", order.dstChain !== b3Viem_1.b3Viem.id && "w-3 rounded-full", order.dstChain === b3Viem_1.b3Viem.id && "h-4") })] })] })] }), points !== undefined && points !== null && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-points-section flex w-full justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-points-label text-as-tertiary", children: "Points" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-points-value text-as-brand font-semibold", children: ["+", (0, formatNumber_1.formatNumber)(points), " pts"] })] })] })), (0, jsx_runtime_1.jsx)("div", { className: "order-details-divider divider w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-details-id-total-section flex w-full justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-id-total-label text-as-tertiary", children: showTotal ? "Total (included fee)" : "Order ID" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-id-total-value text-as-primary overflow-hidden text-ellipsis whitespace-nowrap", children: showTotal && totalAmount ? totalAmount : order.id })] })] }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "order-details-collapsed flex w-full items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-details-collapsed-divider divider w-full" }), (0, jsx_runtime_1.jsx)("button", { className: "order-details-collapsed-button whitespace-nowrap text-sm", onClick: () => setShowOrderDetails(true), children: "Order Details" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "order-details-collapsed-chevron text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" }), (0, jsx_runtime_1.jsx)("div", { className: "order-details-collapsed-divider divider w-full" })] })) }));
|
|
49
49
|
});
|
|
@@ -11,7 +11,7 @@ const react_2 = require("@web3icons/react");
|
|
|
11
11
|
const lucide_react_1 = require("lucide-react");
|
|
12
12
|
const qrcode_react_1 = require("qrcode.react");
|
|
13
13
|
const react_3 = require("react");
|
|
14
|
-
const
|
|
14
|
+
const b3Viem_1 = require("../../../../shared/constants/chains/b3Viem");
|
|
15
15
|
const CryptoPaymentMethod_1 = require("./CryptoPaymentMethod");
|
|
16
16
|
const OrderDetailsCollapsible_1 = require("./OrderDetailsCollapsible");
|
|
17
17
|
const PaymentMethodSwitch_1 = require("./PaymentMethodSwitch");
|
|
@@ -71,5 +71,5 @@ exports.TransferCryptoDetails = (0, react_3.memo)(function TransferCryptoDetails
|
|
|
71
71
|
transition: "stroke-dashoffset 1s linear",
|
|
72
72
|
} })] }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-timer-text absolute inset-0 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("span", { className: "text-as-primary text-[10px] font-semibold", children: formatTime(timeLeft) }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-content flex w-full flex-col gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-cards flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-amount-card w-full", children: [(0, jsx_runtime_1.jsx)("span", { className: "order-transfer-crypto-amount-label text-as-content-secondary text-sm font-medium", children: "Amount" }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-amount-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: (0, jsx_runtime_1.jsx)(react_1.CopyToClipboard, { text: roundedUpSrcAmount || "", onCopy: () => {
|
|
73
73
|
react_1.toast.success("Amount copied to clipboard");
|
|
74
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-amount-copy flex cursor-pointer items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("strong", { className: "order-transfer-crypto-amount-text text-as-primary font-semibold", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "order-transfer-crypto-amount-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 transition-all duration-200" })] }) }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-chain-card w-full", children: [(0, jsx_runtime_1.jsx)("span", { className: "order-transfer-crypto-chain-label text-as-content-secondary text-sm font-medium", children: "Chain" }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-chain-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-chain-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.srcChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.srcChain), className: (0, utils_1.cn)("order-transfer-crypto-chain-logo h-6 rounded-full", order.srcChain ===
|
|
74
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-amount-copy flex cursor-pointer items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("strong", { className: "order-transfer-crypto-amount-text text-as-primary font-semibold", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "order-transfer-crypto-amount-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 transition-all duration-200" })] }) }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-chain-card w-full", children: [(0, jsx_runtime_1.jsx)("span", { className: "order-transfer-crypto-chain-label text-as-content-secondary text-sm font-medium", children: "Chain" }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-chain-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-chain-info flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[order.srcChain].logoUrl, alt: (0, anyspend_1.getChainName)(order.srcChain), className: (0, utils_1.cn)("order-transfer-crypto-chain-logo h-6 rounded-full", order.srcChain === b3Viem_1.b3Viem.id && "h-5 rounded-none") }), (0, jsx_runtime_1.jsx)("span", { className: "order-transfer-crypto-chain-name text-as-primary text-sm font-semibold", children: (0, anyspend_1.getChainName)(order.srcChain) })] }) })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-qr-deposit-card border-b3-react-border bg-as-surface-secondary grid h-[220px] grid-cols-2 overflow-hidden rounded-xl border", children: [(0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-qr-section border-as-border-primary h-full w-full border-r", children: (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-qr-wrapper flex justify-center", children: (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-qr-container bg-as-surface-secondary flex flex-col items-center rounded-lg p-6", children: [(0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: (0, anyspend_1.getPaymentUrl)(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === anyspend_1.ZERO_ADDRESS ? "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "order-transfer-crypto-qr-code bg-as-surface-secondary max-h-48 max-w-48" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-wallet-hint mt-3 flex items-center justify-center gap-2 text-sm", children: [(0, jsx_runtime_1.jsx)("span", { className: "order-transfer-crypto-wallet-text text-as-brand/70 text-sm font-medium", children: "SCAN WITH" }), (0, jsx_runtime_1.jsxs)(react_1.TextLoop, { interval: 3, children: [(0, jsx_runtime_1.jsx)(react_2.WalletMetamask, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletCoinbase, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletPhantom, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), (0, jsx_runtime_1.jsx)(react_2.WalletTrust, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" })] })] })] }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-address-section flex h-full w-full flex-col gap-2 p-6", children: [(0, jsx_runtime_1.jsx)("span", { className: "order-transfer-crypto-address-label text-as-content-secondary text-sm font-medium", children: "Deposit address:" }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-address-copy flex h-full cursor-pointer flex-col items-stretch justify-between gap-4", onClick: handleCopyAddress, children: [(0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-address-text text-as-primary break-all font-mono text-sm font-semibold leading-relaxed", children: order.globalAddress }), (0, jsx_runtime_1.jsx)("div", { className: "order-transfer-crypto-address-copy-icon-wrapper place-self-end", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "order-transfer-crypto-address-copy-icon group-hover:text-as-brand text-as-tertiary h-4 w-4 cursor-pointer transition-all duration-200" }) })] })] })] }), (0, jsx_runtime_1.jsx)(OrderDetailsCollapsible_1.OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount })] }), (0, jsx_runtime_1.jsxs)("div", { className: "order-transfer-crypto-actions flex flex-col gap-3", children: [(0, jsx_runtime_1.jsx)(react_1.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "order-transfer-crypto-copy-btn w-full py-3", onClick: handleCopyAddress, children: "Copy deposit address" }), (0, jsx_runtime_1.jsx)(PaymentMethodSwitch_1.PaymentMethodSwitch, { currentMethod: CryptoPaymentMethod_1.CryptoPaymentMethodType.TRANSFER_CRYPTO, onMethodChange: onPaymentMethodChange })] })] }));
|
|
75
75
|
});
|
|
@@ -32,6 +32,7 @@ const constants_1 = require("../../anyspend/constants");
|
|
|
32
32
|
const rpc_1 = require("../../anyspend/constants/rpc");
|
|
33
33
|
const invariant_1 = __importDefault(require("invariant"));
|
|
34
34
|
const viem_1 = require("viem");
|
|
35
|
+
const b3Viem_1 = require("../../shared/constants/chains/b3Viem");
|
|
35
36
|
const chains_1 = require("viem/chains");
|
|
36
37
|
const chain_1 = require("../types/chain");
|
|
37
38
|
const token_1 = require("./token");
|
|
@@ -192,16 +193,16 @@ exports.EVM_MAINNET = {
|
|
|
192
193
|
coingeckoName: "bsc",
|
|
193
194
|
wethAddress: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
|
|
194
195
|
},
|
|
195
|
-
[
|
|
196
|
-
id:
|
|
197
|
-
name:
|
|
196
|
+
[b3Viem_1.b3Viem.id]: {
|
|
197
|
+
id: b3Viem_1.b3Viem.id,
|
|
198
|
+
name: b3Viem_1.b3Viem.name,
|
|
198
199
|
logoUrl: "https://assets.relay.link/icons/square/8333/light.png",
|
|
199
200
|
type: chain_1.ChainType.EVM,
|
|
200
201
|
nativeRequired: (0, viem_1.parseEther)("0.0001"),
|
|
201
202
|
canDepositNative: true,
|
|
202
|
-
defaultToken: (0, token_1.getEthToken)(
|
|
203
|
-
nativeToken: (0, token_1.getEthToken)(
|
|
204
|
-
viem:
|
|
203
|
+
defaultToken: (0, token_1.getEthToken)(b3Viem_1.b3Viem.id),
|
|
204
|
+
nativeToken: (0, token_1.getEthToken)(b3Viem_1.b3Viem.id),
|
|
205
|
+
viem: b3Viem_1.b3Viem,
|
|
205
206
|
pollingInterval: 1000, // 1 second for B3
|
|
206
207
|
zapperEnum: "B3_MAINNET",
|
|
207
208
|
coingeckoName: "b3",
|
|
@@ -547,7 +548,7 @@ function getPaymentUrl(address, amount, currency, chainId, decimals) {
|
|
|
547
548
|
}
|
|
548
549
|
}
|
|
549
550
|
function getExplorerTxUrl(chainId, txHash) {
|
|
550
|
-
if (chainId ===
|
|
551
|
+
if (chainId === b3Viem_1.b3Viem.id) {
|
|
551
552
|
return "https://explorer.b3.fun/b3/tx/" + txHash;
|
|
552
553
|
}
|
|
553
554
|
if (exports.EVM_CHAINS[chainId]) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
declare const buttonVariants: (props?: ({
|
|
3
|
-
variant?: "
|
|
3
|
+
variant?: "default" | "link" | "b3" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
4
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> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
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> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ChainNetworks } from "../../../global-account/types/chain-networks";
|
|
1
2
|
import { Chain as ThirdwebChain } from "thirdweb";
|
|
2
3
|
import { Chain } from "viem";
|
|
3
|
-
import { ChainNetworks } from "../../../global-account/types/chain-networks";
|
|
4
4
|
export declare const nullAddress = "0x0000000000000000000000000000000000000000";
|
|
5
5
|
export declare const avatarsNFTCollectionAddress = "0x658E2F67D3121A0eA81e5854be0b7539be27Aeb0";
|
|
6
6
|
export declare const viemToThirdwebChain: (chain: Chain) => ThirdwebChain;
|
|
@@ -33,8 +33,8 @@ export declare const b3Mainnet: {
|
|
|
33
33
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
34
34
|
rpcUrls: {
|
|
35
35
|
readonly default: {
|
|
36
|
-
readonly http: readonly ["https://
|
|
37
|
-
readonly ws: readonly ["wss://
|
|
36
|
+
readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
|
|
37
|
+
readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
sourceId?: number | undefined | undefined;
|
|
@@ -43,7 +43,7 @@ export declare const b3Mainnet: {
|
|
|
43
43
|
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
44
44
|
formatters?: undefined;
|
|
45
45
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
46
|
-
readonly rpc: "https://
|
|
46
|
+
readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
|
|
47
47
|
readonly icon: {
|
|
48
48
|
readonly url: "https://cdn.b3.fun/b3_logo.svg";
|
|
49
49
|
readonly width: 32;
|
|
@@ -128,8 +128,8 @@ export declare const b3Chain: Chain | {
|
|
|
128
128
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
129
129
|
rpcUrls: {
|
|
130
130
|
readonly default: {
|
|
131
|
-
readonly http: readonly ["https://
|
|
132
|
-
readonly ws: readonly ["wss://
|
|
131
|
+
readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
|
|
132
|
+
readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
135
|
sourceId?: number | undefined | undefined;
|
|
@@ -138,7 +138,7 @@ export declare const b3Chain: Chain | {
|
|
|
138
138
|
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
139
139
|
formatters?: undefined;
|
|
140
140
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
141
|
-
readonly rpc: "https://
|
|
141
|
+
readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
|
|
142
142
|
readonly icon: {
|
|
143
143
|
readonly url: "https://cdn.b3.fun/b3_logo.svg";
|
|
144
144
|
readonly width: 32;
|
|
@@ -56,11 +56,11 @@ exports.b3Testnet = (0, viem_1.defineChain)({
|
|
|
56
56
|
exports.b3Mainnet = (0, viem_1.defineChain)({
|
|
57
57
|
id: 8333,
|
|
58
58
|
name: "B3",
|
|
59
|
-
rpc: "https://
|
|
59
|
+
rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2",
|
|
60
60
|
rpcUrls: {
|
|
61
61
|
default: {
|
|
62
|
-
http: ["https://
|
|
63
|
-
ws: ["wss://
|
|
62
|
+
http: ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
|
|
63
|
+
ws: ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
icon: {
|
|
@@ -128,7 +128,7 @@ exports.thirdwebB3Testnet = (0, thirdweb_1.defineChain)({
|
|
|
128
128
|
exports.thirdwebB3Mainnet = (0, thirdweb_1.defineChain)({
|
|
129
129
|
id: 8333,
|
|
130
130
|
name: "B3",
|
|
131
|
-
rpc: "https://
|
|
131
|
+
rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
|
|
132
132
|
icon: {
|
|
133
133
|
url: "https://cdn.b3.fun/b3_logo.svg",
|
|
134
134
|
width: 32,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.b3Viem = void 0;
|
|
4
|
+
const rpc_1 = require("../../../anyspend/constants/rpc");
|
|
5
|
+
const chains_1 = require("viem/chains");
|
|
6
|
+
/**
|
|
7
|
+
* Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
|
|
8
|
+
* RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
|
|
9
|
+
*/
|
|
10
|
+
exports.b3Viem = {
|
|
11
|
+
...chains_1.b3,
|
|
12
|
+
rpcUrls: {
|
|
13
|
+
...chains_1.b3.rpcUrls,
|
|
14
|
+
default: {
|
|
15
|
+
...chains_1.b3.rpcUrls.default,
|
|
16
|
+
http: [rpc_1.B3_PUBLIC_RPC],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -2,6 +2,7 @@ import type { Chain as ThirdwebChain } from "thirdweb";
|
|
|
2
2
|
export declare const supportedChains: import("viem").Chain[];
|
|
3
3
|
export declare const supportedChainsTW: ThirdwebChain[];
|
|
4
4
|
export declare const supportedChainNetworks: {
|
|
5
|
+
formatters?: Record<string, any> | undefined;
|
|
5
6
|
contracts?: Record<string, {
|
|
6
7
|
blockCreated?: number | undefined;
|
|
7
8
|
address: string;
|
|
@@ -9,7 +10,6 @@ export declare const supportedChainNetworks: {
|
|
|
9
10
|
sourceId?: number | undefined;
|
|
10
11
|
testnet?: boolean | undefined;
|
|
11
12
|
fees?: Record<string, any> | undefined;
|
|
12
|
-
formatters?: Record<string, any> | undefined;
|
|
13
13
|
color?: string | undefined;
|
|
14
14
|
testnetConfigID?: number | undefined;
|
|
15
15
|
badge?: string | undefined;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"name": "B3",
|
|
6
6
|
"rpcUrls": {
|
|
7
7
|
"default": {
|
|
8
|
-
"http": "https://
|
|
9
|
-
"ws": "wss://
|
|
8
|
+
"http": "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
|
|
9
|
+
"ws": "wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/"
|
|
10
10
|
},
|
|
11
11
|
"backups": []
|
|
12
12
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chain } from "viem
|
|
1
|
+
import type { Chain } from "viem";
|
|
2
2
|
export declare function getChainById(id: number): Chain | undefined;
|
|
3
3
|
export declare function chainIdToName(id: number): string | undefined;
|
|
4
4
|
export declare function getExplorerUrl(chain: Chain, txHash: string): string;
|
|
@@ -5,8 +5,8 @@ exports.chainIdToName = chainIdToName;
|
|
|
5
5
|
exports.getExplorerUrl = getExplorerUrl;
|
|
6
6
|
exports.getAddressExplorerUrl = getAddressExplorerUrl;
|
|
7
7
|
exports.getTokenExplorerUrl = getTokenExplorerUrl;
|
|
8
|
+
const b3Viem_1 = require("../../shared/constants/chains/b3Viem");
|
|
8
9
|
const supported_1 = require("../../shared/constants/chains/supported");
|
|
9
|
-
const chains_1 = require("viem/chains");
|
|
10
10
|
const baseChainBaseUrl = "https://basescan.org";
|
|
11
11
|
function getChainById(id) {
|
|
12
12
|
return Object.values(supported_1.supportedChains).find(chain => chain.id === id);
|
|
@@ -16,7 +16,7 @@ function chainIdToName(id) {
|
|
|
16
16
|
return name === "Base Mainnet" ? "Base" : name === "The Open Network" ? "Open Network" : name;
|
|
17
17
|
}
|
|
18
18
|
function getExplorerUrl(chain, txHash) {
|
|
19
|
-
if (chain.id ===
|
|
19
|
+
if (chain.id === b3Viem_1.b3Viem.id) {
|
|
20
20
|
return "https://explorer.b3.fun/b3/tx/" + txHash;
|
|
21
21
|
}
|
|
22
22
|
let baseUrl = chain.blockExplorers?.default.url;
|
|
@@ -13,7 +13,7 @@ export declare const OPTIMISM_PUBLIC_RPC = "https://optimism-rpc.publicnode.com"
|
|
|
13
13
|
export declare const POLYGON_PUBLIC_RPC = "https://polygon-bor-rpc.publicnode.com";
|
|
14
14
|
export declare const AVALANCHE_PUBLIC_RPC = "https://avalanche-c-chain-rpc.publicnode.com";
|
|
15
15
|
export declare const BSC_PUBLIC_RPC = "https://bsc-rpc.publicnode.com";
|
|
16
|
-
export declare const B3_PUBLIC_RPC = "https://
|
|
16
|
+
export declare const B3_PUBLIC_RPC = "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/";
|
|
17
17
|
export declare const ABSTRACT_PUBLIC_RPC = "https://api.mainnet.abs.xyz";
|
|
18
18
|
export declare const HYPEREVM_PUBLIC_RPC = "https://rpc.hyperliquid.xyz/evm";
|
|
19
19
|
/**
|
|
@@ -15,7 +15,7 @@ export const POLYGON_PUBLIC_RPC = "https://polygon-bor-rpc.publicnode.com";
|
|
|
15
15
|
export const AVALANCHE_PUBLIC_RPC = "https://avalanche-c-chain-rpc.publicnode.com";
|
|
16
16
|
export const BSC_PUBLIC_RPC = "https://bsc-rpc.publicnode.com";
|
|
17
17
|
// Chain-specific public endpoints
|
|
18
|
-
export const B3_PUBLIC_RPC = "https://
|
|
18
|
+
export const B3_PUBLIC_RPC = "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/";
|
|
19
19
|
export const ABSTRACT_PUBLIC_RPC = "https://api.mainnet.abs.xyz";
|
|
20
20
|
export const HYPEREVM_PUBLIC_RPC = "https://rpc.hyperliquid.xyz/evm";
|
|
21
21
|
/**
|
|
@@ -7,7 +7,7 @@ import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/nu
|
|
|
7
7
|
import { MoreVertical } from "lucide-react";
|
|
8
8
|
import { AnimatePresence } from "motion/react";
|
|
9
9
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
10
|
-
import {
|
|
10
|
+
import { b3Viem } from "../../../shared/constants/chains/b3Viem.js";
|
|
11
11
|
import { AnySpendCustom } from "./AnySpendCustom.js";
|
|
12
12
|
// ABI for contractURI and uri functions
|
|
13
13
|
const CONTRACT_URI_ABI = [
|
|
@@ -89,5 +89,5 @@ function DropdownMenu({ nftContract }) {
|
|
|
89
89
|
const [open, setOpen] = useState(false);
|
|
90
90
|
const chain = ALL_CHAINS[nftContract.chainId];
|
|
91
91
|
const nftUrl = getExplorerAddressUrl(nftContract.chainId, nftContract.contractAddress);
|
|
92
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { className: "absolute bottom-3 right-3 z-10 flex items-center justify-center rounded-full bg-black/20 p-1 text-white hover:bg-black/30", "aria-label": "Open NFT menu", children: _jsx(MoreVertical, { className: "h-3 w-3" }) }) }), _jsx(PopoverContent, { align: "end", className: "bg-b3-react-background border-b3-react-border min-w-48 rounded-lg border p-0 shadow-md backdrop-blur-sm", children: _jsxs("div", { className: "pointer-events-auto flex w-full flex-col gap-2 py-2", children: [_jsxs("div", { className: "hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2 text-sm", children: ["Native mint price:", _jsxs("span", { className: "font-semibold", children: [formatTokenAmount(BigInt(nftContract.price), nftContract.currency.decimals, 6, false), " ", nftContract.currency.symbol] })] }), _jsxs("div", { className: "hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2", children: [_jsx("img", { src: chain?.logoUrl, className: cn("h-5 w-5", nftContract.chainId !==
|
|
92
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { className: "absolute bottom-3 right-3 z-10 flex items-center justify-center rounded-full bg-black/20 p-1 text-white hover:bg-black/30", "aria-label": "Open NFT menu", children: _jsx(MoreVertical, { className: "h-3 w-3" }) }) }), _jsx(PopoverContent, { align: "end", className: "bg-b3-react-background border-b3-react-border min-w-48 rounded-lg border p-0 shadow-md backdrop-blur-sm", children: _jsxs("div", { className: "pointer-events-auto flex w-full flex-col gap-2 py-2", children: [_jsxs("div", { className: "hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2 text-sm", children: ["Native mint price:", _jsxs("span", { className: "font-semibold", children: [formatTokenAmount(BigInt(nftContract.price), nftContract.currency.decimals, 6, false), " ", nftContract.currency.symbol] })] }), _jsxs("div", { className: "hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2", children: [_jsx("img", { src: chain?.logoUrl, className: cn("h-5 w-5", nftContract.chainId !== b3Viem.id && "rounded-full") }), _jsxs("span", { className: "text-sm", children: ["Minted on ", _jsx("span", { className: "font-semibold", children: chain ? getChainName(nftContract.chainId) : "Unknown" })] })] }), _jsx("a", { href: nftUrl, target: "_blank", rel: "noopener noreferrer", className: "hover:bg-as-on-surface-3 text-as-primary flex items-center gap-2 rounded px-2 text-sm", children: "View NFT onchain" })] }) })] }));
|
|
93
93
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { getExplorerTxUrl } from "../../../../anyspend/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { b3Viem } from "../../../../shared/constants/chains/b3Viem.js";
|
|
5
5
|
import { cn } from "../../../../shared/utils/cn.js";
|
|
6
6
|
import { ExternalLink } from "lucide-react";
|
|
7
7
|
import { motion } from "motion/react";
|
|
@@ -17,7 +17,7 @@ export function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, return
|
|
|
17
17
|
: "Your payment has been processed successfully.",
|
|
18
18
|
txHash,
|
|
19
19
|
orderId,
|
|
20
|
-
explorerUrl: txHash ? getExplorerTxUrl(dstChainId ??
|
|
20
|
+
explorerUrl: txHash ? getExplorerTxUrl(dstChainId ?? b3Viem.id, txHash) : undefined,
|
|
21
21
|
onDone: () => {
|
|
22
22
|
if (returnUrl)
|
|
23
23
|
window.location.href = returnUrl;
|
|
@@ -26,5 +26,5 @@ export function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, return
|
|
|
26
26
|
returnLabel: content.returnButtonLabel || returnLabel,
|
|
27
27
|
}) }));
|
|
28
28
|
}
|
|
29
|
-
return (_jsxs("div", { className: cn("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [_jsx("div", { className: "anyspend-success-icon mb-4", children: _jsx(AnimatedCheckmark, { className: "h-16 w-16" }) }), _jsx(motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), _jsx(motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && (_jsxs(motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: getExplorerTxUrl(dstChainId ??
|
|
29
|
+
return (_jsxs("div", { className: cn("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [_jsx("div", { className: "anyspend-success-icon mb-4", children: _jsx(AnimatedCheckmark, { className: "h-16 w-16" }) }), _jsx(motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), _jsx(motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && (_jsxs(motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: getExplorerTxUrl(dstChainId ?? b3Viem.id, txHash), target: "_blank", rel: "noopener noreferrer", className: "anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400", children: ["View Transaction", _jsx(ExternalLink, { className: "h-3.5 w-3.5" })] })), !txHash && orderId && (_jsxs(motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, className: "anyspend-success-order-id mt-4 text-xs text-gray-400 dark:text-gray-500", children: ["Order ID: ", orderId] })), returnUrl && (_jsx(motion.a, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 0.6, ease: "easeOut" }, href: returnUrl, className: cn("anyspend-success-return-btn mt-6 inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors", classes?.returnButton), style: { backgroundColor: "#111827", color: "#fff" }, children: content.returnButtonLabel || returnLabel || "Return to Store" }))] }));
|
|
30
30
|
}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { ALL_CHAINS, getChainName, getPaymentUrl, RELAY_SOLANA_MAINNET_CHAIN_ID, ZERO_ADDRESS, } from "../../../../anyspend/index.js";
|
|
4
4
|
import { Badge, CopyToClipboard, ShinyButton, TextLoop } from "../../../../global-account/react/index.js";
|
|
5
5
|
import { cn } from "../../../../shared/utils/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { b3Viem } from "../../../../shared/constants/chains/b3Viem.js";
|
|
7
7
|
import { toast } from "../../../../global-account/react/index.js";
|
|
8
8
|
import { formatUnits } from "../../../../shared/utils/number.js";
|
|
9
9
|
import { WalletCoinbase, WalletMetamask, WalletPhantom, WalletTrust } from "@web3icons/react";
|
|
@@ -14,7 +14,7 @@ export function InsufficientDepositPayment({ order, srcToken, depositDeficit, ph
|
|
|
14
14
|
const depositDeficitAmount = formatUnits(depositDeficit.toString(), srcToken.decimals);
|
|
15
15
|
return (_jsxs("div", { className: "insufficient-deposit-payment relative flex w-full flex-1 flex-col", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "insufficient-deposit-payment-text text-as-primary/50", children: "Please send remaining" }), _jsxs("div", { className: "flex w-full flex-wrap items-center gap-6 sm:justify-between sm:gap-0", children: [_jsx(CopyToClipboard, { text: depositDeficitAmount, onCopy: () => {
|
|
16
16
|
toast.success("Copied to clipboard");
|
|
17
|
-
}, children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("strong", { className: "border-as-brand text-as-primary border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [depositDeficitAmount, " ", srcToken.symbol] }), _jsx(Copy, { className: "text-as-primary/50 hover:text-as-primary h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), _jsxs(Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", getChainName(order.srcChain), _jsx("img", { src: ALL_CHAINS[order.srcChain].logoUrl, alt: getChainName(order.srcChain), className: cn("h-6 rounded-full", order.srcChain ===
|
|
17
|
+
}, children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("strong", { className: "border-as-brand text-as-primary border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [depositDeficitAmount, " ", srcToken.symbol] }), _jsx(Copy, { className: "text-as-primary/50 hover:text-as-primary h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), _jsxs(Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", getChainName(order.srcChain), _jsx("img", { src: ALL_CHAINS[order.srcChain].logoUrl, alt: getChainName(order.srcChain), className: cn("h-6 rounded-full", order.srcChain === b3Viem.id && "h-5 rounded-none") })] })] }), _jsx("span", { className: "text-as-primary/50 mb-1 mt-2", children: " to the address:" })] }), _jsx(CopyToClipboard, { text: order.globalAddress, onCopy: () => {
|
|
18
18
|
toast.success("Copied to clipboard");
|
|
19
19
|
}, children: _jsxs("div", { className: "payment-address bg-b3-react-background border-b3-react-border hover:border-as-brand group flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-3 px-4 shadow-md transition-all duration-200", children: [_jsx("div", { className: "text-as-primary overflow-hidden text-ellipsis whitespace-nowrap text-sm", children: order.globalAddress }), _jsx(Copy, { className: "group-hover:text-as-brand text-as-primary/50 h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), _jsxs("div", { className: "payment-buttons mt-4 flex w-full flex-col items-center gap-2", children: [_jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-5/6 max-w-[400px] items-center gap-2 sm:px-0", disabled: txLoading || isSwitchingOrExecuting, onClick: onPayment, children: txLoading ? (_jsxs(_Fragment, { children: ["Transaction Pending", _jsx(Loader2, { className: "ml-2 h-5 w-5 animate-spin" })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "whitespace-nowrap pl-4 text-lg md:text-sm", children: order.srcChain === RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
20
20
|
? "Pay from Phantom Wallet"
|
|
@@ -14,7 +14,7 @@ import { QRCodeSVG } from "qrcode.react";
|
|
|
14
14
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
15
15
|
import TimeAgo from "react-timeago";
|
|
16
16
|
import { encodeFunctionData, erc20Abi } from "viem";
|
|
17
|
-
import {
|
|
17
|
+
import { b3Viem } from "../../../../shared/constants/chains/b3Viem.js";
|
|
18
18
|
import { useWaitForTransactionReceipt, useWalletClient } from "wagmi";
|
|
19
19
|
import { usePhantomTransfer } from "../../hooks/usePhantomTransfer.js";
|
|
20
20
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./Accordion.js";
|
|
@@ -460,7 +460,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
460
460
|
// Transfer Crypto Payment Method - Show new card-based UI
|
|
461
461
|
_jsx(TransferCryptoDetails, { order: order, recipientName: recipientName, srcToken: srcToken, dstToken: dstToken, tournament: tournament, nft: nft, onBack: handleBack, onPaymentMethodChange: onPaymentMethodChange })) : (_jsxs("div", { className: "order-details-payment-section relative flex w-full flex-1 flex-col", children: [_jsxs("div", { className: "order-details-amount-section flex flex-col gap-1", children: [_jsx("span", { className: "text-as-primary/50 order-details-amount-label", children: "Please send" }), _jsxs("div", { className: "order-details-amount-container flex w-full flex-wrap items-center gap-6 sm:justify-between sm:gap-0", children: [_jsx(CopyToClipboard, { text: roundedUpSrcAmount, onCopy: () => {
|
|
462
462
|
toast.success("Copied to clipboard");
|
|
463
|
-
}, children: _jsxs("div", { className: "order-details-amount-display flex items-center gap-2", children: [_jsxs("strong", { className: "border-as-brand text-as-primary order-details-amount-text border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), _jsx(Copy, { className: "text-as-primary/50 hover:text-as-primary order-details-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), _jsxs(Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", getChainName(order.srcChain), _jsx("img", { src: ALL_CHAINS[order.srcChain].logoUrl, alt: getChainName(order.srcChain), className: cn("h-6 rounded-full", order.srcChain ===
|
|
463
|
+
}, children: _jsxs("div", { className: "order-details-amount-display flex items-center gap-2", children: [_jsxs("strong", { className: "border-as-brand text-as-primary order-details-amount-text border-b-2 pb-1 text-2xl font-semibold sm:text-xl", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), _jsx(Copy, { className: "text-as-primary/50 hover:text-as-primary order-details-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), _jsxs(Badge, { variant: "outline", className: "flex h-10 items-center gap-2 px-3 py-1 pr-2 text-sm", children: ["on ", getChainName(order.srcChain), _jsx("img", { src: ALL_CHAINS[order.srcChain].logoUrl, alt: getChainName(order.srcChain), className: cn("h-6 rounded-full", order.srcChain === b3Viem.id && "h-5 rounded-none") })] })] }), _jsx("span", { className: "text-as-primary/50 order-details-address-label mb-1 mt-2", children: " to the address:" })] }), _jsx(CopyToClipboard, { text: order.globalAddress, onCopy: () => {
|
|
464
464
|
toast.success("Copied to clipboard");
|
|
465
465
|
}, children: _jsxs("div", { className: "bg-b3-react-background border-b3-react-border hover:border-as-brand order-details-address-container group flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-3 px-4 shadow-md transition-all duration-200", children: [_jsx("div", { className: "text-as-primary order-details-address-text overflow-hidden text-ellipsis whitespace-nowrap text-sm", children: order.globalAddress }), _jsx(Copy, { className: "group-hover:text-as-brand text-as-primary/50 order-details-address-copy-icon h-5 w-5 cursor-pointer transition-all duration-200" })] }) }), (account?.address || phantomWalletAddress) && !showQRCode ? (_jsx("div", { className: "mb-4 mt-8 flex w-full flex-col items-center gap-4", children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "relative flex w-full flex-col items-center gap-2", children: [_jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-5/6 items-center gap-2 sm:px-0", disabled: txLoading || isSwitchingOrExecuting, onClick: handlePayment, children: txLoading ? (_jsxs(_Fragment, { children: ["Transaction Pending", _jsx(Loader2, { className: "ml-2 h-5 w-5 animate-spin" })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "pl-4 text-lg md:text-sm", children: order.srcChain === RELAY_SOLANA_MAINNET_CHAIN_ID && phantomWalletAddress
|
|
466
466
|
? "Pay from Phantom Wallet"
|