thirdweb 5.61.6 → 5.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/dist/cjs/exports/extensions/erc1155.js +3 -1
  2. package/dist/cjs/exports/extensions/erc1155.js.map +1 -1
  3. package/dist/cjs/extensions/erc1155/write/mintToBatch.js +79 -0
  4. package/dist/cjs/extensions/erc1155/write/mintToBatch.js.map +1 -0
  5. package/dist/cjs/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js +15 -4
  6. package/dist/cjs/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js.map +1 -1
  7. package/dist/cjs/react/native/ui/components/WalletImage.js +3 -2
  8. package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
  9. package/dist/cjs/react/native/ui/connect/ConnectModal.js +6 -6
  10. package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
  11. package/dist/cjs/react/native/ui/connect/ConnectedButton.js +2 -2
  12. package/dist/cjs/react/native/ui/connect/ConnectedButton.js.map +1 -1
  13. package/dist/cjs/react/native/ui/connect/ConnectedModal.js +3 -3
  14. package/dist/cjs/react/native/ui/connect/ConnectedModal.js.map +1 -1
  15. package/dist/cjs/react/native/ui/connect/ReceiveScreen.js +2 -2
  16. package/dist/cjs/react/native/ui/connect/ReceiveScreen.js.map +1 -1
  17. package/dist/cjs/react/web/wallets/in-app/WalletAuth.js +8 -0
  18. package/dist/cjs/react/web/wallets/in-app/WalletAuth.js.map +1 -1
  19. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -0
  20. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  21. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +11 -16
  22. package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  23. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +7 -0
  24. package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  25. package/dist/cjs/react/web/wallets/shared/SocialLogin.js +9 -12
  26. package/dist/cjs/react/web/wallets/shared/SocialLogin.js.map +1 -1
  27. package/dist/cjs/version.js +1 -1
  28. package/dist/cjs/wallets/in-app/{web/lib → core}/actions/generate-wallet.enclave.js +2 -2
  29. package/dist/cjs/wallets/in-app/core/actions/generate-wallet.enclave.js.map +1 -0
  30. package/dist/cjs/wallets/in-app/{web/lib → core}/actions/get-enclave-user-status.js +2 -2
  31. package/dist/cjs/wallets/in-app/core/actions/get-enclave-user-status.js.map +1 -0
  32. package/dist/cjs/wallets/in-app/{web/lib → core}/actions/sign-message.enclave.js +6 -5
  33. package/dist/cjs/wallets/in-app/core/actions/sign-message.enclave.js.map +1 -0
  34. package/dist/cjs/wallets/in-app/{web/lib → core}/actions/sign-transaction.enclave.js +6 -5
  35. package/dist/cjs/wallets/in-app/core/actions/sign-transaction.enclave.js.map +1 -0
  36. package/dist/cjs/wallets/in-app/{web/lib → core}/actions/sign-typed-data.enclave.js +6 -5
  37. package/dist/cjs/wallets/in-app/core/actions/sign-typed-data.enclave.js.map +1 -0
  38. package/dist/cjs/wallets/in-app/core/authentication/client-scoped-storage.js +9 -2
  39. package/dist/cjs/wallets/in-app/core/authentication/client-scoped-storage.js.map +1 -1
  40. package/dist/cjs/wallets/in-app/core/authentication/guest.js +1 -1
  41. package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -1
  42. package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js +4 -8
  43. package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
  44. package/dist/cjs/wallets/in-app/native/auth/passkeys.js +1 -1
  45. package/dist/cjs/wallets/in-app/native/auth/passkeys.js.map +1 -1
  46. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js +14 -0
  47. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  48. package/dist/cjs/wallets/in-app/native/helpers/auth/middleware.js +3 -2
  49. package/dist/cjs/wallets/in-app/native/helpers/auth/middleware.js.map +1 -1
  50. package/dist/cjs/wallets/in-app/native/helpers/constants.js +2 -1
  51. package/dist/cjs/wallets/in-app/native/helpers/constants.js.map +1 -1
  52. package/dist/cjs/wallets/in-app/native/helpers/wallet/migration.js +133 -0
  53. package/dist/cjs/wallets/in-app/native/helpers/wallet/migration.js.map +1 -0
  54. package/dist/cjs/wallets/in-app/native/helpers/wallet/retrieval.js +2 -0
  55. package/dist/cjs/wallets/in-app/native/helpers/wallet/retrieval.js.map +1 -1
  56. package/dist/cjs/wallets/in-app/native/native-connector.js +50 -28
  57. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  58. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js +2 -2
  59. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
  60. package/dist/cjs/wallets/in-app/web/lib/auth/passkeys.js +1 -1
  61. package/dist/cjs/wallets/in-app/web/lib/auth/passkeys.js.map +1 -1
  62. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +13 -13
  63. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  64. package/dist/cjs/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.js +1 -1
  65. package/dist/cjs/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.js.map +1 -1
  66. package/dist/esm/exports/extensions/erc1155.js +1 -0
  67. package/dist/esm/exports/extensions/erc1155.js.map +1 -1
  68. package/dist/esm/extensions/erc1155/write/mintToBatch.js +76 -0
  69. package/dist/esm/extensions/erc1155/write/mintToBatch.js.map +1 -0
  70. package/dist/esm/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js +15 -4
  71. package/dist/esm/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js.map +1 -1
  72. package/dist/esm/react/native/ui/components/WalletImage.js +3 -2
  73. package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -1
  74. package/dist/esm/react/native/ui/connect/ConnectModal.js +6 -6
  75. package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
  76. package/dist/esm/react/native/ui/connect/ConnectedButton.js +2 -2
  77. package/dist/esm/react/native/ui/connect/ConnectedButton.js.map +1 -1
  78. package/dist/esm/react/native/ui/connect/ConnectedModal.js +3 -3
  79. package/dist/esm/react/native/ui/connect/ConnectedModal.js.map +1 -1
  80. package/dist/esm/react/native/ui/connect/ReceiveScreen.js +2 -2
  81. package/dist/esm/react/native/ui/connect/ReceiveScreen.js.map +1 -1
  82. package/dist/esm/react/web/wallets/in-app/WalletAuth.js +8 -0
  83. package/dist/esm/react/web/wallets/in-app/WalletAuth.js.map +1 -1
  84. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -0
  85. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  86. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +12 -17
  87. package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
  88. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +7 -0
  89. package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
  90. package/dist/esm/react/web/wallets/shared/SocialLogin.js +9 -12
  91. package/dist/esm/react/web/wallets/shared/SocialLogin.js.map +1 -1
  92. package/dist/esm/version.js +1 -1
  93. package/dist/esm/wallets/in-app/{web/lib → core}/actions/generate-wallet.enclave.js +2 -2
  94. package/dist/esm/wallets/in-app/core/actions/generate-wallet.enclave.js.map +1 -0
  95. package/dist/esm/wallets/in-app/{web/lib → core}/actions/get-enclave-user-status.js +2 -2
  96. package/dist/esm/wallets/in-app/core/actions/get-enclave-user-status.js.map +1 -0
  97. package/dist/esm/wallets/in-app/{web/lib → core}/actions/sign-message.enclave.js +6 -5
  98. package/dist/esm/wallets/in-app/core/actions/sign-message.enclave.js.map +1 -0
  99. package/dist/esm/wallets/in-app/{web/lib → core}/actions/sign-transaction.enclave.js +6 -5
  100. package/dist/esm/wallets/in-app/core/actions/sign-transaction.enclave.js.map +1 -0
  101. package/dist/esm/wallets/in-app/{web/lib → core}/actions/sign-typed-data.enclave.js +6 -5
  102. package/dist/esm/wallets/in-app/core/actions/sign-typed-data.enclave.js.map +1 -0
  103. package/dist/esm/wallets/in-app/core/authentication/client-scoped-storage.js +9 -2
  104. package/dist/esm/wallets/in-app/core/authentication/client-scoped-storage.js.map +1 -1
  105. package/dist/esm/wallets/in-app/core/authentication/guest.js +1 -1
  106. package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -1
  107. package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js +4 -8
  108. package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
  109. package/dist/esm/wallets/in-app/native/auth/passkeys.js +1 -1
  110. package/dist/esm/wallets/in-app/native/auth/passkeys.js.map +1 -1
  111. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js +14 -0
  112. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  113. package/dist/esm/wallets/in-app/native/helpers/auth/middleware.js +3 -2
  114. package/dist/esm/wallets/in-app/native/helpers/auth/middleware.js.map +1 -1
  115. package/dist/esm/wallets/in-app/native/helpers/constants.js +1 -0
  116. package/dist/esm/wallets/in-app/native/helpers/constants.js.map +1 -1
  117. package/dist/esm/wallets/in-app/native/helpers/wallet/migration.js +130 -0
  118. package/dist/esm/wallets/in-app/native/helpers/wallet/migration.js.map +1 -0
  119. package/dist/esm/wallets/in-app/native/helpers/wallet/retrieval.js +2 -2
  120. package/dist/esm/wallets/in-app/native/helpers/wallet/retrieval.js.map +1 -1
  121. package/dist/esm/wallets/in-app/native/native-connector.js +50 -28
  122. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  123. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js +2 -2
  124. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -1
  125. package/dist/esm/wallets/in-app/web/lib/auth/passkeys.js +1 -1
  126. package/dist/esm/wallets/in-app/web/lib/auth/passkeys.js.map +1 -1
  127. package/dist/esm/wallets/in-app/web/lib/web-connector.js +13 -13
  128. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  129. package/dist/esm/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.js +1 -1
  130. package/dist/esm/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.js.map +1 -1
  131. package/dist/types/exports/extensions/erc1155.d.ts +1 -0
  132. package/dist/types/exports/extensions/erc1155.d.ts.map +1 -1
  133. package/dist/types/extensions/erc1155/write/mintToBatch.d.ts +72 -0
  134. package/dist/types/extensions/erc1155/write/mintToBatch.d.ts.map +1 -0
  135. package/dist/types/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.d.ts.map +1 -1
  136. package/dist/types/react/native/ui/components/WalletImage.d.ts +2 -0
  137. package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
  138. package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
  139. package/dist/types/react/native/ui/connect/ConnectedButton.d.ts.map +1 -1
  140. package/dist/types/react/native/ui/connect/ConnectedModal.d.ts.map +1 -1
  141. package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts +2 -0
  142. package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts.map +1 -1
  143. package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts.map +1 -1
  144. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  145. package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
  146. package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
  147. package/dist/types/version.d.ts +1 -1
  148. package/dist/types/wallets/in-app/core/actions/generate-wallet.enclave.d.ts +13 -0
  149. package/dist/types/wallets/in-app/core/actions/generate-wallet.enclave.d.ts.map +1 -0
  150. package/dist/types/wallets/in-app/core/actions/get-enclave-user-status.d.ts +14 -0
  151. package/dist/types/wallets/in-app/core/actions/get-enclave-user-status.d.ts.map +1 -0
  152. package/dist/types/wallets/in-app/core/actions/sign-message.enclave.d.ts +17 -0
  153. package/dist/types/wallets/in-app/core/actions/sign-message.enclave.d.ts.map +1 -0
  154. package/dist/types/wallets/in-app/core/actions/sign-transaction.enclave.d.ts +9 -0
  155. package/dist/types/wallets/in-app/core/actions/sign-transaction.enclave.d.ts.map +1 -0
  156. package/dist/types/wallets/in-app/{web/lib → core}/actions/sign-typed-data.enclave.d.ts +3 -5
  157. package/dist/types/wallets/in-app/core/actions/sign-typed-data.enclave.d.ts.map +1 -0
  158. package/dist/types/wallets/in-app/core/authentication/client-scoped-storage.d.ts +4 -3
  159. package/dist/types/wallets/in-app/core/authentication/client-scoped-storage.d.ts.map +1 -1
  160. package/dist/types/wallets/in-app/core/wallet/enclave-wallet.d.ts +6 -7
  161. package/dist/types/wallets/in-app/core/wallet/enclave-wallet.d.ts.map +1 -1
  162. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
  163. package/dist/types/wallets/in-app/native/helpers/constants.d.ts +1 -0
  164. package/dist/types/wallets/in-app/native/helpers/constants.d.ts.map +1 -1
  165. package/dist/types/wallets/in-app/native/helpers/wallet/migration.d.ts +17 -0
  166. package/dist/types/wallets/in-app/native/helpers/wallet/migration.d.ts.map +1 -0
  167. package/dist/types/wallets/in-app/native/helpers/wallet/retrieval.d.ts +27 -0
  168. package/dist/types/wallets/in-app/native/helpers/wallet/retrieval.d.ts.map +1 -1
  169. package/dist/types/wallets/in-app/native/native-connector.d.ts +2 -2
  170. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  171. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts.map +1 -1
  172. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +1 -1
  173. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  174. package/package.json +32 -28
  175. package/src/exports/extensions/erc1155.ts +5 -0
  176. package/src/extensions/erc1155/read/getNFTs.test.ts +44 -0
  177. package/src/extensions/erc1155/write/lazyMint.test.ts +35 -0
  178. package/src/extensions/erc1155/write/mintAdditionalSupplyTo.test.ts +38 -0
  179. package/src/extensions/erc1155/write/mintTo.test.ts +43 -0
  180. package/src/extensions/erc1155/write/mintToBatch.test.ts +74 -0
  181. package/src/extensions/erc1155/write/mintToBatch.ts +117 -0
  182. package/src/extensions/erc20/read/isERC20.test.ts +1 -1
  183. package/src/extensions/erc20/write/transferBatch.test.ts +1 -1
  184. package/src/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.test.ts +75 -80
  185. package/src/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.ts +18 -4
  186. package/src/react/native/ui/components/WalletImage.tsx +5 -2
  187. package/src/react/native/ui/connect/ConnectModal.tsx +19 -2
  188. package/src/react/native/ui/connect/ConnectedButton.tsx +8 -2
  189. package/src/react/native/ui/connect/ConnectedModal.tsx +9 -2
  190. package/src/react/native/ui/connect/ReceiveScreen.tsx +5 -2
  191. package/src/react/web/wallets/in-app/WalletAuth.tsx +8 -0
  192. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +1 -0
  193. package/src/react/web/wallets/shared/OTPLoginUI.tsx +12 -18
  194. package/src/react/web/wallets/shared/PassKeyLogin.tsx +7 -0
  195. package/src/react/web/wallets/shared/SocialLogin.tsx +9 -12
  196. package/src/version.ts +1 -1
  197. package/src/wallets/in-app/{web/lib → core}/actions/generate-wallet.enclave.ts +6 -8
  198. package/src/wallets/in-app/{web/lib → core}/actions/get-enclave-user-status.ts +5 -5
  199. package/src/wallets/in-app/{web/lib → core}/actions/sign-message.enclave.ts +7 -9
  200. package/src/wallets/in-app/{web/lib → core}/actions/sign-transaction.enclave.ts +8 -10
  201. package/src/wallets/in-app/{web/lib → core}/actions/sign-typed-data.enclave.ts +7 -9
  202. package/src/wallets/in-app/core/authentication/client-scoped-storage.ts +6 -4
  203. package/src/wallets/in-app/core/authentication/guest.ts +1 -1
  204. package/src/wallets/in-app/core/wallet/enclave-wallet.ts +11 -17
  205. package/src/wallets/in-app/native/auth/passkeys.ts +1 -1
  206. package/src/wallets/in-app/native/helpers/api/fetchers.ts +14 -0
  207. package/src/wallets/in-app/native/helpers/auth/middleware.ts +3 -2
  208. package/src/wallets/in-app/native/helpers/constants.ts +2 -0
  209. package/src/wallets/in-app/native/helpers/wallet/migration.ts +185 -0
  210. package/src/wallets/in-app/native/helpers/wallet/retrieval.ts +2 -2
  211. package/src/wallets/in-app/native/native-connector.ts +62 -28
  212. package/src/wallets/in-app/web/lib/auth/iframe-auth.ts +2 -2
  213. package/src/wallets/in-app/web/lib/auth/passkeys.ts +1 -1
  214. package/src/wallets/in-app/web/lib/web-connector.ts +13 -13
  215. package/src/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.ts +1 -1
  216. package/dist/cjs/wallets/in-app/web/lib/actions/generate-wallet.enclave.js.map +0 -1
  217. package/dist/cjs/wallets/in-app/web/lib/actions/get-enclave-user-status.js.map +0 -1
  218. package/dist/cjs/wallets/in-app/web/lib/actions/sign-message.enclave.js.map +0 -1
  219. package/dist/cjs/wallets/in-app/web/lib/actions/sign-transaction.enclave.js.map +0 -1
  220. package/dist/cjs/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js.map +0 -1
  221. package/dist/esm/wallets/in-app/web/lib/actions/generate-wallet.enclave.js.map +0 -1
  222. package/dist/esm/wallets/in-app/web/lib/actions/get-enclave-user-status.js.map +0 -1
  223. package/dist/esm/wallets/in-app/web/lib/actions/sign-message.enclave.js.map +0 -1
  224. package/dist/esm/wallets/in-app/web/lib/actions/sign-transaction.enclave.js.map +0 -1
  225. package/dist/esm/wallets/in-app/web/lib/actions/sign-typed-data.enclave.js.map +0 -1
  226. package/dist/types/wallets/in-app/web/lib/actions/generate-wallet.enclave.d.ts +0 -15
  227. package/dist/types/wallets/in-app/web/lib/actions/generate-wallet.enclave.d.ts.map +0 -1
  228. package/dist/types/wallets/in-app/web/lib/actions/get-enclave-user-status.d.ts +0 -14
  229. package/dist/types/wallets/in-app/web/lib/actions/get-enclave-user-status.d.ts.map +0 -1
  230. package/dist/types/wallets/in-app/web/lib/actions/sign-message.enclave.d.ts +0 -19
  231. package/dist/types/wallets/in-app/web/lib/actions/sign-message.enclave.d.ts.map +0 -1
  232. package/dist/types/wallets/in-app/web/lib/actions/sign-transaction.enclave.d.ts +0 -11
  233. package/dist/types/wallets/in-app/web/lib/actions/sign-transaction.enclave.d.ts.map +0 -1
  234. package/dist/types/wallets/in-app/web/lib/actions/sign-typed-data.enclave.d.ts.map +0 -1
@@ -1,97 +1,92 @@
1
- import { beforeAll, describe, expect, it, vi } from "vitest";
1
+ import { describe, expect, it } from "vitest";
2
+ import { TEST_CONTRACT_URI } from "~test/ipfs-uris.js";
3
+ import { TEST_ACCOUNT_D } from "~test/test-wallets.js";
2
4
  import { ANVIL_CHAIN } from "../../../../../test/src/chains.js";
3
5
  import { TEST_CLIENT } from "../../../../../test/src/test-clients.js";
4
- import {
5
- type ThirdwebContract,
6
- getContract,
7
- } from "../../../../contract/contract.js";
8
- import type { Hex } from "../../../../utils/encoding/hex.js";
6
+ import { getContract } from "../../../../contract/contract.js";
7
+ import { deployERC721Contract } from "../../../../extensions/prebuilts/deploy-erc721.js";
8
+ import { sendAndConfirmTransaction } from "../../../../transaction/actions/send-and-confirm-transaction.js";
9
+ import { getNFT } from "../../read/getNFT.js";
9
10
  import { createDelayedRevealBatch } from "./createDelayedRevealBatch.js";
11
+ import { reveal } from "./reveal.js";
10
12
 
11
- const mocks = vi.hoisted(() => ({
12
- getBaseUriFromBatch: vi.fn(),
13
- getBaseURICount: vi.fn(),
14
- encryptDecrypt: vi.fn(),
15
- lazyMint: vi.fn(),
16
- upload: vi.fn(),
17
- }));
18
-
19
- vi.mock("../../../../utils/ipfs.js", () => ({
20
- getBaseUriFromBatch: mocks.getBaseUriFromBatch,
21
- }));
22
-
23
- vi.mock(
24
- "../../__generated__/IBatchMintMetadata/read/getBaseURICount.js",
25
- () => ({
26
- getBaseURICount: mocks.getBaseURICount,
27
- }),
28
- );
29
-
30
- vi.mock("../../__generated__/IDelayedReveal/read/encryptDecrypt.js", () => ({
31
- encryptDecrypt: mocks.encryptDecrypt,
32
- }));
33
-
34
- vi.mock("../../../../storage/upload.js", () => ({
35
- upload: mocks.upload,
36
- }));
37
-
38
- const placeholderNFT = {
13
+ const placeholderMetadata = {
39
14
  name: "Hidden NFT",
40
15
  description: "Will be revealed next week!",
41
16
  };
17
+ const account = TEST_ACCOUNT_D;
18
+ const chain = ANVIL_CHAIN;
19
+ const client = TEST_CLIENT;
20
+ const password = "1234";
42
21
 
43
- const realNFTs = [
44
- {
45
- name: "Common NFT #1",
46
- description: "Common NFT, one of many.",
47
- },
48
- {
49
- name: "Super Rare NFT #2",
50
- description: "You got a Super Rare NFT!",
51
- },
52
- ];
22
+ describe.runIf(process.env.TW_SECRET_KEY)("createDelayedRevealedBatch", () => {
23
+ it("should create delayed-reveal batches properly", async () => {
24
+ const contract = getContract({
25
+ address: await deployERC721Contract({
26
+ account,
27
+ chain,
28
+ client,
29
+ type: "DropERC721",
30
+ params: {
31
+ name: "nftdrop",
32
+ contractURI: TEST_CONTRACT_URI,
33
+ },
34
+ }),
35
+ chain,
36
+ client,
37
+ });
53
38
 
54
- describe("createDelayedRevealedBatch", () => {
55
- let contract: ThirdwebContract;
56
- beforeAll(() => {
57
- vi.clearAllMocks();
58
- contract = getContract({
59
- chain: ANVIL_CHAIN,
60
- address: "0x708781BAE850faA490cB5b5b16b4687Ec0A8D65D",
61
- client: TEST_CLIENT,
39
+ // Create batch #0
40
+ await sendAndConfirmTransaction({
41
+ account,
42
+ transaction: createDelayedRevealBatch({
43
+ contract,
44
+ placeholderMetadata,
45
+ password: "1234",
46
+ metadata: [{ name: "token 0" }, { name: "token 1" }],
47
+ }),
62
48
  });
63
- });
64
49
 
65
- it("should generate the proper calldata", async () => {
66
- mocks.getBaseUriFromBatch
67
- .mockReturnValueOnce(
68
- "ipfs://QmQbqDu4aT7sMJHNUk76s4F6DgGk2hVYXYSqpsTRoRM5G8/",
69
- )
70
- .mockReturnValueOnce(
71
- "ipfs://QmRhASFGXNRE3NXNTfakz82j4Tmv5A9rBezTKGZ5DL6uip/",
72
- );
73
- mocks.getBaseURICount.mockResolvedValue(0n);
74
- mocks.encryptDecrypt.mockResolvedValue(
75
- "0x8967ae24bd1c6439791bc1c8ca3b3499537283b71af366693792a707eb99e80bc0058c90c1f92f18ec716e4760fdf9279241d442b5b5",
76
- );
50
+ // Create batch #1
51
+ await sendAndConfirmTransaction({
52
+ account,
53
+ transaction: createDelayedRevealBatch({
54
+ contract,
55
+ placeholderMetadata,
56
+ password,
57
+ metadata: [{ name: "token 2" }, { name: "token 3" }],
58
+ }),
59
+ });
77
60
 
78
- const tx = createDelayedRevealBatch({
79
- contract,
80
- placeholderMetadata: placeholderNFT,
81
- metadata: realNFTs,
82
- password: "password123",
61
+ // Reveal batch #0
62
+ await sendAndConfirmTransaction({
63
+ account,
64
+ transaction: reveal({ contract, batchId: 0n, password }),
65
+ });
66
+ // Reveal batch #1
67
+ await sendAndConfirmTransaction({
68
+ account,
69
+ transaction: reveal({ contract, batchId: 1n, password }),
83
70
  });
84
71
 
85
- let data: Hex;
86
- if (typeof tx.data === "string") {
87
- data = tx.data;
88
- } else {
89
- data = (await tx.data?.()) || "0x";
90
- }
72
+ /**
73
+ * The token URIs of batch 0 should end with "/0" and "/1"
74
+ * while the token URIs of batch 1 should end with "/2" and "/3"
75
+ */
76
+ const [token0, token1, token2, token3] = await Promise.all([
77
+ getNFT({ contract, tokenId: 0n }),
78
+ getNFT({ contract, tokenId: 1n }),
79
+ getNFT({ contract, tokenId: 2n }),
80
+ getNFT({ contract, tokenId: 3n }),
81
+ ]);
91
82
 
92
- expect(data).toEqual(
93
- "0xd37c353b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d516271447534615437734d4a484e556b3736733446364467476b3268565958595371707354526f524d3547382f0000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000040963325533d81f66ae93aff4f562735814e51020ea8bf2bd48eb983ae88cbc40b00000000000000000000000000000000000000000000000000000000000000368967ae24bd1c6439791bc1c8ca3b3499537283b71af366693792a707eb99e80bc0058c90c1f92f18ec716e4760fdf9279241d442b5b500000000000000000000",
94
- );
95
- expect(mocks.upload).toHaveBeenCalledTimes(2);
83
+ expect(token0.tokenURI.endsWith("/0")).toBe(true);
84
+ expect(token0.metadata.name).toBe("token 0");
85
+ expect(token1.tokenURI.endsWith("/1")).toBe(true);
86
+ expect(token1.metadata.name).toBe("token 1");
87
+ expect(token2.tokenURI.endsWith("/2")).toBe(true);
88
+ expect(token2.metadata.name).toBe("token 2");
89
+ expect(token3.tokenURI.endsWith("/3")).toBe(true);
90
+ expect(token3.metadata.name).toBe("token 3");
96
91
  });
97
92
  });
@@ -14,6 +14,7 @@ import {
14
14
  encryptDecrypt,
15
15
  isEncryptDecryptSupported,
16
16
  } from "../../__generated__/IDelayedReveal/read/encryptDecrypt.js";
17
+ import { nextTokenIdToMint } from "../../__generated__/IERC721Enumerable/read/nextTokenIdToMint.js";
17
18
  import {
18
19
  lazyMint as generatedLazyMint,
19
20
  isLazyMintSupported,
@@ -80,16 +81,29 @@ export function createDelayedRevealBatch(
80
81
  return generatedLazyMint({
81
82
  contract: options.contract,
82
83
  asyncParams: async () => {
83
- const placeholderUris = await upload({
84
- client: options.contract.client,
85
- files: Array(options.metadata.length).fill(options.placeholderMetadata),
86
- });
84
+ const [placeholderUris, startFileNumber] = await Promise.all([
85
+ upload({
86
+ client: options.contract.client,
87
+ files: Array(options.metadata.length).fill(
88
+ options.placeholderMetadata,
89
+ ),
90
+ }),
91
+ nextTokenIdToMint({
92
+ contract: options.contract,
93
+ }),
94
+ ]);
87
95
  const placeholderUri = getBaseUriFromBatch(placeholderUris);
88
96
 
89
97
  const uris = await upload({
90
98
  client: options.contract.client,
91
99
  files: options.metadata,
100
+ // IMPORTANT: File number has to be calculated properly otherwise the whole batch will break
101
+ // e.g: If you are uploading a second batch, the file name should never start from `0`
102
+ rewriteFileNames: {
103
+ fileStartNumber: Number(startFileNumber),
104
+ },
92
105
  });
106
+
93
107
  const baseUri = getBaseUriFromBatch(uris);
94
108
  const baseUriId = await getBaseURICount({
95
109
  contract: options.contract,
@@ -1,4 +1,6 @@
1
1
  import { useQuery } from "@tanstack/react-query";
2
+ import type { ThirdwebClient } from "../../../../client/client.js";
3
+ import { resolveScheme } from "../../../../utils/ipfs.js";
2
4
  import { nativeLocalStorage } from "../../../../utils/storage/nativeStorage.js";
3
5
  import { getWalletInfo } from "../../../../wallets/__generated__/getWalletInfo.js";
4
6
  import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
@@ -25,10 +27,11 @@ import { RNImage } from "./RNImage.js";
25
27
  export const WalletImage = (props: {
26
28
  theme: Theme;
27
29
  wallet: Wallet;
30
+ client: ThirdwebClient;
28
31
  size: number;
29
32
  avatar?: string | null;
30
33
  }) => {
31
- const { wallet, avatar, size } = props;
34
+ const { wallet, avatar, size, client } = props;
32
35
 
33
36
  const { data: imageData } = useQuery({
34
37
  queryKey: ["wallet-image", wallet.id, wallet.getAccount()?.address],
@@ -55,7 +58,7 @@ export const WalletImage = (props: {
55
58
  try {
56
59
  const externalWalletImage = await getWalletInfo(activeEOAId, true);
57
60
  if (externalWalletImage) {
58
- return externalWalletImage;
61
+ return resolveScheme({ client, uri: externalWalletImage });
59
62
  }
60
63
  } catch {}
61
64
 
@@ -2,6 +2,7 @@ import { useCallback, useState } from "react";
2
2
  import { Platform, StyleSheet, View } from "react-native";
3
3
  import { SvgXml } from "react-native-svg";
4
4
  import type { Chain } from "../../../../chains/types.js";
5
+ import type { ThirdwebClient } from "../../../../client/client.js";
5
6
  import type { MultiStepAuthProviderType } from "../../../../wallets/in-app/core/authentication/types.js";
6
7
  import type { InAppWalletAuth } from "../../../../wallets/in-app/core/wallet/types.js";
7
8
  import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
@@ -269,6 +270,7 @@ export function ConnectModal(
269
270
  <WalletLoadingView
270
271
  theme={theme}
271
272
  wallet={modalState.wallet}
273
+ client={client}
272
274
  authProvider={modalState.authMethod}
273
275
  />
274
276
  {containerType === "modal" ? (
@@ -328,6 +330,7 @@ export function ConnectModal(
328
330
  )}
329
331
  <SignInView
330
332
  theme={theme}
333
+ client={client}
331
334
  siweAuth={siweAuth}
332
335
  onSignIn={() => props.onClose?.()}
333
336
  onError={(error) => setModalState({ screen: "error", error })}
@@ -462,10 +465,12 @@ export function ConnectModal(
462
465
  function WalletLoadingView({
463
466
  theme,
464
467
  wallet,
468
+ client,
465
469
  authProvider,
466
470
  }: {
467
471
  theme: Theme;
468
472
  wallet: Wallet;
473
+ client: ThirdwebClient;
469
474
  authProvider?: InAppWalletAuth;
470
475
  }) {
471
476
  const walletInfo = useWalletInfo(wallet.id);
@@ -500,7 +505,12 @@ function WalletLoadingView({
500
505
  />
501
506
  </View>
502
507
  ) : (
503
- <WalletImage theme={theme} size={90} wallet={wallet} />
508
+ <WalletImage
509
+ theme={theme}
510
+ size={90}
511
+ wallet={wallet}
512
+ client={client}
513
+ />
504
514
  )}
505
515
  </WalletLoadingThumbnail>
506
516
  <Spacer size="xl" />
@@ -522,12 +532,14 @@ function WalletLoadingView({
522
532
  function SignInView({
523
533
  theme,
524
534
  siweAuth,
535
+ client,
525
536
  onSignIn,
526
537
  onError,
527
538
  onDisconnect,
528
539
  }: {
529
540
  theme: Theme;
530
541
  siweAuth: ReturnType<typeof useSiweAuth>;
542
+ client: ThirdwebClient;
531
543
  onSignIn: () => void;
532
544
  onError: (error: string) => void;
533
545
  onDisconnect: () => void;
@@ -552,7 +564,12 @@ function SignInView({
552
564
  imageSize={100}
553
565
  animate={isSigningIn}
554
566
  >
555
- <WalletImage theme={theme} size={90} wallet={wallet} />
567
+ <WalletImage
568
+ theme={theme}
569
+ size={90}
570
+ wallet={wallet}
571
+ client={client}
572
+ />
556
573
  </WalletLoadingThumbnail>
557
574
  <Spacer size="xl" />
558
575
  <ThemedText theme={theme} type="subtitle">
@@ -20,7 +20,7 @@ export function ConnectedButton(
20
20
  },
21
21
  ) {
22
22
  const theme = parseTheme(props.theme);
23
- const { account, wallet } = props;
23
+ const { account, wallet, client } = props;
24
24
  const walletChain = useActiveWalletChain();
25
25
  const { pfp, name, balanceQuery } = useConnectedWalletDetails(
26
26
  props.client,
@@ -40,7 +40,13 @@ export function ConnectedButton(
40
40
  }}
41
41
  >
42
42
  <View style={styles.row}>
43
- <WalletImage theme={theme} size={40} wallet={wallet} avatar={pfp} />
43
+ <WalletImage
44
+ theme={theme}
45
+ size={40}
46
+ wallet={wallet}
47
+ avatar={pfp}
48
+ client={client}
49
+ />
44
50
  <View style={styles.col}>
45
51
  <ThemedText
46
52
  theme={theme}
@@ -85,6 +85,7 @@ export function ConnectedModal(props: ConnectedModalProps) {
85
85
  <ReceiveScreen
86
86
  account={props.account}
87
87
  wallet={props.wallet}
88
+ client={props.client}
88
89
  theme={theme}
89
90
  containerType={props.containerType}
90
91
  onBack={() => setModalState({ screen: "account" })}
@@ -161,7 +162,7 @@ export function ConnectedModal(props: ConnectedModalProps) {
161
162
  }
162
163
 
163
164
  const AccountHeader = (props: ConnectedModalProps) => {
164
- const { account, wallet, theme } = props;
165
+ const { account, wallet, theme, client } = props;
165
166
  const walletChain = useActiveWalletChain();
166
167
  const { pfp, name, balanceQuery } = useConnectedWalletDetails(
167
168
  props.client,
@@ -171,7 +172,13 @@ const AccountHeader = (props: ConnectedModalProps) => {
171
172
  );
172
173
  return (
173
174
  <View style={styles.accountHeaderContainer}>
174
- <WalletImage theme={theme} size={70} wallet={wallet} avatar={pfp} />
175
+ <WalletImage
176
+ theme={theme}
177
+ size={70}
178
+ wallet={wallet}
179
+ avatar={pfp}
180
+ client={client}
181
+ />
175
182
  <SmartAccountBadge client={props.client} theme={theme} />
176
183
  <Spacer size="smd" />
177
184
  <Address account={account} theme={theme} addressOrENS={name} />
@@ -1,4 +1,5 @@
1
1
  import { StyleSheet, View } from "react-native";
2
+ import type { ThirdwebClient } from "../../../../client/client.js";
2
3
  import { shortenAddress } from "../../../../utils/address.js";
3
4
  import type { Account, Wallet } from "../../../../wallets/interfaces/wallet.js";
4
5
  import type { Theme } from "../../../core/design-system/index.js";
@@ -16,10 +17,12 @@ type ReceiveScreenProps = {
16
17
  onClose?: () => void;
17
18
  onBack?: () => void;
18
19
  containerType: ContainerType;
20
+ client: ThirdwebClient;
19
21
  };
20
22
 
21
23
  export const ReceiveScreen = (props: ReceiveScreenProps) => {
22
- const { wallet, account, theme, onClose, onBack, containerType } = props;
24
+ const { wallet, account, theme, onClose, onBack, containerType, client } =
25
+ props;
23
26
 
24
27
  return (
25
28
  <>
@@ -32,7 +35,7 @@ export const ReceiveScreen = (props: ReceiveScreenProps) => {
32
35
  />
33
36
  <View style={styles.container}>
34
37
  {/* TODO (rn) QR code scanning */}
35
- <WalletImage theme={theme} wallet={wallet} size={80} />
38
+ <WalletImage theme={theme} wallet={wallet} size={80} client={client} />
36
39
  <Spacer size="lg" />
37
40
  <View
38
41
  style={[
@@ -1,6 +1,7 @@
1
1
  import { Suspense, useRef, useState } from "react";
2
2
  import { defineChain } from "../../../../chains/utils.js";
3
3
  import type { ThirdwebClient } from "../../../../client/client.js";
4
+ import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wallet.js";
4
5
  import { linkProfile } from "../../../../wallets/in-app/web/lib/auth/index.js";
5
6
  import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
6
7
  import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
@@ -43,6 +44,12 @@ export function WalletAuth(props: {
43
44
  );
44
45
  const [error, setError] = useState<string | undefined>();
45
46
  const [showAll, setShowAll] = useState<boolean>(false);
47
+ const ecosystem = isEcosystemWallet(wallet)
48
+ ? {
49
+ id: wallet.id,
50
+ partnerId: wallet.getConfig()?.partnerId,
51
+ }
52
+ : undefined;
46
53
 
47
54
  const back = () => {
48
55
  setStatus("selecting");
@@ -59,6 +66,7 @@ export function WalletAuth(props: {
59
66
  strategy: "wallet",
60
67
  wallet: walletToLink,
61
68
  chain: wallet.getChain() || defineChain(1),
69
+ ecosystem,
62
70
  }).catch((e) => {
63
71
  setError(e.message);
64
72
  throw e;
@@ -262,6 +262,7 @@ export const ConnectWalletSocialOptions = (
262
262
  closeOpenedWindow: (openedWindow: Window) => {
263
263
  openedWindow.close();
264
264
  },
265
+ ecosystem: ecosystemInfo,
265
266
  };
266
267
 
267
268
  const connectPromise = (() => {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
+ import { useCallback, useEffect, useRef, useState } from "react";
3
3
  import type { Chain } from "../../../../chains/types.js";
4
4
  import type { ThirdwebClient } from "../../../../client/client.js";
5
5
  import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
@@ -9,7 +9,6 @@ import {
9
9
  preAuthenticate,
10
10
  } from "../../../../wallets/in-app/web/lib/auth/index.js";
11
11
  import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
12
- import type { EcosystemWalletId } from "../../../../wallets/wallet-types.js";
13
12
  import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
14
13
  import { fontSize } from "../../../core/design-system/index.js";
15
14
  import { setLastAuthProvider } from "../../../core/utils/storage.js";
@@ -54,7 +53,12 @@ export function OTPLoginUI(props: {
54
53
  const [verifyStatus, setVerifyStatus] = useState<VerificationStatus>("idle");
55
54
  const [error, setError] = useState<string | undefined>();
56
55
  const [accountStatus, setAccountStatus] = useState<AccountStatus>("sending");
57
- const isEcosystem = useMemo(() => isEcosystemWallet(wallet.id), [wallet.id]);
56
+ const ecosystem = isEcosystemWallet(wallet)
57
+ ? {
58
+ id: wallet.id,
59
+ partnerId: wallet.getConfig()?.partnerId,
60
+ }
61
+ : undefined;
58
62
 
59
63
  const [screen] = useState<ScreenToShow>("base");
60
64
 
@@ -66,13 +70,7 @@ export function OTPLoginUI(props: {
66
70
  try {
67
71
  if ("email" in userInfo) {
68
72
  await preAuthenticate({
69
- ecosystem: isEcosystem
70
- ? {
71
- id: wallet.id as EcosystemWalletId,
72
- partnerId: (wallet as Wallet<EcosystemWalletId>).getConfig()
73
- ?.partnerId,
74
- }
75
- : undefined,
73
+ ecosystem,
76
74
  email: userInfo.email,
77
75
  strategy: "email",
78
76
  client: props.client,
@@ -80,13 +78,7 @@ export function OTPLoginUI(props: {
80
78
  setAccountStatus("sent");
81
79
  } else if ("phone" in userInfo) {
82
80
  await preAuthenticate({
83
- ecosystem: isEcosystem
84
- ? {
85
- id: wallet.id as EcosystemWalletId,
86
- partnerId: (wallet as Wallet<EcosystemWalletId>).getConfig()
87
- ?.partnerId,
88
- }
89
- : undefined,
81
+ ecosystem,
90
82
  phoneNumber: userInfo.phone,
91
83
  strategy: "phone",
92
84
  client: props.client,
@@ -100,7 +92,7 @@ export function OTPLoginUI(props: {
100
92
  setVerifyStatus("idle");
101
93
  setAccountStatus("error");
102
94
  }
103
- }, [props.client, userInfo, wallet, isEcosystem]);
95
+ }, [props.client, userInfo, ecosystem]);
104
96
 
105
97
  async function connect(otp: string) {
106
98
  if ("email" in userInfo) {
@@ -133,6 +125,7 @@ export function OTPLoginUI(props: {
133
125
  strategy: "email",
134
126
  email: userInfo.email,
135
127
  verificationCode: otp,
128
+ ecosystem,
136
129
  });
137
130
  } else if ("phone" in userInfo) {
138
131
  await linkProfile({
@@ -140,6 +133,7 @@ export function OTPLoginUI(props: {
140
133
  strategy: "phone",
141
134
  phoneNumber: userInfo.phone,
142
135
  verificationCode: otp,
136
+ ecosystem,
143
137
  });
144
138
  }
145
139
  }
@@ -211,6 +211,12 @@ function SignupScreen(props: {
211
211
  const { wallet, done, client, chain } = props;
212
212
  const [error, setError] = useState<string | undefined>();
213
213
  const [status, setStatus] = useState<"loading" | "error">("loading");
214
+ const ecosystem = isEcosystemWallet(wallet)
215
+ ? {
216
+ id: wallet.id,
217
+ partnerId: wallet.getConfig()?.partnerId,
218
+ }
219
+ : undefined;
214
220
 
215
221
  async function signup() {
216
222
  setStatus("loading");
@@ -220,6 +226,7 @@ function SignupScreen(props: {
220
226
  client,
221
227
  strategy: "passkey",
222
228
  type: "sign-up",
229
+ ecosystem,
223
230
  });
224
231
  } else {
225
232
  await wallet.connect({
@@ -39,6 +39,12 @@ export function SocialLogin(props: {
39
39
  const ewLocale = props.locale;
40
40
  const locale = ewLocale.socialLoginScreen;
41
41
  const themeObj = useCustomTheme();
42
+ const ecosystem = isEcosystemWallet(props.wallet)
43
+ ? {
44
+ id: props.wallet.id,
45
+ partnerId: props.wallet.getConfig()?.partnerId,
46
+ }
47
+ : undefined;
42
48
 
43
49
  const [authError, setAuthError] = useState<string | undefined>(undefined);
44
50
  const { done, wallet } = props;
@@ -62,12 +68,7 @@ export function SocialLogin(props: {
62
68
  return loginWithOauthRedirect({
63
69
  authOption: props.socialAuth,
64
70
  client: props.client,
65
- ecosystem: isEcosystemWallet(wallet)
66
- ? {
67
- id: wallet.id,
68
- partnerId: wallet.getConfig()?.partnerId,
69
- }
70
- : undefined,
71
+ ecosystem,
71
72
  redirectUrl: walletConfig?.auth?.redirectUrl,
72
73
  mode: walletConfig?.auth?.mode,
73
74
  });
@@ -78,12 +79,7 @@ export function SocialLogin(props: {
78
79
  authOption: props.socialAuth,
79
80
  themeObj,
80
81
  client: props.client,
81
- ecosystem: isEcosystemWallet(wallet)
82
- ? {
83
- id: wallet.id,
84
- partnerId: wallet.getConfig()?.partnerId,
85
- }
86
- : undefined,
82
+ ecosystem,
87
83
  });
88
84
 
89
85
  if (!socialWindow) {
@@ -99,6 +95,7 @@ export function SocialLogin(props: {
99
95
  closeOpenedWindow: (openedWindow) => {
100
96
  openedWindow.close();
101
97
  },
98
+ ecosystem,
102
99
  }).catch((e) => {
103
100
  setAuthError(e.message);
104
101
  throw e;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.61.6";
1
+ export const version = "5.62.0";
@@ -1,7 +1,8 @@
1
- import type { ThirdwebClient } from "../../../../../client/client.js";
2
- import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
3
- import { getClientFetch } from "../../../../../utils/fetch.js";
4
- import type { Ecosystem } from "../../../core/wallet/types.js";
1
+ import type { ThirdwebClient } from "../../../../client/client.js";
2
+ import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
3
+ import { getClientFetch } from "../../../../utils/fetch.js";
4
+ import type { UserWallet } from "../wallet/enclave-wallet.js";
5
+ import type { Ecosystem } from "../wallet/types.js";
5
6
 
6
7
  /**
7
8
  * Generate a new enclave wallet using an auth token
@@ -34,10 +35,7 @@ export async function generateWallet({
34
35
  }
35
36
 
36
37
  const { wallet } = (await response.json()) as {
37
- wallet: {
38
- address: string;
39
- type: "enclave";
40
- };
38
+ wallet: UserWallet;
41
39
  };
42
40
 
43
41
  return wallet;
@@ -1,8 +1,8 @@
1
- import type { ThirdwebClient } from "../../../../../client/client.js";
2
- import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
3
- import { getClientFetch } from "../../../../../utils/fetch.js";
4
- import type { UserStatus } from "../../../core/wallet/enclave-wallet.js";
5
- import type { Ecosystem } from "../../../core/wallet/types.js";
1
+ import type { ThirdwebClient } from "../../../../client/client.js";
2
+ import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
3
+ import { getClientFetch } from "../../../../utils/fetch.js";
4
+ import type { UserStatus } from "../wallet/enclave-wallet.js";
5
+ import type { Ecosystem } from "../wallet/types.js";
6
6
 
7
7
  /**
8
8
  * Gets the user's status from the backend.