thirdweb 5.56.0 → 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 (263) 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/utils/walletIcon.js +4 -1
  4. package/dist/cjs/react/core/utils/walletIcon.js.map +1 -1
  5. package/dist/cjs/react/native/ui/components/WalletImage.js +2 -0
  6. package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
  7. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +21 -1
  8. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -1
  9. package/dist/cjs/react/native/ui/connect/TokenListScreen.js +2 -1
  10. package/dist/cjs/react/native/ui/connect/TokenListScreen.js.map +1 -1
  11. package/dist/cjs/react/native/ui/icons/svgs.js +2 -1
  12. package/dist/cjs/react/native/ui/icons/svgs.js.map +1 -1
  13. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +15 -2
  14. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  15. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +12 -12
  16. package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  17. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js +5 -5
  18. package/dist/cjs/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  19. package/dist/cjs/react/web/ui/MediaRenderer/MediaRenderer.js +1 -1
  20. package/dist/cjs/react/web/ui/MediaRenderer/MediaRenderer.js.map +1 -1
  21. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletHeader.js +3 -3
  22. package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletHeader.js.map +1 -1
  23. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +4 -0
  24. package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  25. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +38 -19
  26. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  27. package/dist/cjs/react/web/wallets/shared/GuestLogin.js +81 -0
  28. package/dist/cjs/react/web/wallets/shared/GuestLogin.js.map +1 -0
  29. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +1 -1
  30. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  31. package/dist/cjs/react/web/wallets/shared/SocialLogin.js +1 -1
  32. package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
  33. package/dist/cjs/react/web/wallets/shared/locale/de.js +2 -1
  34. package/dist/cjs/react/web/wallets/shared/locale/de.js.map +1 -1
  35. package/dist/cjs/react/web/wallets/shared/locale/en.js +1 -0
  36. package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
  37. package/dist/cjs/react/web/wallets/shared/locale/es.js +2 -1
  38. package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
  39. package/dist/cjs/react/web/wallets/shared/locale/fr.js +2 -1
  40. package/dist/cjs/react/web/wallets/shared/locale/fr.js.map +1 -1
  41. package/dist/cjs/react/web/wallets/shared/locale/ja.js +2 -1
  42. package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
  43. package/dist/cjs/react/web/wallets/shared/locale/kr.js +2 -1
  44. package/dist/cjs/react/web/wallets/shared/locale/kr.js.map +1 -1
  45. package/dist/cjs/react/web/wallets/shared/locale/tl.js +2 -1
  46. package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
  47. package/dist/cjs/react/web/wallets/shared/locale/vi.js +1 -0
  48. package/dist/cjs/react/web/wallets/shared/locale/vi.js.map +1 -1
  49. package/dist/cjs/react/web/wallets/shared/oauthSignIn.js +1 -0
  50. package/dist/cjs/react/web/wallets/shared/oauthSignIn.js.map +1 -1
  51. package/dist/cjs/utils/encoding/hex.js +1 -3
  52. package/dist/cjs/utils/encoding/hex.js.map +1 -1
  53. package/dist/cjs/utils/promise/p-limit.js.map +1 -1
  54. package/dist/cjs/utils/signatures/sign-message.js +2 -4
  55. package/dist/cjs/utils/signatures/sign-message.js.map +1 -1
  56. package/dist/cjs/version.js +1 -1
  57. package/dist/cjs/version.js.map +1 -1
  58. package/dist/cjs/wallets/in-app/core/authentication/guest.js +33 -0
  59. package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -0
  60. package/dist/cjs/wallets/in-app/core/authentication/types.js +1 -0
  61. package/dist/cjs/wallets/in-app/core/authentication/types.js.map +1 -1
  62. package/dist/cjs/wallets/in-app/native/auth/native-auth.js +25 -0
  63. package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -1
  64. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js +1 -3
  65. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  66. package/dist/cjs/wallets/in-app/native/helpers/wallet/sss.js.map +1 -1
  67. package/dist/cjs/wallets/in-app/native/native-connector.js +32 -0
  68. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  69. package/dist/cjs/wallets/in-app/web/in-app.js +13 -1
  70. package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
  71. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +8 -0
  72. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  73. package/dist/cjs/wallets/manager/index.js +5 -0
  74. package/dist/cjs/wallets/manager/index.js.map +1 -1
  75. package/dist/cjs/wallets/types.js +1 -0
  76. package/dist/cjs/wallets/types.js.map +1 -1
  77. package/dist/cjs/wallets/wallet-connect/receiver/request-handlers/switch-chain.js +2 -4
  78. package/dist/cjs/wallets/wallet-connect/receiver/request-handlers/switch-chain.js.map +1 -1
  79. package/dist/esm/contract/verification/index.js +29 -33
  80. package/dist/esm/contract/verification/index.js.map +1 -1
  81. package/dist/esm/react/core/utils/walletIcon.js +3 -0
  82. package/dist/esm/react/core/utils/walletIcon.js.map +1 -1
  83. package/dist/esm/react/native/ui/components/WalletImage.js +3 -1
  84. package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -1
  85. package/dist/esm/react/native/ui/connect/InAppWalletUI.js +21 -1
  86. package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -1
  87. package/dist/esm/react/native/ui/connect/TokenListScreen.js +2 -1
  88. package/dist/esm/react/native/ui/connect/TokenListScreen.js.map +1 -1
  89. package/dist/esm/react/native/ui/icons/svgs.js +1 -0
  90. package/dist/esm/react/native/ui/icons/svgs.js.map +1 -1
  91. package/dist/esm/react/web/ui/ConnectWallet/Details.js +15 -2
  92. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  93. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +12 -12
  94. package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
  95. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js +6 -6
  96. package/dist/esm/react/web/ui/ConnectWallet/screens/TokenSelector.js.map +1 -1
  97. package/dist/esm/react/web/ui/MediaRenderer/MediaRenderer.js +1 -1
  98. package/dist/esm/react/web/ui/MediaRenderer/MediaRenderer.js.map +1 -1
  99. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletHeader.js +3 -3
  100. package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletHeader.js.map +1 -1
  101. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +4 -0
  102. package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
  103. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +38 -19
  104. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  105. package/dist/esm/react/web/wallets/shared/GuestLogin.js +78 -0
  106. package/dist/esm/react/web/wallets/shared/GuestLogin.js.map +1 -0
  107. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +1 -1
  108. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  109. package/dist/esm/react/web/wallets/shared/SocialLogin.js +1 -1
  110. package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
  111. package/dist/esm/react/web/wallets/shared/locale/de.js +2 -1
  112. package/dist/esm/react/web/wallets/shared/locale/de.js.map +1 -1
  113. package/dist/esm/react/web/wallets/shared/locale/en.js +1 -0
  114. package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
  115. package/dist/esm/react/web/wallets/shared/locale/es.js +2 -1
  116. package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
  117. package/dist/esm/react/web/wallets/shared/locale/fr.js +2 -1
  118. package/dist/esm/react/web/wallets/shared/locale/fr.js.map +1 -1
  119. package/dist/esm/react/web/wallets/shared/locale/ja.js +2 -1
  120. package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
  121. package/dist/esm/react/web/wallets/shared/locale/kr.js +2 -1
  122. package/dist/esm/react/web/wallets/shared/locale/kr.js.map +1 -1
  123. package/dist/esm/react/web/wallets/shared/locale/tl.js +2 -1
  124. package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
  125. package/dist/esm/react/web/wallets/shared/locale/vi.js +1 -0
  126. package/dist/esm/react/web/wallets/shared/locale/vi.js.map +1 -1
  127. package/dist/esm/react/web/wallets/shared/oauthSignIn.js +1 -0
  128. package/dist/esm/react/web/wallets/shared/oauthSignIn.js.map +1 -1
  129. package/dist/esm/utils/encoding/hex.js +1 -3
  130. package/dist/esm/utils/encoding/hex.js.map +1 -1
  131. package/dist/esm/utils/promise/p-limit.js.map +1 -1
  132. package/dist/esm/utils/signatures/sign-message.js +2 -4
  133. package/dist/esm/utils/signatures/sign-message.js.map +1 -1
  134. package/dist/esm/version.js +1 -1
  135. package/dist/esm/version.js.map +1 -1
  136. package/dist/esm/wallets/in-app/core/authentication/guest.js +30 -0
  137. package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -0
  138. package/dist/esm/wallets/in-app/core/authentication/types.js +1 -0
  139. package/dist/esm/wallets/in-app/core/authentication/types.js.map +1 -1
  140. package/dist/esm/wallets/in-app/native/auth/native-auth.js +24 -0
  141. package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -1
  142. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js +1 -3
  143. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  144. package/dist/esm/wallets/in-app/native/helpers/wallet/sss.js.map +1 -1
  145. package/dist/esm/wallets/in-app/native/native-connector.js +33 -1
  146. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  147. package/dist/esm/wallets/in-app/web/in-app.js +13 -1
  148. package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
  149. package/dist/esm/wallets/in-app/web/lib/web-connector.js +8 -0
  150. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  151. package/dist/esm/wallets/manager/index.js +5 -0
  152. package/dist/esm/wallets/manager/index.js.map +1 -1
  153. package/dist/esm/wallets/types.js +1 -0
  154. package/dist/esm/wallets/types.js.map +1 -1
  155. package/dist/esm/wallets/wallet-connect/receiver/request-handlers/switch-chain.js +2 -4
  156. package/dist/esm/wallets/wallet-connect/receiver/request-handlers/switch-chain.js.map +1 -1
  157. package/dist/types/contract/verification/index.d.ts.map +1 -1
  158. package/dist/types/react/core/utils/storage.d.ts +1 -1
  159. package/dist/types/react/core/utils/storage.d.ts.map +1 -1
  160. package/dist/types/react/core/utils/walletIcon.d.ts +2 -1
  161. package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -1
  162. package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
  163. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
  164. package/dist/types/react/native/ui/connect/TokenListScreen.d.ts.map +1 -1
  165. package/dist/types/react/native/ui/icons/svgs.d.ts +1 -0
  166. package/dist/types/react/native/ui/icons/svgs.d.ts.map +1 -1
  167. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  168. package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
  169. package/dist/types/react/web/wallets/ecosystem/EcosystemWalletHeader.d.ts.map +1 -1
  170. package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
  171. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +3 -0
  172. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  173. package/dist/types/react/web/wallets/shared/GuestLogin.d.ts +19 -0
  174. package/dist/types/react/web/wallets/shared/GuestLogin.d.ts.map +1 -0
  175. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
  176. package/dist/types/react/web/wallets/shared/locale/de.d.ts +1 -0
  177. package/dist/types/react/web/wallets/shared/locale/de.d.ts.map +1 -1
  178. package/dist/types/react/web/wallets/shared/locale/en.d.ts +1 -0
  179. package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
  180. package/dist/types/react/web/wallets/shared/locale/es.d.ts +1 -0
  181. package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
  182. package/dist/types/react/web/wallets/shared/locale/fr.d.ts +1 -0
  183. package/dist/types/react/web/wallets/shared/locale/fr.d.ts.map +1 -1
  184. package/dist/types/react/web/wallets/shared/locale/ja.d.ts +1 -0
  185. package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
  186. package/dist/types/react/web/wallets/shared/locale/kr.d.ts +1 -0
  187. package/dist/types/react/web/wallets/shared/locale/kr.d.ts.map +1 -1
  188. package/dist/types/react/web/wallets/shared/locale/tl.d.ts +1 -0
  189. package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
  190. package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -0
  191. package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
  192. package/dist/types/react/web/wallets/shared/locale/vi.d.ts +1 -0
  193. package/dist/types/react/web/wallets/shared/locale/vi.d.ts.map +1 -1
  194. package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts.map +1 -1
  195. package/dist/types/utils/encoding/hex.d.ts.map +1 -1
  196. package/dist/types/utils/promise/p-limit.d.ts.map +1 -1
  197. package/dist/types/version.d.ts +1 -1
  198. package/dist/types/version.d.ts.map +1 -1
  199. package/dist/types/wallets/in-app/core/authentication/guest.d.ts +12 -0
  200. package/dist/types/wallets/in-app/core/authentication/guest.d.ts.map +1 -0
  201. package/dist/types/wallets/in-app/core/authentication/types.d.ts +8 -4
  202. package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
  203. package/dist/types/wallets/in-app/core/wallet/types.d.ts +2 -1
  204. package/dist/types/wallets/in-app/core/wallet/types.d.ts.map +1 -1
  205. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts +4 -3
  206. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -1
  207. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
  208. package/dist/types/wallets/in-app/native/helpers/wallet/sss.d.ts.map +1 -1
  209. package/dist/types/wallets/in-app/native/native-connector.d.ts +1 -0
  210. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  211. package/dist/types/wallets/in-app/web/in-app.d.ts +13 -1
  212. package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
  213. package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts +3 -3
  214. package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts.map +1 -1
  215. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  216. package/dist/types/wallets/manager/index.d.ts.map +1 -1
  217. package/dist/types/wallets/types.d.ts +2 -1
  218. package/dist/types/wallets/types.d.ts.map +1 -1
  219. package/dist/types/wallets/wallet-connect/receiver/request-handlers/switch-chain.d.ts.map +1 -1
  220. package/package.json +10 -10
  221. package/src/contract/verification/index.ts +32 -34
  222. package/src/react/core/utils/walletIcon.ts +5 -0
  223. package/src/react/native/ui/components/WalletImage.tsx +3 -0
  224. package/src/react/native/ui/connect/InAppWalletUI.tsx +30 -0
  225. package/src/react/native/ui/connect/TokenListScreen.tsx +9 -12
  226. package/src/react/native/ui/icons/svgs.ts +2 -0
  227. package/src/react/web/ui/ConnectWallet/Details.tsx +15 -2
  228. package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +36 -38
  229. package/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx +34 -36
  230. package/src/react/web/ui/MediaRenderer/MediaRenderer.tsx +1 -1
  231. package/src/react/web/wallets/ecosystem/EcosystemWalletHeader.tsx +18 -20
  232. package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +16 -0
  233. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +128 -101
  234. package/src/react/web/wallets/shared/GuestLogin.tsx +159 -0
  235. package/src/react/web/wallets/shared/OTPLoginUI.tsx +3 -5
  236. package/src/react/web/wallets/shared/SocialLogin.tsx +1 -1
  237. package/src/react/web/wallets/shared/locale/de.ts +2 -1
  238. package/src/react/web/wallets/shared/locale/en.ts +1 -0
  239. package/src/react/web/wallets/shared/locale/es.ts +2 -1
  240. package/src/react/web/wallets/shared/locale/fr.ts +2 -1
  241. package/src/react/web/wallets/shared/locale/ja.ts +2 -1
  242. package/src/react/web/wallets/shared/locale/kr.ts +2 -1
  243. package/src/react/web/wallets/shared/locale/tl.ts +2 -1
  244. package/src/react/web/wallets/shared/locale/types.ts +1 -0
  245. package/src/react/web/wallets/shared/locale/vi.ts +1 -0
  246. package/src/react/web/wallets/shared/oauthSignIn.ts +6 -2
  247. package/src/utils/encoding/hex.ts +2 -3
  248. package/src/utils/promise/p-limit.ts +165 -165
  249. package/src/utils/signatures/sign-message.ts +3 -3
  250. package/src/version.ts +1 -1
  251. package/src/wallets/in-app/core/authentication/guest.ts +37 -0
  252. package/src/wallets/in-app/core/authentication/types.ts +9 -4
  253. package/src/wallets/in-app/core/wallet/types.ts +6 -1
  254. package/src/wallets/in-app/native/auth/native-auth.ts +34 -3
  255. package/src/wallets/in-app/native/helpers/api/fetchers.ts +1 -2
  256. package/src/wallets/in-app/native/helpers/wallet/sss.ts +1 -6
  257. package/src/wallets/in-app/native/native-connector.ts +42 -2
  258. package/src/wallets/in-app/web/in-app.ts +13 -1
  259. package/src/wallets/in-app/web/lib/auth/oauth.ts +3 -3
  260. package/src/wallets/in-app/web/lib/web-connector.ts +8 -0
  261. package/src/wallets/manager/index.ts +5 -0
  262. package/src/wallets/types.ts +2 -0
  263. package/src/wallets/wallet-connect/receiver/request-handlers/switch-chain.ts +2 -3
@@ -54,5 +54,6 @@ export default {
54
54
  signInWithPhone: "電話番号でサインイン",
55
55
  phoneRequired: "電話番号は必須です",
56
56
  passkey: "パスキー",
57
- linkWallet: "Link a Wallet",
57
+ linkWallet: "ウォレットをリンクする",
58
+ loginAsGuest: "ゲストとしてログイン",
58
59
  } satisfies InAppWalletLocale;
@@ -52,5 +52,6 @@ export default {
52
52
  signInWithPhone: "전화번호로 로그인",
53
53
  phoneRequired: "전화번호가 필요합니다",
54
54
  passkey: "비밀번호",
55
- linkWallet: "Link a Wallet",
55
+ linkWallet: "지갑 연결",
56
+ loginAsGuest: "게스트로 로그인",
56
57
  } satisfies InAppWalletLocale;
@@ -55,5 +55,6 @@ export default {
55
55
  signInWithPhone: "Mag-login gamit ang numero ng telepono",
56
56
  phoneRequired: "Kinakailangan ang numero ng telepono",
57
57
  passkey: "Passkey",
58
- linkWallet: "Link a Wallet",
58
+ linkWallet: "Mag-link ng Wallet",
59
+ loginAsGuest: "Mag-login bilang bisita",
59
60
  } satisfies InAppWalletLocale;
@@ -50,5 +50,6 @@ export type InAppWalletLocale = {
50
50
  submitEmail: string;
51
51
  maxAccountsExceeded: string;
52
52
  passkey: string;
53
+ loginAsGuest: string;
53
54
  linkWallet: string;
54
55
  };
@@ -56,4 +56,5 @@ export default {
56
56
  phoneRequired: "Vui lòng nhập số điện thoại",
57
57
  passkey: "Passkey",
58
58
  linkWallet: "Link a Wallet",
59
+ loginAsGuest: "Đăng nhập với tư cách khách",
59
60
  } satisfies InAppWalletLocale;
@@ -1,6 +1,9 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
2
  import { getLoginUrl } from "../../../../wallets/in-app/core/authentication/getLoginPath.js";
3
- import type { InAppWalletSocialAuth } from "../../../../wallets/in-app/core/wallet/types.js";
3
+ import type {
4
+ InAppWalletOAuth,
5
+ InAppWalletSocialAuth,
6
+ } from "../../../../wallets/in-app/core/wallet/types.js";
4
7
  import type { Ecosystem } from "../../../../wallets/in-app/web/types.js";
5
8
  import type { Theme } from "../../../core/design-system/index.js";
6
9
 
@@ -25,7 +28,7 @@ function getWidthAndHeight(authOption: InAppWalletSocialAuth) {
25
28
  }
26
29
 
27
30
  function getOauthLoginPath(
28
- authOption: InAppWalletSocialAuth,
31
+ authOption: InAppWalletOAuth,
29
32
  client: ThirdwebClient,
30
33
  ecosystem?: Ecosystem,
31
34
  ) {
@@ -37,6 +40,7 @@ function getOauthLoginPath(
37
40
  case "telegram":
38
41
  case "line":
39
42
  case "x":
43
+ case "guest":
40
44
  case "discord":
41
45
  return getLoginUrl({ authOption, client, ecosystem });
42
46
  default:
@@ -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";
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;