@0xsequence/marketplace-sdk 1.1.0 → 1.1.1

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 (397) hide show
  1. package/.changeset/honest-peas-arrive.md +5 -0
  2. package/.changeset/real-tips-stick.md +8 -0
  3. package/.changeset/tall-pandas-wear.md +8 -0
  4. package/CHANGELOG.md +24 -2
  5. package/dist/{BellIcon-IpHHEy8h.js → BellIcon-ByhygxBO.js} +2 -2
  6. package/dist/{BellIcon-IpHHEy8h.js.map → BellIcon-ByhygxBO.js.map} +1 -1
  7. package/dist/{CartIcon-C8zbor8H.js → CartIcon-Bt3rQYGk.js} +3 -3
  8. package/dist/{CartIcon-C8zbor8H.js.map → CartIcon-Bt3rQYGk.js.map} +1 -1
  9. package/dist/CollectibleCard-CVpdgXA8.d.ts +8 -0
  10. package/dist/_internal-DkS2VUn5.js.map +1 -1
  11. package/dist/abi-fa-o9gH3.js +134 -0
  12. package/dist/abi-fa-o9gH3.js.map +1 -0
  13. package/dist/{alien_swap-BTJ7mSR-.js → alien_swap-DoY6XfMA.js} +1 -1
  14. package/dist/{alien_swap-BTJ7mSR-.js.map → alien_swap-DoY6XfMA.js.map} +1 -1
  15. package/dist/{api-DuLKn__v.js → api-BoO0V5aJ.js} +8 -3
  16. package/dist/api-BoO0V5aJ.js.map +1 -0
  17. package/dist/{aqua-xyz-BYJ9WSP_.js → aqua-xyz-BBDxnG14.js} +1 -1
  18. package/dist/{aqua-xyz-BYJ9WSP_.js.map → aqua-xyz-BBDxnG14.js.map} +1 -1
  19. package/dist/{aura-D7SUjgro.js → aura-DGx2zwvF.js} +1 -1
  20. package/dist/{aura-D7SUjgro.js.map → aura-DGx2zwvF.js.map} +1 -1
  21. package/dist/{blur-BcnRFCaV.js → blur-D8GKrRrq.js} +1 -1
  22. package/dist/{blur-BcnRFCaV.js.map → blur-D8GKrRrq.js.map} +1 -1
  23. package/dist/{coinbase-ChoX9Hw2.js → coinbase-DOry4PXY.js} +1 -1
  24. package/dist/{coinbase-ChoX9Hw2.js.map → coinbase-DOry4PXY.js.map} +1 -1
  25. package/dist/collectibles-C_H8jMGH.js +358 -0
  26. package/dist/collectibles-C_H8jMGH.js.map +1 -0
  27. package/dist/collections-CKummc-R.js +249 -0
  28. package/dist/collections-CKummc-R.js.map +1 -0
  29. package/dist/{components-CUv-wQr8.js → components-CosnX7F9.js} +5 -5
  30. package/dist/{components-CUv-wQr8.js.map → components-CosnX7F9.js.map} +1 -1
  31. package/dist/{contracts-D72LBOX3.js → contracts-BP_0vX48.js} +3 -3
  32. package/dist/{contracts-D72LBOX3.js.map → contracts-BP_0vX48.js.map} +1 -1
  33. package/dist/{create-config-DV_dtaLt.d.ts → create-config-ZOB7i4ZJ.d.ts} +117 -12
  34. package/dist/{element-Dbcv5qya.js → element-ciybd_VF.js} +1 -1
  35. package/dist/{element-Dbcv5qya.js.map → element-ciybd_VF.js.map} +1 -1
  36. package/dist/filters-V-V8Dn8f.d.ts +60 -0
  37. package/dist/{foundation-QPhUEUy8.js → foundation-Bq4lRz4x.js} +1 -1
  38. package/dist/{foundation-QPhUEUy8.js.map → foundation-Bq4lRz4x.js.map} +1 -1
  39. package/dist/index-BOiHR01C.d.ts +106 -0
  40. package/dist/index-BZIJTQT0.d.ts +121 -0
  41. package/dist/index-BeRV-7AX.d.ts +55 -0
  42. package/dist/{index-BaytncQc.d.ts → index-Bsx6XsC2.d.ts} +58 -55
  43. package/dist/{index-jGgfEHfQ.d.ts → index-BtWMBHeP.d.ts} +13 -9
  44. package/dist/{index-CT8ZorFd.d.ts → index-Bxzjy0d1.d.ts} +1 -1
  45. package/dist/{index-B6aSbaw2.d.ts → index-C-745li7.d.ts} +1 -1
  46. package/dist/{index-BoNNplSx.d.ts → index-C4MUKshG.d.ts} +2 -2
  47. package/dist/{index-DMBMM16q.d.ts → index-CPzvNmq9.d.ts} +35 -35
  48. package/dist/{index-D-UXGo5d.d.ts → index-CS65jqOq.d.ts} +2 -2
  49. package/dist/index-CZUtOTjh.d.ts +1 -0
  50. package/dist/index-CnEbXm_t.d.ts +130 -0
  51. package/dist/{index-CQecU53t.d.ts → index-CxA34wP1.d.ts} +32 -23
  52. package/dist/{index-C768pAfu.d.ts → index-CxpFwGvR.d.ts} +3 -3
  53. package/dist/{index-Bv5XVLjH.d.ts → index-D9LPlmbC.d.ts} +1 -1
  54. package/dist/{index-DJG0kiII.d.ts → index-DFEnA6Wa.d.ts} +28 -17
  55. package/dist/{index-B8vaT3_s.d.ts → index-DNNUeZEq.d.ts} +4 -4
  56. package/dist/{index-CXscCUg7.d.ts → index-DUXfvhxs.d.ts} +12 -12
  57. package/dist/index-DW3njUfb.d.ts +1 -0
  58. package/dist/{index-CMPUveNz.d.ts → index-DWt6yrIG.d.ts} +7 -7
  59. package/dist/index-DewGsFz5.d.ts +1 -0
  60. package/dist/{index-DLUjc7Bx.d.ts → index-DmudgrsN.d.ts} +191 -12
  61. package/dist/{index-DpeWm_vF.d.ts → index-DqXd1EeB.d.ts} +5 -5
  62. package/dist/{index-CM0ZTePs.d.ts → index-DwKr18CI.d.ts} +1 -1
  63. package/dist/{index-D6YMj82n.d.ts → index-NlPMNcqh.d.ts} +100 -100
  64. package/dist/index-Stm5u0I0.d.ts +53 -0
  65. package/dist/index-U-zp70of.d.ts +74 -0
  66. package/dist/index.d.ts +8 -8
  67. package/dist/index.js +8 -8
  68. package/dist/inventory-Dd7TazvZ.js +72 -0
  69. package/dist/inventory-Dd7TazvZ.js.map +1 -0
  70. package/dist/listBalances-BxpxBCvn.js +57 -0
  71. package/dist/listBalances-BxpxBCvn.js.map +1 -0
  72. package/dist/listCollectiblesPaginated-Cy2_qEZA.d.ts +327 -0
  73. package/dist/{listCollections-dTCq00l5.d.ts → listCollections-BB9FxKj2.d.ts} +193 -111
  74. package/dist/{looks-rare-C7cQztTR.js → looks-rare-6H--x3AM.js} +1 -1
  75. package/dist/{looks-rare-C7cQztTR.js.map → looks-rare-6H--x3AM.js.map} +1 -1
  76. package/dist/lowestListing-Cbsi6M1K.d.ts +465 -0
  77. package/dist/{magic-eden-D3r7jiBG.js → magic-eden-BoxEQ1Li.js} +1 -1
  78. package/dist/{magic-eden-D3r7jiBG.js.map → magic-eden-BoxEQ1Li.js.map} +1 -1
  79. package/dist/{manifold-DsX0CBP-.js → manifold-DycKsljb.js} +1 -1
  80. package/dist/{manifold-DsX0CBP-.js.map → manifold-DycKsljb.js.map} +1 -1
  81. package/dist/market-C3HV-awQ.js +209 -0
  82. package/dist/market-C3HV-awQ.js.map +1 -0
  83. package/dist/{marketCurrencies-Bzj8X4TL.d.ts → marketCurrencies-Bpw1bIO0.d.ts} +46 -15
  84. package/dist/marketCurrencies-sKrTX0og.js +53 -0
  85. package/dist/marketCurrencies-sKrTX0og.js.map +1 -0
  86. package/dist/{marketplace-BYY8OloA.js → marketplace-NQB-sEQL.js} +1 -1
  87. package/dist/{marketplace-BYY8OloA.js.map → marketplace-NQB-sEQL.js.map} +1 -1
  88. package/dist/{marketplace-logos-Csv2MBwf.js → marketplace-logos-D4dS1Foy.js} +21 -21
  89. package/dist/{marketplace-logos-Csv2MBwf.js.map → marketplace-logos-D4dS1Foy.js.map} +1 -1
  90. package/dist/{marketplace.gen-w2YvbEEo.js → marketplace.gen-ksUafDqS.js} +56 -5
  91. package/dist/marketplace.gen-ksUafDqS.js.map +1 -0
  92. package/dist/{marketplaceConfig-BTy75Mbf.js → marketplaceConfig-UHQMM9fq.js} +3 -3
  93. package/dist/marketplaceConfig-UHQMM9fq.js.map +1 -0
  94. package/dist/{mintify-DiOoDmO1.js → mintify-Dyqyo8jQ.js} +1 -1
  95. package/dist/{mintify-DiOoDmO1.js.map → mintify-Dyqyo8jQ.js.map} +1 -1
  96. package/dist/{nftx-CP82jNra.js → nftx-2LbFjj9Q.js} +1 -1
  97. package/dist/{nftx-CP82jNra.js.map → nftx-2LbFjj9Q.js.map} +1 -1
  98. package/dist/{okx-p9-4xRjs.js → okx-CBEWJNsR.js} +1 -1
  99. package/dist/{okx-p9-4xRjs.js.map → okx-CBEWJNsR.js.map} +1 -1
  100. package/dist/{open-sea-D2GwAmKS.js → open-sea-Dxntz_PA.js} +1 -1
  101. package/dist/{open-sea-D2GwAmKS.js.map → open-sea-Dxntz_PA.js.map} +1 -1
  102. package/dist/orders-DnFfZAXV.js +462 -0
  103. package/dist/orders-DnFfZAXV.js.map +1 -0
  104. package/dist/{primary-sale-DOmNDq2P.js → primary-sale-1u4QlPdA.js} +1 -1
  105. package/dist/{primary-sale-DOmNDq2P.js.map → primary-sale-1u4QlPdA.js.map} +1 -1
  106. package/dist/primary-sales-Dmsi6bqj.js +114 -0
  107. package/dist/primary-sales-Dmsi6bqj.js.map +1 -0
  108. package/dist/{query-BG-MA1MB.d.ts → query-BWbCsXLY.d.ts} +1 -1
  109. package/dist/{rarible-DqiiW9ki.js → rarible-CS0SupHr.js} +1 -1
  110. package/dist/{rarible-DqiiW9ki.js.map → rarible-CS0SupHr.js.map} +1 -1
  111. package/dist/react/_internal/api/index.d.ts +2 -2
  112. package/dist/react/_internal/api/index.js +3 -3
  113. package/dist/react/_internal/databeat/index.d.ts +1 -1
  114. package/dist/react/_internal/databeat/index.js +28 -17
  115. package/dist/react/_internal/index.d.ts +2 -2
  116. package/dist/react/_internal/index.js +3 -3
  117. package/dist/react/_internal/wagmi/index.d.ts +1 -1
  118. package/dist/react/hooks/config/index.d.ts +8 -8
  119. package/dist/react/hooks/config/index.js +28 -17
  120. package/dist/react/hooks/contracts/index.d.ts +6 -6
  121. package/dist/react/hooks/contracts/index.js +7 -7
  122. package/dist/react/hooks/data/collectibles/index.d.ts +10 -4
  123. package/dist/react/hooks/data/collectibles/index.js +28 -17
  124. package/dist/react/hooks/data/collections/index.d.ts +10 -10
  125. package/dist/react/hooks/data/collections/index.js +28 -17
  126. package/dist/react/hooks/data/index.d.ts +37 -29
  127. package/dist/react/hooks/data/index.js +29 -18
  128. package/dist/react/hooks/data/inventory/index.d.ts +36 -28
  129. package/dist/react/hooks/data/inventory/index.js +28 -17
  130. package/dist/react/hooks/data/market/index.d.ts +11 -5
  131. package/dist/react/hooks/data/market/index.js +28 -17
  132. package/dist/react/hooks/data/orders/index.d.ts +11 -5
  133. package/dist/react/hooks/data/orders/index.js +29 -18
  134. package/dist/react/hooks/data/primary-sales/index.d.ts +36 -28
  135. package/dist/react/hooks/data/primary-sales/index.js +28 -17
  136. package/dist/react/hooks/data/tokens/index.d.ts +4 -4
  137. package/dist/react/hooks/data/tokens/index.js +28 -17
  138. package/dist/react/hooks/index.d.ts +37 -29
  139. package/dist/react/hooks/index.js +29 -18
  140. package/dist/react/hooks/transactions/index.d.ts +2 -2
  141. package/dist/react/hooks/transactions/index.js +28 -17
  142. package/dist/react/hooks/ui/index.d.ts +4 -4
  143. package/dist/react/hooks/ui/index.js +28 -17
  144. package/dist/react/hooks/utils/index.d.ts +36 -28
  145. package/dist/react/hooks/utils/index.js +28 -17
  146. package/dist/react/index.d.ts +37 -29
  147. package/dist/react/index.js +29 -18
  148. package/dist/react/queries/collectibles/index.d.ts +11 -0
  149. package/dist/react/queries/collectibles/index.js +23 -0
  150. package/dist/react/queries/collections/index.d.ts +11 -0
  151. package/dist/react/queries/collections/index.js +20 -0
  152. package/dist/react/queries/index.d.ts +24 -16
  153. package/dist/react/queries/index.js +22 -11
  154. package/dist/react/queries/inventory/index.d.ts +3 -0
  155. package/dist/react/queries/inventory/index.js +22 -0
  156. package/dist/react/queries/market/index.d.ts +6 -0
  157. package/dist/react/queries/market/index.js +22 -0
  158. package/dist/react/queries/orders/index.d.ts +11 -0
  159. package/dist/react/queries/orders/index.js +13 -0
  160. package/dist/react/queries/primary-sales/index.d.ts +4 -0
  161. package/dist/react/queries/primary-sales/index.js +13 -0
  162. package/dist/react/queries/tokens/index.d.ts +5 -0
  163. package/dist/react/queries/tokens/index.js +14 -0
  164. package/dist/react/queries/utils/index.d.ts +4 -0
  165. package/dist/react/queries/utils/index.js +22 -0
  166. package/dist/react/ssr/index.d.ts +7 -7
  167. package/dist/react/ssr/index.js +3 -3
  168. package/dist/react/ssr/index.js.map +1 -1
  169. package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.d.ts +2 -2
  170. package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.js +11 -11
  171. package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +5 -5
  172. package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +28 -17
  173. package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +4 -4
  174. package/dist/react/ui/components/marketplace-collectible-card/index.js +28 -17
  175. package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +2 -2
  176. package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +3 -3
  177. package/dist/react/ui/components/marketplace-logos/index.d.ts +21 -21
  178. package/dist/react/ui/components/marketplace-logos/index.js +1 -1
  179. package/dist/react/ui/icons/index.js +9 -9
  180. package/dist/react/ui/index.d.ts +4 -4
  181. package/dist/react/ui/index.js +28 -17
  182. package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
  183. package/dist/react/ui/modals/_internal/components/actionModal/index.js +28 -17
  184. package/dist/react/utils/index.d.ts +3 -3
  185. package/dist/react/utils/index.js +3 -3
  186. package/dist/{react-BLJ4DkPx.js → react-DE852KeT.js} +1365 -172
  187. package/dist/react-DE852KeT.js.map +1 -0
  188. package/dist/{sequence-Bbb-TFKg.js → sequence-paCCener.js} +1 -1
  189. package/dist/{sequence-Bbb-TFKg.js.map → sequence-paCCener.js.map} +1 -1
  190. package/dist/styles/index.css +154 -0
  191. package/dist/{sudo-swap-CEPIM3Js.js → sudo-swap-9rH2EgfT.js} +1 -1
  192. package/dist/{sudo-swap-CEPIM3Js.js.map → sudo-swap-9rH2EgfT.js.map} +1 -1
  193. package/dist/{super-rare-CMEn9PoO.js → super-rare-DHIuWtRw.js} +1 -1
  194. package/dist/{super-rare-CMEn9PoO.js.map → super-rare-DHIuWtRw.js.map} +1 -1
  195. package/dist/{token-CcyLz8Z8.js → token-Cv7l2ZaL.js} +1 -1
  196. package/dist/{token-CcyLz8Z8.js.map → token-Cv7l2ZaL.js.map} +1 -1
  197. package/dist/tokenBalances-ibDerNmM.js +63 -0
  198. package/dist/tokenBalances-ibDerNmM.js.map +1 -0
  199. package/dist/tokenSupplies-Bfe8RHzI.d.ts +272 -0
  200. package/dist/tokens-cGxMadd8.js +194 -0
  201. package/dist/tokens-cGxMadd8.js.map +1 -0
  202. package/dist/types/index.d.ts +1 -1
  203. package/dist/types/index.js +1 -1
  204. package/dist/{types-D6LkVrF0.d.ts → types-D2TJ1dwv.d.ts} +3 -2
  205. package/dist/utils/abi/index.d.ts +5 -5
  206. package/dist/utils/abi/index.js +5 -5
  207. package/dist/utils/abi/marketplace/index.d.ts +1 -1
  208. package/dist/utils/abi/marketplace/index.js +1 -1
  209. package/dist/utils/abi/primary-sale/index.d.ts +1 -1
  210. package/dist/utils/abi/primary-sale/index.js +1 -1
  211. package/dist/utils/abi/token/index.d.ts +1 -1
  212. package/dist/utils/abi/token/index.js +1 -1
  213. package/dist/utils/index.d.ts +7 -7
  214. package/dist/utils/index.js +8 -8
  215. package/dist/utils-BCgNhBFR.js +112 -0
  216. package/dist/utils-BCgNhBFR.js.map +1 -0
  217. package/dist/{utils-BZEkdqWK.js → utils-BfpDVibN.js} +3 -3
  218. package/dist/{utils-BZEkdqWK.js.map → utils-BfpDVibN.js.map} +1 -1
  219. package/dist/{utils-oVZxdK0o.js → utils-BqxcalL2.js} +2 -2
  220. package/dist/{utils-oVZxdK0o.js.map → utils-BqxcalL2.js.map} +1 -1
  221. package/dist/waitForTransactionReceipt-DieAnV52.js +25 -0
  222. package/dist/waitForTransactionReceipt-DieAnV52.js.map +1 -0
  223. package/dist/{x2y2-DNe6JgtG.js → x2y2-45WDooeh.js} +1 -1
  224. package/dist/{x2y2-DNe6JgtG.js.map → x2y2-45WDooeh.js.map} +1 -1
  225. package/dist/{zora-w0Zqxxs4.js → zora-CbeBoLvQ.js} +1 -1
  226. package/dist/{zora-w0Zqxxs4.js.map → zora-CbeBoLvQ.js.map} +1 -1
  227. package/package.json +10 -5
  228. package/src/react/_internal/api/__mocks__/marketplace.msw.ts +2 -0
  229. package/src/react/_internal/api/marketplace.gen.ts +1730 -2383
  230. package/src/react/_internal/api/query-keys.ts +14 -0
  231. package/src/react/_internal/api/services.ts +1 -1
  232. package/src/react/_internal/databeat/types.ts +1 -0
  233. package/src/react/_internal/types.ts +14 -0
  234. package/src/react/_internal/utils.ts +3 -0
  235. package/src/react/hooks/config/useMarketplaceConfig.tsx +1 -1
  236. package/src/react/hooks/data/collectibles/useBalanceOfCollectible.tsx +1 -1
  237. package/src/react/hooks/data/collectibles/useCollectible.tsx +1 -1
  238. package/src/react/hooks/data/collectibles/useCountOfCollectables.tsx +1 -1
  239. package/src/react/hooks/data/collectibles/useListCollectibleActivities.tsx +1 -1
  240. package/src/react/hooks/data/collectibles/useListCollectibles.tsx +1 -1
  241. package/src/react/hooks/data/collectibles/useListCollectiblesPaginated.tsx +1 -1
  242. package/src/react/hooks/data/collectibles/useTokenBalances.tsx +1 -1
  243. package/src/react/hooks/data/collections/useCollection.tsx +1 -1
  244. package/src/react/hooks/data/collections/useCollectionBalanceDetails.tsx +1 -1
  245. package/src/react/hooks/data/collections/useCollectionDetails.ts +1 -1
  246. package/src/react/hooks/data/collections/useListCollectionActivities.tsx +1 -1
  247. package/src/react/hooks/data/collections/useListCollections.tsx +1 -1
  248. package/src/react/hooks/data/inventory/useInventory.tsx +1 -1
  249. package/src/react/hooks/data/market/useCurrency.tsx +1 -1
  250. package/src/react/hooks/data/market/useListMarketCardData.tsx +7 -0
  251. package/src/react/hooks/data/market/useMarketCurrencies.tsx +1 -1
  252. package/src/react/hooks/data/orders/index.ts +4 -0
  253. package/src/react/hooks/data/orders/useCountItemsOrdersForCollection.tsx +90 -0
  254. package/src/react/hooks/data/orders/useCountListingsForCollectible.tsx +1 -1
  255. package/src/react/hooks/data/orders/useCountOffersForCollectible.tsx +1 -1
  256. package/src/react/hooks/data/orders/useFloorOrder.tsx +1 -1
  257. package/src/react/hooks/data/orders/useGetCountOfFilteredOrders.tsx +39 -0
  258. package/src/react/hooks/data/orders/useHighestOffer.tsx +1 -1
  259. package/src/react/hooks/data/orders/useListItemsOrdersForCollection.tsx +93 -0
  260. package/src/react/hooks/data/orders/useListItemsOrdersForCollectionPaginated.tsx +108 -0
  261. package/src/react/hooks/data/orders/useListListingsForCollectible.tsx +1 -1
  262. package/src/react/hooks/data/orders/useListOffersForCollectible.tsx +1 -1
  263. package/src/react/hooks/data/orders/useLowestListing.tsx +1 -1
  264. package/src/react/hooks/data/primary-sales/useGetCountOfPrimarySaleItems.tsx +2 -2
  265. package/src/react/hooks/data/primary-sales/useListPrimarySaleItems.tsx +1 -1
  266. package/src/react/hooks/data/tokens/useGetTokenRanges.tsx +2 -2
  267. package/src/react/hooks/data/tokens/useListBalances.tsx +2 -2
  268. package/src/react/hooks/data/tokens/useListTokenMetadata.tsx +1 -1
  269. package/src/react/hooks/data/tokens/useSearchTokenMetadata.tsx +1 -1
  270. package/src/react/hooks/data/tokens/useTokenSupplies.ts +1 -1
  271. package/src/react/hooks/transactions/useGenerateCancelTransaction.test.tsx +1 -0
  272. package/src/react/hooks/transactions/useGenerateListingTransaction.test.tsx +13 -0
  273. package/src/react/hooks/transactions/useGenerateOfferTransaction.test.tsx +1 -0
  274. package/src/react/hooks/transactions/useGenerateSellTransaction.test.tsx +6 -0
  275. package/src/react/hooks/ui/useFilterState.tsx +72 -2
  276. package/src/react/hooks/ui/useFilters.tsx +1 -1
  277. package/src/react/hooks/utils/useCheckoutOptions.tsx +2 -2
  278. package/src/react/hooks/utils/useCheckoutOptionsSalesContract.tsx +1 -1
  279. package/src/react/hooks/utils/useComparePrices.tsx +1 -1
  280. package/src/react/hooks/utils/useConvertPriceToUSD.tsx +1 -1
  281. package/src/react/providers/analytics-provider.tsx +45 -0
  282. package/src/react/providers/index.tsx +30 -41
  283. package/src/react/providers/modal-provider.tsx +13 -2
  284. package/src/react/queries/{__tests__ → collectibles/__tests__}/balanceOfCollectible.laos.test.ts +1 -1
  285. package/src/react/queries/{__tests__ → collectibles/__tests__}/tokenBalances.laos.test.ts +1 -1
  286. package/src/react/queries/{balanceOfCollectible.ts → collectibles/balanceOfCollectible.ts} +24 -3
  287. package/src/react/queries/{collectible.ts → collectibles/collectible.ts} +20 -5
  288. package/src/react/queries/{countOfCollectables.ts → collectibles/countOfCollectables.ts} +32 -6
  289. package/src/react/queries/collectibles/index.ts +7 -0
  290. package/src/react/queries/{listCollectibleActivities.ts → collectibles/listCollectibleActivities.ts} +29 -5
  291. package/src/react/queries/{listCollectibles.ts → collectibles/listCollectibles.ts} +28 -9
  292. package/src/react/queries/{listCollectiblesPaginated.ts → collectibles/listCollectiblesPaginated.ts} +22 -5
  293. package/src/react/queries/{tokenBalances.ts → collectibles/tokenBalances.ts} +21 -3
  294. package/src/react/queries/{collection.ts → collections/collection.ts} +19 -5
  295. package/src/react/queries/{collectionBalanceDetails.ts → collections/collectionBalanceDetails.ts} +19 -4
  296. package/src/react/queries/{collectionDetails.ts → collections/collectionDetails.ts} +21 -6
  297. package/src/react/queries/collections/index.ts +5 -0
  298. package/src/react/queries/{listCollectionActivities.ts → collections/listCollectionActivities.ts} +28 -6
  299. package/src/react/queries/{listCollections.ts → collections/listCollections.ts} +17 -6
  300. package/src/react/queries/index.ts +7 -34
  301. package/src/react/queries/{__tests__ → inventory/__tests__}/inventory.laos.test.ts +4 -4
  302. package/src/react/queries/inventory/index.ts +1 -0
  303. package/src/react/queries/{inventory.ts → inventory/inventory.ts} +11 -5
  304. package/src/react/queries/{checkoutOptions.ts → market/checkoutOptions.ts} +28 -6
  305. package/src/react/queries/{checkoutOptionsSalesContract.ts → market/checkoutOptionsSalesContract.ts} +24 -5
  306. package/src/react/queries/{currency.ts → market/currency.ts} +13 -4
  307. package/src/react/queries/{filters.ts → market/filters.ts} +25 -6
  308. package/src/react/queries/market/index.ts +6 -0
  309. package/src/react/queries/{marketCurrencies.ts → market/marketCurrencies.ts} +24 -5
  310. package/src/react/queries/{marketplaceConfig.ts → market/marketplaceConfig.ts} +5 -5
  311. package/src/react/queries/orders/countItemsOrdersForCollection.ts +86 -0
  312. package/src/react/queries/{countListingsForCollectible.ts → orders/countListingsForCollectible.ts} +23 -6
  313. package/src/react/queries/{countOffersForCollectible.ts → orders/countOffersForCollectible.ts} +23 -6
  314. package/src/react/queries/{floorOrder.ts → orders/floorOrder.ts} +15 -4
  315. package/src/react/queries/orders/getCountOfFilteredOrders.ts +88 -0
  316. package/src/react/queries/{highestOffer.ts → orders/highestOffer.ts} +16 -4
  317. package/src/react/queries/orders/index.ts +11 -0
  318. package/src/react/queries/orders/listItemsOrdersForCollection.ts +90 -0
  319. package/src/react/queries/orders/listItemsOrdersForCollectionPaginated.ts +90 -0
  320. package/src/react/queries/{listListingsForCollectible.ts → orders/listListingsForCollectible.ts} +20 -5
  321. package/src/react/queries/{listOffersForCollectible.ts → orders/listOffersForCollectible.ts} +20 -5
  322. package/src/react/queries/{lowestListing.ts → orders/lowestListing.ts} +16 -4
  323. package/src/react/queries/{countOfPrimarySaleItems.ts → primary-sales/countOfPrimarySaleItems.ts} +17 -3
  324. package/src/react/queries/primary-sales/index.ts +3 -0
  325. package/src/react/queries/{primarySaleItems.ts → primary-sales/primarySaleItems.ts} +18 -4
  326. package/src/react/queries/{primarySaleItemsCount.ts → primary-sales/primarySaleItemsCount.ts} +19 -4
  327. package/src/react/queries/{getTokenRanges.ts → tokens/getTokenRanges.ts} +17 -4
  328. package/src/react/queries/tokens/index.ts +5 -0
  329. package/src/react/queries/{listBalances.ts → tokens/listBalances.ts} +18 -3
  330. package/src/react/queries/{listTokenMetadata.ts → tokens/listTokenMetadata.ts} +18 -4
  331. package/src/react/queries/{searchTokenMetadata.ts → tokens/searchTokenMetadata.ts} +18 -4
  332. package/src/react/queries/{tokenSupplies.ts → tokens/tokenSupplies.ts} +16 -4
  333. package/src/react/queries/{comparePrices.ts → utils/comparePrices.ts} +16 -4
  334. package/src/react/queries/{convertPriceToUSD.ts → utils/convertPriceToUSD.ts} +18 -5
  335. package/src/react/queries/utils/index.ts +2 -0
  336. package/src/react/ssr/create-ssr-client.ts +1 -1
  337. package/src/react/ui/components/_internals/ErrorLogBox.tsx +85 -0
  338. package/src/react/ui/components/_internals/action-button/ActionButton.tsx +4 -0
  339. package/src/react/ui/components/_internals/action-button/components/NonOwnerActions.tsx +4 -0
  340. package/src/react/ui/components/marketplace-collectible-card/components/ActionButtonWrapper.tsx +3 -0
  341. package/src/react/ui/components/marketplace-collectible-card/types.ts +1 -0
  342. package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +3 -0
  343. package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +2 -0
  344. package/src/react/ui/modals/BuyModal/components/ERC1155BuyModal.tsx +65 -3
  345. package/src/react/ui/modals/BuyModal/components/ERC721BuyModal.tsx +31 -0
  346. package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC721SalePaymentParams.test.tsx +20 -1
  347. package/src/react/ui/modals/BuyModal/hooks/useERC1155Checkout.ts +7 -2
  348. package/src/react/ui/modals/BuyModal/hooks/useERC721SalePaymentParams.ts +12 -3
  349. package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +11 -2
  350. package/src/react/ui/modals/BuyModal/store.ts +3 -0
  351. package/src/react/ui/modals/CreateListingModal/Modal.tsx +63 -24
  352. package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +4 -0
  353. package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +18 -12
  354. package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +4 -1
  355. package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +1 -0
  356. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +55 -8
  357. package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +10 -0
  358. package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +4 -1
  359. package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +15 -26
  360. package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +1 -0
  361. package/src/react/ui/modals/SellModal/Modal.tsx +21 -3
  362. package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +2 -0
  363. package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +3 -1
  364. package/src/react/ui/modals/SellModal/hooks/useSell.tsx +13 -7
  365. package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +9 -0
  366. package/src/react/ui/modals/_internal/components/calendarDropdown/TimeSelector.tsx +105 -0
  367. package/src/react/ui/modals/_internal/components/calendarDropdown/index.tsx +45 -12
  368. package/src/react/ui/modals/_internal/components/calendarDropdown/overrides.css +39 -0
  369. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +31 -10
  370. package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +18 -9
  371. package/src/react/ui/modals/_internal/components/priceInput/index.tsx +51 -1
  372. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +58 -10
  373. package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +481 -0
  374. package/src/react/utils/waitForTransactionReceipt.ts +26 -32
  375. package/src/styles/index.css +1 -0
  376. package/src/styles/styles.ts +155 -1
  377. package/src/types/index.ts +1 -1
  378. package/src/utils/abi/index.ts +1 -0
  379. package/src/utils/abi/mainModule.ts +158 -0
  380. package/dist/CollectibleCard-C2EWF0zo.d.ts +0 -8
  381. package/dist/api-DuLKn__v.js.map +0 -1
  382. package/dist/filters-zkMJaPey.d.ts +0 -31
  383. package/dist/index-Yobo6icm.d.ts +0 -234
  384. package/dist/listCollectiblesPaginated-Bq0QSOjJ.d.ts +0 -168
  385. package/dist/lowestListing-CB5Te-Q9.d.ts +0 -168
  386. package/dist/marketplace.gen-w2YvbEEo.js.map +0 -1
  387. package/dist/marketplaceConfig-BTy75Mbf.js.map +0 -1
  388. package/dist/queries-EMA5CcwY.js +0 -1399
  389. package/dist/queries-EMA5CcwY.js.map +0 -1
  390. package/dist/react-BLJ4DkPx.js.map +0 -1
  391. package/dist/react-F03jPjPk.css +0 -80
  392. package/dist/react-F03jPjPk.css.map +0 -1
  393. package/dist/tokenSupplies-C470zTT0.d.ts +0 -147
  394. package/dist/waitForTransactionReceipt-B08YZiDY.js +0 -26
  395. package/dist/waitForTransactionReceipt-B08YZiDY.js.map +0 -1
  396. /package/dist/{index-Cg5cFzs-.d.ts → index-6wsMChsg.d.ts} +0 -0
  397. /package/dist/{abi-DYsUABe6.js → queries-KOcILNJO.js} +0 -0
@@ -0,0 +1,209 @@
1
+ import { FilterCondition } from "./builder.gen-B9wR2nvF.js";
2
+ import { checkoutKeys, currencyKeys, getMarketplaceClient, getMetadataClient, getQueryClient } from "./api-BoO0V5aJ.js";
3
+ import { compareAddress } from "./utils-BfpDVibN.js";
4
+ import { marketplaceConfigOptions } from "./marketplaceConfig-UHQMM9fq.js";
5
+ import { queryOptions, skipToken } from "@tanstack/react-query";
6
+
7
+ //#region src/react/queries/market/currency.ts
8
+ /**
9
+ * Fetches currency details from the marketplace API
10
+ */
11
+ async function fetchCurrency(params) {
12
+ const { chainId, currencyAddress, config } = params;
13
+ let currencies = getQueryClient().getQueryData([...currencyKeys.lists, chainId]);
14
+ if (!currencies) currencies = await getMarketplaceClient(config).listCurrencies({ chainId: String(chainId) }).then((resp) => resp.currencies);
15
+ if (!currencies?.length) throw new Error("No currencies returned");
16
+ const currency = currencies.find((currency$1) => currency$1.contractAddress.toLowerCase() === currencyAddress.toLowerCase());
17
+ if (!currency) throw new Error("Currency not found");
18
+ return currency;
19
+ }
20
+ function getCurrencyQueryKey(params) {
21
+ const apiArgs = {
22
+ chainId: String(params.chainId),
23
+ currencyAddress: params.currencyAddress
24
+ };
25
+ return [...currencyKeys.details, apiArgs];
26
+ }
27
+ function currencyQueryOptions(params) {
28
+ const enabled = Boolean(params.chainId && params.currencyAddress && params.config && (params.query?.enabled ?? true));
29
+ return queryOptions({
30
+ queryKey: getCurrencyQueryKey(params),
31
+ queryFn: params.chainId && params.currencyAddress ? () => fetchCurrency({
32
+ chainId: params.chainId,
33
+ currencyAddress: params.currencyAddress,
34
+ config: params.config
35
+ }) : skipToken,
36
+ ...params.query,
37
+ enabled
38
+ });
39
+ }
40
+
41
+ //#endregion
42
+ //#region src/react/queries/market/checkoutOptions.ts
43
+ /**
44
+ * Fetches checkout options from the Marketplace API
45
+ */
46
+ async function fetchCheckoutOptions(params) {
47
+ const { chainId, walletAddress, orders, config, additionalFee } = params;
48
+ const client = getMarketplaceClient(config);
49
+ const apiArgs = {
50
+ chainId: String(chainId),
51
+ wallet: walletAddress,
52
+ orders: orders.map((order) => ({
53
+ contractAddress: order.collectionAddress,
54
+ orderId: order.orderId,
55
+ marketplace: order.marketplace
56
+ })),
57
+ additionalFee: additionalFee ?? 0
58
+ };
59
+ return await client.checkoutOptionsMarketplace(apiArgs);
60
+ }
61
+ function getCheckoutOptionsQueryKey(params) {
62
+ const apiArgs = {
63
+ chainId: String(params.chainId),
64
+ wallet: params.walletAddress,
65
+ orders: params.orders?.map((order) => ({
66
+ contractAddress: order.collectionAddress,
67
+ orderId: order.orderId,
68
+ marketplace: order.marketplace
69
+ })),
70
+ additionalFee: params.additionalFee
71
+ };
72
+ return [...checkoutKeys.options, apiArgs];
73
+ }
74
+ function checkoutOptionsQueryOptions(params) {
75
+ const enabled = Boolean(params.chainId && params.walletAddress && params.orders?.length && params.config && (params.query?.enabled ?? true));
76
+ return queryOptions({
77
+ queryKey: getCheckoutOptionsQueryKey(params),
78
+ queryFn: () => fetchCheckoutOptions({
79
+ chainId: params.chainId,
80
+ walletAddress: params.walletAddress,
81
+ orders: params.orders,
82
+ config: params.config,
83
+ additionalFee: params.additionalFee ?? 0
84
+ }),
85
+ ...params.query,
86
+ enabled
87
+ });
88
+ }
89
+
90
+ //#endregion
91
+ //#region src/react/queries/market/checkoutOptionsSalesContract.ts
92
+ /**
93
+ * Fetches checkout options for sales contract from the Marketplace API
94
+ */
95
+ async function fetchCheckoutOptionsSalesContract(params) {
96
+ const { chainId, walletAddress, contractAddress, collectionAddress, items, config } = params;
97
+ const client = getMarketplaceClient(config);
98
+ const apiArgs = {
99
+ chainId: String(chainId),
100
+ wallet: walletAddress,
101
+ contractAddress,
102
+ collectionAddress,
103
+ items
104
+ };
105
+ return await client.checkoutOptionsSalesContract(apiArgs);
106
+ }
107
+ function getCheckoutOptionsSalesContractQueryKey(params) {
108
+ const apiArgs = {
109
+ chainId: String(params.chainId),
110
+ wallet: params.walletAddress,
111
+ contractAddress: params.contractAddress,
112
+ collectionAddress: params.collectionAddress,
113
+ items: params.items
114
+ };
115
+ return [
116
+ ...checkoutKeys.options,
117
+ "salesContract",
118
+ apiArgs
119
+ ];
120
+ }
121
+ function checkoutOptionsSalesContractQueryOptions(params) {
122
+ const enabled = Boolean(params.chainId && params.walletAddress && params.contractAddress && params.collectionAddress && params.items?.length && params.config && (params.query?.enabled ?? true));
123
+ return queryOptions({
124
+ queryKey: getCheckoutOptionsSalesContractQueryKey(params),
125
+ queryFn: () => fetchCheckoutOptionsSalesContract({
126
+ chainId: params.chainId,
127
+ walletAddress: params.walletAddress,
128
+ contractAddress: params.contractAddress,
129
+ collectionAddress: params.collectionAddress,
130
+ items: params.items,
131
+ config: params.config
132
+ }),
133
+ ...params.query,
134
+ enabled
135
+ });
136
+ }
137
+
138
+ //#endregion
139
+ //#region src/react/queries/market/filters.ts
140
+ /**
141
+ * Fetches collection filters from the Metadata API with optional marketplace filtering
142
+ */
143
+ async function fetchFilters(params) {
144
+ const { chainId, collectionAddress, showAllFilters, excludePropertyValues, config } = params;
145
+ const filters = await getMetadataClient(config).getTokenMetadataPropertyFilters({
146
+ chainID: chainId.toString(),
147
+ contractAddress: collectionAddress,
148
+ excludeProperties: [],
149
+ excludePropertyValues
150
+ }).then((resp) => resp.filters);
151
+ if (showAllFilters) return filters;
152
+ const collectionFilters = (await getQueryClient().fetchQuery(marketplaceConfigOptions(config))).market.collections.find((c) => compareAddress(c.itemsAddress, collectionAddress))?.filterSettings;
153
+ const filterOrder = collectionFilters?.filterOrder;
154
+ const exclusions = collectionFilters?.exclusions;
155
+ let sortedFilters = filters;
156
+ if (filterOrder) sortedFilters = filters.toSorted((a, b) => {
157
+ const aIndex = filterOrder.indexOf(a.name) > -1 ? filterOrder.indexOf(a.name) : filterOrder.length;
158
+ const bIndex = filterOrder.indexOf(b.name) > -1 ? filterOrder.indexOf(b.name) : filterOrder.length;
159
+ return aIndex - bIndex;
160
+ });
161
+ if (exclusions) sortedFilters = sortedFilters.reduce((acc, filter) => {
162
+ const exclusionRule = exclusions.find((rule) => rule.key === filter.name);
163
+ if (!exclusionRule) {
164
+ acc.push(filter);
165
+ return acc;
166
+ }
167
+ if (exclusionRule.condition === FilterCondition.ENTIRE_KEY) return acc;
168
+ if (exclusionRule.condition === FilterCondition.SPECIFIC_VALUE && exclusionRule.value) {
169
+ const filteredValues = filter.values?.filter((value) => value !== exclusionRule.value) || [];
170
+ if (filteredValues.length > 0) acc.push({
171
+ ...filter,
172
+ values: filteredValues
173
+ });
174
+ }
175
+ return acc;
176
+ }, []);
177
+ return sortedFilters;
178
+ }
179
+ function getFiltersQueryKey(params) {
180
+ return [
181
+ "filters",
182
+ {
183
+ chainID: String(params.chainId),
184
+ contractAddress: params.collectionAddress,
185
+ excludeProperties: void 0,
186
+ excludePropertyValues: params.excludePropertyValues
187
+ },
188
+ { showAllFilters: params.showAllFilters }
189
+ ];
190
+ }
191
+ function filtersQueryOptions(params) {
192
+ const enabled = Boolean(params.chainId && params.collectionAddress && params.config && (params.query?.enabled ?? true));
193
+ return queryOptions({
194
+ queryKey: getFiltersQueryKey(params),
195
+ queryFn: () => fetchFilters({
196
+ chainId: params.chainId,
197
+ collectionAddress: params.collectionAddress,
198
+ showAllFilters: params.showAllFilters,
199
+ excludePropertyValues: params.excludePropertyValues,
200
+ config: params.config
201
+ }),
202
+ ...params.query,
203
+ enabled
204
+ });
205
+ }
206
+
207
+ //#endregion
208
+ export { checkoutOptionsQueryOptions, checkoutOptionsSalesContractQueryOptions, currencyQueryOptions, fetchCheckoutOptions, fetchCheckoutOptionsSalesContract, fetchCurrency, fetchFilters, filtersQueryOptions, getCheckoutOptionsQueryKey, getCheckoutOptionsSalesContractQueryKey, getCurrencyQueryKey, getFiltersQueryKey };
209
+ //# sourceMappingURL=market-C3HV-awQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"market-C3HV-awQ.js","names":["currency","apiArgs: CheckoutOptionsMarketplaceArgs","apiArgs: CheckoutOptionsSalesContractArgs"],"sources":["../src/react/queries/market/currency.ts","../src/react/queries/market/checkoutOptions.ts","../src/react/queries/market/checkoutOptionsSalesContract.ts","../src/react/queries/market/filters.ts"],"sourcesContent":["import { queryOptions, skipToken } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport {\n\ttype Currency,\n\tcurrencyKeys,\n\tgetMarketplaceClient,\n\tgetQueryClient,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCurrencyParams {\n\tchainId: number;\n\tcurrencyAddress: Address;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches currency details from the marketplace API\n */\nexport async function fetchCurrency(\n\tparams: FetchCurrencyParams,\n): Promise<Currency | undefined> {\n\tconst { chainId, currencyAddress, config } = params;\n\tconst queryClient = getQueryClient();\n\n\tlet currencies = queryClient.getQueryData([...currencyKeys.lists, chainId]) as\n\t\t| Currency[]\n\t\t| undefined;\n\n\tif (!currencies) {\n\t\tconst marketplaceClient = getMarketplaceClient(config);\n\t\tcurrencies = await marketplaceClient\n\t\t\t.listCurrencies({ chainId: String(chainId) })\n\t\t\t.then((resp) => resp.currencies);\n\t}\n\n\tif (!currencies?.length) {\n\t\tthrow new Error('No currencies returned');\n\t}\n\tconst currency = currencies.find(\n\t\t(currency) =>\n\t\t\tcurrency.contractAddress.toLowerCase() === currencyAddress.toLowerCase(),\n\t);\n\n\tif (!currency) {\n\t\tthrow new Error('Currency not found');\n\t}\n\n\treturn currency;\n}\n\nexport type CurrencyQueryOptions = ValuesOptional<FetchCurrencyParams> & {\n\tquery?: StandardQueryOptions;\n};\n\nexport function getCurrencyQueryKey(params: CurrencyQueryOptions) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId!),\n\t\tcurrencyAddress: params.currencyAddress!,\n\t};\n\n\treturn [...currencyKeys.details, apiArgs] as const;\n}\n\nexport function currencyQueryOptions(params: CurrencyQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.currencyAddress &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCurrencyQueryKey(params),\n\t\tqueryFn:\n\t\t\tparams.chainId && params.currencyAddress\n\t\t\t\t? () =>\n\t\t\t\t\t\tfetchCurrency({\n\t\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\t\t\tchainId: params.chainId!,\n\t\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\t\t\tcurrencyAddress: params.currencyAddress!,\n\t\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\t\t\tconfig: params.config!,\n\t\t\t\t\t\t})\n\t\t\t\t: skipToken,\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport type { MarketplaceKind } from '../../_internal';\nimport {\n\tcheckoutKeys,\n\tgetMarketplaceClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type {\n\tCheckoutOptionsMarketplaceArgs,\n\tCheckoutOptionsMarketplaceReturn,\n} from '../../_internal/api/marketplace.gen';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCheckoutOptionsParams\n\textends Omit<\n\t\tCheckoutOptionsMarketplaceArgs,\n\t\t'chainId' | 'wallet' | 'orders'\n\t> {\n\tchainId: number;\n\twalletAddress: Address;\n\torders: Array<{\n\t\tcollectionAddress: string;\n\t\torderId: string;\n\t\tmarketplace: MarketplaceKind;\n\t}>;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches checkout options from the Marketplace API\n */\nexport async function fetchCheckoutOptions(\n\tparams: FetchCheckoutOptionsParams,\n): Promise<CheckoutOptionsMarketplaceReturn> {\n\tconst { chainId, walletAddress, orders, config, additionalFee } = params;\n\n\tconst client = getMarketplaceClient(config);\n\n\tconst apiArgs: CheckoutOptionsMarketplaceArgs = {\n\t\tchainId: String(chainId),\n\t\twallet: walletAddress,\n\t\torders: orders.map((order) => ({\n\t\t\tcontractAddress: order.collectionAddress,\n\t\t\torderId: order.orderId,\n\t\t\tmarketplace: order.marketplace,\n\t\t})),\n\t\tadditionalFee: additionalFee ?? 0,\n\t};\n\n\tconst result = await client.checkoutOptionsMarketplace(apiArgs);\n\treturn result;\n}\n\nexport type CheckoutOptionsQueryOptions =\n\tValuesOptional<FetchCheckoutOptionsParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCheckoutOptionsQueryKey(\n\tparams: CheckoutOptionsQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\twallet: params.walletAddress,\n\t\torders: params.orders?.map((order) => ({\n\t\t\tcontractAddress: order.collectionAddress,\n\t\t\torderId: order.orderId,\n\t\t\tmarketplace: order.marketplace,\n\t\t})),\n\t\tadditionalFee: params.additionalFee,\n\t} satisfies QueryKeyArgs<CheckoutOptionsMarketplaceArgs>;\n\n\treturn [...checkoutKeys.options, apiArgs] as const;\n}\n\nexport function checkoutOptionsQueryOptions(\n\tparams: CheckoutOptionsQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.walletAddress &&\n\t\t\tparams.orders?.length &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCheckoutOptionsQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCheckoutOptions({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\twalletAddress: params.walletAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\torders: params.orders!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t\tadditionalFee: params.additionalFee ?? 0,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tcheckoutKeys,\n\tgetMarketplaceClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type {\n\tCheckoutOptionsItem,\n\tCheckoutOptionsSalesContractArgs,\n\tCheckoutOptionsSalesContractReturn,\n} from '../../_internal/api/marketplace.gen';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCheckoutOptionsSalesContractParams\n\textends Omit<CheckoutOptionsSalesContractArgs, 'chainId' | 'wallet'> {\n\tchainId: number;\n\twalletAddress: Address;\n\tcontractAddress: string;\n\tcollectionAddress: string;\n\titems: Array<CheckoutOptionsItem>;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches checkout options for sales contract from the Marketplace API\n */\nexport async function fetchCheckoutOptionsSalesContract(\n\tparams: FetchCheckoutOptionsSalesContractParams,\n): Promise<CheckoutOptionsSalesContractReturn> {\n\tconst {\n\t\tchainId,\n\t\twalletAddress,\n\t\tcontractAddress,\n\t\tcollectionAddress,\n\t\titems,\n\t\tconfig,\n\t} = params;\n\n\tconst client = getMarketplaceClient(config);\n\n\tconst apiArgs: CheckoutOptionsSalesContractArgs = {\n\t\tchainId: String(chainId),\n\t\twallet: walletAddress,\n\t\tcontractAddress,\n\t\tcollectionAddress,\n\t\titems,\n\t};\n\n\tconst result = await client.checkoutOptionsSalesContract(apiArgs);\n\treturn result;\n}\n\nexport type CheckoutOptionsSalesContractQueryOptions =\n\tValuesOptional<FetchCheckoutOptionsSalesContractParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCheckoutOptionsSalesContractQueryKey(\n\tparams: CheckoutOptionsSalesContractQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\twallet: params.walletAddress,\n\t\tcontractAddress: params.contractAddress,\n\t\tcollectionAddress: params.collectionAddress,\n\t\titems: params.items,\n\t} satisfies QueryKeyArgs<CheckoutOptionsSalesContractArgs>;\n\n\treturn [...checkoutKeys.options, 'salesContract', apiArgs] as const;\n}\n\nexport function checkoutOptionsSalesContractQueryOptions(\n\tparams: CheckoutOptionsSalesContractQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.walletAddress &&\n\t\t\tparams.contractAddress &&\n\t\t\tparams.collectionAddress &&\n\t\t\tparams.items?.length &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCheckoutOptionsSalesContractQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCheckoutOptionsSalesContract({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\twalletAddress: params.walletAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcontractAddress: params.contractAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\titems: params.items!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import type {\n\tGetTokenMetadataPropertyFiltersArgs,\n\tPropertyFilter,\n} from '@0xsequence/metadata';\nimport { queryOptions } from '@tanstack/react-query';\nimport { FilterCondition, type SdkConfig } from '../../../types';\nimport { compareAddress } from '../../../utils';\nimport {\n\tgetMetadataClient,\n\tgetQueryClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\nimport { marketplaceConfigOptions } from './marketplaceConfig';\n\nexport interface FetchFiltersParams {\n\tchainId: number;\n\tcollectionAddress: string;\n\tshowAllFilters?: boolean;\n\texcludePropertyValues?: boolean;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collection filters from the Metadata API with optional marketplace filtering\n */\nexport async function fetchFilters(\n\tparams: FetchFiltersParams,\n): Promise<PropertyFilter[]> {\n\tconst {\n\t\tchainId,\n\t\tcollectionAddress,\n\t\tshowAllFilters,\n\t\texcludePropertyValues,\n\t\tconfig,\n\t} = params;\n\n\tconst metadataClient = getMetadataClient(config);\n\n\tconst filters = await metadataClient\n\t\t.getTokenMetadataPropertyFilters({\n\t\t\tchainID: chainId.toString(),\n\t\t\tcontractAddress: collectionAddress,\n\t\t\texcludeProperties: [],\n\t\t\texcludePropertyValues,\n\t\t})\n\t\t.then((resp) => resp.filters);\n\n\tif (showAllFilters) return filters;\n\n\tconst queryClient = getQueryClient();\n\tconst marketplaceConfig = await queryClient.fetchQuery(\n\t\tmarketplaceConfigOptions(config),\n\t);\n\tconst collectionFilters = marketplaceConfig.market.collections.find((c) =>\n\t\tcompareAddress(c.itemsAddress, collectionAddress),\n\t)?.filterSettings;\n\n\tconst filterOrder = collectionFilters?.filterOrder;\n\tconst exclusions = collectionFilters?.exclusions;\n\tlet sortedFilters = filters;\n\n\tif (filterOrder) {\n\t\tsortedFilters = filters.toSorted((a, b) => {\n\t\t\tconst aIndex =\n\t\t\t\tfilterOrder.indexOf(a.name) > -1\n\t\t\t\t\t? filterOrder.indexOf(a.name)\n\t\t\t\t\t: filterOrder.length;\n\t\t\tconst bIndex =\n\t\t\t\tfilterOrder.indexOf(b.name) > -1\n\t\t\t\t\t? filterOrder.indexOf(b.name)\n\t\t\t\t\t: filterOrder.length;\n\t\t\treturn aIndex - bIndex;\n\t\t});\n\t}\n\n\tif (exclusions) {\n\t\tsortedFilters = sortedFilters.reduce<PropertyFilter[]>((acc, filter) => {\n\t\t\tconst exclusionRule = exclusions.find((rule) => rule.key === filter.name);\n\n\t\t\tif (!exclusionRule) {\n\t\t\t\tacc.push(filter);\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\tif (exclusionRule.condition === FilterCondition.ENTIRE_KEY) {\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\texclusionRule.condition === FilterCondition.SPECIFIC_VALUE &&\n\t\t\t\texclusionRule.value\n\t\t\t) {\n\t\t\t\tconst filteredValues =\n\t\t\t\t\tfilter.values?.filter((value) => value !== exclusionRule.value) || [];\n\t\t\t\tif (filteredValues.length > 0) {\n\t\t\t\t\tacc.push({ ...filter, values: filteredValues });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn acc;\n\t\t}, []);\n\t}\n\n\treturn sortedFilters;\n}\n\nexport type FiltersQueryOptions = ValuesOptional<FetchFiltersParams> & {\n\tquery?: StandardQueryOptions;\n};\n\nexport function getFiltersQueryKey(params: FiltersQueryOptions) {\n\tconst apiArgs = {\n\t\tchainID: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\texcludeProperties: undefined,\n\t\texcludePropertyValues: params.excludePropertyValues,\n\t} satisfies QueryKeyArgs<GetTokenMetadataPropertyFiltersArgs>;\n\n\treturn [\n\t\t'filters',\n\t\tapiArgs,\n\t\t{ showAllFilters: params.showAllFilters },\n\t] as const;\n}\n\nexport function filtersQueryOptions(params: FiltersQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.collectionAddress &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getFiltersQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchFilters({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\tshowAllFilters: params.showAllFilters,\n\t\t\t\texcludePropertyValues: params.excludePropertyValues,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n"],"mappings":"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"}
@@ -1,9 +1,9 @@
1
- import { Currency, CurrencyStatus, SdkConfig, ValuesOptional } from "./create-config-DV_dtaLt.js";
2
- import { StandardQueryOptions } from "./query-BG-MA1MB.js";
3
- import * as _tanstack_react_query282 from "@tanstack/react-query";
1
+ import { Currency, CurrencyStatus, SdkConfig, ValuesOptional } from "./create-config-ZOB7i4ZJ.js";
2
+ import { StandardQueryOptions } from "./query-BWbCsXLY.js";
3
+ import * as _tanstack_react_query396 from "@tanstack/react-query";
4
4
  import { Address } from "viem";
5
5
 
6
- //#region src/react/queries/currency.d.ts
6
+ //#region src/react/queries/market/currency.d.ts
7
7
  interface FetchCurrencyParams {
8
8
  chainId: number;
9
9
  currencyAddress: Address;
@@ -16,16 +16,26 @@ declare function fetchCurrency(params: FetchCurrencyParams): Promise<Currency |
16
16
  type CurrencyQueryOptions = ValuesOptional<FetchCurrencyParams> & {
17
17
  query?: StandardQueryOptions;
18
18
  };
19
- declare function currencyQueryOptions(params: CurrencyQueryOptions): _tanstack_react_query282.UseQueryOptions<Currency | undefined, Error, Currency | undefined, ("details" | "currencies" | CurrencyQueryOptions)[]> & {
20
- initialData?: Currency | _tanstack_react_query282.InitialDataFunction<Currency> | undefined;
19
+ declare function getCurrencyQueryKey(params: CurrencyQueryOptions): readonly ["currencies", "details", {
20
+ chainId: string;
21
+ currencyAddress: `0x${string}`;
22
+ }];
23
+ declare function currencyQueryOptions(params: CurrencyQueryOptions): _tanstack_react_query396.UseQueryOptions<Currency | undefined, Error, Currency | undefined, readonly ["currencies", "details", {
24
+ chainId: string;
25
+ currencyAddress: `0x${string}`;
26
+ }]> & {
27
+ initialData?: Currency | _tanstack_react_query396.InitialDataFunction<Currency> | undefined;
21
28
  } & {
22
- queryKey: ("details" | "currencies" | CurrencyQueryOptions)[] & {
29
+ queryKey: readonly ["currencies", "details", {
30
+ chainId: string;
31
+ currencyAddress: `0x${string}`;
32
+ }] & {
23
33
  [dataTagSymbol]: Currency | undefined;
24
34
  [dataTagErrorSymbol]: Error;
25
35
  };
26
36
  };
27
37
  //#endregion
28
- //#region src/react/queries/marketCurrencies.d.ts
38
+ //#region src/react/queries/market/marketCurrencies.d.ts
29
39
  interface FetchMarketCurrenciesParams {
30
40
  chainId: number;
31
41
  includeNativeCurrency?: boolean;
@@ -53,7 +63,13 @@ declare function fetchMarketCurrencies(params: FetchMarketCurrenciesParams): Pro
53
63
  type MarketCurrenciesQueryOptions = ValuesOptional<FetchMarketCurrenciesParams> & {
54
64
  query?: StandardQueryOptions;
55
65
  };
56
- declare function marketCurrenciesQueryOptions(params: MarketCurrenciesQueryOptions): _tanstack_react_query282.OmitKeyof<_tanstack_react_query282.UseQueryOptions<{
66
+ declare function getMarketCurrenciesQueryKey(params: MarketCurrenciesQueryOptions): readonly ["currencies", "list", {
67
+ chainId: string;
68
+ }, {
69
+ readonly includeNativeCurrency: boolean | undefined;
70
+ readonly collectionAddress: `0x${string}` | undefined;
71
+ }];
72
+ declare function marketCurrenciesQueryOptions(params: MarketCurrenciesQueryOptions): _tanstack_react_query396.OmitKeyof<_tanstack_react_query396.UseQueryOptions<{
57
73
  contractAddress: string;
58
74
  chainId: number;
59
75
  status: CurrencyStatus;
@@ -81,8 +97,13 @@ declare function marketCurrenciesQueryOptions(params: MarketCurrenciesQueryOptio
81
97
  createdAt: string;
82
98
  updatedAt: string;
83
99
  deletedAt?: string;
84
- }[], ("list" | "currencies" | MarketCurrenciesQueryOptions)[]>, "queryFn"> & {
85
- queryFn?: _tanstack_react_query282.QueryFunction<{
100
+ }[], readonly ["currencies", "list", {
101
+ chainId: string;
102
+ }, {
103
+ readonly includeNativeCurrency: boolean | undefined;
104
+ readonly collectionAddress: `0x${string}` | undefined;
105
+ }]>, "queryFn"> & {
106
+ queryFn?: _tanstack_react_query396.QueryFunction<{
86
107
  contractAddress: string;
87
108
  chainId: number;
88
109
  status: CurrencyStatus;
@@ -96,9 +117,19 @@ declare function marketCurrenciesQueryOptions(params: MarketCurrenciesQueryOptio
96
117
  createdAt: string;
97
118
  updatedAt: string;
98
119
  deletedAt?: string;
99
- }[], ("list" | "currencies" | MarketCurrenciesQueryOptions)[], never> | undefined;
120
+ }[], readonly ["currencies", "list", {
121
+ chainId: string;
122
+ }, {
123
+ readonly includeNativeCurrency: boolean | undefined;
124
+ readonly collectionAddress: `0x${string}` | undefined;
125
+ }], never> | undefined;
100
126
  } & {
101
- queryKey: ("list" | "currencies" | MarketCurrenciesQueryOptions)[] & {
127
+ queryKey: readonly ["currencies", "list", {
128
+ chainId: string;
129
+ }, {
130
+ readonly includeNativeCurrency: boolean | undefined;
131
+ readonly collectionAddress: `0x${string}` | undefined;
132
+ }] & {
102
133
  [dataTagSymbol]: {
103
134
  contractAddress: string;
104
135
  chainId: number;
@@ -118,5 +149,5 @@ declare function marketCurrenciesQueryOptions(params: MarketCurrenciesQueryOptio
118
149
  };
119
150
  };
120
151
  //#endregion
121
- export { CurrencyQueryOptions, FetchCurrencyParams, FetchMarketCurrenciesParams, MarketCurrenciesQueryOptions, currencyQueryOptions, fetchCurrency, fetchMarketCurrencies, marketCurrenciesQueryOptions };
122
- //# sourceMappingURL=marketCurrencies-Bzj8X4TL.d.ts.map
152
+ export { CurrencyQueryOptions, FetchCurrencyParams, FetchMarketCurrenciesParams, MarketCurrenciesQueryOptions, currencyQueryOptions, fetchCurrency, fetchMarketCurrencies, getCurrencyQueryKey, getMarketCurrenciesQueryKey, marketCurrenciesQueryOptions };
153
+ //# sourceMappingURL=marketCurrencies-Bpw1bIO0.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { currencyKeys, getMarketplaceClient, getQueryClient } from "./api-BoO0V5aJ.js";
2
+ import { compareAddress } from "./utils-BfpDVibN.js";
3
+ import { marketplaceConfigOptions } from "./marketplaceConfig-UHQMM9fq.js";
4
+ import { queryOptions } from "@tanstack/react-query";
5
+ import { zeroAddress } from "viem";
6
+
7
+ //#region src/react/queries/market/marketCurrencies.ts
8
+ /**
9
+ * Fetches supported currencies for a marketplace
10
+ */
11
+ async function fetchMarketCurrencies(params) {
12
+ const { chainId, includeNativeCurrency, collectionAddress, config } = params;
13
+ const includeNativeCurrencyOption = includeNativeCurrency ?? true;
14
+ let currencies = await getMarketplaceClient(config).listCurrencies({ chainId: String(chainId) }).then((resp) => resp.currencies.map((currency) => ({
15
+ ...currency,
16
+ contractAddress: currency.contractAddress || zeroAddress
17
+ })));
18
+ if (collectionAddress) {
19
+ const currenciesOptions = (await getQueryClient().fetchQuery(marketplaceConfigOptions(config))).market.collections.find((collection) => compareAddress(collection.itemsAddress, collectionAddress))?.currencyOptions;
20
+ if (currenciesOptions) currencies = currencies.filter((currency) => currenciesOptions.includes(currency.contractAddress));
21
+ }
22
+ if (!includeNativeCurrencyOption) currencies = currencies.filter((currency) => !currency.nativeCurrency);
23
+ return currencies;
24
+ }
25
+ function getMarketCurrenciesQueryKey(params) {
26
+ const apiArgs = { chainId: String(params.chainId) };
27
+ return [
28
+ ...currencyKeys.lists,
29
+ apiArgs,
30
+ {
31
+ includeNativeCurrency: params.includeNativeCurrency,
32
+ collectionAddress: params.collectionAddress
33
+ }
34
+ ];
35
+ }
36
+ function marketCurrenciesQueryOptions(params) {
37
+ const enabled = Boolean(params.chainId && params.config && (params.query?.enabled ?? true));
38
+ return queryOptions({
39
+ queryKey: getMarketCurrenciesQueryKey(params),
40
+ queryFn: () => fetchMarketCurrencies({
41
+ chainId: params.chainId,
42
+ config: params.config,
43
+ includeNativeCurrency: params.includeNativeCurrency,
44
+ collectionAddress: params.collectionAddress
45
+ }),
46
+ ...params.query,
47
+ enabled
48
+ });
49
+ }
50
+
51
+ //#endregion
52
+ export { fetchMarketCurrencies, getMarketCurrenciesQueryKey, marketCurrenciesQueryOptions };
53
+ //# sourceMappingURL=marketCurrencies-sKrTX0og.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketCurrencies-sKrTX0og.js","names":[],"sources":["../src/react/queries/market/marketCurrencies.ts"],"sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { type Address, zeroAddress } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport { compareAddress } from '../../../utils';\nimport {\n\tcurrencyKeys,\n\tgetMarketplaceClient,\n\tgetQueryClient,\n\ttype ListCurrenciesArgs,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\nimport { marketplaceConfigOptions } from './marketplaceConfig';\n\nexport interface FetchMarketCurrenciesParams {\n\tchainId: number;\n\tincludeNativeCurrency?: boolean;\n\tcollectionAddress?: Address;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches supported currencies for a marketplace\n */\nexport async function fetchMarketCurrencies(\n\tparams: FetchMarketCurrenciesParams,\n) {\n\tconst { chainId, includeNativeCurrency, collectionAddress, config } = params;\n\tconst includeNativeCurrencyOption = includeNativeCurrency ?? true;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tlet currencies = await marketplaceClient\n\t\t.listCurrencies({\n\t\t\tchainId: String(chainId),\n\t\t})\n\t\t.then((resp) =>\n\t\t\tresp.currencies.map((currency) => ({\n\t\t\t\t...currency,\n\t\t\t\tcontractAddress: currency.contractAddress || zeroAddress,\n\t\t\t})),\n\t\t);\n\n\tif (collectionAddress) {\n\t\tconst queryClient = getQueryClient();\n\t\tconst marketplaceConfig = await queryClient.fetchQuery(\n\t\t\tmarketplaceConfigOptions(config),\n\t\t);\n\n\t\tconst currenciesOptions = marketplaceConfig.market.collections.find(\n\t\t\t(collection) =>\n\t\t\t\tcompareAddress(collection.itemsAddress, collectionAddress),\n\t\t)?.currencyOptions;\n\n\t\t// Filter currencies based on collection currency options\n\t\tif (currenciesOptions) {\n\t\t\tcurrencies = currencies.filter((currency) =>\n\t\t\t\tcurrenciesOptions.includes(currency.contractAddress),\n\t\t\t);\n\t\t}\n\t}\n\n\tif (!includeNativeCurrencyOption) {\n\t\tcurrencies = currencies.filter((currency) => !currency.nativeCurrency);\n\t}\n\n\treturn currencies;\n}\n\nexport type MarketCurrenciesQueryOptions =\n\tValuesOptional<FetchMarketCurrenciesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getMarketCurrenciesQueryKey(\n\tparams: MarketCurrenciesQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t} satisfies QueryKeyArgs<ListCurrenciesArgs>;\n\n\treturn [\n\t\t...currencyKeys.lists,\n\t\tapiArgs,\n\t\t{\n\t\t\tincludeNativeCurrency: params.includeNativeCurrency,\n\t\t\tcollectionAddress: params.collectionAddress,\n\t\t},\n\t] as const;\n}\n\nexport function marketCurrenciesQueryOptions(\n\tparams: MarketCurrenciesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.chainId && params.config && (params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getMarketCurrenciesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchMarketCurrencies({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t\tincludeNativeCurrency: params.includeNativeCurrency,\n\t\t\t\tcollectionAddress: params.collectionAddress,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n"],"mappings":";;;;;;;;;;AAyBA,eAAsB,sBACrB,QACC;CACD,MAAM,EAAE,SAAS,uBAAuB,mBAAmB,WAAW;CACtE,MAAM,8BAA8B,yBAAyB;CAG7D,IAAI,aAAa,MAFS,qBAAqB,OAAO,CAGpD,eAAe,EACf,SAAS,OAAO,QAAQ,EACxB,CAAC,CACD,MAAM,SACN,KAAK,WAAW,KAAK,cAAc;EAClC,GAAG;EACH,iBAAiB,SAAS,mBAAmB;EAC7C,EAAE,CACH;AAEF,KAAI,mBAAmB;EAMtB,MAAM,qBAJoB,MADN,gBAAgB,CACQ,WAC3C,yBAAyB,OAAO,CAChC,EAE2C,OAAO,YAAY,MAC7D,eACA,eAAe,WAAW,cAAc,kBAAkB,CAC3D,EAAE;AAGH,MAAI,kBACH,cAAa,WAAW,QAAQ,aAC/B,kBAAkB,SAAS,SAAS,gBAAgB,CACpD;;AAIH,KAAI,CAAC,4BACJ,cAAa,WAAW,QAAQ,aAAa,CAAC,SAAS,eAAe;AAGvE,QAAO;;AAQR,SAAgB,4BACf,QACC;CACD,MAAM,UAAU,EACf,SAAS,OAAO,OAAO,QAAQ,EAC/B;AAED,QAAO;EACN,GAAG,aAAa;EAChB;EACA;GACC,uBAAuB,OAAO;GAC9B,mBAAmB,OAAO;GAC1B;EACD;;AAGF,SAAgB,6BACf,QACC;CACD,MAAM,UAAU,QACf,OAAO,WAAW,OAAO,WAAW,OAAO,OAAO,WAAW,MAC7D;AAED,QAAO,aAAa;EACnB,UAAU,4BAA4B,OAAO;EAC7C,eACC,sBAAsB;GAErB,SAAS,OAAO;GAEhB,QAAQ,OAAO;GACf,uBAAuB,OAAO;GAC9B,mBAAmB,OAAO;GAC1B,CAAC;EACH,GAAG,OAAO;EACV;EACA,CAAC"}
@@ -1910,4 +1910,4 @@ const SequenceMarketplaceV2_ABI = [
1910
1910
 
1911
1911
  //#endregion
1912
1912
  export { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI };
1913
- //# sourceMappingURL=marketplace-BYY8OloA.js.map
1913
+ //# sourceMappingURL=marketplace-NQB-sEQL.js.map