thirdweb 5.55.0-nightly-8035923cdad943a47fc909e04522c351d06804f0-20240913000407 → 5.55.1-nightly-b2a2c9784a33394dffbcd32bbd28b2c612a4e603-20240915000420

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 (268) hide show
  1. package/dist/cjs/contract/deployment/deploy-with-abi.js +17 -6
  2. package/dist/cjs/contract/deployment/deploy-with-abi.js.map +1 -1
  3. package/dist/cjs/exports/deploys.js +2 -2
  4. package/dist/cjs/exports/deploys.js.map +1 -1
  5. package/dist/cjs/exports/extensions/marketplace.js +14 -3
  6. package/dist/cjs/exports/extensions/marketplace.js.map +1 -1
  7. package/dist/cjs/extensions/marketplace/direct-listings/read/getListing.js +18 -2
  8. package/dist/cjs/extensions/marketplace/direct-listings/read/getListing.js.map +1 -1
  9. package/dist/cjs/extensions/marketplace/direct-listings/write/buyFromListing.js +21 -4
  10. package/dist/cjs/extensions/marketplace/direct-listings/write/buyFromListing.js.map +1 -1
  11. package/dist/cjs/extensions/marketplace/direct-listings/write/createListing.js +18 -2
  12. package/dist/cjs/extensions/marketplace/direct-listings/write/createListing.js.map +1 -1
  13. package/dist/cjs/extensions/marketplace/english-auctions/read/getAuction.js +18 -2
  14. package/dist/cjs/extensions/marketplace/english-auctions/read/getAuction.js.map +1 -1
  15. package/dist/cjs/extensions/marketplace/english-auctions/read/getWinningBid.js +19 -3
  16. package/dist/cjs/extensions/marketplace/english-auctions/read/getWinningBid.js.map +1 -1
  17. package/dist/cjs/extensions/marketplace/english-auctions/write/bidInAuction.js +27 -8
  18. package/dist/cjs/extensions/marketplace/english-auctions/write/bidInAuction.js.map +1 -1
  19. package/dist/cjs/extensions/marketplace/english-auctions/write/cancelAuction.js +19 -2
  20. package/dist/cjs/extensions/marketplace/english-auctions/write/cancelAuction.js.map +1 -1
  21. package/dist/cjs/extensions/marketplace/english-auctions/write/createAuction.js +18 -2
  22. package/dist/cjs/extensions/marketplace/english-auctions/write/createAuction.js.map +1 -1
  23. package/dist/cjs/extensions/prebuilts/deploy-published.js +6 -1
  24. package/dist/cjs/extensions/prebuilts/deploy-published.js.map +1 -1
  25. package/dist/cjs/extensions/prebuilts/get-required-transactions.js +110 -23
  26. package/dist/cjs/extensions/prebuilts/get-required-transactions.js.map +1 -1
  27. package/dist/cjs/gas/fee-data.js +2 -2
  28. package/dist/cjs/gas/fee-data.js.map +1 -1
  29. package/dist/cjs/pay/buyWithFiat/getQuote.js +1 -0
  30. package/dist/cjs/pay/buyWithFiat/getQuote.js.map +1 -1
  31. package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  32. package/dist/cjs/react/core/utils/walletIcon.js +5 -1
  33. package/dist/cjs/react/core/utils/walletIcon.js.map +1 -1
  34. package/dist/cjs/react/native/ui/components/WalletImage.js +2 -0
  35. package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
  36. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +1 -0
  37. package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -1
  38. package/dist/cjs/react/native/ui/icons/svgs.js +5 -1
  39. package/dist/cjs/react/native/ui/icons/svgs.js.map +1 -1
  40. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +1 -0
  41. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  42. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +2 -2
  43. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  44. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +3 -2
  45. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  46. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js +3 -1
  47. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -1
  48. package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +3 -1
  49. package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
  50. package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js.map +1 -1
  51. package/dist/cjs/react/web/ui/PayEmbed.js +1 -1
  52. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  53. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -0
  54. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  55. package/dist/cjs/react/web/wallets/shared/oauthSignIn.js +1 -0
  56. package/dist/cjs/react/web/wallets/shared/oauthSignIn.js.map +1 -1
  57. package/dist/cjs/utils/abi/normalizeFunctionParams.js +6 -6
  58. package/dist/cjs/utils/abi/normalizeFunctionParams.js.map +1 -1
  59. package/dist/cjs/utils/any-evm/deploy-metadata.js +2 -1
  60. package/dist/cjs/utils/any-evm/deploy-metadata.js.map +1 -1
  61. package/dist/cjs/utils/any-evm/get-init-bytecode-with-salt.js +2 -2
  62. package/dist/cjs/utils/any-evm/get-init-bytecode-with-salt.js.map +1 -1
  63. package/dist/cjs/utils/contract/parse-abi-params.js +3 -0
  64. package/dist/cjs/utils/contract/parse-abi-params.js.map +1 -1
  65. package/dist/cjs/version.js +1 -1
  66. package/dist/cjs/wallets/in-app/core/authentication/types.js +1 -0
  67. package/dist/cjs/wallets/in-app/core/authentication/types.js.map +1 -1
  68. package/dist/cjs/wallets/in-app/native/native-connector.js +2 -0
  69. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  70. package/dist/cjs/wallets/in-app/web/ecosystem.js +2 -0
  71. package/dist/cjs/wallets/in-app/web/ecosystem.js.map +1 -1
  72. package/dist/cjs/wallets/in-app/web/in-app.js +1 -0
  73. package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
  74. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +2 -0
  75. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  76. package/dist/cjs/wallets/types.js +1 -0
  77. package/dist/cjs/wallets/types.js.map +1 -1
  78. package/dist/esm/contract/deployment/deploy-with-abi.js +17 -6
  79. package/dist/esm/contract/deployment/deploy-with-abi.js.map +1 -1
  80. package/dist/esm/exports/deploys.js +1 -1
  81. package/dist/esm/exports/deploys.js.map +1 -1
  82. package/dist/esm/exports/extensions/marketplace.js +9 -8
  83. package/dist/esm/exports/extensions/marketplace.js.map +1 -1
  84. package/dist/esm/extensions/marketplace/direct-listings/read/getListing.js +17 -2
  85. package/dist/esm/extensions/marketplace/direct-listings/read/getListing.js.map +1 -1
  86. package/dist/esm/extensions/marketplace/direct-listings/write/buyFromListing.js +20 -4
  87. package/dist/esm/extensions/marketplace/direct-listings/write/buyFromListing.js.map +1 -1
  88. package/dist/esm/extensions/marketplace/direct-listings/write/createListing.js +17 -2
  89. package/dist/esm/extensions/marketplace/direct-listings/write/createListing.js.map +1 -1
  90. package/dist/esm/extensions/marketplace/english-auctions/read/getAuction.js +17 -2
  91. package/dist/esm/extensions/marketplace/english-auctions/read/getAuction.js.map +1 -1
  92. package/dist/esm/extensions/marketplace/english-auctions/read/getWinningBid.js +19 -4
  93. package/dist/esm/extensions/marketplace/english-auctions/read/getWinningBid.js.map +1 -1
  94. package/dist/esm/extensions/marketplace/english-auctions/write/bidInAuction.js +26 -8
  95. package/dist/esm/extensions/marketplace/english-auctions/write/bidInAuction.js.map +1 -1
  96. package/dist/esm/extensions/marketplace/english-auctions/write/cancelAuction.js +19 -3
  97. package/dist/esm/extensions/marketplace/english-auctions/write/cancelAuction.js.map +1 -1
  98. package/dist/esm/extensions/marketplace/english-auctions/write/createAuction.js +17 -2
  99. package/dist/esm/extensions/marketplace/english-auctions/write/createAuction.js.map +1 -1
  100. package/dist/esm/extensions/prebuilts/deploy-published.js +6 -1
  101. package/dist/esm/extensions/prebuilts/deploy-published.js.map +1 -1
  102. package/dist/esm/extensions/prebuilts/get-required-transactions.js +108 -22
  103. package/dist/esm/extensions/prebuilts/get-required-transactions.js.map +1 -1
  104. package/dist/esm/gas/fee-data.js +2 -2
  105. package/dist/esm/gas/fee-data.js.map +1 -1
  106. package/dist/esm/pay/buyWithFiat/getQuote.js +1 -0
  107. package/dist/esm/pay/buyWithFiat/getQuote.js.map +1 -1
  108. package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  109. package/dist/esm/react/core/utils/walletIcon.js +4 -0
  110. package/dist/esm/react/core/utils/walletIcon.js.map +1 -1
  111. package/dist/esm/react/native/ui/components/WalletImage.js +3 -1
  112. package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -1
  113. package/dist/esm/react/native/ui/connect/InAppWalletUI.js +2 -1
  114. package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -1
  115. package/dist/esm/react/native/ui/icons/svgs.js +4 -0
  116. package/dist/esm/react/native/ui/icons/svgs.js.map +1 -1
  117. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +1 -0
  118. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  119. package/dist/esm/react/web/ui/ConnectWallet/Details.js +2 -2
  120. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  121. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +3 -2
  122. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  123. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js +3 -1
  124. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -1
  125. package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +3 -1
  126. package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
  127. package/dist/esm/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js.map +1 -1
  128. package/dist/esm/react/web/ui/PayEmbed.js +1 -1
  129. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  130. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -0
  131. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  132. package/dist/esm/react/web/wallets/shared/oauthSignIn.js +1 -0
  133. package/dist/esm/react/web/wallets/shared/oauthSignIn.js.map +1 -1
  134. package/dist/esm/utils/abi/normalizeFunctionParams.js +6 -6
  135. package/dist/esm/utils/abi/normalizeFunctionParams.js.map +1 -1
  136. package/dist/esm/utils/any-evm/deploy-metadata.js +2 -1
  137. package/dist/esm/utils/any-evm/deploy-metadata.js.map +1 -1
  138. package/dist/esm/utils/any-evm/get-init-bytecode-with-salt.js +1 -1
  139. package/dist/esm/utils/any-evm/get-init-bytecode-with-salt.js.map +1 -1
  140. package/dist/esm/utils/contract/parse-abi-params.js +3 -0
  141. package/dist/esm/utils/contract/parse-abi-params.js.map +1 -1
  142. package/dist/esm/version.js +1 -1
  143. package/dist/esm/wallets/in-app/core/authentication/types.js +1 -0
  144. package/dist/esm/wallets/in-app/core/authentication/types.js.map +1 -1
  145. package/dist/esm/wallets/in-app/native/native-connector.js +2 -0
  146. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  147. package/dist/esm/wallets/in-app/web/ecosystem.js +2 -0
  148. package/dist/esm/wallets/in-app/web/ecosystem.js.map +1 -1
  149. package/dist/esm/wallets/in-app/web/in-app.js +1 -0
  150. package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
  151. package/dist/esm/wallets/in-app/web/lib/web-connector.js +2 -0
  152. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  153. package/dist/esm/wallets/types.js +1 -0
  154. package/dist/esm/wallets/types.js.map +1 -1
  155. package/dist/types/contract/deployment/deploy-with-abi.d.ts.map +1 -1
  156. package/dist/types/exports/deploys.d.ts +1 -1
  157. package/dist/types/exports/deploys.d.ts.map +1 -1
  158. package/dist/types/exports/extensions/marketplace.d.ts +9 -8
  159. package/dist/types/exports/extensions/marketplace.d.ts.map +1 -1
  160. package/dist/types/extensions/marketplace/direct-listings/read/getListing.d.ts +15 -2
  161. package/dist/types/extensions/marketplace/direct-listings/read/getListing.d.ts.map +1 -1
  162. package/dist/types/extensions/marketplace/direct-listings/write/buyFromListing.d.ts +13 -0
  163. package/dist/types/extensions/marketplace/direct-listings/write/buyFromListing.d.ts.map +1 -1
  164. package/dist/types/extensions/marketplace/direct-listings/write/createListing.d.ts +13 -0
  165. package/dist/types/extensions/marketplace/direct-listings/write/createListing.d.ts.map +1 -1
  166. package/dist/types/extensions/marketplace/english-auctions/read/getAuction.d.ts +15 -2
  167. package/dist/types/extensions/marketplace/english-auctions/read/getAuction.d.ts.map +1 -1
  168. package/dist/types/extensions/marketplace/english-auctions/read/getWinningBid.d.ts +15 -2
  169. package/dist/types/extensions/marketplace/english-auctions/read/getWinningBid.d.ts.map +1 -1
  170. package/dist/types/extensions/marketplace/english-auctions/write/bidInAuction.d.ts +13 -0
  171. package/dist/types/extensions/marketplace/english-auctions/write/bidInAuction.d.ts.map +1 -1
  172. package/dist/types/extensions/marketplace/english-auctions/write/cancelAuction.d.ts +13 -0
  173. package/dist/types/extensions/marketplace/english-auctions/write/cancelAuction.d.ts.map +1 -1
  174. package/dist/types/extensions/marketplace/english-auctions/write/createAuction.d.ts +13 -0
  175. package/dist/types/extensions/marketplace/english-auctions/write/createAuction.d.ts.map +1 -1
  176. package/dist/types/extensions/prebuilts/deploy-published.d.ts.map +1 -1
  177. package/dist/types/extensions/prebuilts/get-required-transactions.d.ts +8 -8
  178. package/dist/types/extensions/prebuilts/get-required-transactions.d.ts.map +1 -1
  179. package/dist/types/pay/buyWithFiat/getQuote.d.ts +7 -0
  180. package/dist/types/pay/buyWithFiat/getQuote.d.ts.map +1 -1
  181. package/dist/types/pay/utils/commonTypes.d.ts +1 -0
  182. package/dist/types/pay/utils/commonTypes.d.ts.map +1 -1
  183. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +7 -0
  184. package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
  185. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +2 -0
  186. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  187. package/dist/types/react/core/utils/storage.d.ts +1 -1
  188. package/dist/types/react/core/utils/storage.d.ts.map +1 -1
  189. package/dist/types/react/core/utils/walletIcon.d.ts +3 -1
  190. package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -1
  191. package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
  192. package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
  193. package/dist/types/react/native/ui/icons/svgs.d.ts +1 -0
  194. package/dist/types/react/native/ui/icons/svgs.d.ts.map +1 -1
  195. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +2 -0
  196. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  197. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +2 -0
  198. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
  199. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.d.ts +2 -0
  200. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.d.ts.map +1 -1
  201. package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts.map +1 -1
  202. package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts +2 -0
  203. package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts.map +1 -1
  204. package/dist/types/react/web/ui/PayEmbed.d.ts +6 -1
  205. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  206. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  207. package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts.map +1 -1
  208. package/dist/types/utils/abi/normalizeFunctionParams.d.ts.map +1 -1
  209. package/dist/types/utils/any-evm/deploy-metadata.d.ts +27 -1
  210. package/dist/types/utils/any-evm/deploy-metadata.d.ts.map +1 -1
  211. package/dist/types/utils/any-evm/get-init-bytecode-with-salt.d.ts +1 -1
  212. package/dist/types/utils/any-evm/get-init-bytecode-with-salt.d.ts.map +1 -1
  213. package/dist/types/utils/contract/parse-abi-params.d.ts.map +1 -1
  214. package/dist/types/version.d.ts +1 -1
  215. package/dist/types/wallets/in-app/core/authentication/types.d.ts +1 -0
  216. package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
  217. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  218. package/dist/types/wallets/in-app/web/ecosystem.d.ts +2 -0
  219. package/dist/types/wallets/in-app/web/ecosystem.d.ts.map +1 -1
  220. package/dist/types/wallets/in-app/web/in-app.d.ts +1 -0
  221. package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
  222. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  223. package/dist/types/wallets/types.d.ts +2 -2
  224. package/dist/types/wallets/types.d.ts.map +1 -1
  225. package/package.json +2 -2
  226. package/src/contract/deployment/deploy-with-abi.ts +19 -6
  227. package/src/exports/deploys.ts +1 -1
  228. package/src/exports/extensions/marketplace.ts +10 -0
  229. package/src/extensions/marketplace/direct-listings/read/getListing.ts +19 -7
  230. package/src/extensions/marketplace/direct-listings/write/buyFromListing.ts +23 -4
  231. package/src/extensions/marketplace/direct-listings/write/createListing.ts +18 -2
  232. package/src/extensions/marketplace/english-auctions/read/getAuction.ts +19 -7
  233. package/src/extensions/marketplace/english-auctions/read/getWinningBid.ts +21 -8
  234. package/src/extensions/marketplace/english-auctions/write/bidInAuction.ts +29 -8
  235. package/src/extensions/marketplace/english-auctions/write/cancelAuction.ts +25 -3
  236. package/src/extensions/marketplace/english-auctions/write/createAuction.ts +18 -2
  237. package/src/extensions/prebuilts/deploy-published.ts +7 -1
  238. package/src/extensions/prebuilts/get-required-transactions.test.ts +13 -11
  239. package/src/extensions/prebuilts/get-required-transactions.ts +149 -32
  240. package/src/gas/fee-data.ts +5 -1
  241. package/src/pay/buyWithFiat/getQuote.ts +9 -0
  242. package/src/pay/utils/commonTypes.ts +2 -0
  243. package/src/react/core/hooks/connection/ConnectButtonProps.ts +8 -0
  244. package/src/react/core/hooks/transaction/useSendTransaction.ts +2 -0
  245. package/src/react/core/utils/walletIcon.ts +6 -0
  246. package/src/react/native/ui/components/WalletImage.tsx +3 -0
  247. package/src/react/native/ui/connect/InAppWalletUI.tsx +2 -0
  248. package/src/react/native/ui/icons/svgs.ts +5 -0
  249. package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +1 -0
  250. package/src/react/web/ui/ConnectWallet/Details.tsx +4 -0
  251. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +6 -0
  252. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.tsx +21 -17
  253. package/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx +17 -15
  254. package/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx +2 -0
  255. package/src/react/web/ui/PayEmbed.tsx +8 -1
  256. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +1 -0
  257. package/src/react/web/wallets/shared/oauthSignIn.ts +1 -0
  258. package/src/utils/abi/normalizeFunctionParams.ts +24 -19
  259. package/src/utils/any-evm/deploy-metadata.ts +33 -2
  260. package/src/utils/any-evm/get-init-bytecode-with-salt.ts +2 -2
  261. package/src/utils/contract/parse-abi-params.ts +3 -0
  262. package/src/version.ts +1 -1
  263. package/src/wallets/in-app/core/authentication/types.ts +1 -0
  264. package/src/wallets/in-app/native/native-connector.ts +2 -0
  265. package/src/wallets/in-app/web/ecosystem.ts +2 -0
  266. package/src/wallets/in-app/web/in-app.ts +1 -0
  267. package/src/wallets/in-app/web/lib/web-connector.ts +2 -0
  268. package/src/wallets/types.ts +1 -0
@@ -10,7 +10,7 @@ import type { BaseTransactionOptions } from "../../../../transaction/types.js";
10
10
  import { toUnits } from "../../../../utils/units.js";
11
11
  import { isERC721 } from "../../../erc721/read/isERC721.js";
12
12
  import { isERC1155 } from "../../../erc1155/read/isERC1155.js";
13
- import { createListing as generatedCreateListing } from "../../__generated__/IDirectListings/write/createListing.js";
13
+ import * as CreateListing from "../../__generated__/IDirectListings/write/createListing.js";
14
14
 
15
15
  /**
16
16
  * @extension MARKETPLACE
@@ -88,7 +88,7 @@ export type CreateListingParams = {
88
88
  export function createListing(
89
89
  options: BaseTransactionOptions<CreateListingParams>,
90
90
  ) {
91
- return generatedCreateListing({
91
+ return CreateListing.createListing({
92
92
  contract: options.contract,
93
93
  asyncParams: async () => {
94
94
  const assetContract = getContract({
@@ -182,3 +182,19 @@ export function createListing(
182
182
  },
183
183
  });
184
184
  }
185
+
186
+ /**
187
+ * Checks if the `createListing` method is supported by the given contract.
188
+ * @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.
189
+ * @returns A boolean indicating if the `createListing` method is supported.
190
+ * @extension MARKETPLACE
191
+ * @example
192
+ * ```ts
193
+ * import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace";
194
+ *
195
+ * const supported = isCreateAuctionSupported(["0x..."]);
196
+ * ```
197
+ */
198
+ export function isCreateListingSupported(availableSelectors: string[]) {
199
+ return CreateListing.isCreateListingSupported(availableSelectors);
200
+ }
@@ -1,18 +1,14 @@
1
1
  import { eth_getBlockByNumber } from "../../../../rpc/actions/eth_getBlockByNumber.js";
2
2
  import { getRpcClient } from "../../../../rpc/rpc.js";
3
3
  import type { BaseTransactionOptions } from "../../../../transaction/types.js";
4
-
5
- import {
6
- type GetAuctionParams as GetAuctionParamsGenerated,
7
- getAuction as getAuctionGenerated,
8
- } from "../../__generated__/IEnglishAuctions/read/getAuction.js";
4
+ import * as GetAuction from "../../__generated__/IEnglishAuctions/read/getAuction.js";
9
5
  import type { EnglishAuction } from "../types.js";
10
6
  import { mapEnglishAuction } from "../utils.js";
11
7
 
12
8
  /**
13
9
  * @extension MARKETPLACE
14
10
  */
15
- export type GetAuctionParams = GetAuctionParamsGenerated;
11
+ export type GetAuctionParams = GetAuction.GetAuctionParams;
16
12
 
17
13
  /**
18
14
  * Retrieves an auction listing based on the provided options.
@@ -32,7 +28,7 @@ export async function getAuction(
32
28
  ): Promise<EnglishAuction> {
33
29
  const rpcClient = getRpcClient(options.contract);
34
30
  const [rawAuction, latestBlock] = await Promise.all([
35
- getAuctionGenerated(options),
31
+ GetAuction.getAuction(options),
36
32
  eth_getBlockByNumber(rpcClient, {
37
33
  blockTag: "latest",
38
34
  }),
@@ -44,3 +40,19 @@ export async function getAuction(
44
40
  rawAuction,
45
41
  });
46
42
  }
43
+
44
+ /**
45
+ * Checks if the `getAuction` method is supported by the given contract.
46
+ * @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.
47
+ * @returns A boolean indicating if the `getAuction` method is supported.
48
+ * @extension MARKETPLACE
49
+ * @example
50
+ * ```ts
51
+ * import { isGetAuctionSupported } from "thirdweb/extensions/marketplace";
52
+ *
53
+ * const supported = isGetAuctionSupported(["0x..."]);
54
+ * ```
55
+ */
56
+ export function isGetAuctionSupported(availableSelectors: string[]) {
57
+ return GetAuction.isGetAuctionSupported(availableSelectors);
58
+ }
@@ -1,15 +1,12 @@
1
- import { ADDRESS_ZERO } from "../../../../constants/addresses.js";
1
+ import { ZERO_ADDRESS } from "../../../../constants/addresses.js";
2
2
  import type { BaseTransactionOptions } from "../../../../transaction/types.js";
3
3
  import { resolveCurrencyValue } from "../../../../utils/extensions/resolve-currency-value.js";
4
- import {
5
- type GetWinningBidParams as GeneratedWinningBidParams,
6
- getWinningBid as getWinningBidGenerated,
7
- } from "../../__generated__/IEnglishAuctions/read/getWinningBid.js";
4
+ import * as GetWinningBid from "../../__generated__/IEnglishAuctions/read/getWinningBid.js";
8
5
 
9
6
  /**
10
7
  * @extension MARKETPLACE
11
8
  */
12
- export type GetWinningBidParams = GeneratedWinningBidParams;
9
+ export type GetWinningBidParams = GetWinningBid.GetWinningBidParams;
13
10
 
14
11
  /**
15
12
  * Retrieves the winning bid information for a given auction.
@@ -31,9 +28,9 @@ export async function getWinningBid(
31
28
  options: BaseTransactionOptions<GetWinningBidParams>,
32
29
  ) {
33
30
  const [bidderAddress, currencyAddress, bidAmountWei] =
34
- await getWinningBidGenerated(options);
31
+ await GetWinningBid.getWinningBid(options);
35
32
 
36
- if (bidderAddress === ADDRESS_ZERO) {
33
+ if (bidderAddress === ZERO_ADDRESS) {
37
34
  return undefined;
38
35
  }
39
36
 
@@ -49,3 +46,19 @@ export async function getWinningBid(
49
46
  }),
50
47
  };
51
48
  }
49
+
50
+ /**
51
+ * Checks if the `getWinningBid` method is supported by the given contract.
52
+ * @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.
53
+ * @returns A boolean indicating if the `getWinningBid` method is supported.
54
+ * @extension MARKETPLACE
55
+ * @example
56
+ * ```ts
57
+ * import { isGetWinningBidSupported } from "thirdweb/extensions/marketplace";
58
+ *
59
+ * const supported = isGetWinningBidSupported(["0x..."]);
60
+ * ```
61
+ */
62
+ export function isGetWinningBidSupported(availableSelectors: string[]) {
63
+ return GetWinningBid.isGetWinningBidSupported(availableSelectors);
64
+ }
@@ -1,9 +1,9 @@
1
1
  import { isNativeTokenAddress } from "../../../../constants/addresses.js";
2
2
  import type { BaseTransactionOptions } from "../../../../transaction/types.js";
3
- import { isNewWinningBid } from "../../__generated__/IEnglishAuctions/read/isNewWinningBid.js";
4
- import { bidInAuction as generatedBidInAuction } from "../../__generated__/IEnglishAuctions/write/bidInAuction.js";
5
- import { getAuction } from "../read/getAuction.js";
6
- import { getWinningBid } from "../read/getWinningBid.js";
3
+ import * as IsNewWinningBid from "../../__generated__/IEnglishAuctions/read/isNewWinningBid.js";
4
+ import * as BidInAuction from "../../__generated__/IEnglishAuctions/write/bidInAuction.js";
5
+ import * as GetAuction from "../read/getAuction.js";
6
+ import * as GetWinningBid from "../read/getWinningBid.js";
7
7
 
8
8
  /**
9
9
  * @extension MARKETPLACE
@@ -39,10 +39,10 @@ export type BidInAuctionParams = {
39
39
  export function bidInAuction(
40
40
  options: BaseTransactionOptions<BidInAuctionParams>,
41
41
  ) {
42
- return generatedBidInAuction({
42
+ return BidInAuction.bidInAuction({
43
43
  contract: options.contract,
44
44
  asyncParams: async () => {
45
- const auction = await getAuction({
45
+ const auction = await GetAuction.getAuction({
46
46
  contract: options.contract,
47
47
  auctionId: options.auctionId,
48
48
  });
@@ -70,13 +70,13 @@ export function bidInAuction(
70
70
  if (resolvedBidAmountWei > auction.buyoutCurrencyValue.value) {
71
71
  throw new Error("Bid amount is above the buyout amount");
72
72
  }
73
- const existingWinningBid = await getWinningBid({
73
+ const existingWinningBid = await GetWinningBid.getWinningBid({
74
74
  auctionId: options.auctionId,
75
75
  contract: options.contract,
76
76
  });
77
77
  if (existingWinningBid) {
78
78
  // check if the bid amount is sufficient to outbid the existing winning bid
79
- const isNewWinner = await isNewWinningBid({
79
+ const isNewWinner = await IsNewWinningBid.isNewWinningBid({
80
80
  contract: options.contract,
81
81
  auctionId: options.auctionId,
82
82
  bidAmount: resolvedBidAmountWei,
@@ -106,3 +106,24 @@ export function bidInAuction(
106
106
  },
107
107
  });
108
108
  }
109
+
110
+ /**
111
+ * Checks if the `bidInAuction` method is supported by the given contract.
112
+ * @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.
113
+ * @returns A boolean indicating if the `bidInAuction` method is supported.
114
+ * @extension MARKETPLACE
115
+ * @example
116
+ * ```ts
117
+ * import { isBidInAuctionSupported } from "thirdweb/extensions/marketplace";
118
+ *
119
+ * const supported = isBidInAuctionSupported(["0x..."]);
120
+ * ```
121
+ */
122
+ export function isBidInAuctionSupported(availableSelectors: string[]) {
123
+ return (
124
+ BidInAuction.isBidInAuctionSupported(availableSelectors) &&
125
+ GetWinningBid.isGetWinningBidSupported(availableSelectors) &&
126
+ GetAuction.isGetAuctionSupported(availableSelectors) &&
127
+ IsNewWinningBid.isIsNewWinningBidSupported(availableSelectors)
128
+ );
129
+ }
@@ -1,6 +1,9 @@
1
1
  import type { BaseTransactionOptions } from "../../../../transaction/types.js";
2
- import { cancelAuction as generatedCancelAuction } from "../../__generated__/IEnglishAuctions/write/cancelAuction.js";
3
- import { getWinningBid } from "../read/getWinningBid.js";
2
+ import * as CancelAuction from "../../__generated__/IEnglishAuctions/write/cancelAuction.js";
3
+ import {
4
+ getWinningBid,
5
+ isGetWinningBidSupported,
6
+ } from "../read/getWinningBid.js";
4
7
 
5
8
  /**
6
9
  * @extension MARKETPLACE
@@ -32,7 +35,7 @@ export type CancelAuctionParams = {
32
35
  export function cancelAuction(
33
36
  options: BaseTransactionOptions<CancelAuctionParams>,
34
37
  ) {
35
- return generatedCancelAuction({
38
+ return CancelAuction.cancelAuction({
36
39
  contract: options.contract,
37
40
  asyncParams: async () => {
38
41
  const winningBid = await getWinningBid({
@@ -51,3 +54,22 @@ export function cancelAuction(
51
54
  },
52
55
  });
53
56
  }
57
+
58
+ /**
59
+ * Checks if the `cancelAuction` method is supported by the given contract.
60
+ * @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.
61
+ * @returns A boolean indicating if the `cancelAuction` method is supported.
62
+ * @extension MARKETPLACE
63
+ * @example
64
+ * ```ts
65
+ * import { isCancelAuctionSupported } from "thirdweb/extensions/marketplace";
66
+ *
67
+ * const supported = isCancelAuctionSupported(["0x..."]);
68
+ * ```
69
+ */
70
+ export function isCancelAuctionSupported(availableSelectors: string[]) {
71
+ return (
72
+ CancelAuction.isCancelAuctionSupported(availableSelectors) &&
73
+ isGetWinningBidSupported(availableSelectors)
74
+ );
75
+ }
@@ -10,7 +10,7 @@ import type { BaseTransactionOptions } from "../../../../transaction/types.js";
10
10
  import { toUnits } from "../../../../utils/units.js";
11
11
  import { isERC721 } from "../../../erc721/read/isERC721.js";
12
12
  import { isERC1155 } from "../../../erc1155/read/isERC1155.js";
13
- import { createAuction as generatedCreateAuction } from "../../__generated__/IEnglishAuctions/write/createAuction.js";
13
+ import * as CreateAuction from "../../__generated__/IEnglishAuctions/write/createAuction.js";
14
14
 
15
15
  /**
16
16
  * @extension MARKETPLACE
@@ -119,7 +119,7 @@ export type CreateAuctionParams = {
119
119
  export function createAuction(
120
120
  options: BaseTransactionOptions<CreateAuctionParams>,
121
121
  ) {
122
- return generatedCreateAuction({
122
+ return CreateAuction.createAuction({
123
123
  ...options,
124
124
  asyncParams: async () => {
125
125
  const assetContract = getContract({
@@ -245,3 +245,19 @@ export function createAuction(
245
245
  },
246
246
  });
247
247
  }
248
+
249
+ /**
250
+ * Checks if the `createAuction` method is supported by the given contract.
251
+ * @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.
252
+ * @returns A boolean indicating if the `createAuction` method is supported.
253
+ * @extension MARKETPLACE
254
+ * @example
255
+ * ```ts
256
+ * import { isCreateAuctionSupported } from "thirdweb/extensions/marketplace";
257
+ *
258
+ * const supported = isCreateAuctionSupported(["0x..."]);
259
+ * ```
260
+ */
261
+ export function isCreateAuctionSupported(availableSelectors: string[]) {
262
+ return CreateAuction.isCreateAuctionSupported(availableSelectors);
263
+ }
@@ -18,6 +18,7 @@ import type { FetchDeployMetadataResult } from "../../utils/any-evm/deploy-metad
18
18
  import { isZkSyncChain } from "../../utils/any-evm/zksync/isZkSyncChain.js";
19
19
  import type { Hex } from "../../utils/encoding/hex.js";
20
20
  import type { Account } from "../../wallets/interfaces/wallet.js";
21
+ import { getAllDefaultConstructorParamsForImplementation } from "./get-required-transactions.js";
21
22
 
22
23
  /**
23
24
  * @extension DEPLOY
@@ -168,7 +169,12 @@ export async function deployContractfromDeployMetadata(
168
169
  client,
169
170
  account,
170
171
  contractId: deployMetadata.name,
171
- constructorParams: implementationConstructorParams,
172
+ constructorParams:
173
+ implementationConstructorParams ||
174
+ (await getAllDefaultConstructorParamsForImplementation({
175
+ chain,
176
+ client,
177
+ })),
172
178
  publisher: deployMetadata.publisher,
173
179
  });
174
180
 
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
2
2
  import { CLEAN_ANVIL_CHAIN } from "../../../test/src/chains.js";
3
3
  import { TEST_CLIENT } from "../../../test/src/test-clients.js";
4
4
  import { fetchPublishedContractMetadata } from "../../contract/deployment/publisher.js";
5
- import { getRequiredTransactionCount } from "./get-required-transactions.js";
5
+ import { getRequiredTransactions } from "./get-required-transactions.js";
6
6
 
7
7
  describe.runIf(process.env.TW_SECRET_KEY)(
8
8
  "getRequiredTransactions",
@@ -11,47 +11,49 @@ describe.runIf(process.env.TW_SECRET_KEY)(
11
11
  },
12
12
  () => {
13
13
  it("should count transactions for a published direct deploy contract", async () => {
14
- const metadata = await fetchPublishedContractMetadata({
14
+ const deployMetadata = await fetchPublishedContractMetadata({
15
15
  client: TEST_CLIENT,
16
16
  contractId: "AccountFactory",
17
17
  });
18
- const results = await getRequiredTransactionCount({
18
+ const results = await getRequiredTransactions({
19
19
  client: TEST_CLIENT,
20
20
  chain: CLEAN_ANVIL_CHAIN,
21
- metadata,
21
+ deployMetadata,
22
22
  });
23
23
  expect(results.length).toBe(1);
24
24
  });
25
25
 
26
26
  it("should count transactions for a published autofactory contract", async () => {
27
- const metadata = await fetchPublishedContractMetadata({
27
+ const deployMetadata = await fetchPublishedContractMetadata({
28
28
  client: TEST_CLIENT,
29
29
  contractId: "Airdrop",
30
30
  });
31
- const results = await getRequiredTransactionCount({
31
+ const results = await getRequiredTransactions({
32
32
  client: TEST_CLIENT,
33
33
  chain: CLEAN_ANVIL_CHAIN,
34
- metadata,
34
+ deployMetadata,
35
35
  });
36
36
  expect(results.length).toBe(4);
37
37
  });
38
38
 
39
39
  it("should count transactions for a modular contract with modules", async () => {
40
- const metadata = await fetchPublishedContractMetadata({
40
+ const deployMetadata = await fetchPublishedContractMetadata({
41
41
  client: TEST_CLIENT,
42
42
  contractId: "ERC721CoreInitializable",
43
43
  });
44
- const results = await getRequiredTransactionCount({
44
+ const results = await getRequiredTransactions({
45
45
  client: TEST_CLIENT,
46
46
  chain: CLEAN_ANVIL_CHAIN,
47
- metadata,
47
+ deployMetadata,
48
48
  modules: await Promise.all(
49
49
  ["ClaimableERC721", "BatchMetadataERC721", "RoyaltyERC721"].map(
50
50
  (contractId) =>
51
51
  fetchPublishedContractMetadata({
52
52
  client: TEST_CLIENT,
53
53
  contractId,
54
- }),
54
+ }).then((m) => ({
55
+ deployMetadata: m,
56
+ })),
55
57
  ),
56
58
  ),
57
59
  });
@@ -5,6 +5,8 @@ import { getDeployedInfraContract } from "../../contract/deployment/utils/infra.
5
5
  import { getDeployedInfraContractFromMetadata } from "../../contract/deployment/utils/infra.js";
6
6
  import { computePublishedContractAddress } from "../../utils/any-evm/compute-published-contract-address.js";
7
7
  import type { FetchDeployMetadataResult } from "../../utils/any-evm/deploy-metadata.js";
8
+ import { isZkSyncChain } from "../../utils/any-evm/zksync/isZkSyncChain.js";
9
+ import type { DeployContractfromDeployMetadataOptions } from "./deploy-published.js";
8
10
 
9
11
  /**
10
12
  * @internal
@@ -13,6 +15,7 @@ export type DeployTransactionType =
13
15
  | "infra"
14
16
  | "implementation"
15
17
  | "module"
18
+ | "extension"
16
19
  | "proxy";
17
20
 
18
21
  /**
@@ -26,36 +29,42 @@ export type DeployTransactionResult = {
26
29
  /**
27
30
  * @internal
28
31
  */
29
- export async function getRequiredTransactionCount(options: {
30
- chain: Chain;
31
- client: ThirdwebClient;
32
- metadata: FetchDeployMetadataResult;
33
- constructorParams?: Record<string, unknown>;
34
- implementationConstructorParams?: Record<string, unknown>;
35
- modules?: FetchDeployMetadataResult[];
36
- }): Promise<DeployTransactionResult[]> {
32
+ export async function getRequiredTransactions(
33
+ options: Omit<
34
+ DeployContractfromDeployMetadataOptions,
35
+ "account" | "initializeParams"
36
+ >,
37
+ ): Promise<DeployTransactionResult[]> {
37
38
  const {
38
39
  chain,
39
40
  client,
40
- metadata,
41
+ deployMetadata,
41
42
  implementationConstructorParams,
42
43
  modules = [],
43
44
  } = options;
44
45
 
45
- if (metadata?.deployType === "autoFactory") {
46
- const results: (DeployTransactionResult | null)[] = await Promise.all([
46
+ if (deployMetadata?.deployType === "autoFactory") {
47
+ const results: (
48
+ | DeployTransactionResult
49
+ | DeployTransactionResult[]
50
+ | null
51
+ )[] = await Promise.all([
47
52
  getDeployedCreate2Factory({
48
53
  chain,
49
54
  client,
50
55
  }).then((c) =>
51
- c ? null : ({ type: "infra", contractId: "Create2Factory" } as const),
56
+ c || isZkSyncChain(chain)
57
+ ? null
58
+ : ({ type: "infra", contractId: "Create2Factory" } as const),
52
59
  ),
53
60
  getDeployedInfraContract({
54
61
  chain,
55
62
  client,
56
63
  contractId: "Forwarder",
57
64
  }).then((c) =>
58
- c ? null : ({ type: "infra", contractId: "Forwarder" } as const),
65
+ c || isZkSyncChain(chain)
66
+ ? null
67
+ : ({ type: "infra", contractId: "Forwarder" } as const),
59
68
  ),
60
69
  getDeployedInfraContract({
61
70
  chain,
@@ -69,42 +78,150 @@ export async function getRequiredTransactionCount(options: {
69
78
  }),
70
79
  },
71
80
  }).then((c) =>
72
- c ? null : ({ type: "infra", contractId: "TWCloneFactory" } as const),
81
+ c || isZkSyncChain(chain)
82
+ ? null
83
+ : ({ type: "infra", contractId: "TWCloneFactory" } as const),
73
84
  ),
74
85
  // TODO (deploy): add WETH contract check for implementations that need it (check implementation constructor params)
75
- getDeployedInfraContract({
86
+ getTransactionsForImplementation({
76
87
  chain,
77
88
  client,
78
- contractId: metadata.name,
79
- constructorParams: implementationConstructorParams,
80
- publisher: metadata.publisher,
81
- version: metadata.version,
82
- }).then((c) =>
83
- c
84
- ? null
85
- : ({
86
- type: "implementation",
87
- contractId: metadata.name,
88
- } as const),
89
- ),
89
+ deployMetadata,
90
+ implementationConstructorParams,
91
+ }),
90
92
  ...modules.map((m) =>
91
93
  getDeployedInfraContractFromMetadata({
92
94
  chain,
93
95
  client,
94
- contractMetadata: m,
96
+ contractMetadata: m.deployMetadata,
95
97
  }).then((c) =>
96
98
  c
97
99
  ? null
98
100
  : ({
99
101
  type: "module",
100
- contractId: m.name,
102
+ contractId: m.deployMetadata.name,
101
103
  } as const),
102
104
  ),
103
105
  ),
104
106
  ]);
105
- results.push({ type: "proxy", contractId: metadata.name });
106
- return results.filter((r) => r !== null);
107
+ results.push({ type: "proxy", contractId: deployMetadata.name });
108
+ return results.flat().filter((r) => r !== null);
107
109
  }
108
110
 
109
- return [{ type: "implementation", contractId: metadata.name }];
111
+ return [{ type: "implementation", contractId: deployMetadata.name }];
112
+ }
113
+
114
+ async function getTransactionsForImplementation(options: {
115
+ chain: Chain;
116
+ client: ThirdwebClient;
117
+ deployMetadata: FetchDeployMetadataResult;
118
+ implementationConstructorParams?: Record<string, unknown>;
119
+ }): Promise<DeployTransactionResult[]> {
120
+ const { chain, client, deployMetadata, implementationConstructorParams } =
121
+ options;
122
+
123
+ if (deployMetadata.name === "MarketplaceV3") {
124
+ return getTransactionsForMaketplaceV3(options);
125
+ }
126
+
127
+ const constructorParams =
128
+ implementationConstructorParams ??
129
+ (await getAllDefaultConstructorParamsForImplementation({
130
+ chain,
131
+ client,
132
+ }));
133
+
134
+ const result = await getDeployedInfraContract({
135
+ chain,
136
+ client,
137
+ contractId: deployMetadata.name,
138
+ constructorParams,
139
+ publisher: deployMetadata.publisher,
140
+ version: deployMetadata.version,
141
+ }).then((c) =>
142
+ c
143
+ ? null
144
+ : ({
145
+ type: "implementation",
146
+ contractId: deployMetadata.name,
147
+ } as const),
148
+ );
149
+ return result ? [result] : [];
150
+ }
151
+
152
+ async function getTransactionsForMaketplaceV3(options: {
153
+ chain: Chain;
154
+ client: ThirdwebClient;
155
+ }): Promise<DeployTransactionResult[]> {
156
+ const { chain, client } = options;
157
+ const WETHAdress = await computePublishedContractAddress({
158
+ chain,
159
+ client,
160
+ contractId: "WETH9",
161
+ });
162
+ const extensions: (DeployTransactionResult | null)[] = await Promise.all([
163
+ getDeployedInfraContract({
164
+ chain,
165
+ client,
166
+ contractId: "WETH9",
167
+ }).then((c) =>
168
+ c ? null : ({ type: "infra", contractId: "WETH9" } as const),
169
+ ),
170
+ getDeployedInfraContract({
171
+ chain,
172
+ client,
173
+ contractId: "DirectListingsLogic",
174
+ constructorParams: { _nativeTokenWrapper: WETHAdress },
175
+ }).then((c) =>
176
+ c
177
+ ? null
178
+ : ({ type: "extension", contractId: "DirectListingsLogic" } as const),
179
+ ),
180
+ getDeployedInfraContract({
181
+ chain,
182
+ client,
183
+ contractId: "EnglishAuctionsLogic",
184
+ constructorParams: { _nativeTokenWrapper: WETHAdress },
185
+ }).then((c) =>
186
+ c
187
+ ? null
188
+ : ({ type: "extension", contractId: "EnglishAuctionsLogic" } as const),
189
+ ),
190
+ getDeployedInfraContract({
191
+ chain,
192
+ client,
193
+ contractId: "OffersLogic",
194
+ }).then((c) =>
195
+ c ? null : ({ type: "extension", contractId: "OffersLogic" } as const),
196
+ ),
197
+ ]);
198
+ // hacky assumption: if we need to deploy any of the extensions, we also need to deploy the implementation
199
+ const transactions = extensions.filter((e) => e !== null);
200
+ if (transactions.length) {
201
+ transactions.push({ type: "implementation", contractId: "MarketplaceV3" });
202
+ }
203
+ return transactions;
204
+ }
205
+
206
+ export async function getAllDefaultConstructorParamsForImplementation(args: {
207
+ chain: Chain;
208
+ client: ThirdwebClient;
209
+ }) {
210
+ const { chain, client } = args;
211
+ const [forwarder, weth] = await Promise.all([
212
+ computePublishedContractAddress({
213
+ chain,
214
+ client,
215
+ contractId: "Forwarder",
216
+ }),
217
+ computePublishedContractAddress({
218
+ chain,
219
+ client,
220
+ contractId: "WETH9",
221
+ }),
222
+ ]);
223
+ return {
224
+ trustedForwarder: forwarder,
225
+ nativeTokenWrapper: weth,
226
+ };
110
227
  }
@@ -138,6 +138,7 @@ export async function getDefaultGasOverrides(
138
138
  async function getDynamicFeeData(
139
139
  client: ThirdwebClient,
140
140
  chain: Chain,
141
+ percentMultiplier = 10,
141
142
  ): Promise<FeeData> {
142
143
  let maxFeePerGas: null | bigint = null;
143
144
  let maxPriorityFeePerGas_: null | bigint = null;
@@ -173,7 +174,10 @@ async function getDynamicFeeData(
173
174
  }
174
175
 
175
176
  // add 10% tip to maxPriorityFeePerGas for faster processing
176
- maxPriorityFeePerGas_ = getPreferredPriorityFee(maxPriorityFeePerGas_);
177
+ maxPriorityFeePerGas_ = getPreferredPriorityFee(
178
+ maxPriorityFeePerGas_,
179
+ percentMultiplier,
180
+ );
177
181
  // eip-1559 formula, doubling the base fee ensures that the tx can be included in the next 6 blocks no matter how busy the network is
178
182
  // good article on the subject: https://www.blocknative.com/blog/eip-1559-fees
179
183
  maxFeePerGas = baseBlockFee * 2n + maxPriorityFeePerGas_;
@@ -1,5 +1,6 @@
1
1
  import type { ThirdwebClient } from "../../client/client.js";
2
2
  import { getClientFetch } from "../../utils/fetch.js";
3
+ import type { FiatProvider } from "../utils/commonTypes.js";
3
4
  import { getPayBuyWithFiatQuoteEndpoint } from "../utils/definitions.js";
4
5
 
5
6
  /**
@@ -82,6 +83,13 @@ export type GetBuyWithFiatQuoteParams = {
82
83
  * If erc20, will onramp native token + erc20
83
84
  */
84
85
  toGasAmountWei?: string;
86
+
87
+ /**
88
+ * Optional parameter to specify the preferred onramp provider.
89
+ *
90
+ * By default, we choose a recommended provider based on the location of the user, KYC status, and currency.
91
+ */
92
+ preferredProvider?: FiatProvider;
85
93
  };
86
94
 
87
95
  /**
@@ -303,6 +311,7 @@ export async function getBuyWithFiatQuote(
303
311
  purchaseData: params.purchaseData,
304
312
  fromAddress: params.fromAddress,
305
313
  toGasAmountWei: params.toGasAmountWei,
314
+ preferredProvider: params.preferredProvider,
306
315
  }),
307
316
  });
308
317
 
@@ -16,3 +16,5 @@ export type PayOnChainTransactionDetails = {
16
16
  completedAt?: string; // ISO DATE
17
17
  explorerLink?: string;
18
18
  };
19
+
20
+ export type FiatProvider = "STRIPE" | "TRANSAK" | "KADO";