thirdweb 5.32.0 → 5.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/dist/cjs/chains/utils.js +9 -7
  2. package/dist/cjs/chains/utils.js.map +1 -1
  3. package/dist/cjs/exports/react.js +3 -0
  4. package/dist/cjs/exports/react.js.map +1 -1
  5. package/dist/cjs/exports/wallets/smart.js +3 -1
  6. package/dist/cjs/exports/wallets/smart.js.map +1 -1
  7. package/dist/cjs/react/core/hooks/others/useChainQuery.js +104 -33
  8. package/dist/cjs/react/core/hooks/others/useChainQuery.js.map +1 -1
  9. package/dist/cjs/react/native/ui/components/ChainIcon.js +2 -3
  10. package/dist/cjs/react/native/ui/components/ChainIcon.js.map +1 -1
  11. package/dist/cjs/react/native/ui/connect/ConnectedModal.js +2 -2
  12. package/dist/cjs/react/native/ui/connect/ConnectedModal.js.map +1 -1
  13. package/dist/cjs/react/native/ui/connect/SendScreen.js +2 -2
  14. package/dist/cjs/react/native/ui/connect/SendScreen.js.map +1 -1
  15. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +6 -5
  16. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  17. package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js +217 -188
  18. package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
  19. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +2 -4
  20. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  21. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +12 -10
  22. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  23. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -2
  24. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  25. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +2 -2
  26. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +1 -1
  27. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +2 -2
  28. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  29. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +2 -2
  30. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  31. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js +2 -2
  32. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js.map +1 -1
  33. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js +8 -6
  34. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js.map +1 -1
  35. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js +2 -2
  36. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js.map +1 -1
  37. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js +3 -2
  38. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  39. package/dist/cjs/react/web/ui/components/ChainIcon.js +1 -1
  40. package/dist/cjs/react/web/ui/components/ChainIcon.js.map +1 -1
  41. package/dist/cjs/react/web/ui/components/ChainName.js +3 -5
  42. package/dist/cjs/react/web/ui/components/ChainName.js.map +1 -1
  43. package/dist/cjs/react/web/ui/components/TokenIcon.js +3 -3
  44. package/dist/cjs/react/web/ui/components/TokenIcon.js.map +1 -1
  45. package/dist/cjs/react/web/ui/components/token/TokenSymbol.js +3 -3
  46. package/dist/cjs/react/web/ui/components/token/TokenSymbol.js.map +1 -1
  47. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletFormUI.js +1 -1
  48. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletFormUI.js.map +1 -1
  49. package/dist/cjs/utils/extensions/drops/get-claim-params.js +3 -2
  50. package/dist/cjs/utils/extensions/drops/get-claim-params.js.map +1 -1
  51. package/dist/cjs/version.js +1 -1
  52. package/dist/cjs/wallets/in-app/web/ecosystem.js +3 -14
  53. package/dist/cjs/wallets/in-app/web/ecosystem.js.map +1 -1
  54. package/dist/cjs/wallets/smart/index.js +3 -17
  55. package/dist/cjs/wallets/smart/index.js.map +1 -1
  56. package/dist/cjs/wallets/smart/lib/bundler.js +1 -1
  57. package/dist/cjs/wallets/smart/lib/bundler.js.map +1 -1
  58. package/dist/cjs/wallets/smart/lib/userop.js +63 -8
  59. package/dist/cjs/wallets/smart/lib/userop.js.map +1 -1
  60. package/dist/esm/chains/utils.js +9 -7
  61. package/dist/esm/chains/utils.js.map +1 -1
  62. package/dist/esm/exports/react.js +1 -0
  63. package/dist/esm/exports/react.js.map +1 -1
  64. package/dist/esm/exports/wallets/smart.js +1 -0
  65. package/dist/esm/exports/wallets/smart.js.map +1 -1
  66. package/dist/esm/react/core/hooks/others/useChainQuery.js +101 -33
  67. package/dist/esm/react/core/hooks/others/useChainQuery.js.map +1 -1
  68. package/dist/esm/react/native/ui/components/ChainIcon.js +3 -4
  69. package/dist/esm/react/native/ui/components/ChainIcon.js.map +1 -1
  70. package/dist/esm/react/native/ui/connect/ConnectedModal.js +3 -3
  71. package/dist/esm/react/native/ui/connect/ConnectedModal.js.map +1 -1
  72. package/dist/esm/react/native/ui/connect/SendScreen.js +3 -3
  73. package/dist/esm/react/native/ui/connect/SendScreen.js.map +1 -1
  74. package/dist/esm/react/web/ui/ConnectWallet/Details.js +7 -6
  75. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  76. package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js +219 -191
  77. package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
  78. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +3 -5
  79. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  80. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +13 -11
  81. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  82. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +3 -3
  83. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  84. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +3 -3
  85. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +1 -1
  86. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +3 -3
  87. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  88. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +3 -3
  89. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  90. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js +3 -3
  91. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js.map +1 -1
  92. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js +9 -7
  93. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js.map +1 -1
  94. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js +3 -3
  95. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.js.map +1 -1
  96. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js +4 -3
  97. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  98. package/dist/esm/react/web/ui/components/ChainIcon.js +1 -1
  99. package/dist/esm/react/web/ui/components/ChainIcon.js.map +1 -1
  100. package/dist/esm/react/web/ui/components/ChainName.js +4 -6
  101. package/dist/esm/react/web/ui/components/ChainName.js.map +1 -1
  102. package/dist/esm/react/web/ui/components/TokenIcon.js +4 -4
  103. package/dist/esm/react/web/ui/components/TokenIcon.js.map +1 -1
  104. package/dist/esm/react/web/ui/components/token/TokenSymbol.js +4 -4
  105. package/dist/esm/react/web/ui/components/token/TokenSymbol.js.map +1 -1
  106. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletFormUI.js +2 -2
  107. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletFormUI.js.map +1 -1
  108. package/dist/esm/utils/extensions/drops/get-claim-params.js +3 -2
  109. package/dist/esm/utils/extensions/drops/get-claim-params.js.map +1 -1
  110. package/dist/esm/version.js +1 -1
  111. package/dist/esm/wallets/in-app/web/ecosystem.js +3 -14
  112. package/dist/esm/wallets/in-app/web/ecosystem.js.map +1 -1
  113. package/dist/esm/wallets/smart/index.js +4 -18
  114. package/dist/esm/wallets/smart/index.js.map +1 -1
  115. package/dist/esm/wallets/smart/lib/bundler.js +1 -1
  116. package/dist/esm/wallets/smart/lib/bundler.js.map +1 -1
  117. package/dist/esm/wallets/smart/lib/userop.js +63 -9
  118. package/dist/esm/wallets/smart/lib/userop.js.map +1 -1
  119. package/dist/types/chains/chain-definitions/anvil.d.ts +1 -0
  120. package/dist/types/chains/chain-definitions/anvil.d.ts.map +1 -1
  121. package/dist/types/chains/chain-definitions/arbitrum-nova.d.ts +1 -0
  122. package/dist/types/chains/chain-definitions/arbitrum-nova.d.ts.map +1 -1
  123. package/dist/types/chains/chain-definitions/arbitrum-sepolia.d.ts +1 -0
  124. package/dist/types/chains/chain-definitions/arbitrum-sepolia.d.ts.map +1 -1
  125. package/dist/types/chains/chain-definitions/arbitrum.d.ts +1 -0
  126. package/dist/types/chains/chain-definitions/arbitrum.d.ts.map +1 -1
  127. package/dist/types/chains/chain-definitions/avalanche-fuji.d.ts +1 -0
  128. package/dist/types/chains/chain-definitions/avalanche-fuji.d.ts.map +1 -1
  129. package/dist/types/chains/chain-definitions/avalanche.d.ts +1 -0
  130. package/dist/types/chains/chain-definitions/avalanche.d.ts.map +1 -1
  131. package/dist/types/chains/chain-definitions/base-sepolia.d.ts +1 -0
  132. package/dist/types/chains/chain-definitions/base-sepolia.d.ts.map +1 -1
  133. package/dist/types/chains/chain-definitions/base.d.ts +1 -0
  134. package/dist/types/chains/chain-definitions/base.d.ts.map +1 -1
  135. package/dist/types/chains/chain-definitions/bsc-testnet.d.ts +1 -0
  136. package/dist/types/chains/chain-definitions/bsc-testnet.d.ts.map +1 -1
  137. package/dist/types/chains/chain-definitions/bsc.d.ts +1 -0
  138. package/dist/types/chains/chain-definitions/bsc.d.ts.map +1 -1
  139. package/dist/types/chains/chain-definitions/ethereum.d.ts +2 -0
  140. package/dist/types/chains/chain-definitions/ethereum.d.ts.map +1 -1
  141. package/dist/types/chains/chain-definitions/hardhat.d.ts +1 -0
  142. package/dist/types/chains/chain-definitions/hardhat.d.ts.map +1 -1
  143. package/dist/types/chains/chain-definitions/linea-sepolia.d.ts +1 -0
  144. package/dist/types/chains/chain-definitions/linea-sepolia.d.ts.map +1 -1
  145. package/dist/types/chains/chain-definitions/linea.d.ts +1 -0
  146. package/dist/types/chains/chain-definitions/linea.d.ts.map +1 -1
  147. package/dist/types/chains/chain-definitions/optimism-sepolia.d.ts +1 -0
  148. package/dist/types/chains/chain-definitions/optimism-sepolia.d.ts.map +1 -1
  149. package/dist/types/chains/chain-definitions/optimism.d.ts +1 -0
  150. package/dist/types/chains/chain-definitions/optimism.d.ts.map +1 -1
  151. package/dist/types/chains/chain-definitions/polygon-amoy.d.ts +1 -0
  152. package/dist/types/chains/chain-definitions/polygon-amoy.d.ts.map +1 -1
  153. package/dist/types/chains/chain-definitions/polygon-mumbai.d.ts +2 -0
  154. package/dist/types/chains/chain-definitions/polygon-mumbai.d.ts.map +1 -1
  155. package/dist/types/chains/chain-definitions/polygon.d.ts +1 -0
  156. package/dist/types/chains/chain-definitions/polygon.d.ts.map +1 -1
  157. package/dist/types/chains/chain-definitions/sepolia.d.ts +1 -0
  158. package/dist/types/chains/chain-definitions/sepolia.d.ts.map +1 -1
  159. package/dist/types/chains/chain-definitions/zksync-sepolia.d.ts +1 -0
  160. package/dist/types/chains/chain-definitions/zksync-sepolia.d.ts.map +1 -1
  161. package/dist/types/chains/chain-definitions/zksync.d.ts +1 -0
  162. package/dist/types/chains/chain-definitions/zksync.d.ts.map +1 -1
  163. package/dist/types/chains/chain-definitions/zora-sepolia.d.ts +1 -0
  164. package/dist/types/chains/chain-definitions/zora-sepolia.d.ts.map +1 -1
  165. package/dist/types/chains/chain-definitions/zora.d.ts +1 -0
  166. package/dist/types/chains/chain-definitions/zora.d.ts.map +1 -1
  167. package/dist/types/chains/types.d.ts +1 -0
  168. package/dist/types/chains/types.d.ts.map +1 -1
  169. package/dist/types/chains/utils.d.ts +1 -0
  170. package/dist/types/chains/utils.d.ts.map +1 -1
  171. package/dist/types/exports/react.d.ts +1 -0
  172. package/dist/types/exports/react.d.ts.map +1 -1
  173. package/dist/types/exports/wallets/smart.d.ts +1 -0
  174. package/dist/types/exports/wallets/smart.d.ts.map +1 -1
  175. package/dist/types/react/core/connectionManager.d.ts +1 -0
  176. package/dist/types/react/core/connectionManager.d.ts.map +1 -1
  177. package/dist/types/react/core/hooks/others/useChainQuery.d.ts +24 -10
  178. package/dist/types/react/core/hooks/others/useChainQuery.d.ts.map +1 -1
  179. package/dist/types/react/core/hooks/wallets/useActiveWalletChain.d.ts +1 -0
  180. package/dist/types/react/core/hooks/wallets/useActiveWalletChain.d.ts.map +1 -1
  181. package/dist/types/react/native/hooks/wallets/useActiveWalletChain.d.ts +1 -0
  182. package/dist/types/react/native/hooks/wallets/useActiveWalletChain.d.ts.map +1 -1
  183. package/dist/types/react/native/index.d.ts +1 -0
  184. package/dist/types/react/native/index.d.ts.map +1 -1
  185. package/dist/types/react/native/ui/components/ChainIcon.d.ts.map +1 -1
  186. package/dist/types/react/web/hooks/wallets/useActiveWalletChain.d.ts +1 -0
  187. package/dist/types/react/web/hooks/wallets/useActiveWalletChain.d.ts.map +1 -1
  188. package/dist/types/react/web/index.d.ts +1 -0
  189. package/dist/types/react/web/index.d.ts.map +1 -1
  190. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  191. package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts +142 -0
  192. package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts.map +1 -1
  193. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  194. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
  195. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +1 -1
  196. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +4 -0
  197. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
  198. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts +1 -0
  199. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map +1 -1
  200. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.d.ts.map +1 -1
  201. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.d.ts.map +1 -1
  202. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
  203. package/dist/types/react/web/ui/components/ChainIcon.d.ts +1 -2
  204. package/dist/types/react/web/ui/components/ChainIcon.d.ts.map +1 -1
  205. package/dist/types/react/web/ui/components/ChainName.d.ts.map +1 -1
  206. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts.map +1 -1
  207. package/dist/types/utils/extensions/drops/get-claim-params.d.ts.map +1 -1
  208. package/dist/types/version.d.ts +1 -1
  209. package/dist/types/wallets/in-app/web/ecosystem.d.ts +3 -14
  210. package/dist/types/wallets/in-app/web/ecosystem.d.ts.map +1 -1
  211. package/dist/types/wallets/manager/index.d.ts +1 -0
  212. package/dist/types/wallets/manager/index.d.ts.map +1 -1
  213. package/dist/types/wallets/smart/index.d.ts.map +1 -1
  214. package/dist/types/wallets/smart/lib/bundler.d.ts +1 -2
  215. package/dist/types/wallets/smart/lib/bundler.d.ts.map +1 -1
  216. package/dist/types/wallets/smart/lib/userop.d.ts +53 -8
  217. package/dist/types/wallets/smart/lib/userop.d.ts.map +1 -1
  218. package/package.json +1 -1
  219. package/src/chains/types.ts +1 -1
  220. package/src/chains/utils.ts +9 -7
  221. package/src/exports/react.ts +5 -0
  222. package/src/exports/wallets/smart.ts +2 -0
  223. package/src/extensions/erc1155/drop1155.test.ts +7 -0
  224. package/src/extensions/erc20/drop20.test.ts +55 -0
  225. package/src/extensions/erc721/drop721.test.ts +28 -0
  226. package/src/react/core/hooks/others/useChainQuery.ts +116 -35
  227. package/src/react/native/ui/components/ChainIcon.tsx +3 -4
  228. package/src/react/native/ui/connect/ConnectedModal.tsx +4 -4
  229. package/src/react/native/ui/connect/SendScreen.tsx +3 -3
  230. package/src/react/web/ui/ConnectWallet/Details.tsx +13 -12
  231. package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +421 -323
  232. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +4 -10
  233. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +17 -15
  234. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +6 -4
  235. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.tsx +4 -4
  236. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +4 -4
  237. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +4 -4
  238. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.tsx +3 -3
  239. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.tsx +14 -9
  240. package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/TokenInfoRow.tsx +3 -4
  241. package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +10 -6
  242. package/src/react/web/ui/components/ChainIcon.tsx +2 -3
  243. package/src/react/web/ui/components/ChainName.tsx +4 -6
  244. package/src/react/web/ui/components/TokenIcon.tsx +4 -4
  245. package/src/react/web/ui/components/token/TokenSymbol.tsx +4 -4
  246. package/src/react/web/wallets/ecosystem/EcosystemWalletFormUI.tsx +6 -10
  247. package/src/utils/extensions/drops/get-claim-params.ts +4 -2
  248. package/src/version.ts +1 -1
  249. package/src/wallets/in-app/web/ecosystem.ts +3 -14
  250. package/src/wallets/smart/index.ts +7 -24
  251. package/src/wallets/smart/lib/bundler.ts +6 -5
  252. package/src/wallets/smart/lib/userop.ts +81 -11
@@ -3,18 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ChainButton = void 0;
5
5
  exports.NetworkSelectorContent = NetworkSelectorContent;
6
+ exports.useNetworkSwitcherModal = useNetworkSwitcherModal;
6
7
  const jsx_runtime_1 = require("react/jsx-runtime");
7
8
  const styled_1 = require("@emotion/styled");
8
9
  const react_icons_1 = require("@radix-ui/react-icons");
9
10
  const fuse_js_1 = require("fuse.js");
10
11
  const react_1 = require("react");
11
- const utils_js_1 = require("../../../../chains/utils.js");
12
12
  const CustomThemeProvider_js_1 = require("../../../core/design-system/CustomThemeProvider.js");
13
13
  const index_js_1 = require("../../../core/design-system/index.js");
14
14
  const useChainQuery_js_1 = require("../../../core/hooks/others/useChainQuery.js");
15
+ const RootElementContext_js_1 = require("../../../core/providers/RootElementContext.js");
15
16
  const useActiveWalletChain_js_1 = require("../../hooks/wallets/useActiveWalletChain.js");
16
17
  const useSwitchActiveWalletChain_js_1 = require("../../hooks/wallets/useSwitchActiveWalletChain.js");
17
18
  const ChainIcon_js_1 = require("../components/ChainIcon.js");
19
+ const Modal_js_1 = require("../components/Modal.js");
18
20
  const Skeleton_js_1 = require("../components/Skeleton.js");
19
21
  const Spacer_js_1 = require("../components/Spacer.js");
20
22
  const Spinner_js_1 = require("../components/Spinner.js");
@@ -26,198 +28,176 @@ const text_js_1 = require("../components/text.js");
26
28
  const elements_js_1 = require("../design-system/elements.js");
27
29
  const useDebouncedValue_js_1 = require("../hooks/useDebouncedValue.js");
28
30
  const useShowMore_js_1 = require("../hooks/useShowMore.js");
29
- let fuseInstances = undefined;
30
- let fuseInitializationStarted = false;
31
- // initialize fuse instances if not already initialized
32
- function initializeFuseInstances() {
33
- if (fuseInitializationStarted) {
34
- return;
35
- }
36
- fuseInitializationStarted = true;
37
- const fuseConfig = {
38
- threshold: 0.4,
39
- keys: [
40
- {
41
- name: "name",
42
- weight: 1,
43
- },
44
- {
45
- name: "chainId",
46
- weight: 1,
47
- },
48
- ],
49
- };
50
- fuseInstances = {
51
- all: new fuse_js_1.default([], fuseConfig),
52
- popular: new fuse_js_1.default([], fuseConfig),
53
- recent: new fuse_js_1.default([], fuseConfig),
54
- };
55
- }
56
- function useLoadChains(allChainsInput, popularChainIds, recentChainIds) {
57
- // load all chains with react query
58
- const chainsQueries = (0, useChainQuery_js_1.useChainsQuery)(allChainsInput, 50);
59
- const isLoading = chainsQueries.some((q) => q.isLoading);
60
- const { allChains, chainsMap } = (0, react_1.useMemo)(() => {
61
- const _chains = [];
62
- const _chainsMap = new Map();
63
- if (isLoading) {
64
- return { allChains: [], chainsMap: _chainsMap };
65
- }
66
- for (const chainQuery of chainsQueries) {
67
- if (chainQuery.data) {
68
- _chains.push({
69
- ...chainQuery.data,
70
- });
71
- }
72
- }
73
- for (const chain of _chains) {
74
- _chainsMap.set(chain.chainId, chain);
75
- }
76
- return { allChains: _chains, chainsMap: _chainsMap, isLoading: false };
77
- }, [chainsQueries, isLoading]);
78
- const recentChains = (0, react_1.useMemo)(() => {
79
- if (!recentChainIds) {
80
- return [];
81
- }
82
- const _recentChains = [];
83
- for (const chainId of recentChainIds) {
84
- const _chain = chainsMap.get(chainId);
85
- if (_chain) {
86
- _recentChains.push(_chain);
87
- }
88
- }
89
- return _recentChains;
90
- }, [recentChainIds, chainsMap]);
91
- const popularChains = (0, react_1.useMemo)(() => {
92
- if (!popularChainIds) {
93
- return [];
94
- }
95
- const _popularChains = [];
96
- for (const chainId of popularChainIds) {
97
- const _chain = chainsMap.get(chainId);
98
- if (_chain) {
99
- _popularChains.push(_chain);
100
- }
101
- }
102
- return _popularChains;
103
- }, [popularChainIds, chainsMap]);
104
- return {
105
- allChains,
106
- popularChains,
107
- recentChains,
108
- isLoading,
109
- };
110
- }
31
+ const getConnectLocale_js_1 = require("./locale/getConnectLocale.js");
111
32
  /**
112
33
  * @internal
113
34
  */
114
35
  function NetworkSelectorContent(props) {
115
- const chainsData = useLoadChains(props.chains, props.networkSelector?.popularChainIds || [], props.networkSelector?.recentChainIds || []);
116
- initializeFuseInstances();
117
- return (0, jsx_runtime_1.jsx)(NetworkSelectorContentInner, { ...props, chainsData: chainsData });
118
- }
119
- function NetworkSelectorContentInner(props) {
120
- const { chainsData, connectLocale } = props;
121
- const chainMap = (0, react_1.useMemo)(() => {
122
- const _chainMap = new Map();
123
- for (const chain of props.chains) {
124
- _chainMap.set(chain.id, chain);
125
- }
126
- return _chainMap;
127
- }, [props.chains]);
128
- const locale = connectLocale.networkSelector;
36
+ const locale = props.connectLocale.networkSelector;
129
37
  const [searchTerm, setSearchTerm] = (0, react_1.useState)("");
130
38
  const [selectedTab, setSelectedTab] = (0, react_1.useState)("all");
131
39
  const deferredSearchTerm = (0, useDebouncedValue_js_1.useDebouncedValue)(searchTerm, 300);
132
40
  const { onSwitch, onCustomClick } = props.networkSelector || {};
133
- const allChainsTab = (0, react_1.useMemo)(() => {
134
- return filterChainByType(chainsData.allChains, selectedTab);
135
- }, [chainsData.allChains, selectedTab]);
136
- const popularChainsTab = (0, react_1.useMemo)(() => {
137
- return filterChainByType(chainsData.popularChains, selectedTab);
138
- }, [chainsData.popularChains, selectedTab]);
139
- const recentChainsTab = (0, react_1.useMemo)(() => {
140
- return filterChainByType(chainsData.recentChains, selectedTab);
141
- }, [chainsData.recentChains, selectedTab]);
142
- // chains filtered by search term + type
143
- const allChainsFiltered = (0, react_1.useMemo)(() => {
144
- if (!fuseInstances) {
145
- return allChainsTab;
41
+ // labels
42
+ const othersLabel = locale.categoryLabel.others;
43
+ const popularLabel = locale.categoryLabel.popular;
44
+ const recentLabel = locale.categoryLabel.recentlyUsed;
45
+ // create sections, chainToSectionMap and allChains
46
+ const { chainSections, allChains, allChainsToSectionMap } = (0, react_1.useMemo)(() => {
47
+ const chainSectionsValue = [];
48
+ const allChainsValue = [];
49
+ const allChainsToSectionMapValue = new Map();
50
+ function addChain(c, section) {
51
+ allChainsToSectionMapValue.set(c.id, section);
52
+ allChainsValue.push(c);
146
53
  }
147
- if (deferredSearchTerm === "") {
148
- return allChainsTab;
54
+ // if new API is used
55
+ if (props.networkSelector?.sections) {
56
+ for (const s of props.networkSelector.sections) {
57
+ const chainsToAdd = s.chains.filter((c) => !allChainsToSectionMapValue.has(c.id));
58
+ if (chainsToAdd.length > 0) {
59
+ chainSectionsValue.push({
60
+ label: s.label,
61
+ chains: chainsToAdd,
62
+ });
63
+ for (const c of chainsToAdd) {
64
+ addChain(c, s.label);
65
+ }
66
+ }
67
+ }
68
+ }
69
+ // if old API is used
70
+ else {
71
+ const allChainsMap = new Map(props.chains.map((c) => [c.id, c]));
72
+ // add all recent chains
73
+ if (props.networkSelector?.recentChainIds &&
74
+ props.networkSelector?.recentChainIds.length > 0) {
75
+ const recentChains = props.networkSelector.recentChainIds
76
+ .map((id) => allChainsMap.get(id))
77
+ .filter((c) => c !== undefined);
78
+ chainSectionsValue.push({
79
+ label: recentLabel,
80
+ chains: recentChains,
81
+ });
82
+ for (const c of recentChains) {
83
+ addChain(c, recentLabel);
84
+ }
85
+ }
86
+ // then add all popular chains ( exclude already added chains )
87
+ if (props.networkSelector?.popularChainIds &&
88
+ props.networkSelector.popularChainIds.length > 0) {
89
+ const popularChains = props.networkSelector.popularChainIds
90
+ .map((id) => allChainsMap.get(id))
91
+ .filter((c) => c !== undefined);
92
+ const chainsToAdd = popularChains.filter((c) => !allChainsToSectionMapValue.has(c.id));
93
+ if (chainsToAdd.length > 0) {
94
+ chainSectionsValue.push({
95
+ label: popularLabel,
96
+ chains: chainsToAdd,
97
+ });
98
+ for (const c of chainsToAdd) {
99
+ addChain(c, popularLabel);
100
+ }
101
+ }
102
+ }
149
103
  }
150
- fuseInstances.all.setCollection(allChainsTab);
151
- return fuseInstances.all.search(deferredSearchTerm).map((r) => r.item);
152
- }, [allChainsTab, deferredSearchTerm]);
153
- const popularChainsFiltered = (0, react_1.useMemo)(() => {
154
- if (!fuseInstances) {
155
- return popularChainsTab;
104
+ // add all other chains ( exclude already added chains )
105
+ const otherChainsToAdd = props.chains.filter((c) => !allChainsToSectionMapValue.has(c.id));
106
+ if (otherChainsToAdd.length > 0) {
107
+ chainSectionsValue.push({
108
+ label: othersLabel,
109
+ chains: otherChainsToAdd,
110
+ });
111
+ for (const c of otherChainsToAdd) {
112
+ addChain(c, othersLabel);
113
+ }
156
114
  }
115
+ return {
116
+ chainSections: chainSectionsValue,
117
+ allChains: allChainsValue,
118
+ allChainsToSectionMap: allChainsToSectionMapValue,
119
+ };
120
+ }, [
121
+ props.networkSelector?.sections,
122
+ props.networkSelector?.recentChainIds,
123
+ props.networkSelector?.popularChainIds,
124
+ props.chains,
125
+ recentLabel,
126
+ popularLabel,
127
+ othersLabel,
128
+ ]);
129
+ // fuse instance for searching
130
+ const fuse = (0, react_1.useMemo)(() => {
131
+ return new fuse_js_1.default(allChains, {
132
+ threshold: 0.4,
133
+ keys: [
134
+ {
135
+ name: "name",
136
+ weight: 1,
137
+ },
138
+ {
139
+ name: "chainId",
140
+ weight: 1,
141
+ },
142
+ ],
143
+ });
144
+ }, [allChains]);
145
+ // chains filtered by search term
146
+ const searchedChainSections = (0, react_1.useMemo)(() => {
157
147
  if (deferredSearchTerm === "") {
158
- return popularChainsTab;
148
+ return undefined;
159
149
  }
160
- fuseInstances.popular.setCollection(popularChainsTab);
161
- return fuseInstances.popular.search(deferredSearchTerm).map((r) => r.item);
162
- }, [deferredSearchTerm, popularChainsTab]);
163
- const recentChainsFiltered = (0, react_1.useMemo)(() => {
164
- if (!fuseInstances) {
165
- return recentChainsTab;
150
+ const filteredChainSectionsValue = [];
151
+ const filteredAllChains = fuse
152
+ .search(deferredSearchTerm)
153
+ .map((r) => r.item);
154
+ for (const c of filteredAllChains) {
155
+ const label = allChainsToSectionMap.get(c.id);
156
+ if (!label) {
157
+ return; // just a type guard, this never happens
158
+ }
159
+ const section = filteredChainSectionsValue.find((s) => s.label === label);
160
+ if (section) {
161
+ section.chains.push(c);
162
+ }
163
+ else {
164
+ filteredChainSectionsValue.push({
165
+ label,
166
+ chains: [c],
167
+ });
168
+ }
169
+ return filteredChainSectionsValue;
166
170
  }
167
- if (deferredSearchTerm === "") {
168
- return recentChainsTab;
171
+ return filteredChainSectionsValue;
172
+ }, [deferredSearchTerm, fuse, allChainsToSectionMap]) || chainSections;
173
+ const filteredChainSections = (0, react_1.useMemo)(() => {
174
+ if (selectedTab === "all") {
175
+ return searchedChainSections;
169
176
  }
170
- fuseInstances.recent.setCollection(recentChainsTab);
171
- return fuseInstances.recent.search(deferredSearchTerm).map((r) => r.item);
172
- }, [deferredSearchTerm, recentChainsTab]);
177
+ return searchedChainSections.map((section) => ({
178
+ label: section.label,
179
+ chains: section.chains.filter((c) => (selectedTab === "mainnet" && !c.testnet) ||
180
+ (selectedTab === "testnet" && c.testnet)),
181
+ }));
182
+ }, [searchedChainSections, selectedTab]);
173
183
  const handleSwitch = (0, react_1.useCallback)((chain) => {
174
184
  if (onSwitch) {
175
185
  onSwitch(chain);
176
186
  }
177
187
  props.closeModal();
178
188
  }, [onSwitch, props]);
179
- const allChainsToShow = (0, react_1.useMemo)(() => {
180
- if (chainsData.isLoading) {
181
- return props.chains;
182
- }
183
- return allChainsFiltered.map(utils_js_1.convertApiChainToChain);
184
- }, [allChainsFiltered, chainsData.isLoading, props.chains]);
185
- const popularChainsToShow = (0, react_1.useMemo)(() => {
186
- if (chainsData.isLoading) {
187
- return (props.networkSelector?.popularChainIds?.map((id) => chainMap.get(id)) || []);
188
- }
189
- return popularChainsFiltered.map(utils_js_1.convertApiChainToChain);
190
- }, [
191
- chainMap,
192
- chainsData.isLoading,
193
- popularChainsFiltered,
194
- props.networkSelector?.popularChainIds,
195
- ]);
196
- const recentChainsToShow = (0, react_1.useMemo)(() => {
197
- if (chainsData.isLoading) {
198
- return (props.networkSelector?.recentChainIds?.map((id) => chainMap.get(id)) || []);
199
- }
200
- return recentChainsFiltered.map(utils_js_1.convertApiChainToChain);
201
- }, [
202
- chainMap,
203
- chainsData.isLoading,
204
- props.networkSelector?.recentChainIds,
205
- recentChainsFiltered,
206
- ]);
207
189
  return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { children: [(0, jsx_runtime_1.jsx)(basic_js_1.Container, { p: "lg", children: props.onBack ? ((0, jsx_runtime_1.jsx)(basic_js_1.ModalHeader, { title: locale.title, onBack: props.onBack })) : ((0, jsx_runtime_1.jsx)(modalElements_js_1.ModalTitle, { children: locale.title })) }), props.showTabs !== false && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(basic_js_1.Container, { px: "lg", children: (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "xxs", children: [(0, jsx_runtime_1.jsx)(TabButton, { onClick: () => setSelectedTab("all"), "data-active": selectedTab === "all", children: locale.allNetworks }), (0, jsx_runtime_1.jsx)(TabButton, { onClick: () => setSelectedTab("mainnet"), "data-active": selectedTab === "mainnet", children: locale.mainnets }), (0, jsx_runtime_1.jsx)(TabButton, { onClick: () => setSelectedTab("testnet"), "data-active": selectedTab === "testnet", children: locale.testnets })] }) }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" })] })), props.showTabs === false && (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xxs" }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { px: "lg", children: (0, jsx_runtime_1.jsxs)("div", { style: {
208
190
  display: "flex",
209
191
  alignItems: "center",
210
192
  position: "relative",
211
193
  }, children: [(0, jsx_runtime_1.jsx)(StyledMagnifyingGlassIcon, { width: index_js_1.iconSize.md, height: index_js_1.iconSize.md }), (0, jsx_runtime_1.jsx)(formElements_js_1.Input, { style: {
212
194
  padding: `${index_js_1.spacing.sm} ${index_js_1.spacing.md} ${index_js_1.spacing.sm} ${index_js_1.spacing.xxl}`,
213
- }, tabIndex: -1, variant: "outline", disabled: chainsData.isLoading, placeholder: chainsData.isLoading
214
- ? "Loading chains..."
215
- : locale.inputPlaceholder, value: searchTerm, onChange: (e) => {
195
+ }, tabIndex: -1, variant: "outline", placeholder: locale.inputPlaceholder, value: searchTerm, onChange: (e) => {
216
196
  setSearchTerm(e.target.value);
217
- } }), (deferredSearchTerm !== searchTerm || chainsData.isLoading) && ((0, jsx_runtime_1.jsx)("div", { style: {
197
+ } }), deferredSearchTerm !== searchTerm && ((0, jsx_runtime_1.jsx)("div", { style: {
218
198
  position: "absolute",
219
199
  right: index_js_1.spacing.md,
220
- }, children: (0, jsx_runtime_1.jsx)(Spinner_js_1.Spinner, { size: "md", color: "accentText" }) }))] }) }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { px: "md", children: (0, jsx_runtime_1.jsx)(NetworkTabContent, { allChainIds: allChainsToShow, popularChainIds: popularChainsToShow, recentChainIds: recentChainsToShow, onSwitch: handleSwitch, renderChain: props.networkSelector?.renderChain, connectLocale: connectLocale, client: props.client, close: props.closeModal }) }), onCustomClick && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(basic_js_1.Line, {}), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { p: "lg", children: (0, jsx_runtime_1.jsx)(buttons_js_1.Button, { fullWidth: true, variant: "link", onClick: () => {
200
+ }, children: (0, jsx_runtime_1.jsx)(Spinner_js_1.Spinner, { size: "md", color: "accentText" }) }))] }) }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { px: "md", children: (0, jsx_runtime_1.jsx)(NetworkTabContent, { chainSections: filteredChainSections, onSwitch: handleSwitch, renderChain: props.networkSelector?.renderChain, connectLocale: props.connectLocale, client: props.client, close: props.closeModal }) }), onCustomClick && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(basic_js_1.Line, {}), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { p: "lg", children: (0, jsx_runtime_1.jsx)(buttons_js_1.Button, { fullWidth: true, variant: "link", onClick: () => {
221
201
  onCustomClick();
222
202
  }, style: {
223
203
  display: "flex",
@@ -225,34 +205,22 @@ function NetworkSelectorContentInner(props) {
225
205
  boxShadow: "none",
226
206
  }, children: locale.addCustomNetwork }) })] }))] }));
227
207
  }
228
- /**
229
- *
230
- * @internal
231
- */
232
- const filterChainByType = (chains, type) => {
233
- if (type === "all") {
234
- return chains;
235
- }
236
- if (type === "testnet") {
237
- return chains.filter((c) => c.testnet);
238
- }
239
- return chains.filter((c) => !c.testnet);
240
- };
241
208
  /**
242
209
  *
243
210
  * @internal
244
211
  */
245
212
  const NetworkTabContent = (props) => {
246
- const locale = props.connectLocale.networkSelector.categoryLabel;
247
- const { recentChainIds, popularChainIds, allChainIds } = props;
248
- const noChainsToShow = recentChainIds?.length === 0 &&
249
- popularChainIds?.length === 0 &&
250
- allChainIds.length === 0;
251
- return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { scrollY: true, animate: "fadein", style: {
213
+ const { chainSections } = props;
214
+ const noChainsToShow = chainSections.every((section) => section.chains.length === 0);
215
+ return ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { scrollY: true, animate: "fadein", style: {
252
216
  height: "330px",
253
217
  paddingBottom: index_js_1.spacing.lg,
254
- }, children: [recentChainIds && recentChainIds.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(SectionLabel, { children: locale.recentlyUsed }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" }), (0, jsx_runtime_1.jsx)(NetworkList, { chains: recentChainIds, onSwitch: props.onSwitch, renderChain: props.renderChain, close: props.close, client: props.client, connectLocale: props.connectLocale }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" })] })), popularChainIds && popularChainIds.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(SectionLabel, { children: locale.popular }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" }), (0, jsx_runtime_1.jsx)(NetworkList, { chains: popularChainIds, onSwitch: props.onSwitch, renderChain: props.renderChain, close: props.close, client: props.client, connectLocale: props.connectLocale }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" })] })), ((popularChainIds && popularChainIds.length > 0) ||
255
- (recentChainIds && recentChainIds.length > 0)) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SectionLabel, { children: locale.others }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" })] })), (0, jsx_runtime_1.jsx)(NetworkList, { chains: allChainIds, onSwitch: props.onSwitch, renderChain: props.renderChain, close: props.close, client: props.client, connectLocale: props.connectLocale }), noChainsToShow && ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "md", center: "both", color: "secondaryText", children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xl" }), (0, jsx_runtime_1.jsx)(react_icons_1.CrossCircledIcon, { width: index_js_1.iconSize.xl, height: index_js_1.iconSize.xl }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { children: " No Results " })] }))] }));
218
+ }, children: noChainsToShow ? ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "md", center: "both", color: "secondaryText", children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xl" }), (0, jsx_runtime_1.jsx)(react_icons_1.CrossCircledIcon, { width: index_js_1.iconSize.xl, height: index_js_1.iconSize.xl }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { children: " No Results " })] })) : (chainSections.map((section, idx) => {
219
+ if (section.chains.length === 0) {
220
+ return null;
221
+ }
222
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [idx !== 0 && (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), (0, jsx_runtime_1.jsx)(SectionLabel, { children: section.label }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xs" }), (0, jsx_runtime_1.jsx)(NetworkList, { chains: section.chains, onSwitch: props.onSwitch, renderChain: props.renderChain, close: props.close, client: props.client, connectLocale: props.connectLocale })] }, section.label));
223
+ })) }));
256
224
  };
257
225
  const NetworkList = /* @__PURE__ */ (0, react_1.memo)(function NetworkList(props) {
258
226
  // show 10 items first, when reaching the last item, show 10 more
@@ -303,15 +271,16 @@ exports.ChainButton = (0, react_1.memo)(function ChainButton(props) {
303
271
  const locale = props.connectLocale;
304
272
  const { chain, confirming, switchingFailed } = props;
305
273
  const activeChain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
306
- const { data: fetchedChain } = (0, useChainQuery_js_1.useChainQuery)(chain);
274
+ const chainNameQuery = (0, useChainQuery_js_1.useChainName)(chain);
275
+ const chainIconQuery = (0, useChainQuery_js_1.useChainIconUrl)(chain);
307
276
  let chainName;
308
- if (fetchedChain) {
309
- chainName = (0, jsx_runtime_1.jsxs)("span", { children: [fetchedChain.name, " "] });
277
+ if (chainNameQuery.name) {
278
+ chainName = (0, jsx_runtime_1.jsxs)("span", { children: [chainNameQuery.name, " "] });
310
279
  }
311
280
  else {
312
281
  chainName = (0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { width: "150px", height: "20px" });
313
282
  }
314
- return ((0, jsx_runtime_1.jsxs)(NetworkButton, { "data-active": activeChain?.id === chain.id, onClick: props.onClick, children: [fetchedChain ? ((0, jsx_runtime_1.jsx)(ChainIcon_js_1.ChainIcon, { chainIcon: fetchedChain.icon, size: index_js_1.iconSize.lg, active: activeChain?.id === chain.id, loading: "lazy", client: props.client })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { width: `${index_js_1.iconSize.lg}px`, height: `${index_js_1.iconSize.lg}px` })), confirming || switchingFailed ? ((0, jsx_runtime_1.jsxs)("div", { style: {
283
+ return ((0, jsx_runtime_1.jsxs)(NetworkButton, { "data-active": activeChain?.id === chain.id, onClick: props.onClick, children: [!chainIconQuery.isLoading ? ((0, jsx_runtime_1.jsx)(ChainIcon_js_1.ChainIcon, { chainIconUrl: chainIconQuery.url, size: index_js_1.iconSize.lg, active: activeChain?.id === chain.id, loading: "lazy", client: props.client })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { width: `${index_js_1.iconSize.lg}px`, height: `${index_js_1.iconSize.lg}px` })), confirming || switchingFailed ? ((0, jsx_runtime_1.jsxs)("div", { style: {
315
284
  display: "flex",
316
285
  flexDirection: "column",
317
286
  gap: index_js_1.spacing.xs,
@@ -386,4 +355,64 @@ const StyledMagnifyingGlassIcon = /* @__PURE__ */ (0, styled_1.default)(react_ic
386
355
  left: index_js_1.spacing.sm,
387
356
  };
388
357
  });
358
+ /**
359
+ * Hook to open the Wallet Network Switcher Modal that shows allows users to switch to different network.
360
+ *
361
+ * @example
362
+ * ```tsx
363
+ * import { createThirdwebClient } from "thirdweb";
364
+ * import { useNetworkSwitcherModal } from "thirdweb/react";
365
+ * import { base, ethereum, polygon, sepolia, arbitrum } from "thirdweb/chains";
366
+ *
367
+ * const client = createThirdwebClient({
368
+ * clientId: "<your_client_id>",
369
+ * });
370
+ *
371
+ * function Example() {
372
+ * const networkSwitcher = useNetworkSwitcherModal();
373
+ *
374
+ * function handleClick() {
375
+ * networkSwitcher.open({
376
+ * client,
377
+ * theme: 'light'
378
+ * sections: [
379
+ * { label: 'Recently used', chains: [arbitrum, polygon] },
380
+ * { label: 'Popular', chains: [base, ethereum, sepolia] },
381
+ * ]
382
+ * });
383
+ * }
384
+ *
385
+ * return <button onClick={handleClick}> Switch Network </button>
386
+ * }
387
+ * ```
388
+ */
389
+ function useNetworkSwitcherModal() {
390
+ const activeChain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
391
+ const setRootEl = (0, react_1.useContext)(RootElementContext_js_1.SetRootElementContext);
392
+ const closeModal = (0, react_1.useCallback)(() => {
393
+ setRootEl(null);
394
+ }, [setRootEl]);
395
+ const openNetworkSwitcher = (0, react_1.useCallback)(async (props) => {
396
+ if (!activeChain) {
397
+ throw new Error("No active wallet found");
398
+ }
399
+ const locale = await (0, getConnectLocale_js_1.getConnectLocale)(props.locale || "en_US");
400
+ setRootEl((0, jsx_runtime_1.jsx)(CustomThemeProvider_js_1.CustomThemeProvider, { theme: props.theme, children: (0, jsx_runtime_1.jsx)(Modal_js_1.Modal, { size: "compact", open: true, setOpen: (value) => {
401
+ if (!value) {
402
+ closeModal();
403
+ }
404
+ }, style: {
405
+ paddingBottom: props.onCustomClick ? index_js_1.spacing.md : "0px",
406
+ }, children: (0, jsx_runtime_1.jsx)(NetworkSelectorContent, { client: props.client, closeModal: closeModal, chains: [activeChain], connectLocale: locale, networkSelector: {
407
+ onCustomClick: props.onCustomClick,
408
+ onSwitch: props.onSwitch,
409
+ renderChain: props.renderChain,
410
+ sections: props.sections,
411
+ } }) }) }));
412
+ }, [setRootEl, closeModal, activeChain]);
413
+ return {
414
+ open: openNetworkSwitcher,
415
+ close: closeModal,
416
+ };
417
+ }
389
418
  //# sourceMappingURL=NetworkSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkSelector.js","sourceRoot":"","sources":["../../../../../../src/react/web/ui/ConnectWallet/NetworkSelector.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA+Nb,wDAUC;;AAxOD,4CAAqC;AACrC,uDAA8E;AAC9E,qCAA2B;AAC3B,iCAAwE;AAGxE,0DAAqE;AAErE,+FAAoF;AACpF,mEAM8C;AAC9C,kFAGqD;AACrD,yFAAmF;AACnF,qGAA+F;AAC/F,6DAAuD;AACvD,2DAAqD;AACrD,uDAAiD;AACjD,yDAAmD;AACnD,qDAAsE;AACtE,yDAAkD;AAClD,mEAAsD;AACtD,qEAA4D;AAC5D,mDAA6C;AAC7C,8DAA+E;AAC/E,wEAAkE;AAClE,4DAAsD;AA6DtD,IAAI,aAAa,GAMD,SAAS,CAAC;AAE1B,IAAI,yBAAyB,GAAG,KAAK,CAAC;AAEtC,uDAAuD;AACvD,SAAS,uBAAuB;IAC9B,IAAI,yBAAyB,EAAE,CAAC;QAC9B,OAAO;IACT,CAAC;IAED,yBAAyB,GAAG,IAAI,CAAC;IAEjC,MAAM,UAAU,GAAG;QACjB,SAAS,EAAE,GAAG;QACd,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,CAAC;aACV;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,CAAC;aACV;SACF;KACF,CAAC;IAEF,aAAa,GAAG;QACd,GAAG,EAAE,IAAI,iBAAI,CAAC,EAAE,EAAE,UAAU,CAAC;QAC7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U,EAAE,sBAAsB;QAClC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;QAC/B,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,mBAAQ,CAAC,EAAE;QACrB,SAAS,EAAE;YACT,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;SAC3C;QAED,CAAC,gBAAK,CAAC,MAAM,CAAC,EAAE;YACd,QAAQ,EAAE,mBAAQ,CAAC,EAAE;SACtB;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,yBAAyB,GAAG,eAAe,CAAC,IAAA,gBAAM,EAAC,iCAAmB,CAAC,CAC3E,CAAC,CAAC,EAAE,EAAE;IACJ,MAAM,KAAK,GAAG,IAAA,uCAAc,GAAE,CAAC;IAC/B,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa;QACjC,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,kBAAO,CAAC,EAAE;KACjB,CAAC;AACJ,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"NetworkSelector.js","sourceRoot":"","sources":["../../../../../../src/react/web/ui/ConnectWallet/NetworkSelector.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAqJb,wDAoTC;AAqaD,0DAmDC;;AAh6BD,4CAAqC;AACrC,uDAA8E;AAC9E,qCAA2B;AAC3B,iCAQe;AAIf,+FAG4D;AAC5D,mEAO8C;AAC9C,kFAGqD;AACrD,yFAAsF;AACtF,yFAAmF;AACnF,qGAA+F;AAC/F,6DAAuD;AACvD,qDAA+C;AAC/C,2DAAqD;AACrD,uDAAiD;AACjD,yDAAmD;AACnD,qDAAsE;AACtE,yDAAkD;AAClD,mEAAsD;AACtD,qEAA4D;AAC5D,mDAA6C;AAC7C,8DAA+E;AAC/E,wEAAkE;AAClE,4DAAsD;AAEtD,sEAAgE;AAgGhE;;GAEG;AAEH,SAAgB,sBAAsB,CAAC,KAAkC;IACvE,MAAM,MAAM,GAAG,KAAK,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AAC,EACD,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CACrC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,UAAU;KAClB,CAAC;AACJ,CAAC"}
@@ -85,8 +85,6 @@ function BuyScreenContent(props) {
85
85
  const { client, supportedDestinations, connectLocale, payOptions, buyForTx } = props;
86
86
  const account = (0, useActiveAccount_js_1.useActiveAccount)();
87
87
  const activeChain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
88
- // prefetch chains metadata for destination chains
89
- (0, useChainQuery_js_1.useChainsQuery)(supportedDestinations.map((x) => x.chain) || [], 50);
90
88
  // screen
91
89
  const { screen, setScreen, drawerScreen, setDrawerScreen, drawerRef, drawerOverlayRef, closeDrawer, } = useBuyScreenStates();
92
90
  // UI selection
@@ -418,12 +416,12 @@ function FiatScreenContent(props) {
418
416
  return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "md", animate: "fadein", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(PayWIthCreditCard_js_1.PayWithCreditCard, { isLoading: fiatQuoteQuery.isLoading, value: fiatQuoteQuery.data?.fromCurrencyWithFees.amount, client: client, currency: selectedCurrency, onSelectCurrency: showCurrencySelector }), (0, jsx_runtime_1.jsx)(EstimatedTimeAndFees_js_1.EstimatedTimeAndFees, { quoteIsLoading: fiatQuoteQuery.isLoading, estimatedSeconds: fiatQuoteQuery.data?.estimatedDurationSeconds, onViewFees: showFees })] }), fiatQuoteQuery.error && ((0, jsx_runtime_1.jsx)("div", { children: getErrorMessage(fiatQuoteQuery.error).map((msg) => ((0, jsx_runtime_1.jsx)(text_js_1.Text, { color: "danger", size: "sm", center: true, multiline: true, children: msg }, msg))) })), (0, jsx_runtime_1.jsx)(buttons_js_1.Button, { variant: disableSubmit ? "outline" : "accent", "data-disabled": disableSubmit, disabled: disableSubmit, fullWidth: true, onClick: handleSubmit, gap: "xs", children: fiatQuoteQuery.isLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Getting price quote", (0, jsx_runtime_1.jsx)(Spinner_js_1.Spinner, { size: "sm", color: "accentText" })] })) : ("Continue") })] }));
419
417
  }
420
418
  function BuyForTxUI(props) {
421
- const chainQuery = (0, useChainQuery_js_1.useChainQuery)(props.buyForTx.tx.chain);
419
+ const chainNameQuery = (0, useChainQuery_js_1.useChainName)(props.buyForTx.tx.chain);
422
420
  return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xs" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", style: {
423
421
  justifyContent: "space-between",
424
422
  }, children: [(0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", children: "Amount Needed" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", style: {
425
423
  alignItems: "flex-end",
426
- }, children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "xs", center: "y", children: [(0, jsx_runtime_1.jsxs)(text_js_1.Text, { color: "primaryText", size: "sm", children: [props.amountNeeded, " ", props.buyForTx.tokenSymbol] }), (0, jsx_runtime_1.jsx)(TokenIcon_js_1.TokenIcon, { chain: props.buyForTx.tx.chain, client: props.client, size: "sm", token: nativeToken_js_1.NATIVE_TOKEN })] }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xxs" }), chainQuery.data ? ((0, jsx_runtime_1.jsxs)(text_js_1.Text, { size: "sm", children: [" ", chainQuery.data.name] })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { height: index_js_1.fontSize.sm, width: "50px" }))] })] }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "md" }), (0, jsx_runtime_1.jsx)(basic_js_1.Line, {}), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "md" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", style: {
424
+ }, children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "xs", center: "y", children: [(0, jsx_runtime_1.jsxs)(text_js_1.Text, { color: "primaryText", size: "sm", children: [props.amountNeeded, " ", props.buyForTx.tokenSymbol] }), (0, jsx_runtime_1.jsx)(TokenIcon_js_1.TokenIcon, { chain: props.buyForTx.tx.chain, client: props.client, size: "sm", token: nativeToken_js_1.NATIVE_TOKEN })] }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xxs" }), chainNameQuery.name ? ((0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", children: chainNameQuery.name })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { height: index_js_1.fontSize.sm, width: "50px" }))] })] }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "md" }), (0, jsx_runtime_1.jsx)(basic_js_1.Line, {}), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "md" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", style: {
427
425
  justifyContent: "space-between",
428
426
  }, children: [(0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", children: "Your Balance" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "xs", children: [(0, jsx_runtime_1.jsxs)(text_js_1.Text, { color: "primaryText", size: "sm", children: [(0, formatNumber_js_1.formatNumber)(Number((0, units_js_1.toEther)(props.buyForTx.balance)), 4), " ", props.buyForTx.tokenSymbol] }), (0, jsx_runtime_1.jsx)(TokenIcon_js_1.TokenIcon, { chain: props.buyForTx.tx.chain, client: props.client, size: "sm", token: nativeToken_js_1.NATIVE_TOKEN })] })] }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "md" }), (0, jsx_runtime_1.jsx)(basic_js_1.Line, {}), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xl" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { center: true, size: "sm", children: "Purchase" }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xxs" })] }));
429
427
  }