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,301 @@
1
+ import { useState } from "react";
2
+ import { Platform, StyleSheet, View } from "react-native";
3
+ import { SvgXml } from "react-native-svg";
4
+ import type { MultiStepAuthProviderType } from "../../../../wallets/in-app/core/authentication/type.js";
5
+ import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
6
+ import { parseTheme } from "../../../core/design-system/CustomThemeProvider.js";
7
+ import type { Theme } from "../../../core/design-system/index.js";
8
+ import type { ConnectButtonProps } from "../../../core/hooks/connection/ConnectButtonProps.js";
9
+ import type { ConnectEmbedProps } from "../../../core/hooks/connection/ConnectEmbedProps.js";
10
+ import { genericWalletIcon } from "../../../core/utils/socialIcons.js";
11
+ import { radius, spacing } from "../../design-system/index.js";
12
+ import { useActiveWallet } from "../../hooks/wallets/useActiveWallet.js";
13
+ import { useConnect } from "../../hooks/wallets/useConnect.js";
14
+ import { getDefaultWallets } from "../../wallets/defaultWallets.js";
15
+ import { type ContainerType, Header } from "../components/Header.js";
16
+ import { ThemedButtonWithIcon } from "../components/button.js";
17
+ import { Spacer } from "../components/spacer.js";
18
+ import { ThemedText } from "../components/text.js";
19
+ import { ThemedView } from "../components/view.js";
20
+ import { TW_ICON } from "../icons/svgs.js";
21
+ import { ExternalWalletsList } from "./ExternalWalletsList.js";
22
+ import { InAppWalletUI, OtpLogin } from "./InAppWalletUI.js";
23
+
24
+ export type ModalState =
25
+ | { screen: "base" }
26
+ | { screen: "otp"; auth: MultiStepAuthProviderType; wallet: Wallet<"inApp"> }
27
+ | { screen: "external_wallets" };
28
+
29
+ /**
30
+ * A component that allows the user to connect their wallet.
31
+ *
32
+ * 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.
33
+ *
34
+ * It only renders UI if wallet is not connected
35
+ * @example
36
+ * ```tsx
37
+ * <ConnectEmbed
38
+ * client={client}
39
+ * />
40
+ * ```
41
+ * @param props -
42
+ * The props for the `ConnectEmbed` component.
43
+ *
44
+ * Refer to the [`ConnectEmbedProps`](https://portal.thirdweb.com/references/typescript/v5/ConnectEmbedProps) type for more details
45
+ * @component
46
+ */
47
+ export function ConnectEmbed(props: ConnectEmbedProps) {
48
+ const theme = parseTheme(props.theme);
49
+ const wallet = useActiveWallet();
50
+ const adaptedProps = {
51
+ ...props,
52
+ connectModal: { ...props },
53
+ } as ConnectButtonProps;
54
+ return wallet ? null : (
55
+ <ConnectModal {...adaptedProps} theme={theme} containerType="embed" />
56
+ );
57
+ }
58
+
59
+ export function ConnectModal(
60
+ props: ConnectButtonProps & {
61
+ theme: Theme;
62
+ onClose?: () => void;
63
+ containerType: ContainerType;
64
+ },
65
+ ) {
66
+ const { theme, client, containerType, accountAbstraction, onConnect } = props;
67
+ const connectMutation = useConnect({
68
+ client,
69
+ accountAbstraction,
70
+ onConnect: (wallet) => {
71
+ props.onClose?.();
72
+ onConnect?.(wallet);
73
+ },
74
+ });
75
+ const wallets = props.wallets || getDefaultWallets(props);
76
+ const [modalState, setModalState] = useState<ModalState>({ screen: "base" });
77
+ const inAppWallet = wallets.find((wallet) => wallet.id === "inApp") as
78
+ | Wallet<"inApp">
79
+ | undefined;
80
+ const externalWallets = wallets.filter((wallet) => wallet.id !== "inApp");
81
+ const showBranding = props.connectModal?.showThirdwebBranding !== false;
82
+ let content: JSX.Element;
83
+
84
+ switch (modalState.screen) {
85
+ case "otp": {
86
+ content = (
87
+ <>
88
+ <Header
89
+ theme={theme}
90
+ onClose={props.onClose}
91
+ containerType={containerType}
92
+ onBack={() => setModalState({ screen: "base" })}
93
+ />
94
+ <Spacer size="xl" />
95
+ <View
96
+ style={{
97
+ flexDirection: "column",
98
+ gap: spacing.md,
99
+ paddingHorizontal: containerType === "modal" ? spacing.lg : 0,
100
+ }}
101
+ >
102
+ <OtpLogin
103
+ auth={modalState.auth}
104
+ wallet={modalState.wallet}
105
+ client={client}
106
+ setScreen={setModalState}
107
+ theme={theme}
108
+ connectMutation={connectMutation}
109
+ />
110
+ </View>
111
+ {containerType === "modal" ? (
112
+ <View style={{ flex: 1 }} />
113
+ ) : (
114
+ <Spacer size="md" />
115
+ )}
116
+ </>
117
+ );
118
+ break;
119
+ }
120
+ case "external_wallets": {
121
+ content = (
122
+ <>
123
+ <Header
124
+ theme={theme}
125
+ onClose={props.onClose}
126
+ containerType={containerType}
127
+ onBack={() => setModalState({ screen: "base" })}
128
+ />
129
+ <Spacer size="lg" />
130
+ <ExternalWalletsList
131
+ theme={theme}
132
+ externalWallets={externalWallets}
133
+ client={client}
134
+ connectMutation={connectMutation}
135
+ containerType={containerType}
136
+ />
137
+ </>
138
+ );
139
+ break;
140
+ }
141
+ default: {
142
+ content = (
143
+ <>
144
+ <Header
145
+ theme={theme}
146
+ onClose={props.onClose}
147
+ containerType={containerType}
148
+ />
149
+ {inAppWallet ? (
150
+ <>
151
+ {containerType === "modal" ? (
152
+ <View style={{ flex: 1 }} />
153
+ ) : (
154
+ <Spacer size="lg" />
155
+ )}
156
+ <View
157
+ style={{
158
+ flexDirection: "column",
159
+ gap: spacing.md,
160
+ paddingHorizontal: containerType === "modal" ? spacing.lg : 0,
161
+ }}
162
+ >
163
+ <InAppWalletUI
164
+ wallet={inAppWallet}
165
+ setScreen={setModalState}
166
+ client={client}
167
+ theme={theme}
168
+ connectMutation={connectMutation}
169
+ />
170
+ {externalWallets.length > 0 ? (
171
+ <>
172
+ <OrDivider theme={theme} />
173
+ <ThemedButtonWithIcon
174
+ theme={theme}
175
+ icon={genericWalletIcon}
176
+ title="Connect a wallet"
177
+ onPress={() =>
178
+ setModalState({ screen: "external_wallets" })
179
+ }
180
+ />
181
+ </>
182
+ ) : null}
183
+ </View>
184
+ {containerType === "modal" ? (
185
+ <View style={{ flex: 1 }} />
186
+ ) : (
187
+ <Spacer size="md" />
188
+ )}
189
+ </>
190
+ ) : externalWallets.length > 0 ? (
191
+ <>
192
+ <Spacer size="lg" />
193
+ <View
194
+ style={{
195
+ flex: 1,
196
+ }}
197
+ >
198
+ <ExternalWalletsList
199
+ theme={theme}
200
+ externalWallets={externalWallets}
201
+ client={client}
202
+ connectMutation={connectMutation}
203
+ containerType={containerType}
204
+ />
205
+ </View>
206
+ </>
207
+ ) : null}
208
+ </>
209
+ );
210
+ }
211
+ }
212
+
213
+ return (
214
+ <ThemedView
215
+ theme={theme}
216
+ style={
217
+ containerType === "modal"
218
+ ? styles.modalContainer
219
+ : styles.embedContainer
220
+ }
221
+ >
222
+ {content}
223
+ {showBranding && <PoweredByThirdweb theme={theme} />}
224
+ </ThemedView>
225
+ );
226
+ }
227
+
228
+ function OrDivider({ theme }: { theme: Theme }) {
229
+ return (
230
+ <View
231
+ style={{
232
+ flexDirection: "row",
233
+ alignItems: "center",
234
+ justifyContent: "center",
235
+ gap: spacing.lg,
236
+ }}
237
+ >
238
+ <View
239
+ style={{
240
+ flex: 1,
241
+ height: 1,
242
+ backgroundColor: theme.colors.borderColor,
243
+ }}
244
+ />
245
+ <ThemedText theme={theme} style={{ color: theme.colors.secondaryText }}>
246
+ OR
247
+ </ThemedText>
248
+ <View
249
+ style={{
250
+ flex: 1,
251
+ height: 1,
252
+ backgroundColor: theme.colors.borderColor,
253
+ }}
254
+ />
255
+ </View>
256
+ );
257
+ }
258
+
259
+ function PoweredByThirdweb({ theme }: { theme: Theme }) {
260
+ return (
261
+ <View
262
+ style={{
263
+ flexDirection: "row",
264
+ justifyContent: "center",
265
+ alignItems: "center",
266
+ gap: spacing.xs,
267
+ paddingBottom: Platform.OS === "android" ? spacing.md : spacing.lg,
268
+ }}
269
+ >
270
+ <ThemedText theme={theme} type="subtext">
271
+ Powered by
272
+ </ThemedText>
273
+ <SvgXml
274
+ xml={TW_ICON}
275
+ width={22}
276
+ height={22}
277
+ style={{ marginBottom: -2 }}
278
+ color={theme.colors.secondaryText}
279
+ />
280
+ <ThemedText theme={theme} type="subtext" style={{ fontWeight: "600" }}>
281
+ thirdweb
282
+ </ThemedText>
283
+ </View>
284
+ );
285
+ }
286
+
287
+ const styles = StyleSheet.create({
288
+ modalContainer: {
289
+ flex: 1,
290
+ width: "100%",
291
+ flexDirection: "column",
292
+ borderTopLeftRadius: radius.lg,
293
+ borderTopRightRadius: radius.lg,
294
+ },
295
+ embedContainer: {
296
+ flex: 1,
297
+ width: "100%",
298
+ flexDirection: "column",
299
+ backgroundColor: "transparent",
300
+ },
301
+ });
@@ -0,0 +1,94 @@
1
+ import { StyleSheet, View } from "react-native";
2
+ import type { Account, Wallet } from "../../../../wallets/interfaces/wallet.js";
3
+ import { parseTheme } from "../../../core/design-system/CustomThemeProvider.js";
4
+ import type { ConnectButtonProps } from "../../../core/hooks/connection/ConnectButtonProps.js";
5
+ import { useConnectedWalletDetails } from "../../../core/utils/wallet.js";
6
+ import { fontSize, spacing } from "../../design-system/index.js";
7
+ import { useActiveWalletChain } from "../../hooks/wallets/useActiveWalletChain.js";
8
+ import { Skeleton } from "../components/Skeleton.js";
9
+ import { WalletImage } from "../components/WalletImage.js";
10
+ import { ThemedButton } from "../components/button.js";
11
+ import { ThemedText } from "../components/text.js";
12
+
13
+ export function ConnectedButton(
14
+ props: ConnectButtonProps & {
15
+ openModal: () => void;
16
+ onClose: () => void;
17
+ wallet: Wallet;
18
+ account: Account;
19
+ },
20
+ ) {
21
+ const theme = parseTheme(props.theme);
22
+ const { account, wallet } = props;
23
+ const walletChain = useActiveWalletChain();
24
+ const { ensAvatarQuery, addressOrENS, balanceQuery } =
25
+ useConnectedWalletDetails(
26
+ props.client,
27
+ walletChain,
28
+ account,
29
+ props.detailsButton?.displayBalanceToken,
30
+ );
31
+ return (
32
+ <ThemedButton
33
+ theme={theme}
34
+ onPress={() => {
35
+ props.openModal();
36
+ }}
37
+ style={{
38
+ paddingHorizontal: spacing.md,
39
+ paddingVertical: spacing.smd,
40
+ }}
41
+ >
42
+ <View style={styles.row}>
43
+ <WalletImage
44
+ theme={theme}
45
+ size={40}
46
+ wallet={wallet}
47
+ ensAvatar={ensAvatarQuery.data}
48
+ />
49
+ <View style={styles.col}>
50
+ <ThemedText
51
+ theme={theme}
52
+ type="defaultSemiBold"
53
+ style={{
54
+ color: theme.colors.primaryButtonText,
55
+ }}
56
+ >
57
+ {addressOrENS}
58
+ </ThemedText>
59
+ {balanceQuery.data ? (
60
+ <ThemedText
61
+ theme={theme}
62
+ type="subtext"
63
+ style={{
64
+ fontSize: fontSize.sm,
65
+ }}
66
+ >
67
+ {Number(balanceQuery.data.displayValue).toFixed(3)}{" "}
68
+ {balanceQuery.data?.symbol}
69
+ </ThemedText>
70
+ ) : (
71
+ <Skeleton
72
+ theme={theme}
73
+ style={{ width: 80, height: 16 }}
74
+ color={theme.colors.secondaryText}
75
+ />
76
+ )}
77
+ </View>
78
+ </View>
79
+ </ThemedButton>
80
+ );
81
+ }
82
+
83
+ const styles = StyleSheet.create({
84
+ row: {
85
+ flexDirection: "row",
86
+ flex: 1,
87
+ gap: spacing.md,
88
+ alignItems: "center",
89
+ },
90
+ col: {
91
+ flexDirection: "column",
92
+ gap: spacing.xxs,
93
+ },
94
+ });