thirdweb 5.99.0 → 5.99.1-nightly-fb4c190eb3fa2da13da668281adf3ae45ed457a2-20250514000358

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 (278) hide show
  1. package/dist/cjs/exports/storage.js +3 -1
  2. package/dist/cjs/exports/storage.js.map +1 -1
  3. package/dist/cjs/extensions/erc1155/drops/read/canClaim.js +1 -1
  4. package/dist/cjs/extensions/erc1155/drops/read/getActiveClaimCondition.js +1 -0
  5. package/dist/cjs/extensions/erc1155/drops/read/getActiveClaimCondition.js.map +1 -1
  6. package/dist/cjs/extensions/erc1155/drops/read/getClaimConditions.js +1 -0
  7. package/dist/cjs/extensions/erc1155/drops/read/getClaimConditions.js.map +1 -1
  8. package/dist/cjs/extensions/erc1155/drops/write/claimTo.js +1 -0
  9. package/dist/cjs/extensions/erc1155/drops/write/claimTo.js.map +1 -1
  10. package/dist/cjs/extensions/erc1155/drops/write/resetClaimEligibility.js +1 -0
  11. package/dist/cjs/extensions/erc1155/drops/write/resetClaimEligibility.js.map +1 -1
  12. package/dist/cjs/extensions/erc1155/drops/write/setClaimConditions.js +1 -0
  13. package/dist/cjs/extensions/erc1155/drops/write/setClaimConditions.js.map +1 -1
  14. package/dist/cjs/extensions/erc1155/write/lazyMint.js +1 -0
  15. package/dist/cjs/extensions/erc1155/write/lazyMint.js.map +1 -1
  16. package/dist/cjs/extensions/erc1155/write/mintAdditionalSupplyTo.js +1 -0
  17. package/dist/cjs/extensions/erc1155/write/mintAdditionalSupplyTo.js.map +1 -1
  18. package/dist/cjs/extensions/erc1155/write/mintAdditionalSupplyToBatch.js +1 -0
  19. package/dist/cjs/extensions/erc1155/write/mintAdditionalSupplyToBatch.js.map +1 -1
  20. package/dist/cjs/extensions/erc1155/write/mintTo.js +1 -0
  21. package/dist/cjs/extensions/erc1155/write/mintTo.js.map +1 -1
  22. package/dist/cjs/extensions/erc1155/write/mintToBatch.js +1 -0
  23. package/dist/cjs/extensions/erc1155/write/mintToBatch.js.map +1 -1
  24. package/dist/cjs/extensions/erc1155/write/sigMint.js +1 -0
  25. package/dist/cjs/extensions/erc1155/write/sigMint.js.map +1 -1
  26. package/dist/cjs/extensions/erc1155/write/updateTokenURI.js +1 -0
  27. package/dist/cjs/extensions/erc1155/write/updateTokenURI.js.map +1 -1
  28. package/dist/cjs/extensions/erc20/drops/read/canClaim.js +1 -1
  29. package/dist/cjs/extensions/erc20/drops/read/getActiveClaimCondition.js +1 -0
  30. package/dist/cjs/extensions/erc20/drops/read/getActiveClaimCondition.js.map +1 -1
  31. package/dist/cjs/extensions/erc20/drops/read/getClaimConditions.js +1 -0
  32. package/dist/cjs/extensions/erc20/drops/read/getClaimConditions.js.map +1 -1
  33. package/dist/cjs/extensions/erc20/drops/write/claimTo.js +2 -0
  34. package/dist/cjs/extensions/erc20/drops/write/claimTo.js.map +1 -1
  35. package/dist/cjs/extensions/erc20/drops/write/resetClaimEligibility.js +1 -0
  36. package/dist/cjs/extensions/erc20/drops/write/resetClaimEligibility.js.map +1 -1
  37. package/dist/cjs/extensions/erc20/drops/write/setClaimConditions.js +1 -0
  38. package/dist/cjs/extensions/erc20/drops/write/setClaimConditions.js.map +1 -1
  39. package/dist/cjs/extensions/erc20/write/mintTo.js +1 -0
  40. package/dist/cjs/extensions/erc20/write/mintTo.js.map +1 -1
  41. package/dist/cjs/extensions/erc20/write/sigMint.js +1 -0
  42. package/dist/cjs/extensions/erc20/write/sigMint.js.map +1 -1
  43. package/dist/cjs/extensions/erc721/drops/read/canClaim.js +2 -0
  44. package/dist/cjs/extensions/erc721/drops/read/canClaim.js.map +1 -1
  45. package/dist/cjs/extensions/erc721/drops/read/getActiveClaimCondition.js +4 -0
  46. package/dist/cjs/extensions/erc721/drops/read/getActiveClaimCondition.js.map +1 -1
  47. package/dist/cjs/extensions/erc721/drops/read/getClaimConditions.js +3 -0
  48. package/dist/cjs/extensions/erc721/drops/read/getClaimConditions.js.map +1 -1
  49. package/dist/cjs/extensions/erc721/drops/write/claimTo.js +1 -0
  50. package/dist/cjs/extensions/erc721/drops/write/claimTo.js.map +1 -1
  51. package/dist/cjs/extensions/erc721/drops/write/claimToBatch.js +1 -0
  52. package/dist/cjs/extensions/erc721/drops/write/claimToBatch.js.map +1 -1
  53. package/dist/cjs/extensions/erc721/drops/write/resetClaimEligibility.js +1 -0
  54. package/dist/cjs/extensions/erc721/drops/write/resetClaimEligibility.js.map +1 -1
  55. package/dist/cjs/extensions/erc721/drops/write/setClaimConditions.js +1 -0
  56. package/dist/cjs/extensions/erc721/drops/write/setClaimConditions.js.map +1 -1
  57. package/dist/cjs/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js +1 -0
  58. package/dist/cjs/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js.map +1 -1
  59. package/dist/cjs/extensions/erc721/lazyMinting/write/reveal.js +1 -1
  60. package/dist/cjs/extensions/erc721/write/lazyMint.js +2 -0
  61. package/dist/cjs/extensions/erc721/write/lazyMint.js.map +1 -1
  62. package/dist/cjs/extensions/erc721/write/mintTo.js +2 -0
  63. package/dist/cjs/extensions/erc721/write/mintTo.js.map +1 -1
  64. package/dist/cjs/extensions/erc721/write/sigMint.js +2 -0
  65. package/dist/cjs/extensions/erc721/write/sigMint.js.map +1 -1
  66. package/dist/cjs/extensions/erc721/write/updateTokenURI.js +1 -0
  67. package/dist/cjs/extensions/erc721/write/updateTokenURI.js.map +1 -1
  68. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +9 -0
  69. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  70. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +6 -39
  71. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
  72. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +52 -7
  73. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
  74. package/dist/cjs/utils/storage/inMemoryStorage.js +16 -0
  75. package/dist/cjs/utils/storage/inMemoryStorage.js.map +1 -0
  76. package/dist/cjs/version.js +1 -1
  77. package/dist/cjs/version.js.map +1 -1
  78. package/dist/cjs/wallets/in-app/web/in-app.js +5 -1
  79. package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
  80. package/dist/esm/exports/storage.js +1 -0
  81. package/dist/esm/exports/storage.js.map +1 -1
  82. package/dist/esm/extensions/erc1155/drops/read/canClaim.js +1 -1
  83. package/dist/esm/extensions/erc1155/drops/read/getActiveClaimCondition.js +1 -0
  84. package/dist/esm/extensions/erc1155/drops/read/getActiveClaimCondition.js.map +1 -1
  85. package/dist/esm/extensions/erc1155/drops/read/getClaimConditions.js +1 -0
  86. package/dist/esm/extensions/erc1155/drops/read/getClaimConditions.js.map +1 -1
  87. package/dist/esm/extensions/erc1155/drops/write/claimTo.js +1 -0
  88. package/dist/esm/extensions/erc1155/drops/write/claimTo.js.map +1 -1
  89. package/dist/esm/extensions/erc1155/drops/write/resetClaimEligibility.js +1 -0
  90. package/dist/esm/extensions/erc1155/drops/write/resetClaimEligibility.js.map +1 -1
  91. package/dist/esm/extensions/erc1155/drops/write/setClaimConditions.js +1 -0
  92. package/dist/esm/extensions/erc1155/drops/write/setClaimConditions.js.map +1 -1
  93. package/dist/esm/extensions/erc1155/write/lazyMint.js +1 -0
  94. package/dist/esm/extensions/erc1155/write/lazyMint.js.map +1 -1
  95. package/dist/esm/extensions/erc1155/write/mintAdditionalSupplyTo.js +1 -0
  96. package/dist/esm/extensions/erc1155/write/mintAdditionalSupplyTo.js.map +1 -1
  97. package/dist/esm/extensions/erc1155/write/mintAdditionalSupplyToBatch.js +1 -0
  98. package/dist/esm/extensions/erc1155/write/mintAdditionalSupplyToBatch.js.map +1 -1
  99. package/dist/esm/extensions/erc1155/write/mintTo.js +1 -0
  100. package/dist/esm/extensions/erc1155/write/mintTo.js.map +1 -1
  101. package/dist/esm/extensions/erc1155/write/mintToBatch.js +1 -0
  102. package/dist/esm/extensions/erc1155/write/mintToBatch.js.map +1 -1
  103. package/dist/esm/extensions/erc1155/write/sigMint.js +1 -0
  104. package/dist/esm/extensions/erc1155/write/sigMint.js.map +1 -1
  105. package/dist/esm/extensions/erc1155/write/updateTokenURI.js +1 -0
  106. package/dist/esm/extensions/erc1155/write/updateTokenURI.js.map +1 -1
  107. package/dist/esm/extensions/erc20/drops/read/canClaim.js +1 -1
  108. package/dist/esm/extensions/erc20/drops/read/getActiveClaimCondition.js +1 -0
  109. package/dist/esm/extensions/erc20/drops/read/getActiveClaimCondition.js.map +1 -1
  110. package/dist/esm/extensions/erc20/drops/read/getClaimConditions.js +1 -0
  111. package/dist/esm/extensions/erc20/drops/read/getClaimConditions.js.map +1 -1
  112. package/dist/esm/extensions/erc20/drops/write/claimTo.js +2 -0
  113. package/dist/esm/extensions/erc20/drops/write/claimTo.js.map +1 -1
  114. package/dist/esm/extensions/erc20/drops/write/resetClaimEligibility.js +1 -0
  115. package/dist/esm/extensions/erc20/drops/write/resetClaimEligibility.js.map +1 -1
  116. package/dist/esm/extensions/erc20/drops/write/setClaimConditions.js +1 -0
  117. package/dist/esm/extensions/erc20/drops/write/setClaimConditions.js.map +1 -1
  118. package/dist/esm/extensions/erc20/write/mintTo.js +1 -0
  119. package/dist/esm/extensions/erc20/write/mintTo.js.map +1 -1
  120. package/dist/esm/extensions/erc20/write/sigMint.js +1 -0
  121. package/dist/esm/extensions/erc20/write/sigMint.js.map +1 -1
  122. package/dist/esm/extensions/erc721/drops/read/canClaim.js +2 -0
  123. package/dist/esm/extensions/erc721/drops/read/canClaim.js.map +1 -1
  124. package/dist/esm/extensions/erc721/drops/read/getActiveClaimCondition.js +4 -0
  125. package/dist/esm/extensions/erc721/drops/read/getActiveClaimCondition.js.map +1 -1
  126. package/dist/esm/extensions/erc721/drops/read/getClaimConditions.js +3 -0
  127. package/dist/esm/extensions/erc721/drops/read/getClaimConditions.js.map +1 -1
  128. package/dist/esm/extensions/erc721/drops/write/claimTo.js +1 -0
  129. package/dist/esm/extensions/erc721/drops/write/claimTo.js.map +1 -1
  130. package/dist/esm/extensions/erc721/drops/write/claimToBatch.js +1 -0
  131. package/dist/esm/extensions/erc721/drops/write/claimToBatch.js.map +1 -1
  132. package/dist/esm/extensions/erc721/drops/write/resetClaimEligibility.js +1 -0
  133. package/dist/esm/extensions/erc721/drops/write/resetClaimEligibility.js.map +1 -1
  134. package/dist/esm/extensions/erc721/drops/write/setClaimConditions.js +1 -0
  135. package/dist/esm/extensions/erc721/drops/write/setClaimConditions.js.map +1 -1
  136. package/dist/esm/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js +1 -0
  137. package/dist/esm/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.js.map +1 -1
  138. package/dist/esm/extensions/erc721/lazyMinting/write/reveal.js +1 -1
  139. package/dist/esm/extensions/erc721/write/lazyMint.js +2 -0
  140. package/dist/esm/extensions/erc721/write/lazyMint.js.map +1 -1
  141. package/dist/esm/extensions/erc721/write/mintTo.js +2 -0
  142. package/dist/esm/extensions/erc721/write/mintTo.js.map +1 -1
  143. package/dist/esm/extensions/erc721/write/sigMint.js +2 -0
  144. package/dist/esm/extensions/erc721/write/sigMint.js.map +1 -1
  145. package/dist/esm/extensions/erc721/write/updateTokenURI.js +1 -0
  146. package/dist/esm/extensions/erc721/write/updateTokenURI.js.map +1 -1
  147. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +9 -0
  148. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  149. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +7 -40
  150. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
  151. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +51 -6
  152. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
  153. package/dist/esm/utils/storage/inMemoryStorage.js +13 -0
  154. package/dist/esm/utils/storage/inMemoryStorage.js.map +1 -0
  155. package/dist/esm/version.js +1 -1
  156. package/dist/esm/version.js.map +1 -1
  157. package/dist/esm/wallets/in-app/web/in-app.js +5 -1
  158. package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
  159. package/dist/types/exports/storage.d.ts +1 -0
  160. package/dist/types/exports/storage.d.ts.map +1 -1
  161. package/dist/types/extensions/erc1155/drops/read/canClaim.d.ts +1 -1
  162. package/dist/types/extensions/erc1155/drops/read/getActiveClaimCondition.d.ts +1 -0
  163. package/dist/types/extensions/erc1155/drops/read/getActiveClaimCondition.d.ts.map +1 -1
  164. package/dist/types/extensions/erc1155/drops/read/getClaimConditions.d.ts +1 -0
  165. package/dist/types/extensions/erc1155/drops/read/getClaimConditions.d.ts.map +1 -1
  166. package/dist/types/extensions/erc1155/drops/write/claimTo.d.ts +1 -0
  167. package/dist/types/extensions/erc1155/drops/write/claimTo.d.ts.map +1 -1
  168. package/dist/types/extensions/erc1155/drops/write/resetClaimEligibility.d.ts +1 -0
  169. package/dist/types/extensions/erc1155/drops/write/resetClaimEligibility.d.ts.map +1 -1
  170. package/dist/types/extensions/erc1155/drops/write/setClaimConditions.d.ts +1 -0
  171. package/dist/types/extensions/erc1155/drops/write/setClaimConditions.d.ts.map +1 -1
  172. package/dist/types/extensions/erc1155/write/lazyMint.d.ts +1 -0
  173. package/dist/types/extensions/erc1155/write/lazyMint.d.ts.map +1 -1
  174. package/dist/types/extensions/erc1155/write/mintAdditionalSupplyTo.d.ts +1 -0
  175. package/dist/types/extensions/erc1155/write/mintAdditionalSupplyTo.d.ts.map +1 -1
  176. package/dist/types/extensions/erc1155/write/mintAdditionalSupplyToBatch.d.ts +1 -0
  177. package/dist/types/extensions/erc1155/write/mintAdditionalSupplyToBatch.d.ts.map +1 -1
  178. package/dist/types/extensions/erc1155/write/mintTo.d.ts +1 -0
  179. package/dist/types/extensions/erc1155/write/mintTo.d.ts.map +1 -1
  180. package/dist/types/extensions/erc1155/write/mintToBatch.d.ts +1 -0
  181. package/dist/types/extensions/erc1155/write/mintToBatch.d.ts.map +1 -1
  182. package/dist/types/extensions/erc1155/write/sigMint.d.ts +1 -0
  183. package/dist/types/extensions/erc1155/write/sigMint.d.ts.map +1 -1
  184. package/dist/types/extensions/erc1155/write/updateTokenURI.d.ts +1 -0
  185. package/dist/types/extensions/erc1155/write/updateTokenURI.d.ts.map +1 -1
  186. package/dist/types/extensions/erc20/drops/read/canClaim.d.ts +1 -1
  187. package/dist/types/extensions/erc20/drops/read/getActiveClaimCondition.d.ts +1 -0
  188. package/dist/types/extensions/erc20/drops/read/getActiveClaimCondition.d.ts.map +1 -1
  189. package/dist/types/extensions/erc20/drops/read/getClaimConditions.d.ts +1 -0
  190. package/dist/types/extensions/erc20/drops/read/getClaimConditions.d.ts.map +1 -1
  191. package/dist/types/extensions/erc20/drops/write/claimTo.d.ts +2 -0
  192. package/dist/types/extensions/erc20/drops/write/claimTo.d.ts.map +1 -1
  193. package/dist/types/extensions/erc20/drops/write/resetClaimEligibility.d.ts +1 -0
  194. package/dist/types/extensions/erc20/drops/write/resetClaimEligibility.d.ts.map +1 -1
  195. package/dist/types/extensions/erc20/drops/write/setClaimConditions.d.ts +1 -0
  196. package/dist/types/extensions/erc20/drops/write/setClaimConditions.d.ts.map +1 -1
  197. package/dist/types/extensions/erc20/write/mintTo.d.ts +1 -0
  198. package/dist/types/extensions/erc20/write/mintTo.d.ts.map +1 -1
  199. package/dist/types/extensions/erc20/write/sigMint.d.ts +1 -0
  200. package/dist/types/extensions/erc20/write/sigMint.d.ts.map +1 -1
  201. package/dist/types/extensions/erc721/drops/read/canClaim.d.ts +2 -0
  202. package/dist/types/extensions/erc721/drops/read/canClaim.d.ts.map +1 -1
  203. package/dist/types/extensions/erc721/drops/read/getActiveClaimCondition.d.ts +4 -0
  204. package/dist/types/extensions/erc721/drops/read/getActiveClaimCondition.d.ts.map +1 -1
  205. package/dist/types/extensions/erc721/drops/read/getClaimConditions.d.ts +3 -0
  206. package/dist/types/extensions/erc721/drops/read/getClaimConditions.d.ts.map +1 -1
  207. package/dist/types/extensions/erc721/drops/write/claimTo.d.ts +1 -0
  208. package/dist/types/extensions/erc721/drops/write/claimTo.d.ts.map +1 -1
  209. package/dist/types/extensions/erc721/drops/write/claimToBatch.d.ts +1 -0
  210. package/dist/types/extensions/erc721/drops/write/claimToBatch.d.ts.map +1 -1
  211. package/dist/types/extensions/erc721/drops/write/resetClaimEligibility.d.ts +1 -0
  212. package/dist/types/extensions/erc721/drops/write/resetClaimEligibility.d.ts.map +1 -1
  213. package/dist/types/extensions/erc721/drops/write/setClaimConditions.d.ts +1 -0
  214. package/dist/types/extensions/erc721/drops/write/setClaimConditions.d.ts.map +1 -1
  215. package/dist/types/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.d.ts +1 -0
  216. package/dist/types/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.d.ts.map +1 -1
  217. package/dist/types/extensions/erc721/lazyMinting/write/reveal.d.ts +1 -1
  218. package/dist/types/extensions/erc721/write/lazyMint.d.ts +2 -0
  219. package/dist/types/extensions/erc721/write/lazyMint.d.ts.map +1 -1
  220. package/dist/types/extensions/erc721/write/mintTo.d.ts +2 -0
  221. package/dist/types/extensions/erc721/write/mintTo.d.ts.map +1 -1
  222. package/dist/types/extensions/erc721/write/sigMint.d.ts +2 -0
  223. package/dist/types/extensions/erc721/write/sigMint.d.ts.map +1 -1
  224. package/dist/types/extensions/erc721/write/updateTokenURI.d.ts +1 -0
  225. package/dist/types/extensions/erc721/write/updateTokenURI.d.ts.map +1 -1
  226. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  227. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +1 -1
  228. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.d.ts +12 -12
  229. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.d.ts.map +1 -1
  230. package/dist/types/utils/storage/inMemoryStorage.d.ts +3 -0
  231. package/dist/types/utils/storage/inMemoryStorage.d.ts.map +1 -0
  232. package/dist/types/version.d.ts +1 -1
  233. package/dist/types/version.d.ts.map +1 -1
  234. package/dist/types/wallets/in-app/web/in-app.d.ts +5 -1
  235. package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
  236. package/package.json +1 -1
  237. package/src/exports/storage.ts +1 -0
  238. package/src/extensions/erc1155/drops/read/canClaim.ts +1 -1
  239. package/src/extensions/erc1155/drops/read/getActiveClaimCondition.ts +1 -0
  240. package/src/extensions/erc1155/drops/read/getClaimConditions.ts +1 -0
  241. package/src/extensions/erc1155/drops/write/claimTo.ts +1 -0
  242. package/src/extensions/erc1155/drops/write/resetClaimEligibility.ts +1 -0
  243. package/src/extensions/erc1155/drops/write/setClaimConditions.ts +1 -0
  244. package/src/extensions/erc1155/write/lazyMint.ts +1 -0
  245. package/src/extensions/erc1155/write/mintAdditionalSupplyTo.ts +1 -0
  246. package/src/extensions/erc1155/write/mintAdditionalSupplyToBatch.ts +1 -0
  247. package/src/extensions/erc1155/write/mintTo.ts +1 -0
  248. package/src/extensions/erc1155/write/mintToBatch.ts +1 -0
  249. package/src/extensions/erc1155/write/sigMint.ts +1 -0
  250. package/src/extensions/erc1155/write/updateTokenURI.ts +1 -0
  251. package/src/extensions/erc20/drops/read/canClaim.ts +1 -1
  252. package/src/extensions/erc20/drops/read/getActiveClaimCondition.ts +1 -0
  253. package/src/extensions/erc20/drops/read/getClaimConditions.ts +1 -0
  254. package/src/extensions/erc20/drops/write/claimTo.ts +2 -0
  255. package/src/extensions/erc20/drops/write/resetClaimEligibility.ts +1 -0
  256. package/src/extensions/erc20/drops/write/setClaimConditions.ts +1 -0
  257. package/src/extensions/erc20/write/mintTo.ts +1 -0
  258. package/src/extensions/erc20/write/sigMint.ts +1 -0
  259. package/src/extensions/erc721/drops/read/canClaim.ts +2 -0
  260. package/src/extensions/erc721/drops/read/getActiveClaimCondition.ts +4 -0
  261. package/src/extensions/erc721/drops/read/getClaimConditions.ts +3 -0
  262. package/src/extensions/erc721/drops/write/claimTo.ts +1 -0
  263. package/src/extensions/erc721/drops/write/claimToBatch.ts +1 -0
  264. package/src/extensions/erc721/drops/write/resetClaimEligibility.ts +1 -0
  265. package/src/extensions/erc721/drops/write/setClaimConditions.ts +1 -0
  266. package/src/extensions/erc721/lazyMinting/write/createDelayedRevealBatch.ts +1 -0
  267. package/src/extensions/erc721/lazyMinting/write/reveal.ts +1 -1
  268. package/src/extensions/erc721/write/lazyMint.ts +2 -0
  269. package/src/extensions/erc721/write/mintTo.ts +2 -0
  270. package/src/extensions/erc721/write/sigMint.ts +2 -0
  271. package/src/extensions/erc721/write/updateTokenURI.ts +1 -0
  272. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +10 -0
  273. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +7 -47
  274. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/{fetchBalancesForWallet.ts → fetchBalancesForWallet.tsx} +70 -8
  275. package/src/utils/storage/inMemoryStorage.ts +15 -0
  276. package/src/version.ts +1 -1
  277. package/src/wallets/in-app/web/in-app.ts +5 -1
  278. package/src/wallets/in-app/web/lib/in-app-backend.test.ts +27 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thirdweb",
3
- "version": "5.99.0",
3
+ "version": "5.99.1-nightly-fb4c190eb3fa2da13da668281adf3ae45ed457a2-20250514000358",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/thirdweb-dev/js.git#main"
@@ -11,3 +11,4 @@ export {
11
11
  type ResolveArweaveSchemeOptions,
12
12
  } from "../utils/arweave.js";
13
13
  export type { AsyncStorage } from "../utils/storage/AsyncStorage.js";
14
+ export { inMemoryStorage } from "../utils/storage/inMemoryStorage.js";
@@ -18,7 +18,7 @@ export type CanClaimResult = {
18
18
 
19
19
  /**
20
20
  * Check if a user can claim a drop.
21
- *
21
+ * This method is only available on the `DropERC1155` contract.
22
22
  * @param options - The options for the transaction.
23
23
  * @returns Whether the user can claim the drop.
24
24
  *
@@ -17,6 +17,7 @@ import {
17
17
  export type GetActiveClaimConditionParams = GetActiveClaimConditionIdParams;
18
18
  /**
19
19
  * Retrieves the active claim condition.
20
+ * This method is only available on the `DropERC1155` contract.
20
21
  * @param options - The transaction options.
21
22
  * @returns A promise that resolves to the active claim condition.
22
23
  * @throws An error if the claim condition is unsupported.
@@ -9,6 +9,7 @@ export type GetClaimConditionsParams = {
9
9
  };
10
10
  /**
11
11
  * Retrieves all claim conditions.
12
+ * This method is only available on the `DropERC1155` contract.
12
13
  * @param options - The transaction options.
13
14
  * @returns A promise that resolves to all claim conditions.
14
15
  * @throws An error if the claim conditions are unsupported by the contract.
@@ -18,6 +18,7 @@ export type ClaimToParams = {
18
18
 
19
19
  /**
20
20
  * Claim ERC1155 NFTs to a specified address
21
+ * This method is only available on the `DropERC1155` contract.
21
22
  * @param options - The options for the transaction
22
23
  * @extension ERC1155
23
24
  * @example
@@ -23,6 +23,7 @@ export type ResetClaimEligibilityParams = GetClaimConditionsParams;
23
23
 
24
24
  /**
25
25
  * Reset the claim eligibility for all users.
26
+ * This method is only available on the `DropERC1155` contract.
26
27
  * @param options
27
28
  * @returns the prepared transaction
28
29
  * @extension ERC1155
@@ -22,6 +22,7 @@ export type SetClaimConditionsParams = {
22
22
 
23
23
  /**
24
24
  * Set the claim conditions for a ERC1155 drop
25
+ * This method is only available on the `DropERC1155` contract.
25
26
  * @param options
26
27
  * @returns the prepared transaction
27
28
  * @extension ERC1155
@@ -37,6 +37,7 @@ export type LazyMintParams = {
37
37
 
38
38
  /**
39
39
  * Lazily mints ERC1155 tokens.
40
+ * This method is only available on the `DropERC1155` contract.
40
41
  * @param options - The options for the lazy minting process.
41
42
  * @returns A promise that resolves to the prepared contract call.
42
43
  * @extension ERC1155
@@ -13,6 +13,7 @@ export type MintAdditionalSupplyToParams = {
13
13
 
14
14
  /**
15
15
  * Mints a "supply" number of additional ERC1155 tokens to the specified "to" address.
16
+ * This method is only available on the `TokenERC1155` contract.
16
17
  * @param options - The transaction options.
17
18
  * @returns A promise that resolves to the transaction result.
18
19
  * @extension ERC1155
@@ -16,6 +16,7 @@ export type MintAdditionalSupplyToBatchParams = WithOverrides<{
16
16
 
17
17
  /**
18
18
  * This extension batches multiple `mintAdditionalSupplyToBatch` extensions into one single multicall.
19
+ * This method is only available on the `TokenERC1155` contract.
19
20
  * Keep in mind that there is a limit of how many NFTs you can mint per transaction.
20
21
  * This limit varies depends on the network that you are transacting on.
21
22
  *
@@ -19,6 +19,7 @@ export type MintToParams = WithOverrides<{
19
19
 
20
20
  /**
21
21
  * Mints a "supply" number of new ERC1155 tokens to the specified "to" address.
22
+ * This method is only available on the `TokenERC1155` contract.
22
23
  * If the `nft` parameter is a string, it will be used as the token URI.
23
24
  * If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI.
24
25
  * @param options - The transaction options.
@@ -40,6 +40,7 @@ export type MintToBatchParams = WithOverrides<{
40
40
 
41
41
  /**
42
42
  * This extension batches multiple `mintTo` extensions into one single multicall.
43
+ * This method is only available on the `TokenERC1155` contract.
43
44
  * Keep in mind that there is a limit of how many NFTs you can mint per transaction.
44
45
  * This limit varies depends on the network that you are transacting on.
45
46
  *
@@ -19,6 +19,7 @@ import {
19
19
 
20
20
  /**
21
21
  * Mints a new ERC1155 token with the given minter signature
22
+ * This method is only available on the `TokenERC1155` contract.
22
23
  * @param options - The transaction options.
23
24
  * @example
24
25
  * ```ts
@@ -20,6 +20,7 @@ export type UpdateTokenURIParams = {
20
20
  * which means it uses `setTokenURI` under the hood.
21
21
  * While the `setTokenURI` method only takes in a uri string, this extension takes in a user-friendly [`NFTInput`](https://portal.thirdweb.com/references/typescript/v5/NFTInput),
22
22
  * upload that content to IPFS and pass the IPFS URI (of said `NFTInput`) to the underlying `setTokenURI` method.
23
+ * This method is only available on the `TokenERC1155` contract.
23
24
  *
24
25
  * This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update.
25
26
  *
@@ -17,7 +17,7 @@ export type CanClaimResult = {
17
17
 
18
18
  /**
19
19
  * Check if a user can claim a drop.
20
- *
20
+ * This method is only available on the `DropERC20` contract.
21
21
  * @param options - The options for the transaction.
22
22
  * @returns Whether the user can claim the drop.
23
23
  *
@@ -5,6 +5,7 @@ import * as MultiById from "../../__generated__/IDropERC20/read/getClaimConditio
5
5
 
6
6
  /**
7
7
  * Retrieves the active claim condition.
8
+ * This method is only available on the `DropERC20` contract.
8
9
  * @param options - The transaction options.
9
10
  * @returns A promise that resolves to the active claim condition.
10
11
  * @throws An error if the claim condition is unsupported.
@@ -5,6 +5,7 @@ import * as MultiById from "../../__generated__/IDropERC20/read/getClaimConditio
5
5
 
6
6
  /**
7
7
  * Retrieves all claim conditions.
8
+ * This method is only available on the `DropERC20` contract.
8
9
  * @param options - The transaction options.
9
10
  * @returns A promise that resolves to all claim conditions.
10
11
  * @throws An error if the claim conditions are unsupported by the contract.
@@ -18,6 +18,8 @@ export type ClaimToParams = {
18
18
 
19
19
  /**
20
20
  * Claim ERC20 NFTs to a specified address
21
+ * This method is only available on the `DropERC20` contract.
22
+ *
21
23
  * @param options - The options for the transaction
22
24
  * @extension ERC20
23
25
  * @example
@@ -12,6 +12,7 @@ import {
12
12
 
13
13
  /**
14
14
  * Reset the claim eligibility for all users.
15
+ * This method is only available on the `DropERC20` contract.
15
16
  * @param options
16
17
  * @returns the prepared transaction
17
18
  * @extension ERC20
@@ -21,6 +21,7 @@ export type SetClaimConditionsParams = {
21
21
 
22
22
  /**
23
23
  * Set the claim conditions for a ERC20 drop
24
+ * This method is only available on the `DropERC20` contract.
24
25
  * @param options
25
26
  * @returns the prepared transaction
26
27
  * @extension ERC20
@@ -27,6 +27,7 @@ export type MintToParams = Prettify<
27
27
 
28
28
  /**
29
29
  * Mints a specified amount of tokens to a given address.
30
+ * This method is only available on the `TokenERC20` contract.
30
31
  * @param options - The options for minting tokens.
31
32
  * @returns A prepared transaction object.
32
33
  * @extension ERC20
@@ -17,6 +17,7 @@ import {
17
17
 
18
18
  /**
19
19
  * Mints a new ERC20 token with the given minter signature
20
+ * This method is only available on the `TokenERC20` contract.
20
21
  * @param options - The transaction options.
21
22
  * @extension ERC20
22
23
  * @example
@@ -18,6 +18,8 @@ export type CanClaimResult = {
18
18
  /**
19
19
  * Check if a user can claim a drop.
20
20
  *
21
+ * This method is only available on the `DropERC721` contract.
22
+ *
21
23
  * @param options - The options for the transaction.
22
24
  * @returns Whether the user can claim the drop.
23
25
  *
@@ -5,6 +5,8 @@ import * as ById from "../../__generated__/IDrop/read/getClaimConditionById.js";
5
5
 
6
6
  /**
7
7
  * Retrieves the active claim condition.
8
+ * This method is only available on the `DropERC721` contract.
9
+ *
8
10
  * @param options - The transaction options.
9
11
  * @returns A promise that resolves to the active claim condition.
10
12
  * @throws An error if the claim condition is unsupported.
@@ -28,6 +30,8 @@ export async function getActiveClaimCondition(
28
30
 
29
31
  /**
30
32
  * Checks if the `getActiveClaimCondition` method is supported by the given contract.
33
+ * This method is only available on the `DropERC721` contract.
34
+ *
31
35
  * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
32
36
  * @returns A boolean indicating if the `getActiveClaimCondition` method is supported.
33
37
  * @extension ERC721
@@ -5,6 +5,9 @@ import * as MultiById from "../../__generated__/IDrop/read/getClaimConditionById
5
5
 
6
6
  /**
7
7
  * Retrieves all claim conditions.
8
+ *
9
+ * This method is only available on the `DropERC721` contract.
10
+ *
8
11
  * @param options - The transaction options.
9
12
  * @returns A promise that resolves to all claim conditions.
10
13
  * @throws An error if the claim conditions are unsupported by the contract.
@@ -22,6 +22,7 @@ export type ClaimToParams = {
22
22
 
23
23
  /**
24
24
  * Claim ERC721 NFTs to a specified address
25
+ * This method is only available on the `DropERC721` contract.
25
26
  * @param options - The options for the transaction
26
27
  * @extension ERC721
27
28
  * @example
@@ -22,6 +22,7 @@ export type ClaimToBatchParams = WithOverrides<{
22
22
  * This extension batches multiple `claimTo` extensions into one single multicall.
23
23
  * Keep in mind that there is a limit of how many NFTs you can claim per transaction.
24
24
  * This limit varies depends on the network that you are transacting on.
25
+ * This method is only available on the `DropERC721` contract.
25
26
  *
26
27
  * You are recommended to experiment with the number to figure out the best number for your chain of choice.
27
28
  * @extension ERC721
@@ -12,6 +12,7 @@ import {
12
12
 
13
13
  /**
14
14
  * Reset the claim eligibility for all users.
15
+ * This method is only available on the `DropERC721` contract.
15
16
  * @param options
16
17
  * @returns the prepared transaction
17
18
  * @extension ERC721
@@ -21,6 +21,7 @@ export type SetClaimConditionsParams = {
21
21
 
22
22
  /**
23
23
  * Set the claim conditions for a ERC721 drop
24
+ * This method is only available on the `DropERC721` contract.
24
25
  * @param options
25
26
  * @returns the prepared transaction
26
27
  * @extension ERC721
@@ -32,6 +32,7 @@ export type CreateDelayedRevealBatchParams = {
32
32
 
33
33
  /**
34
34
  * Creates a batch of encrypted NFTs that can be revealed at a later time.
35
+ * This method is only available on the `DropERC721` contract.
35
36
  *
36
37
  * @param options {CreateDelayedRevealBatchParams} - The delayed reveal options.
37
38
  * @param options.placeholderMetadata {@link NFTInput} - The placeholder metadata for the batch.
@@ -14,7 +14,7 @@ export type RevealParams = {
14
14
 
15
15
  /**
16
16
  * Reveals a previously lazy minted batch of NFTs.
17
- *
17
+ * This method is only available on the `DropERC721` contract.
18
18
  * @param options {RevealParams} - The reveal parameters.
19
19
  * @param options.batchId {number} - The ID of the batch to reveal. Get this by calling `getBatchesToReveal`. {@see getBatchesToReveal}
20
20
  * @param options.password {string} - The password for the reveal, set when the batch was created. {@see createDelayedRevealBatch}
@@ -19,6 +19,8 @@ export type LazyMintParams = {
19
19
 
20
20
  /**
21
21
  * Lazily mints ERC721 tokens.
22
+ * This method is only available on the `DropERC721` contract.
23
+ *
22
24
  * @param options - The options for the lazy minting process.
23
25
  * @returns A promise that resolves to the prepared contract call.
24
26
  * @extension ERC721
@@ -17,6 +17,8 @@ export type MintToParams = WithOverrides<{
17
17
 
18
18
  /**
19
19
  * Mints a new ERC721 token and assigns it to the specified address.
20
+ * This method is only available on the `TokenERC721` contract.
21
+ *
20
22
  * If the `nft` parameter is a string, it will be used as the token URI.
21
23
  * If the `nft` parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI.
22
24
  * @param options - The transaction options.
@@ -22,6 +22,8 @@ import {
22
22
 
23
23
  /**
24
24
  * Mints a new ERC721 token with the given minter signature
25
+ * This method is only available on the `TokenERC721` contract.
26
+ *
25
27
  * @param options - The transaction options.
26
28
  * @example
27
29
  * ```ts
@@ -23,6 +23,7 @@ export type UpdateTokenURIParams = {
23
23
  * upload that content to IPFS and pass the IPFS URI (of said `NFTInput`) to the underlying `setTokenURI` method.
24
24
  *
25
25
  * This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update.
26
+ * This method is only available on the `TokenERC721` contract.
26
27
  *
27
28
  * @extension ERC721
28
29
  * @returns the prepared transaction from `setTokenURI`
@@ -63,6 +63,7 @@ import { SwapFlow } from "./swap/SwapFlow.js";
63
63
  import { SwapScreenContent } from "./swap/SwapScreenContent.js";
64
64
  import { TokenSelectorScreen } from "./swap/TokenSelectorScreen.js";
65
65
  import { TransferFlow } from "./swap/TransferFlow.js";
66
+ import { useWalletsAndBalances } from "./swap/fetchBalancesForWallet.js";
66
67
  import {
67
68
  type SupportedChainAndTokens,
68
69
  useBuySupportedDestinations,
@@ -218,6 +219,15 @@ function BuyScreenContent(props: BuyScreenContentProps) {
218
219
  );
219
220
  }, [props.supportedTokens, supportedSourcesQuery.data, payOptions]);
220
221
 
222
+ // preload wallets and balances
223
+ useWalletsAndBalances({
224
+ client: props.client,
225
+ sourceSupportedTokens: sourceSupportedTokens || [],
226
+ toChain: toChain,
227
+ toToken: toToken,
228
+ mode: payOptions.mode,
229
+ });
230
+
221
231
  const { fromChain, setFromChain, fromToken, setFromToken } =
222
232
  useFromTokenSelectionStates({
223
233
  payOptions,
@@ -4,7 +4,6 @@ import {
4
4
  ChevronRightIcon,
5
5
  Cross2Icon,
6
6
  } from "@radix-ui/react-icons";
7
- import { useQuery } from "@tanstack/react-query";
8
7
  import { trackPayEvent } from "../../../../../../../analytics/track/pay.js";
9
8
  import type { Chain } from "../../../../../../../chains/types.js";
10
9
  import type { ThirdwebClient } from "../../../../../../../client/client.js";
@@ -43,14 +42,9 @@ import { FiatValue } from "./FiatValue.js";
43
42
  import { WalletRow } from "./WalletRow.js";
44
43
  import {
45
44
  type TokenBalance,
46
- fetchBalancesForWallet,
45
+ useWalletsAndBalances,
47
46
  } from "./fetchBalancesForWallet.js";
48
47
 
49
- type WalletKey = {
50
- id: WalletId;
51
- address: string;
52
- };
53
-
54
48
  export function TokenSelectorScreen(props: {
55
49
  client: ThirdwebClient;
56
50
  sourceTokens: SupportedTokens | undefined;
@@ -71,46 +65,12 @@ export function TokenSelectorScreen(props: {
71
65
  const chainInfo = useChainMetadata(props.toChain);
72
66
  const theme = useCustomTheme();
73
67
 
74
- const walletsAndBalances = useQuery({
75
- queryKey: [
76
- "wallets-and-balances",
77
- props.sourceSupportedTokens,
78
- props.toChain.id,
79
- props.toToken,
80
- props.tokenAmount,
81
- props.mode,
82
- activeAccount?.address,
83
- connectedWallets.map((w) => w.getAccount()?.address),
84
- ],
85
- enabled: !!props.sourceSupportedTokens && !!chainInfo.data,
86
- queryFn: async () => {
87
- const entries = await Promise.all(
88
- connectedWallets.map(async (wallet) => {
89
- const balances = await fetchBalancesForWallet({
90
- wallet,
91
- accountAddress: activeAccount?.address,
92
- sourceSupportedTokens: props.sourceSupportedTokens || [],
93
- toChain: props.toChain,
94
- toToken: props.toToken,
95
- tokenAmount: props.tokenAmount,
96
- mode: props.mode,
97
- client: props.client,
98
- });
99
- return [
100
- {
101
- id: wallet.id,
102
- address: wallet.getAccount()?.address || "",
103
- } as WalletKey,
104
- balances,
105
- ] as const;
106
- }),
107
- );
108
- const map = new Map<WalletKey, TokenBalance[]>();
109
- for (const entry of entries) {
110
- map.set(entry[0], entry[1]);
111
- }
112
- return map;
113
- },
68
+ const walletsAndBalances = useWalletsAndBalances({
69
+ client: props.client,
70
+ sourceSupportedTokens: props.sourceSupportedTokens || [],
71
+ toChain: props.toChain,
72
+ toToken: props.toToken,
73
+ mode: props.mode,
114
74
  });
115
75
 
116
76
  if (
@@ -1,3 +1,4 @@
1
+ import { useQuery } from "@tanstack/react-query";
1
2
  import type { Chain } from "../../../../../../../chains/types.js";
2
3
  import { getCachedChain } from "../../../../../../../chains/utils.js";
3
4
  import type { ThirdwebClient } from "../../../../../../../client/client.js";
@@ -9,7 +10,11 @@ import {
9
10
  type GetWalletBalanceResult,
10
11
  getWalletBalance,
11
12
  } from "../../../../../../../wallets/utils/getWalletBalance.js";
13
+ import type { WalletId } from "../../../../../../../wallets/wallet-types.js";
12
14
  import type { PayUIOptions } from "../../../../../../core/hooks/connection/ConnectButtonProps.js";
15
+ import { useChainMetadata } from "../../../../../../core/hooks/others/useChainQuery.js";
16
+ import { useActiveAccount } from "../../../../../../core/hooks/wallets/useActiveAccount.js";
17
+ import { useConnectedWallets } from "../../../../../../core/hooks/wallets/useConnectedWallets.js";
13
18
  import type {
14
19
  SupportedTokens,
15
20
  TokenInfo,
@@ -32,7 +37,6 @@ type FetchBalancesParams = {
32
37
  sourceSupportedTokens: SupportedTokens;
33
38
  toChain: Chain;
34
39
  toToken: ERC20OrNativeToken;
35
- tokenAmount: string;
36
40
  mode: PayUIOptions["mode"];
37
41
  client: ThirdwebClient;
38
42
  };
@@ -43,13 +47,70 @@ export type TokenBalance = {
43
47
  token: TokenInfo;
44
48
  };
45
49
 
46
- export async function fetchBalancesForWallet({
50
+ type WalletKey = {
51
+ id: WalletId;
52
+ address: string;
53
+ };
54
+
55
+ export function useWalletsAndBalances(props: {
56
+ sourceSupportedTokens: SupportedTokens;
57
+ toChain: Chain;
58
+ toToken: ERC20OrNativeToken;
59
+ mode: PayUIOptions["mode"];
60
+ client: ThirdwebClient;
61
+ }) {
62
+ const activeAccount = useActiveAccount();
63
+ const connectedWallets = useConnectedWallets();
64
+ const chainInfo = useChainMetadata(props.toChain);
65
+
66
+ return useQuery({
67
+ queryKey: [
68
+ "wallets-and-balances",
69
+ props.sourceSupportedTokens,
70
+ props.toChain.id,
71
+ props.toToken,
72
+ props.mode,
73
+ activeAccount?.address,
74
+ connectedWallets.map((w) => w.getAccount()?.address),
75
+ ],
76
+ enabled:
77
+ !!props.sourceSupportedTokens && !!chainInfo.data && !!activeAccount,
78
+ queryFn: async () => {
79
+ const entries = await Promise.all(
80
+ connectedWallets.map(async (wallet) => {
81
+ const balances = await fetchBalancesForWallet({
82
+ wallet,
83
+ accountAddress: activeAccount?.address,
84
+ sourceSupportedTokens: props.sourceSupportedTokens || [],
85
+ toChain: props.toChain,
86
+ toToken: props.toToken,
87
+ mode: props.mode,
88
+ client: props.client,
89
+ });
90
+ return [
91
+ {
92
+ id: wallet.id,
93
+ address: wallet.getAccount()?.address || "",
94
+ } as WalletKey,
95
+ balances,
96
+ ] as const;
97
+ }),
98
+ );
99
+ const map = new Map<WalletKey, TokenBalance[]>();
100
+ for (const entry of entries) {
101
+ map.set(entry[0], entry[1]);
102
+ }
103
+ return map;
104
+ },
105
+ });
106
+ }
107
+
108
+ async function fetchBalancesForWallet({
47
109
  wallet,
48
110
  accountAddress,
49
111
  sourceSupportedTokens,
50
112
  toChain,
51
113
  toToken,
52
- tokenAmount,
53
114
  mode,
54
115
  client,
55
116
  }: FetchBalancesParams): Promise<TokenBalance[]> {
@@ -133,7 +194,7 @@ export async function fetchBalancesForWallet({
133
194
  b.chain.id === chainId &&
134
195
  b.token.address.toLowerCase() === token.address.toLowerCase(),
135
196
  );
136
- if (!isNative && !isAlreadyFetched) {
197
+ if (isAlreadyFetched && !isNative) {
137
198
  // ERC20 on insight-enabled chain already handled by insight call
138
199
  continue;
139
200
  }
@@ -148,11 +209,12 @@ export async function fetchBalancesForWallet({
148
209
  });
149
210
 
150
211
  const include =
151
- token.address === destinationToken.address &&
212
+ token.address.toLowerCase() ===
213
+ destinationToken.address.toLowerCase() &&
152
214
  chain.id === toChain.id
153
- ? mode === "fund_wallet" && account.address === accountAddress
154
- ? false
155
- : Number(balance.displayValue) > Number(tokenAmount)
215
+ ? !(
216
+ mode === "fund_wallet" && account.address === accountAddress
217
+ )
156
218
  : balance.value > 0n;
157
219
 
158
220
  if (include) {
@@ -0,0 +1,15 @@
1
+ import type { AsyncStorage } from "./AsyncStorage.js";
2
+
3
+ const store = new Map<string, string>();
4
+
5
+ export const inMemoryStorage: AsyncStorage = {
6
+ getItem: async (key: string) => {
7
+ return store.get(key) ?? null;
8
+ },
9
+ setItem: async (key: string, value: string) => {
10
+ store.set(key, value);
11
+ },
12
+ removeItem: async (key: string) => {
13
+ store.delete(key);
14
+ },
15
+ };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.99.0";
1
+ export const version = "5.99.1-nightly-fb4c190eb3fa2da13da668281adf3ae45ed457a2-20250514000358";
@@ -141,10 +141,14 @@ import type { InAppWalletCreationOptions } from "../core/wallet/types.js";
141
141
  *
142
142
  * ### Connect to a backend account
143
143
  *
144
+ * for usage in backends, you might also need to provide a 'storage' to store auth tokens. In-memory usually works for most purposes.
145
+ *
144
146
  * ```ts
145
147
  * import { inAppWallet } from "thirdweb/wallets";
146
148
  *
147
- * const wallet = inAppWallet();
149
+ * const wallet = inAppWallet({
150
+ * storage: inMemoryStorage, // for usage in backends/scripts
151
+ * });
148
152
  *
149
153
  * const account = await wallet.connect({
150
154
  * client,
@@ -0,0 +1,27 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { TEST_CLIENT } from "~test/test-clients.js";
3
+ import { sepolia } from "../../../../chains/chain-definitions/sepolia.js";
4
+ import { inMemoryStorage } from "../../../../utils/storage/inMemoryStorage.js";
5
+ import { inAppWallet } from "../in-app.js";
6
+
7
+ describe("InAppWallet", () => {
8
+ it("should sign a message with backend strategy", async () => {
9
+ const wallet = inAppWallet({
10
+ smartAccount: {
11
+ chain: sepolia,
12
+ sponsorGas: true,
13
+ },
14
+ storage: inMemoryStorage,
15
+ });
16
+ const account = await wallet.connect({
17
+ client: TEST_CLIENT,
18
+ strategy: "backend",
19
+ walletSecret: "test-secret",
20
+ });
21
+ expect(account.address).toBeDefined();
22
+ const message = await account.signMessage({
23
+ message: "Hello, world!",
24
+ });
25
+ expect(message).toBeDefined();
26
+ });
27
+ });