thirdweb 5.44.1 → 5.45.0-nightly-bbb4f1c53f982b1f9de00fb30efbf2c77f155e96-20240809000532

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 (588) hide show
  1. package/dist/cjs/adapters/ethers5.js +3 -2
  2. package/dist/cjs/adapters/ethers5.js.map +1 -1
  3. package/dist/cjs/adapters/wallet-adapter.js +3 -0
  4. package/dist/cjs/adapters/wallet-adapter.js.map +1 -1
  5. package/dist/cjs/auth/constants.js +1 -2
  6. package/dist/cjs/auth/constants.js.map +1 -1
  7. package/dist/cjs/auth/verify-hash.js +1 -1
  8. package/dist/cjs/auth/verify-hash.js.map +1 -1
  9. package/dist/cjs/chains/chain-definitions/abstract-testnet.js +20 -0
  10. package/dist/cjs/chains/chain-definitions/abstract-testnet.js.map +1 -0
  11. package/dist/cjs/chains/chain-definitions/fraxtal-testnet.js +20 -0
  12. package/dist/cjs/chains/chain-definitions/fraxtal-testnet.js.map +1 -0
  13. package/dist/cjs/chains/chain-definitions/mode-testnet.js +20 -0
  14. package/dist/cjs/chains/chain-definitions/mode-testnet.js.map +1 -0
  15. package/dist/cjs/chains/utils.js +7 -0
  16. package/dist/cjs/chains/utils.js.map +1 -1
  17. package/dist/cjs/exports/chains.js +3 -1
  18. package/dist/cjs/exports/chains.js.map +1 -1
  19. package/dist/cjs/exports/react.js +4 -2
  20. package/dist/cjs/exports/react.js.map +1 -1
  21. package/dist/cjs/exports/wallets/in-app.js +2 -2
  22. package/dist/cjs/exports/wallets/in-app.js.map +1 -1
  23. package/dist/cjs/exports/wallets.js +4 -1
  24. package/dist/cjs/exports/wallets.js.map +1 -1
  25. package/dist/cjs/react/core/hooks/others/useProfiles.js +36 -0
  26. package/dist/cjs/react/core/hooks/others/useProfiles.js.map +1 -0
  27. package/dist/cjs/react/core/utils/{socialIcons.js → walletIcon.js} +26 -1
  28. package/dist/cjs/react/core/utils/walletIcon.js.map +1 -0
  29. package/dist/cjs/react/native/ui/components/TokenIcon.js +2 -2
  30. package/dist/cjs/react/native/ui/components/TokenIcon.js.map +1 -1
  31. package/dist/cjs/react/native/ui/connect/ConnectButton.js +13 -8
  32. package/dist/cjs/react/native/ui/connect/ConnectButton.js.map +1 -1
  33. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +13 -8
  34. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  35. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +22 -5
  36. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  37. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +2 -2
  38. package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
  39. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +13 -8
  40. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  41. package/dist/cjs/react/web/ui/ConnectWallet/Modal/screen.js +1 -1
  42. package/dist/cjs/react/web/ui/ConnectWallet/Modal/screen.js.map +1 -1
  43. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
  44. package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  45. package/dist/cjs/react/web/ui/ConnectWallet/icons/AddUserIcon.js +12 -0
  46. package/dist/cjs/react/web/ui/ConnectWallet/icons/AddUserIcon.js.map +1 -0
  47. package/dist/cjs/react/web/ui/ConnectWallet/icons/MultiUserIcon.js +12 -0
  48. package/dist/cjs/react/web/ui/ConnectWallet/icons/MultiUserIcon.js.map +1 -0
  49. package/dist/cjs/react/web/ui/ConnectWallet/locale/de.js +6 -0
  50. package/dist/cjs/react/web/ui/ConnectWallet/locale/de.js.map +1 -1
  51. package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js +6 -0
  52. package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
  53. package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js +6 -0
  54. package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
  55. package/dist/cjs/react/web/ui/ConnectWallet/locale/fr.js +6 -0
  56. package/dist/cjs/react/web/ui/ConnectWallet/locale/fr.js.map +1 -1
  57. package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js +6 -0
  58. package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
  59. package/dist/cjs/react/web/ui/ConnectWallet/locale/kr.js +6 -0
  60. package/dist/cjs/react/web/ui/ConnectWallet/locale/kr.js.map +1 -1
  61. package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js +6 -0
  62. package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
  63. package/dist/cjs/react/web/ui/ConnectWallet/locale/vi.js +6 -0
  64. package/dist/cjs/react/web/ui/ConnectWallet/locale/vi.js.map +1 -1
  65. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +3 -1
  66. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  67. package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +42 -0
  68. package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -0
  69. package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +58 -0
  70. package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -0
  71. package/dist/cjs/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js +8 -5
  72. package/dist/cjs/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js.map +1 -1
  73. package/dist/cjs/react/web/ui/PayEmbed.js +13 -8
  74. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  75. package/dist/cjs/react/web/ui/components/Spinner.js +1 -1
  76. package/dist/cjs/react/web/ui/components/Spinner.js.map +1 -1
  77. package/dist/cjs/react/web/ui/components/TokenIcon.js +2 -2
  78. package/dist/cjs/react/web/ui/components/TokenIcon.js.map +1 -1
  79. package/dist/cjs/react/web/ui/components/WalletImage.js +6 -32
  80. package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
  81. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +8 -4
  82. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
  83. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletFormUI.js +1 -1
  84. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletFormUI.js.map +1 -1
  85. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +8 -4
  86. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  87. package/dist/cjs/react/web/wallets/in-app/InAppWalletFormUI.js +5 -5
  88. package/dist/cjs/react/web/wallets/in-app/InAppWalletFormUI.js.map +1 -1
  89. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +22 -16
  90. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  91. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +36 -49
  92. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  93. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +47 -20
  94. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  95. package/dist/cjs/react/web/wallets/shared/SocialLogin.js +33 -13
  96. package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
  97. package/dist/cjs/react/web/wallets/shared/locale/en.js +1 -1
  98. package/dist/cjs/react/web/wallets/shared/oauthSignIn.js +1 -1
  99. package/dist/cjs/react/web/wallets/shared/oauthSignIn.js.map +1 -1
  100. package/dist/cjs/reactive/store.js +3 -0
  101. package/dist/cjs/reactive/store.js.map +1 -1
  102. package/dist/cjs/transaction/serialize-transaction.js +20 -142
  103. package/dist/cjs/transaction/serialize-transaction.js.map +1 -1
  104. package/dist/cjs/version.js +1 -1
  105. package/dist/cjs/version.js.map +1 -1
  106. package/dist/cjs/wallets/coinbase/coinbase-wallet.js +8 -1
  107. package/dist/cjs/wallets/coinbase/coinbase-wallet.js.map +1 -1
  108. package/dist/cjs/wallets/create-wallet.js +8 -1
  109. package/dist/cjs/wallets/create-wallet.js.map +1 -1
  110. package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js +14 -3
  111. package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
  112. package/dist/cjs/wallets/in-app/core/authentication/linkAccount.js +67 -0
  113. package/dist/cjs/wallets/in-app/core/authentication/linkAccount.js.map +1 -0
  114. package/dist/cjs/wallets/in-app/core/authentication/siwe.js +47 -0
  115. package/dist/cjs/wallets/in-app/core/authentication/siwe.js.map +1 -0
  116. package/dist/cjs/wallets/in-app/core/authentication/{type.js → types.js} +1 -1
  117. package/dist/cjs/wallets/in-app/core/authentication/types.js.map +1 -0
  118. package/dist/cjs/wallets/in-app/core/wallet/ecosystem-core.js +8 -1
  119. package/dist/cjs/wallets/in-app/core/wallet/ecosystem-core.js.map +1 -1
  120. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +47 -1
  121. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
  122. package/dist/cjs/wallets/in-app/core/wallet/index.js +3 -3
  123. package/dist/cjs/wallets/in-app/core/wallet/index.js.map +1 -1
  124. package/dist/cjs/wallets/in-app/core/wallet/profiles.js +60 -0
  125. package/dist/cjs/wallets/in-app/core/wallet/profiles.js.map +1 -0
  126. package/dist/cjs/wallets/in-app/native/auth/index.js +3 -3
  127. package/dist/cjs/wallets/in-app/native/auth/index.js.map +1 -1
  128. package/dist/cjs/wallets/in-app/native/auth/native-auth.js +47 -112
  129. package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -1
  130. package/dist/cjs/wallets/in-app/native/helpers/auth/middleware.js +5 -5
  131. package/dist/cjs/wallets/in-app/native/helpers/auth/middleware.js.map +1 -1
  132. package/dist/cjs/wallets/in-app/native/native-connector.js +76 -36
  133. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  134. package/dist/cjs/wallets/in-app/web/lib/auth/abstract-login.js +0 -2
  135. package/dist/cjs/wallets/in-app/web/lib/auth/abstract-login.js.map +1 -1
  136. package/dist/cjs/wallets/in-app/web/lib/auth/base-login.js +49 -148
  137. package/dist/cjs/wallets/in-app/web/lib/auth/base-login.js.map +1 -1
  138. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js +26 -12
  139. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
  140. package/dist/cjs/wallets/in-app/web/lib/auth/index.js +3 -3
  141. package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
  142. package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js +2 -2
  143. package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js.map +1 -1
  144. package/dist/cjs/wallets/in-app/web/lib/auth/otp.js +89 -0
  145. package/dist/cjs/wallets/in-app/web/lib/auth/otp.js.map +1 -0
  146. package/dist/cjs/wallets/in-app/web/lib/in-app-account.js +7 -7
  147. package/dist/cjs/wallets/in-app/web/lib/in-app-account.js.map +1 -1
  148. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +89 -30
  149. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  150. package/dist/cjs/wallets/manager/index.js +41 -5
  151. package/dist/cjs/wallets/manager/index.js.map +1 -1
  152. package/dist/cjs/wallets/native/create-wallet.js +8 -1
  153. package/dist/cjs/wallets/native/create-wallet.js.map +1 -1
  154. package/dist/cjs/wallets/smart/lib/utils.js +4 -1
  155. package/dist/cjs/wallets/smart/lib/utils.js.map +1 -1
  156. package/dist/cjs/wallets/smart/smart-wallet.js +8 -1
  157. package/dist/cjs/wallets/smart/smart-wallet.js.map +1 -1
  158. package/dist/esm/adapters/ethers5.js +3 -2
  159. package/dist/esm/adapters/ethers5.js.map +1 -1
  160. package/dist/esm/adapters/wallet-adapter.js +3 -0
  161. package/dist/esm/adapters/wallet-adapter.js.map +1 -1
  162. package/dist/esm/auth/constants.js +0 -1
  163. package/dist/esm/auth/constants.js.map +1 -1
  164. package/dist/esm/auth/verify-hash.js +2 -2
  165. package/dist/esm/auth/verify-hash.js.map +1 -1
  166. package/dist/esm/chains/chain-definitions/abstract-testnet.js +17 -0
  167. package/dist/esm/chains/chain-definitions/abstract-testnet.js.map +1 -0
  168. package/dist/esm/chains/chain-definitions/fraxtal-testnet.js +17 -0
  169. package/dist/esm/chains/chain-definitions/fraxtal-testnet.js.map +1 -0
  170. package/dist/esm/chains/chain-definitions/mode-testnet.js +17 -0
  171. package/dist/esm/chains/chain-definitions/mode-testnet.js.map +1 -0
  172. package/dist/esm/chains/utils.js +6 -0
  173. package/dist/esm/chains/utils.js.map +1 -1
  174. package/dist/esm/exports/chains.js +1 -0
  175. package/dist/esm/exports/chains.js.map +1 -1
  176. package/dist/esm/exports/react.js +1 -0
  177. package/dist/esm/exports/react.js.map +1 -1
  178. package/dist/esm/exports/wallets/embedded.js +1 -1
  179. package/dist/esm/exports/wallets/embedded.js.map +1 -1
  180. package/dist/esm/exports/wallets/in-app.js +2 -2
  181. package/dist/esm/exports/wallets/in-app.js.map +1 -1
  182. package/dist/esm/exports/wallets/in-app.native.js +1 -1
  183. package/dist/esm/exports/wallets/in-app.native.js.map +1 -1
  184. package/dist/esm/exports/wallets.js +1 -0
  185. package/dist/esm/exports/wallets.js.map +1 -1
  186. package/dist/esm/react/core/hooks/others/useProfiles.js +33 -0
  187. package/dist/esm/react/core/hooks/others/useProfiles.js.map +1 -0
  188. package/dist/esm/react/core/utils/{socialIcons.js → walletIcon.js} +25 -1
  189. package/dist/esm/react/core/utils/walletIcon.js.map +1 -0
  190. package/dist/esm/react/native/ui/components/TokenIcon.js +1 -1
  191. package/dist/esm/react/native/ui/components/TokenIcon.js.map +1 -1
  192. package/dist/esm/react/native/ui/connect/ConnectButton.js +14 -9
  193. package/dist/esm/react/native/ui/connect/ConnectButton.js.map +1 -1
  194. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +13 -8
  195. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  196. package/dist/esm/react/web/ui/ConnectWallet/Details.js +22 -5
  197. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  198. package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +1 -1
  199. package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
  200. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +13 -8
  201. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  202. package/dist/esm/react/web/ui/ConnectWallet/Modal/screen.js +1 -1
  203. package/dist/esm/react/web/ui/ConnectWallet/Modal/screen.js.map +1 -1
  204. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +1 -1
  205. package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
  206. package/dist/esm/react/web/ui/ConnectWallet/icons/AddUserIcon.js +8 -0
  207. package/dist/esm/react/web/ui/ConnectWallet/icons/AddUserIcon.js.map +1 -0
  208. package/dist/esm/react/web/ui/ConnectWallet/icons/MultiUserIcon.js +8 -0
  209. package/dist/esm/react/web/ui/ConnectWallet/icons/MultiUserIcon.js.map +1 -0
  210. package/dist/esm/react/web/ui/ConnectWallet/locale/de.js +6 -0
  211. package/dist/esm/react/web/ui/ConnectWallet/locale/de.js.map +1 -1
  212. package/dist/esm/react/web/ui/ConnectWallet/locale/en.js +6 -0
  213. package/dist/esm/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
  214. package/dist/esm/react/web/ui/ConnectWallet/locale/es.js +6 -0
  215. package/dist/esm/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
  216. package/dist/esm/react/web/ui/ConnectWallet/locale/fr.js +6 -0
  217. package/dist/esm/react/web/ui/ConnectWallet/locale/fr.js.map +1 -1
  218. package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js +6 -0
  219. package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
  220. package/dist/esm/react/web/ui/ConnectWallet/locale/kr.js +6 -0
  221. package/dist/esm/react/web/ui/ConnectWallet/locale/kr.js.map +1 -1
  222. package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js +6 -0
  223. package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
  224. package/dist/esm/react/web/ui/ConnectWallet/locale/vi.js +6 -0
  225. package/dist/esm/react/web/ui/ConnectWallet/locale/vi.js.map +1 -1
  226. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +3 -1
  227. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  228. package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +39 -0
  229. package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -0
  230. package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +55 -0
  231. package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -0
  232. package/dist/esm/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js +8 -5
  233. package/dist/esm/react/web/ui/ConnectWallet/screens/ManageWalletScreen.js.map +1 -1
  234. package/dist/esm/react/web/ui/PayEmbed.js +14 -9
  235. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  236. package/dist/esm/react/web/ui/components/Spinner.js +1 -1
  237. package/dist/esm/react/web/ui/components/Spinner.js.map +1 -1
  238. package/dist/esm/react/web/ui/components/TokenIcon.js +1 -1
  239. package/dist/esm/react/web/ui/components/TokenIcon.js.map +1 -1
  240. package/dist/esm/react/web/ui/components/WalletImage.js +4 -30
  241. package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
  242. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +8 -4
  243. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
  244. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletFormUI.js +2 -2
  245. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletFormUI.js.map +1 -1
  246. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +8 -4
  247. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  248. package/dist/esm/react/web/wallets/in-app/InAppWalletFormUI.js +5 -5
  249. package/dist/esm/react/web/wallets/in-app/InAppWalletFormUI.js.map +1 -1
  250. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +18 -12
  251. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  252. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +36 -49
  253. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  254. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +47 -20
  255. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  256. package/dist/esm/react/web/wallets/shared/SocialLogin.js +33 -13
  257. package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
  258. package/dist/esm/react/web/wallets/shared/locale/en.js +1 -1
  259. package/dist/esm/react/web/wallets/shared/oauthSignIn.js +2 -2
  260. package/dist/esm/react/web/wallets/shared/oauthSignIn.js.map +1 -1
  261. package/dist/esm/reactive/store.js +3 -0
  262. package/dist/esm/reactive/store.js.map +1 -1
  263. package/dist/esm/transaction/serialize-transaction.js +21 -142
  264. package/dist/esm/transaction/serialize-transaction.js.map +1 -1
  265. package/dist/esm/version.js +1 -1
  266. package/dist/esm/version.js.map +1 -1
  267. package/dist/esm/wallets/coinbase/coinbase-wallet.js +8 -1
  268. package/dist/esm/wallets/coinbase/coinbase-wallet.js.map +1 -1
  269. package/dist/esm/wallets/create-wallet.js +8 -1
  270. package/dist/esm/wallets/create-wallet.js.map +1 -1
  271. package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js +11 -1
  272. package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
  273. package/dist/esm/wallets/in-app/core/authentication/linkAccount.js +63 -0
  274. package/dist/esm/wallets/in-app/core/authentication/linkAccount.js.map +1 -0
  275. package/dist/esm/wallets/in-app/core/authentication/siwe.js +44 -0
  276. package/dist/esm/wallets/in-app/core/authentication/siwe.js.map +1 -0
  277. package/dist/esm/wallets/in-app/core/authentication/{type.js → types.js} +1 -1
  278. package/dist/esm/wallets/in-app/core/authentication/types.js.map +1 -0
  279. package/dist/esm/wallets/in-app/core/wallet/ecosystem-core.js +8 -1
  280. package/dist/esm/wallets/in-app/core/wallet/ecosystem-core.js.map +1 -1
  281. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +47 -1
  282. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
  283. package/dist/esm/wallets/in-app/core/wallet/index.js +2 -2
  284. package/dist/esm/wallets/in-app/core/wallet/index.js.map +1 -1
  285. package/dist/esm/wallets/in-app/core/wallet/profiles.js +56 -0
  286. package/dist/esm/wallets/in-app/core/wallet/profiles.js.map +1 -0
  287. package/dist/esm/wallets/in-app/native/auth/index.js +2 -2
  288. package/dist/esm/wallets/in-app/native/auth/index.js.map +1 -1
  289. package/dist/esm/wallets/in-app/native/auth/native-auth.js +47 -112
  290. package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -1
  291. package/dist/esm/wallets/in-app/native/helpers/auth/middleware.js +1 -1
  292. package/dist/esm/wallets/in-app/native/helpers/auth/middleware.js.map +1 -1
  293. package/dist/esm/wallets/in-app/native/native-connector.js +67 -27
  294. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  295. package/dist/esm/wallets/in-app/web/lib/auth/abstract-login.js +0 -2
  296. package/dist/esm/wallets/in-app/web/lib/auth/abstract-login.js.map +1 -1
  297. package/dist/esm/wallets/in-app/web/lib/auth/base-login.js +49 -148
  298. package/dist/esm/wallets/in-app/web/lib/auth/base-login.js.map +1 -1
  299. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js +26 -12
  300. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
  301. package/dist/esm/wallets/in-app/web/lib/auth/index.js +2 -2
  302. package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
  303. package/dist/esm/wallets/in-app/web/lib/auth/oauth.js +3 -3
  304. package/dist/esm/wallets/in-app/web/lib/auth/oauth.js.map +1 -1
  305. package/dist/esm/wallets/in-app/web/lib/auth/otp.js +84 -0
  306. package/dist/esm/wallets/in-app/web/lib/auth/otp.js.map +1 -0
  307. package/dist/esm/wallets/in-app/web/lib/in-app-account.js +1 -1
  308. package/dist/esm/wallets/in-app/web/lib/in-app-account.js.map +1 -1
  309. package/dist/esm/wallets/in-app/web/lib/web-connector.js +88 -29
  310. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  311. package/dist/esm/wallets/manager/index.js +41 -5
  312. package/dist/esm/wallets/manager/index.js.map +1 -1
  313. package/dist/esm/wallets/native/create-wallet.js +8 -1
  314. package/dist/esm/wallets/native/create-wallet.js.map +1 -1
  315. package/dist/esm/wallets/smart/lib/utils.js +4 -1
  316. package/dist/esm/wallets/smart/lib/utils.js.map +1 -1
  317. package/dist/esm/wallets/smart/smart-wallet.js +8 -1
  318. package/dist/esm/wallets/smart/smart-wallet.js.map +1 -1
  319. package/dist/types/adapters/ethers5.d.ts +1 -1
  320. package/dist/types/adapters/ethers5.d.ts.map +1 -1
  321. package/dist/types/adapters/wallet-adapter.d.ts.map +1 -1
  322. package/dist/types/auth/constants.d.ts +0 -1
  323. package/dist/types/auth/constants.d.ts.map +1 -1
  324. package/dist/types/auth/verify-hash.d.ts.map +1 -1
  325. package/dist/types/chains/chain-definitions/abstract-testnet.d.ts +7 -0
  326. package/dist/types/chains/chain-definitions/abstract-testnet.d.ts.map +1 -0
  327. package/dist/types/chains/chain-definitions/fraxtal-testnet.d.ts +7 -0
  328. package/dist/types/chains/chain-definitions/fraxtal-testnet.d.ts.map +1 -0
  329. package/dist/types/chains/chain-definitions/mode-testnet.d.ts +7 -0
  330. package/dist/types/chains/chain-definitions/mode-testnet.d.ts.map +1 -0
  331. package/dist/types/chains/utils.d.ts +6 -0
  332. package/dist/types/chains/utils.d.ts.map +1 -1
  333. package/dist/types/exports/chains.d.ts +1 -0
  334. package/dist/types/exports/chains.d.ts.map +1 -1
  335. package/dist/types/exports/react.d.ts +1 -0
  336. package/dist/types/exports/react.d.ts.map +1 -1
  337. package/dist/types/exports/wallets/embedded.d.ts +1 -1
  338. package/dist/types/exports/wallets/embedded.d.ts.map +1 -1
  339. package/dist/types/exports/wallets/in-app.d.ts +2 -2
  340. package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
  341. package/dist/types/exports/wallets/in-app.native.d.ts +1 -1
  342. package/dist/types/exports/wallets/in-app.native.d.ts.map +1 -1
  343. package/dist/types/exports/wallets.d.ts +1 -0
  344. package/dist/types/exports/wallets.d.ts.map +1 -1
  345. package/dist/types/react/core/hooks/others/useProfiles.d.ts +23 -0
  346. package/dist/types/react/core/hooks/others/useProfiles.d.ts.map +1 -0
  347. package/dist/types/react/core/providers/connection-manager.d.ts +3 -0
  348. package/dist/types/react/core/providers/connection-manager.d.ts.map +1 -1
  349. package/dist/types/react/core/utils/storage.d.ts +2 -2
  350. package/dist/types/react/core/utils/storage.d.ts.map +1 -1
  351. package/dist/types/react/core/utils/{socialIcons.d.ts → walletIcon.d.ts} +2 -1
  352. package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -0
  353. package/dist/types/react/native/ui/connect/ConnectButton.d.ts.map +1 -1
  354. package/dist/types/react/native/ui/connect/ConnectModal.d.ts +1 -1
  355. package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
  356. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts +1 -1
  357. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
  358. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
  359. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  360. package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts.map +1 -1
  361. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
  362. package/dist/types/react/web/ui/ConnectWallet/icons/AddUserIcon.d.ts +6 -0
  363. package/dist/types/react/web/ui/ConnectWallet/icons/AddUserIcon.d.ts.map +1 -0
  364. package/dist/types/react/web/ui/ConnectWallet/icons/MultiUserIcon.d.ts +6 -0
  365. package/dist/types/react/web/ui/ConnectWallet/icons/MultiUserIcon.d.ts.map +1 -0
  366. package/dist/types/react/web/ui/ConnectWallet/locale/de.d.ts.map +1 -1
  367. package/dist/types/react/web/ui/ConnectWallet/locale/en.d.ts.map +1 -1
  368. package/dist/types/react/web/ui/ConnectWallet/locale/es.d.ts.map +1 -1
  369. package/dist/types/react/web/ui/ConnectWallet/locale/fr.d.ts.map +1 -1
  370. package/dist/types/react/web/ui/ConnectWallet/locale/ja.d.ts.map +1 -1
  371. package/dist/types/react/web/ui/ConnectWallet/locale/kr.d.ts.map +1 -1
  372. package/dist/types/react/web/ui/ConnectWallet/locale/tl.d.ts.map +1 -1
  373. package/dist/types/react/web/ui/ConnectWallet/locale/types.d.ts +6 -0
  374. package/dist/types/react/web/ui/ConnectWallet/locale/types.d.ts.map +1 -1
  375. package/dist/types/react/web/ui/ConnectWallet/locale/vi.d.ts.map +1 -1
  376. package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts +11 -0
  377. package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts.map +1 -0
  378. package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts +13 -0
  379. package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts.map +1 -0
  380. package/dist/types/react/web/ui/ConnectWallet/screens/ManageWalletScreen.d.ts.map +1 -1
  381. package/dist/types/react/web/ui/ConnectWallet/screens/types.d.ts +1 -1
  382. package/dist/types/react/web/ui/ConnectWallet/screens/types.d.ts.map +1 -1
  383. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  384. package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
  385. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts +1 -0
  386. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
  387. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts +1 -0
  388. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts.map +1 -1
  389. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +2 -1
  390. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
  391. package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts +2 -1
  392. package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts.map +1 -1
  393. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +3 -1
  394. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  395. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts +1 -0
  396. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
  397. package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts +4 -1
  398. package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
  399. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts +3 -0
  400. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
  401. package/dist/types/reactive/store.d.ts.map +1 -1
  402. package/dist/types/transaction/serialize-transaction.d.ts +8 -8
  403. package/dist/types/transaction/serialize-transaction.d.ts.map +1 -1
  404. package/dist/types/utils/any-evm/keyless-transaction.d.ts +1 -1
  405. package/dist/types/version.d.ts +1 -1
  406. package/dist/types/version.d.ts.map +1 -1
  407. package/dist/types/wallets/coinbase/coinbase-wallet.d.ts.map +1 -1
  408. package/dist/types/wallets/create-wallet.d.ts.map +1 -1
  409. package/dist/types/wallets/ecosystem/types.d.ts +2 -8
  410. package/dist/types/wallets/ecosystem/types.d.ts.map +1 -1
  411. package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +8 -3
  412. package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts.map +1 -1
  413. package/dist/types/wallets/in-app/core/authentication/linkAccount.d.ts +24 -0
  414. package/dist/types/wallets/in-app/core/authentication/linkAccount.d.ts.map +1 -0
  415. package/dist/types/wallets/in-app/core/authentication/siwe.d.ts +14 -0
  416. package/dist/types/wallets/in-app/core/authentication/siwe.d.ts.map +1 -0
  417. package/dist/types/wallets/in-app/core/authentication/{type.d.ts → types.d.ts} +17 -2
  418. package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -0
  419. package/dist/types/wallets/in-app/core/interfaces/connector.d.ts +4 -3
  420. package/dist/types/wallets/in-app/core/interfaces/connector.d.ts.map +1 -1
  421. package/dist/types/wallets/in-app/core/wallet/ecosystem-core.d.ts.map +1 -1
  422. package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts.map +1 -1
  423. package/dist/types/wallets/in-app/core/wallet/profiles.d.ts +48 -0
  424. package/dist/types/wallets/in-app/core/wallet/profiles.d.ts.map +1 -0
  425. package/dist/types/wallets/in-app/core/wallet/types.d.ts +1 -1
  426. package/dist/types/wallets/in-app/core/wallet/types.d.ts.map +1 -1
  427. package/dist/types/wallets/in-app/native/auth/index.d.ts +3 -3
  428. package/dist/types/wallets/in-app/native/auth/index.d.ts.map +1 -1
  429. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts +7 -13
  430. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -1
  431. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts +1 -1
  432. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
  433. package/dist/types/wallets/in-app/native/helpers/auth/logout.d.ts +1 -1
  434. package/dist/types/wallets/in-app/native/helpers/auth/logout.d.ts.map +1 -1
  435. package/dist/types/wallets/in-app/native/helpers/auth/middleware.d.ts +3 -3
  436. package/dist/types/wallets/in-app/native/helpers/auth/middleware.d.ts.map +1 -1
  437. package/dist/types/wallets/in-app/native/helpers/storage/local.d.ts +1 -1
  438. package/dist/types/wallets/in-app/native/helpers/storage/local.d.ts.map +1 -1
  439. package/dist/types/wallets/in-app/native/helpers/types.d.ts +1 -1
  440. package/dist/types/wallets/in-app/native/helpers/types.d.ts.map +1 -1
  441. package/dist/types/wallets/in-app/native/helpers/wallet/creation.d.ts +1 -1
  442. package/dist/types/wallets/in-app/native/helpers/wallet/retrieval.d.ts +1 -1
  443. package/dist/types/wallets/in-app/native/helpers/wallet/retrieval.d.ts.map +1 -1
  444. package/dist/types/wallets/in-app/native/native-connector.d.ts +6 -4
  445. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  446. package/dist/types/wallets/in-app/web/lib/auth/abstract-login.d.ts +4 -12
  447. package/dist/types/wallets/in-app/web/lib/auth/abstract-login.d.ts.map +1 -1
  448. package/dist/types/wallets/in-app/web/lib/auth/base-login.d.ts +12 -15
  449. package/dist/types/wallets/in-app/web/lib/auth/base-login.d.ts.map +1 -1
  450. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts +11 -9
  451. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts.map +1 -1
  452. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +4 -4
  453. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
  454. package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts +1 -1
  455. package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts.map +1 -1
  456. package/dist/types/wallets/in-app/web/lib/auth/otp.d.ts +15 -0
  457. package/dist/types/wallets/in-app/web/lib/auth/otp.d.ts.map +1 -0
  458. package/dist/types/wallets/in-app/web/lib/auth/passkeys.d.ts +1 -1
  459. package/dist/types/wallets/in-app/web/lib/auth/passkeys.d.ts.map +1 -1
  460. package/dist/types/wallets/in-app/web/lib/get-url-token.d.ts +1 -1
  461. package/dist/types/wallets/in-app/web/lib/get-url-token.d.ts.map +1 -1
  462. package/dist/types/wallets/in-app/web/lib/in-app-account.d.ts +1 -1
  463. package/dist/types/wallets/in-app/web/lib/in-app-account.d.ts.map +1 -1
  464. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +11 -4
  465. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  466. package/dist/types/wallets/in-app/web/types.d.ts +1 -1
  467. package/dist/types/wallets/in-app/web/types.d.ts.map +1 -1
  468. package/dist/types/wallets/interfaces/wallet.d.ts.map +1 -1
  469. package/dist/types/wallets/manager/index.d.ts +1 -0
  470. package/dist/types/wallets/manager/index.d.ts.map +1 -1
  471. package/dist/types/wallets/native/create-wallet.d.ts.map +1 -1
  472. package/dist/types/wallets/smart/lib/utils.d.ts.map +1 -1
  473. package/dist/types/wallets/smart/smart-wallet.d.ts.map +1 -1
  474. package/dist/types/wallets/types.d.ts +1 -1
  475. package/dist/types/wallets/types.d.ts.map +1 -1
  476. package/package.json +3 -3
  477. package/src/adapters/ethers5.ts +4 -2
  478. package/src/adapters/wallet-adapter.ts +3 -0
  479. package/src/auth/constants.ts +0 -3
  480. package/src/auth/verify-hash.ts +7 -5
  481. package/src/chains/chain-definitions/abstract-testnet.ts +17 -0
  482. package/src/chains/chain-definitions/fraxtal-testnet.ts +17 -0
  483. package/src/chains/chain-definitions/mode-testnet.ts +17 -0
  484. package/src/chains/utils.ts +7 -0
  485. package/src/exports/chains.ts +1 -0
  486. package/src/exports/react.ts +1 -0
  487. package/src/exports/wallets/embedded.ts +1 -1
  488. package/src/exports/wallets/in-app.native.ts +1 -1
  489. package/src/exports/wallets/in-app.ts +2 -2
  490. package/src/exports/wallets.ts +5 -0
  491. package/src/extensions/marketplace/direct-listings/direct-listings.test.ts +334 -337
  492. package/src/extensions/marketplace/english-auctions/english-auctions.test.ts +231 -236
  493. package/src/extensions/marketplace/offers/offers.test.ts +1 -1
  494. package/src/extensions/prebuilts/deploy-modular-core.test.ts +1 -1
  495. package/src/react/core/hooks/others/useProfiles.ts +36 -0
  496. package/src/react/core/utils/storage.ts +1 -1
  497. package/src/react/core/utils/{socialIcons.ts → walletIcon.ts} +25 -0
  498. package/src/react/native/ui/components/TokenIcon.tsx +1 -1
  499. package/src/react/native/ui/connect/ConnectButton.tsx +14 -9
  500. package/src/react/native/ui/connect/ConnectModal.tsx +1 -1
  501. package/src/react/native/ui/connect/InAppWalletUI.tsx +1 -1
  502. package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +13 -8
  503. package/src/react/web/ui/ConnectWallet/Details.tsx +45 -11
  504. package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +3 -1
  505. package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +13 -8
  506. package/src/react/web/ui/ConnectWallet/Modal/screen.tsx +1 -1
  507. package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +1 -1
  508. package/src/react/web/ui/ConnectWallet/icons/AddUserIcon.tsx +25 -0
  509. package/src/react/web/ui/ConnectWallet/icons/MultiUserIcon.tsx +25 -0
  510. package/src/react/web/ui/ConnectWallet/locale/de.ts +6 -0
  511. package/src/react/web/ui/ConnectWallet/locale/en.ts +6 -0
  512. package/src/react/web/ui/ConnectWallet/locale/es.ts +6 -0
  513. package/src/react/web/ui/ConnectWallet/locale/fr.ts +6 -0
  514. package/src/react/web/ui/ConnectWallet/locale/ja.ts +6 -0
  515. package/src/react/web/ui/ConnectWallet/locale/kr.ts +6 -0
  516. package/src/react/web/ui/ConnectWallet/locale/tl.ts +6 -1
  517. package/src/react/web/ui/ConnectWallet/locale/types.ts +6 -0
  518. package/src/react/web/ui/ConnectWallet/locale/vi.ts +6 -0
  519. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +5 -1
  520. package/src/react/web/ui/ConnectWallet/screens/LinkProfileScreen.tsx +88 -0
  521. package/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx +119 -0
  522. package/src/react/web/ui/ConnectWallet/screens/ManageWalletScreen.tsx +20 -4
  523. package/src/react/web/ui/ConnectWallet/screens/types.ts +3 -1
  524. package/src/react/web/ui/PayEmbed.tsx +14 -9
  525. package/src/react/web/ui/components/Spinner.tsx +1 -1
  526. package/src/react/web/ui/components/TokenIcon.tsx +1 -1
  527. package/src/react/web/ui/components/WalletImage.tsx +7 -41
  528. package/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx +16 -4
  529. package/src/react/web/wallets/ecosystem/EcosystemWalletFormUI.tsx +14 -6
  530. package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +17 -5
  531. package/src/react/web/wallets/in-app/InAppWalletFormUI.tsx +13 -12
  532. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +20 -15
  533. package/src/react/web/wallets/shared/OTPLoginUI.tsx +49 -54
  534. package/src/react/web/wallets/shared/PassKeyLogin.tsx +59 -20
  535. package/src/react/web/wallets/shared/SocialLogin.tsx +46 -14
  536. package/src/react/web/wallets/shared/locale/en.ts +1 -1
  537. package/src/react/web/wallets/shared/oauthSignIn.ts +2 -2
  538. package/src/reactive/store.ts +3 -0
  539. package/src/transaction/serialize-transaction.test.ts +13 -9
  540. package/src/transaction/serialize-transaction.ts +31 -258
  541. package/src/version.ts +1 -1
  542. package/src/wallets/coinbase/coinbase-wallet.ts +9 -1
  543. package/src/wallets/create-wallet.ts +9 -1
  544. package/src/wallets/ecosystem/types.ts +2 -10
  545. package/src/wallets/in-app/core/authentication/getLoginPath.ts +22 -3
  546. package/src/wallets/in-app/core/authentication/linkAccount.ts +96 -0
  547. package/src/wallets/in-app/core/authentication/siwe.ts +63 -0
  548. package/src/wallets/in-app/core/authentication/{type.ts → types.ts} +18 -1
  549. package/src/wallets/in-app/core/interfaces/connector.ts +14 -5
  550. package/src/wallets/in-app/core/wallet/ecosystem-core.ts +10 -1
  551. package/src/wallets/in-app/core/wallet/in-app-core.ts +68 -3
  552. package/src/wallets/in-app/core/wallet/index.ts +2 -2
  553. package/src/wallets/in-app/core/wallet/profiles.ts +74 -0
  554. package/src/wallets/in-app/core/wallet/types.ts +1 -1
  555. package/src/wallets/in-app/native/auth/index.ts +2 -2
  556. package/src/wallets/in-app/native/auth/native-auth.ts +70 -183
  557. package/src/wallets/in-app/native/helpers/api/fetchers.ts +1 -1
  558. package/src/wallets/in-app/native/helpers/auth/logout.ts +1 -1
  559. package/src/wallets/in-app/native/helpers/auth/middleware.ts +1 -1
  560. package/src/wallets/in-app/native/helpers/storage/local.ts +1 -1
  561. package/src/wallets/in-app/native/helpers/types.ts +1 -1
  562. package/src/wallets/in-app/native/helpers/wallet/creation.ts +1 -1
  563. package/src/wallets/in-app/native/helpers/wallet/retrieval.ts +1 -1
  564. package/src/wallets/in-app/native/native-connector.ts +96 -35
  565. package/src/wallets/in-app/web/lib/auth/abstract-login.ts +4 -14
  566. package/src/wallets/in-app/web/lib/auth/base-login.ts +75 -177
  567. package/src/wallets/in-app/web/lib/auth/iframe-auth.ts +37 -18
  568. package/src/wallets/in-app/web/lib/auth/index.ts +2 -2
  569. package/src/wallets/in-app/web/lib/auth/oauth.ts +4 -4
  570. package/src/wallets/in-app/web/lib/auth/otp.ts +114 -0
  571. package/src/wallets/in-app/web/lib/auth/passkeys.ts +1 -1
  572. package/src/wallets/in-app/web/lib/get-url-token.ts +1 -1
  573. package/src/wallets/in-app/web/lib/in-app-account.ts +1 -1
  574. package/src/wallets/in-app/web/lib/web-connector.ts +93 -37
  575. package/src/wallets/in-app/web/types.ts +1 -1
  576. package/src/wallets/interfaces/wallet.ts +1 -0
  577. package/src/wallets/manager/index.ts +51 -5
  578. package/src/wallets/native/create-wallet.ts +9 -1
  579. package/src/wallets/smart/lib/utils.ts +6 -1
  580. package/src/wallets/smart/smart-wallet-integration.test.ts +3 -3
  581. package/src/wallets/smart/smart-wallet.ts +9 -1
  582. package/src/wallets/types.ts +6 -1
  583. package/dist/cjs/react/core/utils/socialIcons.js.map +0 -1
  584. package/dist/cjs/wallets/in-app/core/authentication/type.js.map +0 -1
  585. package/dist/esm/react/core/utils/socialIcons.js.map +0 -1
  586. package/dist/esm/wallets/in-app/core/authentication/type.js.map +0 -1
  587. package/dist/types/react/core/utils/socialIcons.d.ts.map +0 -1
  588. package/dist/types/wallets/in-app/core/authentication/type.d.ts.map +0 -1
@@ -1,36 +1,23 @@
1
1
  import {
2
- type ExactPartial,
2
+ type GetTransactionType,
3
3
  type SerializedTransactionReturnType,
4
4
  type Signature,
5
5
  type TransactionSerializable,
6
- type TransactionSerializableEIP1559,
7
- type TransactionSerializableEIP2930,
8
- type TransactionSerializableEIP4844,
9
- type TransactionSerializableLegacy,
10
- type TransactionSerializedEIP1559,
11
- type TransactionSerializedEIP2930,
12
- type TransactionSerializedLegacy,
6
+ type TransactionType,
13
7
  serializeTransaction as _serializeTransaction,
14
- assertTransactionEIP1559,
15
- assertTransactionEIP2930,
16
- assertTransactionLegacy,
17
- serializeAccessList,
18
- toRlp,
19
8
  } from "viem";
20
- import { trim } from "../utils/encoding/helpers/trim.js";
21
- import { type Hex, toHex } from "../utils/encoding/hex.js";
22
9
 
23
- export type SerializeTransactionOptions<
24
- _transaction extends TransactionSerializable,
25
- > = {
26
- transaction: _transaction;
10
+ export type SerializeTransactionOptions = {
11
+ transaction: TransactionSerializable;
12
+ signature?: Signature | undefined;
27
13
  };
28
14
 
29
15
  /**
30
- * Serializes a legacy, EIP-1559, EIP-2930, or EIP-4844 transaction object.
16
+ * Serializes a legacy, EIP-1559, EIP-2930, EIP-4844, or EIP-7702 transaction object.
31
17
  *
32
18
  * @param options - The serialization options.
33
- * @param options.transaction - The transaction object to be serialized, including the signature parameters if necessary.
19
+ * @param options.transaction - The transaction object to be serialized.
20
+ * @param [options.signature] - The signature to include with the transaction, if necessary.
34
21
  * @returns The serialized transaction.
35
22
  * @throws An error if the provided transaction object is invalid.
36
23
  * @transaction
@@ -46,245 +33,31 @@ export type SerializeTransactionOptions<
46
33
  * ```
47
34
  */
48
35
  export function serializeTransaction<
49
- _transaction extends TransactionSerializable,
36
+ const transaction extends TransactionSerializable,
37
+ _transactionType extends TransactionType = GetTransactionType<transaction>,
50
38
  >(
51
- options: SerializeTransactionOptions<_transaction>,
52
- ): SerializedTransactionReturnType<_transaction> {
39
+ options: SerializeTransactionOptions,
40
+ ): SerializedTransactionReturnType<transaction, _transactionType> {
53
41
  const { transaction } = options;
54
42
 
55
- if (
56
- transaction.type === "eip4844" || // explicit type checks required for viem parity
57
- typeof transaction.blobs !== "undefined" ||
58
- typeof transaction.blobVersionedHashes !== "undefined" ||
59
- typeof transaction.maxFeePerBlobGas !== "undefined" ||
60
- typeof transaction.sidecars !== "undefined"
61
- ) {
62
- // default to viem's 4844 serialization until we have blob utilities
63
- return _serializeTransaction<TransactionSerializableEIP4844>(
64
- transaction,
65
- ) as SerializedTransactionReturnType<_transaction>;
66
- }
67
-
68
- if (
69
- transaction.type === "eip1559" ||
70
- typeof transaction.maxFeePerGas !== "undefined" ||
71
- typeof transaction.maxPriorityFeePerGas !== "undefined"
72
- ) {
73
- return serializeEIP1559Transaction({
74
- transaction,
75
- }) as SerializedTransactionReturnType<_transaction>;
76
- }
77
-
78
- if (
79
- transaction.type === "eip2930" ||
80
- (typeof transaction.gasPrice !== "undefined" &&
81
- typeof transaction.accessList !== "undefined")
82
- ) {
83
- return serializeEIP2930Transaction({
84
- transaction,
85
- }) as SerializedTransactionReturnType<_transaction>;
86
- }
87
-
88
- if (
89
- transaction.type === "legacy" ||
90
- typeof transaction.gasPrice !== "undefined"
91
- ) {
92
- return serializeTransactionLegacy({
93
- transaction: transaction as TransactionSerializableLegacy,
94
- }) as SerializedTransactionReturnType<_transaction>;
95
- }
96
-
97
- throw new Error(
98
- `Invalid transaction to serialize.\n\n${JSON.stringify(
99
- transaction,
100
- (_, v) => (typeof v === "bigint" ? `${v.toString()}n` : v),
101
- 2,
102
- )}`,
103
- );
104
- }
105
-
106
- type SerializeEIP1559TransactionOptions = {
107
- transaction: TransactionSerializableEIP1559;
108
- };
109
-
110
- function serializeEIP1559Transaction(
111
- options: SerializeEIP1559TransactionOptions,
112
- ): TransactionSerializedEIP1559 {
113
- assertTransactionEIP1559(options.transaction);
114
-
115
- const {
116
- transaction: {
117
- chainId,
118
- gas,
119
- nonce,
120
- to,
121
- value,
122
- maxFeePerGas,
123
- maxPriorityFeePerGas,
124
- accessList,
125
- data,
126
- r,
127
- s,
128
- v,
129
- yParity,
130
- },
131
- } = options;
132
-
133
- const serializedAccessList = serializeAccessList(accessList);
134
-
135
- const serializedTransaction = [
136
- toHex(chainId),
137
- nonce ? toHex(nonce) : "0x",
138
- maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : "0x",
139
- maxFeePerGas ? toHex(maxFeePerGas) : "0x",
140
- gas ? toHex(gas) : "0x",
141
- // To fix when migrating to our own version of TransactionSerializable (the viem type is downgraded from Address to string when importing)
142
- (to ?? "0x") as Hex,
143
- value ? toHex(value) : "0x",
144
- data ?? "0x",
145
- serializedAccessList,
146
- ...toYParitySignatureArray({ r, s, v, yParity }),
147
- ];
148
-
149
- return `0x02${toRlp(serializedTransaction).slice(2)}`;
150
- }
151
-
152
- type SerializeEIP2930TransactionOptions = {
153
- transaction: TransactionSerializableEIP2930;
154
- };
155
-
156
- function serializeEIP2930Transaction(
157
- options: SerializeEIP2930TransactionOptions,
158
- ): TransactionSerializedEIP2930 {
159
- assertTransactionEIP2930(options.transaction);
160
-
161
- const {
162
- transaction: {
163
- chainId,
164
- gas,
165
- gasPrice,
166
- nonce,
167
- to,
168
- value,
169
- accessList,
170
- data,
171
- r,
172
- s,
173
- v,
174
- yParity,
175
- },
176
- } = options;
177
-
178
- const serializedAccessList = serializeAccessList(accessList);
179
-
180
- const serializedTransaction = [
181
- toHex(chainId),
182
- nonce ? toHex(nonce) : "0x",
183
- gasPrice ? toHex(gasPrice) : "0x",
184
- gas ? toHex(gas) : "0x",
185
- (to ?? "0x") as Hex,
186
- value ? toHex(value) : "0x",
187
- data ?? "0x",
188
- serializedAccessList,
189
- ...toYParitySignatureArray({ r, s, v, yParity }),
190
- ];
191
-
192
- return `0x01${toRlp(serializedTransaction).slice(2)}`;
193
- }
194
-
195
- type SerializeLegacyTransactionOptions = {
196
- transaction: TransactionSerializableLegacy;
197
- };
198
-
199
- function serializeTransactionLegacy(
200
- options: SerializeLegacyTransactionOptions,
201
- ): TransactionSerializedLegacy {
202
- assertTransactionLegacy(options.transaction);
203
-
204
- const {
205
- chainId = 0,
206
- gas,
207
- data,
208
- nonce,
209
- to,
210
- value,
211
- gasPrice,
212
- r,
213
- s,
214
- v,
215
- } = options.transaction;
216
-
217
- let serializedTransaction = [
218
- nonce ? toHex(nonce) : "0x",
219
- gasPrice ? toHex(gasPrice) : "0x",
220
- gas ? toHex(gas) : "0x",
221
- (to ?? "0x") as Hex,
222
- value ? toHex(value) : "0x",
223
- data ?? "0x",
224
- ];
225
-
226
- if (typeof v !== "undefined") {
227
- const v_ = (() => {
228
- // EIP-155 (inferred chainId)
229
- if (v >= 35n) {
230
- const inferredChainId = (v - 35n) / 2n;
231
- if (inferredChainId > 0) return v;
232
- return 27n + (v === 35n ? 0n : 1n);
233
- }
234
-
235
- // EIP-155 (explicit chainId)
236
- if (chainId > 0) return BigInt(chainId * 2) + BigInt(35n + v - 27n);
237
-
238
- // Pre-EIP-155 (no chainId)
239
- const v_ = 27n + (v === 27n ? 0n : 1n);
240
- if (v !== v_) throw new Error(`Invalid legacy signature value v: ${v}`);
241
- return v_;
242
- })();
243
-
244
- if (typeof r === "undefined")
245
- throw new Error(`Invalid legacy signature value r: ${r}`);
246
- if (typeof s === "undefined")
247
- throw new Error(`Invalid legacy signature value s: ${s}`);
248
-
249
- serializedTransaction = [
250
- ...serializedTransaction,
251
- toHex(v_),
252
- r === "0x00" ? "0x" : r,
253
- s === "0x00" ? "0x" : s,
254
- ];
255
- } else if (chainId > 0) {
256
- serializedTransaction = [
257
- ...serializedTransaction,
258
- toHex(chainId),
259
- "0x",
260
- "0x",
261
- ];
262
- }
263
-
264
- return toRlp(serializedTransaction) as TransactionSerializedLegacy;
265
- }
266
-
267
- export function toYParitySignatureArray(
268
- signature: ExactPartial<Signature>,
269
- ): Hex[] {
270
- const { v, yParity } = signature;
271
-
272
- if (typeof signature.r === "undefined") return [];
273
- if (typeof signature.s === "undefined") return [];
274
-
275
- if (typeof v === "undefined" && typeof yParity === "undefined") return [];
276
-
277
- const r = trim(signature.r);
278
- const s = trim(signature.s);
279
-
280
- const yParity_ = (() => {
281
- if (yParity === 1 || yParity === 0) return yParity ? toHex(1) : "0x";
282
- if (typeof yParity !== "undefined")
283
- throw new Error(`Invalid signature value for yParity: ${yParity}`);
284
-
285
- if (v === 0n || v === 27n) return "0x";
286
- if (v === 1n || v === 28n) return toHex(1);
287
- throw new Error(`Invalid signature value v: ${v}`);
43
+ // This is to maintain compatibility with our old interface (including the signature in the transaction object)
44
+ const signature = (() => {
45
+ if (options.signature) return options.signature;
46
+ if (transaction.v === undefined && transaction.yParity === undefined) {
47
+ return undefined;
48
+ }
49
+
50
+ if (transaction.r === undefined || transaction.s === undefined) {
51
+ throw new Error("Invalid signature provided with transaction");
52
+ }
53
+
54
+ return {
55
+ v: transaction.v,
56
+ r: transaction.r,
57
+ s: transaction.s,
58
+ yParity: transaction.yParity,
59
+ };
288
60
  })();
289
- return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
61
+
62
+ return _serializeTransaction(transaction, signature as Signature | undefined); // Trust the options type-checking did its job and that the converted signature mirrors that type
290
63
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.44.1";
1
+ export const version = "5.45.0-nightly-bbb4f1c53f982b1f9de00fb30efbf2c77f155e96-20240809000532";
@@ -5,6 +5,7 @@
5
5
  import type { ProviderInterface } from "@coinbase/wallet-sdk";
6
6
  import { trackConnect } from "../../analytics/track.js";
7
7
  import type { Chain } from "../../chains/types.js";
8
+ import { getCachedChainIfExists } from "../../chains/utils.js";
8
9
  import { COINBASE } from "../constants.js";
9
10
  import type { Account, Wallet } from "../interfaces/wallet.js";
10
11
  import { createWalletEmitter } from "../wallet-emitter.js";
@@ -54,7 +55,14 @@ export function coinbaseWalletSDK(args: {
54
55
  return {
55
56
  id: COINBASE,
56
57
  subscribe: emitter.subscribe,
57
- getChain: () => chain,
58
+ getChain() {
59
+ if (!chain) {
60
+ return undefined;
61
+ }
62
+
63
+ chain = getCachedChainIfExists(chain.id) || chain;
64
+ return chain;
65
+ },
58
66
  getConfig: () => createOptions,
59
67
  getAccount: () => account,
60
68
  autoConnect: async (options) => {
@@ -13,6 +13,7 @@ import type {
13
13
  } from "./wallet-types.js";
14
14
 
15
15
  import { trackConnect } from "../analytics/track.js";
16
+ import { getCachedChainIfExists } from "../chains/utils.js";
16
17
  import { webLocalStorage } from "../utils/storage/webStorage.js";
17
18
  import { isMobile } from "../utils/web/isMobile.js";
18
19
  import { openWindow } from "../utils/web/openWindow.js";
@@ -206,7 +207,14 @@ export function createWallet<const ID extends WalletId>(
206
207
  id,
207
208
  subscribe: emitter.subscribe,
208
209
  getConfig: () => args[1],
209
- getChain: () => chain,
210
+ getChain() {
211
+ if (!chain) {
212
+ return undefined;
213
+ }
214
+
215
+ chain = getCachedChainIfExists(chain.id) || chain;
216
+ return chain;
217
+ },
210
218
  getAccount: () => account,
211
219
  autoConnect: async (
212
220
  options: WalletAutoConnectionOption<
@@ -1,9 +1,7 @@
1
- import type { Prettify } from "../../utils/type-utils.js";
2
1
  import type {
3
2
  InAppWalletAutoConnectOptions,
4
3
  InAppWalletConnectionOptions,
5
4
  } from "../in-app/core/wallet/types.js";
6
- import type { Ecosystem } from "../in-app/web/types.js";
7
5
 
8
6
  export type EcosystemWalletCreationOptions = {
9
7
  partnerId?: string;
@@ -12,11 +10,5 @@ export type EcosystemWalletCreationOptions = {
12
10
  };
13
11
  };
14
12
 
15
- export type EcosystemWalletConnectionOptions = Prettify<
16
- InAppWalletConnectionOptions & {
17
- ecosystem: Ecosystem;
18
- }
19
- >;
20
- export type EcosystemWalletAutoConnectOptions = Prettify<
21
- InAppWalletAutoConnectOptions & { ecosystem: Ecosystem }
22
- >;
13
+ export type EcosystemWalletConnectionOptions = InAppWalletConnectionOptions;
14
+ export type EcosystemWalletAutoConnectOptions = InAppWalletAutoConnectOptions;
@@ -1,16 +1,16 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
2
  import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
3
- import type { SocialAuthOption } from "../../../../wallets/types.js";
3
+ import type { AuthOption } from "../../../../wallets/types.js";
4
4
  import type { Ecosystem } from "../../web/types.js";
5
5
 
6
- export const getSocialAuthLoginPath = ({
6
+ export const getLoginUrl = ({
7
7
  authOption,
8
8
  client,
9
9
  ecosystem,
10
10
  mode = "popup",
11
11
  redirectUrl,
12
12
  }: {
13
- authOption: SocialAuthOption;
13
+ authOption: AuthOption;
14
14
  client: ThirdwebClient;
15
15
  ecosystem?: Ecosystem;
16
16
  mode?: "popup" | "redirect" | "mobile";
@@ -39,3 +39,22 @@ export const getSocialAuthLoginPath = ({
39
39
 
40
40
  return baseUrl;
41
41
  };
42
+
43
+ export const getLoginCallbackUrl = ({
44
+ authOption,
45
+ client,
46
+ ecosystem,
47
+ }: {
48
+ authOption: AuthOption;
49
+ client: ThirdwebClient;
50
+ ecosystem?: Ecosystem;
51
+ }): string => {
52
+ let baseUrl = `${getThirdwebBaseUrl("inAppWallet")}/api/2024-05-05/login/${authOption}/callback?clientId=${client.clientId}`;
53
+ if (ecosystem?.partnerId) {
54
+ baseUrl = `${baseUrl}&ecosystemId=${ecosystem.id}&ecosystemPartnerId=${ecosystem.partnerId}`;
55
+ } else if (ecosystem) {
56
+ baseUrl = `${baseUrl}&ecosystemId=${ecosystem.id}`;
57
+ }
58
+
59
+ return baseUrl;
60
+ };
@@ -0,0 +1,96 @@
1
+ import type { ThirdwebClient } from "../../../../client/client.js";
2
+ import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
3
+ import type { Profile } from "./types.js";
4
+
5
+ /**
6
+ * @description
7
+ * Links a new account to the current one using an auth token.
8
+ * For the public-facing API, use `wallet.linkProfile` instead.
9
+ *
10
+ * @internal
11
+ */
12
+ export async function linkAccount({
13
+ client,
14
+ tokenToLink,
15
+ }: {
16
+ client: ThirdwebClient;
17
+ tokenToLink: string;
18
+ }): Promise<Profile[]> {
19
+ const IN_APP_URL = getThirdwebBaseUrl("inAppWallet");
20
+ const currentAccountToken = localStorage.getItem(
21
+ `walletToken-${client.clientId}`,
22
+ );
23
+
24
+ if (!currentAccountToken) {
25
+ throw new Error("Failed to link account, no user logged in");
26
+ }
27
+
28
+ const headers: Record<string, string> = {
29
+ "Content-Type": "application/json",
30
+ Authorization: `Bearer iaw-auth-token:${currentAccountToken}`,
31
+ "x-thirdweb-client-id": client.clientId,
32
+ };
33
+
34
+ const linkedDetailsResp = await fetch(
35
+ `${IN_APP_URL}/api/2024-05-05/account/connect`,
36
+ {
37
+ method: "POST",
38
+ headers,
39
+ body: JSON.stringify({
40
+ accountAuthTokenToConnect: tokenToLink,
41
+ }),
42
+ },
43
+ );
44
+
45
+ if (!linkedDetailsResp.ok) {
46
+ const body = await linkedDetailsResp.json();
47
+ throw new Error(body.message || "Failed to link account.");
48
+ }
49
+
50
+ const { linkedAccounts } = await linkedDetailsResp.json();
51
+
52
+ return (linkedAccounts ?? []) satisfies Profile[];
53
+ }
54
+
55
+ /**
56
+ * @description
57
+ * Gets the linked accounts for the current user.
58
+ * For the public-facing API, use `wallet.getProfiles` instead.
59
+ *
60
+ * @internal
61
+ */
62
+ export async function getLinkedProfilesInternal({
63
+ client,
64
+ }: { client: ThirdwebClient }): Promise<Profile[]> {
65
+ const IN_APP_URL = getThirdwebBaseUrl("inAppWallet");
66
+ const currentAccountToken = localStorage.getItem(
67
+ `walletToken-${client.clientId}`,
68
+ );
69
+
70
+ if (!currentAccountToken) {
71
+ throw new Error("Failed to get linked accounts, no user logged in");
72
+ }
73
+
74
+ const headers: Record<string, string> = {
75
+ "Content-Type": "application/json",
76
+ Authorization: `Bearer iaw-auth-token:${currentAccountToken}`,
77
+ "x-thirdweb-client-id": client.clientId,
78
+ };
79
+
80
+ const linkedAccountsResp = await fetch(
81
+ `${IN_APP_URL}/api/2024-05-05/accounts`,
82
+ {
83
+ method: "GET",
84
+ headers,
85
+ },
86
+ );
87
+
88
+ if (!linkedAccountsResp.ok) {
89
+ const body = await linkedAccountsResp.json();
90
+ throw new Error(body.message || "Failed to get linked accounts.");
91
+ }
92
+
93
+ const { linkedAccounts } = await linkedAccountsResp.json();
94
+
95
+ return (linkedAccounts ?? []) satisfies Profile[];
96
+ }
@@ -0,0 +1,63 @@
1
+ import { signLoginPayload } from "../../../../auth/core/sign-login-payload.js";
2
+ import type { LoginPayload } from "../../../../auth/core/types.js";
3
+ import type { ThirdwebClient } from "../../../../client/client.js";
4
+ import { getClientFetch } from "../../../../utils/fetch.js";
5
+ import type { InjectedSupportedWalletIds } from "../../../../wallets/__generated__/wallet-ids.js";
6
+ import { createWallet } from "../../../../wallets/create-wallet.js";
7
+ import type { Ecosystem } from "../../web/types.js";
8
+ import { getLoginCallbackUrl, getLoginUrl } from "./getLoginPath.js";
9
+ import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
10
+
11
+ /**
12
+ * @internal
13
+ */
14
+ export async function siweAuthenticate(args: {
15
+ walletId: InjectedSupportedWalletIds;
16
+ chainId: number;
17
+ client: ThirdwebClient;
18
+ ecosystem?: Ecosystem;
19
+ }): Promise<AuthStoredTokenWithCookieReturnType> {
20
+ const wallet = createWallet(args.walletId);
21
+ const account = await wallet.connect({ client: args.client });
22
+ const clientFetch = getClientFetch(args.client, args.ecosystem);
23
+
24
+ const payload = await (async () => {
25
+ const path = getLoginUrl({
26
+ authOption: "siwe",
27
+ client: args.client,
28
+ });
29
+ const res = await clientFetch(
30
+ `${path}&address=${account.address}&chainId=${args.chainId}`,
31
+ );
32
+
33
+ if (!res.ok) throw new Error("Failed to generate SIWE login payload");
34
+
35
+ return (await res.json()) satisfies LoginPayload;
36
+ })();
37
+ const { signature } = await signLoginPayload({ payload, account });
38
+
39
+ const authResult = await (async () => {
40
+ const path = getLoginCallbackUrl({
41
+ authOption: "siwe",
42
+ client: args.client,
43
+ });
44
+ const res = await clientFetch(
45
+ `${path}&signature=${signature}&payload=${encodeURIComponent(payload)}`,
46
+ {
47
+ method: "POST",
48
+ headers: {
49
+ "Content-Type": "application/json",
50
+ },
51
+ body: JSON.stringify({
52
+ signature,
53
+ payload,
54
+ }),
55
+ },
56
+ );
57
+
58
+ if (!res.ok) throw new Error("Failed to verify SIWE signature");
59
+
60
+ return (await res.json()) satisfies AuthStoredTokenWithCookieReturnType;
61
+ })();
62
+ return authResult;
63
+ }
@@ -1,7 +1,9 @@
1
1
  import type { AuthType } from "@passwordless-id/webauthn/dist/esm/types.js";
2
2
  import type { ThirdwebClient } from "../../../../client/client.js";
3
+ import type { Address } from "../../../../utils/address.js";
4
+ import type { InjectedSupportedWalletIds } from "../../../../wallets/__generated__/wallet-ids.js";
3
5
  import type { Account } from "../../../interfaces/wallet.js";
4
- import type { SocialAuthOption } from "../../../types.js";
6
+ import type { AuthOption, SocialAuthOption } from "../../../types.js";
5
7
  import type { Ecosystem } from "../../web/types.js";
6
8
 
7
9
  export type MultiStepAuthProviderType =
@@ -38,6 +40,11 @@ export type SingleStepAuthArgsType =
38
40
  type: "sign-up" | "sign-in";
39
41
  passkeyName?: string;
40
42
  authenticatorType?: AuthType;
43
+ }
44
+ | {
45
+ strategy: "siwe";
46
+ walletId: InjectedSupportedWalletIds;
47
+ chainId: number;
41
48
  };
42
49
 
43
50
  export type AuthArgsType = (MultiStepAuthArgsType | SingleStepAuthArgsType) & {
@@ -71,6 +78,16 @@ export type OauthOption = {
71
78
  redirectUrl: string;
72
79
  };
73
80
 
81
+ export type Profile = {
82
+ type: AuthOption;
83
+ details: {
84
+ id?: string;
85
+ email?: string;
86
+ phone?: string;
87
+ address?: Address;
88
+ };
89
+ };
90
+
74
91
  /**
75
92
  * @internal
76
93
  */
@@ -1,23 +1,32 @@
1
1
  import type { SocialAuthOption } from "../../../../wallets/types.js";
2
2
  import type { Account } from "../../../interfaces/wallet.js";
3
3
  import type {
4
- AuthArgsType,
5
4
  AuthLoginReturnType,
6
5
  AuthStoredTokenWithCookieReturnType,
7
6
  GetUser,
8
7
  LogoutReturnType,
8
+ MultiStepAuthArgsType,
9
9
  PreAuthArgsType,
10
- SendEmailOtpReturnType,
11
- } from "../authentication/type.js";
10
+ SingleStepAuthArgsType,
11
+ } from "../authentication/types.js";
12
12
 
13
13
  export interface InAppConnector {
14
14
  getUser(): Promise<GetUser>;
15
15
  getAccount(): Promise<Account>;
16
- preAuthenticate(args: PreAuthArgsType): Promise<SendEmailOtpReturnType>;
16
+ preAuthenticate(args: PreAuthArgsType): Promise<void>;
17
+ // Authenticate generates an auth token, when redirecting it returns void as the user is redirected to a new page and the token is stored in the callback url
17
18
  authenticateWithRedirect?(strategy: SocialAuthOption): void;
19
+ // Login takes an auth token and connects a user with it
18
20
  loginWithAuthToken?(
19
21
  authResult: AuthStoredTokenWithCookieReturnType,
20
22
  ): Promise<AuthLoginReturnType>;
21
- authenticate(args: AuthArgsType): Promise<AuthLoginReturnType>;
23
+ // Authenticate generates an auth token but does not log the user in
24
+ authenticate(
25
+ args: MultiStepAuthArgsType | SingleStepAuthArgsType,
26
+ ): Promise<AuthStoredTokenWithCookieReturnType>;
27
+ // Connect is authenticate + login combined
28
+ connect(
29
+ args: MultiStepAuthArgsType | SingleStepAuthArgsType,
30
+ ): Promise<AuthLoginReturnType>;
22
31
  logout(): Promise<LogoutReturnType>;
23
32
  }