@b3dotfun/sdk 0.0.88-alpha.3 → 0.0.88-alpha.5

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.
@@ -177,7 +177,7 @@ function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentT
177
177
  };
178
178
  // Chain selection view
179
179
  if (step === "select-chain") {
180
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: [onClose && ((0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), !isBalanceLoading && totalBalance > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-balance border-secondary border-b p-5", children: [(0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-balance-label text-as-secondary text-sm", children: "Your Balance" }), (0, jsx_runtime_1.jsxs)("p", { className: "anyspend-deposit-balance-value text-as-primary text-3xl font-semibold", children: [formatDecimal(totalBalance), " ", (0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: "USD" })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-options flex flex-col gap-2 p-6", children: [isBalanceLoading && ((0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chains-skeleton flex flex-col gap-2", children: [1, 2].map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "border-border-primary flex items-center justify-between rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-6 w-6 rounded-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-4 w-32" }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-3 w-20" })] })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-5 w-5" })] }, i))) })), topChainsWithBalance.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chains flex flex-col gap-2", children: topChainsWithBalance.map(chain => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleSelectChain(chain.id), className: "anyspend-deposit-chain-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chain-content", children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-chain-info", children: [(0, jsx_runtime_1.jsxs)("span", { className: "anyspend-deposit-chain-name text-as-primary flex items-center gap-1.5 font-medium", children: ["Deposit from ", chain.name, (0, jsx_runtime_1.jsx)(ChainIcon, { chainId: chain.id, className: "h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("p", { className: "anyspend-deposit-chain-balance text-as-secondary text-xs", children: [formatUsd(chain.balance), " available"] })] }) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-chain-chevron text-as-secondary h-5 w-5" })] }, chain.id))) })), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-general-options flex flex-col gap-2", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectCrypto, className: "anyspend-deposit-option-button anyspend-deposit-crypto-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-option-content", children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit Crypto" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Swap from any token on any chain" })] }) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-divider flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-stroke h-px flex-1" }), (0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-divider-text text-as-secondary text-sm", children: "More options" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-as-stroke h-px flex-1" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectQrDeposit, className: "anyspend-deposit-option-button anyspend-deposit-qr-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(QrCodeIcon_1.QrCodeIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit with QR Code" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Send tokens directly to deposit address" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectFiat, className: "anyspend-deposit-option-button anyspend-deposit-fiat-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left transition-all", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(CreditCardIcon_1.CreditCardIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Fund with Fiat" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Pay with card or bank transfer" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] })] }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationChainId, className: "mt-2" })] })] }));
180
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: [onClose && ((0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), !isBalanceLoading && totalBalance > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-balance border-theme-border-secondary border-b p-5", children: [(0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-balance-label text-as-secondary text-sm", children: "Your Balance" }), (0, jsx_runtime_1.jsxs)("p", { className: "anyspend-deposit-balance-value text-as-primary text-3xl font-semibold", children: [formatDecimal(totalBalance), " ", (0, jsx_runtime_1.jsx)("span", { className: "text-sm", children: "USD" })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-options flex flex-col gap-2 p-6", children: [isBalanceLoading && ((0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chains-skeleton flex flex-col gap-2", children: [1, 2].map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "border-border-primary flex items-center justify-between rounded-xl border p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-6 w-6 rounded-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-1", children: [(0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-4 w-32" }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-3 w-20" })] })] }), (0, jsx_runtime_1.jsx)(react_1.Skeleton, { className: "h-5 w-5" })] }, i))) })), topChainsWithBalance.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chains flex flex-col gap-2", children: topChainsWithBalance.map(chain => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleSelectChain(chain.id), className: "anyspend-deposit-chain-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-chain-content", children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-chain-info", children: [(0, jsx_runtime_1.jsxs)("span", { className: "anyspend-deposit-chain-name text-as-primary flex items-center gap-1.5 font-medium", children: ["Deposit from ", chain.name, (0, jsx_runtime_1.jsx)(ChainIcon, { chainId: chain.id, className: "h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("p", { className: "anyspend-deposit-chain-balance text-as-secondary text-xs", children: [formatUsd(chain.balance), " available"] })] }) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-chain-chevron text-as-secondary h-5 w-5" })] }, chain.id))) })), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-general-options flex flex-col gap-2", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectCrypto, className: "anyspend-deposit-option-button anyspend-deposit-crypto-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-deposit-option-content", children: (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit Crypto" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Swap from any token on any chain" })] }) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-divider flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-as-stroke h-px flex-1" }), (0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-divider-text text-as-secondary text-sm", children: "More options" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-as-stroke h-px flex-1" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectQrDeposit, className: "anyspend-deposit-option-button anyspend-deposit-qr-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(QrCodeIcon_1.QrCodeIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit with QR Code" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Send tokens directly to deposit address" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectFiat, className: "anyspend-deposit-option-button anyspend-deposit-fiat-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left transition-all", children: [(0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(CreditCardIcon_1.CreditCardIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), (0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit-option-info", children: [(0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Fund with Fiat" }), (0, jsx_runtime_1.jsx)("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Pay with card or bank transfer" })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] })] }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationChainId, className: "mt-2" })] })] }));
181
181
  }
182
182
  // QR Deposit view
183
183
  if (step === "qr-deposit") {
@@ -186,5 +186,5 @@ function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, paymentT
186
186
  // Check if destination is Hyperliquid
187
187
  const isHyperliquidDeposit = destinationChainId === anyspend_1.HYPERLIQUID_CHAIN_ID;
188
188
  // Deposit view
189
- return ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && ((0, jsx_runtime_1.jsxs)("button", { onClick: handleBack, className: "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("svg", { className: "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), (0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && ((0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isHyperliquidDeposit ? ((0, jsx_runtime_1.jsx)(AnySpend_1.AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationToken.address, destinationTokenChainId: destinationChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true })) : ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig })) }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationChainId, className: "px-4 pb-4" })] }));
189
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && ((0, jsx_runtime_1.jsxs)("button", { onClick: handleBack, className: "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("svg", { className: "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), (0, jsx_runtime_1.jsx)("span", { className: "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && ((0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: (0, jsx_runtime_1.jsx)("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isHyperliquidDeposit ? ((0, jsx_runtime_1.jsx)(AnySpend_1.AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationToken.address, destinationTokenChainId: destinationChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true }, selectedChainId)) : ((0, jsx_runtime_1.jsx)(AnySpendCustomExactIn_1.AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig }, selectedChainId)) }), (0, jsx_runtime_1.jsx)(WarningText_1.ChainWarningText, { chainId: destinationChainId, className: "px-4 pb-4" })] }));
190
190
  }
@@ -10,6 +10,7 @@ const formatAddress_1 = require("../../../../shared/utils/formatAddress");
10
10
  const thirdweb_1 = require("../../../../shared/utils/thirdweb");
11
11
  const lucide_react_1 = require("lucide-react");
12
12
  const react_2 = require("thirdweb/react");
13
+ const wallets_1 = require("thirdweb/wallets");
13
14
  const useConnectedWalletDisplay_1 = require("../../hooks/useConnectedWalletDisplay");
14
15
  var CryptoPaymentMethodType;
15
16
  (function (CryptoPaymentMethodType) {
@@ -18,6 +19,12 @@ var CryptoPaymentMethodType;
18
19
  CryptoPaymentMethodType["GLOBAL_WALLET"] = "global_wallet";
19
20
  CryptoPaymentMethodType["TRANSFER_CRYPTO"] = "transfer_crypto";
20
21
  })(CryptoPaymentMethodType || (exports.CryptoPaymentMethodType = CryptoPaymentMethodType = {}));
22
+ const recommendWallets = [
23
+ (0, wallets_1.createWallet)("io.metamask"),
24
+ (0, wallets_1.createWallet)("com.coinbase.wallet"),
25
+ (0, wallets_1.createWallet)("me.rainbow"),
26
+ (0, wallets_1.createWallet)("io.rabby"),
27
+ ];
21
28
  function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod, isCreatingOrder, onBack, onSelectPaymentMethod, }) {
22
29
  const { connectedEOAWallet, connectedSmartWallet } = (0, react_1.useAccountWallet)();
23
30
  const { disconnect } = (0, react_2.useDisconnect)();
@@ -33,7 +40,13 @@ function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod,
33
40
  if (connectedEOAWallet) {
34
41
  await disconnect(connectedEOAWallet);
35
42
  }
36
- const wallet = await openConnectModal({ client: thirdweb_1.client, setActive: false });
43
+ const wallet = await openConnectModal({
44
+ client: thirdweb_1.client,
45
+ setActive: false,
46
+ size: "compact",
47
+ showThirdwebBranding: false,
48
+ wallets: recommendWallets,
49
+ });
37
50
  if (wallet) {
38
51
  // setActiveWallet(wallet);
39
52
  setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
@@ -407,7 +407,7 @@ exports.OrderDetails = (0, react_5.memo)(function OrderDetails({ mode = "modal",
407
407
  ? "Funding Tournament"
408
408
  : "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : ((0, jsx_runtime_1.jsx)(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
409
409
  ? `Waiting for payment`
410
- : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), depositTxs?.length > 0 && !depositEnoughAmount && order.status === "scanning_deposit_transaction" && ((0, jsx_runtime_1.jsx)(InsufficientDepositPayment_1.InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment }))] }));
410
+ : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), depositTxs?.length > 0 && !depositEnoughAmount && order.status === "scanning_deposit_transaction" && ((0, jsx_runtime_1.jsx)(InsufficientDepositPayment_1.InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment })), (0, jsx_runtime_1.jsxs)("button", { className: "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
411
411
  }
412
412
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrderStatus_1.OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), statusDisplay === "processing" && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: order.onrampMetadata ? ((0, jsx_runtime_1.jsx)(PaymentVendorUI_1.default, { order: order, dstTokenSymbol: dstToken.symbol })) : effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.CONNECT_WALLET ||
413
413
  effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.GLOBAL_WALLET ? ((0, jsx_runtime_1.jsx)(ConnectWalletPayment_1.default, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft, cryptoPaymentMethod: effectiveCryptoPaymentMethod, onPaymentMethodChange: onPaymentMethodChange })) : effectiveCryptoPaymentMethod === CryptoPaymentMethod_1.CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
@@ -32,7 +32,6 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
32
32
  const [refetchCount, setRefetchCount] = (0, react_2.useState)(0);
33
33
  const [refetchError, setRefetchError] = (0, react_2.useState)(null);
34
34
  const [turnkeyAuthCompleted, setTurnkeyAuthCompleted] = (0, react_2.useState)(false);
35
- const justCompletedLoginRef = (0, react_2.useRef)(false);
36
35
  const { data: signers, refetch: refetchSigners, isFetching: isFetchingSigners, } = (0, react_1.useGetAllTWSigners)({
37
36
  chain,
38
37
  accountAddress: account?.address,
@@ -152,12 +151,8 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
152
151
  signersEnabled,
153
152
  });
154
153
  // The useEffect will re-run with updated user data to complete the sign-in process
155
- },
156
- // Zustand setters are stable and don't need to be in dependencies:
157
- // eslint-disable-next-line react-hooks/exhaustive-deps
158
- [
154
+ }, [
159
155
  refetchUser,
160
- setB3ModalContentType,
161
156
  strategies,
162
157
  onLoginSuccess,
163
158
  onSessionKeySuccess,
@@ -168,8 +163,10 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
168
163
  closeAfterLogin,
169
164
  source,
170
165
  signersEnabled,
171
- // Zustand setters are stable and don't need to be in dependencies:
172
- // setIsAuthenticated, setIsConnected, setJustCompletedLogin
166
+ setB3ModalContentType,
167
+ setIsAuthenticated,
168
+ setIsConnected,
169
+ setJustCompletedLogin,
173
170
  ]);
174
171
  // Handle post-login flow after signers are loaded
175
172
  (0, react_2.useEffect)(() => {
@@ -184,9 +181,7 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
184
181
  if (isConnected && isAuthenticated && user) {
185
182
  // Mark that login just completed BEFORE opening manage account or closing modal
186
183
  // This allows Turnkey modal to show (if enableTurnkey is true)
187
- // Use ref to prevent setting this multiple times and causing infinite loops
188
- if (closeAfterLogin && !justCompletedLoginRef.current) {
189
- justCompletedLoginRef.current = true;
184
+ if (closeAfterLogin) {
190
185
  setJustCompletedLogin(true);
191
186
  }
192
187
  // Check if we should show Turnkey login form as SECONDARY option (after wallet connection)
@@ -230,7 +225,6 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
230
225
  handlePostTurnkeyFlow();
231
226
  }
232
227
  },
233
- // handlePostTurnkeyFlow changes when its dependencies change, causing infinite loops
234
228
  // eslint-disable-next-line react-hooks/exhaustive-deps
235
229
  [
236
230
  signers,
@@ -251,9 +245,9 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
251
245
  user,
252
246
  enableTurnkey,
253
247
  turnkeyAuthCompleted,
254
- handleTurnkeySuccess,
248
+ // handleTurnkeySuccess, // This is causing infinite loops
255
249
  contentType,
256
- // handlePostTurnkeyFlow - removed because it changes when signers/partnerId/etc change, triggering infinite loops
250
+ handlePostTurnkeyFlow,
257
251
  ]);
258
252
  debug("render", {
259
253
  step,
@@ -268,7 +262,9 @@ function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySuccess, onE
268
262
  if (closeAfterLogin && sessionKeyAdded) {
269
263
  setB3ModalOpen(false);
270
264
  }
271
- }, [closeAfterLogin, sessionKeyAdded, setB3ModalOpen]);
265
+ // setB3ModalOpen is stable
266
+ // eslint-disable-next-line react-hooks/exhaustive-deps
267
+ }, [closeAfterLogin, sessionKeyAdded]);
272
268
  const onSessionKeySuccessEnhanced = (0, react_2.useCallback)(() => {
273
269
  onSessionKeySuccess?.();
274
270
  setB3ModalContentType({
@@ -174,7 +174,7 @@ export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, p
174
174
  };
175
175
  // Chain selection view
176
176
  if (step === "select-chain") {
177
- return (_jsxs("div", { className: cn("anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: [onClose && (_jsx("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), !isBalanceLoading && totalBalance > 0 && (_jsxs("div", { className: "anyspend-deposit-balance border-secondary border-b p-5", children: [_jsx("p", { className: "anyspend-deposit-balance-label text-as-secondary text-sm", children: "Your Balance" }), _jsxs("p", { className: "anyspend-deposit-balance-value text-as-primary text-3xl font-semibold", children: [formatDecimal(totalBalance), " ", _jsx("span", { className: "text-sm", children: "USD" })] })] })), _jsxs("div", { className: "anyspend-deposit-options flex flex-col gap-2 p-6", children: [isBalanceLoading && (_jsx("div", { className: "anyspend-deposit-chains-skeleton flex flex-col gap-2", children: [1, 2].map((_, i) => (_jsxs("div", { className: "border-border-primary flex items-center justify-between rounded-xl border p-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Skeleton, { className: "h-6 w-6 rounded-full" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-3 w-20" })] })] }), _jsx(Skeleton, { className: "h-5 w-5" })] }, i))) })), topChainsWithBalance.length > 0 && (_jsx("div", { className: "anyspend-deposit-chains flex flex-col gap-2", children: topChainsWithBalance.map(chain => (_jsxs("button", { onClick: () => handleSelectChain(chain.id), className: "anyspend-deposit-chain-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [_jsx("div", { className: "anyspend-deposit-chain-content", children: _jsxs("div", { className: "anyspend-deposit-chain-info", children: [_jsxs("span", { className: "anyspend-deposit-chain-name text-as-primary flex items-center gap-1.5 font-medium", children: ["Deposit from ", chain.name, _jsx(ChainIcon, { chainId: chain.id, className: "h-5 w-5" })] }), _jsxs("p", { className: "anyspend-deposit-chain-balance text-as-secondary text-xs", children: [formatUsd(chain.balance), " available"] })] }) }), _jsx(ChevronRight, { className: "anyspend-deposit-chain-chevron text-as-secondary h-5 w-5" })] }, chain.id))) })), _jsxs("div", { className: "anyspend-deposit-general-options flex flex-col gap-2", children: [_jsxs("button", { onClick: handleSelectCrypto, className: "anyspend-deposit-option-button anyspend-deposit-crypto-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [_jsx("div", { className: "anyspend-deposit-option-content", children: _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit Crypto" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Swap from any token on any chain" })] }) }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), _jsxs("div", { className: "anyspend-deposit-divider flex items-center gap-3", children: [_jsx("div", { className: "bg-as-stroke h-px flex-1" }), _jsx("span", { className: "anyspend-deposit-divider-text text-as-secondary text-sm", children: "More options" }), _jsx("div", { className: "bg-as-stroke h-px flex-1" })] }), _jsxs("button", { onClick: handleSelectQrDeposit, className: "anyspend-deposit-option-button anyspend-deposit-qr-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [_jsxs("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [_jsx(QrCodeIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit with QR Code" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Send tokens directly to deposit address" })] })] }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), _jsxs("button", { onClick: handleSelectFiat, className: "anyspend-deposit-option-button anyspend-deposit-fiat-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left transition-all", children: [_jsxs("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [_jsx(CreditCardIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Fund with Fiat" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Pay with card or bank transfer" })] })] }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] })] }), _jsx(ChainWarningText, { chainId: destinationChainId, className: "mt-2" })] })] }));
177
+ return (_jsxs("div", { className: cn("anyspend-deposit anyspend-deposit-chain-selection font-inter bg-as-surface-primary relative mx-auto w-full max-w-[460px]", mode === "page" && "border-as-border-secondary overflow-hidden rounded-2xl border shadow-xl"), children: [onClose && (_jsx("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), !isBalanceLoading && totalBalance > 0 && (_jsxs("div", { className: "anyspend-deposit-balance border-theme-border-secondary border-b p-5", children: [_jsx("p", { className: "anyspend-deposit-balance-label text-as-secondary text-sm", children: "Your Balance" }), _jsxs("p", { className: "anyspend-deposit-balance-value text-as-primary text-3xl font-semibold", children: [formatDecimal(totalBalance), " ", _jsx("span", { className: "text-sm", children: "USD" })] })] })), _jsxs("div", { className: "anyspend-deposit-options flex flex-col gap-2 p-6", children: [isBalanceLoading && (_jsx("div", { className: "anyspend-deposit-chains-skeleton flex flex-col gap-2", children: [1, 2].map((_, i) => (_jsxs("div", { className: "border-border-primary flex items-center justify-between rounded-xl border p-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Skeleton, { className: "h-6 w-6 rounded-full" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Skeleton, { className: "h-4 w-32" }), _jsx(Skeleton, { className: "h-3 w-20" })] })] }), _jsx(Skeleton, { className: "h-5 w-5" })] }, i))) })), topChainsWithBalance.length > 0 && (_jsx("div", { className: "anyspend-deposit-chains flex flex-col gap-2", children: topChainsWithBalance.map(chain => (_jsxs("button", { onClick: () => handleSelectChain(chain.id), className: "anyspend-deposit-chain-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [_jsx("div", { className: "anyspend-deposit-chain-content", children: _jsxs("div", { className: "anyspend-deposit-chain-info", children: [_jsxs("span", { className: "anyspend-deposit-chain-name text-as-primary flex items-center gap-1.5 font-medium", children: ["Deposit from ", chain.name, _jsx(ChainIcon, { chainId: chain.id, className: "h-5 w-5" })] }), _jsxs("p", { className: "anyspend-deposit-chain-balance text-as-secondary text-xs", children: [formatUsd(chain.balance), " available"] })] }) }), _jsx(ChevronRight, { className: "anyspend-deposit-chain-chevron text-as-secondary h-5 w-5" })] }, chain.id))) })), _jsxs("div", { className: "anyspend-deposit-general-options flex flex-col gap-2", children: [_jsxs("button", { onClick: handleSelectCrypto, className: "anyspend-deposit-option-button anyspend-deposit-crypto-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [_jsx("div", { className: "anyspend-deposit-option-content", children: _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit Crypto" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Swap from any token on any chain" })] }) }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), _jsxs("div", { className: "anyspend-deposit-divider flex items-center gap-3", children: [_jsx("div", { className: "bg-as-stroke h-px flex-1" }), _jsx("span", { className: "anyspend-deposit-divider-text text-as-secondary text-sm", children: "More options" }), _jsx("div", { className: "bg-as-stroke h-px flex-1" })] }), _jsxs("button", { onClick: handleSelectQrDeposit, className: "anyspend-deposit-option-button anyspend-deposit-qr-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left shadow-sm transition-all", children: [_jsxs("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [_jsx(QrCodeIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Deposit with QR Code" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Send tokens directly to deposit address" })] })] }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] }), _jsxs("button", { onClick: handleSelectFiat, className: "anyspend-deposit-option-button anyspend-deposit-fiat-button border-border-primary hover:border-as-brand hover:bg-as-surface-secondary flex w-full items-center justify-between rounded-xl border p-4 text-left transition-all", children: [_jsxs("div", { className: "anyspend-deposit-option-content flex items-center gap-3", children: [_jsx(CreditCardIcon, { className: "anyspend-deposit-option-icon h-10 w-10" }), _jsxs("div", { className: "anyspend-deposit-option-info", children: [_jsx("span", { className: "anyspend-deposit-option-title text-as-primary font-medium", children: "Fund with Fiat" }), _jsx("p", { className: "anyspend-deposit-option-description text-as-secondary text-xs", children: "Pay with card or bank transfer" })] })] }), _jsx(ChevronRight, { className: "anyspend-deposit-option-chevron text-as-secondary h-5 w-5" })] })] }), _jsx(ChainWarningText, { chainId: destinationChainId, className: "mt-2" })] })] }));
178
178
  }
179
179
  // QR Deposit view
180
180
  if (step === "qr-deposit") {
@@ -183,5 +183,5 @@ export function AnySpendDeposit({ loadOrder, mode = "modal", recipientAddress, p
183
183
  // Check if destination is Hyperliquid
184
184
  const isHyperliquidDeposit = destinationChainId === HYPERLIQUID_CHAIN_ID;
185
185
  // Deposit view
186
- return (_jsxs("div", { className: "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && (_jsxs("button", { onClick: handleBack, className: "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [_jsx("svg", { className: "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), _jsx("span", { className: "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && (_jsx("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isHyperliquidDeposit ? (_jsx(AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationToken.address, destinationTokenChainId: destinationChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true })) : (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig })) }), _jsx(ChainWarningText, { chainId: destinationChainId, className: "px-4 pb-4" })] }));
186
+ return (_jsxs("div", { className: "anyspend-deposit anyspend-deposit-form relative", children: [shouldShowChainSelection && (_jsxs("button", { onClick: handleBack, className: "anyspend-deposit-back-button text-as-secondary hover:text-as-primary absolute left-4 top-4 z-10 flex items-center gap-1", children: [_jsx("svg", { className: "anyspend-deposit-back-icon h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }), _jsx("span", { className: "anyspend-deposit-back-text text-sm", children: "Back" })] })), onClose && (_jsx("button", { onClick: onClose, className: "anyspend-deposit-close-button text-as-secondary hover:text-as-primary absolute right-4 top-4 z-10", children: _jsx("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8"), children: isHyperliquidDeposit ? (_jsx(AnySpend, { loadOrder: loadOrder, mode: mode, defaultActiveTab: paymentType, recipientAddress: recipientAddress, sourceChainId: selectedChainId, destinationTokenAddress: destinationToken.address, destinationTokenChainId: destinationChainId, onSuccess: txHash => onSuccess?.(txHash ?? ""), onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, hideHeader: true, hideBottomNavigation: true, disableUrlParamManagement: true }, selectedChainId)) : (_jsx(AnySpendCustomExactIn, { loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, paymentType: paymentType, sourceTokenAddress: sourceTokenAddress, sourceTokenChainId: selectedChainId, destinationToken: destinationToken, destinationChainId: destinationChainId, orderType: effectiveOrderType, minDestinationAmount: minDestinationAmount, header: header ?? defaultHeader, onSuccess: onSuccess, onOpenCustomModal: onOpenCustomModal, mainFooter: mainFooter, onTokenSelect: onTokenSelect, customUsdInputValues: customUsdInputValues, preferEoa: preferEoa, customExactInConfig: depositContractConfig }, selectedChainId)) }), _jsx(ChainWarningText, { chainId: destinationChainId, className: "px-4 pb-4" })] }));
187
187
  }
@@ -6,6 +6,7 @@ import { shortenAddress } from "../../../../shared/utils/formatAddress.js";
6
6
  import { client } from "../../../../shared/utils/thirdweb.js";
7
7
  import { ChevronLeft, ChevronRightCircle, Wallet, X, ZapIcon } from "lucide-react";
8
8
  import { useConnectModal, useDisconnect, useWalletInfo } from "thirdweb/react";
9
+ import { createWallet } from "thirdweb/wallets";
9
10
  import { useConnectedWalletDisplay } from "../../hooks/useConnectedWalletDisplay.js";
10
11
  export var CryptoPaymentMethodType;
11
12
  (function (CryptoPaymentMethodType) {
@@ -14,6 +15,12 @@ export var CryptoPaymentMethodType;
14
15
  CryptoPaymentMethodType["GLOBAL_WALLET"] = "global_wallet";
15
16
  CryptoPaymentMethodType["TRANSFER_CRYPTO"] = "transfer_crypto";
16
17
  })(CryptoPaymentMethodType || (CryptoPaymentMethodType = {}));
18
+ const recommendWallets = [
19
+ createWallet("io.metamask"),
20
+ createWallet("com.coinbase.wallet"),
21
+ createWallet("me.rainbow"),
22
+ createWallet("io.rabby"),
23
+ ];
17
24
  export function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentMethod, isCreatingOrder, onBack, onSelectPaymentMethod, }) {
18
25
  const { connectedEOAWallet, connectedSmartWallet } = useAccountWallet();
19
26
  const { disconnect } = useDisconnect();
@@ -29,7 +36,13 @@ export function CryptoPaymentMethod({ selectedPaymentMethod, setSelectedPaymentM
29
36
  if (connectedEOAWallet) {
30
37
  await disconnect(connectedEOAWallet);
31
38
  }
32
- const wallet = await openConnectModal({ client, setActive: false });
39
+ const wallet = await openConnectModal({
40
+ client,
41
+ setActive: false,
42
+ size: "compact",
43
+ showThirdwebBranding: false,
44
+ wallets: recommendWallets,
45
+ });
33
46
  if (wallet) {
34
47
  // setActiveWallet(wallet);
35
48
  setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
@@ -401,7 +401,7 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
401
401
  ? "Funding Tournament"
402
402
  : "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
403
403
  ? `Waiting for payment`
404
- : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), depositTxs?.length > 0 && !depositEnoughAmount && order.status === "scanning_deposit_transaction" && (_jsx(InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment }))] }));
404
+ : `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), depositTxs?.length > 0 && !depositEnoughAmount && order.status === "scanning_deposit_transaction" && (_jsx(InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment })), _jsxs("button", { className: "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [_jsx(RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
405
405
  }
406
406
  return (_jsxs(_Fragment, { children: [_jsx(OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), statusDisplay === "processing" && (_jsx(_Fragment, { children: order.onrampMetadata ? (_jsx(PaymentVendorUI, { order: order, dstTokenSymbol: dstToken.symbol })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ||
407
407
  effectiveCryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET ? (_jsx(ConnectWalletPayment, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft, cryptoPaymentMethod: effectiveCryptoPaymentMethod, onPaymentMethodChange: onPaymentMethodChange })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Loading, useAuthentication, useAuthStore, useB3Config, useGetAllTWSigners, useModalStore, } from "../../../../global-account/react/index.js";
3
3
  import { debugB3React } from "../../../../shared/utils/debug.js";
4
- import { useCallback, useEffect, useRef, useState } from "react";
4
+ import { useCallback, useEffect, useState } from "react";
5
5
  import { useActiveAccount } from "thirdweb/react";
6
6
  import { TurnkeyAuthModal } from "../TurnkeyAuthModal.js";
7
7
  import { SignInWithB3Privy } from "./SignInWithB3Privy.js";
@@ -29,7 +29,6 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
29
29
  const [refetchCount, setRefetchCount] = useState(0);
30
30
  const [refetchError, setRefetchError] = useState(null);
31
31
  const [turnkeyAuthCompleted, setTurnkeyAuthCompleted] = useState(false);
32
- const justCompletedLoginRef = useRef(false);
33
32
  const { data: signers, refetch: refetchSigners, isFetching: isFetchingSigners, } = useGetAllTWSigners({
34
33
  chain,
35
34
  accountAddress: account?.address,
@@ -149,12 +148,8 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
149
148
  signersEnabled,
150
149
  });
151
150
  // The useEffect will re-run with updated user data to complete the sign-in process
152
- },
153
- // Zustand setters are stable and don't need to be in dependencies:
154
- // eslint-disable-next-line react-hooks/exhaustive-deps
155
- [
151
+ }, [
156
152
  refetchUser,
157
- setB3ModalContentType,
158
153
  strategies,
159
154
  onLoginSuccess,
160
155
  onSessionKeySuccess,
@@ -165,8 +160,10 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
165
160
  closeAfterLogin,
166
161
  source,
167
162
  signersEnabled,
168
- // Zustand setters are stable and don't need to be in dependencies:
169
- // setIsAuthenticated, setIsConnected, setJustCompletedLogin
163
+ setB3ModalContentType,
164
+ setIsAuthenticated,
165
+ setIsConnected,
166
+ setJustCompletedLogin,
170
167
  ]);
171
168
  // Handle post-login flow after signers are loaded
172
169
  useEffect(() => {
@@ -181,9 +178,7 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
181
178
  if (isConnected && isAuthenticated && user) {
182
179
  // Mark that login just completed BEFORE opening manage account or closing modal
183
180
  // This allows Turnkey modal to show (if enableTurnkey is true)
184
- // Use ref to prevent setting this multiple times and causing infinite loops
185
- if (closeAfterLogin && !justCompletedLoginRef.current) {
186
- justCompletedLoginRef.current = true;
181
+ if (closeAfterLogin) {
187
182
  setJustCompletedLogin(true);
188
183
  }
189
184
  // Check if we should show Turnkey login form as SECONDARY option (after wallet connection)
@@ -227,7 +222,6 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
227
222
  handlePostTurnkeyFlow();
228
223
  }
229
224
  },
230
- // handlePostTurnkeyFlow changes when its dependencies change, causing infinite loops
231
225
  // eslint-disable-next-line react-hooks/exhaustive-deps
232
226
  [
233
227
  signers,
@@ -248,9 +242,9 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
248
242
  user,
249
243
  enableTurnkey,
250
244
  turnkeyAuthCompleted,
251
- handleTurnkeySuccess,
245
+ // handleTurnkeySuccess, // This is causing infinite loops
252
246
  contentType,
253
- // handlePostTurnkeyFlow - removed because it changes when signers/partnerId/etc change, triggering infinite loops
247
+ handlePostTurnkeyFlow,
254
248
  ]);
255
249
  debug("render", {
256
250
  step,
@@ -265,7 +259,9 @@ export function SignInWithB3Flow({ strategies, onLoginSuccess, onSessionKeySucce
265
259
  if (closeAfterLogin && sessionKeyAdded) {
266
260
  setB3ModalOpen(false);
267
261
  }
268
- }, [closeAfterLogin, sessionKeyAdded, setB3ModalOpen]);
262
+ // setB3ModalOpen is stable
263
+ // eslint-disable-next-line react-hooks/exhaustive-deps
264
+ }, [closeAfterLogin, sessionKeyAdded]);
269
265
  const onSessionKeySuccessEnhanced = useCallback(() => {
270
266
  onSessionKeySuccess?.();
271
267
  setB3ModalContentType({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.88-alpha.3",
3
+ "version": "0.0.88-alpha.5",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -356,7 +356,7 @@ export function AnySpendDeposit({
356
356
  )}
357
357
  {/* Balance header */}
358
358
  {!isBalanceLoading && totalBalance > 0 && (
359
- <div className="anyspend-deposit-balance border-secondary border-b p-5">
359
+ <div className="anyspend-deposit-balance border-theme-border-secondary border-b p-5">
360
360
  <p className="anyspend-deposit-balance-label text-as-secondary text-sm">Your Balance</p>
361
361
  <p className="anyspend-deposit-balance-value text-as-primary text-3xl font-semibold">
362
362
  {formatDecimal(totalBalance)} <span className="text-sm">USD</span>
@@ -525,6 +525,7 @@ export function AnySpendDeposit({
525
525
  <div className={cn("anyspend-deposit-form-content", shouldShowChainSelection && "pt-8")}>
526
526
  {isHyperliquidDeposit ? (
527
527
  <AnySpend
528
+ key={selectedChainId}
528
529
  loadOrder={loadOrder}
529
530
  mode={mode}
530
531
  defaultActiveTab={paymentType}
@@ -541,6 +542,7 @@ export function AnySpendDeposit({
541
542
  />
542
543
  ) : (
543
544
  <AnySpendCustomExactIn
545
+ key={selectedChainId}
544
546
  loadOrder={loadOrder}
545
547
  mode={mode}
546
548
  recipientAddress={recipientAddress}
@@ -6,6 +6,7 @@ import { shortenAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
6
6
  import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
7
7
  import { ChevronLeft, ChevronRightCircle, Wallet, X, ZapIcon } from "lucide-react";
8
8
  import { useConnectModal, useDisconnect, useWalletInfo } from "thirdweb/react";
9
+ import { createWallet } from "thirdweb/wallets";
9
10
  import { useConnectedWalletDisplay } from "../../hooks/useConnectedWalletDisplay";
10
11
 
11
12
  export enum CryptoPaymentMethodType {
@@ -15,6 +16,13 @@ export enum CryptoPaymentMethodType {
15
16
  TRANSFER_CRYPTO = "transfer_crypto",
16
17
  }
17
18
 
19
+ const recommendWallets = [
20
+ createWallet("io.metamask"),
21
+ createWallet("com.coinbase.wallet"),
22
+ createWallet("me.rainbow"),
23
+ createWallet("io.rabby"),
24
+ ];
25
+
18
26
  interface CryptoPaymentMethodProps {
19
27
  selectedPaymentMethod: CryptoPaymentMethodType;
20
28
  setSelectedPaymentMethod: (method: CryptoPaymentMethodType) => void;
@@ -47,7 +55,13 @@ export function CryptoPaymentMethod({
47
55
  if (connectedEOAWallet) {
48
56
  await disconnect(connectedEOAWallet);
49
57
  }
50
- const wallet = await openConnectModal({ client, setActive: false });
58
+ const wallet = await openConnectModal({
59
+ client,
60
+ setActive: false,
61
+ size: "compact",
62
+ showThirdwebBranding: false,
63
+ wallets: recommendWallets,
64
+ });
51
65
  if (wallet) {
52
66
  // setActiveWallet(wallet);
53
67
  setSelectedPaymentMethod(CryptoPaymentMethodType.CONNECT_WALLET);
@@ -905,6 +905,12 @@ export const OrderDetails = memo(function OrderDetails({
905
905
  )}
906
906
 
907
907
  {/* <DelayedSupportMessage /> */}
908
+ <button
909
+ className="text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline"
910
+ onClick={handleBack}
911
+ >
912
+ <RefreshCcw className="ml-2 h-4 w-4" /> Cancel and start over
913
+ </button>
908
914
  </>
909
915
  );
910
916
  }
@@ -8,7 +8,7 @@ import {
8
8
  useModalStore,
9
9
  } from "@b3dotfun/sdk/global-account/react";
10
10
  import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
11
- import { useCallback, useEffect, useRef, useState } from "react";
11
+ import { useCallback, useEffect, useState } from "react";
12
12
  import { useActiveAccount } from "thirdweb/react";
13
13
  import { Account } from "thirdweb/wallets";
14
14
  import { TurnkeyAuthModal } from "../TurnkeyAuthModal";
@@ -51,7 +51,6 @@ export function SignInWithB3Flow({
51
51
  const [refetchCount, setRefetchCount] = useState(0);
52
52
  const [refetchError, setRefetchError] = useState<string | null>(null);
53
53
  const [turnkeyAuthCompleted, setTurnkeyAuthCompleted] = useState(false);
54
- const justCompletedLoginRef = useRef(false);
55
54
  const {
56
55
  data: signers,
57
56
  refetch: refetchSigners,
@@ -185,11 +184,8 @@ export function SignInWithB3Flow({
185
184
  });
186
185
  // The useEffect will re-run with updated user data to complete the sign-in process
187
186
  },
188
- // Zustand setters are stable and don't need to be in dependencies:
189
- // eslint-disable-next-line react-hooks/exhaustive-deps
190
187
  [
191
188
  refetchUser,
192
- setB3ModalContentType,
193
189
  strategies,
194
190
  onLoginSuccess,
195
191
  onSessionKeySuccess,
@@ -200,8 +196,10 @@ export function SignInWithB3Flow({
200
196
  closeAfterLogin,
201
197
  source,
202
198
  signersEnabled,
203
- // Zustand setters are stable and don't need to be in dependencies:
204
- // setIsAuthenticated, setIsConnected, setJustCompletedLogin
199
+ setB3ModalContentType,
200
+ setIsAuthenticated,
201
+ setIsConnected,
202
+ setJustCompletedLogin,
205
203
  ],
206
204
  );
207
205
 
@@ -220,9 +218,7 @@ export function SignInWithB3Flow({
220
218
  if (isConnected && isAuthenticated && user) {
221
219
  // Mark that login just completed BEFORE opening manage account or closing modal
222
220
  // This allows Turnkey modal to show (if enableTurnkey is true)
223
- // Use ref to prevent setting this multiple times and causing infinite loops
224
- if (closeAfterLogin && !justCompletedLoginRef.current) {
225
- justCompletedLoginRef.current = true;
221
+ if (closeAfterLogin) {
226
222
  setJustCompletedLogin(true);
227
223
  }
228
224
 
@@ -271,7 +267,6 @@ export function SignInWithB3Flow({
271
267
  handlePostTurnkeyFlow();
272
268
  }
273
269
  },
274
- // handlePostTurnkeyFlow changes when its dependencies change, causing infinite loops
275
270
  // eslint-disable-next-line react-hooks/exhaustive-deps
276
271
  [
277
272
  signers,
@@ -292,9 +287,9 @@ export function SignInWithB3Flow({
292
287
  user,
293
288
  enableTurnkey,
294
289
  turnkeyAuthCompleted,
295
- handleTurnkeySuccess,
290
+ // handleTurnkeySuccess, // This is causing infinite loops
296
291
  contentType,
297
- // handlePostTurnkeyFlow - removed because it changes when signers/partnerId/etc change, triggering infinite loops
292
+ handlePostTurnkeyFlow,
298
293
  ],
299
294
  );
300
295
 
@@ -312,7 +307,9 @@ export function SignInWithB3Flow({
312
307
  if (closeAfterLogin && sessionKeyAdded) {
313
308
  setB3ModalOpen(false);
314
309
  }
315
- }, [closeAfterLogin, sessionKeyAdded, setB3ModalOpen]);
310
+ // setB3ModalOpen is stable
311
+ // eslint-disable-next-line react-hooks/exhaustive-deps
312
+ }, [closeAfterLogin, sessionKeyAdded]);
316
313
 
317
314
  const onSessionKeySuccessEnhanced = useCallback(() => {
318
315
  onSessionKeySuccess?.();