thirdweb 5.31.1 → 5.32.0

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 (525) hide show
  1. package/dist/cjs/exports/react.js +4 -4
  2. package/dist/cjs/exports/react.js.map +1 -1
  3. package/dist/cjs/exports/react.native.js +14 -6
  4. package/dist/cjs/exports/react.native.js.map +1 -1
  5. package/dist/cjs/exports/wallets/in-app.js +1 -1
  6. package/dist/cjs/exports/wallets/in-app.js.map +1 -1
  7. package/dist/cjs/pay/utils/definitions.js +17 -10
  8. package/dist/cjs/pay/utils/definitions.js.map +1 -1
  9. package/dist/cjs/react/core/hooks/connection/ConnectButtonProps.js.map +1 -0
  10. package/dist/cjs/react/core/hooks/connection/ConnectEmbedProps.js +3 -0
  11. package/dist/cjs/react/core/hooks/connection/ConnectEmbedProps.js.map +1 -0
  12. package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  13. package/dist/cjs/react/core/hooks/wallets/useAutoConnect.js.map +1 -1
  14. package/dist/cjs/react/core/hooks/wallets/useSendToken.js +81 -0
  15. package/dist/cjs/react/core/hooks/wallets/useSendToken.js.map +1 -0
  16. package/dist/cjs/react/{web/ui/ConnectWallet → core/utils}/defaultTokens.js +20 -25
  17. package/dist/cjs/react/core/utils/defaultTokens.js.map +1 -0
  18. package/dist/cjs/react/core/utils/isSmartWallet.js.map +1 -0
  19. package/dist/cjs/react/{web/ui/ConnectWallet/icons/dataUris.js → core/utils/socialIcons.js} +19 -2
  20. package/dist/cjs/react/core/utils/socialIcons.js.map +1 -0
  21. package/dist/cjs/react/core/utils/storage.js.map +1 -0
  22. package/dist/cjs/react/core/utils/wallet.js +85 -0
  23. package/dist/cjs/react/core/utils/wallet.js.map +1 -0
  24. package/dist/cjs/react/native/design-system/index.js +33 -0
  25. package/dist/cjs/react/native/design-system/index.js.map +1 -0
  26. package/dist/cjs/react/native/hooks/wallets/useAutoConnect.js +5 -1
  27. package/dist/cjs/react/native/hooks/wallets/useAutoConnect.js.map +1 -1
  28. package/dist/cjs/react/native/hooks/wallets/useSendToken.js +31 -0
  29. package/dist/cjs/react/native/hooks/wallets/useSendToken.js.map +1 -0
  30. package/dist/cjs/react/native/ui/components/Address.js +31 -0
  31. package/dist/cjs/react/native/ui/components/Address.js.map +1 -0
  32. package/dist/cjs/react/native/ui/components/ChainIcon.js +30 -0
  33. package/dist/cjs/react/native/ui/components/ChainIcon.js.map +1 -0
  34. package/dist/cjs/react/native/ui/components/Header.js +30 -0
  35. package/dist/cjs/react/native/ui/components/Header.js.map +1 -0
  36. package/dist/cjs/react/native/ui/components/RNImage.js +43 -0
  37. package/dist/cjs/react/native/ui/components/RNImage.js.map +1 -0
  38. package/dist/cjs/react/native/ui/components/Skeleton.js +62 -0
  39. package/dist/cjs/react/native/ui/components/Skeleton.js.map +1 -0
  40. package/dist/cjs/react/native/ui/components/TokenIcon.js +16 -0
  41. package/dist/cjs/react/native/ui/components/TokenIcon.js.map +1 -0
  42. package/dist/cjs/react/native/ui/components/WalletImage.js +69 -0
  43. package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -0
  44. package/dist/cjs/react/native/ui/components/button.js +23 -8
  45. package/dist/cjs/react/native/ui/components/button.js.map +1 -1
  46. package/dist/cjs/react/native/ui/components/input.js +64 -0
  47. package/dist/cjs/react/native/ui/components/input.js.map +1 -0
  48. package/dist/cjs/react/native/ui/components/spacer.js +10 -0
  49. package/dist/cjs/react/native/ui/components/spacer.js.map +1 -0
  50. package/dist/cjs/react/native/ui/components/text.js +10 -7
  51. package/dist/cjs/react/native/ui/components/text.js.map +1 -1
  52. package/dist/cjs/react/native/ui/connect/ConnectButton.js +106 -0
  53. package/dist/cjs/react/native/ui/connect/ConnectButton.js.map +1 -0
  54. package/dist/cjs/react/native/ui/connect/ConnectModal.js +133 -0
  55. package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -0
  56. package/dist/cjs/react/native/ui/connect/ConnectedButton.js +42 -0
  57. package/dist/cjs/react/native/ui/connect/ConnectedButton.js.map +1 -0
  58. package/dist/cjs/react/native/ui/connect/ConnectedModal.js +175 -0
  59. package/dist/cjs/react/native/ui/connect/ConnectedModal.js.map +1 -0
  60. package/dist/cjs/react/native/ui/connect/ErrorView.js +25 -0
  61. package/dist/cjs/react/native/ui/connect/ErrorView.js.map +1 -0
  62. package/dist/cjs/react/native/ui/connect/ExternalWalletsList.js +67 -0
  63. package/dist/cjs/react/native/ui/connect/ExternalWalletsList.js.map +1 -0
  64. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +167 -0
  65. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -0
  66. package/dist/cjs/react/native/ui/connect/ReceiveScreen.js +42 -0
  67. package/dist/cjs/react/native/ui/connect/ReceiveScreen.js.map +1 -0
  68. package/dist/cjs/react/native/ui/connect/SendScreen.js +82 -0
  69. package/dist/cjs/react/native/ui/connect/SendScreen.js.map +1 -0
  70. package/dist/cjs/react/native/ui/connect/SuccessView.js +25 -0
  71. package/dist/cjs/react/native/ui/connect/SuccessView.js.map +1 -0
  72. package/dist/cjs/react/native/ui/connect/TokenListScreen.js +59 -0
  73. package/dist/cjs/react/native/ui/connect/TokenListScreen.js.map +1 -0
  74. package/dist/cjs/react/native/ui/icons/svgs.js +236 -0
  75. package/dist/cjs/react/native/ui/icons/svgs.js.map +1 -0
  76. package/dist/cjs/react/native/ui/{TransactionButton/TrabsactionButton.js → transaction/TransactionButton.js} +1 -1
  77. package/dist/cjs/react/native/ui/transaction/TransactionButton.js.map +1 -0
  78. package/dist/cjs/react/native/wallets/defaultWallets.js +22 -0
  79. package/dist/cjs/react/native/wallets/defaultWallets.js.map +1 -0
  80. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  81. package/dist/cjs/react/web/hooks/wallets/useAutoConnect.js +7 -2
  82. package/dist/cjs/react/web/hooks/wallets/useAutoConnect.js.map +1 -1
  83. package/dist/cjs/react/web/hooks/wallets/useSendToken.js +31 -0
  84. package/dist/cjs/react/web/hooks/wallets/useSendToken.js.map +1 -0
  85. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +1 -1
  86. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  87. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +7 -51
  88. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  89. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +2 -8
  90. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
  91. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +0 -4
  92. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  93. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +3 -1
  94. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
  95. package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +2 -2
  96. package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
  97. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js +2 -2
  98. package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
  99. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
  100. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  101. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  102. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  103. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
  104. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  105. package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js +4 -15
  106. package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
  107. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  108. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  109. package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewFunds.js +1 -1
  110. package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewFunds.js.map +1 -1
  111. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  112. package/dist/cjs/react/web/ui/components/ChainIcon.js.map +1 -1
  113. package/dist/cjs/react/web/ui/components/TokenIcon.js +2 -2
  114. package/dist/cjs/react/web/ui/components/TokenIcon.js.map +1 -1
  115. package/dist/cjs/react/web/ui/components/WalletImage.js +12 -13
  116. package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
  117. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletHeader.js +2 -2
  118. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletHeader.js.map +1 -1
  119. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +8 -4
  120. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  121. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +5 -6
  122. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  123. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +1 -1
  124. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  125. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +1 -1
  126. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  127. package/dist/cjs/react/web/wallets/shared/SocialLogin.js +1 -1
  128. package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
  129. package/dist/cjs/version.js +1 -1
  130. package/dist/cjs/wallets/in-app/native/native-connector.js +3 -4
  131. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  132. package/dist/cjs/wallets/manager/index.js +3 -2
  133. package/dist/cjs/wallets/manager/index.js.map +1 -1
  134. package/dist/esm/exports/react.js +4 -3
  135. package/dist/esm/exports/react.js.map +1 -1
  136. package/dist/esm/exports/react.native.js +6 -2
  137. package/dist/esm/exports/react.native.js.map +1 -1
  138. package/dist/esm/exports/wallets/in-app.js +1 -1
  139. package/dist/esm/exports/wallets/in-app.js.map +1 -1
  140. package/dist/esm/pay/utils/definitions.js +15 -9
  141. package/dist/esm/pay/utils/definitions.js.map +1 -1
  142. package/dist/esm/react/core/hooks/connection/ConnectButtonProps.js.map +1 -0
  143. package/dist/esm/react/core/hooks/connection/ConnectEmbedProps.js +2 -0
  144. package/dist/esm/react/core/hooks/connection/ConnectEmbedProps.js.map +1 -0
  145. package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  146. package/dist/esm/react/core/hooks/wallets/useAutoConnect.js.map +1 -1
  147. package/dist/esm/react/core/hooks/wallets/useSendToken.js +78 -0
  148. package/dist/esm/react/core/hooks/wallets/useSendToken.js.map +1 -0
  149. package/dist/esm/react/{web/ui/ConnectWallet → core/utils}/defaultTokens.js +10 -15
  150. package/dist/esm/react/core/utils/defaultTokens.js.map +1 -0
  151. package/dist/esm/react/core/utils/isSmartWallet.js.map +1 -0
  152. package/dist/esm/react/{web/ui/ConnectWallet/icons/dataUris.js → core/utils/socialIcons.js} +18 -1
  153. package/dist/esm/react/core/utils/socialIcons.js.map +1 -0
  154. package/dist/esm/react/core/utils/storage.js.map +1 -0
  155. package/dist/esm/react/core/utils/wallet.js +80 -0
  156. package/dist/esm/react/core/utils/wallet.js.map +1 -0
  157. package/dist/esm/react/native/design-system/index.js +30 -0
  158. package/dist/esm/react/native/design-system/index.js.map +1 -0
  159. package/dist/esm/react/native/hooks/wallets/useAutoConnect.js +5 -1
  160. package/dist/esm/react/native/hooks/wallets/useAutoConnect.js.map +1 -1
  161. package/dist/esm/react/native/hooks/wallets/useSendToken.js +28 -0
  162. package/dist/esm/react/native/hooks/wallets/useSendToken.js.map +1 -0
  163. package/dist/esm/react/native/ui/components/Address.js +27 -0
  164. package/dist/esm/react/native/ui/components/Address.js.map +1 -0
  165. package/dist/esm/react/native/ui/components/ChainIcon.js +26 -0
  166. package/dist/esm/react/native/ui/components/ChainIcon.js.map +1 -0
  167. package/dist/esm/react/native/ui/components/Header.js +27 -0
  168. package/dist/esm/react/native/ui/components/Header.js.map +1 -0
  169. package/dist/esm/react/native/ui/components/RNImage.js +39 -0
  170. package/dist/esm/react/native/ui/components/RNImage.js.map +1 -0
  171. package/dist/esm/react/native/ui/components/Skeleton.js +58 -0
  172. package/dist/esm/react/native/ui/components/Skeleton.js.map +1 -0
  173. package/dist/esm/react/native/ui/components/TokenIcon.js +13 -0
  174. package/dist/esm/react/native/ui/components/TokenIcon.js.map +1 -0
  175. package/dist/esm/react/native/ui/components/WalletImage.js +65 -0
  176. package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -0
  177. package/dist/esm/react/native/ui/components/button.js +24 -10
  178. package/dist/esm/react/native/ui/components/button.js.map +1 -1
  179. package/dist/esm/react/native/ui/components/input.js +60 -0
  180. package/dist/esm/react/native/ui/components/input.js.map +1 -0
  181. package/dist/esm/react/native/ui/components/spacer.js +7 -0
  182. package/dist/esm/react/native/ui/components/spacer.js.map +1 -0
  183. package/dist/esm/react/native/ui/components/text.js +10 -7
  184. package/dist/esm/react/native/ui/components/text.js.map +1 -1
  185. package/dist/esm/react/native/ui/connect/ConnectButton.js +103 -0
  186. package/dist/esm/react/native/ui/connect/ConnectButton.js.map +1 -0
  187. package/dist/esm/react/native/ui/connect/ConnectModal.js +129 -0
  188. package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -0
  189. package/dist/esm/react/native/ui/connect/ConnectedButton.js +39 -0
  190. package/dist/esm/react/native/ui/connect/ConnectedButton.js.map +1 -0
  191. package/dist/esm/react/native/ui/connect/ConnectedModal.js +172 -0
  192. package/dist/esm/react/native/ui/connect/ConnectedModal.js.map +1 -0
  193. package/dist/esm/react/native/ui/connect/ErrorView.js +21 -0
  194. package/dist/esm/react/native/ui/connect/ErrorView.js.map +1 -0
  195. package/dist/esm/react/native/ui/connect/ExternalWalletsList.js +64 -0
  196. package/dist/esm/react/native/ui/connect/ExternalWalletsList.js.map +1 -0
  197. package/dist/esm/react/native/ui/connect/InAppWalletUI.js +163 -0
  198. package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -0
  199. package/dist/esm/react/native/ui/connect/ReceiveScreen.js +38 -0
  200. package/dist/esm/react/native/ui/connect/ReceiveScreen.js.map +1 -0
  201. package/dist/esm/react/native/ui/connect/SendScreen.js +78 -0
  202. package/dist/esm/react/native/ui/connect/SendScreen.js.map +1 -0
  203. package/dist/esm/react/native/ui/connect/SuccessView.js +21 -0
  204. package/dist/esm/react/native/ui/connect/SuccessView.js.map +1 -0
  205. package/dist/esm/react/native/ui/connect/TokenListScreen.js +54 -0
  206. package/dist/esm/react/native/ui/connect/TokenListScreen.js.map +1 -0
  207. package/dist/esm/react/native/ui/icons/svgs.js +233 -0
  208. package/dist/esm/react/native/ui/icons/svgs.js.map +1 -0
  209. package/dist/esm/react/native/ui/{TransactionButton/TrabsactionButton.js → transaction/TransactionButton.js} +1 -1
  210. package/dist/esm/react/native/ui/transaction/TransactionButton.js.map +1 -0
  211. package/dist/esm/react/native/wallets/defaultWallets.js +19 -0
  212. package/dist/esm/react/native/wallets/defaultWallets.js.map +1 -0
  213. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  214. package/dist/esm/react/web/hooks/wallets/useAutoConnect.js +7 -2
  215. package/dist/esm/react/web/hooks/wallets/useAutoConnect.js.map +1 -1
  216. package/dist/esm/react/web/hooks/wallets/useSendToken.js +28 -0
  217. package/dist/esm/react/web/hooks/wallets/useSendToken.js.map +1 -0
  218. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +1 -1
  219. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  220. package/dist/esm/react/web/ui/ConnectWallet/Details.js +7 -51
  221. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  222. package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +2 -8
  223. package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
  224. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +1 -5
  225. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  226. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +3 -1
  227. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
  228. package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +1 -1
  229. package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
  230. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js +1 -1
  231. package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
  232. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +1 -1
  233. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  234. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  235. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  236. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
  237. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
  238. package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js +5 -16
  239. package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
  240. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  241. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  242. package/dist/esm/react/web/ui/ConnectWallet/screens/ViewFunds.js +1 -1
  243. package/dist/esm/react/web/ui/ConnectWallet/screens/ViewFunds.js.map +1 -1
  244. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  245. package/dist/esm/react/web/ui/components/ChainIcon.js.map +1 -1
  246. package/dist/esm/react/web/ui/components/TokenIcon.js +1 -1
  247. package/dist/esm/react/web/ui/components/WalletImage.js +3 -4
  248. package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
  249. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletHeader.js +1 -1
  250. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletHeader.js.map +1 -1
  251. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +8 -4
  252. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  253. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +2 -3
  254. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  255. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +1 -1
  256. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  257. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +1 -1
  258. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  259. package/dist/esm/react/web/wallets/shared/SocialLogin.js +1 -1
  260. package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
  261. package/dist/esm/version.js +1 -1
  262. package/dist/esm/wallets/in-app/native/native-connector.js +3 -4
  263. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  264. package/dist/esm/wallets/manager/index.js +3 -2
  265. package/dist/esm/wallets/manager/index.js.map +1 -1
  266. package/dist/types/exports/react.d.ts +7 -6
  267. package/dist/types/exports/react.d.ts.map +1 -1
  268. package/dist/types/exports/react.native.d.ts +7 -2
  269. package/dist/types/exports/react.native.d.ts.map +1 -1
  270. package/dist/types/exports/wallets/in-app.d.ts +1 -1
  271. package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
  272. package/dist/types/pay/utils/definitions.d.ts +1 -0
  273. package/dist/types/pay/utils/definitions.d.ts.map +1 -1
  274. package/dist/types/react/{web/ui/ConnectWallet → core/hooks/connection}/ConnectButtonProps.d.ts +6 -6
  275. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -0
  276. package/dist/types/react/core/hooks/connection/ConnectEmbedProps.d.ts +264 -0
  277. package/dist/types/react/core/hooks/connection/ConnectEmbedProps.d.ts.map +1 -0
  278. package/dist/types/react/core/hooks/connection/types.d.ts +1 -1
  279. package/dist/types/react/core/hooks/connection/types.d.ts.map +1 -1
  280. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -1
  281. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  282. package/dist/types/react/core/hooks/wallets/useAutoConnect.d.ts +3 -1
  283. package/dist/types/react/core/hooks/wallets/useAutoConnect.d.ts.map +1 -1
  284. package/dist/types/react/core/hooks/wallets/useSendToken.d.ts +12 -0
  285. package/dist/types/react/core/hooks/wallets/useSendToken.d.ts.map +1 -0
  286. package/dist/types/react/{web/ui/ConnectWallet → core/utils}/defaultTokens.d.ts +1 -0
  287. package/dist/types/react/core/utils/defaultTokens.d.ts.map +1 -0
  288. package/dist/types/react/core/utils/isSmartWallet.d.ts.map +1 -0
  289. package/dist/types/react/{web/ui/ConnectWallet/icons/dataUris.d.ts → core/utils/socialIcons.d.ts} +17 -1
  290. package/dist/types/react/core/utils/socialIcons.d.ts.map +1 -0
  291. package/dist/types/react/core/utils/storage.d.ts +5 -0
  292. package/dist/types/react/core/utils/storage.d.ts.map +1 -0
  293. package/dist/types/react/core/utils/wallet.d.ts +26 -0
  294. package/dist/types/react/core/utils/wallet.d.ts.map +1 -0
  295. package/dist/types/react/native/design-system/index.d.ts +30 -0
  296. package/dist/types/react/native/design-system/index.d.ts.map +1 -0
  297. package/dist/types/react/native/hooks/wallets/useAutoConnect.d.ts.map +1 -1
  298. package/dist/types/react/{web/ui/hooks → native/hooks/wallets}/useSendToken.d.ts +18 -1
  299. package/dist/types/react/native/hooks/wallets/useSendToken.d.ts.map +1 -0
  300. package/dist/types/react/native/ui/components/Address.d.ts +9 -0
  301. package/dist/types/react/native/ui/components/Address.d.ts.map +1 -0
  302. package/dist/types/react/native/ui/components/ChainIcon.d.ts +11 -0
  303. package/dist/types/react/native/ui/components/ChainIcon.d.ts.map +1 -0
  304. package/dist/types/react/native/ui/components/Header.d.ts +10 -0
  305. package/dist/types/react/native/ui/components/Header.d.ts.map +1 -0
  306. package/dist/types/react/native/ui/components/RNImage.d.ts +10 -0
  307. package/dist/types/react/native/ui/components/RNImage.d.ts.map +1 -0
  308. package/dist/types/react/native/ui/components/Skeleton.d.ts +11 -0
  309. package/dist/types/react/native/ui/components/Skeleton.d.ts.map +1 -0
  310. package/dist/types/react/native/ui/components/TokenIcon.d.ts +15 -0
  311. package/dist/types/react/native/ui/components/TokenIcon.d.ts.map +1 -0
  312. package/dist/types/react/native/ui/components/WalletImage.d.ts +9 -0
  313. package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -0
  314. package/dist/types/react/native/ui/components/button.d.ts +5 -1
  315. package/dist/types/react/native/ui/components/button.d.ts.map +1 -1
  316. package/dist/types/react/native/ui/components/input.d.ts +12 -0
  317. package/dist/types/react/native/ui/components/input.d.ts.map +1 -0
  318. package/dist/types/react/native/ui/components/spacer.d.ts +5 -0
  319. package/dist/types/react/native/ui/components/spacer.d.ts.map +1 -0
  320. package/dist/types/react/native/ui/components/text.d.ts +1 -1
  321. package/dist/types/react/native/ui/components/text.d.ts.map +1 -1
  322. package/dist/types/react/native/ui/connect/ConnectButton.d.ts +18 -0
  323. package/dist/types/react/native/ui/connect/ConnectButton.d.ts.map +1 -0
  324. package/dist/types/react/native/ui/connect/ConnectModal.d.ts +40 -0
  325. package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -0
  326. package/dist/types/react/native/ui/connect/ConnectedButton.d.ts +9 -0
  327. package/dist/types/react/native/ui/connect/ConnectedButton.d.ts.map +1 -0
  328. package/dist/types/react/native/ui/connect/ConnectedModal.d.ts +14 -0
  329. package/dist/types/react/native/ui/connect/ConnectedModal.d.ts.map +1 -0
  330. package/dist/types/react/native/ui/connect/ErrorView.d.ts +7 -0
  331. package/dist/types/react/native/ui/connect/ErrorView.d.ts.map +1 -0
  332. package/dist/types/react/native/ui/connect/ExternalWalletsList.d.ts +15 -0
  333. package/dist/types/react/native/ui/connect/ExternalWalletsList.d.ts.map +1 -0
  334. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts +19 -0
  335. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -0
  336. package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts +13 -0
  337. package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts.map +1 -0
  338. package/dist/types/react/native/ui/connect/SendScreen.d.ts +14 -0
  339. package/dist/types/react/native/ui/connect/SendScreen.d.ts.map +1 -0
  340. package/dist/types/react/native/ui/connect/SuccessView.d.ts +7 -0
  341. package/dist/types/react/native/ui/connect/SuccessView.d.ts.map +1 -0
  342. package/dist/types/react/native/ui/connect/TokenListScreen.d.ts +20 -0
  343. package/dist/types/react/native/ui/connect/TokenListScreen.d.ts.map +1 -0
  344. package/dist/types/react/native/ui/icons/svgs.d.ts +22 -0
  345. package/dist/types/react/native/ui/icons/svgs.d.ts.map +1 -0
  346. package/dist/types/react/native/ui/{TransactionButton/TrabsactionButton.d.ts → transaction/TransactionButton.d.ts} +1 -1
  347. package/dist/types/react/native/ui/transaction/TransactionButton.d.ts.map +1 -0
  348. package/dist/types/react/native/wallets/defaultWallets.d.ts +11 -0
  349. package/dist/types/react/native/wallets/defaultWallets.d.ts.map +1 -0
  350. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  351. package/dist/types/react/web/hooks/wallets/useAutoConnect.d.ts.map +1 -1
  352. package/dist/types/react/web/hooks/wallets/useSendToken.d.ts +28 -0
  353. package/dist/types/react/web/hooks/wallets/useSendToken.d.ts.map +1 -0
  354. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +1 -1
  355. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
  356. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +2 -2
  357. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  358. package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts.map +1 -1
  359. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +1 -267
  360. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
  361. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts.map +1 -1
  362. package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
  363. package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
  364. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +2 -2
  365. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  366. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts +1 -1
  367. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts.map +1 -1
  368. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +1 -1
  369. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
  370. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +1 -1
  371. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
  372. package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts +1 -1
  373. package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts.map +1 -1
  374. package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts +1 -1
  375. package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts.map +1 -1
  376. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts +1 -1
  377. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
  378. package/dist/types/react/web/ui/ConnectWallet/screens/ViewFunds.d.ts +1 -1
  379. package/dist/types/react/web/ui/ConnectWallet/screens/ViewFunds.d.ts.map +1 -1
  380. package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts +1 -1
  381. package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts.map +1 -1
  382. package/dist/types/react/web/ui/PayEmbed.d.ts +2 -2
  383. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  384. package/dist/types/react/web/ui/components/ChainIcon.d.ts.map +1 -1
  385. package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
  386. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
  387. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  388. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
  389. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
  390. package/dist/types/version.d.ts +1 -1
  391. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  392. package/dist/types/wallets/manager/index.d.ts +1 -0
  393. package/dist/types/wallets/manager/index.d.ts.map +1 -1
  394. package/package.json +19 -3
  395. package/src/exports/react.native.ts +19 -5
  396. package/src/exports/react.ts +7 -12
  397. package/src/exports/wallets/in-app.ts +1 -1
  398. package/src/pay/utils/definitions.ts +16 -9
  399. package/src/react/{web/ui/ConnectWallet → core/hooks/connection}/ConnectButtonProps.ts +7 -10
  400. package/src/react/core/hooks/connection/ConnectEmbedProps.ts +285 -0
  401. package/src/react/core/hooks/connection/types.ts +1 -1
  402. package/src/react/core/hooks/transaction/useSendTransaction.ts +1 -1
  403. package/src/react/core/hooks/wallets/useAutoConnect.ts +1 -1
  404. package/src/react/core/hooks/wallets/useSendToken.ts +94 -0
  405. package/src/react/{web/ui/ConnectWallet → core/utils}/defaultTokens.ts +10 -15
  406. package/src/react/{web/ui/ConnectWallet/icons/dataUris.ts → core/utils/socialIcons.ts} +30 -0
  407. package/src/react/{web/wallets/shared → core/utils}/storage.ts +2 -2
  408. package/src/react/core/utils/wallet.ts +101 -0
  409. package/src/react/native/design-system/index.ts +31 -0
  410. package/src/react/native/hooks/wallets/useAutoConnect.ts +5 -1
  411. package/src/react/native/hooks/wallets/useSendToken.ts +29 -0
  412. package/src/react/native/ui/components/Address.tsx +52 -0
  413. package/src/react/native/ui/components/ChainIcon.tsx +42 -0
  414. package/src/react/native/ui/components/Header.tsx +84 -0
  415. package/src/react/native/ui/components/RNImage.tsx +71 -0
  416. package/src/react/native/ui/components/Skeleton.tsx +93 -0
  417. package/src/react/native/ui/components/TokenIcon.tsx +31 -0
  418. package/src/react/native/ui/components/WalletImage.tsx +81 -0
  419. package/src/react/native/ui/components/button.tsx +41 -9
  420. package/src/react/native/ui/components/input.tsx +128 -0
  421. package/src/react/native/ui/components/spacer.tsx +6 -0
  422. package/src/react/native/ui/components/text.tsx +17 -8
  423. package/src/react/native/ui/connect/ConnectButton.tsx +188 -0
  424. package/src/react/native/ui/connect/ConnectModal.tsx +301 -0
  425. package/src/react/native/ui/connect/ConnectedButton.tsx +94 -0
  426. package/src/react/native/ui/connect/ConnectedModal.tsx +434 -0
  427. package/src/react/native/ui/connect/ErrorView.tsx +44 -0
  428. package/src/react/native/ui/connect/ExternalWalletsList.tsx +162 -0
  429. package/src/react/native/ui/connect/InAppWalletUI.tsx +320 -0
  430. package/src/react/native/ui/connect/ReceiveScreen.tsx +81 -0
  431. package/src/react/native/ui/connect/SendScreen.tsx +238 -0
  432. package/src/react/native/ui/connect/SuccessView.tsx +44 -0
  433. package/src/react/native/ui/connect/TokenListScreen.tsx +147 -0
  434. package/src/react/native/ui/icons/svgs.ts +252 -0
  435. package/src/react/native/wallets/defaultWallets.ts +30 -0
  436. package/src/react/web/hooks/transaction/useSendTransaction.tsx +2 -2
  437. package/src/react/web/hooks/wallets/useAutoConnect.ts +18 -8
  438. package/src/react/web/hooks/wallets/useSendToken.ts +29 -0
  439. package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +2 -2
  440. package/src/react/web/ui/ConnectWallet/Details.tsx +26 -78
  441. package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +2 -9
  442. package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +6 -285
  443. package/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx +3 -1
  444. package/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx +1 -1
  445. package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +1 -1
  446. package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +1 -1
  447. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +2 -2
  448. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +1 -1
  449. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +1 -1
  450. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +1 -1
  451. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +1 -1
  452. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +1 -1
  453. package/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx +8 -21
  454. package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +1 -1
  455. package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +1 -1
  456. package/src/react/web/ui/ConnectWallet/screens/ViewFunds.tsx +4 -1
  457. package/src/react/web/ui/ConnectWallet/screens/nativeToken.ts +1 -1
  458. package/src/react/web/ui/PayEmbed.tsx +3 -3
  459. package/src/react/web/ui/components/ChainIcon.tsx +0 -1
  460. package/src/react/web/ui/components/TokenIcon.tsx +1 -1
  461. package/src/react/web/ui/components/WalletImage.tsx +7 -9
  462. package/src/react/web/wallets/ecosystem/EcosystemWalletHeader.tsx +1 -1
  463. package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +8 -4
  464. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +6 -6
  465. package/src/react/web/wallets/shared/OTPLoginUI.tsx +1 -1
  466. package/src/react/web/wallets/shared/PassKeyLogin.tsx +1 -1
  467. package/src/react/web/wallets/shared/SocialLogin.tsx +1 -1
  468. package/src/version.ts +1 -1
  469. package/src/wallets/in-app/native/native-connector.ts +4 -6
  470. package/src/wallets/manager/index.ts +4 -2
  471. package/dist/cjs/react/native/ui/TransactionButton/TrabsactionButton.js.map +0 -1
  472. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButtonProps.js.map +0 -1
  473. package/dist/cjs/react/web/ui/ConnectWallet/defaultTokens.js.map +0 -1
  474. package/dist/cjs/react/web/ui/ConnectWallet/icons/dataUris.js.map +0 -1
  475. package/dist/cjs/react/web/ui/ConnectWallet/icons/socialLogins.js +0 -15
  476. package/dist/cjs/react/web/ui/ConnectWallet/icons/socialLogins.js.map +0 -1
  477. package/dist/cjs/react/web/ui/hooks/useSendToken.js +0 -57
  478. package/dist/cjs/react/web/ui/hooks/useSendToken.js.map +0 -1
  479. package/dist/cjs/react/web/ui/hooks/useWalletInfo.js +0 -37
  480. package/dist/cjs/react/web/ui/hooks/useWalletInfo.js.map +0 -1
  481. package/dist/cjs/react/web/utils/isSmartWallet.js.map +0 -1
  482. package/dist/cjs/react/web/wallets/in-app/socialIcons.js +0 -10
  483. package/dist/cjs/react/web/wallets/in-app/socialIcons.js.map +0 -1
  484. package/dist/cjs/react/web/wallets/shared/storage.js.map +0 -1
  485. package/dist/esm/react/native/ui/TransactionButton/TrabsactionButton.js.map +0 -1
  486. package/dist/esm/react/web/ui/ConnectWallet/ConnectButtonProps.js.map +0 -1
  487. package/dist/esm/react/web/ui/ConnectWallet/defaultTokens.js.map +0 -1
  488. package/dist/esm/react/web/ui/ConnectWallet/icons/dataUris.js.map +0 -1
  489. package/dist/esm/react/web/ui/ConnectWallet/icons/socialLogins.js +0 -12
  490. package/dist/esm/react/web/ui/ConnectWallet/icons/socialLogins.js.map +0 -1
  491. package/dist/esm/react/web/ui/hooks/useSendToken.js +0 -54
  492. package/dist/esm/react/web/ui/hooks/useSendToken.js.map +0 -1
  493. package/dist/esm/react/web/ui/hooks/useWalletInfo.js +0 -33
  494. package/dist/esm/react/web/ui/hooks/useWalletInfo.js.map +0 -1
  495. package/dist/esm/react/web/utils/isSmartWallet.js.map +0 -1
  496. package/dist/esm/react/web/wallets/in-app/socialIcons.js +0 -7
  497. package/dist/esm/react/web/wallets/in-app/socialIcons.js.map +0 -1
  498. package/dist/esm/react/web/wallets/shared/storage.js.map +0 -1
  499. package/dist/types/react/native/ui/TransactionButton/TrabsactionButton.d.ts.map +0 -1
  500. package/dist/types/react/web/ui/ConnectWallet/ConnectButtonProps.d.ts.map +0 -1
  501. package/dist/types/react/web/ui/ConnectWallet/defaultTokens.d.ts.map +0 -1
  502. package/dist/types/react/web/ui/ConnectWallet/icons/dataUris.d.ts.map +0 -1
  503. package/dist/types/react/web/ui/ConnectWallet/icons/socialLogins.d.ts +0 -12
  504. package/dist/types/react/web/ui/ConnectWallet/icons/socialLogins.d.ts.map +0 -1
  505. package/dist/types/react/web/ui/hooks/useSendToken.d.ts.map +0 -1
  506. package/dist/types/react/web/ui/hooks/useWalletInfo.d.ts +0 -13
  507. package/dist/types/react/web/ui/hooks/useWalletInfo.d.ts.map +0 -1
  508. package/dist/types/react/web/utils/isSmartWallet.d.ts.map +0 -1
  509. package/dist/types/react/web/wallets/in-app/socialIcons.d.ts +0 -6
  510. package/dist/types/react/web/wallets/in-app/socialIcons.d.ts.map +0 -1
  511. package/dist/types/react/web/wallets/shared/storage.d.ts +0 -5
  512. package/dist/types/react/web/wallets/shared/storage.d.ts.map +0 -1
  513. package/src/react/web/ui/ConnectWallet/icons/socialLogins.ts +0 -22
  514. package/src/react/web/ui/hooks/useSendToken.ts +0 -66
  515. package/src/react/web/ui/hooks/useWalletInfo.ts +0 -37
  516. package/src/react/web/wallets/in-app/socialIcons.ts +0 -11
  517. /package/dist/cjs/react/{web/ui/ConnectWallet → core/hooks/connection}/ConnectButtonProps.js +0 -0
  518. /package/dist/cjs/react/{web → core}/utils/isSmartWallet.js +0 -0
  519. /package/dist/cjs/react/{web/wallets/shared → core/utils}/storage.js +0 -0
  520. /package/dist/esm/react/{web/ui/ConnectWallet → core/hooks/connection}/ConnectButtonProps.js +0 -0
  521. /package/dist/esm/react/{web → core}/utils/isSmartWallet.js +0 -0
  522. /package/dist/esm/react/{web/wallets/shared → core/utils}/storage.js +0 -0
  523. /package/dist/types/react/{web → core}/utils/isSmartWallet.d.ts +0 -0
  524. /package/src/react/{web → core}/utils/isSmartWallet.ts +0 -0
  525. /package/src/react/native/ui/{TransactionButton/TrabsactionButton.tsx → transaction/TransactionButton.tsx} +0 -0
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThemedInput = ThemedInput;
4
+ exports.ThemedInputWithSubmit = ThemedInputWithSubmit;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const react_native_1 = require("react-native");
8
+ const react_native_svg_1 = require("react-native-svg");
9
+ const index_js_1 = require("../../design-system/index.js");
10
+ const svgs_js_1 = require("../icons/svgs.js");
11
+ const spinner_js_1 = require("./spinner.js");
12
+ function ThemedInput(props) {
13
+ const { theme, rightView } = props;
14
+ const [isFocused, setIsFocused] = (0, react_1.useState)(false);
15
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
16
+ styles.container,
17
+ {
18
+ borderColor: isFocused
19
+ ? theme.colors.accentButtonBg
20
+ : theme.colors.borderColor,
21
+ },
22
+ ], children: [(0, jsx_runtime_1.jsx)(react_native_1.TextInput, { placeholderTextColor: theme.colors.secondaryText, style: [styles.input, { color: theme.colors.primaryText }], onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props }), rightView && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } }), rightView] }))] }));
23
+ }
24
+ function ThemedInputWithSubmit(props) {
25
+ const { theme, onSubmit } = props;
26
+ const [isFocused, setIsFocused] = (0, react_1.useState)(false);
27
+ const [val, setVal] = (0, react_1.useState)("");
28
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
29
+ styles.container,
30
+ {
31
+ borderColor: isFocused
32
+ ? theme.colors.accentButtonBg
33
+ : theme.colors.borderColor,
34
+ },
35
+ ], children: [(0, jsx_runtime_1.jsx)(react_native_1.TextInput, { placeholderTextColor: theme.colors.secondaryText, style: [
36
+ styles.input,
37
+ {
38
+ color: theme.colors.primaryText,
39
+ },
40
+ ], value: val, onChangeText: setVal, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), ...props }), onSubmit && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: () => onSubmit(val), disabled: props.isSubmitting, style: {
41
+ paddingHorizontal: index_js_1.spacing.lg,
42
+ }, children: props.isSubmitting ? ((0, jsx_runtime_1.jsx)(spinner_js_1.ThemedSpinner, { size: 24, color: theme.colors.secondaryIconColor })) : ((0, jsx_runtime_1.jsx)(react_native_svg_1.SvgXml, { width: 24, height: 24, xml: svgs_js_1.RIGHT_ARROW, color: theme.colors.secondaryIconColor })) }))] }));
43
+ }
44
+ const styles = react_native_1.StyleSheet.create({
45
+ container: {
46
+ flexDirection: "row",
47
+ alignItems: "center",
48
+ borderRadius: index_js_1.radius.lg,
49
+ borderWidth: 1,
50
+ borderStyle: "solid",
51
+ },
52
+ input: {
53
+ flex: 1,
54
+ flexDirection: "row",
55
+ fontSize: 16,
56
+ height: 56,
57
+ gap: index_js_1.spacing.md,
58
+ paddingLeft: index_js_1.spacing.lg,
59
+ paddingVertical: index_js_1.spacing.md,
60
+ justifyContent: "center",
61
+ alignItems: "center",
62
+ },
63
+ });
64
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/components/input.tsx"],"names":[],"mappings":";;AAmBA,kCA6BC;AAED,sDAwDC;;AA1GD,iCAAiC;AACjC,+CAMsB;AACtB,uDAA0C;AAE1C,2DAA+D;AAC/D,8CAA+C;AAC/C,6CAA6C;AAO7C,SAAgB,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACnC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAClD,OAAO,CACL,wBAAC,mBAAI,IACH,KAAK,EAAE;YACL,MAAM,CAAC,SAAS;YAChB;gBACE,WAAW,EAAE,SAAS;oBACpB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc;oBAC7B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW;aAC7B;SACF,aAED,uBAAC,wBAAS,IACR,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,EAChD,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAC1D,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EACjC,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,KAC7B,KAAK,GACT,EACD,SAAS,IAAI,CACZ,6DACE,uBAAC,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I,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB,GAAI,CACpE,CAAC,CAAC,CAAC,CACF,uBAAC,yBAAM,IACL,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,GAAG,EAAE,qBAAW,EAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB,GACtC,CACH,GACgB,CACpB,IACI,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,iBAAM,CAAC,EAAE;QACvB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,OAAO;KACrB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;QACP,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,kBAAO,CAAC,EAAE;QACf,WAAW,EAAE,kBAAO,CAAC,EAAE;QACvB,eAAe,EAAE,kBAAO,CAAC,EAAE;QAC3B,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Spacer = Spacer;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_native_1 = require("react-native");
6
+ const index_js_1 = require("../../design-system/index.js");
7
+ function Spacer({ size }) {
8
+ return (0, jsx_runtime_1.jsx)(react_native_1.View, { style: { height: index_js_1.spacing[size] } });
9
+ }
10
+ //# sourceMappingURL=spacer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spacer.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/components/spacer.tsx"],"names":[],"mappings":";;AAGA,wBAEC;;AALD,+CAAoC;AACpC,2DAAuD;AAEvD,SAAgB,MAAM,CAAC,EAAE,IAAI,EAAkC;IAC7D,OAAO,uBAAC,mBAAI,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,kBAAO,CAAC,IAAI,CAAC,EAAE,GAAI,CAAC;AACpD,CAAC"}
@@ -11,30 +11,33 @@ function ThemedText({ style, theme, type = "default", ...rest }) {
11
11
  type === "defaultSemiBold" ? styles.defaultSemiBold : undefined,
12
12
  type === "subtitle" ? styles.subtitle : undefined,
13
13
  type === "link" ? styles.link : undefined,
14
+ type === "subtext"
15
+ ? { ...styles.subtext, color: theme.colors.secondaryText }
16
+ : undefined,
14
17
  style,
15
18
  ], ...rest }));
16
19
  }
17
20
  const styles = react_native_1.StyleSheet.create({
18
21
  default: {
19
22
  fontSize: 16,
20
- lineHeight: 24,
21
23
  },
22
24
  defaultSemiBold: {
23
25
  fontSize: 16,
24
- lineHeight: 24,
25
26
  fontWeight: "600",
26
27
  },
28
+ subtext: {
29
+ fontSize: 14,
30
+ },
27
31
  title: {
28
- fontSize: 32,
32
+ fontSize: 24,
29
33
  fontWeight: "bold",
30
- lineHeight: 32,
34
+ lineHeight: 28,
31
35
  },
32
36
  subtitle: {
33
- fontSize: 20,
34
- fontWeight: "bold",
37
+ fontSize: 18,
38
+ fontWeight: "600",
35
39
  },
36
40
  link: {
37
- lineHeight: 30,
38
41
  fontSize: 16,
39
42
  },
40
43
  });
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/components/text.tsx"],"names":[],"mappings":";;AAQA,gCAoBC;;AA5BD,+CAAgE;AAQhE,SAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,IAAI,GAAG,SAAS,EAChB,GAAG,IAAI,EACS;IAChB,OAAO,CACL,uBAAC,mBAAI,IACH,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;YACnC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YAC/C,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;YAC3C,IAAI,KAAK,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;YAC/D,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACjD,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YACzC,KAAK;SACN,KACG,IAAI,GACR,CACH,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;KACf;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/components/text.tsx"],"names":[],"mappings":";;AAcA,gCAuBC;;AArCD,+CAAgE;AAchE,SAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,IAAI,GAAG,SAAS,EAChB,GAAG,IAAI,EACS;IAChB,OAAO,CACL,uBAAC,mBAAI,IACH,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;YACnC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YAC/C,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;YAC3C,IAAI,KAAK,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;YAC/D,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACjD,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YACzC,IAAI,KAAK,SAAS;gBAChB,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE;gBAC1D,CAAC,CAAC,SAAS;YACb,KAAK;SACN,KACG,IAAI,GACR,CACH,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;KACb;IACD,eAAe,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,UAAU,EAAE,EAAE;KACf;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;KACb;CACF,CAAC,CAAC"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectButton = ConnectButton;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const react_native_1 = require("react-native");
7
+ const CustomThemeProvider_js_1 = require("../../../core/design-system/CustomThemeProvider.js");
8
+ const useActiveAccount_js_1 = require("../../hooks/wallets/useActiveAccount.js");
9
+ const useActiveWallet_js_1 = require("../../hooks/wallets/useActiveWallet.js");
10
+ const useActiveWalletConnectionStatus_js_1 = require("../../hooks/wallets/useActiveWalletConnectionStatus.js");
11
+ const useAutoConnect_js_1 = require("../../hooks/wallets/useAutoConnect.js");
12
+ const button_js_1 = require("../components/button.js");
13
+ const spinner_js_1 = require("../components/spinner.js");
14
+ const text_js_1 = require("../components/text.js");
15
+ const ConnectModal_js_1 = require("./ConnectModal.js");
16
+ const ConnectedButton_js_1 = require("./ConnectedButton.js");
17
+ const ConnectedModal_js_1 = require("./ConnectedModal.js");
18
+ /**
19
+ * A component that allows the user to connect their wallet.
20
+ * It renders a button which when clicked opens a modal to allow users to connect to wallets specified in `wallets` prop.
21
+ * @example
22
+ * ```tsx
23
+ * <ConnectButton
24
+ * client={client}
25
+ * />
26
+ * ```
27
+ * @param props
28
+ * Props for the `ConnectButton` component
29
+ *
30
+ * Refer to [ConnectButtonProps](https://portal.thirdweb.com/references/typescript/v5/ConnectButtonProps) to see the available props.
31
+ * @component
32
+ */
33
+ function ConnectButton(props) {
34
+ const theme = (0, CustomThemeProvider_js_1.parseTheme)(props.theme);
35
+ const [visible, setVisible] = (0, react_1.useState)(false);
36
+ const wallet = (0, useActiveWallet_js_1.useActiveWallet)();
37
+ const account = (0, useActiveAccount_js_1.useActiveAccount)();
38
+ const status = (0, useActiveWalletConnectionStatus_js_1.useActiveWalletConnectionStatus)();
39
+ (0, useAutoConnect_js_1.useAutoConnect)(props);
40
+ const fadeAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)); // For background opacity
41
+ const slideAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(screenHeight)); // For bottom sheet position
42
+ const openModal = (0, react_1.useCallback)(() => {
43
+ setVisible(true);
44
+ react_native_1.Animated.parallel([
45
+ react_native_1.Animated.timing(fadeAnim.current, {
46
+ toValue: 1,
47
+ duration: 300,
48
+ useNativeDriver: true,
49
+ }),
50
+ react_native_1.Animated.timing(slideAnim.current, {
51
+ toValue: 0,
52
+ duration: 300,
53
+ useNativeDriver: true,
54
+ easing: react_native_1.Easing.out(react_native_1.Easing.exp),
55
+ }),
56
+ ]).start();
57
+ }, []);
58
+ const closeModal = (0, react_1.useCallback)(() => {
59
+ react_native_1.Animated.parallel([
60
+ react_native_1.Animated.timing(fadeAnim.current, {
61
+ toValue: 0,
62
+ duration: 300,
63
+ useNativeDriver: true,
64
+ }),
65
+ react_native_1.Animated.timing(slideAnim.current, {
66
+ toValue: screenHeight,
67
+ duration: 300,
68
+ useNativeDriver: true,
69
+ easing: react_native_1.Easing.in(react_native_1.Easing.exp),
70
+ }),
71
+ ]).start(() => {
72
+ setVisible(false);
73
+ fadeAnim.current.setValue(0);
74
+ slideAnim.current.setValue(screenHeight);
75
+ });
76
+ }, []);
77
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [wallet && account ? ((0, jsx_runtime_1.jsx)(ConnectedButton_js_1.ConnectedButton, { openModal: () => openModal(), onClose: closeModal, wallet: wallet, account: account, ...props })) : ((0, jsx_runtime_1.jsx)(button_js_1.ThemedButton, { theme: theme, onPress: () => openModal(), children: status === "connecting" ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(spinner_js_1.ThemedSpinner, { color: theme.colors.primaryButtonText }) })) : ((0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", style: { color: theme.colors.primaryButtonText }, children: "Connect Wallet" })) })), (0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: visible, animationType: "none", transparent: true, onRequestClose: closeModal, children: (0, jsx_runtime_1.jsxs)(react_native_1.KeyboardAvoidingView, { behavior: "padding", style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [styles.modalOverlay, { opacity: fadeAnim.current }] }), (0, jsx_runtime_1.jsxs)(react_native_1.Animated.View, { style: [
78
+ { flex: 1, transform: [{ translateY: slideAnim.current }] },
79
+ ], children: [(0, jsx_runtime_1.jsx)(react_native_1.Pressable, { style: styles.dismissArea, onPress: closeModal }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.bottomSheetContainer, children: wallet && account ? ((0, jsx_runtime_1.jsx)(ConnectedModal_js_1.ConnectedModal, { ...props, theme: theme, onClose: closeModal, containerType: "modal", wallet: wallet, account: account })) : status === "connecting" ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
80
+ flexDirection: "column",
81
+ flex: 1,
82
+ alignItems: "center",
83
+ justifyContent: "center",
84
+ }, children: (0, jsx_runtime_1.jsx)(spinner_js_1.ThemedSpinner, { color: theme.colors.primaryText, size: 32 }) })) : ((0, jsx_runtime_1.jsx)(ConnectModal_js_1.ConnectModal, { ...props, theme: theme, onClose: closeModal, containerType: "modal" })) })] })] }) })] }));
85
+ }
86
+ const screenHeight = react_native_1.Dimensions.get("window").height;
87
+ const modalHeight = 480;
88
+ const screenWidth = react_native_1.Dimensions.get("window").width;
89
+ const styles = react_native_1.StyleSheet.create({
90
+ modalOverlay: {
91
+ position: "absolute",
92
+ width: screenWidth,
93
+ height: screenHeight,
94
+ backgroundColor: "rgba(0,0,0,0.8)",
95
+ },
96
+ dismissArea: {
97
+ width: "100%",
98
+ flex: 1,
99
+ },
100
+ bottomSheetContainer: {
101
+ height: modalHeight,
102
+ width: screenWidth,
103
+ flexDirection: "column",
104
+ },
105
+ });
106
+ //# sourceMappingURL=ConnectButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectButton.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/connect/ConnectButton.tsx"],"names":[],"mappings":";;AAuCA,sCA8HC;;AArKD,iCAAsD;AACtD,+CASsB;AACtB,+FAAgF;AAEhF,iFAA2E;AAC3E,+EAAyE;AACzE,+GAAyG;AACzG,6EAAuE;AAC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cAAc,EAAE,QAAQ;yCACzB,YAED,uBAAC,0BAAa,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,GAAI,GACvD,CACR,CAAC,CAAC,CAAC,CACF,uBAAC,8BAAY,OACP,KAAK,EACT,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,UAAU,EACnB,aAAa,EAAC,OAAO,GACrB,CACH,GACI,IACO,IACK,GACjB,IACH,CACR,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,yBAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;AACrD,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,WAAW,GAAG,yBAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;AAEnD,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,YAAY,EAAE;QACZ,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,YAAY;QACpB,eAAe,EAAE,iBAAiB;KACnC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,CAAC;KACR;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,WAAW;QAClB,aAAa,EAAE,QAAQ;KACxB;CACF,CAAC,CAAC"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectEmbed = ConnectEmbed;
4
+ exports.ConnectModal = ConnectModal;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const react_native_1 = require("react-native");
8
+ const react_native_svg_1 = require("react-native-svg");
9
+ const CustomThemeProvider_js_1 = require("../../../core/design-system/CustomThemeProvider.js");
10
+ const socialIcons_js_1 = require("../../../core/utils/socialIcons.js");
11
+ const index_js_1 = require("../../design-system/index.js");
12
+ const useActiveWallet_js_1 = require("../../hooks/wallets/useActiveWallet.js");
13
+ const useConnect_js_1 = require("../../hooks/wallets/useConnect.js");
14
+ const defaultWallets_js_1 = require("../../wallets/defaultWallets.js");
15
+ const Header_js_1 = require("../components/Header.js");
16
+ const button_js_1 = require("../components/button.js");
17
+ const spacer_js_1 = require("../components/spacer.js");
18
+ const text_js_1 = require("../components/text.js");
19
+ const view_js_1 = require("../components/view.js");
20
+ const svgs_js_1 = require("../icons/svgs.js");
21
+ const ExternalWalletsList_js_1 = require("./ExternalWalletsList.js");
22
+ const InAppWalletUI_js_1 = require("./InAppWalletUI.js");
23
+ /**
24
+ * A component that allows the user to connect their wallet.
25
+ *
26
+ * it renders the same UI as the [`ConnectButton`](https://portal.thirdweb.com/react/v4/components/ConnectButton) component's modal - but directly on the page instead of being in a modal.
27
+ *
28
+ * It only renders UI if wallet is not connected
29
+ * @example
30
+ * ```tsx
31
+ * <ConnectEmbed
32
+ * client={client}
33
+ * />
34
+ * ```
35
+ * @param props -
36
+ * The props for the `ConnectEmbed` component.
37
+ *
38
+ * Refer to the [`ConnectEmbedProps`](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) type for more details
39
+ * @component
40
+ */
41
+ function ConnectEmbed(props) {
42
+ const theme = (0, CustomThemeProvider_js_1.parseTheme)(props.theme);
43
+ const wallet = (0, useActiveWallet_js_1.useActiveWallet)();
44
+ const adaptedProps = {
45
+ ...props,
46
+ connectModal: { ...props },
47
+ };
48
+ return wallet ? null : ((0, jsx_runtime_1.jsx)(ConnectModal, { ...adaptedProps, theme: theme, containerType: "embed" }));
49
+ }
50
+ function ConnectModal(props) {
51
+ const { theme, client, containerType, accountAbstraction, onConnect } = props;
52
+ const connectMutation = (0, useConnect_js_1.useConnect)({
53
+ client,
54
+ accountAbstraction,
55
+ onConnect: (wallet) => {
56
+ props.onClose?.();
57
+ onConnect?.(wallet);
58
+ },
59
+ });
60
+ const wallets = props.wallets || (0, defaultWallets_js_1.getDefaultWallets)(props);
61
+ const [modalState, setModalState] = (0, react_1.useState)({ screen: "base" });
62
+ const inAppWallet = wallets.find((wallet) => wallet.id === "inApp");
63
+ const externalWallets = wallets.filter((wallet) => wallet.id !== "inApp");
64
+ const showBranding = props.connectModal?.showThirdwebBranding !== false;
65
+ let content;
66
+ switch (modalState.screen) {
67
+ case "otp": {
68
+ content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_js_1.Header, { theme: theme, onClose: props.onClose, containerType: containerType, onBack: () => setModalState({ screen: "base" }) }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "xl" }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
69
+ flexDirection: "column",
70
+ gap: index_js_1.spacing.md,
71
+ paddingHorizontal: containerType === "modal" ? index_js_1.spacing.lg : 0,
72
+ }, children: (0, jsx_runtime_1.jsx)(InAppWalletUI_js_1.OtpLogin, { auth: modalState.auth, wallet: modalState.wallet, client: client, setScreen: setModalState, theme: theme, connectMutation: connectMutation }) }), containerType === "modal" ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } })) : ((0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "md" }))] }));
73
+ break;
74
+ }
75
+ case "external_wallets": {
76
+ content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_js_1.Header, { theme: theme, onClose: props.onClose, containerType: containerType, onBack: () => setModalState({ screen: "base" }) }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" }), (0, jsx_runtime_1.jsx)(ExternalWalletsList_js_1.ExternalWalletsList, { theme: theme, externalWallets: externalWallets, client: client, connectMutation: connectMutation, containerType: containerType })] }));
77
+ break;
78
+ }
79
+ default: {
80
+ content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_js_1.Header, { theme: theme, onClose: props.onClose, containerType: containerType }), inAppWallet ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [containerType === "modal" ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } })) : ((0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" })), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
81
+ flexDirection: "column",
82
+ gap: index_js_1.spacing.md,
83
+ paddingHorizontal: containerType === "modal" ? index_js_1.spacing.lg : 0,
84
+ }, children: [(0, jsx_runtime_1.jsx)(InAppWalletUI_js_1.InAppWalletUI, { wallet: inAppWallet, setScreen: setModalState, client: client, theme: theme, connectMutation: connectMutation }), externalWallets.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(OrDivider, { theme: theme }), (0, jsx_runtime_1.jsx)(button_js_1.ThemedButtonWithIcon, { theme: theme, icon: socialIcons_js_1.genericWalletIcon, title: "Connect a wallet", onPress: () => setModalState({ screen: "external_wallets" }) })] })) : null] }), containerType === "modal" ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 } })) : ((0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "md" }))] })) : externalWallets.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
85
+ flex: 1,
86
+ }, children: (0, jsx_runtime_1.jsx)(ExternalWalletsList_js_1.ExternalWalletsList, { theme: theme, externalWallets: externalWallets, client: client, connectMutation: connectMutation, containerType: containerType }) })] })) : null] }));
87
+ }
88
+ }
89
+ return ((0, jsx_runtime_1.jsxs)(view_js_1.ThemedView, { theme: theme, style: containerType === "modal"
90
+ ? styles.modalContainer
91
+ : styles.embedContainer, children: [content, showBranding && (0, jsx_runtime_1.jsx)(PoweredByThirdweb, { theme: theme })] }));
92
+ }
93
+ function OrDivider({ theme }) {
94
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
95
+ flexDirection: "row",
96
+ alignItems: "center",
97
+ justifyContent: "center",
98
+ gap: index_js_1.spacing.lg,
99
+ }, children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
100
+ flex: 1,
101
+ height: 1,
102
+ backgroundColor: theme.colors.borderColor,
103
+ } }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, style: { color: theme.colors.secondaryText }, children: "OR" }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
104
+ flex: 1,
105
+ height: 1,
106
+ backgroundColor: theme.colors.borderColor,
107
+ } })] }));
108
+ }
109
+ function PoweredByThirdweb({ theme }) {
110
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
111
+ flexDirection: "row",
112
+ justifyContent: "center",
113
+ alignItems: "center",
114
+ gap: index_js_1.spacing.xs,
115
+ paddingBottom: react_native_1.Platform.OS === "android" ? index_js_1.spacing.md : index_js_1.spacing.lg,
116
+ }, children: [(0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "subtext", children: "Powered by" }), (0, jsx_runtime_1.jsx)(react_native_svg_1.SvgXml, { xml: svgs_js_1.TW_ICON, width: 22, height: 22, style: { marginBottom: -2 }, color: theme.colors.secondaryText }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "subtext", style: { fontWeight: "600" }, children: "thirdweb" })] }));
117
+ }
118
+ const styles = react_native_1.StyleSheet.create({
119
+ modalContainer: {
120
+ flex: 1,
121
+ width: "100%",
122
+ flexDirection: "column",
123
+ borderTopLeftRadius: index_js_1.radius.lg,
124
+ borderTopRightRadius: index_js_1.radius.lg,
125
+ },
126
+ embedContainer: {
127
+ flex: 1,
128
+ width: "100%",
129
+ flexDirection: "column",
130
+ backgroundColor: "transparent",
131
+ },
132
+ });
133
+ //# sourceMappingURL=ConnectModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectModal.js","sourceRoot":"","sources":["../../../../../../src/react/native/ui/connect/ConnectModal.tsx"],"names":[],"mappings":";;AA8CA,oCAUC;AAED,oCAuKC;;AAjOD,iCAAiC;AACjC,+CAA0D;AAC1D,uDAA0C;AAG1C,+FAAgF;AAIhF,uEAAuE;AACvE,2DAA+D;AAC/D,+EAAyE;AACzE,qEAA+D;AAC/D,uEAAoE;AACpE,uDAAqE;AACrE,uDAA+D;AAC/D,uDAAiD;AACjD,mDAAmD;AACnD,mDAAmD;AACnD,8CAA2C;AAC3C,qEAA+D;AAC/D,yDAA6D;AAO7D;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,KAAK,GAAG,IAAA,mCAAU,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,IAAA,oCAAe,GAAE,CAAC;IACjC,MAAM,YAAY,GAAG;QACnB,GAAG,KAAK;QACR,YAAY,EAAE,EAAE,GAAG,KAAK,EAAE;KACL,CAAC;IACxB,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACrB,uBAAC,YAAY,OAAK,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAC,OAAO,GAAG,CACvE,CAAC;AACJ,CAAC;AAED,SAAgB,YAAY,CAC1B,KAIC;IAED,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC9E,MAAM,eAAe,GAAG,IAAA,0BAAU,EAAC;QACjC,MAAM;QACN,kBAAkB;QAClB,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE;YACpB,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YAClB,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;KACF,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IA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C,EAAE;SACnE,aAED,uBAAC,oBAAU,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC,SAAS,2BAE3B,EACb,uBAAC,yBAAM,IACL,GAAG,EAAE,iBAAO,EACZ,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,EAC3B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,GACjC,EACF,uBAAC,oBAAU,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,yBAExD,IACR,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,MAAM;QACb,aAAa,EAAE,QAAQ;QACvB,mBAAmB,EAAE,iBAAM,CAAC,EAAE;QAC9B,oBAAoB,EAAE,iBAAM,CAAC,EAAE;KAChC;IACD,cAAc,EAAE;QACd,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,MAAM;QACb,aAAa,EAAE,QAAQ;QACvB,eAAe,EAAE,aAAa;KAC/B;CACF,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectedButton = ConnectedButton;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_native_1 = require("react-native");
6
+ const CustomThemeProvider_js_1 = require("../../../core/design-system/CustomThemeProvider.js");
7
+ const wallet_js_1 = require("../../../core/utils/wallet.js");
8
+ const index_js_1 = require("../../design-system/index.js");
9
+ const useActiveWalletChain_js_1 = require("../../hooks/wallets/useActiveWalletChain.js");
10
+ const Skeleton_js_1 = require("../components/Skeleton.js");
11
+ const WalletImage_js_1 = require("../components/WalletImage.js");
12
+ const button_js_1 = require("../components/button.js");
13
+ const text_js_1 = require("../components/text.js");
14
+ function ConnectedButton(props) {
15
+ const theme = (0, CustomThemeProvider_js_1.parseTheme)(props.theme);
16
+ const { account, wallet } = props;
17
+ const walletChain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
18
+ const { ensAvatarQuery, addressOrENS, balanceQuery } = (0, wallet_js_1.useConnectedWalletDetails)(props.client, walletChain, account, props.detailsButton?.displayBalanceToken);
19
+ return ((0, jsx_runtime_1.jsx)(button_js_1.ThemedButton, { theme: theme, onPress: () => {
20
+ props.openModal();
21
+ }, style: {
22
+ paddingHorizontal: index_js_1.spacing.md,
23
+ paddingVertical: index_js_1.spacing.smd,
24
+ }, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.row, children: [(0, jsx_runtime_1.jsx)(WalletImage_js_1.WalletImage, { theme: theme, size: 40, wallet: wallet, ensAvatar: ensAvatarQuery.data }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.col, children: [(0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", style: {
25
+ color: theme.colors.primaryButtonText,
26
+ }, children: addressOrENS }), balanceQuery.data ? ((0, jsx_runtime_1.jsxs)(text_js_1.ThemedText, { theme: theme, type: "subtext", style: {
27
+ fontSize: index_js_1.fontSize.sm,
28
+ }, children: [Number(balanceQuery.data.displayValue).toFixed(3), " ", balanceQuery.data?.symbol] })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { theme: theme, style: { width: 80, height: 16 }, color: theme.colors.secondaryText }))] })] }) }));
29
+ }
30
+ const styles = react_native_1.StyleSheet.create({
31
+ row: {
32
+ flexDirection: "row",
33
+ flex: 1,
34
+ gap: index_js_1.spacing.md,
35
+ alignItems: "center",
36
+ },
37
+ col: {
38
+ flexDirection: "column",
39
+ gap: index_js_1.spacing.xxs,
40
+ },
41
+ });
42
+ //# sourceMappingURL=ConnectedButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectedButton.js","s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A,YAAY,GACF,EACZ,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CACnB,wBAAC,oBAAU,IACT,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,SAAS,EACd,KAAK,EAAE;gCACL,QAAQ,EAAE,mBAAQ,CAAC,EAAE;6BACtB,aAEA,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EACtD,YAAY,CAAC,IAAI,EAAE,MAAM,IACf,CACd,CAAC,CAAC,CAAC,CACF,uBAAC,sBAAQ,IACP,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAChC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,aAAa,GACjC,CACH,IACI,IACF,GACM,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,aAAa,EAAE,KAAK;QACpB,IAAI,EAAE,CAAC;QACP,GAAG,EAAE,kBAAO,CAAC,EAAE;QACf,UAAU,EAAE,QAAQ;KACrB;IACD,GAAG,EAAE;QACH,aAAa,EAAE,QAAQ;QACvB,GAAG,EAAE,kBAAO,CAAC,GAAG;KACjB;CACF,CAAC,CAAC"}
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectedModal = ConnectedModal;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const react_native_1 = require("react-native");
7
+ const contract_js_1 = require("../../../../contract/contract.js");
8
+ const is_contract_deployed_js_1 = require("../../../../utils/bytecode/is-contract-deployed.js");
9
+ const useChainQuery_js_1 = require("../../../core/hooks/others/useChainQuery.js");
10
+ const isSmartWallet_js_1 = require("../../../core/utils/isSmartWallet.js");
11
+ const wallet_js_1 = require("../../../core/utils/wallet.js");
12
+ const index_js_1 = require("../../design-system/index.js");
13
+ const useActiveAccount_js_1 = require("../../hooks/wallets/useActiveAccount.js");
14
+ const useActiveWallet_js_1 = require("../../hooks/wallets/useActiveWallet.js");
15
+ const useActiveWalletChain_js_1 = require("../../hooks/wallets/useActiveWalletChain.js");
16
+ const useDisconnect_js_1 = require("../../hooks/wallets/useDisconnect.js");
17
+ const Address_js_1 = require("../components/Address.js");
18
+ const ChainIcon_js_1 = require("../components/ChainIcon.js");
19
+ const Header_js_1 = require("../components/Header.js");
20
+ const RNImage_js_1 = require("../components/RNImage.js");
21
+ const Skeleton_js_1 = require("../components/Skeleton.js");
22
+ const WalletImage_js_1 = require("../components/WalletImage.js");
23
+ const button_js_1 = require("../components/button.js");
24
+ const spacer_js_1 = require("../components/spacer.js");
25
+ const text_js_1 = require("../components/text.js");
26
+ const view_js_1 = require("../components/view.js");
27
+ const svgs_js_1 = require("../icons/svgs.js");
28
+ const ReceiveScreen_js_1 = require("./ReceiveScreen.js");
29
+ const SendScreen_js_1 = require("./SendScreen.js");
30
+ const TokenListScreen_js_1 = require("./TokenListScreen.js");
31
+ function ConnectedModal(props) {
32
+ const { theme, containerType, client } = props;
33
+ const [modalState, setModalState] = (0, react_1.useState)({
34
+ screen: "account",
35
+ });
36
+ let content;
37
+ switch (modalState.screen) {
38
+ case "send": {
39
+ content = ((0, jsx_runtime_1.jsx)(SendScreen_js_1.SendScreen, { theme: theme, client: client, onClose: props.onClose, onBack: () => setModalState({ screen: "account" }), containerType: containerType, supportedTokens: props.supportedTokens }));
40
+ break;
41
+ }
42
+ case "receive": {
43
+ content = ((0, jsx_runtime_1.jsx)(ReceiveScreen_js_1.ReceiveScreen, { account: props.account, wallet: props.wallet, theme: theme, containerType: props.containerType, onBack: () => setModalState({ screen: "account" }), onClose: props.onClose }));
44
+ break;
45
+ }
46
+ case "view_funds": {
47
+ content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_js_1.Header, { theme: theme, onClose: props.onClose, onBack: () => setModalState({ screen: "account" }), containerType: containerType, title: "View Funds" }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "xl" }), (0, jsx_runtime_1.jsx)(TokenListScreen_js_1.TokenListScreen, { client: client, theme: theme, supportedTokens: props.supportedTokens })] }));
48
+ break;
49
+ }
50
+ default: {
51
+ content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.onClose && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: props.onClose, style: {
52
+ padding: index_js_1.spacing.lg,
53
+ position: "absolute",
54
+ right: 0,
55
+ top: 0,
56
+ zIndex: 1,
57
+ }, children: (0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, data: svgs_js_1.CLOSE_ICON, size: 24, color: theme.colors.secondaryIconColor }) })), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "xl" }), (0, jsx_runtime_1.jsx)(AccountHeader, { ...props }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" }), (0, jsx_runtime_1.jsx)(WalletActionsRow, { ...props, setModalState: setModalState }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "lg" }), (0, jsx_runtime_1.jsx)(WalletMenu, { ...props, setModalState: setModalState })] }));
58
+ }
59
+ }
60
+ return ((0, jsx_runtime_1.jsx)(view_js_1.ThemedView, { theme: theme, style: containerType === "modal"
61
+ ? styles.modalContainer
62
+ : styles.embedContainer, children: content }));
63
+ }
64
+ const AccountHeader = (props) => {
65
+ const { account, wallet, theme } = props;
66
+ const walletChain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
67
+ const { ensAvatarQuery, addressOrENS, balanceQuery } = (0, wallet_js_1.useConnectedWalletDetails)(props.client, walletChain, account, props.detailsButton?.displayBalanceToken);
68
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.accountHeaderContainer, children: [(0, jsx_runtime_1.jsx)(WalletImage_js_1.WalletImage, { theme: theme, size: 64, wallet: wallet, ensAvatar: ensAvatarQuery.data }), (0, jsx_runtime_1.jsx)(SmartAccountBadge, { client: props.client, theme: theme }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "smd" }), (0, jsx_runtime_1.jsx)(Address_js_1.Address, { account: account, theme: theme, addressOrENS: addressOrENS }), (0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "xxs" }), balanceQuery.data ? ((0, jsx_runtime_1.jsxs)(text_js_1.ThemedText, { theme: theme, type: "subtext", style: {
69
+ fontSize: index_js_1.fontSize.sm,
70
+ }, children: [Number(balanceQuery.data.displayValue).toFixed(3), " ", balanceQuery.data?.symbol] })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { theme: theme, style: { width: 80, height: 16 } }))] }));
71
+ };
72
+ const WalletActionsRow = (props) => {
73
+ const { theme, setModalState } = props;
74
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.walletActionRowContainer, children: [(0, jsx_runtime_1.jsxs)(button_js_1.ThemedButton, { theme: theme, variant: "secondary", style: styles.walletActionButton, onPress: () => setModalState({ screen: "send" }), children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, size: 24, data: svgs_js_1.SEND_ICON, color: theme.colors.secondaryIconColor }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: "Send" })] }), (0, jsx_runtime_1.jsxs)(button_js_1.ThemedButton, { theme: theme, variant: "secondary", style: styles.walletActionButton, onPress: () => setModalState({ screen: "receive" }), children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, size: 24, data: svgs_js_1.RECEIVE_ICON, color: theme.colors.secondaryIconColor }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: "Receive" })] })] }));
75
+ };
76
+ const WalletMenu = (props) => {
77
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.walletMenuContainer, children: [(0, jsx_runtime_1.jsx)(ChainSwitcher, { ...props }), (0, jsx_runtime_1.jsx)(ViewFunds, { ...props }), (0, jsx_runtime_1.jsx)(DisconnectWallet, { ...props })] }));
78
+ };
79
+ const ChainSwitcher = (props) => {
80
+ const { client, wallet, theme } = props;
81
+ const chain = wallet.getChain();
82
+ const chainQuery = (0, useChainQuery_js_1.useChainQuery)(chain);
83
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: styles.walletMenuRow, children: [(0, jsx_runtime_1.jsx)(ChainIcon_js_1.ChainIcon, { client: client, size: 32, chain: chain, theme: theme }), chainQuery.data?.name ? ((0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: chainQuery.data?.name })) : ((0, jsx_runtime_1.jsx)(Skeleton_js_1.Skeleton, { theme: theme, style: { width: 80, height: 16 } }))] }));
84
+ };
85
+ const ViewFunds = (props) => {
86
+ const { theme, setModalState } = props;
87
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: styles.walletMenuRow, onPress: () => setModalState({ screen: "view_funds" }), children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, size: 32, data: svgs_js_1.COINS_ICON, color: theme.colors.secondaryIconColor }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: "View Funds" })] }));
88
+ };
89
+ const DisconnectWallet = (props) => {
90
+ const { wallet, theme, onClose } = props;
91
+ const { disconnect } = (0, useDisconnect_js_1.useDisconnect)();
92
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: styles.walletMenuRow, onPress: () => {
93
+ onClose?.();
94
+ disconnect(wallet);
95
+ }, children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, size: 32, data: svgs_js_1.EXIT_ICON, color: theme.colors.secondaryIconColor }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, type: "defaultSemiBold", children: "Disconnect Wallet" })] }));
96
+ };
97
+ function SmartAccountBadge(props) {
98
+ const activeAccount = (0, useActiveAccount_js_1.useActiveAccount)();
99
+ const activeWallet = (0, useActiveWallet_js_1.useActiveWallet)();
100
+ const isSmartWallet = (0, isSmartWallet_js_1.hasSmartAccount)(activeWallet);
101
+ const chain = (0, useActiveWalletChain_js_1.useActiveWalletChain)();
102
+ const { client, theme } = props;
103
+ const [isSmartWalletDeployed, setIsSmartWalletDeployed] = (0, react_1.useState)(false);
104
+ (0, react_1.useEffect)(() => {
105
+ if (activeAccount && isSmartWallet && activeAccount.address && chain) {
106
+ const contract = (0, contract_js_1.getContract)({
107
+ address: activeAccount.address,
108
+ chain,
109
+ client,
110
+ });
111
+ (0, is_contract_deployed_js_1.isContractDeployed)(contract).then((isDeployed) => {
112
+ setIsSmartWalletDeployed(isDeployed);
113
+ });
114
+ }
115
+ else {
116
+ setIsSmartWalletDeployed(false);
117
+ }
118
+ }, [activeAccount, chain, client, isSmartWallet]);
119
+ const content = ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
120
+ flexDirection: "row",
121
+ alignItems: "center",
122
+ justifyContent: "center",
123
+ gap: index_js_1.spacing.xs,
124
+ backgroundColor: theme.colors.secondaryButtonBg,
125
+ borderRadius: index_js_1.radius.md,
126
+ paddingVertical: index_js_1.spacing.xs,
127
+ paddingLeft: index_js_1.spacing.sm,
128
+ paddingRight: index_js_1.spacing.smd,
129
+ }, children: [(0, jsx_runtime_1.jsx)(RNImage_js_1.RNImage, { theme: theme, data: svgs_js_1.SMART_WALLET_ICON, size: 14, color: theme.colors.accentButtonBg }), (0, jsx_runtime_1.jsx)(text_js_1.ThemedText, { theme: theme, style: { color: theme.colors.primaryText, fontSize: index_js_1.fontSize.xs }, children: "Smart Account" })] }));
130
+ if (chain && activeAccount && isSmartWallet) {
131
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(spacer_js_1.Spacer, { size: "smd" }), isSmartWalletDeployed ? ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: () => react_native_1.Linking.openURL(`https://thirdweb.com/${chain.id}/${activeAccount.address}/account`), children: content })) : ((0, jsx_runtime_1.jsx)(react_native_1.View, { children: content }))] }));
132
+ }
133
+ return null;
134
+ }
135
+ const styles = react_native_1.StyleSheet.create({
136
+ modalContainer: {
137
+ flex: 1,
138
+ width: "100%",
139
+ flexDirection: "column",
140
+ borderTopLeftRadius: index_js_1.radius.lg,
141
+ borderTopRightRadius: index_js_1.radius.lg,
142
+ },
143
+ embedContainer: {
144
+ flex: 1,
145
+ width: "100%",
146
+ flexDirection: "column",
147
+ backgroundColor: "transparent",
148
+ },
149
+ accountHeaderContainer: {
150
+ flexDirection: "column",
151
+ justifyContent: "center",
152
+ alignItems: "center",
153
+ paddingHorizontal: index_js_1.spacing.lg,
154
+ },
155
+ walletActionRowContainer: {
156
+ flexDirection: "row",
157
+ justifyContent: "space-evenly",
158
+ alignItems: "center",
159
+ gap: index_js_1.spacing.md,
160
+ paddingHorizontal: index_js_1.spacing.lg,
161
+ },
162
+ walletActionButton: { flex: 1, padding: index_js_1.spacing.smd, gap: index_js_1.spacing.smd },
163
+ walletMenuContainer: {
164
+ flexDirection: "column",
165
+ gap: index_js_1.spacing.lg,
166
+ paddingHorizontal: index_js_1.spacing.lg,
167
+ },
168
+ walletMenuRow: {
169
+ flexDirection: "row",
170
+ justifyContent: "flex-start",
171
+ alignItems: "center",
172
+ gap: index_js_1.spacing.md,
173
+ },
174
+ });
175
+ //# sourceMappingURL=ConnectedModal.js.map