thirdweb 5.56.0-nightly-a5e605c65e360a9d3d2e553d6783e58582b50a70-20240917000331 → 5.57.0-nightly-cf1683c3feea6eb36ac6b902a1dd64c8ed8803c9-20240918000340

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 (298) hide show
  1. package/dist/cjs/contract/verification/index.js +29 -33
  2. package/dist/cjs/contract/verification/index.js.map +1 -1
  3. package/dist/cjs/react/core/hooks/pay/useBuyWithCryptoStatus.js +7 -1
  4. package/dist/cjs/react/core/hooks/pay/useBuyWithCryptoStatus.js.map +1 -1
  5. package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js +15 -1
  6. package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
  7. package/dist/cjs/react/core/providers/invalidateWalletBalance.js +1 -1
  8. package/dist/cjs/react/core/providers/invalidateWalletBalance.js.map +1 -1
  9. package/dist/cjs/react/core/utils/walletIcon.js +4 -1
  10. package/dist/cjs/react/core/utils/walletIcon.js.map +1 -1
  11. package/dist/cjs/react/native/ui/components/WalletImage.js +2 -0
  12. package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
  13. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +21 -1
  14. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -1
  15. package/dist/cjs/react/native/ui/connect/TokenListScreen.js +2 -1
  16. package/dist/cjs/react/native/ui/connect/TokenListScreen.js.map +1 -1
  17. package/dist/cjs/react/native/ui/icons/svgs.js +2 -1
  18. package/dist/cjs/react/native/ui/icons/svgs.js.map +1 -1
  19. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +15 -2
  20. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  21. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +7 -2
  22. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  23. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +12 -12
  24. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  25. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js +5 -5
  26. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  27. package/dist/cjs/react/web/ui/MediaRenderer/MediaRenderer.js +1 -1
  28. package/dist/cjs/react/web/ui/MediaRenderer/MediaRenderer.js.map +1 -1
  29. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletHeader.js +3 -3
  30. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletHeader.js.map +1 -1
  31. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +4 -0
  32. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  33. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +38 -19
  34. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  35. package/dist/cjs/react/web/wallets/shared/GuestLogin.js +81 -0
  36. package/dist/cjs/react/web/wallets/shared/GuestLogin.js.map +1 -0
  37. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +1 -1
  38. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  39. package/dist/cjs/react/web/wallets/shared/SocialLogin.js +1 -1
  40. package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
  41. package/dist/cjs/react/web/wallets/shared/locale/de.js +2 -1
  42. package/dist/cjs/react/web/wallets/shared/locale/de.js.map +1 -1
  43. package/dist/cjs/react/web/wallets/shared/locale/en.js +1 -0
  44. package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
  45. package/dist/cjs/react/web/wallets/shared/locale/es.js +2 -1
  46. package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
  47. package/dist/cjs/react/web/wallets/shared/locale/fr.js +2 -1
  48. package/dist/cjs/react/web/wallets/shared/locale/fr.js.map +1 -1
  49. package/dist/cjs/react/web/wallets/shared/locale/ja.js +2 -1
  50. package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
  51. package/dist/cjs/react/web/wallets/shared/locale/kr.js +2 -1
  52. package/dist/cjs/react/web/wallets/shared/locale/kr.js.map +1 -1
  53. package/dist/cjs/react/web/wallets/shared/locale/tl.js +2 -1
  54. package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
  55. package/dist/cjs/react/web/wallets/shared/locale/vi.js +1 -0
  56. package/dist/cjs/react/web/wallets/shared/locale/vi.js.map +1 -1
  57. package/dist/cjs/react/web/wallets/shared/oauthSignIn.js +1 -0
  58. package/dist/cjs/react/web/wallets/shared/oauthSignIn.js.map +1 -1
  59. package/dist/cjs/transaction/resolve-method.js +8 -1
  60. package/dist/cjs/transaction/resolve-method.js.map +1 -1
  61. package/dist/cjs/utils/encoding/hex.js +1 -3
  62. package/dist/cjs/utils/encoding/hex.js.map +1 -1
  63. package/dist/cjs/utils/promise/p-limit.js.map +1 -1
  64. package/dist/cjs/utils/signatures/sign-message.js +2 -4
  65. package/dist/cjs/utils/signatures/sign-message.js.map +1 -1
  66. package/dist/cjs/version.js +1 -1
  67. package/dist/cjs/wallets/in-app/core/authentication/guest.js +33 -0
  68. package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -0
  69. package/dist/cjs/wallets/in-app/core/authentication/types.js +1 -0
  70. package/dist/cjs/wallets/in-app/core/authentication/types.js.map +1 -1
  71. package/dist/cjs/wallets/in-app/native/auth/native-auth.js +25 -0
  72. package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -1
  73. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js +1 -3
  74. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  75. package/dist/cjs/wallets/in-app/native/helpers/wallet/sss.js.map +1 -1
  76. package/dist/cjs/wallets/in-app/native/native-connector.js +32 -0
  77. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  78. package/dist/cjs/wallets/in-app/web/in-app.js +13 -1
  79. package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
  80. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +8 -0
  81. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  82. package/dist/cjs/wallets/manager/index.js +5 -0
  83. package/dist/cjs/wallets/manager/index.js.map +1 -1
  84. package/dist/cjs/wallets/types.js +1 -0
  85. package/dist/cjs/wallets/types.js.map +1 -1
  86. package/dist/cjs/wallets/wallet-connect/receiver/request-handlers/switch-chain.js +2 -4
  87. package/dist/cjs/wallets/wallet-connect/receiver/request-handlers/switch-chain.js.map +1 -1
  88. package/dist/esm/contract/verification/index.js +29 -33
  89. package/dist/esm/contract/verification/index.js.map +1 -1
  90. package/dist/esm/react/core/hooks/pay/useBuyWithCryptoStatus.js +7 -1
  91. package/dist/esm/react/core/hooks/pay/useBuyWithCryptoStatus.js.map +1 -1
  92. package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js +15 -1
  93. package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
  94. package/dist/esm/react/core/providers/invalidateWalletBalance.js +1 -1
  95. package/dist/esm/react/core/providers/invalidateWalletBalance.js.map +1 -1
  96. package/dist/esm/react/core/utils/walletIcon.js +3 -0
  97. package/dist/esm/react/core/utils/walletIcon.js.map +1 -1
  98. package/dist/esm/react/native/ui/components/WalletImage.js +3 -1
  99. package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -1
  100. package/dist/esm/react/native/ui/connect/InAppWalletUI.js +21 -1
  101. package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -1
  102. package/dist/esm/react/native/ui/connect/TokenListScreen.js +2 -1
  103. package/dist/esm/react/native/ui/connect/TokenListScreen.js.map +1 -1
  104. package/dist/esm/react/native/ui/icons/svgs.js +1 -0
  105. package/dist/esm/react/native/ui/icons/svgs.js.map +1 -1
  106. package/dist/esm/react/web/ui/ConnectWallet/Details.js +15 -2
  107. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  108. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +7 -2
  109. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  110. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +12 -12
  111. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  112. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js +6 -6
  113. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  114. package/dist/esm/react/web/ui/MediaRenderer/MediaRenderer.js +1 -1
  115. package/dist/esm/react/web/ui/MediaRenderer/MediaRenderer.js.map +1 -1
  116. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletHeader.js +3 -3
  117. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletHeader.js.map +1 -1
  118. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +4 -0
  119. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  120. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +38 -19
  121. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  122. package/dist/esm/react/web/wallets/shared/GuestLogin.js +78 -0
  123. package/dist/esm/react/web/wallets/shared/GuestLogin.js.map +1 -0
  124. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +1 -1
  125. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  126. package/dist/esm/react/web/wallets/shared/SocialLogin.js +1 -1
  127. package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
  128. package/dist/esm/react/web/wallets/shared/locale/de.js +2 -1
  129. package/dist/esm/react/web/wallets/shared/locale/de.js.map +1 -1
  130. package/dist/esm/react/web/wallets/shared/locale/en.js +1 -0
  131. package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
  132. package/dist/esm/react/web/wallets/shared/locale/es.js +2 -1
  133. package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
  134. package/dist/esm/react/web/wallets/shared/locale/fr.js +2 -1
  135. package/dist/esm/react/web/wallets/shared/locale/fr.js.map +1 -1
  136. package/dist/esm/react/web/wallets/shared/locale/ja.js +2 -1
  137. package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
  138. package/dist/esm/react/web/wallets/shared/locale/kr.js +2 -1
  139. package/dist/esm/react/web/wallets/shared/locale/kr.js.map +1 -1
  140. package/dist/esm/react/web/wallets/shared/locale/tl.js +2 -1
  141. package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
  142. package/dist/esm/react/web/wallets/shared/locale/vi.js +1 -0
  143. package/dist/esm/react/web/wallets/shared/locale/vi.js.map +1 -1
  144. package/dist/esm/react/web/wallets/shared/oauthSignIn.js +1 -0
  145. package/dist/esm/react/web/wallets/shared/oauthSignIn.js.map +1 -1
  146. package/dist/esm/transaction/resolve-method.js +8 -1
  147. package/dist/esm/transaction/resolve-method.js.map +1 -1
  148. package/dist/esm/utils/encoding/hex.js +1 -3
  149. package/dist/esm/utils/encoding/hex.js.map +1 -1
  150. package/dist/esm/utils/promise/p-limit.js.map +1 -1
  151. package/dist/esm/utils/signatures/sign-message.js +2 -4
  152. package/dist/esm/utils/signatures/sign-message.js.map +1 -1
  153. package/dist/esm/version.js +1 -1
  154. package/dist/esm/wallets/in-app/core/authentication/guest.js +30 -0
  155. package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -0
  156. package/dist/esm/wallets/in-app/core/authentication/types.js +1 -0
  157. package/dist/esm/wallets/in-app/core/authentication/types.js.map +1 -1
  158. package/dist/esm/wallets/in-app/native/auth/native-auth.js +24 -0
  159. package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -1
  160. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js +1 -3
  161. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  162. package/dist/esm/wallets/in-app/native/helpers/wallet/sss.js.map +1 -1
  163. package/dist/esm/wallets/in-app/native/native-connector.js +33 -1
  164. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  165. package/dist/esm/wallets/in-app/web/in-app.js +13 -1
  166. package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
  167. package/dist/esm/wallets/in-app/web/lib/web-connector.js +8 -0
  168. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  169. package/dist/esm/wallets/manager/index.js +5 -0
  170. package/dist/esm/wallets/manager/index.js.map +1 -1
  171. package/dist/esm/wallets/types.js +1 -0
  172. package/dist/esm/wallets/types.js.map +1 -1
  173. package/dist/esm/wallets/wallet-connect/receiver/request-handlers/switch-chain.js +2 -4
  174. package/dist/esm/wallets/wallet-connect/receiver/request-handlers/switch-chain.js.map +1 -1
  175. package/dist/types/contract/verification/index.d.ts.map +1 -1
  176. package/dist/types/exports/utils.d.ts +1 -0
  177. package/dist/types/exports/utils.d.ts.map +1 -1
  178. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +7 -14
  179. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
  180. package/dist/types/react/core/hooks/pay/useBuyWithCryptoStatus.d.ts.map +1 -1
  181. package/dist/types/react/core/hooks/pay/useBuyWithFiatStatus.d.ts.map +1 -1
  182. package/dist/types/react/core/utils/storage.d.ts +1 -1
  183. package/dist/types/react/core/utils/storage.d.ts.map +1 -1
  184. package/dist/types/react/core/utils/walletIcon.d.ts +2 -1
  185. package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -1
  186. package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
  187. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
  188. package/dist/types/react/native/ui/connect/TokenListScreen.d.ts.map +1 -1
  189. package/dist/types/react/native/ui/icons/svgs.d.ts +1 -0
  190. package/dist/types/react/native/ui/icons/svgs.d.ts.map +1 -1
  191. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  192. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  193. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
  194. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletHeader.d.ts.map +1 -1
  195. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
  196. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +3 -0
  197. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  198. package/dist/types/react/web/wallets/shared/GuestLogin.d.ts +19 -0
  199. package/dist/types/react/web/wallets/shared/GuestLogin.d.ts.map +1 -0
  200. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
  201. package/dist/types/react/web/wallets/shared/locale/de.d.ts +1 -0
  202. package/dist/types/react/web/wallets/shared/locale/de.d.ts.map +1 -1
  203. package/dist/types/react/web/wallets/shared/locale/en.d.ts +1 -0
  204. package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
  205. package/dist/types/react/web/wallets/shared/locale/es.d.ts +1 -0
  206. package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
  207. package/dist/types/react/web/wallets/shared/locale/fr.d.ts +1 -0
  208. package/dist/types/react/web/wallets/shared/locale/fr.d.ts.map +1 -1
  209. package/dist/types/react/web/wallets/shared/locale/ja.d.ts +1 -0
  210. package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
  211. package/dist/types/react/web/wallets/shared/locale/kr.d.ts +1 -0
  212. package/dist/types/react/web/wallets/shared/locale/kr.d.ts.map +1 -1
  213. package/dist/types/react/web/wallets/shared/locale/tl.d.ts +1 -0
  214. package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
  215. package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -0
  216. package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
  217. package/dist/types/react/web/wallets/shared/locale/vi.d.ts +1 -0
  218. package/dist/types/react/web/wallets/shared/locale/vi.d.ts.map +1 -1
  219. package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts.map +1 -1
  220. package/dist/types/transaction/resolve-method.d.ts +2 -2
  221. package/dist/types/transaction/resolve-method.d.ts.map +1 -1
  222. package/dist/types/utils/encoding/hex.d.ts.map +1 -1
  223. package/dist/types/utils/promise/p-limit.d.ts.map +1 -1
  224. package/dist/types/version.d.ts +1 -1
  225. package/dist/types/wallets/in-app/core/authentication/guest.d.ts +12 -0
  226. package/dist/types/wallets/in-app/core/authentication/guest.d.ts.map +1 -0
  227. package/dist/types/wallets/in-app/core/authentication/types.d.ts +8 -4
  228. package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
  229. package/dist/types/wallets/in-app/core/wallet/types.d.ts +2 -1
  230. package/dist/types/wallets/in-app/core/wallet/types.d.ts.map +1 -1
  231. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts +4 -3
  232. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -1
  233. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
  234. package/dist/types/wallets/in-app/native/helpers/wallet/sss.d.ts.map +1 -1
  235. package/dist/types/wallets/in-app/native/native-connector.d.ts +1 -0
  236. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  237. package/dist/types/wallets/in-app/web/in-app.d.ts +13 -1
  238. package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
  239. package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts +3 -3
  240. package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts.map +1 -1
  241. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  242. package/dist/types/wallets/manager/index.d.ts.map +1 -1
  243. package/dist/types/wallets/types.d.ts +2 -1
  244. package/dist/types/wallets/types.d.ts.map +1 -1
  245. package/dist/types/wallets/wallet-connect/receiver/request-handlers/switch-chain.d.ts.map +1 -1
  246. package/package.json +10 -10
  247. package/src/contract/verification/index.ts +32 -34
  248. package/src/exports/utils.ts +9 -0
  249. package/src/react/core/hooks/connection/ConnectButtonProps.ts +7 -14
  250. package/src/react/core/hooks/pay/useBuyWithCryptoStatus.ts +7 -1
  251. package/src/react/core/hooks/pay/useBuyWithFiatStatus.ts +17 -1
  252. package/src/react/core/providers/invalidateWalletBalance.test.ts +1 -1
  253. package/src/react/core/providers/invalidateWalletBalance.ts +1 -1
  254. package/src/react/core/utils/walletIcon.ts +5 -0
  255. package/src/react/native/ui/components/WalletImage.tsx +3 -0
  256. package/src/react/native/ui/connect/InAppWalletUI.tsx +30 -0
  257. package/src/react/native/ui/connect/TokenListScreen.tsx +9 -12
  258. package/src/react/native/ui/icons/svgs.ts +2 -0
  259. package/src/react/web/ui/ConnectWallet/Details.tsx +15 -2
  260. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +8 -2
  261. package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +36 -38
  262. package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +34 -36
  263. package/src/react/web/ui/MediaRenderer/MediaRenderer.tsx +1 -1
  264. package/src/react/web/wallets/ecosystem/EcosystemWalletHeader.tsx +18 -20
  265. package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +16 -0
  266. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +128 -101
  267. package/src/react/web/wallets/shared/GuestLogin.tsx +159 -0
  268. package/src/react/web/wallets/shared/OTPLoginUI.tsx +3 -5
  269. package/src/react/web/wallets/shared/SocialLogin.tsx +1 -1
  270. package/src/react/web/wallets/shared/locale/de.ts +2 -1
  271. package/src/react/web/wallets/shared/locale/en.ts +1 -0
  272. package/src/react/web/wallets/shared/locale/es.ts +2 -1
  273. package/src/react/web/wallets/shared/locale/fr.ts +2 -1
  274. package/src/react/web/wallets/shared/locale/ja.ts +2 -1
  275. package/src/react/web/wallets/shared/locale/kr.ts +2 -1
  276. package/src/react/web/wallets/shared/locale/tl.ts +2 -1
  277. package/src/react/web/wallets/shared/locale/types.ts +1 -0
  278. package/src/react/web/wallets/shared/locale/vi.ts +1 -0
  279. package/src/react/web/wallets/shared/oauthSignIn.ts +6 -2
  280. package/src/transaction/resolve-method.test.ts +78 -0
  281. package/src/transaction/resolve-method.ts +14 -3
  282. package/src/utils/encoding/hex.ts +2 -3
  283. package/src/utils/promise/p-limit.ts +165 -165
  284. package/src/utils/signatures/sign-message.ts +3 -3
  285. package/src/version.ts +1 -1
  286. package/src/wallets/in-app/core/authentication/guest.ts +37 -0
  287. package/src/wallets/in-app/core/authentication/types.ts +9 -4
  288. package/src/wallets/in-app/core/wallet/types.ts +6 -1
  289. package/src/wallets/in-app/native/auth/native-auth.ts +34 -3
  290. package/src/wallets/in-app/native/helpers/api/fetchers.ts +1 -2
  291. package/src/wallets/in-app/native/helpers/wallet/sss.ts +1 -6
  292. package/src/wallets/in-app/native/native-connector.ts +42 -2
  293. package/src/wallets/in-app/web/in-app.ts +13 -1
  294. package/src/wallets/in-app/web/lib/auth/oauth.ts +3 -3
  295. package/src/wallets/in-app/web/lib/web-connector.ts +8 -0
  296. package/src/wallets/manager/index.ts +5 -0
  297. package/src/wallets/types.ts +2 -0
  298. package/src/wallets/wallet-connect/receiver/request-handlers/switch-chain.ts +2 -3
@@ -1,4 +1,5 @@
1
1
  import type { Abi, AbiFunction } from "abitype";
2
+ import { parseAbiItem } from "abitype";
2
3
  import { resolveContractAbi } from "../contract/actions/resolve-abi.js";
3
4
  import type { ThirdwebContract } from "../contract/contract.js";
4
5
 
@@ -22,9 +23,19 @@ import type { ThirdwebContract } from "../contract/contract.js";
22
23
  * ```
23
24
  * @contract
24
25
  */
25
- export function resolveMethod<abiFn extends AbiFunction>(method: string) {
26
- return async (contract: ThirdwebContract) => {
27
- const resolvedAbi = await resolveContractAbi<Abi>(contract);
26
+ export function resolveMethod<
27
+ abiFn extends AbiFunction,
28
+ TAbi extends Abi = Abi,
29
+ >(method: string) {
30
+ return async (contract: ThirdwebContract<TAbi>) => {
31
+ if (typeof method === "string" && method.startsWith("function ")) {
32
+ // we know it will be an abi function so we can cast it
33
+ return parseAbiItem(method) as AbiFunction;
34
+ }
35
+
36
+ const resolvedAbi = contract.abi?.length
37
+ ? contract.abi
38
+ : await resolveContractAbi<Abi>(contract);
28
39
  // we try to find the abiFunction in the abi
29
40
  const abiFunction = resolvedAbi.find((item) => {
30
41
  // if the item is not a function we can ignore it
@@ -436,9 +436,8 @@ export function numberToHex(
436
436
  );
437
437
  }
438
438
 
439
- const hex = `0x${(signed && value < 0
440
- ? (1n << BigInt(size * 8)) + BigInt(value)
441
- : value
439
+ const hex = `0x${(
440
+ signed && value < 0 ? (1n << BigInt(size * 8)) + BigInt(value) : value
442
441
  ).toString(16)}` as Hex;
443
442
  if (size) {
444
443
  return padHex(hex, { size }) as Hex;
@@ -1,105 +1,105 @@
1
1
  // source code of yocto-queue + modified to add types
2
2
  // https://github.com/sindresorhus/yocto-queue
3
3
  class Node<T> {
4
- value: T;
5
- next: Node<T> | undefined;
4
+ value: T;
5
+ next: Node<T> | undefined;
6
6
 
7
- constructor(value: T) {
8
- this.value = value;
9
- }
7
+ constructor(value: T) {
8
+ this.value = value;
9
+ }
10
10
  }
11
11
 
12
12
  class Queue<T> {
13
- private head: Node<T> | undefined;
14
- private tail: Node<T> | undefined;
15
- size: number;
16
-
17
- constructor() {
18
- this.clear();
19
- this.size = 0;
20
- }
21
-
22
- enqueue(value: T) {
23
- const node = new Node(value);
24
-
25
- if (this.head) {
26
- if (this.tail) {
27
- this.tail.next = node;
28
- }
29
- this.tail = node;
30
- } else {
31
- this.head = node;
32
- this.tail = node;
33
- }
34
-
35
- this.size++;
36
- }
37
-
38
- dequeue() {
39
- const current = this.head;
40
- if (!current) {
41
- return;
42
- }
43
-
44
- this.head = this.head?.next;
45
- this.size--;
46
- return current.value;
47
- }
48
-
49
- clear() {
50
- this.head = undefined;
51
- this.tail = undefined;
52
- this.size = 0;
53
- }
54
-
55
- *[Symbol.iterator]() {
56
- let current = this.head;
57
-
58
- while (current) {
59
- yield current.value;
60
- current = current.next;
61
- }
62
- }
13
+ private head: Node<T> | undefined;
14
+ private tail: Node<T> | undefined;
15
+ size: number;
16
+
17
+ constructor() {
18
+ this.clear();
19
+ this.size = 0;
20
+ }
21
+
22
+ enqueue(value: T) {
23
+ const node = new Node(value);
24
+
25
+ if (this.head) {
26
+ if (this.tail) {
27
+ this.tail.next = node;
28
+ }
29
+ this.tail = node;
30
+ } else {
31
+ this.head = node;
32
+ this.tail = node;
33
+ }
34
+
35
+ this.size++;
36
+ }
37
+
38
+ dequeue() {
39
+ const current = this.head;
40
+ if (!current) {
41
+ return;
42
+ }
43
+
44
+ this.head = this.head?.next;
45
+ this.size--;
46
+ return current.value;
47
+ }
48
+
49
+ clear() {
50
+ this.head = undefined;
51
+ this.tail = undefined;
52
+ this.size = 0;
53
+ }
54
+
55
+ *[Symbol.iterator]() {
56
+ let current = this.head;
57
+
58
+ while (current) {
59
+ yield current.value;
60
+ current = current.next;
61
+ }
62
+ }
63
63
  }
64
64
 
65
65
  // source code of p-limit - https://github.com/sindresorhus/p-limit/ + modified to add types
66
66
  const AsyncResource = {
67
- bind(fn: () => void, _type?: any, thisArg?: any) {
68
- return fn.bind(thisArg);
69
- },
67
+ bind(fn: () => void, _type?: any, thisArg?: any) {
68
+ return fn.bind(thisArg);
69
+ },
70
70
  };
71
71
 
72
72
  type LimitFunctionCallSignature = {
73
- /**
74
- * @param fn - Promise-returning/async function.
75
- * @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
76
- * @returns The promise returned by calling `fn(...arguments)`.
77
- */
78
- <Arguments extends unknown[], ReturnType>(
79
- fn: (...arguments_: Arguments) => PromiseLike<ReturnType> | ReturnType,
80
- ...arguments_: Arguments
81
- ): Promise<ReturnType>;
73
+ /**
74
+ * @param fn - Promise-returning/async function.
75
+ * @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
76
+ * @returns The promise returned by calling `fn(...arguments)`.
77
+ */
78
+ <Arguments extends unknown[], ReturnType>(
79
+ fn: (...arguments_: Arguments) => PromiseLike<ReturnType> | ReturnType,
80
+ ...arguments_: Arguments
81
+ ): Promise<ReturnType>;
82
82
  };
83
83
 
84
84
  export type LimitFunction = {
85
- /**
86
- * The number of promises that are currently running.
87
- */
88
- readonly activeCount: number;
89
-
90
- /**
91
- * The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
92
- */
93
- readonly pendingCount: number;
94
-
95
- /**
96
- * Discard pending promises that are waiting to run.
97
- *
98
- * This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
99
- *
100
- * Note: This does not cancel promises that are already running.
101
- */
102
- clearQueue: () => void;
85
+ /**
86
+ * The number of promises that are currently running.
87
+ */
88
+ readonly activeCount: number;
89
+
90
+ /**
91
+ * The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
92
+ */
93
+ readonly pendingCount: number;
94
+
95
+ /**
96
+ * Discard pending promises that are waiting to run.
97
+ *
98
+ * This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
99
+ *
100
+ * Note: This does not cancel promises that are already running.
101
+ */
102
+ clearQueue: () => void;
103
103
  } & LimitFunctionCallSignature;
104
104
 
105
105
  type Fn = () => void;
@@ -110,84 +110,84 @@ type Fn = () => void;
110
110
  * @internal
111
111
  */
112
112
  export function pLimit(concurrency: number): LimitFunction {
113
- if (
114
- !(
115
- (Number.isInteger(concurrency) ||
116
- concurrency === Number.POSITIVE_INFINITY) &&
117
- concurrency > 0
118
- )
119
- ) {
120
- throw new TypeError("Expected `concurrency` to be a number from 1 and up");
121
- }
122
-
123
- const queue = new Queue<Fn>();
124
- let activeCount = 0;
125
-
126
- const next = () => {
127
- activeCount--;
128
-
129
- if (queue.size > 0) {
130
- const fn = queue.dequeue();
131
- if (fn) {
132
- fn();
133
- }
134
- }
135
- };
136
-
137
- const run = async (function_: Fn, resolve: any, arguments_: any[]) => {
138
- activeCount++;
139
-
140
- // @ts-ignore
141
- const result = (async () => function_(...arguments_))();
142
-
143
- resolve(result);
144
-
145
- try {
146
- await result;
147
- } catch {}
148
-
149
- next();
150
- };
151
-
152
- const enqueue = (function_: Fn, resolve: any, arguments_: any[]) => {
153
- queue.enqueue(
154
- AsyncResource.bind(run.bind(undefined, function_, resolve, arguments_)),
155
- );
156
-
157
- (async () => {
158
- // This function needs to wait until the next microtask before comparing
159
- // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
160
- // when the run function is dequeued and called. The comparison in the if-statement
161
- // needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
162
- await Promise.resolve();
163
-
164
- if (activeCount < concurrency && queue.size > 0) {
165
- const fn = queue.dequeue();
166
- if (fn) {
167
- fn();
168
- }
169
- }
170
- })();
171
- };
172
-
173
- const generator: LimitFunctionCallSignature = (function_, ...arguments_) =>
174
- new Promise((resolve) => {
175
- enqueue(function_, resolve, arguments_);
176
- });
177
-
178
- Object.defineProperties(generator, {
179
- activeCount: {
180
- get: () => activeCount,
181
- },
182
- pendingCount: {
183
- get: () => queue.size,
184
- },
185
- clearQueue: {
186
- value() {
187
- queue.clear();
188
- },
189
- },
190
- });
191
-
192
- return generator as LimitFunction;
113
+ if (
114
+ !(
115
+ (Number.isInteger(concurrency) ||
116
+ concurrency === Number.POSITIVE_INFINITY) &&
117
+ concurrency > 0
118
+ )
119
+ ) {
120
+ throw new TypeError("Expected `concurrency` to be a number from 1 and up");
121
+ }
122
+
123
+ const queue = new Queue<Fn>();
124
+ let activeCount = 0;
125
+
126
+ const next = () => {
127
+ activeCount--;
128
+
129
+ if (queue.size > 0) {
130
+ const fn = queue.dequeue();
131
+ if (fn) {
132
+ fn();
133
+ }
134
+ }
135
+ };
136
+
137
+ const run = async (function_: Fn, resolve: any, arguments_: any[]) => {
138
+ activeCount++;
139
+
140
+ // @ts-ignore
141
+ const result = (async () => function_(...arguments_))();
142
+
143
+ resolve(result);
144
+
145
+ try {
146
+ await result;
147
+ } catch {}
148
+
149
+ next();
150
+ };
151
+
152
+ const enqueue = (function_: Fn, resolve: any, arguments_: any[]) => {
153
+ queue.enqueue(
154
+ AsyncResource.bind(run.bind(undefined, function_, resolve, arguments_)),
155
+ );
156
+
157
+ (async () => {
158
+ // This function needs to wait until the next microtask before comparing
159
+ // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
160
+ // when the run function is dequeued and called. The comparison in the if-statement
161
+ // needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
162
+ await Promise.resolve();
163
+
164
+ if (activeCount < concurrency && queue.size > 0) {
165
+ const fn = queue.dequeue();
166
+ if (fn) {
167
+ fn();
168
+ }
169
+ }
170
+ })();
171
+ };
172
+
173
+ const generator: LimitFunctionCallSignature = (function_, ...arguments_) =>
174
+ new Promise((resolve) => {
175
+ enqueue(function_, resolve, arguments_);
176
+ });
177
+
178
+ Object.defineProperties(generator, {
179
+ activeCount: {
180
+ get: () => activeCount,
181
+ },
182
+ pendingCount: {
183
+ get: () => queue.size,
184
+ },
185
+ clearQueue: {
186
+ value() {
187
+ queue.clear();
188
+ },
189
+ },
190
+ });
191
+
192
+ return generator as LimitFunction;
193
193
  }
@@ -62,10 +62,10 @@ export function signMessage(
62
62
  const { message, privateKey } = options;
63
63
  const signature = sign({ hash: hashMessage(message), privateKey });
64
64
  return signatureToHex(signature);
65
- } else if ("account" in options) {
65
+ }
66
+ if ("account" in options) {
66
67
  const { message, account } = options;
67
68
  return account.signMessage({ message });
68
- } else {
69
- throw new Error("Either privateKey or account is required");
70
69
  }
70
+ throw new Error("Either privateKey or account is required");
71
71
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.56.0-nightly-a5e605c65e360a9d3d2e553d6783e58582b50a70-20240917000331";
1
+ export const version = "5.57.0-nightly-cf1683c3feea6eb36ac6b902a1dd64c8ed8803c9-20240918000340";
@@ -0,0 +1,37 @@
1
+ import type { ThirdwebClient } from "../../../../client/client.js";
2
+ import { getClientFetch } from "../../../../utils/fetch.js";
3
+ import type { Ecosystem } from "../../web/types.js";
4
+ import { getLoginCallbackUrl } from "./getLoginPath.js";
5
+ import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
6
+
7
+ /**
8
+ * Does no real authentication, just issues a temporary token for the user.
9
+ * @internal
10
+ */
11
+ export async function guestAuthenticate(args: {
12
+ client: ThirdwebClient;
13
+ ecosystem?: Ecosystem;
14
+ }): Promise<AuthStoredTokenWithCookieReturnType> {
15
+ const clientFetch = getClientFetch(args.client, args.ecosystem);
16
+ const authResult = await (async () => {
17
+ const path = getLoginCallbackUrl({
18
+ authOption: "guest",
19
+ client: args.client,
20
+ ecosystem: args.ecosystem,
21
+ });
22
+ const res = await clientFetch(`${path}`, {
23
+ method: "POST",
24
+ headers: {
25
+ "Content-Type": "application/json",
26
+ },
27
+ body: JSON.stringify({
28
+ sessionId: "guest",
29
+ }),
30
+ });
31
+
32
+ if (!res.ok) throw new Error("Failed to generate guest account");
33
+
34
+ return (await res.json()) satisfies AuthStoredTokenWithCookieReturnType;
35
+ })();
36
+ return authResult;
37
+ }
@@ -3,7 +3,7 @@ import type { ThirdwebClient } from "../../../../client/client.js";
3
3
  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
- import type { AuthOption, SocialAuthOption } from "../../../types.js";
6
+ import type { AuthOption, OAuthOption } from "../../../types.js";
7
7
  import type { Ecosystem } from "../../web/types.js";
8
8
 
9
9
  export type MultiStepAuthProviderType =
@@ -26,7 +26,7 @@ export type MultiStepAuthArgsType = MultiStepAuthProviderType & {
26
26
 
27
27
  export type SingleStepAuthArgsType =
28
28
  | {
29
- strategy: SocialAuthOption;
29
+ strategy: OAuthOption;
30
30
  openedWindow?: Window;
31
31
  closeOpenedWindow?: (window: Window) => void;
32
32
  redirectUrl?: string;
@@ -52,6 +52,10 @@ export type SingleStepAuthArgsType =
52
52
  strategy: "wallet";
53
53
  wallet: Wallet;
54
54
  chain: Chain;
55
+ }
56
+ | {
57
+ strategy: "guest";
58
+ client: ThirdwebClient;
55
59
  };
56
60
 
57
61
  export type AuthArgsType = (MultiStepAuthArgsType | SingleStepAuthArgsType) & {
@@ -68,6 +72,7 @@ export enum RecoveryShareManagement {
68
72
  // TODO: remove usage of enums, instead use object with as const
69
73
  export enum AuthProvider {
70
74
  COGNITO = "Cognito",
75
+ GUEST = "Guest",
71
76
  GOOGLE = "Google",
72
77
  EMAIL_OTP = "EmailOtp",
73
78
  CUSTOM_JWT = "CustomJWT",
@@ -82,8 +87,8 @@ export enum AuthProvider {
82
87
  TELEGRAM = "Telegram",
83
88
  }
84
89
 
85
- export type OauthOption = {
86
- strategy: SocialAuthOption;
90
+ export type OAuthRedirectObject = {
91
+ strategy: OAuthOption;
87
92
  redirectUrl: string;
88
93
  };
89
94
 
@@ -1,7 +1,11 @@
1
1
  import type { Chain } from "../../../../chains/types.js";
2
2
  import type { ThirdwebClient } from "../../../../client/client.js";
3
3
  import type { SmartWalletOptions } from "../../../smart/types.js";
4
- import type { AuthOption, SocialAuthOption } from "../../../types.js";
4
+ import type {
5
+ AuthOption,
6
+ OAuthOption,
7
+ SocialAuthOption,
8
+ } from "../../../types.js";
5
9
  import type {
6
10
  AuthStoredTokenWithCookieReturnType,
7
11
  MultiStepAuthArgsType,
@@ -24,6 +28,7 @@ export type InAppWalletAutoConnectOptions = {
24
28
  };
25
29
 
26
30
  export type InAppWalletSocialAuth = SocialAuthOption;
31
+ export type InAppWalletOAuth = OAuthOption;
27
32
  export type InAppWalletAuth = AuthOption;
28
33
 
29
34
  export type InAppWalletCreationOptions =
@@ -3,11 +3,12 @@ import type { Chain } from "../../../../chains/types.js";
3
3
  import type { ThirdwebClient } from "../../../../client/client.js";
4
4
  import type { Wallet } from "../../../interfaces/wallet.js";
5
5
  import { getLoginUrl } from "../../core/authentication/getLoginPath.js";
6
+ import { guestAuthenticate } from "../../core/authentication/guest.js";
6
7
  import { siweAuthenticate } from "../../core/authentication/siwe.js";
7
8
  import type {
8
9
  AuthStoredTokenWithCookieReturnType,
9
10
  MultiStepAuthArgsType,
10
- OauthOption,
11
+ OAuthRedirectObject,
11
12
  } from "../../core/authentication/types.js";
12
13
  import { verifyOtp } from "../../web/lib/auth/otp.js";
13
14
  import type { Ecosystem } from "../../web/types.js";
@@ -53,7 +54,7 @@ export async function otpLogin(
53
54
  }
54
55
 
55
56
  export async function authenticate(
56
- auth: OauthOption,
57
+ auth: OAuthRedirectObject,
57
58
  client: ThirdwebClient,
58
59
  ): Promise<AuthStoredTokenWithCookieReturnType> {
59
60
  const loginUrl = getLoginUrl({
@@ -98,7 +99,7 @@ export async function authenticate(
98
99
  }
99
100
 
100
101
  export async function socialLogin(
101
- auth: OauthOption,
102
+ auth: OAuthRedirectObject,
102
103
  client: ThirdwebClient,
103
104
  ): Promise<AuthStoredTokenWithCookieReturnType> {
104
105
  const { storedToken } = await authenticate(auth, client);
@@ -158,6 +159,36 @@ export async function siweLogin(
158
159
  }
159
160
  }
160
161
 
162
+ export async function guestLogin(
163
+ client: ThirdwebClient,
164
+ ecosystem?: Ecosystem,
165
+ ): Promise<AuthStoredTokenWithCookieReturnType> {
166
+ const { storedToken } = await guestAuthenticate({
167
+ client,
168
+ ecosystem,
169
+ });
170
+ try {
171
+ const toStoreToken: AuthStoredTokenWithCookieReturnType["storedToken"] = {
172
+ jwtToken: storedToken.jwtToken,
173
+ authDetails: storedToken.authDetails,
174
+ authProvider: storedToken.authProvider,
175
+ developerClientId: storedToken.developerClientId,
176
+ cookieString: storedToken.cookieString,
177
+ // we should always store the jwt cookie since there's no concept of cookie in react native
178
+ shouldStoreCookieString: true,
179
+ isNewUser: storedToken.isNewUser,
180
+ };
181
+
182
+ await postAuth({ storedToken: toStoreToken, client });
183
+
184
+ return { storedToken };
185
+ } catch (e) {
186
+ throw new Error(
187
+ createErrorMessage("Malformed response from post authentication", e),
188
+ );
189
+ }
190
+ }
191
+
161
192
  export async function customJwt(
162
193
  authOptions: { jwt: string; password: string },
163
194
  client: ThirdwebClient,
@@ -91,9 +91,8 @@ export const authFetchEmbeddedWalletUser = async (
91
91
  params,
92
92
  retries - 1,
93
93
  );
94
- } else {
95
- throw e;
96
94
  }
95
+ throw e;
97
96
  }
98
97
  };
99
98
 
@@ -206,12 +206,7 @@ function getRNG(type) {
206
206
  size = 32;
207
207
  elems = Math.ceil(bits / 32);
208
208
  while (str === null) {
209
- str = construct(
210
- bits,
211
- randomBytesBuffer(elems),
212
- radix,
213
- size,
214
- );
209
+ str = construct(bits, randomBytesBuffer(elems), radix, size);
215
210
  }
216
211
 
217
212
  return str;