@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.
Files changed (58) hide show
  1. package/dist/cjs/anyspend/constants/rpc.d.ts +1 -1
  2. package/dist/cjs/anyspend/constants/rpc.js +1 -1
  3. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
  4. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +3 -3
  5. package/dist/cjs/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
  6. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +2 -2
  7. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
  8. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
  9. package/dist/cjs/anyspend/utils/chain.js +8 -7
  10. package/dist/cjs/global-account/react/components/custom/Button.d.ts +1 -1
  11. package/dist/cjs/global-account/react/components/ui/button.d.ts +1 -1
  12. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +7 -7
  13. package/dist/cjs/shared/constants/chains/b3Chain.js +4 -4
  14. package/dist/cjs/shared/constants/chains/b3Viem.d.ts +6 -0
  15. package/dist/cjs/shared/constants/chains/b3Viem.js +19 -0
  16. package/dist/cjs/shared/constants/chains/supported.d.ts +1 -1
  17. package/dist/cjs/shared/generated/chain-networks.json +2 -2
  18. package/dist/cjs/shared/utils/chains.d.ts +1 -1
  19. package/dist/cjs/shared/utils/chains.js +2 -2
  20. package/dist/esm/anyspend/constants/rpc.d.ts +1 -1
  21. package/dist/esm/anyspend/constants/rpc.js +1 -1
  22. package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
  23. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +3 -3
  24. package/dist/esm/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
  25. package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
  26. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
  27. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
  28. package/dist/esm/anyspend/utils/chain.js +10 -9
  29. package/dist/esm/global-account/react/components/custom/Button.d.ts +1 -1
  30. package/dist/esm/global-account/react/components/ui/button.d.ts +1 -1
  31. package/dist/esm/shared/constants/chains/b3Chain.d.ts +7 -7
  32. package/dist/esm/shared/constants/chains/b3Chain.js +4 -4
  33. package/dist/esm/shared/constants/chains/b3Viem.d.ts +6 -0
  34. package/dist/esm/shared/constants/chains/b3Viem.js +16 -0
  35. package/dist/esm/shared/constants/chains/supported.d.ts +1 -1
  36. package/dist/esm/shared/generated/chain-networks.json +2 -2
  37. package/dist/esm/shared/utils/chains.d.ts +1 -1
  38. package/dist/esm/shared/utils/chains.js +2 -2
  39. package/dist/types/anyspend/constants/rpc.d.ts +1 -1
  40. package/dist/types/global-account/react/components/custom/Button.d.ts +1 -1
  41. package/dist/types/global-account/react/components/ui/button.d.ts +1 -1
  42. package/dist/types/shared/constants/chains/b3Chain.d.ts +7 -7
  43. package/dist/types/shared/constants/chains/b3Viem.d.ts +6 -0
  44. package/dist/types/shared/constants/chains/supported.d.ts +1 -1
  45. package/dist/types/shared/utils/chains.d.ts +1 -1
  46. package/package.json +1 -1
  47. package/src/anyspend/constants/rpc.ts +2 -1
  48. package/src/anyspend/react/components/AnySpendNFT.tsx +2 -2
  49. package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +3 -3
  50. package/src/anyspend/react/components/common/InsufficientDepositPayment.tsx +2 -2
  51. package/src/anyspend/react/components/common/OrderDetails.tsx +2 -2
  52. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +4 -4
  53. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +2 -2
  54. package/src/anyspend/utils/chain.ts +9 -8
  55. package/src/shared/constants/chains/b3Chain.ts +5 -5
  56. package/src/shared/constants/chains/b3Viem.ts +18 -0
  57. package/src/shared/generated/chain-networks.json +2 -2
  58. package/src/shared/utils/chains.ts +3 -2
@@ -9,7 +9,7 @@ import { formatTokenAmount } from "../../../../shared/utils/number.js";
9
9
  import { ChevronDown, Copy } from "lucide-react";
10
10
  import { motion } from "motion/react";
11
11
  import { memo, useState } from "react";
12
- import { b3 } from "viem/chains";
12
+ import { b3Viem } from "../../../../shared/constants/chains/b3Viem.js";
13
13
  export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({ order, dstToken, tournament, nft, recipientName, formattedExpectedDstAmount, className, showTotal = false, totalAmount, points, isOpen, onOpenChange, classes, }) {
14
14
  const [internalOpen, setInternalOpen] = useState(true);
15
15
  // Use controlled mode if isOpen is provided, otherwise use internal state
@@ -39,5 +39,5 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({ o
39
39
  ? order.metadata.action
40
40
  ? capitalizeFirstLetter(order.metadata.action)
41
41
  : "Contract execution"
42
- : "" }), _jsxs("div", { className: "order-details-expected-value flex flex-wrap items-center justify-end gap-2", children: [order.type === "swap" || order.type === "deposit_first" ? (_jsx("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : order.type === "mint_nft" ? (_jsxs("div", { className: "order-details-nft-info flex items-center gap-2", children: [_jsx("img", { src: nft?.imageUrl, alt: nft?.name || "NFT", className: "order-details-nft-image h-5 w-5" }), _jsx("div", { className: "order-details-nft-name", children: nft?.name || "NFT" })] })) : order.type === "join_tournament" || order.type === "fund_tournament" ? (_jsxs("div", { className: "order-details-tournament-info flex items-center gap-2", children: [_jsx("img", { src: tournament?.imageUrl, alt: tournament?.name || "Tournament", className: "order-details-tournament-image h-5 w-5" }), _jsx("div", { className: "order-details-tournament-name", children: tournament?.name || "Tournament" })] })) : order.type === "hype_duel" ? (_jsx("div", { className: "order-details-hype-info flex items-center gap-2", children: _jsxs("div", { className: "order-details-hype-amount", children: [formatTokenAmount(BigInt(order.payload.expectedDstAmount), dstToken.decimals), " HYPE"] }) })) : order.type === "custom" || order.type === "custom_exact_in" ? (_jsx("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : null, _jsxs("div", { className: "order-details-chain-info text-as-primary/50 flex items-center gap-2", children: [_jsxs("span", { className: "order-details-chain-text", children: ["on ", order.dstChain !== b3.id && getChainName(order.dstChain)] }), _jsx("img", { src: ALL_CHAINS[order.dstChain].logoUrl, alt: getChainName(order.dstChain), className: cn("order-details-chain-logo h-3", order.dstChain !== b3.id && "w-3 rounded-full", order.dstChain === b3.id && "h-4") })] })] })] }), points !== undefined && points !== null && (_jsxs(_Fragment, { children: [_jsx("div", { className: "order-details-divider divider w-full" }), _jsxs("div", { className: "order-details-points-section flex w-full justify-between gap-4", children: [_jsx("div", { className: "order-details-points-label text-as-tertiary", children: "Points" }), _jsxs("div", { className: "order-details-points-value text-as-brand font-semibold", children: ["+", formatNumber(points), " pts"] })] })] })), _jsx("div", { className: "order-details-divider divider w-full" }), _jsxs("div", { className: "order-details-id-total-section flex w-full justify-between gap-4", children: [_jsx("div", { className: "order-details-id-total-label text-as-tertiary", children: showTotal ? "Total (included fee)" : "Order ID" }), _jsx("div", { className: "order-details-id-total-value text-as-primary overflow-hidden text-ellipsis whitespace-nowrap", children: showTotal && totalAmount ? totalAmount : order.id })] })] }) })) : (_jsxs("div", { className: "order-details-collapsed flex w-full items-center", children: [_jsx("div", { className: "order-details-collapsed-divider divider w-full" }), _jsx("button", { className: "order-details-collapsed-button whitespace-nowrap text-sm", onClick: () => setShowOrderDetails(true), children: "Order Details" }), _jsx(ChevronDown, { className: "order-details-collapsed-chevron text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" }), _jsx("div", { className: "order-details-collapsed-divider divider w-full" })] })) }));
42
+ : "" }), _jsxs("div", { className: "order-details-expected-value flex flex-wrap items-center justify-end gap-2", children: [order.type === "swap" || order.type === "deposit_first" ? (_jsx("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : order.type === "mint_nft" ? (_jsxs("div", { className: "order-details-nft-info flex items-center gap-2", children: [_jsx("img", { src: nft?.imageUrl, alt: nft?.name || "NFT", className: "order-details-nft-image h-5 w-5" }), _jsx("div", { className: "order-details-nft-name", children: nft?.name || "NFT" })] })) : order.type === "join_tournament" || order.type === "fund_tournament" ? (_jsxs("div", { className: "order-details-tournament-info flex items-center gap-2", children: [_jsx("img", { src: tournament?.imageUrl, alt: tournament?.name || "Tournament", className: "order-details-tournament-image h-5 w-5" }), _jsx("div", { className: "order-details-tournament-name", children: tournament?.name || "Tournament" })] })) : order.type === "hype_duel" ? (_jsx("div", { className: "order-details-hype-info flex items-center gap-2", children: _jsxs("div", { className: "order-details-hype-amount", children: [formatTokenAmount(BigInt(order.payload.expectedDstAmount), dstToken.decimals), " HYPE"] }) })) : order.type === "custom" || order.type === "custom_exact_in" ? (_jsx("span", { className: "order-details-amount-text", children: `~${finalFormattedExpectedDstAmount} ${dstToken.symbol}` })) : null, _jsxs("div", { className: "order-details-chain-info text-as-primary/50 flex items-center gap-2", children: [_jsxs("span", { className: "order-details-chain-text", children: ["on ", order.dstChain !== b3Viem.id && getChainName(order.dstChain)] }), _jsx("img", { src: ALL_CHAINS[order.dstChain].logoUrl, alt: getChainName(order.dstChain), className: cn("order-details-chain-logo h-3", order.dstChain !== b3Viem.id && "w-3 rounded-full", order.dstChain === b3Viem.id && "h-4") })] })] })] }), points !== undefined && points !== null && (_jsxs(_Fragment, { children: [_jsx("div", { className: "order-details-divider divider w-full" }), _jsxs("div", { className: "order-details-points-section flex w-full justify-between gap-4", children: [_jsx("div", { className: "order-details-points-label text-as-tertiary", children: "Points" }), _jsxs("div", { className: "order-details-points-value text-as-brand font-semibold", children: ["+", formatNumber(points), " pts"] })] })] })), _jsx("div", { className: "order-details-divider divider w-full" }), _jsxs("div", { className: "order-details-id-total-section flex w-full justify-between gap-4", children: [_jsx("div", { className: "order-details-id-total-label text-as-tertiary", children: showTotal ? "Total (included fee)" : "Order ID" }), _jsx("div", { className: "order-details-id-total-value text-as-primary overflow-hidden text-ellipsis whitespace-nowrap", children: showTotal && totalAmount ? totalAmount : order.id })] })] }) })) : (_jsxs("div", { className: "order-details-collapsed flex w-full items-center", children: [_jsx("div", { className: "order-details-collapsed-divider divider w-full" }), _jsx("button", { className: "order-details-collapsed-button whitespace-nowrap text-sm", onClick: () => setShowOrderDetails(true), children: "Order Details" }), _jsx(ChevronDown, { className: "order-details-collapsed-chevron text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" }), _jsx("div", { className: "order-details-collapsed-divider divider w-full" })] })) }));
43
43
  });
@@ -8,7 +8,7 @@ import { WalletCoinbase, WalletMetamask, WalletPhantom, WalletTrust } from "@web
8
8
  import { ChevronLeft, Copy } from "lucide-react";
9
9
  import { QRCodeSVG } from "qrcode.react";
10
10
  import { memo, useEffect, useMemo, useState } from "react";
11
- import { b3 } from "viem/chains";
11
+ import { b3Viem } from "../../../../shared/constants/chains/b3Viem.js";
12
12
  import { CryptoPaymentMethodType } from "./CryptoPaymentMethod.js";
13
13
  import { OrderDetailsCollapsible } from "./OrderDetailsCollapsible.js";
14
14
  import { PaymentMethodSwitch } from "./PaymentMethodSwitch.js";
@@ -68,5 +68,5 @@ export const TransferCryptoDetails = memo(function TransferCryptoDetails({ order
68
68
  transition: "stroke-dashoffset 1s linear",
69
69
  } })] }), _jsx("div", { className: "order-transfer-crypto-timer-text absolute inset-0 flex items-center justify-center", children: _jsx("span", { className: "text-as-primary text-[10px] font-semibold", children: formatTime(timeLeft) }) })] })] }), _jsxs("div", { className: "order-transfer-crypto-content flex w-full flex-col gap-4", children: [_jsxs("div", { className: "order-transfer-crypto-cards flex items-center gap-4", children: [_jsxs("div", { className: "order-transfer-crypto-amount-card w-full", children: [_jsx("span", { className: "order-transfer-crypto-amount-label text-as-content-secondary text-sm font-medium", children: "Amount" }), _jsx("div", { className: "order-transfer-crypto-amount-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: _jsx(CopyToClipboard, { text: roundedUpSrcAmount || "", onCopy: () => {
70
70
  toast.success("Amount copied to clipboard");
71
- }, children: _jsxs("div", { className: "order-transfer-crypto-amount-copy flex cursor-pointer items-center justify-between gap-2", children: [_jsxs("strong", { className: "order-transfer-crypto-amount-text text-as-primary font-semibold", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), _jsx(Copy, { className: "order-transfer-crypto-amount-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 transition-all duration-200" })] }) }) })] }), _jsxs("div", { className: "order-transfer-crypto-chain-card w-full", children: [_jsx("span", { className: "order-transfer-crypto-chain-label text-as-content-secondary text-sm font-medium", children: "Chain" }), _jsx("div", { className: "order-transfer-crypto-chain-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: _jsxs("div", { className: "order-transfer-crypto-chain-info flex items-center gap-2", children: [_jsx("img", { src: ALL_CHAINS[order.srcChain].logoUrl, alt: getChainName(order.srcChain), className: cn("order-transfer-crypto-chain-logo h-6 rounded-full", order.srcChain === b3.id && "h-5 rounded-none") }), _jsx("span", { className: "order-transfer-crypto-chain-name text-as-primary text-sm font-semibold", children: getChainName(order.srcChain) })] }) })] })] }), _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: [_jsx("div", { className: "order-transfer-crypto-qr-section border-as-border-primary h-full w-full border-r", children: _jsx("div", { className: "order-transfer-crypto-qr-wrapper flex justify-center", children: _jsxs("div", { className: "order-transfer-crypto-qr-container bg-as-surface-secondary flex flex-col items-center rounded-lg p-6", children: [_jsx(QRCodeSVG, { value: getPaymentUrl(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === 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" }), _jsxs("div", { className: "order-transfer-crypto-wallet-hint mt-3 flex items-center justify-center gap-2 text-sm", children: [_jsx("span", { className: "order-transfer-crypto-wallet-text text-as-brand/70 text-sm font-medium", children: "SCAN WITH" }), _jsxs(TextLoop, { interval: 3, children: [_jsx(WalletMetamask, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" })] })] })] }) }) }), _jsxs("div", { className: "order-transfer-crypto-address-section flex h-full w-full flex-col gap-2 p-6", children: [_jsx("span", { className: "order-transfer-crypto-address-label text-as-content-secondary text-sm font-medium", children: "Deposit address:" }), _jsxs("div", { className: "order-transfer-crypto-address-copy flex h-full cursor-pointer flex-col items-stretch justify-between gap-4", onClick: handleCopyAddress, children: [_jsx("div", { className: "order-transfer-crypto-address-text text-as-primary break-all font-mono text-sm font-semibold leading-relaxed", children: order.globalAddress }), _jsx("div", { className: "order-transfer-crypto-address-copy-icon-wrapper place-self-end", children: _jsx(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" }) })] })] })] }), _jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount })] }), _jsxs("div", { className: "order-transfer-crypto-actions flex flex-col gap-3", children: [_jsx(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" }), _jsx(PaymentMethodSwitch, { currentMethod: CryptoPaymentMethodType.TRANSFER_CRYPTO, onMethodChange: onPaymentMethodChange })] })] }));
71
+ }, children: _jsxs("div", { className: "order-transfer-crypto-amount-copy flex cursor-pointer items-center justify-between gap-2", children: [_jsxs("strong", { className: "order-transfer-crypto-amount-text text-as-primary font-semibold", children: [roundedUpSrcAmount, " ", srcToken.symbol] }), _jsx(Copy, { className: "order-transfer-crypto-amount-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 transition-all duration-200" })] }) }) })] }), _jsxs("div", { className: "order-transfer-crypto-chain-card w-full", children: [_jsx("span", { className: "order-transfer-crypto-chain-label text-as-content-secondary text-sm font-medium", children: "Chain" }), _jsx("div", { className: "order-transfer-crypto-chain-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: _jsxs("div", { className: "order-transfer-crypto-chain-info flex items-center gap-2", children: [_jsx("img", { src: ALL_CHAINS[order.srcChain].logoUrl, alt: getChainName(order.srcChain), className: cn("order-transfer-crypto-chain-logo h-6 rounded-full", order.srcChain === b3Viem.id && "h-5 rounded-none") }), _jsx("span", { className: "order-transfer-crypto-chain-name text-as-primary text-sm font-semibold", children: getChainName(order.srcChain) })] }) })] })] }), _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: [_jsx("div", { className: "order-transfer-crypto-qr-section border-as-border-primary h-full w-full border-r", children: _jsx("div", { className: "order-transfer-crypto-qr-wrapper flex justify-center", children: _jsxs("div", { className: "order-transfer-crypto-qr-container bg-as-surface-secondary flex flex-col items-center rounded-lg p-6", children: [_jsx(QRCodeSVG, { value: getPaymentUrl(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === 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" }), _jsxs("div", { className: "order-transfer-crypto-wallet-hint mt-3 flex items-center justify-center gap-2 text-sm", children: [_jsx("span", { className: "order-transfer-crypto-wallet-text text-as-brand/70 text-sm font-medium", children: "SCAN WITH" }), _jsxs(TextLoop, { interval: 3, children: [_jsx(WalletMetamask, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "order-transfer-crypto-wallet-icon h-5 w-5", variant: "branded" })] })] })] }) }) }), _jsxs("div", { className: "order-transfer-crypto-address-section flex h-full w-full flex-col gap-2 p-6", children: [_jsx("span", { className: "order-transfer-crypto-address-label text-as-content-secondary text-sm font-medium", children: "Deposit address:" }), _jsxs("div", { className: "order-transfer-crypto-address-copy flex h-full cursor-pointer flex-col items-stretch justify-between gap-4", onClick: handleCopyAddress, children: [_jsx("div", { className: "order-transfer-crypto-address-text text-as-primary break-all font-mono text-sm font-semibold leading-relaxed", children: order.globalAddress }), _jsx("div", { className: "order-transfer-crypto-address-copy-icon-wrapper place-self-end", children: _jsx(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" }) })] })] })] }), _jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount })] }), _jsxs("div", { className: "order-transfer-crypto-actions flex flex-col gap-3", children: [_jsx(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" }), _jsx(PaymentMethodSwitch, { currentMethod: CryptoPaymentMethodType.TRANSFER_CRYPTO, onMethodChange: onPaymentMethodChange })] })] }));
72
72
  });
@@ -1,8 +1,9 @@
1
1
  import { RELAY_SOLANA_MAINNET_CHAIN_ID } from "../../anyspend/constants/index.js";
2
- import { ABSTRACT_PUBLIC_RPC, ARBITRUM_PUBLIC_RPC, AVALANCHE_PUBLIC_RPC, B3_PUBLIC_RPC, BASE_PUBLIC_RPC, BSC_PUBLIC_RPC, ETHEREUM_PUBLIC_RPC, HYPEREVM_PUBLIC_RPC, OPTIMISM_PUBLIC_RPC, POLYGON_PUBLIC_RPC, } from "../../anyspend/constants/rpc.js";
2
+ import { ABSTRACT_PUBLIC_RPC, ARBITRUM_PUBLIC_RPC, AVALANCHE_PUBLIC_RPC, BASE_PUBLIC_RPC, BSC_PUBLIC_RPC, ETHEREUM_PUBLIC_RPC, HYPEREVM_PUBLIC_RPC, OPTIMISM_PUBLIC_RPC, POLYGON_PUBLIC_RPC, } from "../../anyspend/constants/rpc.js";
3
3
  import invariant from "invariant";
4
4
  import { createPublicClient, createWalletClient, defineChain, http, parseEther, } from "viem";
5
- import { abstract, arbitrum, avalanche, b3, base, bsc, mainnet, optimism, polygon } from "viem/chains";
5
+ import { b3Viem } from "../../shared/constants/chains/b3Viem.js";
6
+ import { abstract, arbitrum, avalanche, base, bsc, mainnet, optimism, polygon } from "viem/chains";
6
7
  import { ChainType } from "../types/chain.js";
7
8
  import { getAvaxToken, getBnbToken, getEthToken, getHyperEVMNativeToken, getHyperliquidUSDCToken, getPolToken, getSolanaToken, HYPEREVM_CHAIN_ID, HYPERLIQUID_CHAIN_ID, } from "./token.js";
8
9
  function getCustomEvmChain(chain, rpcUrl) {
@@ -162,16 +163,16 @@ export const EVM_MAINNET = {
162
163
  coingeckoName: "bsc",
163
164
  wethAddress: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
164
165
  },
165
- [b3.id]: {
166
- id: b3.id,
167
- name: b3.name,
166
+ [b3Viem.id]: {
167
+ id: b3Viem.id,
168
+ name: b3Viem.name,
168
169
  logoUrl: "https://assets.relay.link/icons/square/8333/light.png",
169
170
  type: ChainType.EVM,
170
171
  nativeRequired: parseEther("0.0001"),
171
172
  canDepositNative: true,
172
- defaultToken: getEthToken(b3.id),
173
- nativeToken: getEthToken(b3.id),
174
- viem: getCustomEvmChain(b3, B3_PUBLIC_RPC),
173
+ defaultToken: getEthToken(b3Viem.id),
174
+ nativeToken: getEthToken(b3Viem.id),
175
+ viem: b3Viem,
175
176
  pollingInterval: 1000, // 1 second for B3
176
177
  zapperEnum: "B3_MAINNET",
177
178
  coingeckoName: "b3",
@@ -517,7 +518,7 @@ export function getPaymentUrl(address, amount, currency, chainId, decimals) {
517
518
  }
518
519
  }
519
520
  export function getExplorerTxUrl(chainId, txHash) {
520
- if (chainId === b3.id) {
521
+ if (chainId === b3Viem.id) {
521
522
  return "https://explorer.b3.fun/b3/tx/" + txHash;
522
523
  }
523
524
  if (EVM_CHAINS[chainId]) {
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  declare const buttonVariants: (props?: ({
3
- variant?: "link" | "default" | "b3" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
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?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
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://mainnet-rpc.b3.fun"];
37
- readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
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://mainnet-rpc.b3.fun";
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://mainnet-rpc.b3.fun"];
132
- readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
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://mainnet-rpc.b3.fun";
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;
@@ -52,11 +52,11 @@ export const b3Testnet = defineChain({
52
52
  export const b3Mainnet = defineChain({
53
53
  id: 8333,
54
54
  name: "B3",
55
- rpc: "https://mainnet-rpc.b3.fun",
55
+ rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2",
56
56
  rpcUrls: {
57
57
  default: {
58
- http: ["https://mainnet-rpc.b3.fun"],
59
- ws: ["wss://mainnet-rpc.b3.fun/ws"],
58
+ http: ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
59
+ ws: ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
60
60
  },
61
61
  },
62
62
  icon: {
@@ -123,7 +123,7 @@ export const thirdwebB3Testnet = defineThirdwebChain({
123
123
  export const thirdwebB3Mainnet = defineThirdwebChain({
124
124
  id: 8333,
125
125
  name: "B3",
126
- rpc: "https://mainnet-rpc.b3.fun/http",
126
+ rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
127
127
  icon: {
128
128
  url: "https://cdn.b3.fun/b3_logo.svg",
129
129
  width: 32,
@@ -0,0 +1,6 @@
1
+ import type { Chain } from "viem";
2
+ /**
3
+ * Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
4
+ * RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
5
+ */
6
+ export declare const b3Viem: Chain;
@@ -0,0 +1,16 @@
1
+ import { B3_PUBLIC_RPC } from "../../../anyspend/constants/rpc.js";
2
+ import { b3 as viemB3 } from "viem/chains";
3
+ /**
4
+ * Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
5
+ * RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
6
+ */
7
+ export const b3Viem = {
8
+ ...viemB3,
9
+ rpcUrls: {
10
+ ...viemB3.rpcUrls,
11
+ default: {
12
+ ...viemB3.rpcUrls.default,
13
+ http: [B3_PUBLIC_RPC],
14
+ },
15
+ },
16
+ };
@@ -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://mainnet-rpc.b3.fun",
9
- "ws": "wss://mainnet-rpc.b3.fun/ws"
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/chains";
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;
@@ -1,5 +1,5 @@
1
+ import { b3Viem } from "../../shared/constants/chains/b3Viem.js";
1
2
  import { supportedChains } from "../../shared/constants/chains/supported.js";
2
- import { b3 } from "viem/chains";
3
3
  const baseChainBaseUrl = "https://basescan.org";
4
4
  export function getChainById(id) {
5
5
  return Object.values(supportedChains).find(chain => chain.id === id);
@@ -9,7 +9,7 @@ export function chainIdToName(id) {
9
9
  return name === "Base Mainnet" ? "Base" : name === "The Open Network" ? "Open Network" : name;
10
10
  }
11
11
  export function getExplorerUrl(chain, txHash) {
12
- if (chain.id === b3.id) {
12
+ if (chain.id === b3Viem.id) {
13
13
  return "https://explorer.b3.fun/b3/tx/" + txHash;
14
14
  }
15
15
  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://mainnet-rpc.b3.fun/http";
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
  /**
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  declare const buttonVariants: (props?: ({
3
- variant?: "link" | "default" | "b3" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
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?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
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 "@b3dotfun/sdk/global-account/types/chain-networks";
1
2
  import { Chain as ThirdwebChain } from "thirdweb";
2
3
  import { Chain } from "viem";
3
- import { ChainNetworks } from "@b3dotfun/sdk/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://mainnet-rpc.b3.fun"];
37
- readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
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://mainnet-rpc.b3.fun";
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://mainnet-rpc.b3.fun"];
132
- readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
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://mainnet-rpc.b3.fun";
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;
@@ -0,0 +1,6 @@
1
+ import type { Chain } from "viem";
2
+ /**
3
+ * Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
4
+ * RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
5
+ */
6
+ export declare const b3Viem: Chain;
@@ -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;
@@ -1,4 +1,4 @@
1
- import { Chain } from "viem/chains";
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.1.69-alpha.16",
3
+ "version": "0.1.69-alpha.17",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -17,7 +17,8 @@ export const AVALANCHE_PUBLIC_RPC = "https://avalanche-c-chain-rpc.publicnode.co
17
17
  export const BSC_PUBLIC_RPC = "https://bsc-rpc.publicnode.com";
18
18
 
19
19
  // Chain-specific public endpoints
20
- export const B3_PUBLIC_RPC = "https://mainnet-rpc.b3.fun/http";
20
+ export const B3_PUBLIC_RPC =
21
+ "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/";
21
22
  export const ABSTRACT_PUBLIC_RPC = "https://api.mainnet.abs.xyz";
22
23
  export const HYPEREVM_PUBLIC_RPC = "https://rpc.hyperliquid.xyz/evm";
23
24
 
@@ -8,7 +8,7 @@ import { formatDisplayNumber, formatTokenAmount } from "@b3dotfun/sdk/shared/uti
8
8
  import { MoreVertical } from "lucide-react";
9
9
  import { AnimatePresence } from "motion/react";
10
10
  import { useCallback, useEffect, useRef, useState } from "react";
11
- import { b3 } from "viem/chains";
11
+ import { b3Viem } from "@b3dotfun/sdk/shared/constants/chains/b3Viem";
12
12
  import { GetQuoteResponse } from "../../types/api_req_res";
13
13
  import { AnySpendCustom } from "./AnySpendCustom";
14
14
  import type { AnySpendContent, AnySpendSlots, AnySpendTheme } from "./types/customization";
@@ -215,7 +215,7 @@ function DropdownMenu({ nftContract }: { nftContract: components["schemas"]["Nft
215
215
  </div>
216
216
 
217
217
  <div className="hover:bg-as-on-surface-3 flex cursor-default items-center gap-2 rounded px-2">
218
- <img src={chain?.logoUrl} className={cn("h-5 w-5", nftContract.chainId !== b3.id && "rounded-full")} />
218
+ <img src={chain?.logoUrl} className={cn("h-5 w-5", nftContract.chainId !== b3Viem.id && "rounded-full")} />
219
219
  <span className="text-sm">
220
220
  Minted on <span className="font-semibold">{chain ? getChainName(nftContract.chainId) : "Unknown"}</span>
221
221
  </span>
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { getExplorerTxUrl } from "@b3dotfun/sdk/anyspend";
4
- import { b3 } from "viem/chains";
4
+ import { b3Viem } from "@b3dotfun/sdk/shared/constants/chains/b3Viem";
5
5
  import { cn } from "@b3dotfun/sdk/shared/utils/cn";
6
6
  import { ExternalLink } from "lucide-react";
7
7
  import { motion } from "motion/react";
@@ -39,7 +39,7 @@ export function CheckoutSuccess({
39
39
  : "Your payment has been processed successfully.",
40
40
  txHash,
41
41
  orderId,
42
- explorerUrl: txHash ? getExplorerTxUrl(dstChainId ?? b3.id, txHash) : undefined,
42
+ explorerUrl: txHash ? getExplorerTxUrl(dstChainId ?? b3Viem.id, txHash) : undefined,
43
43
  onDone: () => {
44
44
  if (returnUrl) window.location.href = returnUrl;
45
45
  },
@@ -79,7 +79,7 @@ export function CheckoutSuccess({
79
79
  initial={{ opacity: 0 }}
80
80
  animate={{ opacity: 1 }}
81
81
  transition={{ duration: 0.3, delay: 0.5, ease: "easeOut" }}
82
- href={getExplorerTxUrl(dstChainId ?? b3.id, txHash)}
82
+ href={getExplorerTxUrl(dstChainId ?? b3Viem.id, txHash)}
83
83
  target="_blank"
84
84
  rel="noopener noreferrer"
85
85
  className="anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400"
@@ -10,7 +10,7 @@ import {
10
10
  import { components } from "@b3dotfun/sdk/anyspend/types/api";
11
11
  import { Badge, CopyToClipboard, ShinyButton, TextLoop } from "@b3dotfun/sdk/global-account/react";
12
12
  import { cn } from "@b3dotfun/sdk/shared/utils";
13
- import { b3 } from "viem/chains";
13
+ import { b3Viem } from "@b3dotfun/sdk/shared/constants/chains/b3Viem";
14
14
 
15
15
  import { toast } from "@b3dotfun/sdk/global-account/react";
16
16
  import { formatUnits } from "@b3dotfun/sdk/shared/utils/number";
@@ -63,7 +63,7 @@ export function InsufficientDepositPayment({
63
63
  <img
64
64
  src={ALL_CHAINS[order.srcChain].logoUrl}
65
65
  alt={getChainName(order.srcChain)}
66
- className={cn("h-6 rounded-full", order.srcChain === b3.id && "h-5 rounded-none")}
66
+ className={cn("h-6 rounded-full", order.srcChain === b3Viem.id && "h-5 rounded-none")}
67
67
  />
68
68
  </Badge>
69
69
  </div>
@@ -41,7 +41,7 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
41
41
  import TimeAgo from "react-timeago";
42
42
 
43
43
  import { encodeFunctionData, erc20Abi } from "viem";
44
- import { b3 } from "viem/chains";
44
+ import { b3Viem } from "@b3dotfun/sdk/shared/constants/chains/b3Viem";
45
45
  import { useWaitForTransactionReceipt, useWalletClient } from "wagmi";
46
46
  import { usePhantomTransfer } from "../../hooks/usePhantomTransfer";
47
47
  import type { OrderDetailsClasses } from "../types/classes";
@@ -1019,7 +1019,7 @@ export const OrderDetails = memo(function OrderDetails({
1019
1019
  <img
1020
1020
  src={ALL_CHAINS[order.srcChain].logoUrl}
1021
1021
  alt={getChainName(order.srcChain)}
1022
- className={cn("h-6 rounded-full", order.srcChain === b3.id && "h-5 rounded-none")}
1022
+ className={cn("h-6 rounded-full", order.srcChain === b3Viem.id && "h-5 rounded-none")}
1023
1023
  />
1024
1024
  </Badge>
1025
1025
  </div>
@@ -11,7 +11,7 @@ import { ChevronDown, Copy } from "lucide-react";
11
11
  import { motion } from "motion/react";
12
12
  import { memo, useState } from "react";
13
13
 
14
- import { b3 } from "viem/chains";
14
+ import { b3Viem } from "@b3dotfun/sdk/shared/constants/chains/b3Viem";
15
15
  import type { OrderDetailsCollapsibleClasses } from "../types/classes";
16
16
 
17
17
  type Order = components["schemas"]["Order"];
@@ -154,15 +154,15 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({
154
154
 
155
155
  <div className="order-details-chain-info text-as-primary/50 flex items-center gap-2">
156
156
  <span className="order-details-chain-text">
157
- on {order.dstChain !== b3.id && getChainName(order.dstChain)}
157
+ on {order.dstChain !== b3Viem.id && getChainName(order.dstChain)}
158
158
  </span>
159
159
  <img
160
160
  src={ALL_CHAINS[order.dstChain].logoUrl}
161
161
  alt={getChainName(order.dstChain)}
162
162
  className={cn(
163
163
  "order-details-chain-logo h-3",
164
- order.dstChain !== b3.id && "w-3 rounded-full",
165
- order.dstChain === b3.id && "h-4",
164
+ order.dstChain !== b3Viem.id && "w-3 rounded-full",
165
+ order.dstChain === b3Viem.id && "h-4",
166
166
  )}
167
167
  />
168
168
  </div>
@@ -10,7 +10,7 @@ import { ChevronLeft, Copy } from "lucide-react";
10
10
  import { QRCodeSVG } from "qrcode.react";
11
11
  import { memo, useEffect, useMemo, useState } from "react";
12
12
 
13
- import { b3 } from "viem/chains";
13
+ import { b3Viem } from "@b3dotfun/sdk/shared/constants/chains/b3Viem";
14
14
  import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
15
15
  import { OrderDetailsCollapsible } from "./OrderDetailsCollapsible";
16
16
  import { PaymentMethodSwitch } from "./PaymentMethodSwitch";
@@ -193,7 +193,7 @@ export const TransferCryptoDetails = memo(function TransferCryptoDetails({
193
193
  alt={getChainName(order.srcChain)}
194
194
  className={cn(
195
195
  "order-transfer-crypto-chain-logo h-6 rounded-full",
196
- order.srcChain === b3.id && "h-5 rounded-none",
196
+ order.srcChain === b3Viem.id && "h-5 rounded-none",
197
197
  )}
198
198
  />
199
199
  <span className="order-transfer-crypto-chain-name text-as-primary text-sm font-semibold">
@@ -25,7 +25,8 @@ import {
25
25
  Transport,
26
26
  WalletClient,
27
27
  } from "viem";
28
- import { abstract, arbitrum, avalanche, b3, base, bsc, mainnet, optimism, polygon } from "viem/chains";
28
+ import { b3Viem } from "@b3dotfun/sdk/shared/constants/chains/b3Viem";
29
+ import { abstract, arbitrum, avalanche, base, bsc, mainnet, optimism, polygon } from "viem/chains";
29
30
  import { ChainType, IBaseChain, IEVMChain, IHyperliquidChain, ISolanaChain } from "../types/chain";
30
31
  import {
31
32
  getAvaxToken,
@@ -203,16 +204,16 @@ export const EVM_MAINNET: Record<number, IEVMChain> = {
203
204
  coingeckoName: "bsc",
204
205
  wethAddress: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
205
206
  },
206
- [b3.id]: {
207
- id: b3.id,
208
- name: b3.name,
207
+ [b3Viem.id]: {
208
+ id: b3Viem.id,
209
+ name: b3Viem.name,
209
210
  logoUrl: "https://assets.relay.link/icons/square/8333/light.png",
210
211
  type: ChainType.EVM,
211
212
  nativeRequired: parseEther("0.0001"),
212
213
  canDepositNative: true,
213
- defaultToken: getEthToken(b3.id),
214
- nativeToken: getEthToken(b3.id),
215
- viem: getCustomEvmChain(b3, B3_PUBLIC_RPC),
214
+ defaultToken: getEthToken(b3Viem.id),
215
+ nativeToken: getEthToken(b3Viem.id),
216
+ viem: b3Viem,
216
217
  pollingInterval: 1000, // 1 second for B3
217
218
  zapperEnum: "B3_MAINNET",
218
219
  coingeckoName: "b3",
@@ -605,7 +606,7 @@ export function getPaymentUrl(
605
606
  }
606
607
 
607
608
  export function getExplorerTxUrl(chainId: number, txHash: string) {
608
- if (chainId === b3.id) {
609
+ if (chainId === b3Viem.id) {
609
610
  return "https://explorer.b3.fun/b3/tx/" + txHash;
610
611
  }
611
612
  if (EVM_CHAINS[chainId]) {