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
@@ -0,0 +1,43 @@
1
+ import { prepareEvent } from "../../../../../event/prepare-event.js";
2
+ import type { AbiParameterToPrimitiveType } from "abitype";
3
+
4
+ /**
5
+ * Represents the filters for the "ClaimConditionUpdated" event.
6
+ */
7
+ export type ClaimConditionUpdatedEventFilters = Partial<{
8
+ tokenId: AbiParameterToPrimitiveType<{
9
+ type: "uint256";
10
+ name: "tokenId";
11
+ indexed: true;
12
+ }>;
13
+ }>;
14
+
15
+ /**
16
+ * Creates an event object for the ClaimConditionUpdated event.
17
+ * @param filters - Optional filters to apply to the event.
18
+ * @returns The prepared event object.
19
+ * @extension ERC1155
20
+ * @example
21
+ * ```ts
22
+ * import { getContractEvents } from "thirdweb";
23
+ * import { claimConditionUpdatedEvent } from "thirdweb/extensions/erc1155";
24
+ *
25
+ * const events = await getContractEvents({
26
+ * contract,
27
+ * events: [
28
+ * claimConditionUpdatedEvent({
29
+ * tokenId: ...,
30
+ * })
31
+ * ],
32
+ * });
33
+ * ```
34
+ */
35
+ export function claimConditionUpdatedEvent(
36
+ filters: ClaimConditionUpdatedEventFilters = {},
37
+ ) {
38
+ return prepareEvent({
39
+ signature:
40
+ "event ClaimConditionUpdated(uint256 indexed tokenId, (uint256 startTimestamp, uint256 maxClaimableSupply, uint256 supplyClaimed, uint256 quantityLimitPerWallet, bytes32 merkleRoot, uint256 pricePerToken, address currency, string metadata) condition, bool resetEligibility)",
41
+ filters,
42
+ });
43
+ }
@@ -0,0 +1,53 @@
1
+ import { prepareEvent } from "../../../../../event/prepare-event.js";
2
+ import type { AbiParameterToPrimitiveType } from "abitype";
3
+
4
+ /**
5
+ * Represents the filters for the "TokensClaimed" event.
6
+ */
7
+ export type TokensClaimedEventFilters = Partial<{
8
+ claimer: AbiParameterToPrimitiveType<{
9
+ type: "address";
10
+ name: "claimer";
11
+ indexed: true;
12
+ }>;
13
+ receiver: AbiParameterToPrimitiveType<{
14
+ type: "address";
15
+ name: "receiver";
16
+ indexed: true;
17
+ }>;
18
+ tokenId: AbiParameterToPrimitiveType<{
19
+ type: "uint256";
20
+ name: "tokenId";
21
+ indexed: true;
22
+ }>;
23
+ }>;
24
+
25
+ /**
26
+ * Creates an event object for the TokensClaimed event.
27
+ * @param filters - Optional filters to apply to the event.
28
+ * @returns The prepared event object.
29
+ * @extension ERC1155
30
+ * @example
31
+ * ```ts
32
+ * import { getContractEvents } from "thirdweb";
33
+ * import { tokensClaimedEvent } from "thirdweb/extensions/erc1155";
34
+ *
35
+ * const events = await getContractEvents({
36
+ * contract,
37
+ * events: [
38
+ * tokensClaimedEvent({
39
+ * claimer: ...,
40
+ * receiver: ...,
41
+ * tokenId: ...,
42
+ * })
43
+ * ],
44
+ * });
45
+ * ```
46
+ */
47
+ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) {
48
+ return prepareEvent({
49
+ signature:
50
+ "event TokensClaimed(address indexed claimer, address indexed receiver, uint256 indexed tokenId, uint256 quantityClaimed)",
51
+ filters,
52
+ });
53
+ }
@@ -0,0 +1,160 @@
1
+ import type { AbiParameterToPrimitiveType } from "abitype";
2
+ import { readContract } from "../../../../../transaction/read-contract.js";
3
+ import type { BaseTransactionOptions } from "../../../../../transaction/types.js";
4
+ import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
5
+ import { decodeAbiParameters } from "viem";
6
+ import type { Hex } from "../../../../../utils/encoding/hex.js";
7
+ import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
8
+
9
+ /**
10
+ * Represents the parameters for the "claimCondition" function.
11
+ */
12
+ export type ClaimConditionParams = {
13
+ tokenId: AbiParameterToPrimitiveType<{ type: "uint256"; name: "tokenId" }>;
14
+ };
15
+
16
+ export const FN_SELECTOR = "0xe9703d25" as const;
17
+ const FN_INPUTS = [
18
+ {
19
+ type: "uint256",
20
+ name: "tokenId",
21
+ },
22
+ ] as const;
23
+ const FN_OUTPUTS = [
24
+ {
25
+ type: "tuple",
26
+ name: "condition",
27
+ components: [
28
+ {
29
+ type: "uint256",
30
+ name: "startTimestamp",
31
+ },
32
+ {
33
+ type: "uint256",
34
+ name: "maxClaimableSupply",
35
+ },
36
+ {
37
+ type: "uint256",
38
+ name: "supplyClaimed",
39
+ },
40
+ {
41
+ type: "uint256",
42
+ name: "quantityLimitPerWallet",
43
+ },
44
+ {
45
+ type: "bytes32",
46
+ name: "merkleRoot",
47
+ },
48
+ {
49
+ type: "uint256",
50
+ name: "pricePerToken",
51
+ },
52
+ {
53
+ type: "address",
54
+ name: "currency",
55
+ },
56
+ {
57
+ type: "string",
58
+ name: "metadata",
59
+ },
60
+ ],
61
+ },
62
+ ] as const;
63
+
64
+ /**
65
+ * Checks if the `claimCondition` method is supported by the given contract.
66
+ * @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.
67
+ * @returns A boolean indicating if the `claimCondition` method is supported.
68
+ * @extension ERC1155
69
+ * @example
70
+ * ```ts
71
+ * import { isClaimConditionSupported } from "thirdweb/extensions/erc1155";
72
+ * const supported = isClaimConditionSupported(["0x..."]);
73
+ * ```
74
+ */
75
+ export function isClaimConditionSupported(availableSelectors: string[]) {
76
+ return detectMethod({
77
+ availableSelectors,
78
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
79
+ });
80
+ }
81
+
82
+ /**
83
+ * Encodes the parameters for the "claimCondition" function.
84
+ * @param options - The options for the claimCondition function.
85
+ * @returns The encoded ABI parameters.
86
+ * @extension ERC1155
87
+ * @example
88
+ * ```ts
89
+ * import { encodeClaimConditionParams } from "thirdweb/extensions/erc1155";
90
+ * const result = encodeClaimConditionParams({
91
+ * tokenId: ...,
92
+ * });
93
+ * ```
94
+ */
95
+ export function encodeClaimConditionParams(options: ClaimConditionParams) {
96
+ return encodeAbiParameters(FN_INPUTS, [options.tokenId]);
97
+ }
98
+
99
+ /**
100
+ * Encodes the "claimCondition" function into a Hex string with its parameters.
101
+ * @param options - The options for the claimCondition function.
102
+ * @returns The encoded hexadecimal string.
103
+ * @extension ERC1155
104
+ * @example
105
+ * ```ts
106
+ * import { encodeClaimCondition } from "thirdweb/extensions/erc1155";
107
+ * const result = encodeClaimCondition({
108
+ * tokenId: ...,
109
+ * });
110
+ * ```
111
+ */
112
+ export function encodeClaimCondition(options: ClaimConditionParams) {
113
+ // we do a "manual" concat here to avoid the overhead of the "concatHex" function
114
+ // we can do this because we know the specific formats of the values
115
+ return (FN_SELECTOR +
116
+ encodeClaimConditionParams(options).slice(
117
+ 2,
118
+ )) as `${typeof FN_SELECTOR}${string}`;
119
+ }
120
+
121
+ /**
122
+ * Decodes the result of the claimCondition function call.
123
+ * @param result - The hexadecimal result to decode.
124
+ * @returns The decoded result as per the FN_OUTPUTS definition.
125
+ * @extension ERC1155
126
+ * @example
127
+ * ```ts
128
+ * import { decodeClaimConditionResult } from "thirdweb/extensions/erc1155";
129
+ * const result = decodeClaimConditionResultResult("...");
130
+ * ```
131
+ */
132
+ export function decodeClaimConditionResult(result: Hex) {
133
+ return decodeAbiParameters(FN_OUTPUTS, result)[0];
134
+ }
135
+
136
+ /**
137
+ * Calls the "claimCondition" function on the contract.
138
+ * @param options - The options for the claimCondition function.
139
+ * @returns The parsed result of the function call.
140
+ * @extension ERC1155
141
+ * @example
142
+ * ```ts
143
+ * import { claimCondition } from "thirdweb/extensions/erc1155";
144
+ *
145
+ * const result = await claimCondition({
146
+ * contract,
147
+ * tokenId: ...,
148
+ * });
149
+ *
150
+ * ```
151
+ */
152
+ export async function claimCondition(
153
+ options: BaseTransactionOptions<ClaimConditionParams>,
154
+ ) {
155
+ return readContract({
156
+ contract: options.contract,
157
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
158
+ params: [options.tokenId],
159
+ });
160
+ }
@@ -0,0 +1,229 @@
1
+ import type { AbiParameterToPrimitiveType } from "abitype";
2
+ import type {
3
+ BaseTransactionOptions,
4
+ WithOverrides,
5
+ } from "../../../../../transaction/types.js";
6
+ import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js";
7
+ import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
8
+ import { once } from "../../../../../utils/promise/once.js";
9
+ import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
10
+
11
+ /**
12
+ * Represents the parameters for the "claim" function.
13
+ */
14
+ export type ClaimParams = WithOverrides<{
15
+ receiver: AbiParameterToPrimitiveType<{ type: "address"; name: "receiver" }>;
16
+ tokenId: AbiParameterToPrimitiveType<{ type: "uint256"; name: "tokenId" }>;
17
+ quantity: AbiParameterToPrimitiveType<{ type: "uint256"; name: "quantity" }>;
18
+ currency: AbiParameterToPrimitiveType<{ type: "address"; name: "currency" }>;
19
+ pricePerToken: AbiParameterToPrimitiveType<{
20
+ type: "uint256";
21
+ name: "pricePerToken";
22
+ }>;
23
+ allowlistProof: AbiParameterToPrimitiveType<{
24
+ type: "tuple";
25
+ name: "allowlistProof";
26
+ components: [
27
+ { type: "bytes32[]"; name: "proof" },
28
+ { type: "uint256"; name: "quantityLimitPerWallet" },
29
+ { type: "uint256"; name: "pricePerToken" },
30
+ { type: "address"; name: "currency" },
31
+ ];
32
+ }>;
33
+ data: AbiParameterToPrimitiveType<{ type: "bytes"; name: "data" }>;
34
+ }>;
35
+
36
+ export const FN_SELECTOR = "0x57bc3d78" as const;
37
+ const FN_INPUTS = [
38
+ {
39
+ type: "address",
40
+ name: "receiver",
41
+ },
42
+ {
43
+ type: "uint256",
44
+ name: "tokenId",
45
+ },
46
+ {
47
+ type: "uint256",
48
+ name: "quantity",
49
+ },
50
+ {
51
+ type: "address",
52
+ name: "currency",
53
+ },
54
+ {
55
+ type: "uint256",
56
+ name: "pricePerToken",
57
+ },
58
+ {
59
+ type: "tuple",
60
+ name: "allowlistProof",
61
+ components: [
62
+ {
63
+ type: "bytes32[]",
64
+ name: "proof",
65
+ },
66
+ {
67
+ type: "uint256",
68
+ name: "quantityLimitPerWallet",
69
+ },
70
+ {
71
+ type: "uint256",
72
+ name: "pricePerToken",
73
+ },
74
+ {
75
+ type: "address",
76
+ name: "currency",
77
+ },
78
+ ],
79
+ },
80
+ {
81
+ type: "bytes",
82
+ name: "data",
83
+ },
84
+ ] as const;
85
+ const FN_OUTPUTS = [] as const;
86
+
87
+ /**
88
+ * Checks if the `claim` method is supported by the given contract.
89
+ * @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.
90
+ * @returns A boolean indicating if the `claim` method is supported.
91
+ * @extension ERC1155
92
+ * @example
93
+ * ```ts
94
+ * import { isClaimSupported } from "thirdweb/extensions/erc1155";
95
+ *
96
+ * const supported = isClaimSupported(["0x..."]);
97
+ * ```
98
+ */
99
+ export function isClaimSupported(availableSelectors: string[]) {
100
+ return detectMethod({
101
+ availableSelectors,
102
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
103
+ });
104
+ }
105
+
106
+ /**
107
+ * Encodes the parameters for the "claim" function.
108
+ * @param options - The options for the claim function.
109
+ * @returns The encoded ABI parameters.
110
+ * @extension ERC1155
111
+ * @example
112
+ * ```ts
113
+ * import { encodeClaimParams } from "thirdweb/extensions/erc1155";
114
+ * const result = encodeClaimParams({
115
+ * receiver: ...,
116
+ * tokenId: ...,
117
+ * quantity: ...,
118
+ * currency: ...,
119
+ * pricePerToken: ...,
120
+ * allowlistProof: ...,
121
+ * data: ...,
122
+ * });
123
+ * ```
124
+ */
125
+ export function encodeClaimParams(options: ClaimParams) {
126
+ return encodeAbiParameters(FN_INPUTS, [
127
+ options.receiver,
128
+ options.tokenId,
129
+ options.quantity,
130
+ options.currency,
131
+ options.pricePerToken,
132
+ options.allowlistProof,
133
+ options.data,
134
+ ]);
135
+ }
136
+
137
+ /**
138
+ * Encodes the "claim" function into a Hex string with its parameters.
139
+ * @param options - The options for the claim function.
140
+ * @returns The encoded hexadecimal string.
141
+ * @extension ERC1155
142
+ * @example
143
+ * ```ts
144
+ * import { encodeClaim } from "thirdweb/extensions/erc1155";
145
+ * const result = encodeClaim({
146
+ * receiver: ...,
147
+ * tokenId: ...,
148
+ * quantity: ...,
149
+ * currency: ...,
150
+ * pricePerToken: ...,
151
+ * allowlistProof: ...,
152
+ * data: ...,
153
+ * });
154
+ * ```
155
+ */
156
+ export function encodeClaim(options: ClaimParams) {
157
+ // we do a "manual" concat here to avoid the overhead of the "concatHex" function
158
+ // we can do this because we know the specific formats of the values
159
+ return (FN_SELECTOR +
160
+ encodeClaimParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`;
161
+ }
162
+
163
+ /**
164
+ * Prepares a transaction to call the "claim" function on the contract.
165
+ * @param options - The options for the "claim" function.
166
+ * @returns A prepared transaction object.
167
+ * @extension ERC1155
168
+ * @example
169
+ * ```ts
170
+ * import { sendTransaction } from "thirdweb";
171
+ * import { claim } from "thirdweb/extensions/erc1155";
172
+ *
173
+ * const transaction = claim({
174
+ * contract,
175
+ * receiver: ...,
176
+ * tokenId: ...,
177
+ * quantity: ...,
178
+ * currency: ...,
179
+ * pricePerToken: ...,
180
+ * allowlistProof: ...,
181
+ * data: ...,
182
+ * overrides: {
183
+ * ...
184
+ * }
185
+ * });
186
+ *
187
+ * // Send the transaction
188
+ * await sendTransaction({ transaction, account });
189
+ * ```
190
+ */
191
+ export function claim(
192
+ options: BaseTransactionOptions<
193
+ | ClaimParams
194
+ | {
195
+ asyncParams: () => Promise<ClaimParams>;
196
+ }
197
+ >,
198
+ ) {
199
+ const asyncOptions = once(async () => {
200
+ return "asyncParams" in options ? await options.asyncParams() : options;
201
+ });
202
+
203
+ return prepareContractCall({
204
+ contract: options.contract,
205
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
206
+ params: async () => {
207
+ const resolvedOptions = await asyncOptions();
208
+ return [
209
+ resolvedOptions.receiver,
210
+ resolvedOptions.tokenId,
211
+ resolvedOptions.quantity,
212
+ resolvedOptions.currency,
213
+ resolvedOptions.pricePerToken,
214
+ resolvedOptions.allowlistProof,
215
+ resolvedOptions.data,
216
+ ] as const;
217
+ },
218
+ value: async () => (await asyncOptions()).overrides?.value,
219
+ accessList: async () => (await asyncOptions()).overrides?.accessList,
220
+ gas: async () => (await asyncOptions()).overrides?.gas,
221
+ gasPrice: async () => (await asyncOptions()).overrides?.gasPrice,
222
+ maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas,
223
+ maxPriorityFeePerGas: async () =>
224
+ (await asyncOptions()).overrides?.maxPriorityFeePerGas,
225
+ nonce: async () => (await asyncOptions()).overrides?.nonce,
226
+ extraGas: async () => (await asyncOptions()).overrides?.extraGas,
227
+ erc20Value: async () => (await asyncOptions()).overrides?.erc20Value,
228
+ });
229
+ }
@@ -0,0 +1,213 @@
1
+ import type { AbiParameterToPrimitiveType } from "abitype";
2
+ import type {
3
+ BaseTransactionOptions,
4
+ WithOverrides,
5
+ } from "../../../../../transaction/types.js";
6
+ import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js";
7
+ import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js";
8
+ import { once } from "../../../../../utils/promise/once.js";
9
+ import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js";
10
+
11
+ /**
12
+ * Represents the parameters for the "setClaimConditions" function.
13
+ */
14
+ export type SetClaimConditionsParams = WithOverrides<{
15
+ tokenId: AbiParameterToPrimitiveType<{ type: "uint256"; name: "tokenId" }>;
16
+ phase: AbiParameterToPrimitiveType<{
17
+ type: "tuple";
18
+ name: "phase";
19
+ components: [
20
+ { type: "uint256"; name: "startTimestamp" },
21
+ { type: "uint256"; name: "maxClaimableSupply" },
22
+ { type: "uint256"; name: "supplyClaimed" },
23
+ { type: "uint256"; name: "quantityLimitPerWallet" },
24
+ { type: "bytes32"; name: "merkleRoot" },
25
+ { type: "uint256"; name: "pricePerToken" },
26
+ { type: "address"; name: "currency" },
27
+ { type: "string"; name: "metadata" },
28
+ ];
29
+ }>;
30
+ resetClaimEligibility: AbiParameterToPrimitiveType<{
31
+ type: "bool";
32
+ name: "resetClaimEligibility";
33
+ }>;
34
+ }>;
35
+
36
+ export const FN_SELECTOR = "0x8affb89f" as const;
37
+ const FN_INPUTS = [
38
+ {
39
+ type: "uint256",
40
+ name: "tokenId",
41
+ },
42
+ {
43
+ type: "tuple",
44
+ name: "phase",
45
+ components: [
46
+ {
47
+ type: "uint256",
48
+ name: "startTimestamp",
49
+ },
50
+ {
51
+ type: "uint256",
52
+ name: "maxClaimableSupply",
53
+ },
54
+ {
55
+ type: "uint256",
56
+ name: "supplyClaimed",
57
+ },
58
+ {
59
+ type: "uint256",
60
+ name: "quantityLimitPerWallet",
61
+ },
62
+ {
63
+ type: "bytes32",
64
+ name: "merkleRoot",
65
+ },
66
+ {
67
+ type: "uint256",
68
+ name: "pricePerToken",
69
+ },
70
+ {
71
+ type: "address",
72
+ name: "currency",
73
+ },
74
+ {
75
+ type: "string",
76
+ name: "metadata",
77
+ },
78
+ ],
79
+ },
80
+ {
81
+ type: "bool",
82
+ name: "resetClaimEligibility",
83
+ },
84
+ ] as const;
85
+ const FN_OUTPUTS = [] as const;
86
+
87
+ /**
88
+ * Checks if the `setClaimConditions` method is supported by the given contract.
89
+ * @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.
90
+ * @returns A boolean indicating if the `setClaimConditions` method is supported.
91
+ * @extension ERC1155
92
+ * @example
93
+ * ```ts
94
+ * import { isSetClaimConditionsSupported } from "thirdweb/extensions/erc1155";
95
+ *
96
+ * const supported = isSetClaimConditionsSupported(["0x..."]);
97
+ * ```
98
+ */
99
+ export function isSetClaimConditionsSupported(availableSelectors: string[]) {
100
+ return detectMethod({
101
+ availableSelectors,
102
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
103
+ });
104
+ }
105
+
106
+ /**
107
+ * Encodes the parameters for the "setClaimConditions" function.
108
+ * @param options - The options for the setClaimConditions function.
109
+ * @returns The encoded ABI parameters.
110
+ * @extension ERC1155
111
+ * @example
112
+ * ```ts
113
+ * import { encodeSetClaimConditionsParams } from "thirdweb/extensions/erc1155";
114
+ * const result = encodeSetClaimConditionsParams({
115
+ * tokenId: ...,
116
+ * phase: ...,
117
+ * resetClaimEligibility: ...,
118
+ * });
119
+ * ```
120
+ */
121
+ export function encodeSetClaimConditionsParams(
122
+ options: SetClaimConditionsParams,
123
+ ) {
124
+ return encodeAbiParameters(FN_INPUTS, [
125
+ options.tokenId,
126
+ options.phase,
127
+ options.resetClaimEligibility,
128
+ ]);
129
+ }
130
+
131
+ /**
132
+ * Encodes the "setClaimConditions" function into a Hex string with its parameters.
133
+ * @param options - The options for the setClaimConditions function.
134
+ * @returns The encoded hexadecimal string.
135
+ * @extension ERC1155
136
+ * @example
137
+ * ```ts
138
+ * import { encodeSetClaimConditions } from "thirdweb/extensions/erc1155";
139
+ * const result = encodeSetClaimConditions({
140
+ * tokenId: ...,
141
+ * phase: ...,
142
+ * resetClaimEligibility: ...,
143
+ * });
144
+ * ```
145
+ */
146
+ export function encodeSetClaimConditions(options: SetClaimConditionsParams) {
147
+ // we do a "manual" concat here to avoid the overhead of the "concatHex" function
148
+ // we can do this because we know the specific formats of the values
149
+ return (FN_SELECTOR +
150
+ encodeSetClaimConditionsParams(options).slice(
151
+ 2,
152
+ )) as `${typeof FN_SELECTOR}${string}`;
153
+ }
154
+
155
+ /**
156
+ * Prepares a transaction to call the "setClaimConditions" function on the contract.
157
+ * @param options - The options for the "setClaimConditions" function.
158
+ * @returns A prepared transaction object.
159
+ * @extension ERC1155
160
+ * @example
161
+ * ```ts
162
+ * import { sendTransaction } from "thirdweb";
163
+ * import { setClaimConditions } from "thirdweb/extensions/erc1155";
164
+ *
165
+ * const transaction = setClaimConditions({
166
+ * contract,
167
+ * tokenId: ...,
168
+ * phase: ...,
169
+ * resetClaimEligibility: ...,
170
+ * overrides: {
171
+ * ...
172
+ * }
173
+ * });
174
+ *
175
+ * // Send the transaction
176
+ * await sendTransaction({ transaction, account });
177
+ * ```
178
+ */
179
+ export function setClaimConditions(
180
+ options: BaseTransactionOptions<
181
+ | SetClaimConditionsParams
182
+ | {
183
+ asyncParams: () => Promise<SetClaimConditionsParams>;
184
+ }
185
+ >,
186
+ ) {
187
+ const asyncOptions = once(async () => {
188
+ return "asyncParams" in options ? await options.asyncParams() : options;
189
+ });
190
+
191
+ return prepareContractCall({
192
+ contract: options.contract,
193
+ method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const,
194
+ params: async () => {
195
+ const resolvedOptions = await asyncOptions();
196
+ return [
197
+ resolvedOptions.tokenId,
198
+ resolvedOptions.phase,
199
+ resolvedOptions.resetClaimEligibility,
200
+ ] as const;
201
+ },
202
+ value: async () => (await asyncOptions()).overrides?.value,
203
+ accessList: async () => (await asyncOptions()).overrides?.accessList,
204
+ gas: async () => (await asyncOptions()).overrides?.gas,
205
+ gasPrice: async () => (await asyncOptions()).overrides?.gasPrice,
206
+ maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas,
207
+ maxPriorityFeePerGas: async () =>
208
+ (await asyncOptions()).overrides?.maxPriorityFeePerGas,
209
+ nonce: async () => (await asyncOptions()).overrides?.nonce,
210
+ extraGas: async () => (await asyncOptions()).overrides?.extraGas,
211
+ erc20Value: async () => (await asyncOptions()).overrides?.erc20Value,
212
+ });
213
+ }