thirdweb 5.58.5 → 5.59.0-nightly-e2b3484764275560aa899f3f894b767faedaa9a1-20240925000331

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 (377) hide show
  1. package/dist/cjs/exports/react.js +3 -3
  2. package/dist/cjs/exports/react.js.map +1 -1
  3. package/dist/cjs/exports/react.native.js +5 -3
  4. package/dist/cjs/exports/react.native.js.map +1 -1
  5. package/dist/cjs/exports/wallets/in-app.js +3 -1
  6. package/dist/cjs/exports/wallets/in-app.js.map +1 -1
  7. package/dist/cjs/exports/wallets/in-app.native.js +3 -1
  8. package/dist/cjs/exports/wallets/in-app.native.js.map +1 -1
  9. package/dist/cjs/exports/wallets.js +15 -10
  10. package/dist/cjs/exports/wallets.js.map +1 -1
  11. package/dist/cjs/exports/wallets.native.js +18 -7
  12. package/dist/cjs/exports/wallets.native.js.map +1 -1
  13. package/dist/cjs/react/core/hooks/wallets/{useAdminAccount.js → useAdminWallet.js} +1 -1
  14. package/dist/cjs/react/core/hooks/wallets/useAdminWallet.js.map +1 -0
  15. package/dist/cjs/react/{core/hooks/others → native/hooks/wallets}/useProfiles.js +15 -7
  16. package/dist/cjs/react/native/hooks/wallets/useProfiles.js.map +1 -0
  17. package/dist/cjs/react/native/ui/connect/ConnectedButton.js +1 -1
  18. package/dist/cjs/react/native/ui/connect/ConnectedButton.js.map +1 -1
  19. package/dist/cjs/react/native/ui/connect/ConnectedModal.js +1 -1
  20. package/dist/cjs/react/native/ui/connect/ConnectedModal.js.map +1 -1
  21. package/dist/cjs/react/native/ui/connect/TokenListScreen.js +1 -1
  22. package/dist/cjs/react/native/ui/connect/TokenListScreen.js.map +1 -1
  23. package/dist/cjs/react/web/hooks/wallets/useProfiles.js +45 -0
  24. package/dist/cjs/react/web/hooks/wallets/useProfiles.js.map +1 -0
  25. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +4 -4
  26. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  27. package/dist/cjs/react/web/ui/ConnectWallet/Modal/TOS.js +2 -2
  28. package/dist/cjs/react/web/ui/ConnectWallet/Modal/TOS.js.map +1 -1
  29. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +2 -2
  30. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  31. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +1 -1
  32. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
  33. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +1 -1
  34. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
  35. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +6 -6
  36. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  37. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
  38. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  39. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +2 -2
  40. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +1 -1
  41. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +1 -1
  42. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  43. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +3 -3
  44. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +1 -1
  45. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +1 -1
  46. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +1 -1
  47. package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +2 -2
  48. package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -1
  49. package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +4 -2
  50. package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
  51. package/dist/cjs/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js +2 -2
  52. package/dist/cjs/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js.map +1 -1
  53. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +2 -2
  54. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  55. package/dist/cjs/react/web/wallets/in-app/WalletAuth.js +5 -4
  56. package/dist/cjs/react/web/wallets/in-app/WalletAuth.js.map +1 -1
  57. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +10 -10
  58. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  59. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +4 -3
  60. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  61. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +9 -7
  62. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  63. package/dist/cjs/react/web/wallets/shared/SocialLogin.js +3 -2
  64. package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
  65. package/dist/cjs/version.js +1 -1
  66. package/dist/cjs/version.js.map +1 -1
  67. package/dist/cjs/wallets/in-app/core/authentication/linkAccount.js +7 -7
  68. package/dist/cjs/wallets/in-app/core/authentication/linkAccount.js.map +1 -1
  69. package/dist/cjs/wallets/in-app/core/authentication/types.js.map +1 -1
  70. package/dist/cjs/wallets/in-app/core/wallet/ecosystem-core.js +0 -20
  71. package/dist/cjs/wallets/in-app/core/wallet/ecosystem-core.js.map +1 -1
  72. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +0 -39
  73. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
  74. package/dist/cjs/wallets/in-app/native/auth/index.js +57 -2
  75. package/dist/cjs/wallets/in-app/native/auth/index.js.map +1 -1
  76. package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -1
  77. package/dist/cjs/wallets/in-app/native/native-connector.js +61 -19
  78. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  79. package/dist/cjs/wallets/in-app/web/lib/actions/sign-message.enclave.js +1 -1
  80. package/dist/cjs/wallets/in-app/web/lib/actions/sign-message.enclave.js.map +1 -1
  81. package/dist/cjs/wallets/in-app/web/lib/actions/sign-transaction.enclave.js +1 -1
  82. package/dist/cjs/wallets/in-app/web/lib/actions/sign-transaction.enclave.js.map +1 -1
  83. package/dist/cjs/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js +1 -1
  84. package/dist/cjs/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js.map +1 -1
  85. package/dist/cjs/wallets/in-app/web/lib/auth/abstract-login.js.map +1 -1
  86. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js +2 -8
  87. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
  88. package/dist/cjs/wallets/in-app/web/lib/auth/index.js +80 -4
  89. package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
  90. package/dist/cjs/wallets/in-app/web/lib/enclave-wallet.js +2 -8
  91. package/dist/cjs/wallets/in-app/web/lib/enclave-wallet.js.map +1 -1
  92. package/dist/cjs/wallets/in-app/web/lib/get-auth-token.js +1 -0
  93. package/dist/cjs/wallets/in-app/web/lib/get-auth-token.js.map +1 -1
  94. package/dist/cjs/wallets/in-app/web/lib/iframe-wallet.js +2 -8
  95. package/dist/cjs/wallets/in-app/web/lib/iframe-wallet.js.map +1 -1
  96. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +31 -0
  97. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  98. package/dist/esm/exports/react.js +2 -2
  99. package/dist/esm/exports/react.js.map +1 -1
  100. package/dist/esm/exports/react.native.js +2 -1
  101. package/dist/esm/exports/react.native.js.map +1 -1
  102. package/dist/esm/exports/wallets/in-app.js +1 -1
  103. package/dist/esm/exports/wallets/in-app.js.map +1 -1
  104. package/dist/esm/exports/wallets/in-app.native.js +1 -1
  105. package/dist/esm/exports/wallets/in-app.native.js.map +1 -1
  106. package/dist/esm/exports/wallets.js +1 -1
  107. package/dist/esm/exports/wallets.js.map +1 -1
  108. package/dist/esm/exports/wallets.native.js +4 -0
  109. package/dist/esm/exports/wallets.native.js.map +1 -1
  110. package/dist/esm/react/core/hooks/wallets/{useAdminAccount.js → useAdminWallet.js} +1 -1
  111. package/dist/esm/react/core/hooks/wallets/useAdminWallet.js.map +1 -0
  112. package/dist/esm/react/{core/hooks/others → native/hooks/wallets}/useProfiles.js +14 -6
  113. package/dist/esm/react/native/hooks/wallets/useProfiles.js.map +1 -0
  114. package/dist/esm/react/native/ui/connect/ConnectedButton.js +1 -1
  115. package/dist/esm/react/native/ui/connect/ConnectedButton.js.map +1 -1
  116. package/dist/esm/react/native/ui/connect/ConnectedModal.js +1 -1
  117. package/dist/esm/react/native/ui/connect/ConnectedModal.js.map +1 -1
  118. package/dist/esm/react/native/ui/connect/TokenListScreen.js +1 -1
  119. package/dist/esm/react/native/ui/connect/TokenListScreen.js.map +1 -1
  120. package/dist/esm/react/web/hooks/wallets/useProfiles.js +42 -0
  121. package/dist/esm/react/web/hooks/wallets/useProfiles.js.map +1 -0
  122. package/dist/esm/react/web/ui/ConnectWallet/Details.js +3 -3
  123. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  124. package/dist/esm/react/web/ui/ConnectWallet/Modal/TOS.js +2 -2
  125. package/dist/esm/react/web/ui/ConnectWallet/Modal/TOS.js.map +1 -1
  126. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +2 -2
  127. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  128. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +1 -1
  129. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
  130. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +1 -1
  131. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
  132. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +6 -6
  133. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  134. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
  135. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  136. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +2 -2
  137. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +1 -1
  138. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +1 -1
  139. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
  140. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +3 -3
  141. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +1 -1
  142. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +1 -1
  143. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +1 -1
  144. package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +1 -1
  145. package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -1
  146. package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +4 -2
  147. package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
  148. package/dist/esm/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js +1 -1
  149. package/dist/esm/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js.map +1 -1
  150. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +1 -1
  151. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  152. package/dist/esm/react/web/wallets/in-app/WalletAuth.js +3 -2
  153. package/dist/esm/react/web/wallets/in-app/WalletAuth.js.map +1 -1
  154. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +2 -2
  155. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  156. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +5 -4
  157. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  158. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +5 -3
  159. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  160. package/dist/esm/react/web/wallets/shared/SocialLogin.js +3 -2
  161. package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
  162. package/dist/esm/version.js +1 -1
  163. package/dist/esm/version.js.map +1 -1
  164. package/dist/esm/wallets/in-app/core/authentication/linkAccount.js +7 -7
  165. package/dist/esm/wallets/in-app/core/authentication/linkAccount.js.map +1 -1
  166. package/dist/esm/wallets/in-app/core/authentication/types.js.map +1 -1
  167. package/dist/esm/wallets/in-app/core/wallet/ecosystem-core.js +0 -20
  168. package/dist/esm/wallets/in-app/core/wallet/ecosystem-core.js.map +1 -1
  169. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +0 -39
  170. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
  171. package/dist/esm/wallets/in-app/native/auth/index.js +55 -2
  172. package/dist/esm/wallets/in-app/native/auth/index.js.map +1 -1
  173. package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -1
  174. package/dist/esm/wallets/in-app/native/native-connector.js +61 -19
  175. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  176. package/dist/esm/wallets/in-app/web/lib/actions/sign-message.enclave.js +1 -1
  177. package/dist/esm/wallets/in-app/web/lib/actions/sign-message.enclave.js.map +1 -1
  178. package/dist/esm/wallets/in-app/web/lib/actions/sign-transaction.enclave.js +1 -1
  179. package/dist/esm/wallets/in-app/web/lib/actions/sign-transaction.enclave.js.map +1 -1
  180. package/dist/esm/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js +1 -1
  181. package/dist/esm/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js.map +1 -1
  182. package/dist/esm/wallets/in-app/web/lib/auth/abstract-login.js.map +1 -1
  183. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js +2 -8
  184. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
  185. package/dist/esm/wallets/in-app/web/lib/auth/index.js +77 -4
  186. package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
  187. package/dist/esm/wallets/in-app/web/lib/enclave-wallet.js +2 -8
  188. package/dist/esm/wallets/in-app/web/lib/enclave-wallet.js.map +1 -1
  189. package/dist/esm/wallets/in-app/web/lib/get-auth-token.js +1 -0
  190. package/dist/esm/wallets/in-app/web/lib/get-auth-token.js.map +1 -1
  191. package/dist/esm/wallets/in-app/web/lib/iframe-wallet.js +2 -8
  192. package/dist/esm/wallets/in-app/web/lib/iframe-wallet.js.map +1 -1
  193. package/dist/esm/wallets/in-app/web/lib/web-connector.js +31 -0
  194. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  195. package/dist/types/exports/react.d.ts +2 -2
  196. package/dist/types/exports/react.d.ts.map +1 -1
  197. package/dist/types/exports/react.native.d.ts +2 -1
  198. package/dist/types/exports/react.native.d.ts.map +1 -1
  199. package/dist/types/exports/wallets/in-app.d.ts +1 -1
  200. package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
  201. package/dist/types/exports/wallets/in-app.native.d.ts +1 -1
  202. package/dist/types/exports/wallets/in-app.native.d.ts.map +1 -1
  203. package/dist/types/exports/wallets.d.ts +1 -1
  204. package/dist/types/exports/wallets.d.ts.map +1 -1
  205. package/dist/types/exports/wallets.native.d.ts +2 -0
  206. package/dist/types/exports/wallets.native.d.ts.map +1 -1
  207. package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts +1 -1
  208. package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts.map +1 -1
  209. package/dist/types/react/core/hooks/wallets/useActiveWallet.d.ts +1 -1
  210. package/dist/types/react/core/hooks/wallets/useActiveWallet.d.ts.map +1 -1
  211. package/dist/types/react/core/hooks/wallets/useActiveWalletConnectionStatus.d.ts +1 -1
  212. package/dist/types/react/core/hooks/wallets/useActiveWalletConnectionStatus.d.ts.map +1 -1
  213. package/dist/types/react/core/hooks/wallets/useAddConnectedWallet.d.ts +1 -1
  214. package/dist/types/react/core/hooks/wallets/useAddConnectedWallet.d.ts.map +1 -1
  215. package/dist/types/react/core/hooks/wallets/{useAdminAccount.d.ts → useAdminWallet.d.ts} +2 -2
  216. package/dist/types/react/core/hooks/wallets/useAdminWallet.d.ts.map +1 -0
  217. package/dist/types/react/core/hooks/wallets/useConnectedWallets.d.ts +1 -1
  218. package/dist/types/react/core/hooks/wallets/useConnectedWallets.d.ts.map +1 -1
  219. package/dist/types/react/core/hooks/wallets/useDisconnect.d.ts +1 -1
  220. package/dist/types/react/core/hooks/wallets/useSetActiveWallet.d.ts +1 -1
  221. package/dist/types/react/core/hooks/wallets/useSetActiveWallet.d.ts.map +1 -1
  222. package/dist/types/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts +1 -1
  223. package/dist/types/react/core/hooks/wallets/useSetActiveWalletConnectionStatus.d.ts.map +1 -1
  224. package/dist/types/react/core/providers/connection-manager.d.ts +27 -27
  225. package/dist/types/react/{core/hooks/others → native/hooks/wallets}/useProfiles.d.ts +8 -3
  226. package/dist/types/react/native/hooks/wallets/useProfiles.d.ts.map +1 -0
  227. package/dist/types/react/web/hooks/wallets/useProfiles.d.ts +28 -0
  228. package/dist/types/react/web/hooks/wallets/useProfiles.d.ts.map +1 -0
  229. package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts.map +1 -1
  230. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.d.ts.map +1 -1
  231. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +1 -1
  232. package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts.map +1 -1
  233. package/dist/types/react/web/ui/MediaRenderer/ModelViewer.d.ts +1 -1
  234. package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts.map +1 -1
  235. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
  236. package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts +1 -1
  237. package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
  238. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
  239. package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts +1 -2
  240. package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts.map +1 -1
  241. package/dist/types/utils/fetch.d.ts +1 -1
  242. package/dist/types/utils/fetch.d.ts.map +1 -1
  243. package/dist/types/version.d.ts +1 -1
  244. package/dist/types/version.d.ts.map +1 -1
  245. package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +1 -1
  246. package/dist/types/wallets/in-app/core/authentication/guest.d.ts +1 -1
  247. package/dist/types/wallets/in-app/core/authentication/linkAccount.d.ts +6 -3
  248. package/dist/types/wallets/in-app/core/authentication/linkAccount.d.ts.map +1 -1
  249. package/dist/types/wallets/in-app/core/authentication/passkeys.d.ts +1 -1
  250. package/dist/types/wallets/in-app/core/authentication/siwe.d.ts +1 -1
  251. package/dist/types/wallets/in-app/core/authentication/types.d.ts +4 -3
  252. package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
  253. package/dist/types/wallets/in-app/core/interfaces/connector.d.ts +3 -1
  254. package/dist/types/wallets/in-app/core/interfaces/connector.d.ts.map +1 -1
  255. package/dist/types/wallets/in-app/core/wallet/ecosystem-core.d.ts.map +1 -1
  256. package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts +1 -1
  257. package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts.map +1 -1
  258. package/dist/types/wallets/in-app/core/wallet/types.d.ts +5 -0
  259. package/dist/types/wallets/in-app/core/wallet/types.d.ts.map +1 -1
  260. package/dist/types/wallets/in-app/native/auth/index.d.ts +48 -2
  261. package/dist/types/wallets/in-app/native/auth/index.d.ts.map +1 -1
  262. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts +1 -1
  263. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -1
  264. package/dist/types/wallets/in-app/native/native-connector.d.ts +8 -2
  265. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  266. package/dist/types/wallets/in-app/web/lib/actions/generate-wallet.enclave.d.ts +1 -1
  267. package/dist/types/wallets/in-app/web/lib/actions/generate-wallet.enclave.d.ts.map +1 -1
  268. package/dist/types/wallets/in-app/web/lib/actions/get-enclave-user-status.d.ts +1 -1
  269. package/dist/types/wallets/in-app/web/lib/actions/get-enclave-user-status.d.ts.map +1 -1
  270. package/dist/types/wallets/in-app/web/lib/actions/sign-message.enclave.d.ts +1 -1
  271. package/dist/types/wallets/in-app/web/lib/actions/sign-message.enclave.d.ts.map +1 -1
  272. package/dist/types/wallets/in-app/web/lib/actions/sign-transaction.enclave.d.ts +1 -1
  273. package/dist/types/wallets/in-app/web/lib/actions/sign-transaction.enclave.d.ts.map +1 -1
  274. package/dist/types/wallets/in-app/web/lib/actions/sign-typed-data.enclave.d.ts +1 -1
  275. package/dist/types/wallets/in-app/web/lib/actions/sign-typed-data.enclave.d.ts.map +1 -1
  276. package/dist/types/wallets/in-app/web/lib/auth/abstract-login.d.ts +2 -1
  277. package/dist/types/wallets/in-app/web/lib/auth/abstract-login.d.ts.map +1 -1
  278. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts +5 -3
  279. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts.map +1 -1
  280. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +68 -8
  281. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
  282. package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts +1 -1
  283. package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts.map +1 -1
  284. package/dist/types/wallets/in-app/web/lib/auth/otp.d.ts +1 -1
  285. package/dist/types/wallets/in-app/web/lib/auth/otp.d.ts.map +1 -1
  286. package/dist/types/wallets/in-app/web/lib/enclave-wallet.d.ts +8 -7
  287. package/dist/types/wallets/in-app/web/lib/enclave-wallet.d.ts.map +1 -1
  288. package/dist/types/wallets/in-app/web/lib/get-auth-token.d.ts +1 -1
  289. package/dist/types/wallets/in-app/web/lib/get-auth-token.d.ts.map +1 -1
  290. package/dist/types/wallets/in-app/web/lib/iframe-wallet.d.ts +5 -3
  291. package/dist/types/wallets/in-app/web/lib/iframe-wallet.d.ts.map +1 -1
  292. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +9 -8
  293. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  294. package/dist/types/wallets/in-app/web/types.d.ts +1 -5
  295. package/dist/types/wallets/in-app/web/types.d.ts.map +1 -1
  296. package/dist/types/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.d.ts +1 -1
  297. package/dist/types/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.d.ts.map +1 -1
  298. package/package.json +4 -4
  299. package/src/exports/react.native.ts +2 -1
  300. package/src/exports/react.ts +2 -2
  301. package/src/exports/wallets/in-app.native.ts +2 -0
  302. package/src/exports/wallets/in-app.ts +2 -0
  303. package/src/exports/wallets.native.ts +12 -0
  304. package/src/exports/wallets.ts +6 -1
  305. package/src/react/{core/hooks/others → native/hooks/wallets}/useProfiles.ts +19 -8
  306. package/src/react/native/ui/connect/ConnectedButton.tsx +1 -1
  307. package/src/react/native/ui/connect/ConnectedModal.tsx +1 -1
  308. package/src/react/native/ui/connect/TokenListScreen.tsx +1 -1
  309. package/src/react/web/hooks/wallets/useProfiles.ts +48 -0
  310. package/src/react/web/ui/ConnectWallet/Details.tsx +4 -4
  311. package/src/react/web/ui/ConnectWallet/Modal/TOS.tsx +3 -2
  312. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +4 -1
  313. package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +1 -1
  314. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx +2 -3
  315. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +10 -10
  316. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +1 -1
  317. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.tsx +2 -2
  318. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +1 -1
  319. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.tsx +3 -4
  320. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.tsx +1 -1
  321. package/src/react/web/ui/ConnectWallet/screens/LinkProfileScreen.tsx +1 -1
  322. package/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx +4 -2
  323. package/src/react/web/ui/ConnectWallet/screens/ManageWalletScreen.tsx +1 -1
  324. package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +1 -1
  325. package/src/react/web/ui/prebuilt/NFT/NFT.test.tsx +2 -2
  326. package/src/react/web/wallets/in-app/WalletAuth.tsx +3 -2
  327. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +2 -2
  328. package/src/react/web/wallets/shared/OTPLoginUI.tsx +8 -4
  329. package/src/react/web/wallets/shared/PassKeyLogin.tsx +6 -3
  330. package/src/react/web/wallets/shared/SocialLogin.tsx +3 -2
  331. package/src/react/web/wallets/shared/oauthSignIn.ts +1 -1
  332. package/src/utils/fetch.test.ts +1 -1
  333. package/src/utils/fetch.ts +1 -1
  334. package/src/version.ts +1 -1
  335. package/src/wallets/in-app/core/authentication/getLoginPath.ts +1 -1
  336. package/src/wallets/in-app/core/authentication/guest.ts +1 -1
  337. package/src/wallets/in-app/core/authentication/linkAccount.ts +15 -11
  338. package/src/wallets/in-app/core/authentication/passkeys.ts +1 -1
  339. package/src/wallets/in-app/core/authentication/siwe.ts +1 -1
  340. package/src/wallets/in-app/core/authentication/types.ts +10 -8
  341. package/src/wallets/in-app/core/interfaces/connector.ts +4 -0
  342. package/src/wallets/in-app/core/wallet/ecosystem-core.ts +1 -40
  343. package/src/wallets/in-app/core/wallet/in-app-core.ts +1 -58
  344. package/src/wallets/in-app/core/wallet/types.ts +6 -0
  345. package/src/wallets/in-app/native/auth/index.ts +62 -6
  346. package/src/wallets/in-app/native/auth/native-auth.ts +1 -1
  347. package/src/wallets/in-app/native/native-connector.ts +53 -27
  348. package/src/wallets/in-app/web/lib/actions/generate-wallet.enclave.ts +1 -1
  349. package/src/wallets/in-app/web/lib/actions/get-enclave-user-status.ts +1 -1
  350. package/src/wallets/in-app/web/lib/actions/sign-message.enclave.ts +2 -2
  351. package/src/wallets/in-app/web/lib/actions/sign-transaction.enclave.ts +2 -2
  352. package/src/wallets/in-app/web/lib/actions/sign-typed-data.enclave.ts +2 -2
  353. package/src/wallets/in-app/web/lib/auth/abstract-login.ts +2 -1
  354. package/src/wallets/in-app/web/lib/auth/iframe-auth.ts +6 -8
  355. package/src/wallets/in-app/web/lib/auth/index.ts +89 -19
  356. package/src/wallets/in-app/web/lib/auth/oauth.ts +1 -1
  357. package/src/wallets/in-app/web/lib/auth/otp.ts +1 -1
  358. package/src/wallets/in-app/web/lib/enclave-wallet.ts +9 -13
  359. package/src/wallets/in-app/web/lib/get-auth-token.ts +2 -1
  360. package/src/wallets/in-app/web/lib/iframe-wallet.ts +5 -9
  361. package/src/wallets/in-app/web/lib/web-connector.ts +37 -4
  362. package/src/wallets/in-app/web/types.ts +1 -6
  363. package/src/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.ts +1 -1
  364. package/dist/cjs/react/core/hooks/others/useProfiles.js.map +0 -1
  365. package/dist/cjs/react/core/hooks/wallets/useAdminAccount.js.map +0 -1
  366. package/dist/cjs/wallets/in-app/core/wallet/profiles.js +0 -61
  367. package/dist/cjs/wallets/in-app/core/wallet/profiles.js.map +0 -1
  368. package/dist/esm/react/core/hooks/others/useProfiles.js.map +0 -1
  369. package/dist/esm/react/core/hooks/wallets/useAdminAccount.js.map +0 -1
  370. package/dist/esm/wallets/in-app/core/wallet/profiles.js +0 -57
  371. package/dist/esm/wallets/in-app/core/wallet/profiles.js.map +0 -1
  372. package/dist/types/react/core/hooks/others/useProfiles.d.ts.map +0 -1
  373. package/dist/types/react/core/hooks/wallets/useAdminAccount.d.ts.map +0 -1
  374. package/dist/types/wallets/in-app/core/wallet/profiles.d.ts +0 -49
  375. package/dist/types/wallets/in-app/core/wallet/profiles.d.ts.map +0 -1
  376. package/src/wallets/in-app/core/wallet/profiles.ts +0 -76
  377. /package/src/react/core/hooks/wallets/{useAdminAccount.ts → useAdminWallet.ts} +0 -0
@@ -134,7 +134,7 @@ export function SwapStatusScreen(props: {
134
134
  </Text>
135
135
  <Spacer y="sm" />
136
136
  <Text size="sm" color="danger">
137
- Expected {swapStatus.data.quote.toToken.symbol}, Got
137
+ Expected {swapStatus.data.quote.toToken.symbol}, Got{" "}
138
138
  {swapStatus.data.destination.token.symbol} instead
139
139
  </Text>
140
140
  </Container>
@@ -8,7 +8,7 @@ import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
8
8
  import type { EcosystemWalletId } from "../../../../../wallets/wallet-types.js";
9
9
  import { iconSize } from "../../../../core/design-system/index.js";
10
10
  import { useActiveWalletChain } from "../../../../core/hooks/wallets/useActiveWalletChain.js";
11
- import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminAccount.js";
11
+ import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminWallet.js";
12
12
  import EcosystemWalletConnectUI from "../../../wallets/ecosystem/EcosystemWalletConnectUI.js";
13
13
  import { LoadingScreen } from "../../../wallets/shared/LoadingScreen.js";
14
14
  import { Container, Line, ModalHeader } from "../../components/basic.js";
@@ -3,9 +3,9 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
3
3
  import { shortenAddress } from "../../../../../utils/address.js";
4
4
  import type { Profile } from "../../../../../wallets/in-app/core/authentication/types.js";
5
5
  import { fontSize, iconSize } from "../../../../core/design-system/index.js";
6
- import { useProfiles } from "../../../../core/hooks/others/useProfiles.js";
7
6
  import { useSocialProfiles } from "../../../../core/social/useSocialProfiles.js";
8
7
  import { getWalletIcon } from "../../../../core/utils/walletIcon.js";
8
+ import { useProfiles } from "../../../hooks/wallets/useProfiles.js";
9
9
  import { LoadingScreen } from "../../../wallets/shared/LoadingScreen.js";
10
10
  import { Img } from "../../components/Img.js";
11
11
  import { Spacer } from "../../components/Spacer.js";
@@ -44,7 +44,9 @@ export function LinkedProfilesScreen(props: {
44
44
  locale: ConnectLocale;
45
45
  client: ThirdwebClient;
46
46
  }) {
47
- const { data: connectedProfiles, isLoading } = useProfiles();
47
+ const { data: connectedProfiles, isLoading } = useProfiles({
48
+ client: props.client,
49
+ });
48
50
 
49
51
  if (isLoading) {
50
52
  return <LoadingScreen />;
@@ -6,7 +6,7 @@ import { isInAppWallet } from "../../../../../wallets/in-app/core/wallet/index.j
6
6
  import { injectedProvider } from "../../../../../wallets/injected/mipdStore.js";
7
7
  import { fontSize, iconSize } from "../../../../core/design-system/index.js";
8
8
  import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js";
9
- import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminAccount.js";
9
+ import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminWallet.js";
10
10
  import { Spacer } from "../../components/Spacer.js";
11
11
  import { Container, Line, ModalHeader } from "../../components/basic.js";
12
12
  import { Text } from "../../components/text.js";
@@ -13,7 +13,7 @@ import { useSiweAuth } from "../../../../core/hooks/auth/useSiweAuth.js";
13
13
  import type { ConnectButtonProps } from "../../../../core/hooks/connection/ConnectButtonProps.js";
14
14
  import { useActiveAccount } from "../../../../core/hooks/wallets/useActiveAccount.js";
15
15
  import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js";
16
- import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminAccount.js";
16
+ import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminWallet.js";
17
17
  import { useDisconnect } from "../../../../core/hooks/wallets/useDisconnect.js";
18
18
  import { wait } from "../../../../core/utils/wait.js";
19
19
  import { LoadingScreen } from "../../../wallets/shared/LoadingScreen.js";
@@ -58,8 +58,8 @@ describe.runIf(process.env.TW_SECRET_KEY)("NFT prebuilt component", () => {
58
58
  }
59
59
  return (
60
60
  <div>
61
- Contract: {String(context.contract.address)}
62
- Token ID: {context.tokenId.toString()}
61
+ Contract: {String(context.contract)}, Token ID:{" "}
62
+ {context.tokenId.toString()}
63
63
  </div>
64
64
  );
65
65
  }
@@ -1,7 +1,7 @@
1
1
  import { Suspense, useRef, useState } from "react";
2
2
  import { defineChain } from "../../../../chains/utils.js";
3
3
  import type { ThirdwebClient } from "../../../../client/client.js";
4
- import { linkProfile } from "../../../../wallets/in-app/core/wallet/profiles.js";
4
+ import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
5
5
  import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
6
6
  import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
7
7
  import { iconSize } from "../../../core/design-system/index.js";
@@ -54,7 +54,8 @@ export function WalletAuth(props: {
54
54
  setStatus("loading");
55
55
  walletToConnect.current = walletToLink;
56
56
  try {
57
- await linkProfile(wallet as Wallet<"inApp">, {
57
+ await linkProfile({
58
+ client: props.client,
58
59
  strategy: "wallet",
59
60
  wallet: walletToLink,
60
61
  chain: wallet.getChain() || defineChain(1),
@@ -8,7 +8,7 @@ import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
8
8
  import { getEcosystemWalletAuthOptions } from "../../../../wallets/ecosystem/get-ecosystem-wallet-auth-options.js";
9
9
  import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
10
10
  import type { Profile } from "../../../../wallets/in-app/core/authentication/types.js";
11
- import { linkProfile } from "../../../../wallets/in-app/core/wallet/profiles.js";
11
+ import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
12
12
  import { loginWithOauthRedirect } from "../../../../wallets/in-app/web/lib/auth/oauth.js";
13
13
  import type { Account, Wallet } from "../../../../wallets/interfaces/wallet.js";
14
14
  import {
@@ -269,7 +269,7 @@ export const ConnectWalletSocialOptions = (
269
269
  if (wallet.id !== "inApp" && !isEcosystemWallet(wallet)) {
270
270
  throw new Error("Only in-app wallets support multi-auth");
271
271
  }
272
- return linkProfile(wallet, connectOptions);
272
+ return linkProfile(connectOptions);
273
273
  }
274
274
 
275
275
  const connectPromise = wallet.connect(connectOptions);
@@ -4,8 +4,10 @@ import type { Chain } from "../../../../chains/types.js";
4
4
  import type { ThirdwebClient } from "../../../../client/client.js";
5
5
  import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
6
6
  import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
7
- import { linkProfile } from "../../../../wallets/in-app/core/wallet/profiles.js";
8
- import { preAuthenticate } from "../../../../wallets/in-app/web/lib/auth/index.js";
7
+ import {
8
+ linkProfile,
9
+ preAuthenticate,
10
+ } from "../../../../wallets/in-app/web/lib/auth/index.js";
9
11
  import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
10
12
  import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
11
13
  import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
@@ -126,13 +128,15 @@ export function OTPLoginUI(props: {
126
128
 
127
129
  async function link(otp: string) {
128
130
  if ("email" in userInfo) {
129
- await linkProfile(wallet as Wallet<"inApp">, {
131
+ await linkProfile({
132
+ client: props.client,
130
133
  strategy: "email",
131
134
  email: userInfo.email,
132
135
  verificationCode: otp,
133
136
  });
134
137
  } else if ("phone" in userInfo) {
135
- await linkProfile(wallet as Wallet<"inApp">, {
138
+ await linkProfile({
139
+ client: props.client,
136
140
  strategy: "phone",
137
141
  phoneNumber: userInfo.phone,
138
142
  verificationCode: otp,
@@ -1,10 +1,11 @@
1
1
  import { useEffect, useRef, useState } from "react";
2
2
  import type { Chain } from "../../../../chains/types.js";
3
3
  import type { ThirdwebClient } from "../../../../client/client.js";
4
- import { type Wallet, linkProfile } from "../../../../exports/wallets.js";
5
4
  import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
6
5
  import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
6
+ import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
7
7
  import { hasStoredPasskey } from "../../../../wallets/in-app/web/lib/auth/passkeys.js";
8
+ import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
8
9
  import { iconSize } from "../../../core/design-system/index.js";
9
10
  import { setLastAuthProvider } from "../../../core/utils/storage.js";
10
11
  import { FingerPrintIcon } from "../../ui/ConnectWallet/icons/FingerPrintIcon.js";
@@ -141,7 +142,8 @@ function LoginScreen(props: {
141
142
  setStatus("loading");
142
143
  try {
143
144
  if (props.isLinking) {
144
- await linkProfile(wallet as Wallet<"inApp">, {
145
+ await linkProfile({
146
+ client,
145
147
  strategy: "passkey",
146
148
  type: "sign-in",
147
149
  }).catch((e) => {
@@ -214,7 +216,8 @@ function SignupScreen(props: {
214
216
  setStatus("loading");
215
217
  try {
216
218
  if (props.isLinking) {
217
- await linkProfile(wallet as Wallet<"inApp">, {
219
+ await linkProfile({
220
+ client,
218
221
  strategy: "passkey",
219
222
  type: "sign-up",
220
223
  });
@@ -4,8 +4,8 @@ import type { Chain } from "../../../../chains/types.js";
4
4
  import type { ThirdwebClient } from "../../../../client/client.js";
5
5
  import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
6
6
  import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
7
- import { linkProfile } from "../../../../wallets/in-app/core/wallet/profiles.js";
8
7
  import type { InAppWalletSocialAuth } from "../../../../wallets/in-app/core/wallet/types.js";
8
+ import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
9
9
  import { loginWithOauthRedirect } from "../../../../wallets/in-app/web/lib/auth/oauth.js";
10
10
  import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
11
11
  import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
@@ -92,7 +92,8 @@ export function SocialLogin(props: {
92
92
 
93
93
  setStatus("connecting");
94
94
  if (props.isLinking) {
95
- await linkProfile(wallet as Wallet<"inApp">, {
95
+ await linkProfile({
96
+ client: props.client,
96
97
  strategy: props.socialAuth,
97
98
  openedWindow: socialWindow,
98
99
  closeOpenedWindow: (openedWindow) => {
@@ -1,10 +1,10 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
2
  import { getLoginUrl } from "../../../../wallets/in-app/core/authentication/getLoginPath.js";
3
3
  import type {
4
+ Ecosystem,
4
5
  InAppWalletOAuth,
5
6
  InAppWalletSocialAuth,
6
7
  } from "../../../../wallets/in-app/core/wallet/types.js";
7
- import type { Ecosystem } from "../../../../wallets/in-app/web/types.js";
8
8
  import type { Theme } from "../../../core/design-system/index.js";
9
9
 
10
10
  function getBodyTitle(authOption: InAppWalletSocialAuth) {
@@ -1,6 +1,6 @@
1
1
  import { beforeEach, describe, expect, it, vi } from "vitest";
2
2
  import type { ThirdwebClient } from "../client/client.js";
3
- import type { Ecosystem } from "../wallets/in-app/web/types.js";
3
+ import type { Ecosystem } from "../wallets/in-app/core/wallet/types.js";
4
4
  import {
5
5
  IS_THIRDWEB_URL_CACHE,
6
6
  getClientFetch,
@@ -1,6 +1,6 @@
1
1
  import type { ThirdwebClient } from "../client/client.js";
2
2
  import { version } from "../version.js";
3
- import type { Ecosystem } from "../wallets/in-app/web/types.js";
3
+ import type { Ecosystem } from "../wallets/in-app/core/wallet/types.js";
4
4
  import { LruMap } from "./caching/lru.js";
5
5
  import {
6
6
  type OperatingSystem,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.58.5";
1
+ export const version = "5.59.0-nightly-e2b3484764275560aa899f3f894b767faedaa9a1-20240925000331";
@@ -1,7 +1,7 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
2
  import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
3
3
  import { type AuthOption, authOptions } from "../../../../wallets/types.js";
4
- import type { Ecosystem } from "../../web/types.js";
4
+ import type { Ecosystem } from "../wallet/types.js";
5
5
 
6
6
  const getLoginOptionRoute = (option: AuthOption | "wallet") => {
7
7
  if (!authOptions.includes(option as AuthOption) && option !== "wallet") {
@@ -2,7 +2,7 @@ import type { ThirdwebClient } from "../../../../client/client.js";
2
2
  import { getClientFetch } from "../../../../utils/fetch.js";
3
3
  import { randomBytesHex } from "../../../../utils/random.js";
4
4
  import type { AsyncStorage } from "../../../../utils/storage/AsyncStorage.js";
5
- import type { Ecosystem } from "../../web/types.js";
5
+ import type { Ecosystem } from "../wallet/types.js";
6
6
  import { ClientScopedStorage } from "./client-scoped-storage.js";
7
7
  import { getLoginCallbackUrl } from "./getLoginPath.js";
8
8
  import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
@@ -1,7 +1,8 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
2
  import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
3
3
  import { getClientFetch } from "../../../../utils/fetch.js";
4
- import type { Ecosystem } from "../../web/types.js";
4
+ import type { Ecosystem } from "../wallet/types.js";
5
+ import type { ClientScopedStorage } from "./client-scoped-storage.js";
5
6
  import type { Profile } from "./types.js";
6
7
 
7
8
  /**
@@ -15,16 +16,16 @@ export async function linkAccount({
15
16
  client,
16
17
  ecosystem,
17
18
  tokenToLink,
19
+ storage,
18
20
  }: {
19
21
  client: ThirdwebClient;
20
22
  ecosystem?: Ecosystem;
21
23
  tokenToLink: string;
24
+ storage: ClientScopedStorage;
22
25
  }): Promise<Profile[]> {
23
26
  const clientFetch = getClientFetch(client, ecosystem);
24
27
  const IN_APP_URL = getThirdwebBaseUrl("inAppWallet");
25
- const currentAccountToken = localStorage.getItem(
26
- `walletToken-${client.clientId}${ecosystem?.id ? `-${ecosystem.id}` : ""}`,
27
- );
28
+ const currentAccountToken = await storage.getAuthCookie();
28
29
 
29
30
  if (!currentAccountToken) {
30
31
  throw new Error("Failed to link account, no user logged in");
@@ -65,20 +66,23 @@ export async function linkAccount({
65
66
  export async function getLinkedProfilesInternal({
66
67
  client,
67
68
  ecosystem,
68
- }: { client: ThirdwebClient; ecosystem?: Ecosystem }): Promise<Profile[]> {
69
+ storage,
70
+ }: {
71
+ client: ThirdwebClient;
72
+ ecosystem?: Ecosystem;
73
+ storage: ClientScopedStorage;
74
+ }): Promise<Profile[]> {
69
75
  const clientFetch = getClientFetch(client, ecosystem);
70
76
  const IN_APP_URL = getThirdwebBaseUrl("inAppWallet");
71
- const currentAccountToken = localStorage.getItem(
72
- `walletToken-${client.clientId}${ecosystem?.id ? `-${ecosystem.id}` : ""}`,
73
- );
77
+ const currentAccountToken = await storage.getAuthCookie();
78
+ if (!currentAccountToken) {
79
+ throw new Error("Failed to get linked accounts, no user logged in");
80
+ }
74
81
 
75
82
  const headers: Record<string, string> = {
76
83
  Authorization: `Bearer iaw-auth-token:${currentAccountToken}`,
77
84
  "Content-Type": "application/json",
78
85
  };
79
- if (!currentAccountToken) {
80
- throw new Error("Failed to get linked accounts, no user logged in");
81
- }
82
86
 
83
87
  const linkedAccountsResp = await clientFetch(
84
88
  `${IN_APP_URL}/api/2024-05-05/accounts`,
@@ -2,7 +2,7 @@ import type { ThirdwebClient } from "../../../../client/client.js";
2
2
  import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
3
3
  import { getClientFetch } from "../../../../utils/fetch.js";
4
4
  import type { AsyncStorage } from "../../../../utils/storage/AsyncStorage.js";
5
- import type { Ecosystem } from "../../web/types.js";
5
+ import type { Ecosystem } from "../wallet/types.js";
6
6
  import { ClientScopedStorage } from "./client-scoped-storage.js";
7
7
  import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
8
8
 
@@ -4,7 +4,7 @@ import type { Chain } from "../../../../chains/types.js";
4
4
  import type { ThirdwebClient } from "../../../../client/client.js";
5
5
  import { getClientFetch } from "../../../../utils/fetch.js";
6
6
  import type { Wallet } from "../../../interfaces/wallet.js";
7
- import type { Ecosystem } from "../../web/types.js";
7
+ import type { Ecosystem } from "../wallet/types.js";
8
8
  import { getLoginCallbackUrl, getLoginUrl } from "./getLoginPath.js";
9
9
  import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
10
10
 
@@ -4,7 +4,7 @@ import type { Address } from "../../../../utils/address.js";
4
4
  import type { Account } from "../../../interfaces/wallet.js";
5
5
  import type { Wallet } from "../../../interfaces/wallet.js";
6
6
  import type { AuthOption, OAuthOption } from "../../../types.js";
7
- import type { Ecosystem } from "../../web/types.js";
7
+ import type { Ecosystem } from "../wallet/types.js";
8
8
 
9
9
  export type MultiStepAuthProviderType =
10
10
  | {
@@ -24,14 +24,16 @@ export type MultiStepAuthArgsType = MultiStepAuthProviderType & {
24
24
  verificationCode: string;
25
25
  };
26
26
 
27
+ export type SocialAuthArgsType = {
28
+ strategy: OAuthOption;
29
+ openedWindow?: Window;
30
+ closeOpenedWindow?: (window: Window) => void;
31
+ redirectUrl?: string;
32
+ mode?: "redirect" | "popup" | "window";
33
+ };
34
+
27
35
  export type SingleStepAuthArgsType =
28
- | {
29
- strategy: OAuthOption;
30
- openedWindow?: Window;
31
- closeOpenedWindow?: (window: Window) => void;
32
- redirectUrl?: string;
33
- mode?: "redirect" | "popup" | "window";
34
- }
36
+ | SocialAuthArgsType
35
37
  | { strategy: "jwt"; jwt: string; encryptionKey: string }
36
38
  | { strategy: "auth_endpoint"; payload: string; encryptionKey: string }
37
39
  | { strategy: "iframe_email_verification"; email: string }
@@ -1,12 +1,14 @@
1
1
  import type { SocialAuthOption } from "../../../../wallets/types.js";
2
2
  import type { Account } from "../../../interfaces/wallet.js";
3
3
  import type {
4
+ AuthArgsType,
4
5
  AuthLoginReturnType,
5
6
  AuthStoredTokenWithCookieReturnType,
6
7
  GetUser,
7
8
  LogoutReturnType,
8
9
  MultiStepAuthArgsType,
9
10
  PreAuthArgsType,
11
+ Profile,
10
12
  SingleStepAuthArgsType,
11
13
  } from "../authentication/types.js";
12
14
 
@@ -33,4 +35,6 @@ export interface InAppConnector {
33
35
  args: MultiStepAuthArgsType | SingleStepAuthArgsType,
34
36
  ): Promise<AuthLoginReturnType>;
35
37
  logout(): Promise<LogoutReturnType>;
38
+ linkProfile(args: AuthArgsType): Promise<Profile[]>;
39
+ getProfiles(): Promise<Profile[]>;
36
40
  }
@@ -8,18 +8,9 @@ import type {
8
8
  CreateWalletArgs,
9
9
  EcosystemWalletId,
10
10
  } from "../../../wallet-types.js";
11
- import type { Ecosystem } from "../../web/types.js";
12
- import {
13
- getLinkedProfilesInternal,
14
- linkAccount as linkProfileWithToken,
15
- } from "../authentication/linkAccount.js";
16
- import type {
17
- MultiStepAuthArgsType,
18
- Profile,
19
- SingleStepAuthArgsType,
20
- } from "../authentication/types.js";
21
11
  import type { InAppConnector } from "../interfaces/connector.js";
22
12
  import { getOrCreateInAppWalletConnector } from "./in-app-core.js";
13
+ import type { Ecosystem } from "./types.js";
23
14
 
24
15
  /**
25
16
  * @internal
@@ -52,13 +43,6 @@ export function createEcosystemWallet(args: {
52
43
  return chain;
53
44
  },
54
45
  getConfig: () => createOptions,
55
- getProfiles: async () => {
56
- if (!client) {
57
- return [];
58
- }
59
-
60
- return getLinkedProfilesInternal({ client, ecosystem });
61
- },
62
46
  getAccount: () => account,
63
47
  autoConnect: async (options) => {
64
48
  const { autoConnectInAppWallet } = await import("./index.js");
@@ -133,28 +117,5 @@ export function createEcosystemWallet(args: {
133
117
  chain = newChain;
134
118
  emitter.emit("chainChanged", newChain);
135
119
  },
136
- // This is not included on the global interface but is force-resolved in linkProfile
137
- linkProfile: async (
138
- options: SingleStepAuthArgsType | MultiStepAuthArgsType,
139
- ): Promise<Profile[]> => {
140
- if (!client) {
141
- throw new Error(
142
- "No client found, please connect the wallet before linking a profile",
143
- );
144
- }
145
-
146
- const connector = await getOrCreateInAppWalletConnector(
147
- client,
148
- connectorFactory,
149
- ecosystem,
150
- );
151
-
152
- const { storedToken } = await connector.authenticate(options);
153
- return await linkProfileWithToken({
154
- client,
155
- ecosystem,
156
- tokenToLink: storedToken.cookieString,
157
- });
158
- },
159
120
  } as Wallet<EcosystemWalletId>;
160
121
  }
@@ -5,17 +5,8 @@ import type { ThirdwebClient } from "../../../../client/client.js";
5
5
  import type { Account, Wallet } from "../../../interfaces/wallet.js";
6
6
  import { createWalletEmitter } from "../../../wallet-emitter.js";
7
7
  import type { CreateWalletArgs } from "../../../wallet-types.js";
8
- import type { Ecosystem } from "../../web/types.js";
9
- import {
10
- getLinkedProfilesInternal,
11
- linkAccount as linkProfileWithToken,
12
- } from "../authentication/linkAccount.js";
13
- import type {
14
- MultiStepAuthArgsType,
15
- Profile,
16
- SingleStepAuthArgsType,
17
- } from "../authentication/types.js";
18
8
  import type { InAppConnector } from "../interfaces/connector.js";
9
+ import type { Ecosystem } from "./types.js";
19
10
 
20
11
  const connectorCache = new Map<string, InAppConnector>();
21
12
 
@@ -62,33 +53,6 @@ export function createInAppWallet(args: {
62
53
  },
63
54
  getConfig: () => createOptions,
64
55
  getAccount: () => account,
65
- /**
66
- * @description
67
- * Gets the linked profiles for the current wallet.
68
- * This method is only available for in-app or ecosystem wallets.
69
- *
70
- * @returns An array of accounts user profiles linked to the current wallet.
71
- *
72
- * @example
73
- * ```ts
74
- * import { inAppWallet } from "thirdweb/wallets";
75
- *
76
- * const wallet = inAppWallet();
77
- * wallet.connect({ strategy: "google" });
78
- *
79
- * const profiles = wallet.getProfiles();
80
- *
81
- * console.log(profiles[0].type);
82
- * console.log(profiles[0].details.email);
83
- * ```
84
- */
85
- getProfiles: async () => {
86
- if (!client) {
87
- return [];
88
- }
89
-
90
- return getLinkedProfilesInternal({ client });
91
- },
92
56
  autoConnect: async (options) => {
93
57
  const { autoConnectInAppWallet } = await import("./index.js");
94
58
 
@@ -178,26 +142,5 @@ export function createInAppWallet(args: {
178
142
  }
179
143
  emitter.emit("chainChanged", newChain);
180
144
  },
181
- // This is not included on the global interface but is force-resolved in linkProfile
182
- linkProfile: async (
183
- options: SingleStepAuthArgsType | MultiStepAuthArgsType,
184
- ): Promise<Profile[]> => {
185
- if (!client) {
186
- throw new Error(
187
- "No client found, please connect the wallet before linking a profile",
188
- );
189
- }
190
-
191
- const connector = await getOrCreateInAppWalletConnector(
192
- client,
193
- connectorFactory,
194
- );
195
-
196
- const { storedToken } = await connector.authenticate(options);
197
- return await linkProfileWithToken({
198
- client,
199
- tokenToLink: storedToken.cookieString,
200
- });
201
- },
202
145
  } as Wallet<"inApp">;
203
146
  }
@@ -6,12 +6,18 @@ import type {
6
6
  OAuthOption,
7
7
  SocialAuthOption,
8
8
  } from "../../../types.js";
9
+ import type { EcosystemWalletId } from "../../../wallet-types.js";
9
10
  import type {
10
11
  AuthStoredTokenWithCookieReturnType,
11
12
  MultiStepAuthArgsType,
12
13
  SingleStepAuthArgsType,
13
14
  } from "../authentication/types.js";
14
15
 
16
+ export type Ecosystem = {
17
+ id: EcosystemWalletId;
18
+ partnerId?: string;
19
+ };
20
+
15
21
  export type InAppWalletConnectionOptions = (
16
22
  | MultiStepAuthArgsType
17
23
  | SingleStepAuthArgsType