@b3dotfun/sdk 0.1.70-alpha.18 → 0.1.70-alpha.19

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 (155) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/anyspend/constants/rpc.d.ts +1 -0
  3. package/dist/cjs/anyspend/constants/rpc.js +3 -1
  4. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +1 -3
  5. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +14 -12
  6. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +32 -13
  7. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +32 -10
  8. package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +16 -8
  9. package/dist/cjs/anyspend/react/components/common/TokenBalance.js +4 -5
  10. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
  11. package/dist/cjs/anyspend/utils/chain.d.ts +45 -0
  12. package/dist/cjs/anyspend/utils/chain.js +51 -2
  13. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
  14. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +2 -2
  15. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  16. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +4 -5
  17. package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.js +23 -15
  18. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +2 -2
  19. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +8 -6
  20. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +17 -8
  21. package/dist/cjs/global-account/react/components/Send/Send.js +15 -11
  22. package/dist/cjs/global-account/react/hooks/index.d.ts +2 -2
  23. package/dist/cjs/global-account/react/hooks/index.js +7 -8
  24. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +2 -1
  25. package/dist/cjs/global-account/react/hooks/useAuth.js +1 -0
  26. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +2 -1
  27. package/dist/cjs/global-account/react/hooks/useAuthentication.js +1 -0
  28. package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  29. package/dist/cjs/global-account/react/hooks/useFirstEOA.js +1 -0
  30. package/dist/cjs/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  31. package/dist/cjs/global-account/react/hooks/usePortfolioBalance.js +76 -0
  32. package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  33. package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.js +178 -0
  34. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -2
  35. package/dist/cjs/global-account/react/utils/createWagmiConfig.d.ts +2 -2
  36. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +24 -0
  37. package/dist/cjs/shared/constants/chains/supported.d.ts +4 -4
  38. package/dist/cjs/shared/constants/index.d.ts +4 -0
  39. package/dist/cjs/shared/utils/zerionPositions.d.ts +96 -0
  40. package/dist/cjs/shared/utils/zerionPositions.js +186 -0
  41. package/dist/cjs/wallet/utils/createWalletConfig.d.ts +2 -2
  42. package/dist/esm/anyspend/constants/rpc.d.ts +1 -0
  43. package/dist/esm/anyspend/constants/rpc.js +2 -0
  44. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +1 -3
  45. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +15 -13
  46. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +33 -14
  47. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +33 -11
  48. package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +18 -10
  49. package/dist/esm/anyspend/react/components/common/TokenBalance.js +6 -7
  50. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
  51. package/dist/esm/anyspend/utils/chain.d.ts +45 -0
  52. package/dist/esm/anyspend/utils/chain.js +50 -3
  53. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
  54. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +2 -2
  55. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  56. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +4 -5
  57. package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.js +24 -16
  58. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +3 -3
  59. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +9 -7
  60. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +18 -9
  61. package/dist/esm/global-account/react/components/Send/Send.js +16 -12
  62. package/dist/esm/global-account/react/hooks/index.d.ts +2 -2
  63. package/dist/esm/global-account/react/hooks/index.js +2 -2
  64. package/dist/esm/global-account/react/hooks/useAuth.d.ts +2 -1
  65. package/dist/esm/global-account/react/hooks/useAuth.js +1 -0
  66. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +2 -1
  67. package/dist/esm/global-account/react/hooks/useAuthentication.js +1 -0
  68. package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  69. package/dist/esm/global-account/react/hooks/useFirstEOA.js +1 -0
  70. package/dist/esm/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  71. package/dist/esm/global-account/react/hooks/usePortfolioBalance.js +72 -0
  72. package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  73. package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.js +175 -0
  74. package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -2
  75. package/dist/esm/global-account/react/utils/createWagmiConfig.d.ts +2 -2
  76. package/dist/esm/shared/constants/chains/b3Chain.d.ts +24 -0
  77. package/dist/esm/shared/constants/chains/supported.d.ts +4 -4
  78. package/dist/esm/shared/constants/index.d.ts +4 -0
  79. package/dist/esm/shared/utils/zerionPositions.d.ts +96 -0
  80. package/dist/esm/shared/utils/zerionPositions.js +178 -0
  81. package/dist/esm/wallet/utils/createWalletConfig.d.ts +2 -2
  82. package/dist/types/anyspend/constants/rpc.d.ts +1 -0
  83. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +1 -3
  84. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
  85. package/dist/types/anyspend/utils/chain.d.ts +45 -0
  86. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -2
  87. package/dist/types/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  88. package/dist/types/global-account/react/hooks/index.d.ts +2 -2
  89. package/dist/types/global-account/react/hooks/useAuth.d.ts +2 -1
  90. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +2 -1
  91. package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  92. package/dist/types/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  93. package/dist/types/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  94. package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -2
  95. package/dist/types/global-account/react/utils/createWagmiConfig.d.ts +2 -2
  96. package/dist/types/shared/constants/chains/b3Chain.d.ts +24 -0
  97. package/dist/types/shared/constants/chains/supported.d.ts +4 -4
  98. package/dist/types/shared/constants/index.d.ts +4 -0
  99. package/dist/types/shared/utils/zerionPositions.d.ts +96 -0
  100. package/dist/types/wallet/utils/createWalletConfig.d.ts +2 -2
  101. package/node_modules/@b3/chain-registry/chains.json +29 -1
  102. package/node_modules/@b3/chain-registry/package.json +18 -2
  103. package/package.json +2 -2
  104. package/src/anyspend/README.md +2 -2
  105. package/src/anyspend/constants/rpc.ts +2 -0
  106. package/src/anyspend/docs/components.md +6 -6
  107. package/src/anyspend/docs/contributing.md +1 -1
  108. package/src/anyspend/docs/hooks.md +3 -3
  109. package/src/anyspend/docs/installation.md +2 -2
  110. package/src/anyspend/react/components/AnySpendDeposit.tsx +26 -19
  111. package/src/anyspend/react/components/AnySpendStakeB3.tsx +55 -14
  112. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +55 -11
  113. package/src/anyspend/react/components/__tests__/QRDeposit.test.tsx +3 -4
  114. package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +25 -12
  115. package/src/anyspend/react/components/common/TokenBalance.tsx +10 -7
  116. package/src/anyspend/utils/__tests__/deprecatedChains.test.ts +44 -0
  117. package/src/anyspend/utils/__tests__/toRegistryChainId.test.ts +17 -0
  118. package/src/anyspend/utils/chain.ts +53 -2
  119. package/src/global-account/react/components/B3Provider/B3Provider.tsx +1 -3
  120. package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +4 -11
  121. package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +50 -21
  122. package/src/global-account/react/components/ManageAccount/NFTContent.tsx +5 -3
  123. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +10 -6
  124. package/src/global-account/react/components/ManageAccount/TokenContent.tsx +22 -9
  125. package/src/global-account/react/components/Send/Send.tsx +39 -15
  126. package/src/global-account/react/hooks/index.ts +2 -2
  127. package/src/global-account/react/hooks/useAuth.ts +3 -2
  128. package/src/global-account/react/hooks/useAuthentication.ts +3 -2
  129. package/src/global-account/react/hooks/useFirstEOA.tsx +9 -2
  130. package/src/global-account/react/hooks/usePortfolioBalance.ts +89 -0
  131. package/src/global-account/react/hooks/usePortfolioCollectibles.ts +212 -0
  132. package/src/global-account/react/stores/useModalStore.ts +0 -2
  133. package/src/shared/constants/index.ts +8 -0
  134. package/src/shared/utils/__tests__/zerionPositions.test.ts +226 -0
  135. package/src/shared/utils/zerionPositions.ts +244 -0
  136. package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +0 -59
  137. package/dist/cjs/global-account/react/hooks/useSimBalance.js +0 -98
  138. package/dist/cjs/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  139. package/dist/cjs/global-account/react/hooks/useSimCollectibles.js +0 -190
  140. package/dist/cjs/global-account/react/utils/simdune.d.ts +0 -7
  141. package/dist/cjs/global-account/react/utils/simdune.js +0 -21
  142. package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +0 -59
  143. package/dist/esm/global-account/react/hooks/useSimBalance.js +0 -93
  144. package/dist/esm/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  145. package/dist/esm/global-account/react/hooks/useSimCollectibles.js +0 -187
  146. package/dist/esm/global-account/react/utils/simdune.d.ts +0 -7
  147. package/dist/esm/global-account/react/utils/simdune.js +0 -17
  148. package/dist/types/global-account/react/hooks/useSimBalance.d.ts +0 -59
  149. package/dist/types/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  150. package/dist/types/global-account/react/utils/simdune.d.ts +0 -7
  151. package/node_modules/@b3/chain-registry/src/index.ts +0 -169
  152. package/node_modules/@b3/chain-registry/tsconfig.json +0 -16
  153. package/src/global-account/react/hooks/useSimBalance.ts +0 -164
  154. package/src/global-account/react/hooks/useSimCollectibles.ts +0 -238
  155. package/src/global-account/react/utils/simdune.ts +0 -20
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ALL_CHAINS = exports.HYPERLIQUID_CHAINS = exports.SOLANA_CHAINS = exports.EVM_CHAINS = exports.HYPERLIQUID_MAINNET = exports.SOLANA_MAINNET = exports.EVM_TESTNET = exports.EVM_MAINNET = exports.plume = exports.hyperEVM = void 0;
6
+ exports.DEPRECATED_CHAIN_IDS = exports.ALL_CHAINS = exports.HYPERLIQUID_CHAINS = exports.SOLANA_CHAINS = exports.EVM_CHAINS = exports.HYPERLIQUID_MAINNET = exports.SOLANA_MAINNET = exports.EVM_TESTNET = exports.EVM_MAINNET = exports.plume = exports.hyperEVM = void 0;
7
7
  exports.setChainRpcOverrides = setChainRpcOverrides;
8
8
  exports.getChainRpcOverrides = getChainRpcOverrides;
9
9
  exports.clearChainRpcOverrides = clearChainRpcOverrides;
10
+ exports.toRegistryChainId = toRegistryChainId;
10
11
  exports.getSolanaChains = getSolanaChains;
11
12
  exports.getAllEvmChains = getAllEvmChains;
12
13
  exports.getChainType = getChainType;
@@ -27,8 +28,10 @@ exports.getNativeToken = getNativeToken;
27
28
  exports.isEvmChain = isEvmChain;
28
29
  exports.isHyperliquidChain = isHyperliquidChain;
29
30
  exports.getHyperliquidChain = getHyperliquidChain;
31
+ exports.isDeprecatedChain = isDeprecatedChain;
30
32
  exports.getAvailableChainIds = getAvailableChainIds;
31
33
  const constants_1 = require("../../anyspend/constants");
34
+ const zerionPositions_1 = require("../../shared/utils/zerionPositions");
32
35
  const rpc_1 = require("../../anyspend/constants/rpc");
33
36
  const b3Viem_1 = require("../../shared/constants/chains/b3Viem");
34
37
  const invariant_1 = __importDefault(require("invariant"));
@@ -258,6 +261,20 @@ exports.EVM_MAINNET = {
258
261
  coingeckoName: "plume-network",
259
262
  wethAddress: "0xea237441c92cae6fc17caaf9a7acb3f953be4bd1", // WPLUME (wrapped native)
260
263
  },
264
+ [chains_1.robinhood.id]: {
265
+ id: chains_1.robinhood.id,
266
+ name: chains_1.robinhood.name,
267
+ logoUrl: "https://assets.relay.link/icons/square/4663/light.png",
268
+ type: chain_1.ChainType.EVM,
269
+ nativeRequired: (0, viem_1.parseEther)("0.0001"),
270
+ canDepositNative: true,
271
+ defaultToken: (0, token_1.getEthToken)(chains_1.robinhood.id),
272
+ nativeToken: (0, token_1.getEthToken)(chains_1.robinhood.id),
273
+ viem: getCustomEvmChain(chains_1.robinhood, rpc_1.ROBINHOOD_PUBLIC_RPC),
274
+ pollingInterval: 1000, // 1 second for Robinhood Chain (Arbitrum Orbit fast blocks)
275
+ coingeckoName: "robinhood",
276
+ wethAddress: "0x0bd7d308f8e1639fab988df18a8011f41eacad73", // wrapped native ETH (registry wrappedNative)
277
+ },
261
278
  };
262
279
  exports.EVM_TESTNET = {
263
280
  // [sepolia.id]: {
@@ -336,6 +353,16 @@ exports.HYPERLIQUID_MAINNET = {
336
353
  };
337
354
  exports.EVM_CHAINS = { ...exports.EVM_MAINNET, ...exports.EVM_TESTNET };
338
355
  exports.SOLANA_CHAINS = { [constants_1.RELAY_SOLANA_MAINNET_CHAIN_ID]: exports.SOLANA_MAINNET };
356
+ /**
357
+ * Translate a Relay-numbered chain id into the id the chain registry uses.
358
+ *
359
+ * Relay numbers Solana 792703809; every other chain shares the universal EVM id. Balance rows are
360
+ * keyed by the registry's id, so handing Relay's number to a balance lookup matches nothing at all
361
+ * — and a funded Solana wallet then reads as empty rather than as unreadable.
362
+ */
363
+ function toRegistryChainId(chainId) {
364
+ return chainId === constants_1.RELAY_SOLANA_MAINNET_CHAIN_ID ? zerionPositions_1.SOLANA_CHAIN_ID : chainId;
365
+ }
339
366
  exports.HYPERLIQUID_CHAINS = {
340
367
  [token_1.HYPERLIQUID_CHAIN_ID]: exports.HYPERLIQUID_MAINNET,
341
368
  };
@@ -612,6 +639,24 @@ function getHyperliquidChain(chainId) {
612
639
  (0, invariant_1.default)(exports.HYPERLIQUID_CHAINS[chainId], `Chain ${chainId} is not a Hyperliquid chain`);
613
640
  return exports.HYPERLIQUID_CHAINS[chainId];
614
641
  }
642
+ /**
643
+ * Chains AnySpend no longer accepts orders on, as either source or destination.
644
+ *
645
+ * They stay in ALL_CHAINS on purpose. That map answers "what is this chain" — name, logo, token,
646
+ * decimals — which every order that ever existed still needs in order to render; removing an entry
647
+ * would make getChainName and friends throw on historical rows. Whether new orders are accepted is
648
+ * this separate question.
649
+ *
650
+ * anyspend-service imports this list rather than keeping its own, so the API and the chain picker
651
+ * can never disagree about what is on offer.
652
+ */
653
+ exports.DEPRECATED_CHAIN_IDS = [
654
+ 8333, // B3
655
+ 98866, // Plume
656
+ ];
657
+ function isDeprecatedChain(chainId) {
658
+ return chainId !== undefined && exports.DEPRECATED_CHAIN_IDS.includes(chainId);
659
+ }
615
660
  /**
616
661
  * Get available chain IDs for AnySpend based on context (source or destination).
617
662
  * Filters out chains that shouldn't be available for the given context.
@@ -627,7 +672,11 @@ function getHyperliquidChain(chainId) {
627
672
  * const destChains = getAvailableChainIds("to") // [1, 8453, 137, ..., 1337]
628
673
  */
629
674
  function getAvailableChainIds(context) {
630
- const allChainIds = Object.values(exports.ALL_CHAINS).map(chain => chain.id);
675
+ // Deprecated chains are excluded from both directions: the API rejects them, so offering them in
676
+ // a picker would let a user select something that then fails at order creation.
677
+ const allChainIds = Object.values(exports.ALL_CHAINS)
678
+ .map(chain => chain.id)
679
+ .filter(chainId => !isDeprecatedChain(chainId));
631
680
  if (context === "from") {
632
681
  // Hyperliquid is only supported as destination chain, not source chain
633
682
  return allChainIds.filter(chainId => chainId !== token_1.HYPERLIQUID_CHAIN_ID);
@@ -10,7 +10,7 @@ import { ClientType } from "../../../client-manager";
10
10
  /**
11
11
  * Main B3Provider component
12
12
  */
13
- export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider, simDuneApiKey, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication, queryClient, authStrategy, apiUrl, notificationsApiUrl, }: {
13
+ export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication, queryClient, authStrategy, apiUrl, notificationsApiUrl, }: {
14
14
  theme: "light" | "dark";
15
15
  children: React.ReactNode;
16
16
  accountOverride?: Account;
@@ -18,7 +18,6 @@ export declare function B3Provider({ theme, children, accountOverride, environme
18
18
  automaticallySetFirstEoa?: boolean;
19
19
  /** EIP-1193 provider to auto-connect as the default EOA wallet (e.g., Farcaster frame wallet) */
20
20
  defaultEoaProvider?: EIP1193.EIP1193Provider;
21
- simDuneApiKey?: string;
22
21
  toaster?: {
23
22
  position?: "top-center" | "top-right" | "bottom-center" | "bottom-right";
24
23
  style?: React.CSSProperties;
@@ -28,7 +28,7 @@ const NOTIFICATIONS_URL_BY_ENV = {
28
28
  /**
29
29
  * Main B3Provider component
30
30
  */
31
- function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider, simDuneApiKey,
31
+ function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, defaultEoaProvider,
32
32
  // deprecated since v0.0.87
33
33
  toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors = false, createClientReferenceId, defaultPermissions, disableBSMNTAuthentication = false, queryClient, authStrategy = "thirdweb", apiUrl, notificationsApiUrl, }) {
34
34
  // Override the B3 API URL when the `apiUrl` prop is provided.
@@ -55,7 +55,7 @@ toaster: _toaster, clientType = "rest", rpcUrls, partnerId, stripePublishableKey
55
55
  (0, client_manager_1.setClientType)(clientType);
56
56
  }, [clientType]);
57
57
  const wagmiConfig = (0, react_3.useMemo)(() => (0, createWagmiConfig_1.createWagmiConfig)({ partnerId, rpcUrls, connectors, overrideDefaultConnectors }), [partnerId, rpcUrls, connectors, overrideDefaultConnectors]);
58
- return ((0, jsx_runtime_1.jsx)(react_2.WalletProvider, { wagmiConfig: wagmiConfig, queryClient: queryClient, children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(index_1.ToastProvider, { children: (0, jsx_runtime_1.jsx)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, onLogoutCallback: onLogout, disableBSMNTAuthentication: disableBSMNTAuthentication, children: (0, jsx_runtime_1.jsxs)(B3ConfigProvider_1.B3ConfigProvider, { accountOverride: accountOverride, environment: environment, automaticallySetFirstEoa: !!automaticallySetFirstEoa, theme: theme, clientType: clientType, partnerId: partnerId, stripePublishableKey: stripePublishableKey, createClientReferenceId: createClientReferenceId, defaultPermissions: defaultPermissions, authStrategy: authStrategy, children: [(0, jsx_runtime_1.jsx)(ToastContextConnector, {}), (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { simDuneApiKey: simDuneApiKey, children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" })] }), authStrategy === "better-auth" ? ((0, jsx_runtime_1.jsx)(BetterAuthProvider_1.default, { partnerId: partnerId })) : ((0, jsx_runtime_1.jsx)(AuthenticationProvider_1.default, { partnerId: partnerId, automaticallySetFirstEoa: !!automaticallySetFirstEoa, defaultEoaProvider: defaultEoaProvider }))] }) }) }) }) }));
58
+ return ((0, jsx_runtime_1.jsx)(react_2.WalletProvider, { wagmiConfig: wagmiConfig, queryClient: queryClient, children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(index_1.ToastProvider, { children: (0, jsx_runtime_1.jsx)(LocalSDKProvider_1.LocalSDKProvider, { onConnectCallback: onConnect, onLogoutCallback: onLogout, disableBSMNTAuthentication: disableBSMNTAuthentication, children: (0, jsx_runtime_1.jsxs)(B3ConfigProvider_1.B3ConfigProvider, { accountOverride: accountOverride, environment: environment, automaticallySetFirstEoa: !!automaticallySetFirstEoa, theme: theme, clientType: clientType, partnerId: partnerId, stripePublishableKey: stripePublishableKey, createClientReferenceId: createClientReferenceId, defaultPermissions: defaultPermissions, authStrategy: authStrategy, children: [(0, jsx_runtime_1.jsx)(ToastContextConnector, {}), (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" })] }), authStrategy === "better-auth" ? ((0, jsx_runtime_1.jsx)(BetterAuthProvider_1.default, { partnerId: partnerId })) : ((0, jsx_runtime_1.jsx)(AuthenticationProvider_1.default, { partnerId: partnerId, automaticallySetFirstEoa: !!automaticallySetFirstEoa, defaultEoaProvider: defaultEoaProvider }))] }) }) }) }) }));
59
59
  }
60
60
  /**
61
61
  * Component to connect the toast context to the global toast API
@@ -1,4 +1,3 @@
1
- export declare function RelayKitProviderWrapper({ children, simDuneApiKey, }: {
1
+ export declare function RelayKitProviderWrapper({ children }: {
2
2
  children: React.ReactNode;
3
- simDuneApiKey?: string;
4
3
  }): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const relay_kit_ui_1 = require("@relayprotocol/relay-kit-ui");
6
6
  const relay_sdk_1 = require("@relayprotocol/relay-sdk");
7
7
  const react_1 = require("react");
8
- function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
8
+ function RelayKitProviderWrapper({ children }) {
9
9
  const [relayChains, setRelayChains] = (0, react_1.useState)([]);
10
10
  (0, react_1.useEffect)(() => {
11
11
  const fetchChains = async () => {
@@ -14,13 +14,12 @@ function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
14
14
  };
15
15
  fetchChains();
16
16
  }, []);
17
+ // No balance provider is configured for Relay's own token selector. Relay reads balances through
18
+ // its Dune integration, which we no longer hold a key for, and it accepts no substitute — so the
19
+ // selector lists tokens without balances rather than showing figures nothing can refresh.
17
20
  return ((0, jsx_runtime_1.jsx)(relay_kit_ui_1.RelayKitProvider, { options: {
18
21
  baseApiUrl: relay_sdk_1.MAINNET_RELAY_API,
19
22
  source: "anyspend",
20
- duneConfig: {
21
- apiKey: simDuneApiKey,
22
- apiBaseUrl: "https://api.sim.dune.com",
23
- },
24
23
  chains: relayChains,
25
24
  privateChainIds: undefined,
26
25
  appName: "AnySpend",
@@ -47,7 +47,7 @@ function ContentTokens({ activeTab }) {
47
47
  const animationDirection = (0, react_2.useRef)(null);
48
48
  // === DATA FETCHING ===
49
49
  const account = (0, react_3.useActiveAccount)();
50
- const { data: simBalance, refetch: refetchSimBalance, isLoading: isLoadingBalance } = (0, react_1.useSimBalance)(account?.address);
50
+ const { data: balances, refetch: refetchBalances, isLoading: isLoadingBalance, isError: isBalanceError, } = (0, react_1.usePortfolioBalance)(account?.address);
51
51
  // === BLOCKCHAIN INTERACTION ===
52
52
  const { switchChainAndExecute } = (0, react_1.useUnifiedChainSwitchAndExecute)();
53
53
  // === ANALYTICS ===
@@ -81,13 +81,13 @@ function ContentTokens({ activeTab }) {
81
81
  // === HELPER FUNCTION ===
82
82
  // Get current version of selected token from fresh balance data
83
83
  // 🔧 FIX: Prevents auto-navigation back to token list when balance refreshes
84
- // The useSimBalance hook refreshes data, creating new token object references
84
+ // The balance hook refreshes data, creating new token object references
85
85
  // This helper ensures we always get the fresh token data instead of stale references
86
86
  const getCurrentSelectedToken = () => {
87
- if (!selectedToken || !simBalance?.balances) {
87
+ if (!selectedToken || !balances) {
88
88
  return null;
89
89
  }
90
- const found = simBalance.balances.find(token => token.chain_id === selectedToken.chain_id && token.address === selectedToken.address);
90
+ const found = balances.find(token => token.chain_id === selectedToken.chain_id && token.address === selectedToken.address);
91
91
  return found || null;
92
92
  };
93
93
  // ==================================================================================
@@ -153,11 +153,13 @@ function ContentTokens({ activeTab }) {
153
153
  functionName: "transfer",
154
154
  args: [recipientAddress, amountInWei],
155
155
  });
156
- const tx = await switchChainAndExecute(displayToken.chain_id, {
157
- to: displayToken.address === "native" ? recipientAddress : displayToken.address,
158
- data: sendTokenData,
159
- value: displayToken.address === "native" ? amountInWei : BigInt(0),
160
- });
156
+ // A native send carries value and no calldata; an ERC-20 send carries calldata and no
157
+ // value. Branch on the explicit flag, never on the address: the native sentinel is a
158
+ // display detail, and taking the ERC-20 path for a native coin spends gas without moving
159
+ // anything.
160
+ const tx = await switchChainAndExecute(displayToken.chain_id, displayToken.is_native
161
+ ? { to: recipientAddress, value: amountInWei }
162
+ : { to: displayToken.address, data: sendTokenData, value: BigInt(0) });
161
163
  if (tx) {
162
164
  // Track successful send
163
165
  sendAnalyticsEvent("send_token_button_click", {
@@ -183,7 +185,7 @@ function ContentTokens({ activeTab }) {
183
185
  // Wait 1 second to make sure the tx is indexed on sim api.
184
186
  setTimeout(async () => {
185
187
  // Force refetch to bypass cache and get fresh balance data
186
- await refetchSimBalance();
188
+ await refetchBalances();
187
189
  }, 1000);
188
190
  setIsSending(false);
189
191
  }
@@ -217,21 +219,27 @@ function ContentTokens({ activeTab }) {
217
219
  if (isLoadingBalance) {
218
220
  return (0, jsx_runtime_1.jsx)(LoadingIndicator, {});
219
221
  }
220
- // Show empty state when no account or no balance data
221
- if (!account?.address || !simBalance) {
222
+ // A wallet IS connected here only the read failed. Prompting the user to connect would send
223
+ // them to fix something that is not broken.
224
+ // `isBalanceError` as well as the absent list: after a first success a later refetch failure
225
+ // keeps `data` populated, so `!balances` alone would show stale numbers as if they were fresh.
226
+ if (account?.address && (isBalanceError || !balances)) {
227
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line/50 mb-4 rounded-full p-4", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-b3-foreground-muted h-8 w-8" }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-b3-grey font-neue-montreal-semibold mb-2", children: "Couldn't load your tokens" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => refetchBalances(), className: "text-b3-foreground-muted font-neue-montreal-medium text-sm underline", children: "Try again" })] }));
228
+ }
229
+ if (!account?.address) {
222
230
  return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line/50 mb-4 rounded-full p-4", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-b3-foreground-muted h-8 w-8" }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-b3-grey font-neue-montreal-semibold mb-2", children: "No wallet connected" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Connect your wallet to view token balances" })] }));
223
231
  }
224
232
  // === SMART FILTERING LOGIC ===
225
233
  // Filter tokens with value >= $1 to reduce noise from dust tokens
226
- const filteredTokens = simBalance?.balances.filter(token => token.value_usd !== undefined && token.value_usd >= 1) || [];
234
+ const filteredTokens = balances?.filter(token => token.value_usd !== undefined && token.value_usd >= 1) || [];
227
235
  // 🧠 INTELLIGENT DISPLAY LOGIC:
228
236
  // Show all tokens automatically when filtering would be unhelpful:
229
237
  // 1. User explicitly requested to show all, OR
230
238
  // 2. No tokens with value >= $1 (user has only dust), OR
231
239
  // 3. 5 or fewer tokens with value >= $1 (not enough to warrant filtering)
232
240
  const shouldShowAllTokens = showAllTokens || filteredTokens.length === 0 || filteredTokens.length <= 5;
233
- const tokensToShow = shouldShowAllTokens ? simBalance?.balances || [] : filteredTokens;
234
- const hasHiddenTokens = !shouldShowAllTokens && (simBalance?.balances.length || 0) > filteredTokens.length;
241
+ const tokensToShow = shouldShowAllTokens ? balances || [] : filteredTokens;
242
+ const hasHiddenTokens = !shouldShowAllTokens && (balances?.length || 0) > filteredTokens.length;
235
243
  // Handle token selection and navigate to send form
236
244
  const handleTokenClick = (token) => {
237
245
  setSelectedToken(token);
@@ -9,7 +9,7 @@ const NFTContent = () => {
9
9
  const activeWallet = (0, react_1.useActiveWallet)();
10
10
  const activeAccount = activeWallet?.getAccount();
11
11
  const activeAddress = activeAccount?.address;
12
- const { data: nfts, isLoading } = (0, hooks_1.useSimCollectibles)(activeAddress, [1, 8453], { filterSpam: true });
13
- return ((0, jsx_runtime_1.jsx)("div", { style: { minHeight: "100px" }, children: nfts ? ((0, jsx_runtime_1.jsx)(__1.AccountAssets, { nfts: nfts, isLoading: isLoading })) : ((0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "No NFTs found" })) }));
12
+ const { data: nfts, isLoading, isError } = (0, hooks_1.usePortfolioCollectibles)(activeAddress, [1, 8453], { filterSpam: true });
13
+ return ((0, jsx_runtime_1.jsx)("div", { style: { minHeight: "100px" }, children: isError ? ((0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "Couldn't load your NFTs" })) : nfts ? ((0, jsx_runtime_1.jsx)(__1.AccountAssets, { nfts: nfts, isLoading: isLoading })) : ((0, jsx_runtime_1.jsx)("div", { className: "py-12 text-center text-gray-500", children: "No NFTs found" })) }));
14
14
  };
15
15
  exports.default = NFTContent;
@@ -29,14 +29,16 @@ const ProfileSection = () => {
29
29
  const setB3ModalOpen = (0, react_1.useModalStore)(state => state.setB3ModalOpen);
30
30
  const setB3ModalContentType = (0, react_1.useModalStore)(state => state.setB3ModalContentType);
31
31
  const navigateBack = (0, react_1.useModalStore)(state => state.navigateBack);
32
- const { data: simBalance } = (0, react_1.useSimBalance)(smartWalletAddress);
32
+ const { data: balances, isError: isBalanceError } = (0, react_1.usePortfolioBalance)(smartWalletAddress);
33
33
  const [imgError, setImgError] = (0, react_2.useState)(false);
34
34
  const handleImgError = (0, react_2.useCallback)(() => setImgError(true), []);
35
+ // Null while the holdings are unknown. Summing an absent list to $0.00 would report an empty
36
+ // portfolio to someone whose balances merely failed to load.
35
37
  const totalBalanceUsd = (0, react_2.useMemo)(() => {
36
- if (!simBalance?.balances)
37
- return 0;
38
- return simBalance.balances.reduce((sum, token) => sum + (token.value_usd || 0), 0);
39
- }, [simBalance]);
38
+ if (isBalanceError || !balances)
39
+ return null;
40
+ return balances.reduce((sum, token) => sum + (token.value_usd || 0), 0);
41
+ }, [balances, isBalanceError]);
40
42
  const handleEditAvatar = () => {
41
43
  setB3ModalOpen(true);
42
44
  setB3ModalContentType({
@@ -53,6 +55,6 @@ const ProfileSection = () => {
53
55
  }, [avatarSrc]);
54
56
  const currentUsername = user?.username || profile?.displayName || (0, utils_1.formatUsername)(profile?.name || "");
55
57
  const avatarSeed = eoaAddress || account?.address || smartWalletAddress || currentUsername || user?.email || "user";
56
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between px-5 py-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-avatar relative", children: [(0, jsx_runtime_1.jsx)("div", { className: "border-b3-line border-1 bg-b3-primary-wash size-14 overflow-hidden rounded-full border", children: avatarSrc && !imgError ? ((0, jsx_runtime_1.jsx)(IPFSMediaRenderer_1.IPFSMediaRenderer, { src: avatarSrc, alt: "Profile Avatar", className: "h-full w-full object-cover", onError: handleImgError })) : ((0, jsx_runtime_1.jsx)(boring_avatars_1.default, { name: avatarSeed, variant: "beam", size: 56, colors: constants_1.AVATAR_COLORS })) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleEditAvatar, className: "border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-6 items-center justify-center rounded-full border-4 bg-[#a0a0ab] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { size: 10, className: "text-b3-background" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-info flex flex-col gap-1", children: [!isBetterAuth && ((0, jsx_runtime_1.jsxs)("h2", { className: "text-b3-grey font-neue-montreal-semibold flex h-[38px] items-center gap-1 text-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted", children: " $" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[30px]", children: (0, number_1.formatDisplayNumber)(totalBalanceUsd, { fractionDigits: 2 }) })] })), (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-username font-neue-montreal-semibold text-base leading-none text-[#0B57C2]", children: currentUsername }), isBetterAuth && user?.email && ((0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: user.email }))] })] }) }));
58
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between px-5 py-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile flex items-center gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-avatar relative", children: [(0, jsx_runtime_1.jsx)("div", { className: "border-b3-line border-1 bg-b3-primary-wash size-14 overflow-hidden rounded-full border", children: avatarSrc && !imgError ? ((0, jsx_runtime_1.jsx)(IPFSMediaRenderer_1.IPFSMediaRenderer, { src: avatarSrc, alt: "Profile Avatar", className: "h-full w-full object-cover", onError: handleImgError })) : ((0, jsx_runtime_1.jsx)(boring_avatars_1.default, { name: avatarSeed, variant: "beam", size: 56, colors: constants_1.AVATAR_COLORS })) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleEditAvatar, className: "border-b3-background hover:bg-b3-grey/80 absolute -bottom-1 -right-1 flex size-6 items-center justify-center rounded-full border-4 bg-[#a0a0ab] transition-colors", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Pencil, { size: 10, className: "text-b3-background" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "global-account-profile-info flex flex-col gap-1", children: [!isBetterAuth && ((0, jsx_runtime_1.jsxs)("h2", { className: "text-b3-grey font-neue-montreal-semibold flex h-[38px] items-center gap-1 text-xl", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted", children: " $" }), (0, jsx_runtime_1.jsx)("div", { className: "text-[30px]", children: totalBalanceUsd === null ? "—" : (0, number_1.formatDisplayNumber)(totalBalanceUsd, { fractionDigits: 2 }) })] })), (0, jsx_runtime_1.jsx)("div", { className: "b3-modal-username font-neue-montreal-semibold text-base leading-none text-[#0B57C2]", children: currentUsername }), isBetterAuth && user?.email && ((0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: user.email }))] })] }) }));
57
59
  };
58
60
  exports.default = ProfileSection;
@@ -5,23 +5,32 @@ const react_1 = require("../../../../global-account/react");
5
5
  const supported_1 = require("../../../../shared/constants/chains/supported");
6
6
  const react_2 = require("thirdweb/react");
7
7
  const TokenBalanceRow_1 = require("./TokenBalanceRow");
8
- // Chain logo URLs mapping
9
- const CHAIN_LOGOS = [1, 8453, 8333].map(chainId => (0, supported_1.getChainLogo)(chainId));
8
+ const ETHEREUM_CHAIN_ID = 1;
9
+ // Chain logo URLs, keyed by chain id. Built with Object.fromEntries rather than `.map()`: an array
10
+ // satisfies Record<number, string> for the type checker while indexing by 0,1,2 at runtime, so
11
+ // every lookup by a real chain id would miss.
12
+ const CHAIN_LOGOS = Object.fromEntries([ETHEREUM_CHAIN_ID, 8453, 8333].map(chainId => [chainId, (0, supported_1.getChainLogo)(chainId)]));
10
13
  const TokenContent = () => {
11
14
  // Get active wallet state
12
15
  const activeWallet = (0, react_2.useActiveWallet)();
13
16
  const activeAccount = activeWallet?.getAccount();
14
17
  const activeAddress = activeAccount?.address;
15
- const { data: simBalance } = (0, react_1.useSimBalance)(activeAddress, [8453, 8333, 1]);
16
- console.log("simBalance :", simBalance);
18
+ // Base and Ethereum only. B3 (8333) is deliberately absent: the portfolio provider does not index
19
+ // it, so asking for it returns nothing and reads as a coverage gap rather than a choice. Restoring
20
+ // B3 needs a non-provider source, the way HyperEVM and Plume are served on-chain in b3os-web.
21
+ const { data: balances, isError: isBalanceError } = (0, react_1.usePortfolioBalance)(activeAddress, [8453, ETHEREUM_CHAIN_ID]);
17
22
  if (!activeAddress) {
18
23
  return (0, jsx_runtime_1.jsx)("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "No tokens found" });
19
24
  }
20
- if (!simBalance?.balances || simBalance.balances.length === 0) {
25
+ // "Couldn't load" and "holds nothing" are different answers and must not share a message.
26
+ if (isBalanceError) {
27
+ return (0, jsx_runtime_1.jsx)("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "Couldn't load your tokens" });
28
+ }
29
+ if (!balances || balances.length === 0) {
21
30
  return (0, jsx_runtime_1.jsx)("div", { className: "col-span-3 py-12 text-center text-gray-500", children: "No tokens found" });
22
31
  }
23
32
  // Sort by USD value descending
24
- const sortedBalances = [...simBalance.balances].sort((a, b) => {
33
+ const sortedBalances = [...balances].sort((a, b) => {
25
34
  const valueA = a.value_usd || 0;
26
35
  const valueB = b.value_usd || 0;
27
36
  return valueB - valueA;
@@ -35,8 +44,8 @@ const TokenContent = () => {
35
44
  // Determine token logo
36
45
  // For native tokens, use ETH logo instead of chain logo
37
46
  let tokenLogo = token.token_metadata?.logo || "";
38
- if (token.address === "native" && token.symbol === "ETH") {
39
- tokenLogo = CHAIN_LOGOS[0];
47
+ if (token.is_native && token.symbol === "ETH") {
48
+ tokenLogo = CHAIN_LOGOS[ETHEREUM_CHAIN_ID];
40
49
  }
41
50
  return ((0, jsx_runtime_1.jsx)(TokenBalanceRow_1.TokenBalanceRow, { tokenLogo: tokenLogo, chainLogo: CHAIN_LOGOS[token.chain_id] || "", name: token.name || token.symbol, balance: `${balance} ${token.symbol}`, usdValue: usdValue, priceChange: priceChange }, `${token.chain_id}-${token.address}-${index}`));
42
51
  }) }));
@@ -37,7 +37,7 @@ function Send({ recipientAddress: initialRecipient, onSuccess }) {
37
37
  const [addressError, setAddressError] = (0, react_2.useState)("");
38
38
  const [showValidatedResult, setShowValidatedResult] = (0, react_2.useState)(false);
39
39
  // Hooks
40
- const { data: simBalance, refetch: refetchSimBalance, isLoading: isLoadingBalance } = (0, react_1.useSimBalance)(address);
40
+ const { data: balances, refetch: refetchBalances, isLoading: isLoadingBalance, isError: isBalanceError, } = (0, react_1.usePortfolioBalance)(address);
41
41
  const { switchChainAndExecute } = (0, react_1.useUnifiedChainSwitchAndExecute)();
42
42
  const { sendAnalyticsEvent } = (0, react_1.useAnalytics)();
43
43
  // Recent addresses store
@@ -101,10 +101,10 @@ function Send({ recipientAddress: initialRecipient, onSuccess }) {
101
101
  };
102
102
  // Get current selected token from fresh balance
103
103
  const getCurrentSelectedToken = () => {
104
- if (!selectedToken || !simBalance?.balances) {
104
+ if (!selectedToken || !balances) {
105
105
  return null;
106
106
  }
107
- const found = simBalance.balances.find(token => token.chain_id === selectedToken.chain_id && token.address === selectedToken.address);
107
+ const found = balances.find(token => token.chain_id === selectedToken.chain_id && token.address === selectedToken.address);
108
108
  return found || null;
109
109
  };
110
110
  // Percentage button handler
@@ -138,11 +138,12 @@ function Send({ recipientAddress: initialRecipient, onSuccess }) {
138
138
  functionName: "transfer",
139
139
  args: [recipientAddress, amountInWei],
140
140
  });
141
- const tx = await switchChainAndExecute(currentToken.chain_id, {
142
- to: currentToken.address === "native" ? recipientAddress : currentToken.address,
143
- data: sendTokenData,
144
- value: currentToken.address === "native" ? amountInWei : BigInt(0),
145
- });
141
+ // A native send carries value and no calldata; an ERC-20 send carries calldata and no value.
142
+ // Branch on the explicit flag, never on the address: the native sentinel is a display detail,
143
+ // and taking the ERC-20 path for a native coin spends gas without moving anything.
144
+ const tx = await switchChainAndExecute(currentToken.chain_id, currentToken.is_native
145
+ ? { to: recipientAddress, value: amountInWei }
146
+ : { to: currentToken.address, data: sendTokenData, value: BigInt(0) });
146
147
  if (tx) {
147
148
  sendAnalyticsEvent("send_token_button_click", {
148
149
  ...analyticsData,
@@ -155,7 +156,7 @@ function Send({ recipientAddress: initialRecipient, onSuccess }) {
155
156
  onSuccess(tx);
156
157
  }
157
158
  setTimeout(async () => {
158
- await refetchSimBalance();
159
+ await refetchBalances();
159
160
  }, 1000);
160
161
  }
161
162
  }
@@ -191,8 +192,11 @@ function Send({ recipientAddress: initialRecipient, onSuccess }) {
191
192
  return ((0, jsx_runtime_1.jsxs)("div", { className: "dark:bg-b3-background flex h-[600px] w-full flex-col bg-white", children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.default, { handleBack: handleBack, title: getStepTitle() }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 overflow-y-auto", children: [step === "recipient" && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line dark:bg-b3-background flex h-12 w-full items-stretch overflow-hidden rounded-lg border border-[#d1d1d6] bg-white", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex w-12 items-center justify-center bg-transparent px-3 py-2", children: (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-medium text-base text-[#3f3f46] dark:text-white", children: "To" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 items-center border-l border-[#d1d1d6] px-3 py-2", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", value: recipientAddress, onChange: e => handleRecipientAddressChange(e.target.value), placeholder: "ENS or Address", className: "font-neue-montreal-medium dark:bg-b3-background flex-1 text-base text-[#70707b] outline-none placeholder:text-[#70707b] dark:text-white dark:placeholder:text-white" }), (0, jsx_runtime_1.jsx)("button", { onClick: handlePaste, className: "font-inter ml-2 rounded-md border border-[#e4e4e7] bg-[#fafafa] px-2.5 py-0.5 text-sm font-medium text-[#3f3f46] transition-colors hover:bg-[#f4f4f5]", children: "Paste" })] })] }), addressError && (0, jsx_runtime_1.jsx)("p", { className: "font-neue-montreal-medium -mt-4 text-xs text-red-500", children: addressError }), showValidatedResult && recipientAddress && (0, viem_1.isAddress)(recipientAddress) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1", children: (0, jsx_runtime_1.jsx)("span", { className: "font-sf-pro-text text-sm font-semibold leading-[1.3] tracking-[-0.41px] text-[#0b57c2]", children: "Result" }) }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSelectValidatedAddress, className: "dark:bg-b3-background dark:border-b3-line flex items-center gap-2 rounded-xl bg-[#f4f4f5] px-3 py-2 transition-colors hover:bg-[#e4e4e7]", children: [validatedRecipientAvatar ? ((0, jsx_runtime_1.jsx)("img", { src: validatedRecipientAvatar, alt: validatedProfileData?.name || recipientAddress, className: "h-10 w-10 rounded-full" })) : ((0, jsx_runtime_1.jsx)("div", { className: "dark:border-b3-line dark:bg-b3-background flex h-10 w-10 items-center justify-center rounded-full border border-[#e4e4e7] bg-[#f4f4f5]", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "h-5 w-5 text-[#a0a0ab] dark:text-white" }) })), (0, jsx_runtime_1.jsxs)("span", { className: "font-neue-montreal-medium text-base tracking-[-0.32px] text-[#70707b] dark:text-white", children: [recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4), validatedProfileData?.name && ` (${validatedProfileData.name})`] })] })] })), recentAddresses.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "h-3.5 w-3.5 text-[#3f3f46]" }), (0, jsx_runtime_1.jsx)("span", { className: "font-sf-pro-text text-sm font-semibold leading-[1.3] tracking-[-0.41px] text-[#3f3f46]", children: "Recents" })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col", children: recentAddresses.map((recent, index) => ((0, jsx_runtime_1.jsx)(RecentAddressItem, { address: recent.address, onClick: () => {
192
193
  // Just fill the input and show validation - don't auto-proceed
193
194
  handleRecipientAddressChange(recent.address);
194
- } }, index))) })] }))] })), step === "token" && ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col p-5", children: isLoadingBalance ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-1", children: [...Array(3)].map((_, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between rounded-xl p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-10 w-10 animate-pulse rounded-full" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line mb-1 h-4 w-16 animate-pulse rounded" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-3 w-24 animate-pulse rounded" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line mb-1 h-4 w-20 animate-pulse rounded" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-3 w-16 animate-pulse rounded" })] })] }, index))) }) })) : simBalance?.balances && simBalance.balances.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-1", children: simBalance.balances.map(token => ((0, jsx_runtime_1.jsxs)("div", { className: "hover:bg-b3-line/60 dark:hover:bg-b3-primary-wash/40 group flex cursor-pointer items-center justify-between rounded-xl p-3 transition-all duration-200", onClick: () => {
195
+ } }, index))) })] }))] })), step === "token" && ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col p-5", children: isLoadingBalance ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-1", children: [...Array(3)].map((_, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between rounded-xl p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-10 w-10 animate-pulse rounded-full" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line mb-1 h-4 w-16 animate-pulse rounded" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-3 w-24 animate-pulse rounded" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line mb-1 h-4 w-20 animate-pulse rounded" }), (0, jsx_runtime_1.jsx)("div", { className: "bg-b3-line h-3 w-16 animate-pulse rounded" })] })] }, index))) }) })) : balances && balances.length > 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-1", children: balances.map(token => ((0, jsx_runtime_1.jsxs)("div", { className: "hover:bg-b3-line/60 dark:hover:bg-b3-primary-wash/40 group flex cursor-pointer items-center justify-between rounded-xl p-3 transition-all duration-200", onClick: () => {
195
196
  setSelectedToken(token);
196
197
  setStep("amount");
197
- }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: anyspend_1.ALL_CHAINS[token.chain_id]?.logoUrl ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[token.chain_id].logoUrl, tokenUrl: token.token_metadata?.logo, className: "size-10" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-react-foreground size-10" })) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: token.symbol }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: token.name })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: (0, number_1.formatTokenAmount)(BigInt(token.amount), token.decimals) }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: (0, number_1.formatDisplayNumber)(token.value_usd, { style: "currency", fractionDigits: 2 }) })] })] }, token.chain_id + "_" + token.address))) }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-foreground-muted mb-4 h-8 w-8" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "No tokens available" })] })) })), step === "amount" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line dark:bg-b3-background flex items-center justify-between rounded-xl border border-[#d1d1d6] bg-[#fafafa] p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center", children: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.logoUrl ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[selectedToken.chain_id].logoUrl, tokenUrl: selectedToken.token_metadata?.logo, className: "size-10" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-react-foreground size-10" })) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "font-neue-montreal-semibold text-base text-[#18181b] dark:text-white", children: selectedToken.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "font-neue-montreal-medium text-sm text-[#70707b] dark:text-white", children: (0, number_1.formatTokenAmount)(BigInt(selectedToken.amount), selectedToken.decimals) })] })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setStep("token"), className: "text-b3-primary-blue font-neue-montreal-semibold hover:text-b3-primary-blue/80 text-sm transition-colors dark:text-white", children: "Change" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, { decimalSeparator: ".", allowedDecimalSeparators: [","], thousandSeparator: true, inputMode: "decimal", autoComplete: "off", autoCorrect: "off", type: "text", placeholder: "0.00", minLength: 1, maxLength: 30, spellCheck: "false", className: "font-neue-montreal-medium placeholder:text-b3-foreground-muted dark:border-b3-line dark:bg-b3-background w-full rounded-lg border border-[#d1d1d6] bg-white px-3 py-2 text-base text-[#18181b] outline-none focus:border-[#0c68e9] dark:text-white", pattern: "^[0-9]*[.,]?[0-9]*$", disabled: isSending, value: sendAmount, allowNegative: false, onValueChange: values => setSendAmount(values.value) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-4 gap-2", children: [25, 50, 75, 100].map(percentage => ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", onClick: () => handlePercentageClick(percentage), className: "font-neue-montreal-medium dark:border-b3-line dark:bg-b3-background border-[#d1d1d6] text-sm text-[#18181b] hover:bg-[#fafafa] dark:text-white", disabled: isSending, children: [percentage, "%"] }, percentage))) }), (0, jsx_runtime_1.jsxs)("div", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: ["Available: ", (0, number_1.formatTokenAmount)(BigInt(selectedToken.amount), selectedToken.decimals), " ", selectedToken.symbol] })] }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setStep("confirm"), disabled: !sendAmount || parseFloat(sendAmount) <= 0, className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold disabled:bg-b3-line disabled:text-b3-foreground-muted h-12 w-full rounded-xl text-white", children: "Continue" })] })), step === "confirm" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex min-h-full flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 px-5 pb-0 pt-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "dark:bg-b3-line flex h-14 w-14 items-center justify-center rounded-full bg-[#d5e5fd]", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Send, { className: "h-7 w-7 text-[#0c68e9]" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-[30px] leading-[38px] text-[#18181b] dark:text-white", children: sendAmount }), (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-[30px] leading-[38px] text-[#70707b] dark:text-white", children: selectedToken.symbol })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-5" }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3 px-5", children: (0, jsx_runtime_1.jsx)("div", { className: "dark:border-b3-line dark:bg-b3-background rounded-xl border border-[#e4e4e7] bg-[#fafafa] p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line flex items-center justify-between border-b border-[#e4e4e7] pb-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "To" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-inter text-sm font-normal leading-5 text-[#18181b] dark:text-white", children: ["Wallet (", recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4), ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line flex items-center justify-between border-b border-[#e4e4e7] pb-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "Network" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.name || "Unknown" }), anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.logoUrl && ((0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[selectedToken.chain_id].logoUrl, alt: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.name, className: "h-4 w-4 rounded-full" }))] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "Network fee" }), (0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#18181b] dark:text-white", children: "$0.1" })] })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1" }), (0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line dark:bg-b3-background flex gap-4 border-t border-[#e4e4e7] bg-[#fafafa] p-4", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleBack, disabled: isSending, variant: "outline", className: "font-inter h-12 flex-1 rounded-xl border border-[#e4e4e7] bg-white text-base font-semibold text-[#3f3f46] shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#fafafa]", children: "Cancel" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleSend, disabled: isSending, className: "font-inter border-white/12 h-12 flex-1 rounded-xl border-2 bg-[#0c68e9] text-base font-semibold text-white shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#0b5fd4]", children: isSending ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Sending..."] })) : ("Send") })] })] })), step === "success" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-full flex-col items-center justify-center gap-6 p-5 text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-14 w-14 items-center justify-center rounded-full bg-green-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Send, { className: "h-7 w-7 text-green-600" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-neue-montreal-semibold mb-2 text-xl text-[#18181b]", children: "Sent!" }), (0, jsx_runtime_1.jsxs)("p", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: [sendAmount, " ", selectedToken.symbol, " was sent to ", recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4)] })] }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setB3ModalOpen(false), className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full rounded-xl text-white", children: "Done" })] }))] })] }));
198
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center rounded-full", children: anyspend_1.ALL_CHAINS[token.chain_id]?.logoUrl ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[token.chain_id].logoUrl, tokenUrl: token.token_metadata?.logo, className: "size-10" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-react-foreground size-10" })) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: token.symbol }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: token.name })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-grey font-neue-montreal-semibold transition-colors duration-200 group-hover:font-bold group-hover:text-black", children: (0, number_1.formatTokenAmount)(BigInt(token.amount), token.decimals) }), (0, jsx_runtime_1.jsx)("div", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm transition-colors duration-200 group-hover:text-gray-700", children: (0, number_1.formatDisplayNumber)(token.value_usd, { style: "currency", fractionDigits: 2 }) })] })] }, token.chain_id + "_" + token.address))) }) })) : isBalanceError ? (
199
+ // Telling someone they hold nothing, when the read simply failed, invites them to go
200
+ // looking for missing funds.
201
+ (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-foreground-muted mb-4 h-8 w-8" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "Couldn't load your tokens" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => refetchBalances(), className: "text-b3-foreground-muted font-neue-montreal-medium mt-2 text-sm underline", children: "Try again" })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-foreground-muted mb-4 h-8 w-8" }), (0, jsx_runtime_1.jsx)("p", { className: "text-b3-foreground-muted font-neue-montreal-medium text-sm", children: "No tokens available" })] })) })), step === "amount" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line dark:bg-b3-background flex items-center justify-between rounded-xl border border-[#d1d1d6] bg-[#fafafa] p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-10 w-10 items-center justify-center", children: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.logoUrl ? ((0, jsx_runtime_1.jsx)(ChainTokenIcon_1.ChainTokenIcon, { chainUrl: anyspend_1.ALL_CHAINS[selectedToken.chain_id].logoUrl, tokenUrl: selectedToken.token_metadata?.logo, className: "size-10" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.CircleHelp, { className: "text-b3-react-foreground size-10" })) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "font-neue-montreal-semibold text-base text-[#18181b] dark:text-white", children: selectedToken.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "font-neue-montreal-medium text-sm text-[#70707b] dark:text-white", children: (0, number_1.formatTokenAmount)(BigInt(selectedToken.amount), selectedToken.decimals) })] })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setStep("token"), className: "text-b3-primary-blue font-neue-montreal-semibold hover:text-b3-primary-blue/80 text-sm transition-colors dark:text-white", children: "Change" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, { decimalSeparator: ".", allowedDecimalSeparators: [","], thousandSeparator: true, inputMode: "decimal", autoComplete: "off", autoCorrect: "off", type: "text", placeholder: "0.00", minLength: 1, maxLength: 30, spellCheck: "false", className: "font-neue-montreal-medium placeholder:text-b3-foreground-muted dark:border-b3-line dark:bg-b3-background w-full rounded-lg border border-[#d1d1d6] bg-white px-3 py-2 text-base text-[#18181b] outline-none focus:border-[#0c68e9] dark:text-white", pattern: "^[0-9]*[.,]?[0-9]*$", disabled: isSending, value: sendAmount, allowNegative: false, onValueChange: values => setSendAmount(values.value) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-4 gap-2", children: [25, 50, 75, 100].map(percentage => ((0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", onClick: () => handlePercentageClick(percentage), className: "font-neue-montreal-medium dark:border-b3-line dark:bg-b3-background border-[#d1d1d6] text-sm text-[#18181b] hover:bg-[#fafafa] dark:text-white", disabled: isSending, children: [percentage, "%"] }, percentage))) }), (0, jsx_runtime_1.jsxs)("div", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: ["Available: ", (0, number_1.formatTokenAmount)(BigInt(selectedToken.amount), selectedToken.decimals), " ", selectedToken.symbol] })] }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setStep("confirm"), disabled: !sendAmount || parseFloat(sendAmount) <= 0, className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold disabled:bg-b3-line disabled:text-b3-foreground-muted h-12 w-full rounded-xl text-white", children: "Continue" })] })), step === "confirm" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex min-h-full flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-4 px-5 pb-0 pt-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "dark:bg-b3-line flex h-14 w-14 items-center justify-center rounded-full bg-[#d5e5fd]", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Send, { className: "h-7 w-7 text-[#0c68e9]" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-[30px] leading-[38px] text-[#18181b] dark:text-white", children: sendAmount }), (0, jsx_runtime_1.jsx)("span", { className: "font-neue-montreal-semibold text-[30px] leading-[38px] text-[#70707b] dark:text-white", children: selectedToken.symbol })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-5" }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-3 px-5", children: (0, jsx_runtime_1.jsx)("div", { className: "dark:border-b3-line dark:bg-b3-background rounded-xl border border-[#e4e4e7] bg-[#fafafa] p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line flex items-center justify-between border-b border-[#e4e4e7] pb-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "To" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-inter text-sm font-normal leading-5 text-[#18181b] dark:text-white", children: ["Wallet (", recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4), ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line flex items-center justify-between border-b border-[#e4e4e7] pb-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "Network" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.name || "Unknown" }), anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.logoUrl && ((0, jsx_runtime_1.jsx)("img", { src: anyspend_1.ALL_CHAINS[selectedToken.chain_id].logoUrl, alt: anyspend_1.ALL_CHAINS[selectedToken.chain_id]?.name, className: "h-4 w-4 rounded-full" }))] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#51525c] dark:text-white", children: "Network fee" }), (0, jsx_runtime_1.jsx)("span", { className: "font-inter text-sm font-normal leading-5 text-[#18181b] dark:text-white", children: "$0.1" })] })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1" }), (0, jsx_runtime_1.jsxs)("div", { className: "dark:border-b3-line dark:bg-b3-background flex gap-4 border-t border-[#e4e4e7] bg-[#fafafa] p-4", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleBack, disabled: isSending, variant: "outline", className: "font-inter h-12 flex-1 rounded-xl border border-[#e4e4e7] bg-white text-base font-semibold text-[#3f3f46] shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#fafafa]", children: "Cancel" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleSend, disabled: isSending, className: "font-inter border-white/12 h-12 flex-1 rounded-xl border-2 bg-[#0c68e9] text-base font-semibold text-white shadow-[inset_0px_0px_0px_1px_rgba(10,13,18,0.18),inset_0px_-2px_0px_0px_rgba(10,13,18,0.05)] hover:bg-[#0b5fd4]", children: isSending ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Sending..."] })) : ("Send") })] })] })), step === "success" && selectedToken && ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-full flex-col items-center justify-center gap-6 p-5 text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex h-14 w-14 items-center justify-center rounded-full bg-green-100", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Send, { className: "h-7 w-7 text-green-600" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-neue-montreal-semibold mb-2 text-xl text-[#18181b]", children: "Sent!" }), (0, jsx_runtime_1.jsxs)("p", { className: "font-neue-montreal-medium text-sm text-[#70707b]", children: [sendAmount, " ", selectedToken.symbol, " was sent to ", recipientAddress.slice(0, 6), "...", recipientAddress.slice(-4)] })] }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setB3ModalOpen(false), className: "bg-b3-primary-blue hover:bg-b3-primary-blue/90 font-neue-montreal-semibold h-12 w-full rounded-xl text-white", children: "Done" })] }))] })] }));
198
202
  }
@@ -30,8 +30,8 @@ export { useQueryBSMNT } from "./useQueryBSMNT";
30
30
  export { useRemoveSessionKey } from "./useRemoveSessionKey";
31
31
  export { useRouter } from "./useRouter";
32
32
  export { useSearchParamsSSR } from "./useSearchParamsSSR";
33
- export { useSimBalance, useSimSvmBalance, useSimTokenBalance } from "./useSimBalance";
34
- export { useSimCollectibles } from "./useSimCollectibles";
33
+ export { usePortfolioBalance, usePortfolioTokenBalance } from "./usePortfolioBalance";
34
+ export { usePortfolioCollectibles } from "./usePortfolioCollectibles";
35
35
  export { useSiwe } from "./useSiwe";
36
36
  export { useTokenBalance } from "./useTokenBalance";
37
37
  export { useTokenBalanceDirect } from "./useTokenBalanceDirect";
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.useUnifiedChainSwitchAndExecute = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = exports.useSimCollectibles = exports.useSimTokenBalance = exports.useSimSvmBalance = exports.useSimBalance = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.useProfileSettings = exports.useProfilePreference = exports.useProfile = exports.useDisplayName = exports.useOneBalance = exports.useNotifications = exports.useNativeBalanceFromRPC = exports.useNativeBalance = exports.useMediaQuery = exports.useIsomorphicLayoutEffect = exports.useIsMobile = exports.useHasMounted = exports.useGlobalAccount = exports.useGetGeo = exports.useGetAllTWSigners = exports.useFirstEOA = exports.useExchangeRate = exports.useConnect = exports.useClient = exports.useChainSwitchWithAction = exports.useB3EnsName = exports.useB3BalanceFromAddresses = exports.EmailVerificationRequiredError = exports.useBetterAuth = exports.useAuthentication = exports.useAuth = exports.useAnalytics = exports.useAddTWSessionKey = exports.useAccountWallet = exports.useAccountAssets = exports.createWagmiConfig = void 0;
18
- exports.useUser = exports.useURLParams = void 0;
17
+ exports.useURLParams = exports.useUnifiedChainSwitchAndExecute = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalanceDirect = exports.useTokenBalance = exports.useSiwe = exports.usePortfolioCollectibles = exports.usePortfolioTokenBalance = exports.usePortfolioBalance = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.useProfileSettings = exports.useProfilePreference = exports.useProfile = exports.useDisplayName = exports.useOneBalance = exports.useNotifications = exports.useNativeBalanceFromRPC = exports.useNativeBalance = exports.useMediaQuery = exports.useIsomorphicLayoutEffect = exports.useIsMobile = exports.useHasMounted = exports.useGlobalAccount = exports.useGetGeo = exports.useGetAllTWSigners = exports.useFirstEOA = exports.useExchangeRate = exports.useConnect = exports.useClient = exports.useChainSwitchWithAction = exports.useB3EnsName = exports.useB3BalanceFromAddresses = exports.EmailVerificationRequiredError = exports.useBetterAuth = exports.useAuthentication = exports.useAuth = exports.useAnalytics = exports.useAddTWSessionKey = exports.useAccountWallet = exports.useAccountAssets = exports.createWagmiConfig = void 0;
18
+ exports.useUser = void 0;
19
19
  var createWagmiConfig_1 = require("../utils/createWagmiConfig");
20
20
  Object.defineProperty(exports, "createWagmiConfig", { enumerable: true, get: function () { return createWagmiConfig_1.createWagmiConfig; } });
21
21
  var useAccountAssets_1 = require("./useAccountAssets");
@@ -84,12 +84,11 @@ var useRouter_1 = require("./useRouter");
84
84
  Object.defineProperty(exports, "useRouter", { enumerable: true, get: function () { return useRouter_1.useRouter; } });
85
85
  var useSearchParamsSSR_1 = require("./useSearchParamsSSR");
86
86
  Object.defineProperty(exports, "useSearchParamsSSR", { enumerable: true, get: function () { return useSearchParamsSSR_1.useSearchParamsSSR; } });
87
- var useSimBalance_1 = require("./useSimBalance");
88
- Object.defineProperty(exports, "useSimBalance", { enumerable: true, get: function () { return useSimBalance_1.useSimBalance; } });
89
- Object.defineProperty(exports, "useSimSvmBalance", { enumerable: true, get: function () { return useSimBalance_1.useSimSvmBalance; } });
90
- Object.defineProperty(exports, "useSimTokenBalance", { enumerable: true, get: function () { return useSimBalance_1.useSimTokenBalance; } });
91
- var useSimCollectibles_1 = require("./useSimCollectibles");
92
- Object.defineProperty(exports, "useSimCollectibles", { enumerable: true, get: function () { return useSimCollectibles_1.useSimCollectibles; } });
87
+ var usePortfolioBalance_1 = require("./usePortfolioBalance");
88
+ Object.defineProperty(exports, "usePortfolioBalance", { enumerable: true, get: function () { return usePortfolioBalance_1.usePortfolioBalance; } });
89
+ Object.defineProperty(exports, "usePortfolioTokenBalance", { enumerable: true, get: function () { return usePortfolioBalance_1.usePortfolioTokenBalance; } });
90
+ var usePortfolioCollectibles_1 = require("./usePortfolioCollectibles");
91
+ Object.defineProperty(exports, "usePortfolioCollectibles", { enumerable: true, get: function () { return usePortfolioCollectibles_1.usePortfolioCollectibles; } });
93
92
  var useSiwe_1 = require("./useSiwe");
94
93
  Object.defineProperty(exports, "useSiwe", { enumerable: true, get: function () { return useSiwe_1.useSiwe; } });
95
94
  var useTokenBalance_1 = require("./useTokenBalance");
@@ -1,3 +1,4 @@
1
+ import { type EcosystemWallet } from "../../../shared/constants";
1
2
  import { Wallet } from "thirdweb/wallets";
2
3
  import { preAuthenticate } from "thirdweb/wallets/in-app";
3
4
  /**
@@ -13,7 +14,7 @@ export declare function useAuth(): {
13
14
  isReady: boolean;
14
15
  isConnecting: boolean;
15
16
  isConnected: boolean;
16
- wallet: import("thirdweb/dist/types/wallets/in-app/core/wallet/types").EcosystemWallet;
17
+ wallet: EcosystemWallet;
17
18
  preAuthenticate: typeof preAuthenticate;
18
19
  connect: (_walleAutoConnectedWith: Wallet, allConnectedWallets: Wallet[]) => Promise<void>;
19
20
  isAuthenticating: boolean;
@@ -50,6 +50,7 @@ function useAuth() {
50
50
  const { switchAccount } = (0, wagmi_1.useSwitchAccount)();
51
51
  const { user, setUser } = (0, useUserQuery_1.useUserQuery)();
52
52
  debug("@@activeWagmiAccount", activeWagmiAccount);
53
+ // Explicit annotation keeps the hook's declaration portable (TS2742).
53
54
  const wallet = (0, wallets_1.ecosystemWallet)(constants_1.ecosystemWalletId, {
54
55
  partnerId: partnerId,
55
56
  });
@@ -1,3 +1,4 @@
1
+ import { type EcosystemWallet } from "../../../shared/constants";
1
2
  import { Wallet } from "thirdweb/wallets";
2
3
  import { preAuthenticate } from "thirdweb/wallets/in-app";
3
4
  export declare function useAuthentication(partnerId: string, { skipAutoConnect }?: {
@@ -8,7 +9,7 @@ export declare function useAuthentication(partnerId: string, { skipAutoConnect }
8
9
  isReady: boolean;
9
10
  isConnecting: boolean;
10
11
  isConnected: boolean;
11
- wallet: import("thirdweb/dist/types/wallets/in-app/core/wallet/types").EcosystemWallet;
12
+ wallet: EcosystemWallet;
12
13
  preAuthenticate: typeof preAuthenticate;
13
14
  connect: (_walleAutoConnectedWith: Wallet, allConnectedWallets: Wallet[]) => Promise<void>;
14
15
  isAuthenticating: boolean;
@@ -59,6 +59,7 @@ function useAuthentication(partnerId, { skipAutoConnect = false } = {}) {
59
59
  const activeWagmiAccount = (0, wagmi_1.useAccount)();
60
60
  const { switchAccount } = (0, wagmi_1.useSwitchAccount)();
61
61
  debug("@@activeWagmiAccount", activeWagmiAccount);
62
+ // Explicit annotation keeps the hook's declaration portable (TS2742).
62
63
  const wallet = (0, wallets_1.ecosystemWallet)(constants_1.ecosystemWalletId, {
63
64
  partnerId: partnerId,
64
65
  });