thirdweb 5.64.4-nightly-043ee925981bdc39649d30ad65d2fce922515ab0-20241030000335 → 5.64.4

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 (248) hide show
  1. package/dist/cjs/exports/wallets/smart.js +2 -1
  2. package/dist/cjs/exports/wallets/smart.js.map +1 -1
  3. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.js +31 -0
  4. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.js.map +1 -0
  5. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.js +33 -0
  6. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.js.map +1 -0
  7. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.js +149 -0
  8. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.js.map +1 -0
  9. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.js +193 -0
  10. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.js.map +1 -0
  11. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.js +173 -0
  12. package/dist/cjs/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.js.map +1 -0
  13. package/dist/cjs/extensions/erc1155/drops/write/claimTo.js +5 -2
  14. package/dist/cjs/extensions/erc1155/drops/write/claimTo.js.map +1 -1
  15. package/dist/cjs/extensions/erc1155/drops/write/setClaimConditions.js +4 -1
  16. package/dist/cjs/extensions/erc1155/drops/write/setClaimConditions.js.map +1 -1
  17. package/dist/cjs/extensions/erc20/drops/write/claimTo.js +1 -0
  18. package/dist/cjs/extensions/erc20/drops/write/claimTo.js.map +1 -1
  19. package/dist/cjs/extensions/erc20/drops/write/setClaimConditions.js +1 -0
  20. package/dist/cjs/extensions/erc20/drops/write/setClaimConditions.js.map +1 -1
  21. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/events/ClaimConditionUpdated.js +27 -0
  22. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/events/ClaimConditionUpdated.js.map +1 -0
  23. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.js +33 -0
  24. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.js.map +1 -0
  25. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.js +105 -0
  26. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.js.map +1 -0
  27. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/write/claim.js +184 -0
  28. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/write/claim.js.map +1 -0
  29. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.js +164 -0
  30. package/dist/cjs/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.js.map +1 -0
  31. package/dist/cjs/extensions/erc721/drops/write/claimTo.js +6 -3
  32. package/dist/cjs/extensions/erc721/drops/write/claimTo.js.map +1 -1
  33. package/dist/cjs/extensions/erc721/drops/write/setClaimConditions.js +4 -1
  34. package/dist/cjs/extensions/erc721/drops/write/setClaimConditions.js.map +1 -1
  35. package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +2 -1
  36. package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
  37. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +3 -2
  38. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  39. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -1
  40. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  41. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +4 -3
  42. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
  43. package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +2 -1
  44. package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
  45. package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +2 -1
  46. package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
  47. package/dist/cjs/transaction/prepare-contract-call.js +23 -0
  48. package/dist/cjs/transaction/prepare-contract-call.js.map +1 -1
  49. package/dist/cjs/utils/extensions/drops/get-claim-params.js +20 -0
  50. package/dist/cjs/utils/extensions/drops/get-claim-params.js.map +1 -1
  51. package/dist/cjs/utils/extensions/drops/get-multicall-set-claim-claim-conditon-transactions.js +39 -12
  52. package/dist/cjs/utils/extensions/drops/get-multicall-set-claim-claim-conditon-transactions.js.map +1 -1
  53. package/dist/cjs/utils/url.js +8 -0
  54. package/dist/cjs/utils/url.js.map +1 -1
  55. package/dist/cjs/version.js +1 -1
  56. package/dist/cjs/version.js.map +1 -1
  57. package/dist/cjs/wallets/in-app/core/authentication/authEndpoint.js +7 -6
  58. package/dist/cjs/wallets/in-app/core/authentication/authEndpoint.js.map +1 -1
  59. package/dist/cjs/wallets/in-app/core/authentication/guest.js +17 -20
  60. package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -1
  61. package/dist/cjs/wallets/in-app/core/authentication/jwt.js +7 -6
  62. package/dist/cjs/wallets/in-app/core/authentication/jwt.js.map +1 -1
  63. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js +0 -1
  64. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  65. package/dist/cjs/wallets/in-app/native/native-connector.js +2 -2
  66. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  67. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +17 -20
  68. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  69. package/dist/cjs/wallets/smart/lib/calls.js +31 -0
  70. package/dist/cjs/wallets/smart/lib/calls.js.map +1 -1
  71. package/dist/cjs/wallets/smart/lib/userop.js +1 -0
  72. package/dist/cjs/wallets/smart/lib/userop.js.map +1 -1
  73. package/dist/esm/exports/wallets/smart.js +1 -1
  74. package/dist/esm/exports/wallets/smart.js.map +1 -1
  75. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.js +28 -0
  76. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.js.map +1 -0
  77. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.js +30 -0
  78. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.js.map +1 -0
  79. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.js +141 -0
  80. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.js.map +1 -0
  81. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.js +186 -0
  82. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.js.map +1 -0
  83. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.js +166 -0
  84. package/dist/esm/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.js.map +1 -0
  85. package/dist/esm/extensions/erc1155/drops/write/claimTo.js +5 -2
  86. package/dist/esm/extensions/erc1155/drops/write/claimTo.js.map +1 -1
  87. package/dist/esm/extensions/erc1155/drops/write/setClaimConditions.js +4 -1
  88. package/dist/esm/extensions/erc1155/drops/write/setClaimConditions.js.map +1 -1
  89. package/dist/esm/extensions/erc20/drops/write/claimTo.js +1 -0
  90. package/dist/esm/extensions/erc20/drops/write/claimTo.js.map +1 -1
  91. package/dist/esm/extensions/erc20/drops/write/setClaimConditions.js +1 -0
  92. package/dist/esm/extensions/erc20/drops/write/setClaimConditions.js.map +1 -1
  93. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/events/ClaimConditionUpdated.js +24 -0
  94. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/events/ClaimConditionUpdated.js.map +1 -0
  95. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.js +30 -0
  96. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.js.map +1 -0
  97. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.js +99 -0
  98. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.js.map +1 -0
  99. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/write/claim.js +177 -0
  100. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/write/claim.js.map +1 -0
  101. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.js +157 -0
  102. package/dist/esm/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.js.map +1 -0
  103. package/dist/esm/extensions/erc721/drops/write/claimTo.js +6 -3
  104. package/dist/esm/extensions/erc721/drops/write/claimTo.js.map +1 -1
  105. package/dist/esm/extensions/erc721/drops/write/setClaimConditions.js +4 -1
  106. package/dist/esm/extensions/erc721/drops/write/setClaimConditions.js.map +1 -1
  107. package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +2 -1
  108. package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
  109. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +3 -2
  110. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  111. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -1
  112. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  113. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +4 -3
  114. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
  115. package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +2 -1
  116. package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
  117. package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +2 -1
  118. package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
  119. package/dist/esm/transaction/prepare-contract-call.js +23 -0
  120. package/dist/esm/transaction/prepare-contract-call.js.map +1 -1
  121. package/dist/esm/utils/extensions/drops/get-claim-params.js +20 -0
  122. package/dist/esm/utils/extensions/drops/get-claim-params.js.map +1 -1
  123. package/dist/esm/utils/extensions/drops/get-multicall-set-claim-claim-conditon-transactions.js +39 -12
  124. package/dist/esm/utils/extensions/drops/get-multicall-set-claim-claim-conditon-transactions.js.map +1 -1
  125. package/dist/esm/utils/url.js +6 -0
  126. package/dist/esm/utils/url.js.map +1 -1
  127. package/dist/esm/version.js +1 -1
  128. package/dist/esm/version.js.map +1 -1
  129. package/dist/esm/wallets/in-app/core/authentication/authEndpoint.js +7 -6
  130. package/dist/esm/wallets/in-app/core/authentication/authEndpoint.js.map +1 -1
  131. package/dist/esm/wallets/in-app/core/authentication/guest.js +17 -20
  132. package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -1
  133. package/dist/esm/wallets/in-app/core/authentication/jwt.js +7 -6
  134. package/dist/esm/wallets/in-app/core/authentication/jwt.js.map +1 -1
  135. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js +1 -1
  136. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  137. package/dist/esm/wallets/in-app/native/native-connector.js +2 -2
  138. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  139. package/dist/esm/wallets/in-app/web/lib/web-connector.js +17 -20
  140. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  141. package/dist/esm/wallets/smart/lib/calls.js +30 -0
  142. package/dist/esm/wallets/smart/lib/calls.js.map +1 -1
  143. package/dist/esm/wallets/smart/lib/userop.js +1 -0
  144. package/dist/esm/wallets/smart/lib/userop.js.map +1 -1
  145. package/dist/types/exports/wallets/smart.d.ts +1 -1
  146. package/dist/types/exports/wallets/smart.d.ts.map +1 -1
  147. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.d.ts +72 -0
  148. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.d.ts.map +1 -0
  149. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.d.ts +64 -0
  150. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.d.ts.map +1 -0
  151. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.d.ts +101 -0
  152. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.d.ts.map +1 -0
  153. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.d.ts +139 -0
  154. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.d.ts.map +1 -0
  155. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.d.ts +127 -0
  156. package/dist/types/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.d.ts.map +1 -0
  157. package/dist/types/extensions/erc1155/drops/write/claimTo.d.ts +1 -0
  158. package/dist/types/extensions/erc1155/drops/write/claimTo.d.ts.map +1 -1
  159. package/dist/types/extensions/erc1155/drops/write/setClaimConditions.d.ts +1 -0
  160. package/dist/types/extensions/erc1155/drops/write/setClaimConditions.d.ts.map +1 -1
  161. package/dist/types/extensions/erc20/drops/write/claimTo.d.ts +1 -0
  162. package/dist/types/extensions/erc20/drops/write/claimTo.d.ts.map +1 -1
  163. package/dist/types/extensions/erc20/drops/write/setClaimConditions.d.ts +1 -0
  164. package/dist/types/extensions/erc20/drops/write/setClaimConditions.d.ts.map +1 -1
  165. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/events/ClaimConditionUpdated.d.ts +54 -0
  166. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/events/ClaimConditionUpdated.d.ts.map +1 -0
  167. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.d.ts +64 -0
  168. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.d.ts.map +1 -0
  169. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.d.ts +62 -0
  170. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.d.ts.map +1 -0
  171. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/write/claim.d.ts +132 -0
  172. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/write/claim.d.ts.map +1 -0
  173. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.d.ts +120 -0
  174. package/dist/types/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.d.ts.map +1 -0
  175. package/dist/types/extensions/erc721/drops/write/claimTo.d.ts +1 -0
  176. package/dist/types/extensions/erc721/drops/write/claimTo.d.ts.map +1 -1
  177. package/dist/types/extensions/erc721/drops/write/setClaimConditions.d.ts +1 -0
  178. package/dist/types/extensions/erc721/drops/write/setClaimConditions.d.ts.map +1 -1
  179. package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts.map +1 -1
  180. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
  181. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +1 -1
  182. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +1 -1
  183. package/dist/types/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.d.ts.map +1 -1
  184. package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
  185. package/dist/types/transaction/prepare-contract-call.d.ts +23 -0
  186. package/dist/types/transaction/prepare-contract-call.d.ts.map +1 -1
  187. package/dist/types/utils/extensions/drops/get-claim-params.d.ts +1 -0
  188. package/dist/types/utils/extensions/drops/get-claim-params.d.ts.map +1 -1
  189. package/dist/types/utils/extensions/drops/get-multicall-set-claim-claim-conditon-transactions.d.ts +1 -0
  190. package/dist/types/utils/extensions/drops/get-multicall-set-claim-claim-conditon-transactions.d.ts.map +1 -1
  191. package/dist/types/utils/url.d.ts +2 -0
  192. package/dist/types/utils/url.d.ts.map +1 -1
  193. package/dist/types/version.d.ts +1 -1
  194. package/dist/types/version.d.ts.map +1 -1
  195. package/dist/types/wallets/in-app/core/authentication/authEndpoint.d.ts +2 -2
  196. package/dist/types/wallets/in-app/core/authentication/authEndpoint.d.ts.map +1 -1
  197. package/dist/types/wallets/in-app/core/authentication/guest.d.ts.map +1 -1
  198. package/dist/types/wallets/in-app/core/authentication/jwt.d.ts +2 -2
  199. package/dist/types/wallets/in-app/core/authentication/jwt.d.ts.map +1 -1
  200. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts +0 -4
  201. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
  202. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +1 -1
  203. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  204. package/dist/types/wallets/smart/lib/calls.d.ts +27 -1
  205. package/dist/types/wallets/smart/lib/calls.d.ts.map +1 -1
  206. package/dist/types/wallets/smart/lib/userop.d.ts.map +1 -1
  207. package/package.json +1 -1
  208. package/src/exports/wallets/smart.ts +4 -1
  209. package/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.ts +43 -0
  210. package/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.ts +53 -0
  211. package/src/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.ts +160 -0
  212. package/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.ts +229 -0
  213. package/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.ts +213 -0
  214. package/src/extensions/erc1155/customDrop1155.test.ts +181 -0
  215. package/src/extensions/erc1155/drops/write/claimTo.ts +6 -2
  216. package/src/extensions/erc1155/drops/write/setClaimConditions.ts +5 -1
  217. package/src/extensions/erc20/customDrop20.test.ts +80 -0
  218. package/src/extensions/erc20/drops/write/claimTo.ts +2 -0
  219. package/src/extensions/erc20/drops/write/setClaimConditions.ts +2 -0
  220. package/src/extensions/erc721/__generated__/IDropSinglePhase/events/ClaimConditionUpdated.ts +25 -0
  221. package/src/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.ts +53 -0
  222. package/src/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.ts +105 -0
  223. package/src/extensions/erc721/__generated__/IDropSinglePhase/write/claim.ts +219 -0
  224. package/src/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.ts +203 -0
  225. package/src/extensions/erc721/customDrop721.test.ts +115 -0
  226. package/src/extensions/erc721/drops/write/claimTo.ts +7 -3
  227. package/src/extensions/erc721/drops/write/setClaimConditions.ts +5 -1
  228. package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +5 -1
  229. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +9 -2
  230. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +5 -3
  231. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +13 -3
  232. package/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx +2 -1
  233. package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +5 -1
  234. package/src/transaction/prepare-contract-call.ts +23 -0
  235. package/src/utils/extensions/drops/get-claim-params.ts +29 -2
  236. package/src/utils/extensions/drops/get-multicall-set-claim-claim-conditon-transactions.ts +46 -16
  237. package/src/utils/url.ts +8 -0
  238. package/src/version.ts +1 -1
  239. package/src/wallets/in-app/core/authentication/authEndpoint.ts +11 -8
  240. package/src/wallets/in-app/core/authentication/guest.ts +16 -19
  241. package/src/wallets/in-app/core/authentication/jwt.ts +11 -8
  242. package/src/wallets/in-app/native/helpers/api/fetchers.ts +1 -1
  243. package/src/wallets/in-app/native/native-connector.ts +2 -2
  244. package/src/wallets/in-app/web/lib/web-connector.ts +20 -20
  245. package/src/wallets/smart/lib/calls.ts +42 -1
  246. package/src/wallets/smart/lib/userop.ts +1 -0
  247. package/src/wallets/smart/smart-wallet-integration-v07.test.ts +8 -0
  248. package/src/wallets/smart/smart-wallet-integration.test.ts +7 -0
@@ -4,6 +4,7 @@ import type { ThirdwebClient } from "../../../../../../../client/client.js";
4
4
  import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
5
5
  import type { ValidBuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
6
6
  import { shortenAddress } from "../../../../../../../utils/address.js";
7
+ import { formatExplorerTxUrl } from "../../../../../../../utils/url.js";
7
8
  import {
8
9
  fontSize,
9
10
  iconSize,
@@ -199,7 +200,10 @@ export function SwapTxDetailsTable(
199
200
  <ButtonLink
200
201
  fullWidth
201
202
  variant="outline"
202
- href={`${fromChainExplorers.explorers[0].url}/tx/${sourceTxHash}`}
203
+ href={formatExplorerTxUrl(
204
+ fromChainExplorers.explorers[0]?.url,
205
+ sourceTxHash,
206
+ )}
203
207
  target="_blank"
204
208
  gap="xs"
205
209
  style={{
@@ -330,7 +334,10 @@ export function SwapTxDetailsTable(
330
334
  <ButtonLink
331
335
  fullWidth
332
336
  variant="outline"
333
- href={`${fromChainExplorers.explorers[0].url}/tx/${sourceTxHash}`}
337
+ href={formatExplorerTxUrl(
338
+ fromChainExplorers.explorers[0]?.url,
339
+ sourceTxHash,
340
+ )}
334
341
  target="_blank"
335
342
  gap="xs"
336
343
  style={{
@@ -352,7 +359,10 @@ export function SwapTxDetailsTable(
352
359
  <ButtonLink
353
360
  fullWidth
354
361
  variant="outline"
355
- href={`${toChainExplorers.explorers[0].url}/tx/${destinationTxHash}`}
362
+ href={formatExplorerTxUrl(
363
+ toChainExplorers.explorers[0]?.url,
364
+ destinationTxHash,
365
+ )}
356
366
  target="_blank"
357
367
  gap="xs"
358
368
  style={{
@@ -7,6 +7,7 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
7
7
  import { getTransactionStore } from "../../../../../transaction/transaction-store.js";
8
8
  import { shortenHex } from "../../../../../utils/address.js";
9
9
  import type { Hex } from "../../../../../utils/encoding/hex.js";
10
+ import { formatExplorerTxUrl } from "../../../../../utils/url.js";
10
11
  import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
11
12
  import { iconSize, spacing } from "../../../../core/design-system/index.js";
12
13
  import { useWaitForReceipt } from "../../../../core/hooks/contract/useWaitForReceipt.js";
@@ -192,7 +193,7 @@ function TransactionButton(props: {
192
193
  if (props.explorerUrl) {
193
194
  return (
194
195
  <a
195
- href={`${props.explorerUrl}/tx/${props.hash}`}
196
+ href={formatExplorerTxUrl(props.explorerUrl, props.hash)}
196
197
  target="_blank"
197
198
  rel="noreferrer"
198
199
  >
@@ -3,6 +3,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
3
3
  import type { Hex } from "viem";
4
4
  import type { WaitForReceiptOptions } from "../../../../transaction/actions/wait-for-tx-receipt.js";
5
5
  import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
6
+ import { formatExplorerTxUrl } from "../../../../utils/url.js";
6
7
  import { iconSize } from "../../../core/design-system/index.js";
7
8
  import { useChainExplorers } from "../../../core/hooks/others/useChainQuery.js";
8
9
  import { useSendTransaction } from "../../hooks/transaction/useSendTransaction.js";
@@ -106,7 +107,10 @@ export function ExecutingTxScreen(props: {
106
107
  <ButtonLink
107
108
  fullWidth
108
109
  variant="outline"
109
- href={`${chainExplorers.explorers[0]?.url}/tx/${txHash}`}
110
+ href={formatExplorerTxUrl(
111
+ chainExplorers.explorers[0]?.url ?? "",
112
+ txHash,
113
+ )}
110
114
  target="_blank"
111
115
  as="a"
112
116
  gap="xs"
@@ -92,6 +92,29 @@ export type PrepareContractCallOptions<
92
92
  * });
93
93
  * ```
94
94
  *
95
+ * ### Usage with ERC20 value:
96
+ *
97
+ * For transactions that transfer ERC20 tokens, you can specify the value as the amount of tokens to transfer.
98
+ *
99
+ * You can use this in conjuction with the [`getApprovalForTransaction`](https://portal.thirdweb.com/references/typescript/v5/getApprovalForTransaction) function to easily create approval transactions for ERC20 tokens.
100
+ *
101
+ * This value will also be read by the react hooks and UI components to present to total cost to the user.
102
+ *
103
+ * ```ts
104
+ * import { prepareContractCall } from "thirdweb";
105
+ * import { toWei } from "thirdweb/utils";
106
+ *
107
+ * const transaction = prepareContractCall({
108
+ * contract,
109
+ * method: "function payWithCoin()",
110
+ * params: [],
111
+ * erc20Value: {
112
+ * tokenAddress: "0x...", // the address of the ERC20 token
113
+ * amountWei: toWei("0.1"), // the amount of tokens to transfer in wei
114
+ * },
115
+ * });
116
+ * ```
117
+ *
95
118
  * ### Usage with a JSON ABI function object:
96
119
  *
97
120
  * ```ts
@@ -6,13 +6,14 @@ import {
6
6
  import type { ThirdwebContract } from "../../../contract/contract.js";
7
7
  import { getContractMetadata } from "../../../extensions/common/read/getContractMetadata.js";
8
8
  import type { Hex } from "../../encoding/hex.js";
9
- import type { OverrideProof } from "./types.js";
9
+ import type { ClaimCondition, OverrideProof } from "./types.js";
10
10
 
11
11
  export type GetClaimParamsOptions = {
12
12
  contract: ThirdwebContract;
13
13
  to: string;
14
14
  quantity: bigint;
15
15
  from?: string;
16
+ singlePhaseDrop?: boolean;
16
17
  } & (
17
18
  | {
18
19
  type: "erc721";
@@ -47,9 +48,18 @@ export type GetClaimParamsOptions = {
47
48
  * @extension COMMON
48
49
  */
49
50
  export async function getClaimParams(options: GetClaimParamsOptions) {
50
- const cc = await (async () => {
51
+ const cc: ClaimCondition = await (async () => {
51
52
  if (options.type === "erc1155") {
52
53
  // lazy-load the getActiveClaimCondition function
54
+ if (options.singlePhaseDrop) {
55
+ const { claimCondition } = await import(
56
+ "../../../extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.js"
57
+ );
58
+ return await claimCondition({
59
+ contract: options.contract,
60
+ tokenId: options.tokenId,
61
+ });
62
+ }
53
63
  const { getActiveClaimCondition } = await import(
54
64
  "../../../extensions/erc1155/drops/read/getActiveClaimCondition.js"
55
65
  );
@@ -60,6 +70,14 @@ export async function getClaimParams(options: GetClaimParamsOptions) {
60
70
  }
61
71
  if (options.type === "erc721") {
62
72
  // lazy-load the getActiveClaimCondition function
73
+ if (options.singlePhaseDrop) {
74
+ const { claimCondition } = await import(
75
+ "../../../extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.js"
76
+ );
77
+ return await claimCondition({
78
+ contract: options.contract,
79
+ });
80
+ }
63
81
  const { getActiveClaimCondition } = await import(
64
82
  "../../../extensions/erc721/drops/read/getActiveClaimCondition.js"
65
83
  );
@@ -71,6 +89,15 @@ export async function getClaimParams(options: GetClaimParamsOptions) {
71
89
  // otherwise erc20 case!
72
90
 
73
91
  // lazy-load the getActiveClaimCondition function
92
+ if (options.singlePhaseDrop) {
93
+ // same ABI as erc721
94
+ const { claimCondition } = await import(
95
+ "../../../extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.js"
96
+ );
97
+ return await claimCondition({
98
+ contract: options.contract,
99
+ });
100
+ }
74
101
  const { getActiveClaimCondition } = await import(
75
102
  "../../../extensions/erc20/drops/read/getActiveClaimCondition.js"
76
103
  );
@@ -15,6 +15,7 @@ export async function getMulticallSetClaimConditionTransactions(options: {
15
15
  tokenDecimals: number;
16
16
  tokenId?: bigint;
17
17
  resetClaimEligibility?: boolean;
18
+ singlePhase?: boolean;
18
19
  }): Promise<Hex[]> {
19
20
  const merkleInfos: Record<string, string> = {};
20
21
  const phases = await Promise.all(
@@ -94,23 +95,52 @@ export async function getMulticallSetClaimConditionTransactions(options: {
94
95
  let encodedSetClaimConditions: Hex;
95
96
  if (options.tokenId !== undefined) {
96
97
  // 1155
97
- const { encodeSetClaimConditions } = await import(
98
- "../../../extensions/erc1155/__generated__/IDrop1155/write/setClaimConditions.js"
99
- );
100
- encodedSetClaimConditions = encodeSetClaimConditions({
101
- tokenId: options.tokenId,
102
- phases: sortedPhases,
103
- resetClaimEligibility: options.resetClaimEligibility || false,
104
- });
98
+ if (options.singlePhase) {
99
+ const { encodeSetClaimConditions } = await import(
100
+ "../../../extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.js"
101
+ );
102
+ const phase = sortedPhases[0];
103
+ if (!phase) {
104
+ throw new Error("No phase provided");
105
+ }
106
+ encodedSetClaimConditions = encodeSetClaimConditions({
107
+ tokenId: options.tokenId,
108
+ phase,
109
+ resetClaimEligibility: options.resetClaimEligibility || false,
110
+ });
111
+ } else {
112
+ const { encodeSetClaimConditions } = await import(
113
+ "../../../extensions/erc1155/__generated__/IDrop1155/write/setClaimConditions.js"
114
+ );
115
+ encodedSetClaimConditions = encodeSetClaimConditions({
116
+ tokenId: options.tokenId,
117
+ phases: sortedPhases,
118
+ resetClaimEligibility: options.resetClaimEligibility || false,
119
+ });
120
+ }
105
121
  } else {
106
- // 721
107
- const { encodeSetClaimConditions } = await import(
108
- "../../../extensions/erc721/__generated__/IDrop/write/setClaimConditions.js"
109
- );
110
- encodedSetClaimConditions = encodeSetClaimConditions({
111
- phases: sortedPhases,
112
- resetClaimEligibility: options.resetClaimEligibility || false,
113
- });
122
+ // erc721 or erc20
123
+ if (options.singlePhase) {
124
+ const { encodeSetClaimConditions } = await import(
125
+ "../../../extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.js"
126
+ );
127
+ const phase = sortedPhases[0];
128
+ if (!phase) {
129
+ throw new Error("No phase provided");
130
+ }
131
+ encodedSetClaimConditions = encodeSetClaimConditions({
132
+ phase,
133
+ resetClaimEligibility: options.resetClaimEligibility || false,
134
+ });
135
+ } else {
136
+ const { encodeSetClaimConditions } = await import(
137
+ "../../../extensions/erc721/__generated__/IDrop/write/setClaimConditions.js"
138
+ );
139
+ encodedSetClaimConditions = encodeSetClaimConditions({
140
+ phases: sortedPhases,
141
+ resetClaimEligibility: options.resetClaimEligibility || false,
142
+ });
143
+ }
114
144
  }
115
145
  encodedTransactions.push(encodedSetClaimConditions);
116
146
  return encodedTransactions;
package/src/utils/url.ts CHANGED
@@ -63,3 +63,11 @@ export function formatWalletConnectUrl(
63
63
  ? formatUniversalUrl(appUrl, wcUri)
64
64
  : formatNativeUrl(appUrl, wcUri);
65
65
  }
66
+
67
+ export function formatExplorerTxUrl(explorerUrl: string, txHash: string) {
68
+ return `${explorerUrl.endsWith("/") ? explorerUrl : `${explorerUrl}/`}tx/${txHash}`;
69
+ }
70
+
71
+ export function formatExplorerAddressUrl(explorerUrl: string, address: string) {
72
+ return `${explorerUrl.endsWith("/") ? explorerUrl : `${explorerUrl}/`}address/${address}`;
73
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.64.4-nightly-043ee925981bdc39649d30ad65d2fce922515ab0-20241030000335";
1
+ export const version = "5.64.4";
@@ -1,34 +1,37 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
- import { getSessionHeaders } from "../../native/helpers/api/fetchers.js";
2
+ import { getClientFetch } from "../../../../utils/fetch.js";
3
3
  import { ROUTE_AUTH_ENDPOINT_CALLBACK } from "../../native/helpers/constants.js";
4
4
  import { createErrorMessage } from "../../native/helpers/errors.js";
5
- import type { ClientScopedStorage } from "./client-scoped-storage.js";
5
+ import type { Ecosystem } from "../wallet/types.js";
6
6
  import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
7
7
 
8
8
  export async function authEndpoint(args: {
9
9
  payload: string;
10
10
  client: ThirdwebClient;
11
- storage: ClientScopedStorage;
11
+ ecosystem?: Ecosystem;
12
12
  }): Promise<AuthStoredTokenWithCookieReturnType> {
13
- const resp = await fetch(ROUTE_AUTH_ENDPOINT_CALLBACK, {
13
+ const clientFetch = getClientFetch(args.client, args.ecosystem);
14
+
15
+ const res = await clientFetch(ROUTE_AUTH_ENDPOINT_CALLBACK, {
14
16
  method: "POST",
15
17
  headers: {
16
- ...getSessionHeaders(),
18
+ "Content-Type": "application/json",
17
19
  },
18
20
  body: JSON.stringify({
19
21
  payload: args.payload,
20
22
  developerClientId: args.client.clientId,
21
23
  }),
22
24
  });
23
- if (!resp.ok) {
24
- const error = await resp.json();
25
+
26
+ if (!res.ok) {
27
+ const error = await res.json();
25
28
  throw new Error(
26
29
  `Custom auth endpoint authentication error: ${error.message}`,
27
30
  );
28
31
  }
29
32
 
30
33
  try {
31
- const { verifiedToken } = await resp.json();
34
+ const { verifiedToken } = await res.json();
32
35
 
33
36
  return { storedToken: verifiedToken };
34
37
  } catch (e) {
@@ -29,25 +29,22 @@ export async function guestAuthenticate(args: {
29
29
  }
30
30
 
31
31
  const clientFetch = getClientFetch(args.client, args.ecosystem);
32
- const authResult = await (async () => {
33
- const path = getLoginCallbackUrl({
34
- authOption: "guest",
35
- client: args.client,
36
- ecosystem: args.ecosystem,
37
- });
38
- const res = await clientFetch(`${path}`, {
39
- method: "POST",
40
- headers: {
41
- "Content-Type": "application/json",
42
- },
43
- body: JSON.stringify({
44
- sessionId,
45
- }),
46
- });
32
+ const path = getLoginCallbackUrl({
33
+ authOption: "guest",
34
+ client: args.client,
35
+ ecosystem: args.ecosystem,
36
+ });
37
+ const res = await clientFetch(`${path}`, {
38
+ method: "POST",
39
+ headers: {
40
+ "Content-Type": "application/json",
41
+ },
42
+ body: JSON.stringify({
43
+ sessionId,
44
+ }),
45
+ });
47
46
 
48
- if (!res.ok) throw new Error("Failed to generate guest account");
47
+ if (!res.ok) throw new Error("Failed to generate guest account");
49
48
 
50
- return (await res.json()) satisfies AuthStoredTokenWithCookieReturnType;
51
- })();
52
- return authResult;
49
+ return (await res.json()) satisfies AuthStoredTokenWithCookieReturnType;
53
50
  }
@@ -1,19 +1,21 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
- import { getSessionHeaders } from "../../native/helpers/api/fetchers.js";
2
+ import { getClientFetch } from "../../../../utils/fetch.js";
3
3
  import { ROUTE_AUTH_JWT_CALLBACK } from "../../native/helpers/constants.js";
4
4
  import { createErrorMessage } from "../../native/helpers/errors.js";
5
- import type { ClientScopedStorage } from "./client-scoped-storage.js";
5
+ import type { Ecosystem } from "../wallet/types.js";
6
6
  import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
7
7
 
8
8
  export async function customJwt(args: {
9
9
  jwt: string;
10
10
  client: ThirdwebClient;
11
- storage: ClientScopedStorage;
11
+ ecosystem?: Ecosystem;
12
12
  }): Promise<AuthStoredTokenWithCookieReturnType> {
13
- const resp = await fetch(ROUTE_AUTH_JWT_CALLBACK, {
13
+ const clientFetch = getClientFetch(args.client, args.ecosystem);
14
+
15
+ const res = await clientFetch(ROUTE_AUTH_JWT_CALLBACK, {
14
16
  method: "POST",
15
17
  headers: {
16
- ...getSessionHeaders(),
18
+ "Content-Type": "application/json",
17
19
  },
18
20
  body: JSON.stringify({
19
21
  jwt: args.jwt,
@@ -21,13 +23,14 @@ export async function customJwt(args: {
21
23
  }),
22
24
  });
23
25
 
24
- if (!resp.ok) {
25
- const error = await resp.json();
26
+ if (!res.ok) {
27
+ const error = await res.json();
26
28
  throw new Error(`JWT authentication error: ${error.message}`);
27
29
  }
28
30
 
29
31
  try {
30
- const { verifiedToken } = await resp.json();
32
+ const { verifiedToken } = await res.json();
33
+
31
34
  return { storedToken: verifiedToken };
32
35
  } catch (e) {
33
36
  throw new Error(
@@ -19,7 +19,7 @@ const ECOSYSTEM_PARTNER_ID_HEADER = "x-ecosystem-partner-id";
19
19
 
20
20
  let sessionNonce: Hex | undefined = undefined;
21
21
 
22
- export function getSessionHeaders() {
22
+ function getSessionHeaders() {
23
23
  if (!sessionNonce) {
24
24
  sessionNonce = randomBytesHex(16);
25
25
  }
@@ -199,13 +199,13 @@ export class InAppNativeConnector implements InAppConnector {
199
199
  return customJwt({
200
200
  jwt: params.jwt,
201
201
  client: this.client,
202
- storage: this.storage,
202
+ ecosystem: this.ecosystem,
203
203
  });
204
204
  case "auth_endpoint":
205
205
  return authEndpoint({
206
206
  payload: params.payload,
207
207
  client: this.client,
208
- storage: this.storage,
208
+ ecosystem: this.ecosystem,
209
209
  });
210
210
  default:
211
211
  throw new Error(`Unsupported authentication type: ${strategy}`);
@@ -4,8 +4,10 @@ import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
4
4
  import type { SocialAuthOption } from "../../../../wallets/types.js";
5
5
  import type { Account } from "../../../interfaces/wallet.js";
6
6
  import { getUserStatus } from "../../core/actions/get-enclave-user-status.js";
7
+ import { authEndpoint } from "../../core/authentication/authEndpoint.js";
7
8
  import { ClientScopedStorage } from "../../core/authentication/client-scoped-storage.js";
8
9
  import { guestAuthenticate } from "../../core/authentication/guest.js";
10
+ import { customJwt } from "../../core/authentication/jwt.js";
9
11
  import {
10
12
  getLinkedProfilesInternal,
11
13
  linkAccount,
@@ -268,8 +270,11 @@ export class InAppWebConnector implements InAppConnector {
268
270
  });
269
271
  }
270
272
 
271
- async loginWithAuthToken(authResult: AuthStoredTokenWithCookieReturnType) {
272
- return this.auth.loginWithAuthToken(authResult);
273
+ async loginWithAuthToken(
274
+ authResult: AuthStoredTokenWithCookieReturnType,
275
+ recoveryCode?: string,
276
+ ) {
277
+ return this.auth.loginWithAuthToken(authResult, recoveryCode);
273
278
  }
274
279
 
275
280
  /**
@@ -292,20 +297,22 @@ export class InAppWebConnector implements InAppConnector {
292
297
  client: this.client,
293
298
  ecosystem: this.ecosystem,
294
299
  });
300
+ case "auth_endpoint": {
301
+ return authEndpoint({
302
+ payload: args.payload,
303
+ client: this.client,
304
+ ecosystem: this.ecosystem,
305
+ });
306
+ }
295
307
  case "jwt":
296
- return this.auth.authenticateWithCustomJwt({
308
+ return customJwt({
297
309
  jwt: args.jwt,
298
- encryptionKey: args.encryptionKey,
310
+ client: this.client,
311
+ ecosystem: this.ecosystem,
299
312
  });
300
313
  case "passkey": {
301
314
  return this.passkeyAuth(args);
302
315
  }
303
- case "auth_endpoint": {
304
- return this.auth.authenticateWithCustomAuthEndpoint({
305
- payload: args.payload,
306
- encryptionKey: args.encryptionKey,
307
- });
308
- }
309
316
  case "iframe_email_verification": {
310
317
  return this.auth.authenticateWithIframe({
311
318
  email: args.email,
@@ -359,17 +366,10 @@ export class InAppWebConnector implements InAppConnector {
359
366
  ): Promise<AuthLoginReturnType> {
360
367
  const strategy = args.strategy;
361
368
  switch (strategy) {
369
+ case "auth_endpoint":
362
370
  case "jwt": {
363
- return this.auth.loginWithCustomJwt({
364
- jwt: args.jwt,
365
- encryptionKey: args.encryptionKey,
366
- });
367
- }
368
- case "auth_endpoint": {
369
- return this.auth.loginWithCustomAuthEndpoint({
370
- payload: args.payload,
371
- encryptionKey: args.encryptionKey,
372
- });
371
+ const authToken = await this.authenticate(args);
372
+ return await this.loginWithAuthToken(authToken, args.encryptionKey);
373
373
  }
374
374
  case "iframe_email_verification": {
375
375
  return this.auth.loginWithIframe({
@@ -1,9 +1,49 @@
1
- import type { ThirdwebContract } from "../../../contract/contract.js";
1
+ import type { Chain } from "../../../chains/types.js";
2
+ import type { ThirdwebClient } from "../../../client/client.js";
3
+ import {
4
+ type ThirdwebContract,
5
+ getContract,
6
+ } from "../../../contract/contract.js";
2
7
  import { prepareContractCall } from "../../../transaction/prepare-contract-call.js";
3
8
  import type { PreparedTransaction } from "../../../transaction/prepare-transaction.js";
4
9
  import { readContract } from "../../../transaction/read-contract.js";
5
10
  import { isHex, stringToHex } from "../../../utils/encoding/hex.js";
6
11
  import type { SendTransactionOption } from "../../interfaces/wallet.js";
12
+ import { DEFAULT_ACCOUNT_FACTORY_V0_6 } from "./constants.js";
13
+
14
+ /**
15
+ * Predict the address of a smart account.
16
+ * @param args - The options for predicting the address of a smart account.
17
+ * @returns The predicted address of the smart account.
18
+ * @example
19
+ * ```ts
20
+ * import { predictSmartAccountAddress } from "thirdweb/wallets/smart";
21
+ *
22
+ * const predictedAddress = await predictSmartAccountAddress({
23
+ * client,
24
+ * chain,
25
+ * adminAddress,
26
+ * });
27
+ * ```
28
+ * @walletUtils
29
+ */
30
+ export async function predictSmartAccountAddress(args: {
31
+ client: ThirdwebClient;
32
+ chain: Chain;
33
+ adminAddress: string;
34
+ factoryAddress?: string;
35
+ accountSalt?: string;
36
+ }): Promise<string> {
37
+ return predictAddress({
38
+ adminAddress: args.adminAddress,
39
+ accountSalt: args.accountSalt,
40
+ factoryContract: getContract({
41
+ address: args.factoryAddress ?? DEFAULT_ACCOUNT_FACTORY_V0_6,
42
+ chain: args.chain,
43
+ client: args.client,
44
+ }),
45
+ });
46
+ }
7
47
 
8
48
  /**
9
49
  * Predict the address of a smart account.
@@ -20,6 +60,7 @@ import type { SendTransactionOption } from "../../interfaces/wallet.js";
20
60
  * });
21
61
  * ```
22
62
  * @walletUtils
63
+ * @deprecated Use `predictSmartAccountAddress` instead.
23
64
  */
24
65
  export async function predictAddress(args: {
25
66
  factoryContract: ThirdwebContract;
@@ -149,6 +149,7 @@ export async function createUnsignedUserOp(args: {
149
149
  const bundlerOptions = {
150
150
  client,
151
151
  chain,
152
+ bundlerUrl: overrides?.bundlerUrl,
152
153
  entrypointAddress: overrides?.entrypointAddress,
153
154
  };
154
155
 
@@ -23,6 +23,7 @@ import { isContractDeployed } from "../../utils/bytecode/is-contract-deployed.js
23
23
  import { sleep } from "../../utils/sleep.js";
24
24
  import type { Account, Wallet } from "../interfaces/wallet.js";
25
25
  import { generateAccount } from "../utils/generateAccount.js";
26
+ import { predictSmartAccountAddress } from "./lib/calls.js";
26
27
  import { DEFAULT_ACCOUNT_FACTORY_V0_7 } from "./lib/constants.js";
27
28
  import { smartWallet } from "./smart-wallet.js";
28
29
 
@@ -70,6 +71,13 @@ describe.runIf(process.env.TW_SECRET_KEY).sequential(
70
71
 
71
72
  it("can connect", async () => {
72
73
  expect(smartWalletAddress).toHaveLength(42);
74
+ const predictedAddress = await predictSmartAccountAddress({
75
+ client,
76
+ chain,
77
+ adminAddress: personalAccount.address,
78
+ factoryAddress: DEFAULT_ACCOUNT_FACTORY_V0_7,
79
+ });
80
+ expect(predictedAddress).toEqual(smartWalletAddress);
73
81
  });
74
82
 
75
83
  it("should revert on unsuccessful transactions", async () => {
@@ -23,6 +23,7 @@ import { isContractDeployed } from "../../utils/bytecode/is-contract-deployed.js
23
23
  import { sleep } from "../../utils/sleep.js";
24
24
  import type { Account, Wallet } from "../interfaces/wallet.js";
25
25
  import { generateAccount } from "../utils/generateAccount.js";
26
+ import { predictSmartAccountAddress } from "./lib/calls.js";
26
27
  import { smartWallet } from "./smart-wallet.js";
27
28
 
28
29
  let wallet: Wallet;
@@ -69,6 +70,12 @@ describe.runIf(process.env.TW_SECRET_KEY).sequential(
69
70
 
70
71
  it("can connect", async () => {
71
72
  expect(smartWalletAddress).toHaveLength(42);
73
+ const predictedAddress = await predictSmartAccountAddress({
74
+ client,
75
+ chain,
76
+ adminAddress: personalAccount.address,
77
+ });
78
+ expect(predictedAddress).toEqual(smartWalletAddress);
72
79
  });
73
80
 
74
81
  it("should revert on unsuccessful transactions", async () => {