@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
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-BoO0V5aJ.js","names":["browserQueryClient: QueryClient | undefined","projectAccessKey: string","jwtAuth?: string","headers: Record<string, string>"],"sources":["../src/react/_internal/api/get-query-client.ts","../src/react/_internal/api/laos-api.ts","../src/react/_internal/api/marketplace-api.ts","../src/react/_internal/api/query-keys.ts","../src/react/_internal/api/services.ts"],"sourcesContent":["import {\n\tdefaultShouldDehydrateQuery,\n\tQueryClient,\n} from '@tanstack/react-query';\nimport { hashFn } from 'wagmi/query';\n\nfunction makeQueryClient() {\n\treturn new QueryClient({\n\t\tdefaultOptions: {\n\t\t\tqueries: {\n\t\t\t\tstaleTime: 60 * 1000,\n\t\t\t\tqueryKeyHashFn: hashFn,\n\t\t\t},\n\t\t\tdehydrate: {\n\t\t\t\tshouldDehydrateQuery: (query) =>\n\t\t\t\t\tdefaultShouldDehydrateQuery(query) ||\n\t\t\t\t\tquery.state.status === 'pending',\n\t\t\t},\n\t\t},\n\t});\n}\n\nlet browserQueryClient: QueryClient | undefined;\n\nexport function getQueryClient() {\n\tif (typeof globalThis.document === 'undefined') {\n\t\treturn makeQueryClient();\n\t}\n\n\tif (!browserQueryClient) browserQueryClient = makeQueryClient();\n\treturn browserQueryClient;\n}\n","import type {\n\tGetTokenBalancesReturn,\n\tGetTokenSuppliesReturn,\n} from '@0xsequence/indexer';\n\nexport type SortOption = {\n\tcolumn: string;\n\torder: 'ASC' | 'DESC';\n};\n\nexport type PaginationOptions = {\n\tsort: SortOption[];\n};\n\nexport type TokenSuppliesParams = {\n\tchainId: string;\n\tcontractAddress: string;\n\tincludeMetadata?: boolean;\n\tpage?: PaginationOptions;\n};\n\nexport type TokenBalancesParams = {\n\tchainId: string;\n\taccountAddress: string;\n\tcontractAddress: string;\n\tincludeMetadata?: boolean;\n\tpage?: PaginationOptions;\n};\n\nexport class LaosAPI {\n\tprivate baseUrl = 'https://extensions.api.laosnetwork.io';\n\n\tconstructor(baseUrl?: string) {\n\t\tif (baseUrl) {\n\t\t\tthis.baseUrl = baseUrl;\n\t\t}\n\t}\n\n\tasync getTokenSupplies({\n\t\tchainId,\n\t\tcontractAddress,\n\t\tincludeMetadata = true,\n\t\tpage = {\n\t\t\tsort: [\n\t\t\t\t{\n\t\t\t\t\tcolumn: 'CREATED_AT',\n\t\t\t\t\torder: 'DESC',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t}: TokenSuppliesParams): Promise<GetTokenSuppliesReturn> {\n\t\tconst response = await fetch(`${this.baseUrl}/token/GetTokenSupplies`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tchainId,\n\t\t\t\tcontractAddress,\n\t\t\t\tincludeMetadata,\n\t\t\t\tpage,\n\t\t\t}),\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`Failed to get token supplies: ${response.statusText}`);\n\t\t}\n\n\t\treturn await response.json();\n\t}\n\n\tasync getTokenBalances({\n\t\tchainId,\n\t\taccountAddress,\n\t\tcontractAddress,\n\t\tincludeMetadata = true,\n\t\tpage = {\n\t\t\tsort: [\n\t\t\t\t{\n\t\t\t\t\tcolumn: 'CREATED_AT',\n\t\t\t\t\torder: 'DESC',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t}: TokenBalancesParams): Promise<GetTokenBalancesReturn> {\n\t\tconst response = await fetch(`${this.baseUrl}/token/GetTokenBalances`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tchainId,\n\t\t\t\taccountAddress,\n\t\t\t\tcontractAddress,\n\t\t\t\tincludeMetadata,\n\t\t\t\tpage,\n\t\t\t}),\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`Failed to get token balances: ${response.statusText}`);\n\t\t}\n\n\t\treturn await response.json();\n\t}\n}\n","import { Marketplace } from './marketplace.gen';\n\nexport class SequenceMarketplace extends Marketplace {\n\tconstructor(\n\t\thostname: string,\n\t\tpublic projectAccessKey: string,\n\t\tpublic jwtAuth?: string,\n\t) {\n\t\tsuper(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);\n\t\tthis.fetch = this._fetch;\n\t}\n\n\t_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {\n\t\tconst headers: Record<string, string> = {};\n\n\t\tconst jwtAuth = this.jwtAuth;\n\t\tconst projectAccessKey = this.projectAccessKey;\n\n\t\tif (jwtAuth && jwtAuth.length > 0) {\n\t\t\theaders.Authorization = `BEARER ${jwtAuth}`;\n\t\t}\n\n\t\tif (projectAccessKey && projectAccessKey.length > 0) {\n\t\t\theaders['X-Access-Key'] = projectAccessKey;\n\t\t}\n\n\t\tconst requestInit = init || {};\n\t\trequestInit.headers = { ...init?.headers, ...headers };\n\n\t\treturn fetch(input, requestInit);\n\t};\n}\n","// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys\nclass CollectableKeys {\n\tstatic all = ['collectable'] as const;\n\tstatic details = [...CollectableKeys.all, 'details'] as const;\n\tstatic lists = [...CollectableKeys.all, 'list'] as const;\n\tstatic floorOrders = [...CollectableKeys.all, 'floorOrders'] as const;\n\tstatic userBalances = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'userBalances',\n\t] as const;\n\tstatic royaltyPercentage = [\n\t\t...CollectableKeys.all,\n\t\t'royaltyPercentage',\n\t] as const;\n\tstatic highestOffers = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'highestOffers',\n\t] as const;\n\tstatic lowestListings = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'lowestListings',\n\t] as const;\n\tstatic offers = [...CollectableKeys.all, 'offers'] as const;\n\tstatic offersCount = [...CollectableKeys.all, 'offersCount'] as const;\n\tstatic listings = [...CollectableKeys.all, 'listings'] as const;\n\tstatic listingsCount = [...CollectableKeys.all, 'listingsCount'] as const;\n\tstatic listPrimarySaleItems = ['listPrimarySaleItems'] as const;\n\tstatic primarySaleItemsCount = ['primarySaleItemsCount'] as const;\n\tstatic filter = [...CollectableKeys.all, 'filter'] as const;\n\tstatic counts = [...CollectableKeys.all, 'counts'] as const;\n\tstatic collectibleActivities = [\n\t\t...CollectableKeys.all,\n\t\t'collectibleActivities',\n\t] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys\nclass CollectionKeys {\n\tstatic all = ['collections'] as const;\n\tstatic list = [...CollectionKeys.all, 'list'] as const;\n\tstatic detail = [...CollectionKeys.all, 'detail'] as const;\n\tstatic collectionActivities = [\n\t\t...CollectionKeys.all,\n\t\t'collectionActivities',\n\t] as const;\n\tstatic collectionItemsOrders = [\n\t\t...CollectionKeys.all,\n\t\t'collectionItemsOrders',\n\t] as const;\n\tstatic collectionItemsOrdersCount = [\n\t\t...CollectionKeys.all,\n\t\t'collectionItemsOrdersCount',\n\t] as const;\n\tstatic getCountOfFilteredOrders = [\n\t\t...CollectionKeys.all,\n\t\t'getCountOfFilteredOrders',\n\t] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys\nclass BalanceQueries {\n\tstatic all = ['balances'] as const;\n\tstatic lists = [...BalanceQueries.all, 'tokenBalances'] as const;\n\tstatic collectionBalanceDetails = [\n\t\t...BalanceQueries.all,\n\t\t'collectionBalanceDetails',\n\t] as const;\n\tstatic inventory = ['inventory'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys\nclass CheckoutKeys {\n\tstatic all = ['checkouts'] as const;\n\tstatic options = [...CheckoutKeys.all, 'options'] as const;\n\tstatic cartItems = [...CheckoutKeys.all, 'cartItems'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys\nclass CurrencyKeys {\n\tstatic all = ['currencies'] as const;\n\tstatic lists = [...CurrencyKeys.all, 'list'] as const;\n\tstatic details = [...CurrencyKeys.all, 'details'] as const;\n\tstatic conversion = [...CurrencyKeys.all, 'conversion'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys\nclass ConfigKeys {\n\tstatic all = ['configs'] as const;\n\tstatic marketplace = [...ConfigKeys.all, 'marketplace'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys\nclass TokenKeys {\n\tstatic all = ['tokens'] as const;\n\tstatic metadata = [...TokenKeys.all, 'metadata'] as const;\n\tstatic supplies = [...TokenKeys.all, 'supplies'] as const;\n\tstatic ranges = [...TokenKeys.all, 'ranges'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys\nclass TokenSuppliesKeys {\n\tstatic all = ['tokenSupplies'] as const;\n\tstatic maps = [...TokenSuppliesKeys.all, 'map'] as const;\n}\nexport const collectableKeys = CollectableKeys;\nexport const collectionKeys = CollectionKeys;\nexport const balanceQueries = BalanceQueries;\nexport const checkoutKeys = CheckoutKeys;\nexport const currencyKeys = CurrencyKeys;\nexport const configKeys = ConfigKeys;\nexport const tokenKeys = TokenKeys;\nexport const tokenSuppliesKeys = TokenSuppliesKeys;\n","import { SequenceAPIClient } from '@0xsequence/api';\nimport { SequenceIndexer } from '@0xsequence/indexer';\nimport { SequenceMetadata } from '@0xsequence/metadata';\nimport { stringTemplate } from '@0xsequence/network';\nimport type { ApiConfig, Env, SdkConfig } from '../../../types/sdk-config';\nimport { getNetwork } from '../../../utils/network';\nimport { BuilderAPI } from './builder-api';\nimport { SequenceMarketplace } from './marketplace-api';\n\nconst SERVICES = {\n\t// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function\n\tsequenceApi: 'https://${prefix}api.sequence.app',\n\t// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function\n\tmetadata: 'https://${prefix}metadata.sequence.app',\n\t// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function\n\tindexer: 'https://${prefix}${network}-indexer.sequence.app',\n\t// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function\n\tmarketplaceApi: 'https://${prefix}marketplace-api.sequence.app',\n\t// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function\n\tbuilderRpcApi: 'https://${prefix}api.sequence.build',\n};\n\ntype ChainNameOrId = string | number;\n\nconst metadataURL = (env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.metadata, { prefix });\n};\n\nconst indexerURL = (chain: ChainNameOrId, env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\tconst network = getNetwork(chain).name;\n\treturn stringTemplate(SERVICES.indexer, { network: network, prefix });\n};\n\nexport const marketplaceApiURL = (env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.marketplaceApi, { prefix });\n};\n\nconst builderRpcApiURL = (env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.builderRpcApi, { prefix });\n};\n\nexport const sequenceApiUrl = (env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.sequenceApi, { prefix });\n};\n\nexport const getBuilderClient = (config: SdkConfig) => {\n\tconst overrides = config._internal?.overrides?.api?.builder;\n\tconst url =\n\t\toverrides?.url || builderRpcApiURL(overrides?.env || 'production');\n\tconst projectAccessKey = overrides?.accessKey || config.projectAccessKey;\n\treturn new BuilderAPI(url, projectAccessKey);\n};\n\nexport const getMetadataClient = (config: SdkConfig) => {\n\tconst overrides = config._internal?.overrides?.api?.metadata;\n\tconst url = overrides?.url || metadataURL(overrides?.env || 'production');\n\tconst projectAccessKey = overrides?.accessKey || config.projectAccessKey;\n\treturn new SequenceMetadata(url, projectAccessKey);\n};\n\nexport const getIndexerClient = (chain: ChainNameOrId, config: SdkConfig) => {\n\tconst overrides = config._internal?.overrides?.api?.indexer;\n\tconst url =\n\t\toverrides?.url || indexerURL(chain, overrides?.env || 'production');\n\tconst projectAccessKey = overrides?.accessKey || config.projectAccessKey;\n\treturn new SequenceIndexer(url, projectAccessKey);\n};\n\nexport const getMarketplaceClient = (config: SdkConfig) => {\n\tconst overrides = config._internal?.overrides?.api?.marketplace;\n\tconst url =\n\t\toverrides?.url || marketplaceApiURL(overrides?.env || 'production');\n\tconst projectAccessKey = overrides?.accessKey || config.projectAccessKey;\n\treturn new SequenceMarketplace(url, projectAccessKey);\n};\n\nexport const getSequenceApiClient = (config: SdkConfig) => {\n\tconst overrides = config._internal?.overrides?.api?.sequenceApi;\n\tconst url = overrides?.url || sequenceApiUrl(overrides?.env || 'production');\n\tconst projectAccessKey = overrides?.accessKey || config.projectAccessKey;\n\treturn new SequenceAPIClient(url, projectAccessKey);\n};\n\nconst getPrefix = (env: ApiConfig['env']) => {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\treturn 'dev-';\n\t\tcase 'production':\n\t\t\treturn '';\n\t\tcase 'next':\n\t\t\treturn 'next-';\n\t}\n};\n"],"mappings":";;;;;;;;;;;AAMA,SAAS,kBAAkB;AAC1B,QAAO,IAAI,YAAY,EACtB,gBAAgB;EACf,SAAS;GACR,WAAW,KAAK;GAChB,gBAAgB;GAChB;EACD,WAAW,EACV,uBAAuB,UACtB,4BAA4B,MAAM,IAClC,MAAM,MAAM,WAAW,WACxB;EACD,EACD,CAAC;;AAGH,IAAIA;AAEJ,SAAgB,iBAAiB;AAChC,KAAI,OAAO,WAAW,aAAa,YAClC,QAAO,iBAAiB;AAGzB,KAAI,CAAC,mBAAoB,sBAAqB,iBAAiB;AAC/D,QAAO;;;;;ACDR,IAAa,UAAb,MAAqB;CACpB,AAAQ,UAAU;CAElB,YAAY,SAAkB;AAC7B,MAAI,QACH,MAAK,UAAU;;CAIjB,MAAM,iBAAiB,EACtB,SACA,iBACA,kBAAkB,MAClB,OAAO,EACN,MAAM,CACL;EACC,QAAQ;EACR,OAAO;EACP,CACD,EACD,IACuD;EACxD,MAAM,WAAW,MAAM,MAAM,GAAG,KAAK,QAAQ,0BAA0B;GACtE,QAAQ;GACR,SAAS,EACR,gBAAgB,oBAChB;GACD,MAAM,KAAK,UAAU;IACpB;IACA;IACA;IACA;IACA,CAAC;GACF,CAAC;AAEF,MAAI,CAAC,SAAS,GACb,OAAM,IAAI,M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a;CACpE,MAAM,mBAAmB,WAAW,aAAa,OAAO;AACxD,QAAO,IAAI,oBAAoB,KAAK,iBAAiB;;AAGtD,MAAa,wBAAwB,WAAsB;CAC1D,MAAM,YAAY,OAAO,WAAW,WAAW,KAAK;CACpD,MAAM,MAAM,WAAW,OAAO,eAAe,WAAW,OAAO,aAAa;CAC5E,MAAM,mBAAmB,WAAW,aAAa,OAAO;AACxD,QAAO,IAAI,kBAAkB,KAAK,iBAAiB;;AAGpD,MAAM,aAAa,QAA0B;AAC5C,SAAQ,KAAR;EACC,KAAK,cACJ,QAAO;EACR,KAAK,aACJ,QAAO;EACR,KAAK,OACJ,QAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"builder-api-BFuZNOaN.js","names":["projectAccessKey?: string","jwtAuth?: string","headers: Record<string, string>"],"sources":["../src/react/_internal/api/builder-api.ts"],"sourcesContent":["import { MarketplaceService } from './builder.gen';\n\nexport class BuilderAPI extends MarketplaceService {\n\tconstructor(\n\t\thostname: string,\n\t\tpublic projectAccessKey?: string,\n\t\tpublic jwtAuth?: string,\n\t) {\n\t\tsuper(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);\n\t\tthis.fetch = this._fetch;\n\t}\n\n\t_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {\n\t\tconst headers: Record<string, string> = {};\n\n\t\tconst jwtAuth = this.jwtAuth;\n\t\tconst projectAccessKey = this.projectAccessKey;\n\n\t\tif (jwtAuth && jwtAuth.length > 0) {\n\t\t\theaders.Authorization = `BEARER ${jwtAuth}`;\n\t\t}\n\n\t\tif (projectAccessKey && projectAccessKey.length > 0) {\n\t\t\theaders['X-Access-Key'] = projectAccessKey;\n\t\t}\n\n\t\tconst requestInit = init || {};\n\t\trequestInit.headers = { ...init?.headers, ...headers };\n\n\t\treturn fetch(input, requestInit);\n\t};\n}\n"],"mappings":";;;AAEA,IAAa,aAAb,cAAgC,mBAAmB;CAClD,YACC,UACA,AAAOA,kBACP,AAAOC,SACN;AACD,QAAM,SAAS,SAAS,IAAI,GAAG,SAAS,MAAM,GAAG,GAAG,GAAG,UAAU,MAAM;EAHhE;EACA;AAGP,OAAK,QAAQ,KAAK;;CAGnB,UAAU,OAAoB,SAA0C;EACvE,MAAMC,UAAkC,EAAE;EAE1C,MAAM,UAAU,KAAK;EACrB,MAAM,mBAAmB,KAAK;AAE9B,MAAI,WAAW,QAAQ,SAAS,EAC/B,SAAQ,gBAAgB,UAAU;AAGnC,MAAI,oBAAoB,iBAAiB,SAAS,EACjD,SAAQ,kBAAkB;EAG3B,MAAM,cAAc,QAAQ,EAAE;AAC9B,cAAY,UAAU;GAAE,GAAG,MAAM;GAAS,GAAG;GAAS;AAEtD,SAAO,MAAM,OAAO,YAAY"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"builder.gen-B9wR2nvF.js","names":["webrpcErrorByCode: { [code: number]: any }","reqHeaders: { [key: string]: string }","code: number"],"sources":["../src/react/_internal/api/builder.gen.ts"],"sourcesContent":["// Relevant parts for lookupMarketplace & common Webrpc utilities\n// sequence-builder v0.1.0 52bd730f3b821fe99051d69ced824442369efe4a\n// --\n// Code generated by webrpc-gen@v0.26.0 with typescript generator. DO NOT EDIT.\n//\n// webrpc-gen -schema=builder.main.ridl -target=typescript -client -out=../../webapp/src/rpc/proto/builder.gen.ts\n\nexport const WebrpcHeader = \"Webrpc\";\nexport const WebrpcHeaderValue =\n \"webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-builder@v0.1.0\";\n\n//\n// Types for lookupMarketplace\n//\n\nexport enum MarketplaceWalletType {\n UNIVERSAL = \"UNIVERSAL\",\n EMBEDDED = \"EMBEDDED\",\n ECOSYSTEM = \"ECOSYSTEM\",\n}\n\nexport enum FilterCondition {\n ENTIRE_KEY = \"ENTIRE_KEY\",\n SPECIFIC_VALUE = \"SPECIFIC_VALUE\",\n}\n\nexport interface LookupMarketplaceArgs {\n projectId?: number;\n domain?: string;\n userAddress?: string;\n}\n\nexport interface LookupMarketplaceReturn {\n marketplace: Marketplace;\n marketCollections: Array<MarketCollection>;\n shopCollections: Array<ShopCollection>;\n}\n\nexport interface Marketplace {\n projectId: number;\n settings: MarketplaceSettings;\n market: MarketplacePage;\n shop: MarketplacePage;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface MarketplaceSettings {\n style: { [key: string]: any };\n publisherId: string;\n title: string;\n socials: MarketplaceSocials;\n faviconUrl: string;\n walletOptions: MarketplaceWallet;\n logoUrl: string;\n fontUrl: string;\n accessKey?: string;\n}\n\nexport interface MarketplacePage {\n enabled: boolean;\n bannerUrl: string;\n ogImage: string;\n private: boolean;\n}\n\nexport interface MarketplaceSocials {\n twitter: string;\n discord: string;\n website: string;\n tiktok: string;\n instagram: string;\n youtube: string;\n}\n\nexport interface MarketplaceWallet {\n walletType: MarketplaceWalletType;\n oidcIssuers: { [key: string]: string };\n connectors: Array<string>;\n includeEIP6963Wallets: boolean;\n ecosystem?: MarketplaceWalletEcosystem;\n embedded?: MarketplaceWalletEmbedded;\n}\n\nexport interface MarketplaceWalletEcosystem {\n walletUrl: string;\n walletAppName: string;\n logoLightUrl?: string;\n logoDarkUrl?: string;\n}\n\nexport interface MarketplaceWalletEmbedded {\n tenantKey: string;\n emailEnabled: boolean;\n providers: Array<OpenIdProvider>;\n}\n\nexport interface OpenIdProvider {\n iss: string;\n aud: Array<string>;\n}\n\nexport interface MarketCollection {\n id: number;\n projectId: number;\n chainId: number;\n itemsAddress: string;\n contractType: string;\n bannerUrl: string;\n feePercentage: number;\n currencyOptions: Array<string>;\n destinationMarketplace: string;\n filterSettings?: CollectionFilterSettings;\n sortOrder?: number;\n private: boolean;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface CollectionFilterSettings {\n filterOrder: Array<string>;\n exclusions: Array<MetadataFilterRule>;\n}\n\nexport interface MetadataFilterRule {\n key: string;\n condition: FilterCondition;\n value?: string;\n}\n\nexport interface ShopCollection {\n id: number;\n projectId: number;\n chainId: number;\n itemsAddress: string;\n saleAddress: string;\n name: string;\n bannerUrl: string;\n tokenIds: Array<string>;\n customTokenIds: Array<string>;\n sortOrder?: number;\n private: boolean;\n createdAt?: string;\n updatedAt?: string;\n}\n\n//\n// Service Interface Definition for MarketplaceService (relevant part)\n//\nexport interface MarketplaceService {\n /**\n * Public Methods\n */\n lookupMarketplace(\n args: LookupMarketplaceArgs,\n headers?: object,\n signal?: AbortSignal\n ): Promise<LookupMarketplaceReturn>;\n}\n\n//\n// Errors (Complete set from original)\n//\n\nexport class WebrpcError extends Error {\n name: string;\n code: number;\n message: string;\n status: number;\n cause?: string;\n\n /** @deprecated Use message instead of msg. Deprecated in webrpc v0.11.0. */\n msg: string;\n\n constructor(\n name: string,\n code: number,\n message: string,\n status: number,\n cause?: string\n ) {\n super(message);\n this.name = name || \"WebrpcError\";\n this.code = typeof code === \"number\" ? code : 0;\n this.message = message || `endpoint error ${this.code}`;\n this.msg = this.message;\n this.status = typeof status === \"number\" ? status : 0;\n this.cause = cause;\n Object.setPrototypeOf(this, WebrpcError.prototype);\n }\n\n static new(payload: any): WebrpcError {\n return new this(\n payload.error,\n payload.code,\n payload.message || payload.msg,\n payload.status,\n payload.cause\n );\n }\n}\n\n// Webrpc errors\n\nexport class WebrpcEndpointError extends WebrpcError {\n constructor(\n name: string = \"WebrpcEndpoint\",\n code: number = 0,\n message: string = `endpoint error`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcEndpointError.prototype);\n }\n}\n\nexport class WebrpcRequestFailedError extends WebrpcError {\n constructor(\n name: string = \"WebrpcRequestFailed\",\n code: number = -1,\n message: string = `request failed`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);\n }\n}\n\nexport class WebrpcBadRouteError extends WebrpcError {\n constructor(\n name: string = \"WebrpcBadRoute\",\n code: number = -2,\n message: string = `bad route`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);\n }\n}\n\nexport class WebrpcBadMethodError extends WebrpcError {\n constructor(\n name: string = \"WebrpcBadMethod\",\n code: number = -3,\n message: string = `bad method`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);\n }\n}\n\nexport class WebrpcBadRequestError extends WebrpcError {\n constructor(\n name: string = \"WebrpcBadRequest\",\n code: number = -4,\n message: string = `bad request`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);\n }\n}\n\nexport class WebrpcBadResponseError extends WebrpcError {\n constructor(\n name: string = \"WebrpcBadResponse\",\n code: number = -5,\n message: string = `bad response`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);\n }\n}\n\nexport class WebrpcServerPanicError extends WebrpcError {\n constructor(\n name: string = \"WebrpcServerPanic\",\n code: number = -6,\n message: string = `server panic`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);\n }\n}\n\nexport class WebrpcInternalErrorError extends WebrpcError {\n // Name as per original\n constructor(\n name: string = \"WebrpcInternalError\",\n code: number = -7,\n message: string = `internal error`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);\n }\n}\n\nexport class WebrpcClientDisconnectedError extends WebrpcError {\n constructor(\n name: string = \"WebrpcClientDisconnected\",\n code: number = -8,\n message: string = `client disconnected`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype);\n }\n}\n\nexport class WebrpcStreamLostError extends WebrpcError {\n constructor(\n name: string = \"WebrpcStreamLost\",\n code: number = -9,\n message: string = `stream lost`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);\n }\n}\n\nexport class WebrpcStreamFinishedError extends WebrpcError {\n constructor(\n name: string = \"WebrpcStreamFinished\",\n code: number = -10,\n message: string = `stream finished`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);\n }\n}\n\n// Schema errors\n\nexport class UnauthorizedError extends WebrpcError {\n constructor(\n name: string = \"Unauthorized\",\n code: number = 1000,\n message: string = `Unauthorized access`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n\nexport class PermissionDeniedError extends WebrpcError {\n constructor(\n name: string = \"PermissionDenied\",\n code: number = 1001,\n message: string = `Permission denied`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, PermissionDeniedError.prototype);\n }\n}\n\nexport class SessionExpiredError extends WebrpcError {\n constructor(\n name: string = \"SessionExpired\",\n code: number = 1002,\n message: string = `Session expired`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, SessionExpiredError.prototype);\n }\n}\n\nexport class MethodNotFoundError extends WebrpcError {\n constructor(\n name: string = \"MethodNotFound\",\n code: number = 1003,\n message: string = `Method not found`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, MethodNotFoundError.prototype);\n }\n}\n\nexport class RequestConflictError extends WebrpcError {\n constructor(\n name: string = \"RequestConflict\",\n code: number = 1004,\n message: string = `Conflict with target resource`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, RequestConflictError.prototype);\n }\n}\n\nexport class ServiceDisabledError extends WebrpcError {\n constructor(\n name: string = \"ServiceDisabled\",\n code: number = 1005,\n message: string = `Service disabled`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, ServiceDisabledError.prototype);\n }\n}\n\nexport class TimeoutError extends WebrpcError {\n constructor(\n name: string = \"Timeout\",\n code: number = 2000,\n message: string = `Request timed out`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, TimeoutError.prototype);\n }\n}\n\nexport class InvalidArgumentError extends WebrpcError {\n constructor(\n name: string = \"InvalidArgument\",\n code: number = 2001,\n message: string = `Invalid argument`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, InvalidArgumentError.prototype);\n }\n}\n\nexport class NotFoundError extends WebrpcError {\n constructor(\n name: string = \"NotFound\",\n code: number = 3000,\n message: string = `Resource not found`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n\nexport class UserNotFoundError extends WebrpcError {\n constructor(\n name: string = \"UserNotFound\",\n code: number = 3001,\n message: string = `User not found`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, UserNotFoundError.prototype);\n }\n}\n\nexport class ProjectNotFoundError extends WebrpcError {\n constructor(\n name: string = \"ProjectNotFound\",\n code: number = 3002,\n message: string = `Project not found`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, ProjectNotFoundError.prototype);\n }\n}\n\nexport class InvalidTierError extends WebrpcError {\n constructor(\n name: string = \"InvalidTier\",\n code: number = 3003,\n message: string = `Invalid subscription tier`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, InvalidTierError.prototype);\n }\n}\n\nexport class EmailTemplateExistsError extends WebrpcError {\n constructor(\n name: string = \"EmailTemplateExists\",\n code: number = 3004,\n message: string = `Email Template exists`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, EmailTemplateExistsError.prototype);\n }\n}\n\nexport class SubscriptionLimitError extends WebrpcError {\n constructor(\n name: string = \"SubscriptionLimit\",\n code: number = 3005,\n message: string = `Subscription limit reached`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, SubscriptionLimitError.prototype);\n }\n}\n\nexport class FeatureNotIncludedError extends WebrpcError {\n constructor(\n name: string = \"FeatureNotIncluded\",\n code: number = 3006,\n message: string = `Feature not included`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, FeatureNotIncludedError.prototype);\n }\n}\n\nexport class InvalidNetworkError extends WebrpcError {\n constructor(\n name: string = \"InvalidNetwork\",\n code: number = 3007,\n message: string = `Invalid network`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, InvalidNetworkError.prototype);\n }\n}\n\nexport class InvitationExpiredError extends WebrpcError {\n constructor(\n name: string = \"InvitationExpired\",\n code: number = 4000,\n message: string = `Invitation code is expired`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, InvitationExpiredError.prototype);\n }\n}\n\nexport class AlreadyCollaboratorError extends WebrpcError {\n constructor(\n name: string = \"AlreadyCollaborator\",\n code: number = 4001,\n message: string = `Already a collaborator`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, AlreadyCollaboratorError.prototype);\n }\n}\n\nexport enum errors {\n WebrpcEndpoint = \"WebrpcEndpoint\",\n WebrpcRequestFailed = \"WebrpcRequestFailed\",\n WebrpcBadRoute = \"WebrpcBadRoute\",\n WebrpcBadMethod = \"WebrpcBadMethod\",\n WebrpcBadRequest = \"WebrpcBadRequest\",\n WebrpcBadResponse = \"WebrpcBadResponse\",\n WebrpcServerPanic = \"WebrpcServerPanic\",\n WebrpcInternalError = \"WebrpcInternalError\",\n WebrpcClientDisconnected = \"WebrpcClientDisconnected\",\n WebrpcStreamLost = \"WebrpcStreamLost\",\n WebrpcStreamFinished = \"WebrpcStreamFinished\",\n Unauthorized = \"Unauthorized\",\n PermissionDenied = \"PermissionDenied\",\n SessionExpired = \"SessionExpired\",\n MethodNotFound = \"MethodNotFound\",\n RequestConflict = \"RequestConflict\",\n ServiceDisabled = \"ServiceDisabled\",\n Timeout = \"Timeout\",\n InvalidArgument = \"InvalidArgument\",\n NotFound = \"NotFound\",\n UserNotFound = \"UserNotFound\",\n ProjectNotFound = \"ProjectNotFound\",\n InvalidTier = \"InvalidTier\",\n EmailTemplateExists = \"EmailTemplateExists\",\n SubscriptionLimit = \"SubscriptionLimit\",\n FeatureNotIncluded = \"FeatureNotIncluded\",\n InvalidNetwork = \"InvalidNetwork\",\n InvitationExpired = \"InvitationExpired\",\n AlreadyCollaborator = \"AlreadyCollaborator\",\n}\n\nexport enum WebrpcErrorCodes {\n WebrpcEndpoint = 0,\n WebrpcRequestFailed = -1,\n WebrpcBadRoute = -2,\n WebrpcBadMethod = -3,\n WebrpcBadRequest = -4,\n WebrpcBadResponse = -5,\n WebrpcServerPanic = -6,\n WebrpcInternalError = -7,\n WebrpcClientDisconnected = -8,\n WebrpcStreamLost = -9,\n WebrpcStreamFinished = -10,\n Unauthorized = 1000,\n PermissionDenied = 1001,\n SessionExpired = 1002,\n MethodNotFound = 1003,\n RequestConflict = 1004,\n ServiceDisabled = 1005,\n Timeout = 2000,\n InvalidArgument = 2001,\n NotFound = 3000,\n UserNotFound = 3001,\n ProjectNotFound = 3002,\n InvalidTier = 3003,\n EmailTemplateExists = 3004,\n SubscriptionLimit = 3005,\n FeatureNotIncluded = 3006,\n InvalidNetwork = 3007,\n InvitationExpired = 4000,\n AlreadyCollaborator = 4001,\n}\n\nexport const webrpcErrorByCode: { [code: number]: any } = {\n [0]: WebrpcEndpointError,\n [-1]: WebrpcRequestFailedError,\n [-2]: WebrpcBadRouteError,\n [-3]: WebrpcBadMethodError,\n [-4]: WebrpcBadRequestError,\n [-5]: WebrpcBadResponseError,\n [-6]: WebrpcServerPanicError,\n [-7]: WebrpcInternalErrorError, // Name as per original\n [-8]: WebrpcClientDisconnectedError,\n [-9]: WebrpcStreamLostError,\n [-10]: WebrpcStreamFinishedError,\n [1000]: UnauthorizedError,\n [1001]: PermissionDeniedError,\n [1002]: SessionExpiredError,\n [1003]: MethodNotFoundError,\n [1004]: RequestConflictError,\n [1005]: ServiceDisabledError,\n [2000]: TimeoutError,\n [2001]: InvalidArgumentError,\n [3000]: NotFoundError,\n [3001]: UserNotFoundError,\n [3002]: ProjectNotFoundError,\n [3003]: InvalidTierError,\n [3004]: EmailTemplateExistsError,\n [3005]: SubscriptionLimitError,\n [3006]: FeatureNotIncludedError,\n [3007]: InvalidNetworkError,\n [4000]: InvitationExpiredError,\n [4001]: AlreadyCollaboratorError,\n};\n\n//\n// Client Implementation for MarketplaceService (relevant part)\n//\nexport type Fetch = (\n input: RequestInfo,\n init?: RequestInit\n) => Promise<Response>;\n\nexport class MarketplaceService {\n protected hostname: string;\n protected fetch: Fetch;\n protected path = \"/rpc/MarketplaceService/\";\n\n constructor(hostname: string, fetch: Fetch) {\n this.hostname = hostname.replace(/\\/*$/, \"\");\n this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init);\n }\n\n private url(name: string): string {\n return this.hostname + this.path + name;\n }\n\n lookupMarketplace = (\n args: LookupMarketplaceArgs,\n headers?: object,\n signal?: AbortSignal\n ): Promise<LookupMarketplaceReturn> => {\n return this.fetch(\n this.url(\"LookupMarketplace\"),\n createHTTPRequest(args, headers, signal)\n ).then(\n (res) => {\n return buildResponse(res).then((_data) => {\n return {\n marketplace: <Marketplace>_data.marketplace,\n marketCollections: <Array<MarketCollection>>_data.marketCollections,\n shopCollections: <Array<ShopCollection>>_data.shopCollections,\n };\n });\n },\n (error) => {\n throw WebrpcRequestFailedError.new({\n cause: `lookupMarketplace(): ${error.message || \"\"}`,\n });\n }\n );\n };\n}\n\n//\n// Helper Functions\n//\nconst createHTTPRequest = (\n body: object = {},\n headers: object = {},\n signal: AbortSignal | null = null\n): object => {\n const reqHeaders: { [key: string]: string } = {\n ...headers,\n \"Content-Type\": \"application/json\",\n };\n reqHeaders[WebrpcHeader] = WebrpcHeaderValue;\n\n return {\n method: \"POST\",\n headers: reqHeaders,\n body: JSON.stringify(body || {}),\n signal,\n };\n};\n\nconst buildResponse = (res: Response): Promise<any> => {\n return res.text().then((text) => {\n let data;\n try {\n data = JSON.parse(text);\n } catch (error) {\n let message = \"\";\n if (error instanceof Error) {\n message = error.message;\n }\n throw WebrpcBadResponseError.new({\n status: res.status,\n cause: `JSON.parse(): ${message}: response text: ${text}`,\n });\n }\n if (!res.ok) {\n const code: number = typeof data.code === \"number\" ? data.code : 0;\n throw (webrpcErrorByCode[code] || WebrpcError).new(data);\n }\n return data;\n });\n};\n"],"mappings":";AAOA,MAAa,eAAe;AAC5B,MAAa,oBACX;AAMF,IAAY,0EAAL;AACL;AACA;AACA;;;AAGF,IAAY,8DAAL;AACL;AACA;;;AA6IF,IAAa,cAAb,MAAa,oBAAoB,MAAM;CACrC;CACA;CACA;CACA;CACA;;CAGA;CAEA,YACE,MACA,MACA,SACA,QACA,OACA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO,QAAQ;AACpB,OAAK,OAAO,OAAO,SAAS,WAAW,OAAO;AAC9C,OAAK,UAAU,WAAW,kBAAkB,KAAK;AACjD,OAAK,MAAM,KAAK;AAChB,OAAK,SAAS,OAAO,WAAW,WAAW,SAAS;AACpD,OAAK,QAAQ;AACb,SAAO,eAAe,MAAM,YAAY,UAAU;;CAGpD,OAAO,IAAI,SAA2B;AACpC,SAAO,IAAI,KACT,QAAQ,OACR,QAAQ,MACR,QAAQ,WAAW,QAAQ,KAC3B,QAAQ,QACR,QAAQ,MACT;;;AAML,IAAa,sBAAb,MAAa,4BAA4B,YAAY;CACnD,YACE,OAAe,kBACf,OAAe,GACf,UAAkB,kBAClB,SAA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,CAAC,MAAM,UAAU;AACxC,WAAO;KACL,aAA0B,MAAM;KAChC,mBAA4C,MAAM;KAClD,iBAAwC,MAAM;KAC/C;KACD;MAEH,UAAU;AACT,SAAM,yBAAyB,IAAI,EACjC,OAAO,wBAAwB,MAAM,WAAW,MACjD,CAAC;IAEL;;;AAOL,MAAM,qBACJ,OAAe,EAAE,EACjB,UAAkB,EAAE,EACpB,SAA6B,SAClB;CACX,MAAMC,aAAwC;EAC5C,GAAG;EACH,gBAAgB;EACjB;AACD,YAAW,gBAAgB;AAE3B,QAAO;EACL,QAAQ;EACR,SAAS;EACT,MAAM,KAAK,UAAU,QAAQ,EAAE,CAAC;EAChC;EACD;;AAGH,MAAM,iBAAiB,QAAgC;AACrD,QAAO,IAAI,MAAM,CAAC,MAAM,SAAS;EAC/B,IAAI;AACJ,MAAI;AACF,UAAO,KAAK,MAAM,KAAK;WAChB,OAAO;GACd,IAAI,UAAU;AACd,OAAI,iBAAiB,MACnB,WAAU,MAAM;AAElB,SAAM,uBAAuB,IAAI;IAC/B,QAAQ,IAAI;IACZ,OAAO,iBAAiB,QAAQ,mBAAmB;IACpD,CAAC;;AAEJ,MAAI,CAAC,IAAI,IAAI;GACX,MAAMC,OAAe,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;AACjE,UAAO,kBAAkB,SAAS,aAAa,IAAI,KAAK;;AAE1D,SAAO;GACP"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"collectibles-C_H8jMGH.js","names":["apiArgs: GetTokenMetadataArgs","apiArgs: GetCountOfFilteredCollectiblesArgs","apiArgs","apiArgs: GetCountOfAllCollectiblesArgs","pageParams: Page | undefined","apiArgs: ListCollectibleActivitiesArgs","apiArgs: ListCollectiblesArgs","pageParams: Page","apiArgs: ListCollectiblesArgs"],"sources":["../src/react/queries/collectibles/balanceOfCollectible.ts","../src/react/queries/collectibles/collectible.ts","../src/react/queries/collectibles/countOfCollectables.ts","../src/react/queries/collectibles/listCollectibleActivities.ts","../src/react/queries/collectibles/listCollectibles.ts","../src/react/queries/collectibles/listCollectiblesPaginated.ts"],"sourcesContent":["import { queryOptions, skipToken } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { UseQueryParameters } from 'wagmi/query';\nimport type { SdkConfig } from '../../../types';\nimport { collectableKeys, getIndexerClient, LaosAPI } from '../../_internal';\n\nexport type UseBalanceOfCollectibleArgs = {\n\tcollectionAddress: Address;\n\tcollectableId: string;\n\tuserAddress: Address | undefined;\n\tchainId: number;\n\tisLaos721?: boolean;\n\tincludeMetadata?: boolean;\n\tquery?: UseQueryParameters;\n};\n\n/**\n * Fetches the balance of a specific collectible for a user\n *\n * @param args - Arguments for the API call\n * @param config - SDK configuration\n * @returns The balance data\n */\nexport async function fetchBalanceOfCollectible(\n\targs: Omit<UseBalanceOfCollectibleArgs, 'userAddress'> & {\n\t\tuserAddress: Address;\n\t},\n\tconfig: SdkConfig,\n) {\n\tif (args.isLaos721) {\n\t\tconst laosApi = new LaosAPI();\n\t\tconst response = await laosApi.getTokenBalances({\n\t\t\tchainId: args.chainId.toString(),\n\t\t\tcontractAddress: args.collectionAddress,\n\t\t\taccountAddress: args.userAddress,\n\t\t\tincludeMetadata: true,\n\t\t});\n\n\t\treturn response.balances[0] || null;\n\t}\n\n\tconst indexerClient = getIndexerClient(args.chainId, config);\n\treturn indexerClient\n\t\t.getTokenBalances({\n\t\t\taccountAddress: args.userAddress,\n\t\t\tcontractAddress: args.collectionAddress,\n\t\t\ttokenID: args.collectableId,\n\t\t\tincludeMetadata: args.includeMetadata ?? false,\n\t\t\tmetadataOptions: {\n\t\t\t\tverifiedOnly: true,\n\t\t\t\tincludeContracts: [args.collectionAddress],\n\t\t\t},\n\t\t})\n\t\t.then((res) => res.balances[0] || null);\n}\n\nexport function getBalanceOfCollectibleQueryKey(\n\targs: UseBalanceOfCollectibleArgs,\n) {\n\tconst apiArgs = {\n\t\tchainId: args.chainId,\n\t\taccountAddress: args.userAddress,\n\t\tcontractAddress: args.collectionAddress,\n\t\ttokenID: args.collectableId,\n\t\tincludeMetadata: args.includeMetadata,\n\t\tmetadataOptions: args.userAddress\n\t\t\t? {\n\t\t\t\t\tverifiedOnly: true,\n\t\t\t\t\tincludeContracts: [args.collectionAddress],\n\t\t\t\t}\n\t\t\t: undefined,\n\t\tisLaos721: args.isLaos721,\n\t};\n\n\treturn [...collectableKeys.userBalances, apiArgs] as const;\n}\n\n/**\n * Creates a tanstack query options object for the balance query\n *\n * @param args - The query arguments\n * @param config - SDK configuration\n * @returns Query options configuration\n */\nexport function balanceOfCollectibleOptions(\n\targs: UseBalanceOfCollectibleArgs,\n\tconfig: SdkConfig,\n) {\n\tconst enabled = !!args.userAddress && (args.query?.enabled ?? true);\n\treturn queryOptions({\n\t\tqueryKey: getBalanceOfCollectibleQueryKey(args),\n\t\tqueryFn: enabled\n\t\t\t? () =>\n\t\t\t\t\tfetchBalanceOfCollectible(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...args,\n\t\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: this is guaranteed by the userAddress check above\n\t\t\t\t\t\t\tuserAddress: args.userAddress!,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t)\n\t\t\t: skipToken,\n\t});\n}\n","import type { GetTokenMetadataArgs } from '@0xsequence/metadata';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMetadataClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport { collectableKeys } from '../../_internal/api/query-keys';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCollectibleParams\n\textends Omit<\n\t\tGetTokenMetadataArgs,\n\t\t'chainID' | 'contractAddress' | 'tokenIDs'\n\t> {\n\tchainId: number;\n\tcollectionAddress: string;\n\tcollectibleId: string;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collectible metadata from the metadata API\n */\nexport async function fetchCollectible(params: FetchCollectibleParams) {\n\tconst { collectionAddress, collectibleId, chainId, config } = params;\n\n\tconst metadataClient = getMetadataClient(config);\n\n\tconst apiArgs: GetTokenMetadataArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainID: String(chainId),\n\t\ttokenIDs: [collectibleId],\n\t};\n\n\tconst result = await metadataClient.getTokenMetadata(apiArgs);\n\treturn result.tokenMetadata[0];\n}\n\nexport type CollectibleQueryOptions = ValuesOptional<FetchCollectibleParams> & {\n\tquery?: StandardQueryOptions;\n};\n\nexport function getCollectibleQueryKey(params: CollectibleQueryOptions) {\n\tconst apiArgs = {\n\t\tchainID: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\t// biome-ignore lint/style/noNonNullAssertion: Dont need to validate here\n\t\ttokenIDs: [params.collectibleId!],\n\t} satisfies QueryKeyArgs<GetTokenMetadataArgs>;\n\n\treturn [...collectableKeys.details, apiArgs] as const;\n}\n\nexport function collectibleQueryOptions(params: CollectibleQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.collectibleId &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectibleQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollectible({\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\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectibleId: params.collectibleId!,\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 { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMarketplaceClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type {\n\tCollectiblesFilter,\n\tGetCountOfAllCollectiblesArgs,\n\tGetCountOfFilteredCollectiblesArgs,\n\tOrderSide,\n} from '../../_internal/api/marketplace.gen';\nimport { collectableKeys } from '../../_internal/api/query-keys';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCountOfCollectablesParams {\n\tchainId: number;\n\tcollectionAddress: string;\n\tconfig: SdkConfig;\n\tfilter?: CollectiblesFilter;\n\tside?: OrderSide;\n}\n\n/**\n * Fetches count of collectibles from the marketplace API\n */\nexport async function fetchCountOfCollectables(\n\tparams: FetchCountOfCollectablesParams,\n) {\n\tconst { collectionAddress, chainId, config, filter, side } = params;\n\n\tconst client = getMarketplaceClient(config);\n\n\tif (filter && side) {\n\t\tconst apiArgs: GetCountOfFilteredCollectiblesArgs = {\n\t\t\tcontractAddress: collectionAddress,\n\t\t\tchainId: String(chainId),\n\t\t\tfilter,\n\t\t\tside,\n\t\t};\n\n\t\tconst result = await client.getCountOfFilteredCollectibles(apiArgs);\n\t\treturn result.count;\n\t}\n\n\tconst apiArgs: GetCountOfAllCollectiblesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t};\n\n\tconst result = await client.getCountOfAllCollectibles(apiArgs);\n\treturn result.count;\n}\n\nexport type CountOfCollectablesQueryOptions =\n\tValuesOptional<FetchCountOfCollectablesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCountOfCollectablesQueryKey(\n\tparams: CountOfCollectablesQueryOptions,\n) {\n\tif (params.filter && params.side) {\n\t\tconst apiArgs = {\n\t\t\tchainId: String(params.chainId),\n\t\t\tcontractAddress: params.collectionAddress,\n\t\t\tfilter: params.filter,\n\t\t\tside: params.side,\n\t\t} satisfies QueryKeyArgs<GetCountOfFilteredCollectiblesArgs>;\n\n\t\treturn [...collectableKeys.counts, apiArgs] as const;\n\t}\n\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t} satisfies QueryKeyArgs<GetCountOfAllCollectiblesArgs>;\n\n\treturn [...collectableKeys.counts, apiArgs] as const;\n}\n\nexport function countOfCollectablesQueryOptions(\n\tparams: CountOfCollectablesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCountOfCollectablesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCountOfCollectables({\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\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\tfilter: params.filter,\n\t\t\t\tside: params.side,\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 { Page, SdkConfig } from '../../../types';\nimport type {\n\tListCollectibleActivitiesArgs,\n\tListCollectibleActivitiesReturn,\n\tQueryKeyArgs,\n\tSortBy,\n\tValuesOptional,\n} from '../../_internal';\nimport { collectableKeys, getMarketplaceClient } from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchListCollectibleActivitiesParams\n\textends Omit<\n\t\tListCollectibleActivitiesArgs,\n\t\t'chainId' | 'contractAddress' | 'page'\n\t> {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tpage?: number;\n\tpageSize?: number;\n\tsort?: SortBy[];\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collectible activities from the Marketplace API\n */\nexport async function fetchListCollectibleActivities(\n\tparams: FetchListCollectibleActivitiesParams,\n): Promise<ListCollectibleActivitiesReturn> {\n\tconst {\n\t\tcollectionAddress,\n\t\tchainId,\n\t\tconfig,\n\t\tpage,\n\t\tpageSize,\n\t\tsort,\n\t\t...additionalApiParams\n\t} = params;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst pageParams: Page | undefined =\n\t\tpage || pageSize || sort\n\t\t\t? {\n\t\t\t\t\tpage: page ?? 1,\n\t\t\t\t\tpageSize: pageSize ?? 10,\n\t\t\t\t\tsort,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst apiArgs: ListCollectibleActivitiesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\tpage: pageParams,\n\t\t...additionalApiParams,\n\t};\n\n\treturn await marketplaceClient.listCollectibleActivities(apiArgs);\n}\n\nexport type ListCollectibleActivitiesQueryOptions =\n\tValuesOptional<FetchListCollectibleActivitiesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListCollectibleActivitiesQueryKey(\n\tparams: ListCollectibleActivitiesQueryOptions,\n) {\n\t// TODO: Do we actually want to do the page like this?\n\tconst page =\n\t\tparams.page || params.pageSize || params.sort\n\t\t\t? {\n\t\t\t\t\tpage: params.page ?? 1,\n\t\t\t\t\tpageSize: params.pageSize ?? 10,\n\t\t\t\t\tsort: params.sort,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\ttokenId: params.tokenId,\n\t\tpage: page,\n\t} satisfies QueryKeyArgs<ListCollectibleActivitiesArgs>;\n\n\treturn [...collectableKeys.collectibleActivities, apiArgs] as const;\n}\n\nexport function listCollectibleActivitiesQueryOptions(\n\tparams: ListCollectibleActivitiesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.tokenId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListCollectibleActivitiesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchListCollectibleActivities({\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\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\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\ttokenId: params.tokenId!,\n\t\t\t\tpage: params.page,\n\t\t\t\tpageSize: params.pageSize,\n\t\t\t\tsort: params.sort,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { infiniteQueryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { Page, SdkConfig } from '../../../types';\nimport type { CardType } from '../../../types/types';\nimport { compareAddress } from '../../../utils';\nimport type {\n\tListCollectiblesArgs,\n\tListCollectiblesReturn,\n\tQueryKeyArgs,\n\tValuesOptional,\n} from '../../_internal';\nimport {\n\ttype CollectibleOrder,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n\tMetadataStatus,\n\tOrderSide,\n} from '../../_internal';\nimport type { StandardInfiniteQueryOptions } from '../../types/query';\nimport { fetchMarketplaceConfig } from '../market/marketplaceConfig';\nimport {\n\tfetchBalances,\n\ttype UseListBalancesArgs,\n} from '../tokens/listBalances';\n\nexport interface FetchListCollectiblesParams\n\textends Omit<ListCollectiblesArgs, 'chainId' | 'contractAddress'> {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tisLaos721?: boolean;\n\tcardType?: CardType;\n\tconfig: SdkConfig;\n\tenabled?: boolean;\n}\n\n/**\n * Fetches a list of collectibles with pagination support from the Marketplace API\n */\nexport async function fetchListCollectibles(\n\tparams: FetchListCollectiblesParams,\n\tpage: Page,\n): Promise<ListCollectiblesReturn> {\n\tconst { collectionAddress, chainId, config, ...additionalApiParams } = params;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\tconst marketplaceConfig = await fetchMarketplaceConfig({ config });\n\tconst isMarketCollection = marketplaceConfig?.market.collections.some(\n\t\t(collection) => compareAddress(collection.itemsAddress, collectionAddress),\n\t);\n\n\t// If it's not a market collection, return an empty list. those collections are not compatible with the ListCollectibles endpoint.\n\tif (params.enabled === false || !isMarketCollection) {\n\t\treturn {\n\t\t\tcollectibles: [],\n\t\t\tpage: {\n\t\t\t\tpage: 1,\n\t\t\t\tpageSize: 30,\n\t\t\t\tmore: false,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst apiArgs: ListCollectiblesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\tpage: page,\n\t\t...additionalApiParams,\n\t};\n\n\tif (params.isLaos721 && params.side === OrderSide.listing) {\n\t\ttry {\n\t\t\tconst fetchBalancesArgs = {\n\t\t\t\tchainId: params.chainId,\n\t\t\t\taccountAddress: params.filter?.inAccounts?.[0] as Address,\n\t\t\t\tcontractAddress: params.collectionAddress,\n\t\t\t\tpage: page,\n\t\t\t\tincludeMetadata: true,\n\t\t\t\tisLaos721: true,\n\t\t\t} satisfies UseListBalancesArgs;\n\n\t\t\tconst balances = await fetchBalances(fetchBalancesArgs, config, page);\n\t\t\tconst collectibles: CollectibleOrder[] = balances.balances.map(\n\t\t\t\t(balance) => {\n\t\t\t\t\tif (!balance.tokenMetadata)\n\t\t\t\t\t\tthrow new Error('Token metadata not found');\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\ttokenId: balance.tokenID ?? '',\n\t\t\t\t\t\t\tattributes: balance.tokenMetadata.attributes,\n\t\t\t\t\t\t\timage: balance.tokenMetadata.image,\n\t\t\t\t\t\t\tname: balance.tokenMetadata.name,\n\t\t\t\t\t\t\tdescription: balance.tokenMetadata.description,\n\t\t\t\t\t\t\tvideo: balance.tokenMetadata.video,\n\t\t\t\t\t\t\taudio: balance.tokenMetadata.audio,\n\t\t\t\t\t\t\tstatus: MetadataStatus.AVAILABLE,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcollectibles: collectibles,\n\t\t\t\t//@ts-expect-error\n\t\t\t\tpage: balances.page,\n\t\t\t};\n\t\t} catch (error) {\n\t\t\t// If the request fails, ignore the error and return the collectibles from our indexer\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n\n\treturn await marketplaceClient.listCollectibles(apiArgs);\n}\n\nexport type ListCollectiblesQueryOptions =\n\tValuesOptional<FetchListCollectiblesParams> & {\n\t\tquery?: StandardInfiniteQueryOptions;\n\t};\n\nexport function getListCollectiblesQueryKey(\n\tparams: ListCollectiblesQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\tside: params.side,\n\t\tfilter: params.filter,\n\t} satisfies QueryKeyArgs<Omit<ListCollectiblesArgs, 'page'>>;\n\n\treturn [...collectableKeys.lists, apiArgs] as const;\n}\n\nexport function listCollectiblesQueryOptions(\n\tparams: ListCollectiblesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.side &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn infiniteQueryOptions({\n\t\tqueryKey: getListCollectiblesQueryKey(params),\n\t\tqueryFn: async ({ pageParam }) => {\n\t\t\treturn fetchListCollectibles(\n\t\t\t\t{\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\tchainId: params.chainId!,\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\tconfig: params.config!,\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\tside: params.side!,\n\t\t\t\t\tfilter: params.filter,\n\t\t\t\t\tisLaos721: params.isLaos721,\n\t\t\t\t\tcardType: params.cardType,\n\t\t\t\t},\n\t\t\t\tpageParam,\n\t\t\t);\n\t\t},\n\t\tinitialPageParam: { page: 1, pageSize: 30 } as Page,\n\t\tgetNextPageParam: (lastPage) =>\n\t\t\tlastPage.page?.more ? lastPage.page : undefined,\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 { Page, SdkConfig } from '../../../types';\nimport type {\n\tListCollectiblesArgs,\n\tListCollectiblesReturn,\n\tQueryKeyArgs,\n\tValuesOptional,\n} from '../../_internal';\nimport { collectableKeys, getMarketplaceClient } from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchListCollectiblesPaginatedParams\n\textends Omit<ListCollectiblesArgs, 'chainId' | 'contractAddress' | 'page'> {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tpage?: number;\n\tpageSize?: number;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches a list of collectibles with pagination support from the Marketplace API\n */\nexport async function fetchListCollectiblesPaginated(\n\tparams: FetchListCollectiblesPaginatedParams,\n): Promise<ListCollectiblesReturn> {\n\tconst {\n\t\tcollectionAddress,\n\t\tchainId,\n\t\tconfig,\n\t\tpage = 1,\n\t\tpageSize = 30,\n\t\t...additionalApiParams\n\t} = params;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst pageParams: Page = {\n\t\tpage,\n\t\tpageSize,\n\t};\n\n\tconst apiArgs: ListCollectiblesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\tpage: pageParams,\n\t\t...additionalApiParams,\n\t};\n\n\treturn await marketplaceClient.listCollectibles(apiArgs);\n}\n\nexport type ListCollectiblesPaginatedQueryOptions =\n\tValuesOptional<FetchListCollectiblesPaginatedParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListCollectiblesPaginatedQueryKey(\n\tparams: ListCollectiblesPaginatedQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\tside: params.side,\n\t\tfilter: params.filter,\n\t\tpage: params.page\n\t\t\t? { page: params.page, pageSize: params.pageSize ?? 30 }\n\t\t\t: undefined,\n\t} satisfies QueryKeyArgs<ListCollectiblesArgs>;\n\n\treturn [...collectableKeys.lists, 'paginated', apiArgs] as const;\n}\n\nexport function listCollectiblesPaginatedQueryOptions(\n\tparams: ListCollectiblesPaginatedQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.side &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListCollectiblesPaginatedQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchListCollectiblesPaginated({\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\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\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tside: params.side!,\n\t\t\t\tfilter: params.filter,\n\t\t\t\tpage: params.page,\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,MAAM,OAAO;GAAM,UAAU,OAAO,YAAY;GAAI,GACtD;EACH;AAED,QAAO;EAAC,GAAG,gBAAgB;EAAO;EAAa;EAAQ;;AAGxD,SAAgB,sCACf,QACC;CACD,MAAM,UAAU,QACf,OAAO,qBACN,OAAO,WACP,OAAO,QACP,OAAO,WACN,OAAO,OAAO,WAAW,MAC3B;AAED,QAAO,aAAa;EACnB,UAAU,qCAAqC,OAAO;EACtD,eACC,+BAA+B;GAE9B,SAAS,OAAO;GAEhB,mBAAmB,OAAO;GAE1B,QAAQ,OAAO;GAEf,MAAM,OAAO;GACb,QAAQ,OAAO;GACf,MAAM,OAAO;GACb,UAAU,OAAO;GACjB,CAAC;EACH,GAAG,OAAO;EACV;EACA,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"collections-CKummc-R.js","names":["apiArgs: GetCollectionDetailArgs","pageParams: Page | undefined","apiArgs: ListCollectionActivitiesArgs"],"sources":["../src/react/queries/collections/collection.ts","../src/react/queries/collections/collectionBalanceDetails.ts","../src/react/queries/collections/collectionDetails.ts","../src/react/queries/collections/listCollectionActivities.ts","../src/react/queries/collections/listCollections.ts"],"sourcesContent":["import type { GetContractInfoArgs } from '@0xsequence/metadata';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMetadataClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport { collectionKeys } from '../../_internal/api/query-keys';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCollectionParams {\n\tchainId: number;\n\tcollectionAddress: string;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collection information from the metadata API\n */\nexport async function fetchCollection(params: FetchCollectionParams) {\n\tconst { collectionAddress, chainId, config } = params;\n\n\tconst metadataClient = getMetadataClient(config);\n\n\tconst result = await metadataClient.getContractInfo({\n\t\tchainID: chainId.toString(),\n\t\tcontractAddress: collectionAddress,\n\t});\n\n\treturn result.contractInfo;\n}\n\nexport type CollectionQueryOptions = ValuesOptional<FetchCollectionParams> & {\n\tquery?: StandardQueryOptions;\n};\n\nexport function getCollectionQueryKey(params: CollectionQueryOptions) {\n\tconst apiArgs = {\n\t\tchainID: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t} satisfies QueryKeyArgs<GetContractInfoArgs>;\n\n\treturn [...collectionKeys.detail, apiArgs] as const;\n}\n\nexport function collectionQueryOptions(params: CollectionQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectionQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollection({\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\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 { GetTokenBalancesDetailsReturn } from '@0xsequence/indexer';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tbalanceQueries,\n\tgetIndexerClient,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface CollectionBalanceFilter {\n\taccountAddresses: Array<Address>;\n\tcontractWhitelist?: Array<Address>;\n\tomitNativeBalances: boolean;\n}\n\nexport interface FetchCollectionBalanceDetailsParams {\n\tchainId: number;\n\tfilter: CollectionBalanceFilter;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches detailed balance information for multiple accounts from the Indexer API\n */\nexport async function fetchCollectionBalanceDetails(\n\tparams: FetchCollectionBalanceDetailsParams,\n): Promise<GetTokenBalancesDetailsReturn> {\n\tconst { chainId, filter, config } = params;\n\n\tconst indexerClient = getIndexerClient(chainId, config);\n\n\tconst promises = filter.accountAddresses.map((accountAddress) =>\n\t\tindexerClient.getTokenBalancesDetails({\n\t\t\tfilter: {\n\t\t\t\taccountAddresses: [accountAddress],\n\t\t\t\tcontractWhitelist: filter.contractWhitelist,\n\t\t\t\tomitNativeBalances: filter.omitNativeBalances,\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst responses = await Promise.all(promises);\n\tconst mergedResponse = responses.reduce<GetTokenBalancesDetailsReturn>(\n\t\t(acc, curr) => {\n\t\t\tif (!curr) return acc;\n\t\t\treturn {\n\t\t\t\tpage: curr.page,\n\t\t\t\tnativeBalances: [\n\t\t\t\t\t...(acc.nativeBalances || []),\n\t\t\t\t\t...(curr.nativeBalances || []),\n\t\t\t\t],\n\t\t\t\tbalances: [...(acc.balances || []), ...(curr.balances || [])],\n\t\t\t};\n\t\t},\n\t\t{ page: {}, nativeBalances: [], balances: [] },\n\t);\n\n\tif (!mergedResponse) {\n\t\tthrow new Error('Failed to fetch collection balance details');\n\t}\n\n\treturn mergedResponse;\n}\n\nexport type CollectionBalanceDetailsQueryOptions =\n\tValuesOptional<FetchCollectionBalanceDetailsParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCollectionBalanceDetailsQueryKey(\n\tparams: CollectionBalanceDetailsQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: params.chainId!,\n\t\tfilter: params.filter!,\n\t};\n\n\treturn [...balanceQueries.collectionBalanceDetails, apiArgs] as const;\n}\n\nexport function collectionBalanceDetailsQueryOptions(\n\tparams: CollectionBalanceDetailsQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.filter?.accountAddresses?.length &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectionBalanceDetailsQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollectionBalanceDetails({\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\tfilter: params.filter!,\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 { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMarketplaceClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { GetCollectionDetailArgs } from '../../_internal/api/marketplace.gen';\nimport { collectionKeys } from '../../_internal/api/query-keys';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCollectionDetailsParams\n\textends Omit<GetCollectionDetailArgs, 'chainId' | 'contractAddress'> {\n\tchainId: number;\n\tcollectionAddress: string;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collection details from the marketplace API\n */\nexport async function fetchCollectionDetails(\n\tparams: FetchCollectionDetailsParams,\n) {\n\tconst { collectionAddress, chainId, config, ...additionalApiParams } = params;\n\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst apiArgs: GetCollectionDetailArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\t...additionalApiParams,\n\t};\n\n\tconst result = await marketplaceClient.getCollectionDetail(apiArgs);\n\treturn result.collection;\n}\n\nexport type CollectionDetailsQueryOptions =\n\tValuesOptional<FetchCollectionDetailsParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCollectionDetailsQueryKey(\n\tparams: CollectionDetailsQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t} satisfies QueryKeyArgs<GetCollectionDetailArgs>;\n\n\treturn [...collectionKeys.detail, apiArgs] as const;\n}\n\nexport function collectionDetailsQueryOptions(\n\tparams: CollectionDetailsQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectionDetailsQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollectionDetails({\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\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 { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { Page, SdkConfig } from '../../../types';\nimport type {\n\tListCollectionActivitiesArgs,\n\tListCollectionActivitiesReturn,\n\tQueryKeyArgs,\n\tSortBy,\n\tValuesOptional,\n} from '../../_internal';\nimport { getMarketplaceClient } from '../../_internal';\nimport { collectionKeys } from '../../_internal/api';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchListCollectionActivitiesParams\n\textends Omit<\n\t\tListCollectionActivitiesArgs,\n\t\t'chainId' | 'contractAddress' | 'page'\n\t> {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tpage?: number;\n\tpageSize?: number;\n\tsort?: SortBy[];\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collection activities from the Marketplace API\n */\nexport async function fetchListCollectionActivities(\n\tparams: FetchListCollectionActivitiesParams,\n): Promise<ListCollectionActivitiesReturn> {\n\tconst {\n\t\tcollectionAddress,\n\t\tchainId,\n\t\tconfig,\n\t\tpage,\n\t\tpageSize,\n\t\tsort,\n\t\t...additionalApiParams\n\t} = params;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst pageParams: Page | undefined =\n\t\tpage || pageSize || sort\n\t\t\t? {\n\t\t\t\t\tpage: page ?? 1,\n\t\t\t\t\tpageSize: pageSize ?? 10,\n\t\t\t\t\tsort,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst apiArgs: ListCollectionActivitiesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\tpage: pageParams,\n\t\t...additionalApiParams,\n\t};\n\n\treturn await marketplaceClient.listCollectionActivities(apiArgs);\n}\n\nexport type ListCollectionActivitiesQueryOptions =\n\tValuesOptional<FetchListCollectionActivitiesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListCollectionActivitiesQueryKey(\n\tparams: ListCollectionActivitiesQueryOptions,\n) {\n\tconst page =\n\t\tparams.page || params.pageSize || params.sort\n\t\t\t? {\n\t\t\t\t\tpage: params.page ?? 1,\n\t\t\t\t\tpageSize: params.pageSize ?? 10,\n\t\t\t\t\tsort: params.sort,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\tpage: page,\n\t} satisfies QueryKeyArgs<ListCollectionActivitiesArgs>;\n\n\treturn [...collectionKeys.collectionActivities, apiArgs] as const;\n}\n\nexport function listCollectionActivitiesQueryOptions(\n\tparams: ListCollectionActivitiesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListCollectionActivitiesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchListCollectionActivities({\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\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\tpage: params.page,\n\t\t\t\tpageSize: params.pageSize,\n\t\t\t\tsort: params.sort,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import type { ContractInfo } from '@0xsequence/metadata';\nimport { queryOptions, skipToken } from '@tanstack/react-query';\nimport type { CardType, SdkConfig } from '../../../types';\nimport type {\n\tMarketCollection,\n\tMarketplaceConfig,\n\tShopCollection,\n} from '../../../types/new-marketplace-types';\nimport { compareAddress } from '../../../utils';\nimport {\n\tcollectionKeys,\n\tgetMetadataClient,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nconst allCollections = (marketplaceConfig: MarketplaceConfig) => {\n\treturn [\n\t\t...marketplaceConfig.market.collections,\n\t\t...marketplaceConfig.shop.collections,\n\t];\n};\n\nexport interface FetchListCollectionsParams {\n\tcardType?: CardType;\n\tmarketplaceConfig: MarketplaceConfig;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collections from the metadata API with marketplace config filtering\n */\nexport async function fetchListCollections(params: FetchListCollectionsParams) {\n\tconst { cardType, marketplaceConfig, config } = params;\n\tconst metadataClient = getMetadataClient(config);\n\n\tlet collections = allCollections(marketplaceConfig);\n\n\tif (!collections?.length) {\n\t\treturn [];\n\t}\n\n\tif (cardType) {\n\t\tcollections = collections.filter(\n\t\t\t(collection) => collection.cardType === cardType,\n\t\t);\n\t}\n\n\t// Group collections by chainId\n\tconst collectionsByChain = collections.reduce<Record<string, string[]>>(\n\t\t(acc, curr) => {\n\t\t\tconst { chainId, itemsAddress } = curr;\n\t\t\tif (!acc[chainId]) {\n\t\t\t\tacc[chainId] = [];\n\t\t\t}\n\t\t\tacc[chainId].push(itemsAddress);\n\t\t\treturn acc;\n\t\t},\n\t\t{},\n\t);\n\n\t// Fetch collections for each chain\n\tconst promises = Object.entries(collectionsByChain).map(\n\t\t([chainId, addresses]) =>\n\t\t\tmetadataClient\n\t\t\t\t.getContractInfoBatch({\n\t\t\t\t\tchainID: chainId,\n\t\t\t\t\tcontractAddresses: addresses,\n\t\t\t\t})\n\t\t\t\t.then((resp) => Object.values(resp.contractInfoMap)),\n\t);\n\n\tconst settled = await Promise.allSettled(promises);\n\n\t// If all promises failed, throw the first error\n\tif (settled.every((result) => result.status === 'rejected')) {\n\t\tconst firstError = settled[0] as PromiseRejectedResult;\n\t\tthrow firstError.reason;\n\t}\n\n\tconst results = settled\n\t\t.filter(\n\t\t\t(r): r is PromiseFulfilledResult<ContractInfo[]> =>\n\t\t\t\tr.status === 'fulfilled',\n\t\t)\n\t\t.flatMap((r) => r.value);\n\n\tconst collectionsWithMetadata = collections\n\t\t.map((collection) => {\n\t\t\tconst metadata = results.find((result) =>\n\t\t\t\tcompareAddress(result.address, collection.itemsAddress),\n\t\t\t);\n\t\t\treturn { collection, metadata };\n\t\t})\n\t\t.filter(\n\t\t\t(\n\t\t\t\titem,\n\t\t\t): item is {\n\t\t\t\tcollection: MarketCollection | ShopCollection;\n\t\t\t\tmetadata: ContractInfo;\n\t\t\t} => item.metadata !== undefined,\n\t\t)\n\t\t.map(({ collection, metadata }) => ({\n\t\t\t...collection,\n\t\t\t...metadata,\n\t\t}));\n\n\treturn collectionsWithMetadata;\n}\n\nexport type ListCollectionsQueryOptions =\n\tValuesOptional<FetchListCollectionsParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListCollectionsQueryKey(\n\tparams: ListCollectionsQueryOptions,\n) {\n\tconst queryKeyParams = {\n\t\tcardType: params.cardType,\n\t\tmarketplaceConfig: params.marketplaceConfig,\n\t} as const;\n\n\treturn [...collectionKeys.list, queryKeyParams] as const;\n}\n\nexport function listCollectionsQueryOptions(\n\tparams: ListCollectionsQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.marketplaceConfig &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListCollectionsQueryKey(params),\n\t\tqueryFn: enabled\n\t\t\t? () =>\n\t\t\t\t\tfetchListCollections({\n\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\tmarketplaceConfig: params.marketplaceConfig!,\n\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\tconfig: params.config!,\n\t\t\t\t\t\tcardType: params.cardType,\n\t\t\t\t\t})\n\t\t\t: skipToken,\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n\n// Keep old function for backward compatibility during migration\nexport const listCollectionsOptions = ({\n\tcardType,\n\tmarketplaceConfig,\n\tconfig,\n}: {\n\tcardType?: CardType;\n\tmarketplaceConfig: MarketplaceConfig | undefined;\n\tconfig: SdkConfig;\n}) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectionKeys.list, { cardType, marketplaceConfig, config }],\n\t\tqueryFn: marketplaceConfig\n\t\t\t? () =>\n\t\t\t\t\tfetchListCollections({\n\t\t\t\t\t\tmarketplaceConfig,\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t\tcardType,\n\t\t\t\t\t})\n\t\t\t: skipToken,\n\t\tenabled: Boolean(marketplaceConfig),\n\t});\n};\n"],"mappings":";;;;;;;;AAoBA,eAAsB,gBAAgB,QAA+B;CACpE,MAAM,EAAE,mBAAmB,SAAS,WAAW;AAS/C,SALe,MAFQ,kBAAkB,OAAO,CAEZ,gBAAgB;EACnD,SAAS,QAAQ,UAAU;EAC3B,iBAAiB;EACjB,CAAC,EAEY;;AAOf,SAAgB,sBAAsB,QAAgC;CACrE,MAAM,UAAU;EAC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 -1 +0,0 @@
1
- {"version":3,"file":"components-CosnX7F9.js","names":["SvgBellIcon"],"sources":["../src/react/ui/components/marketplace-collectible-card/components/footer/components/FooterName.tsx","../src/react/ui/components/marketplace-collectible-card/components/footer/components/PriceDisplay.tsx","../src/react/ui/components/marketplace-collectible-card/components/footer/components/SaleDetailsPill.tsx","../src/react/ui/components/marketplace-collectible-card/components/footer/components/TokenTypeBalancePill.tsx"],"sourcesContent":["'use client';\n\nimport { cn, IconButton, Text } from '@0xsequence/design-system';\nimport { useAccount } from 'wagmi';\nimport { compareAddress } from '../../../../../../../utils/address';\nimport type { Order } from '../../../../../../_internal';\nimport SvgBellIcon from '../../../../../icons/BellIcon';\n\ninterface FooterNameProps {\n\tname: string;\n\tisShop?: boolean;\n\thighestOffer?: Order;\n\tonOfferClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n\tquantityInitial?: string;\n\tquantityRemaining?: string;\n\tbalance?: string;\n}\n\nexport const FooterName = ({\n\tname,\n\tisShop,\n\thighestOffer,\n\tonOfferClick,\n\tquantityInitial,\n\tquantityRemaining,\n\tbalance,\n}: FooterNameProps) => {\n\tconst { address: currentUserAddress } = useAccount();\n\tconst displayName = (() => {\n\t\tif (name.length > 15 && highestOffer && !isShop) {\n\t\t\treturn `${name.substring(0, 13)}...`;\n\t\t}\n\t\tif (name.length > 17 && !highestOffer && !isShop) {\n\t\t\treturn `${name.substring(0, 17)}...`;\n\t\t}\n\t\tif (name.length > 17) {\n\t\t\treturn `${name.substring(0, 17)}...`;\n\t\t}\n\t\treturn name;\n\t})();\n\n\treturn (\n\t\t<div className=\"relative flex w-full items-center justify-between\">\n\t\t\t<Text\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'overflow-hidden text-ellipsis text-left font-body font-bold text-sm text-text-100',\n\t\t\t\t\tisShop &&\n\t\t\t\t\t\t(quantityInitial === undefined ||\n\t\t\t\t\t\t\tquantityRemaining === undefined) &&\n\t\t\t\t\t\t'text-text-50',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{displayName || 'Untitled'}\n\t\t\t</Text>\n\n\t\t\t{highestOffer &&\n\t\t\t\tonOfferClick &&\n\t\t\t\t!isShop &&\n\t\t\t\t(() => {\n\t\t\t\t\t// Check if the current user made the offer\n\t\t\t\t\tconst isOfferMadeBySelf =\n\t\t\t\t\t\tcurrentUserAddress &&\n\t\t\t\t\t\thighestOffer.createdBy &&\n\t\t\t\t\t\tcompareAddress(highestOffer.createdBy, currentUserAddress);\n\n\t\t\t\t\t// Check if user owns the token (has balance > 0)\n\t\t\t\t\tconst userOwnsToken = balance && Number(balance) > 0;\n\n\t\t\t\t\t// Can accept offer: didn't make the offer AND owns the token\n\t\t\t\t\tconst canAcceptOffer = !isOfferMadeBySelf && userOwnsToken;\n\n\t\t\t\t\t// Should show disabled styling: can't accept offer\n\t\t\t\t\tconst shouldDisable = !canAcceptOffer;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tclassName={`absolute top-0 right-0 z-10 h-[22px] w-[22px] ${shouldDisable ? 'opacity-50 hover:animate-none hover:opacity-50' : 'hover:animate-bell-ring'}`}\n\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\tif (!canAcceptOffer) {\n\t\t\t\t\t\t\t\t\t// For cases where user can't accept offer (offer maker or non-owner), allow normal wrapper behavior\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Only stop propagation and open offer modal if user can accept the offer\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\tonOfferClick?.(e);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonMouseEnter={(e) => {\n\t\t\t\t\t\t\t\tif (canAcceptOffer) {\n\t\t\t\t\t\t\t\t\t// Only prevent parent hover effects when user can accept offer\n\t\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ticon={(props) => <SvgBellIcon {...props} size=\"xs\" />}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})()}\n\t\t</div>\n\t);\n};\n","'use client';\n\nimport {\n\tChevronLeftIcon,\n\tChevronRightIcon,\n\tcn,\n\tImage,\n\tText,\n} from '@0xsequence/design-system';\nimport type { Currency } from '../../../../../../_internal';\nimport { formatPriceNumber } from '../../../utils';\n\ninterface PriceDisplayProps {\n\tamount: string;\n\tcurrency: Currency;\n\tshowCurrencyIcon?: boolean;\n\tclassName?: string;\n}\n\nexport const formatPrice = (\n\tamount: string,\n\tcurrency: Currency,\n): React.ReactNode => {\n\tconst { formattedNumber, isUnderflow, isOverflow } = formatPriceNumber(\n\t\tamount,\n\t\tcurrency.decimals,\n\t);\n\tconst isFree = amount === '0';\n\n\tif (isFree) {\n\t\treturn <Text className=\"font-bold text-sm text-text-100\">Free</Text>;\n\t}\n\n\tif (isUnderflow) {\n\t\treturn (\n\t\t\t<div className=\"flex items-center\">\n\t\t\t\t<ChevronLeftIcon className=\"h-3 w-3 text-text-100\" />\n\t\t\t\t<Text className=\"font-bold text-sm text-text-100\">{`${formattedNumber} ${currency.symbol}`}</Text>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (isOverflow) {\n\t\treturn (\n\t\t\t<div className=\"flex items-center\">\n\t\t\t\t<ChevronRightIcon className=\"h-3 w-3 text-text-100\" />\n\t\t\t\t<Text className=\"font-bold text-sm text-text-100\">{`${formattedNumber} ${currency.symbol}`}</Text>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Text className=\"font-bold text-sm text-text-100\">\n\t\t\t{formattedNumber} {currency.symbol}\n\t\t</Text>\n\t);\n};\n\nexport const PriceDisplay = ({\n\tamount,\n\tcurrency,\n\tshowCurrencyIcon = true,\n\tclassName,\n}: PriceDisplayProps) => {\n\treturn (\n\t\t<div className={cn('flex items-center gap-1', className)}>\n\t\t\t{showCurrencyIcon && currency.imageUrl && (\n\t\t\t\t<Image\n\t\t\t\t\talt={currency.symbol}\n\t\t\t\t\tclassName=\"h-3 w-3\"\n\t\t\t\t\tsrc={currency.imageUrl}\n\t\t\t\t\tonError={(e) => {\n\t\t\t\t\t\te.currentTarget.style.display = 'none';\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{formatPrice(amount, currency)}\n\t\t</div>\n\t);\n};\n","'use client';\n\nimport { Text } from '@0xsequence/design-system';\nimport type { ContractType } from '../../../../../../_internal';\nimport { getSupplyStatusText } from '../../../utils';\n\ninterface SaleDetailsPillProps {\n\tquantityRemaining: string | undefined;\n\tcollectionType: ContractType;\n\tunlimitedSupply?: boolean;\n}\n\nexport const SaleDetailsPill = ({\n\tquantityRemaining,\n\tcollectionType,\n\tunlimitedSupply,\n}: SaleDetailsPillProps) => {\n\tconst supplyText = getSupplyStatusText({\n\t\tquantityRemaining,\n\t\tcollectionType,\n\t\tunlimitedSupply,\n\t});\n\n\treturn (\n\t\t<Text className=\"rounded-lg bg-background-secondary px-2 py-1 text-left font-medium text-text-80 text-xs\">\n\t\t\t{supplyText}\n\t\t</Text>\n\t);\n};\n","'use client';\n\nimport { Text } from '@0xsequence/design-system';\nimport { formatUnits } from 'viem';\nimport { ContractType } from '../../../../../../_internal';\n\ninterface TokenTypeBalancePillProps {\n\tbalance?: string;\n\ttype: ContractType;\n\tdecimals?: number;\n}\n\nexport const TokenTypeBalancePill = ({\n\tbalance,\n\ttype,\n\tdecimals,\n}: TokenTypeBalancePillProps) => {\n\tconst displayText =\n\t\ttype === ContractType.ERC1155\n\t\t\t? balance\n\t\t\t\t? `Owned: ${formatUnits(BigInt(balance), decimals ?? 0)}`\n\t\t\t\t: 'ERC-1155'\n\t\t\t: 'ERC-721';\n\n\treturn (\n\t\t<Text className=\"rounded-lg bg-background-secondary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,KAAI,YACH,QACC,qBAAC;EAAI,WAAU;aACd,oBAAC,mBAAgB,WAAU,0BAA0B,EACrD,oBAAC;GAAK,WAAU;aAAmC,GAAG,gBAAgB,GAAG,SAAS;IAAgB;GAC7F;AAIR,KAAI,WACH,QACC,qBAAC;EAAI,WAAU;aACd,oBAAC,oBAAiB,WAAU,0BAA0B,EACtD,oBAAC;GAAK,WAAU;aAAmC,GAAG,gBAAgB,GAAG,SAAS;IAAgB;GAC7F;AAIR,QACC,qBAAC;EAAK,WAAU;;GACd;GAAgB;GAAE,SAAS;;GACtB;;AAIT,MAAa,gBAAgB,EAC5B,QACA,UACA,mBAAmB,MACnB,gBACwB;AACxB,QACC,qBAAC;EAAI,WAAW,GAAG,2BAA2B,UAAU;aACtD,oBAAoB,SAAS,YAC7B,oBAAC;GACA,KAAK,SAAS;GACd,WAAU;GACV,KAAK,SAAS;GACd,UAAU,MAAM;AACf,MAAE,cAAc,MAAM,UAAU;;IAEhC,EAEF,YAAY,QAAQ,SAAS;GACzB;;;;;ACjER,MAAa,mBAAmB,EAC/B,mBACA,gBACA,sBAC2B;CAC3B,MAAM,aAAa,oBAAoB;EACtC;EACA;EACA;EACA,CAAC;AAEF,QACC,oBAAC;EAAK,WAAU;YACd;GACK;;;;;ACdT,MAAa,wBAAwB,EACpC,SACA,MACA,eACgC;CAChC,MAAM,cACL,SAAS,aAAa,UACnB,UACC,UAAU,YAAY,OAAO,QAAQ,EAAE,YAAY,EAAE,KACrD,aACD;AAEJ,QACC,oBAAC;EAAK,WAAU;YACd;GACK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-config-CIfejoCk.js","names":["wallets: Wallet[]","rpcUrl: string"],"sources":["../src/react/_internal/consts.ts","../src/react/_internal/wagmi/get-connectors.ts","../src/react/_internal/wagmi/create-config.ts"],"sourcesContent":["export const DEFAULT_NETWORK = 137;\n","import {\n\tapple,\n\tappleWaas,\n\tcoinbaseWallet,\n\tecosystemWallet,\n\temail,\n\temailWaas,\n\tfacebook,\n\tgetConnectWallets,\n\tgoogle,\n\tgoogleWaas,\n\ttype SequenceOptions,\n\tsequence,\n\ttwitch,\n\ttype Wallet,\n\twalletConnect,\n} from '@0xsequence/connect';\nimport React, { type FunctionComponent } from 'react';\nimport type { CreateConnectorFn } from 'wagmi';\nimport type { Env, SdkConfig } from '../../../types/index';\nimport type { MarketplaceConfig } from '../../../types/new-marketplace-types';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { MarketplaceWalletType } from '../api/builder.gen';\nimport { DEFAULT_NETWORK } from '../consts';\n\nexport function getConnectors({\n\tmarketplaceConfig,\n\tsdkConfig,\n\twalletType,\n}: {\n\tmarketplaceConfig: MarketplaceConfig;\n\tsdkConfig: SdkConfig;\n\twalletType: MarketplaceWalletType;\n}): CreateConnectorFn[] {\n\tconst connectors = commonConnectors(marketplaceConfig, sdkConfig);\n\n\tif (walletType === MarketplaceWalletType.UNIVERSAL) {\n\t\tconnectors.push(...getUniversalWalletConfigs(sdkConfig, marketplaceConfig));\n\t} else if (walletType === MarketplaceWalletType.EMBEDDED) {\n\t\tconnectors.push(...getWaasConnectors(sdkConfig, marketplaceConfig));\n\t} else if (walletType === MarketplaceWalletType.ECOSYSTEM) {\n\t\tconnectors.push(getEcosystemConnector(marketplaceConfig, sdkConfig));\n\t} else {\n\t\tthrow new Error('Invalid wallet type');\n\t}\n\n\treturn getConnectWallets(sdkConfig.projectAccessKey, connectors);\n}\n\nfunction commonConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n) {\n\tconst wallets = [];\n\tconst { title: appName } = marketplaceConfig.settings;\n\tconst walletOptions = marketplaceConfig.settings.walletOptions;\n\tconst walletConnectProjectId = sdkConfig.walletConnectProjectId;\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(\n\t\t\tcoinbaseWallet({\n\t\t\t\tappName,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(\n\t\t\twalletConnect({\n\t\t\t\tprojectId: walletConnectProjectId,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn wallets;\n}\n\nfunction getUniversalWalletConfigs(\n\tconfig: SdkConfig,\n\tmarketplaceConfig: MarketplaceConfig,\n): Wallet[] {\n\tconst sequenceWalletOverrides =\n\t\tconfig._internal?.overrides?.api?.sequenceWallet;\n\tconst sequenceWalletUrl =\n\t\tsequenceWalletOverrides?.url ||\n\t\tgetSequenceWalletURL(sequenceWalletOverrides?.env || 'production');\n\tconst projectAccessKey =\n\t\tsequenceWalletOverrides?.accessKey || config.projectAccessKey;\n\n\tconst sequenceWalletOptions = {\n\t\twalletAppURL: sequenceWalletUrl,\n\t\tdefaultNetwork: DEFAULT_NETWORK,\n\t\tconnect: {\n\t\t\tprojectAccessKey,\n\t\t\tapp: marketplaceConfig.settings.title,\n\t\t\tsettings: {\n\t\t\t\t// TODO: make a separate config for this?\n\t\t\t\tbannerUrl: marketplaceConfig.market.ogImage,\n\t\t\t},\n\t\t},\n\t} satisfies SequenceOptions;\n\n\treturn [\n\t\tsequence(sequenceWalletOptions),\n\t\temail(sequenceWalletOptions),\n\t\tfacebook(sequenceWalletOptions),\n\t\tgoogle(sequenceWalletOptions),\n\t\tapple(sequenceWalletOptions),\n\t\ttwitch(sequenceWalletOptions),\n\t] as const;\n}\n\nexport function getWaasConnectors(\n\tconfig: SdkConfig,\n\tmarketplaceConfig: MarketplaceConfig,\n): Wallet[] {\n\tconst { projectAccessKey } = config;\n\n\tconst waasConfigKey =\n\t\tmarketplaceConfig.settings.walletOptions.embedded?.tenantKey;\n\n\tif (!waasConfigKey)\n\t\tthrow new MissingConfigError(\n\t\t\t'Embedded wallet config is missing, please check your access key',\n\t\t);\n\n\tconst waasOptions = marketplaceConfig.settings.walletOptions.oidcIssuers;\n\tconst googleClientId = waasOptions.google;\n\tconst appleClientId = waasOptions.apple;\n\tconst appleRedirectURI =\n\t\ttypeof window !== 'undefined'\n\t\t\t? `${window.location.origin}${window.location.pathname}`\n\t\t\t: undefined;\n\n\tconst wallets: Wallet[] = [];\n\n\tif (marketplaceConfig.settings.walletOptions.embedded?.emailEnabled) {\n\t\twallets.push(\n\t\t\temailWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\twaasConfigKey,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (googleClientId) {\n\t\twallets.push(\n\t\t\tgoogleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tgoogleClientId,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (appleClientId) {\n\t\twallets.push(\n\t\t\tappleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tappleClientId,\n\t\t\t\tappleRedirectURI,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn wallets;\n}\n\nexport function getEcosystemConnector(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n): Wallet {\n\tconst ecosystemOptions = marketplaceConfig.settings.walletOptions.ecosystem;\n\tif (!ecosystemOptions) throw new MissingConfigError('ecosystem');\n\tconst { walletAppName, walletUrl, logoDarkUrl, logoLightUrl } =\n\t\tecosystemOptions;\n\n\treturn ecosystemWallet({\n\t\tprojectAccessKey: sdkConfig.projectAccessKey,\n\t\twalletUrl,\n\t\tname: walletAppName,\n\t\tdefaultNetwork: DEFAULT_NETWORK,\n\t\tlogoDark: getEcosystemLogo(logoDarkUrl, walletAppName),\n\t\tlogoLight: getEcosystemLogo(logoLightUrl, walletAppName),\n\t});\n}\n\nfunction getEcosystemLogo(\n\turl: string | undefined,\n\tname: string,\n): FunctionComponent {\n\tif (!url) return () => null;\n\tconst Logo = () =>\n\t\tReact.createElement('img', { src: url, alt: name, width: 32, height: 32 });\n\tLogo.displayName = 'EcosystemLogo';\n\treturn Logo;\n}\n\nfunction getSequenceWalletURL(env: Env) {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\treturn 'https://dev.sequence.app';\n\t\tcase 'next':\n\t\t\treturn 'https://next.sequence.app';\n\t\t// biome-ignore lint/complexity/noUselessSwitchCase: Production case kept for readability alongside other environments\n\t\tcase 'production':\n\t\tdefault:\n\t\t\treturn 'https://sequence.app';\n\t}\n}\n","import { allNetworks, findNetworkConfig } from '@0xsequence/network';\nimport type { Chain, Transport } from 'viem';\nimport { cookieStorage, createConfig, createStorage, http } from 'wagmi';\nimport type { Env, SdkConfig } from '../../../types/index';\nimport type { MarketplaceConfig } from '../../../types/new-marketplace-types';\nimport { networkToWagmiChain } from '../../../utils/networkconfigToWagmiChain';\nimport { getConnectors } from './get-connectors';\n\nexport const createWagmiConfig = (\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n\tssr?: boolean,\n) => {\n\tconst { chains, transports } = getWagmiChainsAndTransports({\n\t\tmarketplaceConfig,\n\t\tsdkConfig,\n\t});\n\n\tconst walletType = marketplaceConfig.settings.walletOptions.walletType;\n\n\tconst connectors = getConnectors({\n\t\tmarketplaceConfig,\n\t\tsdkConfig,\n\t\twalletType,\n\t});\n\n\tconst multiInjectedProviderDiscovery =\n\t\tmarketplaceConfig.settings.walletOptions.includeEIP6963Wallets;\n\n\treturn createConfig({\n\t\tconnectors,\n\t\tchains,\n\t\tssr,\n\t\tmultiInjectedProviderDiscovery,\n\t\tstorage: ssr\n\t\t\t? createStorage({\n\t\t\t\t\tstorage: cookieStorage,\n\t\t\t\t})\n\t\t\t: undefined,\n\t\ttransports,\n\t});\n};\n\nexport function getWagmiChainsAndTransports({\n\tmarketplaceConfig,\n\tsdkConfig,\n}: {\n\tmarketplaceConfig: MarketplaceConfig;\n\tsdkConfig: SdkConfig;\n}) {\n\tconst chains = getChainConfigs(marketplaceConfig);\n\tconst nodeGatewayOverrides = sdkConfig._internal?.overrides?.api?.nodeGateway;\n\tconst nodeGatewayEnv = nodeGatewayOverrides?.env ?? 'production';\n\tconst nodeGatewayUrl = nodeGatewayOverrides?.url;\n\tconst projectAccessKey =\n\t\tnodeGatewayOverrides?.accessKey ?? sdkConfig.projectAccessKey;\n\n\tconst transports = getTransportConfigs(\n\t\tchains,\n\t\tprojectAccessKey,\n\t\tnodeGatewayEnv,\n\t\tnodeGatewayUrl,\n\t);\n\n\treturn { chains, transports };\n}\n\nfunction getChainConfigs(\n\t_marketConfig: MarketplaceConfig,\n): [Chain, ...Chain[]] {\n\tconst chains = Object.values(allNetworks).map(networkToWagmiChain);\n\n\treturn chains as [Chain, ...Chain[]];\n}\n\nfunction getTransportConfigs(\n\tchains: [Chain, ...Chain[]],\n\tprojectAccessKey: string,\n\tnodeGatewayEnv: Env | undefined,\n\tnodeGatewayUrl?: string,\n): Record<number, Transport> {\n\treturn chains.reduce(\n\t\t(acc, chain) => {\n\t\t\tconst network = findNetworkConfig(allNetworks, chain.id);\n\t\t\tif (network) {\n\t\t\t\tlet rpcUrl: string;\n\t\t\t\tif (nodeGatewayUrl) {\n\t\t\t\t\t// Use manual URL if provided\n\t\t\t\t\trpcUrl = nodeGatewayUrl;\n\t\t\t\t} else {\n\t\t\t\t\t// Use default URL with environment prefix\n\t\t\t\t\trpcUrl = network.rpcUrl;\n\t\t\t\t\tif (nodeGatewayEnv === 'development') {\n\t\t\t\t\t\trpcUrl = rpcUrl.replace('nodes.', 'dev-nodes.');\n\t\t\t\t\t}\n\t\t\t\t\tif (!network.rpcUrl.endsWith(projectAccessKey))\n\t\t\t\t\t\trpcUrl = `${rpcUrl}/${projectAccessKey}`;\n\t\t\t\t}\n\t\t\t\tacc[chain.id] = http(rpcUrl);\n\t\t\t}\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<number, Transport>,\n\t);\n}\n"],"mappings":";;;;;;;;;AAAA,MAAa,kBAAkB;;;;ACyB/B,SAAgB,cAAc,EAC7B,mBACA,WACA,cAK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1D;EACA;EACA,CAAC;CAEF,MAAM,aAAa,kBAAkB,SAAS,cAAc;CAE5D,MAAM,aAAa,cAAc;EAChC;EACA;EACA;EACA,CAAC;CAEF,MAAM,iCACL,kBAAkB,SAAS,cAAc;AAE1C,QAAO,aAAa;EACnB;EACA;EACA;EACA;EACA,SAAS,MACN,cAAc,EACd,SAAS,eACT,CAAC,GACD;EACH;EACA,CAAC;;AAGH,SAAgB,4BAA4B,EAC3C,mBACA,aAIE;CACF,MAAM,SAAS,gBAAgB,kBAAkB;CACjD,MAAM,uBAAuB,UAAU,WAAW,WAAW,KAAK;CAClE,MAAM,iBAAiB,sBAAsB,OAAO;CACpD,MAAM,iBAAiB,sBAAsB;CAC7C,MAAM,mBACL,sBAAsB,aAAa,UAAU;CAE9C,MAAM,aAAa,oBAClB,QACA,kBACA,gBACA,eACA;AAED,QAAO;EAAE;EAAQ;EAAY;;AAG9B,SAAS,gBACR,eACsB;AAGtB,QAFe,OAAO,OAAO,YAAY,CAAC,IAAI,oBAAoB;;AAKnE,SAAS,oBACR,QACA,kBACA,gBACA,gBAC4B;AAC5B,QAAO,OAAO,QACZ,KAAK,UAAU;EACf,MAAM,UAAU,kBAAkB,aAAa,MAAM,GAAG;AACxD,MAAI,SAAS;GACZ,IAAIC;AACJ,OAAI,eAEH,UAAS;QACH;AAEN,aAAS,QAAQ;AACjB,QAAI,mBAAmB,cACtB,UAAS,OAAO,QAAQ,UAAU,aAAa;AAEhD,QAAI,CAAC,QAAQ,OAAO,SAAS,iBAAiB,CAC7C,UAAS,GAAG,OAAO,GAAG;;AAExB,OAAI,MAAM,MAAM,KAAK,OAAO;;AAE7B,SAAO;IAER,EAAE,CACF"}
@@ -1,18 +0,0 @@
1
- import { MarketplaceConfig, MarketplaceSdkContext, WalletKind } from "./create-config-ZOB7i4ZJ.js";
2
- import * as _tanstack_react_query341 from "@tanstack/react-query";
3
-
4
- //#region src/react/hooks/config/useConfig.d.ts
5
- declare function useConfig(): MarketplaceSdkContext;
6
- //#endregion
7
- //#region src/react/hooks/config/useConnectorMetadata.d.ts
8
- declare const useConnectorMetadata: () => {
9
- isWaaS: boolean;
10
- isSequence: boolean | undefined;
11
- walletKind: WalletKind;
12
- };
13
- //#endregion
14
- //#region src/react/hooks/config/useMarketplaceConfig.d.ts
15
- declare const useMarketplaceConfig: () => _tanstack_react_query341.UseQueryResult<MarketplaceConfig, Error>;
16
- //#endregion
17
- export { useConfig, useConnectorMetadata, useMarketplaceConfig };
18
- //# sourceMappingURL=index-DNNUeZEq.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inventory-Dd7TazvZ.js","names":[],"sources":["../src/react/queries/inventory/inventory.ts"],"sourcesContent":["import type { ContractInfo, TokenBalance } from '@0xsequence/indexer';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { Page, SdkConfig } from '../../../types';\nimport { compareAddress } from '../../../utils';\nimport {\n\ttype ContractType,\n\tgetQueryClient,\n\tMetadataStatus,\n} from '../../_internal';\nimport { tokenBalancesOptions } from '../collectibles/tokenBalances';\nimport { fetchMarketplaceConfig } from '../market/marketplaceConfig';\n\nexport interface UseInventoryArgs {\n\taccountAddress: Address;\n\tcollectionAddress: Address;\n\tchainId: number;\n\tisLaos721?: boolean;\n\tincludeNonTradable?: boolean;\n\tquery?: {\n\t\tenabled?: boolean;\n\t\tpage?: number;\n\t\tpageSize?: number;\n\t};\n}\n\ninterface GetInventoryArgs extends Omit<UseInventoryArgs, 'query'> {\n\tisLaos721: boolean;\n}\n\ninterface CollectibleWithBalance {\n\tmetadata: {\n\t\ttokenId: string;\n\t\tattributes: Array<any>;\n\t\timage?: string;\n\t\tname: string;\n\t\tdescription?: string;\n\t\tvideo?: string;\n\t\taudio?: string;\n\t\tstatus: MetadataStatus;\n\t};\n\tbalance: string;\n\tcontractInfo?: ContractInfo;\n\tcontractType: ContractType.ERC1155 | ContractType.ERC721;\n}\n\nexport interface CollectiblesResponse {\n\tcollectibles: CollectibleWithBalance[];\n\tpage: Page;\n\tisTradable: boolean;\n}\n\nfunction collectibleFromTokenBalance(\n\ttoken: TokenBalance,\n): CollectibleWithBalance {\n\treturn {\n\t\tmetadata: {\n\t\t\ttokenId: token.tokenID ?? '',\n\t\t\tattributes: token.tokenMetadata?.attributes ?? [],\n\t\t\timage: token.tokenMetadata?.image,\n\t\t\tname: token.tokenMetadata?.name ?? '',\n\t\t\tdescription: token.tokenMetadata?.description,\n\t\t\tvideo: token.tokenMetadata?.video,\n\t\t\taudio: token.tokenMetadata?.audio,\n\t\t\tstatus: MetadataStatus.AVAILABLE,\n\t\t},\n\t\tcontractInfo: token.contractInfo,\n\t\tcontractType: token.contractType as unknown as\n\t\t\t| ContractType.ERC1155\n\t\t\t| ContractType.ERC721,\n\t\tbalance: token.balance,\n\t};\n}\n\nasync function fetchIndexerTokens(\n\tchainId: number,\n\taccountAddress: Address,\n\tcollectionAddress: Address,\n\tconfig: SdkConfig,\n\tisLaos721: boolean,\n): Promise<{ collectibles: CollectibleWithBalance[] }> {\n\tconst queryClient = getQueryClient();\n\tconst balances = await queryClient.fetchQuery(\n\t\ttokenBalancesOptions(\n\t\t\t{\n\t\t\t\tcollectionAddress,\n\t\t\t\tuserAddress: accountAddress,\n\t\t\t\tchainId,\n\t\t\t\tisLaos721,\n\t\t\t\tincludeMetadata: true,\n\t\t\t},\n\t\t\tconfig,\n\t\t),\n\t);\n\n\tconst collectibles = balances.map((balance) =>\n\t\tcollectibleFromTokenBalance(balance),\n\t);\n\n\treturn {\n\t\tcollectibles,\n\t};\n}\n\nexport async function fetchInventory(\n\targs: GetInventoryArgs,\n\tconfig: SdkConfig,\n\tpage: Page,\n): Promise<CollectiblesResponse> {\n\tconst { accountAddress, collectionAddress, chainId, isLaos721 } = args;\n\tconst marketplaceConfig = await fetchMarketplaceConfig({ config });\n\n\tconst marketCollections = marketplaceConfig?.market.collections || [];\n\n\tconst isMarketCollection = marketCollections.some((collection) =>\n\t\tcompareAddress(collection.itemsAddress, collectionAddress),\n\t);\n\n\t// Determine if this collection is tradable (market collection vs shop collection)\n\tconst isTradable = isMarketCollection;\n\n\t// Fetch collectibles from indexer\n\tconst { collectibles } = await fetchIndexerTokens(\n\t\tchainId,\n\t\taccountAddress,\n\t\tcollectionAddress,\n\t\tconfig,\n\t\tisLaos721,\n\t);\n\n\treturn {\n\t\tcollectibles,\n\t\tpage: {\n\t\t\tpage: page.page,\n\t\t\tpageSize: page.pageSize,\n\t\t},\n\t\tisTradable,\n\t};\n}\n\nexport function inventoryOptions(args: UseInventoryArgs, config: SdkConfig) {\n\tconst enabledQuery = args.query?.enabled ?? true;\n\tconst enabled =\n\t\tenabledQuery && !!args.accountAddress && !!args.collectionAddress;\n\n\treturn queryOptions({\n\t\tqueryKey: [\n\t\t\t'inventory',\n\t\t\targs.accountAddress,\n\t\t\targs.collectionAddress,\n\t\t\targs.chainId,\n\t\t\targs.query?.page ?? 1,\n\t\t\targs.query?.pageSize ?? 30,\n\t\t],\n\t\tqueryFn: () =>\n\t\t\tfetchInventory(\n\t\t\t\t{\n\t\t\t\t\t...args,\n\t\t\t\t\tisLaos721: args.isLaos721 ?? false,\n\t\t\t\t},\n\t\t\t\tconfig,\n\t\t\t\t{\n\t\t\t\t\tpage: args.query?.page ?? 1,\n\t\t\t\t\tpageSize: args.query?.pageSize ?? 30,\n\t\t\t\t},\n\t\t\t),\n\t\tenabled,\n\t});\n}\n"],"mappings":";;;;;;;;AAoDA,SAAS,4BACR,OACyB;AACzB,QAAO;EACN,UAAU;GACT,SAAS,MAAM,WAAW;GAC1B,YAAY,MAAM,eAAe,cAAc,EAAE;GACjD,OAAO,MAAM,eAAe;GAC5B,MAAM,MAAM,eAAe,QAAQ;GACnC,aAAa,MAAM,eAAe;GAClC,OAAO,MAAM,eAAe;GAC5B,OAAO,MAAM,eAAe;GAC5B,QAAQ,eAAe;GACvB;EACD,cAAc,MAAM;EACpB,cAAc,MAAM;EAGpB,SAAS,MAAM;EACf;;AAGF,eAAe,mBACd,SACA,gBACA,mBACA,QACA,WACsD;AAmBtD,QAAO,EACN,eAlBgB,MADG,gBAAgB,CACD,WAClC,qBACC;EACC;EACA,aAAa;EACb;EACA;EACA,iBAAiB;EACjB,EACD,OACA,CACD,EAE6B,KAAK,YAClC,4BAA4B,QAAQ,CACpC,EAIA;;AAGF,eAAsB,eACrB,MACA,QACA,MACgC;CAChC,MAAM,EAAE,gBAAgB,mBAAmB,SAAS,cAAc;CAUlE,MAAM,eAToB,MAAM,uBAAuB,EAAE,QAAQ,CAAC,GAErB,OAAO,eAAe,EAAE,EAExB,MAAM,eAClD,eAAe,WAAW,cAAc,kBAAkB,CAC1D;CAMD,MAAM,EAAE,iBAAiB,MAAM,mBAC9B,SACA,gBACA,mBACA,QACA,UACA;AAED,QAAO;EACN;EACA,MAAM;GACL,MAAM,KAAK;GACX,UAAU,KAAK;GACf;EACD;EACA;;AAGF,SAAgB,iBAAiB,MAAwB,QAAmB;CAE3E,MAAM,WADe,KAAK,OAAO,WAAW,SAE3B,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,KAAK;AAEjD,QAAO,aAAa;EACnB,UAAU;GACT;GACA,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK,OAAO,QAAQ;GACpB,KAAK,OAAO,YAAY;GACxB;EACD,eACC,eACC;GACC,GAAG;GACH,WAAW,KAAK,aAAa;GAC7B,EACD,QACA;GACC,MAAM,KAAK,OAAO,QAAQ;GAC1B,UAAU,KAAK,OAAO,YAAY;GAClC,CACD;EACF;EACA,CAAC"}
@@ -1,57 +0,0 @@
1
- import { LaosAPI, balanceQueries, getIndexerClient } from "./api-BoO0V5aJ.js";
2
- import { infiniteQueryOptions } from "@tanstack/react-query";
3
-
4
- //#region src/react/queries/tokens/listBalances.ts
5
- async function fetchBalances(args, config, page) {
6
- if (args.isLaos721 && args.accountAddress) return new LaosAPI().getTokenBalances({
7
- chainId: args.chainId.toString(),
8
- accountAddress: args.accountAddress,
9
- contractAddress: args.contractAddress,
10
- includeMetadata: args.includeMetadata,
11
- page: { sort: [{
12
- column: "CREATED_AT",
13
- order: "DESC"
14
- }] }
15
- });
16
- return getIndexerClient(args.chainId, config).getTokenBalances({
17
- ...args,
18
- tokenID: args.tokenId,
19
- page
20
- });
21
- }
22
- function getListBalancesQueryKey(args) {
23
- const apiArgs = {
24
- chainId: args.chainId,
25
- accountAddress: args.accountAddress,
26
- contractAddress: args.contractAddress,
27
- tokenID: args.tokenId,
28
- includeMetadata: args.includeMetadata,
29
- metadataOptions: args.metadataOptions,
30
- includeCollectionTokens: args.includeCollectionTokens,
31
- isLaos721: args.isLaos721
32
- };
33
- return [...balanceQueries.lists, apiArgs];
34
- }
35
- /**
36
- * Creates a tanstack infinite query options object for the balances query
37
- *
38
- * @param args - The query arguments
39
- * @param config - SDK configuration
40
- * @returns Query options configuration
41
- */
42
- function listBalancesOptions(args, config) {
43
- return infiniteQueryOptions({
44
- ...args.query,
45
- queryKey: getListBalancesQueryKey(args),
46
- queryFn: ({ pageParam }) => fetchBalances(args, config, pageParam),
47
- initialPageParam: {
48
- page: 1,
49
- pageSize: 30
50
- },
51
- getNextPageParam: (lastPage) => lastPage.page.after
52
- });
53
- }
54
-
55
- //#endregion
56
- export { fetchBalances, getListBalancesQueryKey, listBalancesOptions };
57
- //# sourceMappingURL=listBalances-BxpxBCvn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listBalances-BxpxBCvn.js","names":[],"sources":["../src/react/queries/tokens/listBalances.ts"],"sourcesContent":["import type { GetTokenBalancesReturn, Page } from '@0xsequence/indexer';\nimport { infiniteQueryOptions } from '@tanstack/react-query';\nimport type { Address, Hex } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport { balanceQueries, getIndexerClient, LaosAPI } from '../../_internal';\n\nexport type UseListBalancesArgs = {\n\tchainId: number;\n\taccountAddress?: Address;\n\tcontractAddress?: Address;\n\ttokenId?: string;\n\tincludeMetadata?: boolean;\n\tmetadataOptions?: {\n\t\tverifiedOnly?: boolean;\n\t\tunverifiedOnly?: boolean;\n\t\tincludeContracts?: Hex[];\n\t};\n\tincludeCollectionTokens?: boolean;\n\tpage?: Page;\n\tisLaos721?: boolean;\n\t//TODO: More options\n\tquery?: {\n\t\tenabled?: boolean;\n\t};\n};\n\nexport async function fetchBalances(\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n\tpage: Page,\n): Promise<GetTokenBalancesReturn> {\n\tif (args.isLaos721 && args.accountAddress) {\n\t\tconst laosClient = new LaosAPI();\n\t\treturn laosClient.getTokenBalances({\n\t\t\tchainId: args.chainId.toString(),\n\t\t\taccountAddress: args.accountAddress,\n\t\t\tcontractAddress: args.contractAddress as Address,\n\t\t\tincludeMetadata: args.includeMetadata,\n\t\t\tpage: {\n\t\t\t\tsort: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumn: 'CREATED_AT',\n\t\t\t\t\t\torder: 'DESC',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t});\n\t}\n\n\tconst indexerClient = getIndexerClient(args.chainId, config);\n\treturn indexerClient.getTokenBalances({\n\t\t...args,\n\t\ttokenID: args.tokenId,\n\t\tpage: page,\n\t});\n}\n\nexport function getListBalancesQueryKey(args: UseListBalancesArgs) {\n\tconst apiArgs = {\n\t\tchainId: args.chainId,\n\t\taccountAddress: args.accountAddress,\n\t\tcontractAddress: args.contractAddress,\n\t\ttokenID: args.tokenId,\n\t\tincludeMetadata: args.includeMetadata,\n\t\tmetadataOptions: args.metadataOptions,\n\t\tincludeCollectionTokens: args.includeCollectionTokens,\n\t\tisLaos721: args.isLaos721,\n\t};\n\n\treturn [...balanceQueries.lists, apiArgs] as const;\n}\n\n/**\n * Creates a tanstack infinite query options object for the balances query\n *\n * @param args - The query arguments\n * @param config - SDK configuration\n * @returns Query options configuration\n */\nexport function listBalancesOptions(\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n) {\n\treturn infiniteQueryOptions({\n\t\t...args.query,\n\t\tqueryKey: getListBalancesQueryKey(args),\n\t\tqueryFn: ({ pageParam }) => fetchBalances(args, config, pageParam),\n\t\tinitialPageParam: { page: 1, pageSize: 30 } as Page,\n\t\tgetNextPageParam: (lastPage) => lastPage.page.after,\n\t});\n}\n"],"mappings":";;;;AA0BA,eAAsB,cACrB,MACA,QACA,MACkC;AAClC,KAAI,KAAK,aAAa,KAAK,eAE1B,QADmB,IAAI,SAAS,CACd,iBAAiB;EAClC,SAAS,KAAK,QAAQ,UAAU;EAChC,gBAAgB,KAAK;EACrB,iBAAiB,KAAK;EACtB,iBAAiB,KAAK;EACtB,MAAM,EACL,MAAM,CACL;GACC,QAAQ;GACR,OAAO;GACP,CACD,EACD;EACD,CAAC;AAIH,QADsB,iBAAiB,KAAK,SAAS,OAAO,CACvC,iBAAiB;EACrC,GAAG;EACH,SAAS,KAAK;EACR;EACN,CAAC;;AAGH,SAAgB,wBAAwB,MAA2B;CAClE,MAAM,UAAU;EACf,SAAS,KAAK;EACd,gBAAgB,KAAK;EACrB,iBAAiB,KAAK;EACtB,SAAS,KAAK;EACd,iBAAiB,KAAK;EACtB,iBAAiB,KAAK;EACtB,yBAAyB,KAAK;EAC9B,WAAW,KAAK;EAChB;AAED,QAAO,CAAC,GAAG,eAAe,OAAO,QAAQ;;;;;;;;;AAU1C,SAAgB,oBACf,MACA,QACC;AACD,QAAO,qBAAqB;EAC3B,GAAG,KAAK;EACR,UAAU,wBAAwB,KAAK;EACvC,UAAU,EAAE,gBAAgB,cAAc,MAAM,QAAQ,UAAU;EAClE,kBAAkB;GAAE,MAAM;GAAG,UAAU;GAAI;EAC3C,mBAAmB,aAAa,SAAS,KAAK;EAC9C,CAAC"}
@@ -1 +0,0 @@
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":";;;;;;;;;;AAqBA,eAAsB,cACrB,QACgC;CAChC,MAAM,EAAE,SAAS,iBAAiB,WAAW;CAG7C,IAAI,aAFgB,gBAAgB,CAEP,aAAa,CAAC,GAAG,aAAa,OAAO,QAAQ,CAAC;AAI3E,KAAI,CAAC,WAEJ,cAAa,MADa,qBAAqB,OAAO,CAEpD,eAAe,EAAE,SAAS,OAAO,QAAQ,EAAE,CAAC,CAC5C,MAAM,SAAS,KAAK,WAAW;AAGlC,KAAI,CAAC,YAAY,OAChB,OAAM,IAAI,MAAM,yBAAyB;CAE1C,MAAM,WAAW,WAAW,MAC1B,eACAA,WAAS,gBAAgB,aAAa,KAAK,gBAAgB,aAAa,CACzE;AAED,KAAI,CAAC,SACJ,OAAM,IAAI,MAAM,qBAAqB;AAGtC,QAAO;;AAOR,SAAgB,oBAAoB,QAA8B;CACjE,MAAM,UAAU;EACf,SAAS,OAAO,OAAO,QAAS;EAChC,iBAAiB,OAAO;EACxB;AAED,QAAO,CAAC,GAAG,aAAa,SAAS,QAAQ;;AAG1C,SAAgB,qBAAqB,QAA8B;CAClE,MAAM,UAAU,QACf,OAAO,WACN,OAAO,mBACP,OAAO,WACN,OAAO,OAAO,WAAW,MAC3B;AAED,QAAO,aAAa;EACnB,UAAU,oBAAoB,OAAO;EACrC,SACC,OAAO,WAAW,OAAO,wBAEtB,cAAc;GAEb,SAAS,OAAO;GAEhB,iB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C3B,YAAY;EAChB,MAAM,SACL,YAAY,QAAQ,EAAE,KAAK,GAAG,KAC3B,YAAY,QAAQ,EAAE,KAAK,GAC3B,YAAY;AAChB,SAAO,SAAS;GACf;AAGH,KAAI,WACH,iBAAgB,cAAc,QAA0B,KAAK,WAAW;EACvE,MAAM,gBAAgB,WAAW,MAAM,SAAS,KAAK,QAAQ,OAAO,KAAK;AAEzE,MAAI,CAAC,eAAe;AACnB,OAAI,KAAK,OAAO;AAChB,UAAO;;AAGR,MAAI,cAAc,cAAc,gBAAgB,WAC/C,QAAO;AAGR,MACC,cAAc,cAAc,gBAAgB,kBAC5C,cAAc,OACb;GACD,MAAM,iBACL,OAAO,QAAQ,QAAQ,UAAU,UAAU,cAAc,MAAM,IAAI,EAAE;AACtE,OAAI,eAAe,SAAS,EAC3B,KAAI,KAAK;IAAE,GAAG;IAAQ,QAAQ;IAAgB,CAAC;;AAIjD,SAAO;IACL,EAAE,CAAC;AAGP,QAAO;;AAOR,SAAgB,mBAAmB,QAA6B;AAQ/D,QAAO;EACN;EARe;GACf,SAAS,OAAO,OAAO,QAAQ;GAC/B,iBAAiB,OAAO;GACxB,mBAAmB;GACnB,uBAAuB,OAAO;GAC9B;EAKA,EAAE,gBAAgB,OAAO,gBAAgB;EACzC;;AAGF,SAAgB,oBAAoB,QAA6B;CAChE,MAAM,UAAU,QACf,OAAO,WACN,OAAO,qBACP,OAAO,WACN,OAAO,OAAO,WAAW,MAC3B;AAED,QAAO,aAAa;EACnB,UAAU,mBAAmB,OAAO;EACpC,eACC,aAAa;GAEZ,SAAS,OAAO;GAEhB,mBAAmB,OAAO;GAC1B,gBAAgB,OAAO;GACvB,uBAAuB,OAAO;GAE9B,QAAQ,OAAO;GACf,CAAC;EACH,GAAG,OAAO;EACV;EACA,CAAC"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"marketplace-logos-D4dS1Foy.js","names":[],"sources":["../src/react/ui/components/marketplace-logos/marketplace-logos.tsx"],"sourcesContent":["import { Image } from '@0xsequence/design-system';\nimport { type ComponentProps, lazy, Suspense } from 'react';\n\n/* @__PURE__ */\nconst createMarketplaceLogo = (\n\timportFn: () => Promise<{ default: string }>,\n\talt: string,\n) => {\n\tconst LazyLogo = lazy(async () => {\n\t\tconst src = await importFn();\n\t\treturn {\n\t\t\tdefault: function MarketplaceLogo({\n\t\t\t\talt: altProp,\n\t\t\t\t...props\n\t\t\t}: ComponentProps<typeof Image>) {\n\t\t\t\treturn <Image src={src.default} alt={altProp || alt} {...props} />;\n\t\t\t},\n\t\t};\n\t});\n\n\treturn function MarketplaceLogo(props: ComponentProps<typeof Image>) {\n\t\treturn (\n\t\t\t<Suspense\n\t\t\t\tfallback={<div style={{ width: props.width, height: props.height }} />}\n\t\t\t>\n\t\t\t\t{/* @ts-ignore */}\n\t\t\t\t<LazyLogo {...props} />\n\t\t\t</Suspense>\n\t\t);\n\t};\n};\n\nexport const AlienSwapLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/alien_swap.png'),\n\t'AlienSwap Logo',\n);\nexport const AquaXyzLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/aqua-xyz.png'),\n\t'AquaXyz Logo',\n);\nexport const AuraLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/aura.png'),\n\t'Aura Logo',\n);\nexport const BlurLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/blur.png'),\n\t'Blur Logo',\n);\nexport const CoinbaseLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/coinbase.png'),\n\t'Coinbase Logo',\n);\nexport const ElementLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/element.png'),\n\t'Element Logo',\n);\nexport const FoundationLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/foundation.png'),\n\t'Foundation Logo',\n);\nexport const LooksRareLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/looks-rare.png'),\n\t'LooksRare Logo',\n);\nexport const MagicEdenLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/magic-eden.png'),\n\t'MagicEden Logo',\n);\nexport const ManifoldLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/manifold.png'),\n\t'Manifold Logo',\n);\nexport const MintifyLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/mintify.png'),\n\t'Mintify Logo',\n);\nexport const NftxLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/nftx.png'),\n\t'NFTX Logo',\n);\nexport const OkxLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/okx.png'),\n\t'OKX Logo',\n);\nexport const OpenSeaLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/open-sea.png'),\n\t'OpenSea Logo',\n);\nexport const RaribleLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/rarible.png'),\n\t'Rarible Logo',\n);\nexport const SequenceLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/sequence.png'),\n\t'Sequence Logo',\n);\nexport const SudoSwapLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/sudo-swap.png'),\n\t'SudoSwap Logo',\n);\nexport const SuperRareLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/super-rare.png'),\n\t'SuperRare Logo',\n);\nexport const X2y2Logo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/x2y2.png'),\n\t'X2Y2 Logo',\n);\nexport const ZoraLogo = createMarketplaceLogo(\n\t() => import('../../images/marketplaces/zora.png'),\n\t'Zora Logo',\n);\n"],"mappings":";;;;;AAIA,MAAM,yBACL,UACA,QACI;CACJ,MAAM,WAAW,KAAK,YAAY;EACjC,MAAM,MAAM,MAAM,UAAU;AAC5B,SAAO,EACN,SAAS,SAAS,gBAAgB,EACjC,KAAK,QACL,GAAG,SAC6B;AAChC,UAAO,oBAAC;IAAM,KAAK,IAAI;IAAS,KAAK,WAAW;IAAK,GAAI;KAAS;KAEnE;GACA;AAEF,QAAO,SAAS,gBAAgB,OAAqC;AACpE,SACC,oBAAC;GACA,UAAU,oBAAC,SAAI,OAAO;IAAE,OAAO,MAAM;IAAO,QAAQ,MAAM;IAAQ,GAAI;aAGtE,oBAAC,YAAS,GAAI,QAAS;IACb;;;AAKd,MAAa,gBAAgB,4BACtB,OAAO,6BACb,iBACA;AACD,MAAa,cAAc,4BACpB,OAAO,2BACb,eACA;AACD,MAAa,WAAW,4BACjB,OAAO,uBACb,YACA;AACD,MAAa,WAAW,4BACjB,OAAO,uBACb,YACA;AACD,MAAa,eAAe,4BACrB,OAAO,2BACb,gBACA;AACD,MAAa,cAAc,4BACpB,OAAO,0BACb,eACA;AACD,MAAa,iBAAiB,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