@0xsequence/marketplace-sdk 1.1.1 → 1.2.0

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 (327) hide show
  1. package/CHANGELOG.md +34 -3
  2. package/dist/{BellIcon-ByhygxBO.js → BellIcon-DMKEumAz.js} +2 -2
  3. package/dist/BellIcon-DMKEumAz.js.map +1 -0
  4. package/dist/{CartIcon-Bt3rQYGk.js → CartIcon-UyB4NYKt.js} +3 -3
  5. package/dist/CartIcon-UyB4NYKt.js.map +1 -0
  6. package/dist/CollectibleCard-z05qWzKE.d.ts +8 -0
  7. package/dist/_internal-DkS2VUn5.js.map +1 -1
  8. package/dist/abi-fa-o9gH3.js.map +1 -1
  9. package/dist/{alien_swap-DoY6XfMA.js → alien_swap-Cq8LuElo.js} +1 -1
  10. package/dist/{alien_swap-DoY6XfMA.js.map → alien_swap-Cq8LuElo.js.map} +1 -1
  11. package/dist/{api-BoO0V5aJ.js → api-GwTR0dBA.js} +8 -49
  12. package/dist/api-GwTR0dBA.js.map +1 -0
  13. package/dist/{aqua-xyz-BBDxnG14.js → aqua-xyz-0yye_c-Z.js} +1 -1
  14. package/dist/{aqua-xyz-BBDxnG14.js.map → aqua-xyz-0yye_c-Z.js.map} +1 -1
  15. package/dist/{aura-DGx2zwvF.js → aura-TaxFvTFQ.js} +1 -1
  16. package/dist/{aura-DGx2zwvF.js.map → aura-TaxFvTFQ.js.map} +1 -1
  17. package/dist/{blur-D8GKrRrq.js → blur-BupOTobO.js} +1 -1
  18. package/dist/{blur-D8GKrRrq.js.map → blur-BupOTobO.js.map} +1 -1
  19. package/dist/{builder-api-BFuZNOaN.js → builder-api-m4JAA6ee.js} +3 -3
  20. package/dist/builder-api-m4JAA6ee.js.map +1 -0
  21. package/dist/{builder.gen-B9wR2nvF.js → builder.gen--XD71cNL.js} +2 -2
  22. package/dist/builder.gen--XD71cNL.js.map +1 -0
  23. package/dist/{coinbase-DOry4PXY.js → coinbase-DTgZ4wDT.js} +1 -1
  24. package/dist/{coinbase-DOry4PXY.js.map → coinbase-DTgZ4wDT.js.map} +1 -1
  25. package/dist/{collectibles-C_H8jMGH.js → collectibles-CZ6i8sXK.js} +15 -49
  26. package/dist/collectibles-CZ6i8sXK.js.map +1 -0
  27. package/dist/{collections-CKummc-R.js → collections-5NcU-7ZR.js} +92 -10
  28. package/dist/collections-5NcU-7ZR.js.map +1 -0
  29. package/dist/{components-CosnX7F9.js → components-CY8kx2kb.js} +13 -9
  30. package/dist/components-CY8kx2kb.js.map +1 -0
  31. package/dist/{contracts-BP_0vX48.js → contracts-DRJHF89h.js} +4 -3
  32. package/dist/{contracts-BP_0vX48.js.map → contracts-DRJHF89h.js.map} +1 -1
  33. package/dist/{create-config-CIfejoCk.js → create-config-BxyfYCEk.js} +6 -5
  34. package/dist/create-config-BxyfYCEk.js.map +1 -0
  35. package/dist/{create-config-ZOB7i4ZJ.d.ts → create-config-CFBeD8CB.d.ts} +47 -60
  36. package/dist/{element-ciybd_VF.js → element-D4dDznlu.js} +1 -1
  37. package/dist/{element-ciybd_VF.js.map → element-D4dDznlu.js.map} +1 -1
  38. package/dist/{filters-V-V8Dn8f.d.ts → filters-B5niI_fX.d.ts} +7 -7
  39. package/dist/{foundation-Bq4lRz4x.js → foundation-GHZOKAzN.js} +1 -1
  40. package/dist/{foundation-Bq4lRz4x.js.map → foundation-GHZOKAzN.js.map} +1 -1
  41. package/dist/{index-BeRV-7AX.d.ts → index-8scPf0CS.d.ts} +2 -2
  42. package/dist/index-9qsplZ8r.d.ts +18 -0
  43. package/dist/{index-BZIJTQT0.d.ts → index-BIuYTMc2.d.ts} +10 -9
  44. package/dist/{index-C4MUKshG.d.ts → index-BNrz99xy.d.ts} +3 -3
  45. package/dist/{index-Bsx6XsC2.d.ts → index-BYQOPS8e.d.ts} +116 -62
  46. package/dist/{index-DUXfvhxs.d.ts → index-BkZ7SPLc.d.ts} +19 -29
  47. package/dist/{index-NlPMNcqh.d.ts → index-BnUku_aF.d.ts} +109 -114
  48. package/dist/{index-Stm5u0I0.d.ts → index-BtDAHMW_.d.ts} +9 -12
  49. package/dist/{index-BOiHR01C.d.ts → index-C-c_M_sE.d.ts} +10 -9
  50. package/dist/{index-DWt6yrIG.d.ts → index-CNIiC8Z_.d.ts} +11 -8
  51. package/dist/{index-DmudgrsN.d.ts → index-CbERNN3s.d.ts} +26 -16
  52. package/dist/{index-CxpFwGvR.d.ts → index-CsfxsN0t.d.ts} +4 -4
  53. package/dist/{index-CxA34wP1.d.ts → index-DASjaiJL.d.ts} +105 -19
  54. package/dist/{index-Bxzjy0d1.d.ts → index-DD7Vc4cE.d.ts} +2 -2
  55. package/dist/{index-DqXd1EeB.d.ts → index-DIc8OqWV.d.ts} +7 -6
  56. package/dist/{index-CnEbXm_t.d.ts → index-DVI_vggD.d.ts} +53 -12
  57. package/dist/{index-CPzvNmq9.d.ts → index-DqxQeYT2.d.ts} +39 -36
  58. package/dist/{index-CS65jqOq.d.ts → index-Dsf9FRtr.d.ts} +19 -3
  59. package/dist/{index-DFEnA6Wa.d.ts → index-DxAReMEO.d.ts} +34 -34
  60. package/dist/{index-U-zp70of.d.ts → index-UXRoZmd_.d.ts} +8 -12
  61. package/dist/{index-DwKr18CI.d.ts → index-isFvc5gd.d.ts} +2 -2
  62. package/dist/{index-BtWMBHeP.d.ts → index-j3nuJWyJ.d.ts} +13 -9
  63. package/dist/{index-C-745li7.d.ts → index-nVb7o0hc.d.ts} +2 -2
  64. package/dist/{index-D9LPlmbC.d.ts → index-pbE88Tt7.d.ts} +2 -2
  65. package/dist/index.d.ts +8 -8
  66. package/dist/index.js +9 -9
  67. package/dist/{inventory-Dd7TazvZ.js → inventory--t6Zu55O.js} +21 -18
  68. package/dist/inventory--t6Zu55O.js.map +1 -0
  69. package/dist/{listCollectiblesPaginated-Cy2_qEZA.d.ts → listCollectiblesPaginated-BlE5mSzh.d.ts} +32 -32
  70. package/dist/{listCollections-BB9FxKj2.d.ts → listCollections-DWyqFSQ3.d.ts} +143 -66
  71. package/dist/{looks-rare-6H--x3AM.js → looks-rare-2HBhMpOf.js} +1 -1
  72. package/dist/{looks-rare-6H--x3AM.js.map → looks-rare-2HBhMpOf.js.map} +1 -1
  73. package/dist/{lowestListing-Cbsi6M1K.d.ts → lowestListing-DsunDO1c.d.ts} +38 -28
  74. package/dist/{magic-eden-BoxEQ1Li.js → magic-eden-BYdTp-uk.js} +1 -1
  75. package/dist/{magic-eden-BoxEQ1Li.js.map → magic-eden-BYdTp-uk.js.map} +1 -1
  76. package/dist/{manifold-DycKsljb.js → manifold-yE0x6ZmO.js} +1 -1
  77. package/dist/{manifold-DycKsljb.js.map → manifold-yE0x6ZmO.js.map} +1 -1
  78. package/dist/{market-C3HV-awQ.js → market-DuBpFsDg.js} +27 -17
  79. package/dist/market-DuBpFsDg.js.map +1 -0
  80. package/dist/{marketCurrencies-Bpw1bIO0.d.ts → marketCurrencies-BgwmbGFk.d.ts} +20 -9
  81. package/dist/{marketCurrencies-sKrTX0og.js → marketCurrencies-Bolonndy.js} +13 -7
  82. package/dist/marketCurrencies-Bolonndy.js.map +1 -0
  83. package/dist/marketplace-NQB-sEQL.js.map +1 -1
  84. package/dist/{marketplace-logos-D4dS1Foy.js → marketplace-logos-Cz9RrtQo.js} +21 -21
  85. package/dist/marketplace-logos-Cz9RrtQo.js.map +1 -0
  86. package/dist/{marketplace.gen-ksUafDqS.js → marketplace.gen-906FrJQJ.js} +24 -5
  87. package/dist/marketplace.gen-906FrJQJ.js.map +1 -0
  88. package/dist/{marketplaceConfig-UHQMM9fq.js → marketplaceConfig-Bqjo7NYO.js} +8 -4
  89. package/dist/marketplaceConfig-Bqjo7NYO.js.map +1 -0
  90. package/dist/{mintify-Dyqyo8jQ.js → mintify-BXQx3mZB.js} +1 -1
  91. package/dist/{mintify-Dyqyo8jQ.js.map → mintify-BXQx3mZB.js.map} +1 -1
  92. package/dist/{network-DtmiMhcg.js → network-DwdZ_5-7.js} +2 -2
  93. package/dist/network-DwdZ_5-7.js.map +1 -0
  94. package/dist/{networkconfigToWagmiChain-DbUf6HiO.js → networkconfigToWagmiChain-Ct-hGq8M.js} +4 -3
  95. package/dist/networkconfigToWagmiChain-Ct-hGq8M.js.map +1 -0
  96. package/dist/{nftx-2LbFjj9Q.js → nftx-B929_3Ce.js} +1 -1
  97. package/dist/{nftx-2LbFjj9Q.js.map → nftx-B929_3Ce.js.map} +1 -1
  98. package/dist/{okx-CBEWJNsR.js → okx-sZ0-Udny.js} +1 -1
  99. package/dist/{okx-CBEWJNsR.js.map → okx-sZ0-Udny.js.map} +1 -1
  100. package/dist/{open-sea-Dxntz_PA.js → open-sea-DO9PhTrz.js} +1 -1
  101. package/dist/{open-sea-Dxntz_PA.js.map → open-sea-DO9PhTrz.js.map} +1 -1
  102. package/dist/{orders-DnFfZAXV.js → orders-DH76ym2e.js} +16 -9
  103. package/dist/orders-DH76ym2e.js.map +1 -0
  104. package/dist/primary-sale-1u4QlPdA.js.map +1 -1
  105. package/dist/{primary-sales-Dmsi6bqj.js → primary-sales-CECrqatg.js} +49 -7
  106. package/dist/primary-sales-CECrqatg.js.map +1 -0
  107. package/dist/{query-BWbCsXLY.d.ts → query-brXxOcH0.d.ts} +1 -1
  108. package/dist/{rarible-CS0SupHr.js → rarible-Ccb2hs7y.js} +1 -1
  109. package/dist/{rarible-CS0SupHr.js.map → rarible-Ccb2hs7y.js.map} +1 -1
  110. package/dist/react/_internal/api/index.d.ts +2 -2
  111. package/dist/react/_internal/api/index.js +6 -6
  112. package/dist/react/_internal/databeat/index.d.ts +1 -1
  113. package/dist/react/_internal/databeat/index.js +28 -29
  114. package/dist/react/_internal/index.d.ts +2 -2
  115. package/dist/react/_internal/index.js +8 -8
  116. package/dist/react/_internal/wagmi/index.d.ts +1 -1
  117. package/dist/react/_internal/wagmi/index.js +3 -3
  118. package/dist/react/hooks/config/index.d.ts +8 -8
  119. package/dist/react/hooks/config/index.js +28 -29
  120. package/dist/react/hooks/contracts/index.d.ts +6 -6
  121. package/dist/react/hooks/contracts/index.js +8 -8
  122. package/dist/react/hooks/data/collectibles/index.d.ts +10 -10
  123. package/dist/react/hooks/data/collectibles/index.js +28 -29
  124. package/dist/react/hooks/data/collections/index.d.ts +11 -11
  125. package/dist/react/hooks/data/collections/index.js +29 -30
  126. package/dist/react/hooks/data/index.d.ts +37 -37
  127. package/dist/react/hooks/data/index.js +29 -30
  128. package/dist/react/hooks/data/inventory/index.d.ts +36 -36
  129. package/dist/react/hooks/data/inventory/index.js +28 -29
  130. package/dist/react/hooks/data/market/index.d.ts +11 -11
  131. package/dist/react/hooks/data/market/index.js +28 -29
  132. package/dist/react/hooks/data/orders/index.d.ts +10 -10
  133. package/dist/react/hooks/data/orders/index.js +28 -29
  134. package/dist/react/hooks/data/primary-sales/index.d.ts +37 -37
  135. package/dist/react/hooks/data/primary-sales/index.js +29 -30
  136. package/dist/react/hooks/data/tokens/index.d.ts +4 -4
  137. package/dist/react/hooks/data/tokens/index.js +28 -29
  138. package/dist/react/hooks/index.d.ts +37 -37
  139. package/dist/react/hooks/index.js +29 -30
  140. package/dist/react/hooks/transactions/index.d.ts +2 -2
  141. package/dist/react/hooks/transactions/index.js +28 -29
  142. package/dist/react/hooks/ui/index.d.ts +4 -4
  143. package/dist/react/hooks/ui/index.js +28 -29
  144. package/dist/react/hooks/utils/index.d.ts +36 -36
  145. package/dist/react/hooks/utils/index.js +28 -29
  146. package/dist/react/index.d.ts +37 -37
  147. package/dist/react/index.js +29 -30
  148. package/dist/react/queries/collectibles/index.d.ts +10 -10
  149. package/dist/react/queries/collectibles/index.js +12 -13
  150. package/dist/react/queries/collections/index.d.ts +11 -11
  151. package/dist/react/queries/collections/index.js +11 -11
  152. package/dist/react/queries/index.d.ts +24 -24
  153. package/dist/react/queries/index.js +22 -23
  154. package/dist/react/queries/inventory/index.d.ts +2 -2
  155. package/dist/react/queries/inventory/index.js +12 -12
  156. package/dist/react/queries/market/index.d.ts +5 -5
  157. package/dist/react/queries/market/index.js +12 -12
  158. package/dist/react/queries/orders/index.d.ts +10 -10
  159. package/dist/react/queries/orders/index.js +8 -8
  160. package/dist/react/queries/primary-sales/index.d.ts +4 -4
  161. package/dist/react/queries/primary-sales/index.js +9 -9
  162. package/dist/react/queries/tokens/index.d.ts +4 -4
  163. package/dist/react/queries/tokens/index.js +8 -9
  164. package/dist/react/queries/utils/index.d.ts +3 -3
  165. package/dist/react/queries/utils/index.js +12 -12
  166. package/dist/react/ssr/index.d.ts +7 -7
  167. package/dist/react/ssr/index.js +8 -8
  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 +12 -12
  171. package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +7 -10
  172. package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +28 -29
  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 -29
  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 +8 -8
  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 +8 -8
  180. package/dist/react/ui/index.d.ts +4 -4
  181. package/dist/react/ui/index.js +28 -29
  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 -29
  184. package/dist/react/utils/index.d.ts +1 -1
  185. package/dist/react/utils/index.js +6 -6
  186. package/dist/{react-DE852KeT.js → react-CBsgOdVP.js} +608 -735
  187. package/dist/react-CBsgOdVP.js.map +1 -0
  188. package/dist/{sequence-paCCener.js → sequence-CRdb1yEs.js} +1 -1
  189. package/dist/{sequence-paCCener.js.map → sequence-CRdb1yEs.js.map} +1 -1
  190. package/dist/styles/index.css +1 -1
  191. package/dist/{sudo-swap-9rH2EgfT.js → sudo-swap-BIklG2gq.js} +1 -1
  192. package/dist/{sudo-swap-9rH2EgfT.js.map → sudo-swap-BIklG2gq.js.map} +1 -1
  193. package/dist/{super-rare-DHIuWtRw.js → super-rare-h8645_5E.js} +1 -1
  194. package/dist/{super-rare-DHIuWtRw.js.map → super-rare-h8645_5E.js.map} +1 -1
  195. package/dist/token-Cv7l2ZaL.js.map +1 -1
  196. package/dist/{tokenBalances-ibDerNmM.js → tokenBalances-CouzNX4j.js} +6 -12
  197. package/dist/tokenBalances-CouzNX4j.js.map +1 -0
  198. package/dist/{tokenSupplies-Bfe8RHzI.d.ts → tokenSupplies-C3zJll0M.d.ts} +32 -39
  199. package/dist/{tokens-cGxMadd8.js → tokens-BvIRUCGG.js} +58 -27
  200. package/dist/tokens-BvIRUCGG.js.map +1 -0
  201. package/dist/transaction-DZUW5RHu.js.map +1 -1
  202. package/dist/types/index.d.ts +1 -1
  203. package/dist/types/index.js +2 -2
  204. package/dist/types-B_-cnkcP.js.map +1 -1
  205. package/dist/{types-D2TJ1dwv.d.ts → types-CMDwfhfR.d.ts} +5 -5
  206. package/dist/utils/abi/index.d.ts +4 -4
  207. package/dist/utils/abi/marketplace/index.d.ts +1 -1
  208. package/dist/utils/abi/primary-sale/index.d.ts +1 -1
  209. package/dist/utils/abi/token/index.d.ts +1 -1
  210. package/dist/utils/index.d.ts +7 -7
  211. package/dist/utils/index.js +7 -7
  212. package/dist/{utils-BfpDVibN.js → utils-9ToOvt-c.js} +50 -7
  213. package/dist/utils-9ToOvt-c.js.map +1 -0
  214. package/dist/{utils-BqxcalL2.js → utils-B6di6O-C.js} +2 -2
  215. package/dist/utils-B6di6O-C.js.map +1 -0
  216. package/dist/{utils-BCgNhBFR.js → utils-BCYTEOvy.js} +17 -7
  217. package/dist/utils-BCYTEOvy.js.map +1 -0
  218. package/dist/{waitForTransactionReceipt-DieAnV52.js → waitForTransactionReceipt-CbSeUSXe.js} +5 -4
  219. package/dist/{waitForTransactionReceipt-DieAnV52.js.map → waitForTransactionReceipt-CbSeUSXe.js.map} +1 -1
  220. package/dist/{x2y2-45WDooeh.js → x2y2-OvF__ugj.js} +1 -1
  221. package/dist/{x2y2-45WDooeh.js.map → x2y2-OvF__ugj.js.map} +1 -1
  222. package/dist/{zora-CbeBoLvQ.js → zora-DzCeu-eE.js} +1 -1
  223. package/dist/{zora-CbeBoLvQ.js.map → zora-DzCeu-eE.js.map} +1 -1
  224. package/package.json +38 -38
  225. package/src/react/_internal/api/__mocks__/marketplace.msw.ts +13 -0
  226. package/src/react/_internal/api/index.ts +0 -1
  227. package/src/react/_internal/api/marketplace.gen.ts +70 -26
  228. package/src/react/_internal/api/query-keys.ts +9 -0
  229. package/src/react/hooks/data/collectibles/useBalanceOfCollectible.tsx +0 -9
  230. package/src/react/hooks/data/collectibles/useListCollectibles.tsx +1 -16
  231. package/src/react/hooks/data/collectibles/useTokenBalances.tsx +0 -9
  232. package/src/react/hooks/data/collections/index.ts +2 -0
  233. package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.test.tsx +112 -0
  234. package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.tsx +74 -0
  235. package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.test.tsx +110 -0
  236. package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.tsx +74 -0
  237. package/src/react/hooks/data/inventory/useInventory.tsx +1 -10
  238. package/src/react/hooks/data/market/useMarketCurrencies.test.tsx +31 -2
  239. package/src/react/hooks/data/primary-sales/index.ts +1 -0
  240. package/src/react/hooks/data/primary-sales/usePrimarySaleItem.tsx +71 -0
  241. package/src/react/hooks/data/tokens/useListBalances.tsx +1 -10
  242. package/src/react/hooks/data/tokens/useTokenSupplies.ts +1 -13
  243. package/src/react/hooks/transactions/useGenerateOfferTransaction.test.tsx +2 -0
  244. package/src/react/hooks/transactions/useProcessStep.test.tsx +8 -6
  245. package/src/react/hooks/transactions/useProcessStep.ts +8 -6
  246. package/src/react/hooks/utils/useComparePrices.test.tsx +1 -1
  247. package/src/react/providers/modal-provider.tsx +2 -1
  248. package/src/react/queries/collectibles/balanceOfCollectible.ts +1 -15
  249. package/src/react/queries/collectibles/listCollectibles.ts +1 -54
  250. package/src/react/queries/collectibles/tokenBalances.ts +1 -15
  251. package/src/react/queries/collections/activeListingsCurrencies.ts +84 -0
  252. package/src/react/queries/collections/activeOffersCurrencies.ts +84 -0
  253. package/src/react/queries/collections/index.ts +2 -0
  254. package/src/react/queries/inventory/inventory.ts +2 -9
  255. package/src/react/queries/market/marketCurrencies.ts +8 -1
  256. package/src/react/queries/primary-sales/index.ts +1 -0
  257. package/src/react/queries/primary-sales/primarySaleItem.ts +80 -0
  258. package/src/react/queries/tokens/listBalances.ts +1 -21
  259. package/src/react/queries/tokens/tokenSupplies.ts +2 -31
  260. package/src/react/queries/utils/comparePrices.ts +13 -1
  261. package/src/react/ui/components/_internals/action-button/ActionButton.stories.tsx +2 -0
  262. package/src/react/ui/components/marketplace-collectible-card/components/footer/Footer.tsx +4 -18
  263. package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +2 -2
  264. package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +0 -2
  265. package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +3 -0
  266. package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +1 -0
  267. package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +0 -23
  268. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +22 -2
  269. package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +2 -0
  270. package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +2 -0
  271. package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +2 -0
  272. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +15 -12
  273. package/src/react/ui/modals/_internal/components/floorPriceText/__tests__/FloorPriceText.test.tsx +2 -0
  274. package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +1 -1
  275. package/src/react/ui/modals/_internal/components/priceInput/index.tsx +148 -11
  276. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +1 -1
  277. package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +2 -0
  278. package/src/styles/styles.ts +1 -1
  279. package/src/utils/networkconfigToWagmiChain.ts +7 -0
  280. package/src/utils/price.ts +58 -0
  281. package/test/const.ts +2 -0
  282. package/test/server-setup.ts +0 -2
  283. package/.changeset/honest-peas-arrive.md +0 -5
  284. package/.changeset/real-tips-stick.md +0 -8
  285. package/.changeset/tall-pandas-wear.md +0 -8
  286. package/dist/BellIcon-ByhygxBO.js.map +0 -1
  287. package/dist/CartIcon-Bt3rQYGk.js.map +0 -1
  288. package/dist/CollectibleCard-CVpdgXA8.d.ts +0 -8
  289. package/dist/api-BoO0V5aJ.js.map +0 -1
  290. package/dist/builder-api-BFuZNOaN.js.map +0 -1
  291. package/dist/builder.gen-B9wR2nvF.js.map +0 -1
  292. package/dist/collectibles-C_H8jMGH.js.map +0 -1
  293. package/dist/collections-CKummc-R.js.map +0 -1
  294. package/dist/components-CosnX7F9.js.map +0 -1
  295. package/dist/create-config-CIfejoCk.js.map +0 -1
  296. package/dist/index-DNNUeZEq.d.ts +0 -18
  297. package/dist/inventory-Dd7TazvZ.js.map +0 -1
  298. package/dist/listBalances-BxpxBCvn.js +0 -57
  299. package/dist/listBalances-BxpxBCvn.js.map +0 -1
  300. package/dist/market-C3HV-awQ.js.map +0 -1
  301. package/dist/marketCurrencies-sKrTX0og.js.map +0 -1
  302. package/dist/marketplace-logos-D4dS1Foy.js.map +0 -1
  303. package/dist/marketplace.gen-ksUafDqS.js.map +0 -1
  304. package/dist/marketplaceConfig-UHQMM9fq.js.map +0 -1
  305. package/dist/network-DtmiMhcg.js.map +0 -1
  306. package/dist/networkconfigToWagmiChain-DbUf6HiO.js.map +0 -1
  307. package/dist/orders-DnFfZAXV.js.map +0 -1
  308. package/dist/primary-sales-Dmsi6bqj.js.map +0 -1
  309. package/dist/react-DE852KeT.js.map +0 -1
  310. package/dist/tokenBalances-ibDerNmM.js.map +0 -1
  311. package/dist/tokens-cGxMadd8.js.map +0 -1
  312. package/dist/utils-BCgNhBFR.js.map +0 -1
  313. package/dist/utils-BfpDVibN.js.map +0 -1
  314. package/dist/utils-BqxcalL2.js.map +0 -1
  315. package/src/react/_internal/api/__mocks__/laos.msw.ts +0 -387
  316. package/src/react/_internal/api/__tests__/laos-api.test.ts +0 -756
  317. package/src/react/_internal/api/laos-api.ts +0 -106
  318. package/src/react/hooks/data/collectibles/useBalanceOfCollectible.laos.test.tsx +0 -367
  319. package/src/react/queries/collectibles/__tests__/balanceOfCollectible.laos.test.ts +0 -123
  320. package/src/react/queries/collectibles/__tests__/tokenBalances.laos.test.ts +0 -123
  321. package/src/react/queries/inventory/__tests__/inventory.laos.test.ts +0 -499
  322. package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +0 -481
  323. /package/dist/{index-6wsMChsg.d.ts → index-CCggO_hw.d.ts} +0 -0
  324. /package/dist/{index-CZUtOTjh.d.ts → index-CKefEBrI.d.ts} +0 -0
  325. /package/dist/{index-DW3njUfb.d.ts → index-DgsCqh_P.d.ts} +0 -0
  326. /package/dist/{index-DewGsFz5.d.ts → index-xpO4AQyS.d.ts} +0 -0
  327. /package/dist/{queries-KOcILNJO.js → queries-CyajGg_O.js} +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@0xsequence/marketplace-sdk",
3
3
  "private": false,
4
- "version": "1.1.1",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -41,31 +41,31 @@
41
41
  "dependencies": {
42
42
  "@databeat/tracker": "^0.9.3",
43
43
  "@legendapp/state": "3.0.0-beta.32",
44
- "@tailwindcss/cli": "^4.1.13",
45
- "@xstate/store": "^3.9.2",
44
+ "@tailwindcss/cli": "^4.1.16",
45
+ "@xstate/store": "^3.11.2",
46
46
  "class-variance-authority": "^0.7.1",
47
47
  "clsx": "^2.1.1",
48
48
  "date-fns": "^4.1.0",
49
49
  "dnum": "^2.15.0",
50
- "react-day-picker": "^9.9.0",
50
+ "react-day-picker": "^9.11.1",
51
51
  "tailwind-merge": "^3.3.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "0xsequence": "^2.3.27",
55
- "@0xsequence/api": "^2.3.27",
56
- "@0xsequence/checkout": "^5.3.14",
57
- "@0xsequence/connect": "^5.3.14",
58
- "@0xsequence/design-system": "^2.2.2",
59
- "@0xsequence/indexer": "^2.3.27",
60
- "@0xsequence/metadata": "^2.3.27",
61
- "@0xsequence/network": "^2.3.27",
54
+ "0xsequence": "^2.3.32",
55
+ "@0xsequence/api": "^2.3.33",
56
+ "@0xsequence/checkout": "^5.4.0",
57
+ "@0xsequence/connect": "^5.4.0",
58
+ "@0xsequence/design-system": "^2.2.5",
59
+ "@0xsequence/indexer": "^2.3.33",
60
+ "@0xsequence/metadata": "^2.3.33",
61
+ "@0xsequence/network": "^2.3.33",
62
62
  "@google/model-viewer": "^4.1.0",
63
- "@tanstack/react-query": "^5.87.1",
64
- "nuqs": "^2.6.0",
65
- "react": "^19.1.1",
66
- "react-dom": "^19.1.1",
67
- "viem": "^2.37.4",
68
- "wagmi": "^2.16.9"
63
+ "@tanstack/react-query": "^5.90.5",
64
+ "nuqs": "^2.7.2",
65
+ "react": "^19.2.0",
66
+ "react-dom": "^19.2.0",
67
+ "viem": "^2.38.5",
68
+ "wagmi": "^2.19.0"
69
69
  },
70
70
  "peerDependenciesMeta": {
71
71
  "nuqs": {
@@ -73,39 +73,39 @@
73
73
  }
74
74
  },
75
75
  "devDependencies": {
76
- "@biomejs/biome": "^2.2.3",
77
- "@changesets/cli": "^2.29.6",
78
- "@eslint/js": "^9.35.0",
79
- "@storybook/addon-docs": "^9.1.5",
80
- "@storybook/addon-vitest": "^9.1.5",
81
- "@storybook/react-vite": "^9.1.5",
76
+ "@biomejs/biome": "^2.3.1",
77
+ "@changesets/cli": "^2.29.7",
78
+ "@eslint/js": "^9.38.0",
79
+ "@storybook/addon-docs": "^9.1.16",
80
+ "@storybook/addon-vitest": "^9.1.16",
81
+ "@storybook/react-vite": "^9.1.16",
82
82
  "@storybook/test-runner": "^0.23.0",
83
- "@tailwindcss/postcss": "^4.1.13",
84
- "@testing-library/jest-dom": "^6.8.0",
83
+ "@tailwindcss/postcss": "^4.1.16",
84
+ "@testing-library/jest-dom": "^6.9.1",
85
85
  "@testing-library/react": "^16.3.0",
86
- "@types/react": "^19.1.12",
87
- "@types/react-dom": "^19.1.9",
86
+ "@types/react": "^19.2.2",
87
+ "@types/react-dom": "^19.2.2",
88
88
  "@vitest/browser": "4.0.0-beta.12",
89
89
  "@vitest/coverage-v8": "4.0.0-beta.12",
90
- "eslint": "^9.35.0",
90
+ "eslint": "^9.38.0",
91
91
  "eslint-config-biome": "^2.1.3",
92
92
  "eslint-plugin-react": "^7.37.5",
93
93
  "eslint-plugin-react-hooks": "^5.2.0",
94
- "eslint-plugin-storybook": "^9.1.5",
95
- "globals": "^16.3.0",
94
+ "eslint-plugin-storybook": "^9.1.16",
95
+ "globals": "^16.4.0",
96
96
  "happy-dom": "^18.0.1",
97
97
  "jsdom": "^26.1.0",
98
- "msw": "^2.11.1",
99
- "msw-storybook-addon": "^2.0.5",
100
- "playwright": "^1.55.0",
98
+ "msw": "^2.11.6",
99
+ "msw-storybook-addon": "^2.0.6",
100
+ "playwright": "^1.56.1",
101
101
  "postcss": "^8.5.6",
102
102
  "prool": "^0.0.24",
103
103
  "rollup-preserve-directives": "^1.1.3",
104
- "storybook": "^9.1.5",
105
- "tailwindcss": "^4.1.13",
104
+ "storybook": "^9.1.16",
105
+ "tailwindcss": "^4.1.16",
106
106
  "tsdown": "^0.14.2",
107
- "typescript": "^5.9.2",
108
- "typescript-eslint": "^8.43.0",
107
+ "typescript": "^5.9.3",
108
+ "typescript-eslint": "^8.46.2",
109
109
  "vite-tsconfig-paths": "^5.1.4",
110
110
  "vitest": "4.0.0-beta.12"
111
111
  },
@@ -38,6 +38,8 @@ export const mockCurrencies: Currency[] = [
38
38
  exchangeRate: 1800.0,
39
39
  defaultChainCurrency: false,
40
40
  nativeCurrency: true,
41
+ openseaListing: true,
42
+ openseaOffer: true,
41
43
  createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
42
44
  updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
43
45
  },
@@ -51,6 +53,8 @@ export const mockCurrencies: Currency[] = [
51
53
  exchangeRate: 1.0,
52
54
  defaultChainCurrency: true,
53
55
  nativeCurrency: false,
56
+ openseaListing: true,
57
+ openseaOffer: true,
54
58
  status: CurrencyStatus.active,
55
59
  createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
56
60
  updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
@@ -98,6 +102,7 @@ export const mockOrder: Order = {
98
102
  blockNumber: 1234567,
99
103
  createdAt: new Date().toISOString(),
100
104
  updatedAt: new Date().toISOString(),
105
+ slug: 'test-order',
101
106
  };
102
107
 
103
108
  export const mockCollectibleOrder: CollectibleOrder = {
@@ -282,6 +287,14 @@ export const handlers = [
282
287
  collection: mockCollection,
283
288
  }),
284
289
 
290
+ mockMarketplaceHandler('GetCollectionActiveListingsCurrencies', {
291
+ currencies: mockCurrencies,
292
+ }),
293
+
294
+ mockMarketplaceHandler('GetCollectionActiveOffersCurrencies', {
295
+ currencies: mockCurrencies,
296
+ }),
297
+
285
298
  mockMarketplaceHandler('GetCollectibleLowestOffer', {
286
299
  order: mockOrder,
287
300
  }),
@@ -1,5 +1,4 @@
1
1
  export * from './get-query-client';
2
- export * from './laos-api';
3
2
  export * from './marketplace.gen';
4
3
  export * from './marketplace-api';
5
4
  export * from './query-keys';
@@ -1,20 +1,13 @@
1
1
  /* eslint-disable */
2
- // marketplace-api 0391bc2ece6d83092773039f15d1ea60ebfc32bf
2
+ // marketplace-api 1ecb14ce28259b0a60c8b90d3e247aced7bcdfad
3
3
  // --
4
4
  // Code generated by webrpc-gen@v0.25.4 with typescript generator. DO NOT EDIT.
5
5
  //
6
6
  // webrpc-gen -schema=marketplace.ridl -target=typescript -client -out=./clients/marketplace.gen.ts
7
- //
8
- // MANUAL MODIFICATIONS FOR BACKWARDS COMPATIBILITY:
9
- // - Order.slug: made optional (was required)
10
- // - ExecuteArgs.params: made optional (was required)
11
- // - ExecuteInput.slug: made optional (was required)
12
- // - GenerateOfferTransactionArgs.offerType: made optional (was required)
13
- // - ContractType: added LAOS_ERC_721 enum value (was removed in new gen)
14
7
 
15
8
  export const WebrpcHeader = "Webrpc"
16
9
 
17
- export const WebrpcHeaderValue = "webrpc@v0.25.4;gen-typescript@v0.17.0;marketplace-api@v0.0.0-0391bc2ece6d83092773039f15d1ea60ebfc32bf;marketplace-sdk@v1.1.1"
10
+ export const WebrpcHeaderValue = "webrpc@v0.25.4;gen-typescript@v0.17.0;marketplace-api@v0.0.0-1ecb14ce28259b0a60c8b90d3e247aced7bcdfad;marketplace-sdk@v1.2.0"
18
11
 
19
12
  // WebRPC description and code-gen version
20
13
  export const WebRPCVersion = "v1"
@@ -23,7 +16,7 @@ export const WebRPCVersion = "v1"
23
16
  export const WebRPCSchemaVersion = ""
24
17
 
25
18
  // Schema hash generated from your RIDL schema
26
- export const WebRPCSchemaHash = "0391bc2ece6d83092773039f15d1ea60ebfc32bf"
19
+ export const WebRPCSchemaHash = "1ecb14ce28259b0a60c8b90d3e247aced7bcdfad"
27
20
 
28
21
  type WebrpcGenVersions = {
29
22
  webrpcGenVersion: string;
@@ -152,7 +145,8 @@ export enum OrderbookKind {
152
145
  opensea = 'opensea',
153
146
  looks_rare = 'looks_rare',
154
147
  reservoir = 'reservoir',
155
- x2y2 = 'x2y2'
148
+ x2y2 = 'x2y2',
149
+ magic_eden = 'magic_eden'
156
150
  }
157
151
 
158
152
  export enum SourceKind {
@@ -160,7 +154,8 @@ export enum SourceKind {
160
154
  external = 'external',
161
155
  sequence_marketplace_v1 = 'sequence_marketplace_v1',
162
156
  sequence_marketplace_v2 = 'sequence_marketplace_v2',
163
- opensea = 'opensea'
157
+ opensea = 'opensea',
158
+ magic_eden = 'magic_eden'
164
159
  }
165
160
 
166
161
  export enum OrderSide {
@@ -189,8 +184,7 @@ export enum ContractType {
189
184
  UNKNOWN = 'UNKNOWN',
190
185
  ERC20 = 'ERC20',
191
186
  ERC721 = 'ERC721',
192
- ERC1155 = 'ERC1155',
193
- LAOS_ERC_721 = 'LAOS_ERC_721'
187
+ ERC1155 = 'ERC1155'
194
188
  }
195
189
 
196
190
  export enum CollectionPriority {
@@ -393,7 +387,7 @@ export interface Order {
393
387
  status: OrderStatus
394
388
  chainId: number
395
389
  originName: string
396
- slug?: string
390
+ slug: string
397
391
  collectionContractAddress: string
398
392
  tokenId?: string
399
393
  createdBy: string
@@ -512,6 +506,8 @@ export interface Currency {
512
506
  exchangeRate: number
513
507
  defaultChainCurrency: boolean
514
508
  nativeCurrency: boolean
509
+ openseaListing: boolean
510
+ openseaOffer: boolean
515
511
  createdAt: string
516
512
  updatedAt: string
517
513
  deletedAt?: string
@@ -596,9 +592,9 @@ export interface ExecuteInput {
596
592
  signature: string
597
593
  method: string
598
594
  endpoint: string
599
- slug?: string
600
595
  executeType: ExecuteType
601
596
  body: any
597
+ slug?: string
602
598
  }
603
599
 
604
600
  export interface Activity {
@@ -648,6 +644,8 @@ export interface PrimarySaleItem {
648
644
  priceDecimals: number
649
645
  priceAmount: string
650
646
  priceAmountFormatted: string
647
+ priceUsd: number
648
+ priceUsdFormatted: string
651
649
  supply: string
652
650
  supplyCap: string
653
651
  unlimitedSupply: boolean
@@ -816,6 +814,8 @@ export interface AddCollectiblesReturn {
816
814
  export interface Marketplace {
817
815
  listCurrencies(args: ListCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn>
818
816
  getCollectionDetail(args: GetCollectionDetailArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionDetailReturn>
817
+ getCollectionActiveListingsCurrencies(args: GetCollectionActiveListingsCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionActiveListingsCurrenciesReturn>
818
+ getCollectionActiveOffersCurrencies(args: GetCollectionActiveOffersCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionActiveOffersCurrenciesReturn>
819
819
  getCollectible(args: GetCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleReturn>
820
820
  getLowestPriceOfferForCollectible(args: GetLowestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceOfferForCollectibleReturn>
821
821
  getHighestPriceOfferForCollectible(args: GetHighestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceOfferForCollectibleReturn>
@@ -863,7 +863,7 @@ export interface Marketplace {
863
863
  generateOfferTransaction(args: GenerateOfferTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateOfferTransactionReturn>
864
864
  generateCancelTransaction(args: GenerateCancelTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateCancelTransactionReturn>
865
865
  /**
866
- * only used in a case of external transactions ( when we create off-chain transactions ) for instance opensea market, use onlyu ExecuteInput and leave other inputs empty, they are depracated and kept only for backward compatibility
866
+ * only used in a case of external transactions ( when we create off-chain transactions ) for instance opensea market, use only ExecuteInput params and leave other root inputs empty, they are depracated and kept only for backward compatibility
867
867
  */
868
868
  execute(args: ExecuteArgs, headers?: object, signal?: AbortSignal): Promise<ExecuteReturn>
869
869
  /**
@@ -903,6 +903,22 @@ export interface GetCollectionDetailArgs {
903
903
  export interface GetCollectionDetailReturn {
904
904
  collection: Collection
905
905
  }
906
+ export interface GetCollectionActiveListingsCurrenciesArgs {
907
+ chainId: string
908
+ contractAddress: string
909
+ }
910
+
911
+ export interface GetCollectionActiveListingsCurrenciesReturn {
912
+ currencies: Array<Currency>
913
+ }
914
+ export interface GetCollectionActiveOffersCurrenciesArgs {
915
+ chainId: string
916
+ contractAddress: string
917
+ }
918
+
919
+ export interface GetCollectionActiveOffersCurrenciesReturn {
920
+ currencies: Array<Currency>
921
+ }
906
922
  export interface GetCollectibleArgs {
907
923
  chainId: string
908
924
  contractAddress: string
@@ -1162,7 +1178,7 @@ export interface GenerateOfferTransactionArgs {
1162
1178
  offer: CreateReq
1163
1179
  additionalFees: Array<AdditionalFee>
1164
1180
  walletType?: WalletKind
1165
- offerType?: OfferType
1181
+ offerType: OfferType
1166
1182
  }
1167
1183
 
1168
1184
  export interface GenerateOfferTransactionReturn {
@@ -1180,13 +1196,13 @@ export interface GenerateCancelTransactionReturn {
1180
1196
  steps: Array<Step>
1181
1197
  }
1182
1198
  export interface ExecuteArgs {
1183
- params?: ExecuteInput
1184
- chainId: string
1185
- signature: string
1186
- method: string
1187
- endpoint: string
1188
- executeType: ExecuteType
1189
- body: any
1199
+ params: ExecuteInput
1200
+ chainId?: string
1201
+ signature?: string
1202
+ method?: string
1203
+ endpoint?: string
1204
+ executeType?: ExecuteType
1205
+ body?: any
1190
1206
  }
1191
1207
 
1192
1208
  export interface ExecuteReturn {
@@ -1609,6 +1625,34 @@ export class Marketplace implements Marketplace {
1609
1625
  })
1610
1626
  }
1611
1627
 
1628
+ getCollectionActiveListingsCurrencies = (args: GetCollectionActiveListingsCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionActiveListingsCurrenciesReturn> => {
1629
+ return this.fetch(
1630
+ this.url('GetCollectionActiveListingsCurrencies'),
1631
+ createHTTPRequest(args, headers, signal)).then((res) => {
1632
+ return buildResponse(res).then(_data => {
1633
+ return {
1634
+ currencies: <Array<Currency>>(_data.currencies),
1635
+ }
1636
+ })
1637
+ }, (error) => {
1638
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1639
+ })
1640
+ }
1641
+
1642
+ getCollectionActiveOffersCurrencies = (args: GetCollectionActiveOffersCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionActiveOffersCurrenciesReturn> => {
1643
+ return this.fetch(
1644
+ this.url('GetCollectionActiveOffersCurrencies'),
1645
+ createHTTPRequest(args, headers, signal)).then((res) => {
1646
+ return buildResponse(res).then(_data => {
1647
+ return {
1648
+ currencies: <Array<Currency>>(_data.currencies),
1649
+ }
1650
+ })
1651
+ }, (error) => {
1652
+ throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1653
+ })
1654
+ }
1655
+
1612
1656
  getCollectible = (args: GetCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleReturn> => {
1613
1657
  return this.fetch(
1614
1658
  this.url('GetCollectible'),
@@ -2671,4 +2715,4 @@ export const webrpcErrorByCode: { [code: number]: any } = {
2671
2715
  [9999]: NotImplementedError,
2672
2716
  }
2673
2717
 
2674
- export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
2718
+ export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
@@ -28,6 +28,7 @@ class CollectableKeys {
28
28
  static listings = [...CollectableKeys.all, 'listings'] as const;
29
29
  static listingsCount = [...CollectableKeys.all, 'listingsCount'] as const;
30
30
  static listPrimarySaleItems = ['listPrimarySaleItems'] as const;
31
+ static primarySaleItem = ['primarySaleItem'] as const;
31
32
  static primarySaleItemsCount = ['primarySaleItemsCount'] as const;
32
33
  static filter = [...CollectableKeys.all, 'filter'] as const;
33
34
  static counts = [...CollectableKeys.all, 'counts'] as const;
@@ -58,6 +59,14 @@ class CollectionKeys {
58
59
  ...CollectionKeys.all,
59
60
  'getCountOfFilteredOrders',
60
61
  ] as const;
62
+ static activeListingsCurrencies = [
63
+ ...CollectionKeys.all,
64
+ 'activeListingsCurrencies',
65
+ ] as const;
66
+ static activeOffersCurrencies = [
67
+ ...CollectionKeys.all,
68
+ 'activeOffersCurrencies',
69
+ ] as const;
61
70
  }
62
71
 
63
72
  // biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys
@@ -1,11 +1,9 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
- import { ContractType } from '../../../_internal';
3
2
  import {
4
3
  balanceOfCollectibleOptions,
5
4
  type UseBalanceOfCollectibleArgs,
6
5
  } from '../../../queries/collectibles/balanceOfCollectible';
7
6
  import { useConfig } from '../../config/useConfig';
8
- import { useMarketplaceConfig } from '../../config/useMarketplaceConfig';
9
7
 
10
8
  /**
11
9
  * Hook to fetch the balance of a specific collectible for a user
@@ -29,18 +27,11 @@ import { useMarketplaceConfig } from '../../config/useMarketplaceConfig';
29
27
  */
30
28
  export function useBalanceOfCollectible(args: UseBalanceOfCollectibleArgs) {
31
29
  const config = useConfig();
32
- const { data: marketplaceConfig } = useMarketplaceConfig();
33
-
34
- const collection = marketplaceConfig?.market.collections.find(
35
- (collection) => collection.itemsAddress === args.collectionAddress,
36
- );
37
- const isLaos721 = collection?.contractType === ContractType.LAOS_ERC_721;
38
30
 
39
31
  return useQuery(
40
32
  balanceOfCollectibleOptions(
41
33
  {
42
34
  ...args,
43
- isLaos721,
44
35
  },
45
36
  config,
46
37
  ),
@@ -18,14 +18,13 @@ export type UseListCollectiblesParams = Optional<
18
18
  * Hook to fetch a list of collectibles with infinite pagination support
19
19
  *
20
20
  * Fetches collectibles from the marketplace with support for filtering, pagination,
21
- * and special handling for shop marketplace types and LAOS721 contracts.
21
+ * and special handling for shop marketplace types.
22
22
  *
23
23
  * @param params - Configuration parameters
24
24
  * @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
25
25
  * @param params.collectionAddress - The collection contract address
26
26
  * @param params.side - Order side (listing or bid)
27
27
  * @param params.filter - Optional filtering parameters
28
- * @param params.isLaos721 - Whether the collection is a LAOS721 contract
29
28
  * @param params.marketplaceType - Type of marketplace (shop, etc.)
30
29
  * @param params.query - Optional React Query configuration
31
30
  *
@@ -55,20 +54,6 @@ export type UseListCollectiblesParams = Optional<
55
54
  * }
56
55
  * })
57
56
  * ```
58
- *
59
- * @example
60
- * For LAOS721 collections:
61
- * ```typescript
62
- * const { data } = useListCollectibles({
63
- * chainId: 137,
64
- * collectionAddress: '0x...',
65
- * side: OrderSide.listing,
66
- * isLaos721: true,
67
- * filter: {
68
- * inAccounts: ['0x...']
69
- * }
70
- * })
71
- * ```
72
57
  */
73
58
  export function useListCollectibles(params: UseListCollectiblesParams) {
74
59
  const defaultConfig = useConfig();
@@ -1,11 +1,9 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
- import { ContractType } from '../../../_internal';
3
2
  import {
4
3
  tokenBalancesOptions,
5
4
  type UseTokenBalancesArgs,
6
5
  } from '../../../queries/collectibles/tokenBalances';
7
6
  import { useConfig } from '../../config/useConfig';
8
- import { useMarketplaceConfig } from '../../config/useMarketplaceConfig';
9
7
 
10
8
  /**
11
9
  * Hook to fetch all token balances for a user in a collection
@@ -28,18 +26,11 @@ import { useMarketplaceConfig } from '../../config/useMarketplaceConfig';
28
26
  */
29
27
  export function useTokenBalances(args: UseTokenBalancesArgs) {
30
28
  const config = useConfig();
31
- const { data: marketplaceConfig } = useMarketplaceConfig();
32
-
33
- const collection = marketplaceConfig?.market.collections.find(
34
- (collection) => collection.itemsAddress === args.collectionAddress,
35
- );
36
- const isLaos721 = collection?.contractType === ContractType.LAOS_ERC_721;
37
29
 
38
30
  return useQuery(
39
31
  tokenBalancesOptions(
40
32
  {
41
33
  ...args,
42
- isLaos721,
43
34
  },
44
35
  config,
45
36
  ),
@@ -1,4 +1,6 @@
1
1
  export * from './useCollection';
2
+ export * from './useCollectionActiveListingsCurrencies';
3
+ export * from './useCollectionActiveOffersCurrencies';
2
4
  export * from './useCollectionBalanceDetails';
3
5
  export * from './useCollectionDetails';
4
6
  export * from './useCollectionDetailsPolling';
@@ -0,0 +1,112 @@
1
+ import { renderHook, server, waitFor } from '@test';
2
+ import { HttpResponse, http } from 'msw';
3
+ import { zeroAddress } from 'viem';
4
+ import { describe, expect, it } from 'vitest';
5
+ import {
6
+ mockCurrencies,
7
+ mockMarketplaceEndpoint,
8
+ } from '../../../_internal/api/__mocks__/marketplace.msw';
9
+ import type { UseCollectionActiveListingsCurrenciesParams } from './useCollectionActiveListingsCurrencies';
10
+ import { useCollectionActiveListingsCurrencies } from './useCollectionActiveListingsCurrencies';
11
+
12
+ describe('useCollectionActiveListingsCurrencies', () => {
13
+ const defaultArgs: UseCollectionActiveListingsCurrenciesParams = {
14
+ chainId: 1,
15
+ collectionAddress: zeroAddress,
16
+ };
17
+
18
+ it('should fetch active listings currencies data successfully', async () => {
19
+ const { result } = renderHook(() =>
20
+ useCollectionActiveListingsCurrencies(defaultArgs),
21
+ );
22
+
23
+ // Initially loading
24
+ expect(result.current.isLoading).toBe(true);
25
+ expect(result.current.data).toBeUndefined();
26
+
27
+ // Wait for data to be loaded
28
+ await waitFor(() => {
29
+ expect(result.current.isLoading).toBe(false);
30
+ });
31
+
32
+ // Verify the data matches our mock
33
+ expect(result.current.data).toEqual(mockCurrencies);
34
+ expect(result.current.error).toBeNull();
35
+ });
36
+
37
+ it('should handle error states', async () => {
38
+ // Override the handler for this test to return an error
39
+ server.use(
40
+ http.post(
41
+ mockMarketplaceEndpoint('GetCollectionActiveListingsCurrencies'),
42
+ () => {
43
+ return HttpResponse.json(
44
+ {
45
+ error: { message: 'Failed to fetch active listings currencies' },
46
+ },
47
+ { status: 500 },
48
+ );
49
+ },
50
+ ),
51
+ );
52
+
53
+ const { result } = renderHook(() =>
54
+ useCollectionActiveListingsCurrencies(defaultArgs),
55
+ );
56
+
57
+ await waitFor(() => {
58
+ expect(result.current.isError).toBe(true);
59
+ });
60
+
61
+ expect(result.current.error).toBeDefined();
62
+ expect(result.current.data).toBeUndefined();
63
+ });
64
+
65
+ it('should refetch when args change', async () => {
66
+ const { result, rerender } = renderHook(() =>
67
+ useCollectionActiveListingsCurrencies(defaultArgs),
68
+ );
69
+
70
+ // Wait for initial data
71
+ await waitFor(() => {
72
+ expect(result.current.isLoading).toBe(false);
73
+ });
74
+
75
+ // Change args and rerender
76
+ const newArgs = {
77
+ ...defaultArgs,
78
+ collectionAddress:
79
+ '0x1234567890123456789012345678901234567890' as `0x${string}`,
80
+ };
81
+
82
+ rerender(() => useCollectionActiveListingsCurrencies(newArgs));
83
+
84
+ // Wait for new data
85
+ await waitFor(() => {
86
+ expect(result.current.data).toBeDefined();
87
+ });
88
+
89
+ // Verify that the query was refetched with new args
90
+ expect(result.current.data).toBeDefined();
91
+ expect(result.current.isSuccess).toBe(true);
92
+ });
93
+
94
+ it('should handle undefined query params', async () => {
95
+ const argsWithoutQuery: UseCollectionActiveListingsCurrenciesParams = {
96
+ chainId: 1,
97
+ collectionAddress: zeroAddress,
98
+ query: {},
99
+ };
100
+
101
+ const { result } = renderHook(() =>
102
+ useCollectionActiveListingsCurrencies(argsWithoutQuery),
103
+ );
104
+
105
+ await waitFor(() => {
106
+ expect(result.current.isLoading).toBe(false);
107
+ });
108
+
109
+ expect(result.current.data).toBeDefined();
110
+ expect(result.current.error).toBeNull();
111
+ });
112
+ });