@0xsequence/marketplace-sdk 1.0.0 → 1.1.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.
- package/.storybook/main.ts +1 -1
- package/.storybook/preview.tsx +0 -1
- package/CHANGELOG.md +62 -13
- package/dist/BellIcon-IpHHEy8h.js +45 -0
- package/dist/BellIcon-IpHHEy8h.js.map +1 -0
- package/dist/{BellIcon-Cb9YEUzJ.js → CartIcon-C8zbor8H.js} +10 -49
- package/dist/CartIcon-C8zbor8H.js.map +1 -0
- package/dist/CollectibleCard-C2EWF0zo.d.ts +8 -0
- package/dist/{_internal-DslqcNC1.js → _internal-DkS2VUn5.js} +1 -1
- package/dist/{_internal-DslqcNC1.js.map → _internal-DkS2VUn5.js.map} +1 -1
- package/dist/{alien_swap-DJ98gZQp.js → alien_swap-BTJ7mSR-.js} +1 -1
- package/dist/{alien_swap-DJ98gZQp.js.map → alien_swap-BTJ7mSR-.js.map} +1 -1
- package/dist/{api-BmEQfSQa.js → api-DuLKn__v.js} +5 -3
- package/dist/api-DuLKn__v.js.map +1 -0
- package/dist/{aqua-xyz-n1PcCCZ0.js → aqua-xyz-BYJ9WSP_.js} +1 -1
- package/dist/{aqua-xyz-n1PcCCZ0.js.map → aqua-xyz-BYJ9WSP_.js.map} +1 -1
- package/dist/{aura-Bevk_YkS.js → aura-D7SUjgro.js} +1 -1
- package/dist/{aura-Bevk_YkS.js.map → aura-D7SUjgro.js.map} +1 -1
- package/dist/{blur-B5sHErx5.js → blur-BcnRFCaV.js} +1 -1
- package/dist/{blur-B5sHErx5.js.map → blur-BcnRFCaV.js.map} +1 -1
- package/dist/builder-api-BFuZNOaN.js.map +1 -1
- package/dist/builder.gen-B9wR2nvF.js.map +1 -1
- package/dist/{coinbase-D30W-lxA.js → coinbase-ChoX9Hw2.js} +1 -1
- package/dist/{coinbase-D30W-lxA.js.map → coinbase-ChoX9Hw2.js.map} +1 -1
- package/dist/components-CUv-wQr8.js +119 -0
- package/dist/components-CUv-wQr8.js.map +1 -0
- package/dist/{contracts-DPHFT2TA.js → contracts-D72LBOX3.js} +4 -5
- package/dist/{contracts-DPHFT2TA.js.map → contracts-D72LBOX3.js.map} +1 -1
- package/dist/{create-config-6uynwTeb.js → create-config-CIfejoCk.js} +6 -11
- package/dist/create-config-CIfejoCk.js.map +1 -0
- package/dist/{create-config-lLSrnkbb.d.ts → create-config-DV_dtaLt.d.ts} +24 -31
- package/dist/{element-C2NJexro.js → element-Dbcv5qya.js} +1 -1
- package/dist/{element-C2NJexro.js.map → element-Dbcv5qya.js.map} +1 -1
- package/dist/{filters-B8XS4tFH.d.ts → filters-zkMJaPey.d.ts} +6 -6
- package/dist/{foundation-QgY1lvUj.js → foundation-QPhUEUy8.js} +1 -1
- package/dist/{foundation-QgY1lvUj.js.map → foundation-QPhUEUy8.js.map} +1 -1
- package/dist/{index-ChSKFOMx.d.ts → index-B6aSbaw2.d.ts} +1 -1
- package/dist/{index-PSPpUxCE.d.ts → index-B8vaT3_s.d.ts} +4 -4
- package/dist/{index-DonXiSg2.d.ts → index-BaytncQc.d.ts} +100 -56
- package/dist/{index-CY5UEX4h.d.ts → index-BoNNplSx.d.ts} +2 -2
- package/dist/{index-QxxS6f9r.d.ts → index-Bv5XVLjH.d.ts} +1 -1
- package/dist/{index-CIkpYltz.d.ts → index-C768pAfu.d.ts} +3 -3
- package/dist/{index-DX0Vm8HY.d.ts → index-CM0ZTePs.d.ts} +1 -1
- package/dist/index-CMPUveNz.d.ts +64 -0
- package/dist/{index-ThUIs-Sy.d.ts → index-CQecU53t.d.ts} +28 -23
- package/dist/{index-CtF7EE2z.d.ts → index-CT8ZorFd.d.ts} +1 -1
- package/dist/{index-Dpyp7fQz.d.ts → index-CXscCUg7.d.ts} +12 -12
- package/dist/{index-ByW08-Z7.d.ts → index-D-UXGo5d.d.ts} +2 -2
- package/dist/{index-D71J5Ghd.d.ts → index-D6YMj82n.d.ts} +79 -79
- package/dist/{index-CQnGIGb5.d.ts → index-DJG0kiII.d.ts} +33 -33
- package/dist/{index-D2HohSwO.d.ts → index-DLUjc7Bx.d.ts} +52 -29
- package/dist/{index-C7xKVIr4.d.ts → index-DMBMM16q.d.ts} +37 -37
- package/dist/{index-DNU9xoGK.d.ts → index-DpeWm_vF.d.ts} +5 -5
- package/dist/{index-BuY_NKSX.d.ts → index-Yobo6icm.d.ts} +40 -28
- package/dist/{index-BGJXqdg6.d.ts → index-jGgfEHfQ.d.ts} +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +12 -11
- package/dist/{listCollectiblesPaginated--AgXjajA.d.ts → listCollectiblesPaginated-Bq0QSOjJ.d.ts} +28 -26
- package/dist/{listCollections-Bbzbz7qW.d.ts → listCollections-dTCq00l5.d.ts} +168 -123
- package/dist/{looks-rare-CMVPny4v.js → looks-rare-C7cQztTR.js} +1 -1
- package/dist/{looks-rare-CMVPny4v.js.map → looks-rare-C7cQztTR.js.map} +1 -1
- package/dist/{lowestListing-BQHfQpfg.d.ts → lowestListing-CB5Te-Q9.d.ts} +41 -17
- package/dist/{magic-eden-IrWp2ZXk.js → magic-eden-D3r7jiBG.js} +1 -1
- package/dist/{magic-eden-IrWp2ZXk.js.map → magic-eden-D3r7jiBG.js.map} +1 -1
- package/dist/{manifold-DeOE-p2G.js → manifold-DsX0CBP-.js} +1 -1
- package/dist/{manifold-DeOE-p2G.js.map → manifold-DsX0CBP-.js.map} +1 -1
- package/dist/{marketCurrencies-CmOMCCOr.d.ts → marketCurrencies-Bzj8X4TL.d.ts} +8 -8
- package/dist/{marketplace-B5Z8G03R.js → marketplace-BYY8OloA.js} +1 -1
- package/dist/{marketplace-B5Z8G03R.js.map → marketplace-BYY8OloA.js.map} +1 -1
- package/dist/{marketplace-logos-D8t86gsW.js → marketplace-logos-Csv2MBwf.js} +21 -21
- package/dist/marketplace-logos-Csv2MBwf.js.map +1 -0
- package/dist/{marketplace.gen-JzNYpM0U.js → marketplace.gen-w2YvbEEo.js} +2 -2
- package/dist/marketplace.gen-w2YvbEEo.js.map +1 -0
- package/dist/{marketplaceConfig-sNh-MA5M.js → marketplaceConfig-BTy75Mbf.js} +8 -9
- package/dist/marketplaceConfig-BTy75Mbf.js.map +1 -0
- package/dist/{mintify-DG3GrljJ.js → mintify-DiOoDmO1.js} +1 -1
- package/dist/{mintify-DG3GrljJ.js.map → mintify-DiOoDmO1.js.map} +1 -1
- package/dist/{network-DnBEe1Ur.js → network-DtmiMhcg.js} +2 -2
- package/dist/network-DtmiMhcg.js.map +1 -0
- package/dist/networkconfigToWagmiChain-DbUf6HiO.js +15 -0
- package/dist/networkconfigToWagmiChain-DbUf6HiO.js.map +1 -0
- package/dist/{nftx-B3LH-ZYM.js → nftx-CP82jNra.js} +1 -1
- package/dist/{nftx-B3LH-ZYM.js.map → nftx-CP82jNra.js.map} +1 -1
- package/dist/{okx-CRFLrT3Z.js → okx-p9-4xRjs.js} +1 -1
- package/dist/{okx-CRFLrT3Z.js.map → okx-p9-4xRjs.js.map} +1 -1
- package/dist/{open-sea-cOpfl366.js → open-sea-D2GwAmKS.js} +1 -1
- package/dist/{open-sea-cOpfl366.js.map → open-sea-D2GwAmKS.js.map} +1 -1
- package/dist/{primary-sale-CLjXRrDj.js → primary-sale-DOmNDq2P.js} +1 -1
- package/dist/{primary-sale-CLjXRrDj.js.map → primary-sale-DOmNDq2P.js.map} +1 -1
- package/dist/{queries-BYT4GJw3.js → queries-EMA5CcwY.js} +208 -287
- package/dist/queries-EMA5CcwY.js.map +1 -0
- package/dist/{query-BTe7Wkrs.d.ts → query-BG-MA1MB.d.ts} +1 -1
- package/dist/{rarible-guwUx4cn.js → rarible-DqiiW9ki.js} +1 -1
- package/dist/{rarible-guwUx4cn.js.map → rarible-DqiiW9ki.js.map} +1 -1
- package/dist/react/_internal/api/index.d.ts +1 -1
- package/dist/react/_internal/api/index.js +4 -4
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +24 -21
- package/dist/react/_internal/index.d.ts +1 -1
- package/dist/react/_internal/index.js +8 -7
- package/dist/react/_internal/wagmi/index.d.ts +1 -1
- package/dist/react/_internal/wagmi/index.js +4 -3
- package/dist/react/hooks/config/index.d.ts +8 -8
- package/dist/react/hooks/config/index.js +24 -21
- package/dist/react/hooks/contracts/index.d.ts +6 -6
- package/dist/react/hooks/contracts/index.js +13 -12
- package/dist/react/hooks/data/collectibles/index.d.ts +4 -4
- package/dist/react/hooks/data/collectibles/index.js +24 -21
- package/dist/react/hooks/data/collections/index.d.ts +10 -10
- package/dist/react/hooks/data/collections/index.js +24 -21
- package/dist/react/hooks/data/index.d.ts +29 -29
- package/dist/react/hooks/data/index.js +25 -22
- package/dist/react/hooks/data/inventory/index.d.ts +28 -28
- package/dist/react/hooks/data/inventory/index.js +24 -21
- package/dist/react/hooks/data/market/index.d.ts +5 -11
- package/dist/react/hooks/data/market/index.js +24 -21
- package/dist/react/hooks/data/orders/index.d.ts +5 -11
- package/dist/react/hooks/data/orders/index.js +25 -22
- package/dist/react/hooks/data/primary-sales/index.d.ts +28 -28
- package/dist/react/hooks/data/primary-sales/index.js +24 -21
- package/dist/react/hooks/data/tokens/index.d.ts +4 -4
- package/dist/react/hooks/data/tokens/index.js +24 -21
- package/dist/react/hooks/index.d.ts +29 -29
- package/dist/react/hooks/index.js +25 -22
- package/dist/react/hooks/transactions/index.d.ts +2 -2
- package/dist/react/hooks/transactions/index.js +24 -21
- package/dist/react/hooks/ui/index.d.ts +4 -4
- package/dist/react/hooks/ui/index.js +24 -21
- package/dist/react/hooks/utils/index.d.ts +29 -29
- package/dist/react/hooks/utils/index.js +25 -22
- package/dist/react/index.d.ts +29 -29
- package/dist/react/index.js +25 -22
- package/dist/react/queries/index.d.ts +16 -16
- package/dist/react/queries/index.js +18 -17
- package/dist/react/ssr/index.d.ts +7 -7
- package/dist/react/ssr/index.js +9 -8
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.d.ts +3 -0
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.js +22 -0
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +54 -0
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +29 -0
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +5 -5
- package/dist/react/ui/components/marketplace-collectible-card/index.js +24 -21
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +2 -2
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +9 -8
- package/dist/react/ui/components/marketplace-logos/index.d.ts +21 -21
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/icons/index.js +13 -11
- package/dist/react/ui/index.d.ts +5 -5
- package/dist/react/ui/index.js +24 -21
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +24 -21
- package/dist/react/utils/index.d.ts +1 -1
- package/dist/react/utils/index.js +5 -5
- package/dist/{react-Ceq8mamy.js → react-BLJ4DkPx.js} +723 -807
- package/dist/react-BLJ4DkPx.js.map +1 -0
- package/dist/{react-CbqXKOpt.css → react-F03jPjPk.css} +1 -1
- package/dist/{react-CbqXKOpt.css.map → react-F03jPjPk.css.map} +1 -1
- package/dist/{sequence-Dt2Xo7Fa.js → sequence-Bbb-TFKg.js} +1 -1
- package/dist/{sequence-Dt2Xo7Fa.js.map → sequence-Bbb-TFKg.js.map} +1 -1
- package/dist/styles/index.css +46 -24
- package/dist/{sudo-swap-CGoARONs.js → sudo-swap-CEPIM3Js.js} +1 -1
- package/dist/{sudo-swap-CGoARONs.js.map → sudo-swap-CEPIM3Js.js.map} +1 -1
- package/dist/{super-rare-NeQtZjcn.js → super-rare-CMEn9PoO.js} +1 -1
- package/dist/{super-rare-NeQtZjcn.js.map → super-rare-CMEn9PoO.js.map} +1 -1
- package/dist/{token-D9gZVqbX.js → token-CcyLz8Z8.js} +1 -1
- package/dist/{token-D9gZVqbX.js.map → token-CcyLz8Z8.js.map} +1 -1
- package/dist/{tokenSupplies-DXtkRYNO.d.ts → tokenSupplies-C470zTT0.d.ts} +23 -23
- package/dist/{transaction-CC2KxNF6.js → transaction-DZUW5RHu.js} +2 -8
- package/dist/transaction-DZUW5RHu.js.map +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +2 -2
- package/dist/{types-G2PWxiJR.js → types-B_-cnkcP.js} +1 -1
- package/dist/types-B_-cnkcP.js.map +1 -0
- package/dist/{types-BlCa0TVE.d.ts → types-D6LkVrF0.d.ts} +18 -10
- package/dist/utils/abi/index.d.ts +4 -4
- package/dist/utils/abi/index.js +4 -4
- package/dist/utils/abi/marketplace/index.d.ts +1 -1
- package/dist/utils/abi/marketplace/index.js +1 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1 -1
- package/dist/utils/abi/primary-sale/index.js +1 -1
- package/dist/utils/abi/token/index.d.ts +1 -1
- package/dist/utils/abi/token/index.js +1 -1
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/index.js +11 -10
- package/dist/{utils-CKJd-CRf.js → utils-BZEkdqWK.js} +7 -24
- package/dist/utils-BZEkdqWK.js.map +1 -0
- package/dist/{utils-wquIhK6T.js → utils-oVZxdK0o.js} +2 -2
- package/dist/utils-oVZxdK0o.js.map +1 -0
- package/dist/{waitForTransactionReceipt-DZxAuR9N.js → waitForTransactionReceipt-B08YZiDY.js} +3 -4
- package/dist/{waitForTransactionReceipt-DZxAuR9N.js.map → waitForTransactionReceipt-B08YZiDY.js.map} +1 -1
- package/dist/{x2y2-CQdg24VP.js → x2y2-DNe6JgtG.js} +1 -1
- package/dist/{x2y2-CQdg24VP.js.map → x2y2-DNe6JgtG.js.map} +1 -1
- package/dist/{zora-DdEydy4L.js → zora-w0Zqxxs4.js} +1 -1
- package/dist/{zora-DdEydy4L.js.map → zora-w0Zqxxs4.js.map} +1 -1
- package/package.json +35 -35
- package/src/react/_internal/api/marketplace.gen.ts +1 -1
- package/src/react/_internal/api/query-keys.ts +2 -0
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +19 -8
- package/src/react/_internal/wagmi/create-config.ts +6 -17
- package/src/react/hooks/config/__snapshots__/useMarketplaceConfig.test.tsx.snap +4 -4
- package/src/react/hooks/data/collectibles/useBalanceOfCollectible.laos.test.tsx +2 -2
- package/src/react/hooks/data/collectibles/useTokenBalances.test.tsx +151 -0
- package/src/react/hooks/data/collectibles/useTokenBalances.tsx +47 -0
- package/src/react/hooks/data/collections/__snapshots__/useListCollections.test.tsx.snap +6 -6
- package/src/react/hooks/data/inventory/useInventory.test.tsx +3 -98
- package/src/react/hooks/data/inventory/useInventory.tsx +2 -2
- package/src/react/hooks/data/market/useListMarketCardData.tsx +1 -1
- package/src/react/hooks/data/orders/useListOffersForCollectible.tsx +70 -45
- package/src/react/hooks/data/primary-sales/useList1155ShopCardData.tsx +21 -37
- package/src/react/hooks/data/primary-sales/useList721ShopCardData.tsx +14 -3
- package/src/react/hooks/data/tokens/useSearchTokenMetadata.tsx +4 -1
- package/src/react/hooks/transactions/useCancelOrder.test.tsx +7 -4
- package/src/react/hooks/transactions/useCancelOrder.tsx +2 -1
- package/src/react/hooks/transactions/useCancelTransactionSteps.tsx +2 -2
- package/src/react/hooks/transactions/useProcessStep.test.tsx +2 -2
- package/src/react/hooks/utils/__tests__/useEnsureCorrectChain.test.tsx +75 -0
- package/src/react/hooks/utils/index.ts +0 -1
- package/src/react/hooks/utils/useEnsureCorrectChain.ts +31 -34
- package/src/react/providers/index.tsx +12 -14
- package/src/react/providers/modal-provider.tsx +2 -2
- package/src/react/queries/__tests__/balanceOfCollectible.laos.test.ts +3 -3
- package/src/react/queries/__tests__/inventory.laos.test.ts +6 -3
- package/src/react/queries/__tests__/tokenBalances.laos.test.ts +123 -0
- package/src/react/queries/balanceOfCollectible.ts +2 -1
- package/src/react/queries/filters.ts +23 -28
- package/src/react/queries/index.ts +1 -0
- package/src/react/queries/inventory.ts +63 -243
- package/src/react/queries/listCollectibles.ts +22 -48
- package/src/react/queries/listCollections.ts +10 -13
- package/src/react/queries/listOffersForCollectible.ts +101 -0
- package/src/react/queries/marketplaceConfig.ts +6 -2
- package/src/react/queries/tokenBalances.ts +85 -0
- package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +4 -4
- package/src/react/ui/components/_internals/action-button/ActionButton.stories.tsx +8 -8
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +6 -9
- package/src/react/ui/components/_internals/action-button/__tests__/NonOwnerActions.test.tsx +4 -4
- package/src/react/ui/components/_internals/action-button/components/NonOwnerActions.tsx +6 -6
- package/src/react/ui/components/_internals/custom-select/__tests__/CustomSelect.test.tsx +1 -1
- package/src/react/ui/components/marketplace-collectible-card/CollectibleCard.tsx +4 -3
- package/src/react/ui/components/marketplace-collectible-card/CollectibleCardSkeleton.tsx +13 -2
- package/src/react/ui/components/marketplace-collectible-card/components/ActionButtonWrapper.tsx +4 -7
- package/src/react/ui/components/marketplace-collectible-card/components/BaseCard.tsx +14 -5
- package/src/react/ui/components/marketplace-collectible-card/components/footer/Footer.tsx +179 -0
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/FooterName.tsx +103 -0
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/PriceDisplay.tsx +80 -0
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/SaleDetailsPill.tsx +29 -0
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/TokenTypeBalancePill.tsx +30 -0
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/index.ts +4 -0
- package/src/react/ui/components/marketplace-collectible-card/components/footer/index.ts +2 -0
- package/src/react/ui/components/marketplace-collectible-card/types.ts +18 -6
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +11 -23
- package/src/react/ui/components/marketplace-collectible-card/variants/NonTradableInventoryCard.tsx +42 -0
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +15 -12
- package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +10 -10
- package/src/react/ui/modals/BuyModal/__tests__/ERC1155ShopModal.test.tsx +3 -3
- package/src/react/ui/modals/BuyModal/__tests__/Modal.test.tsx.bak +3 -3
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +6 -6
- package/src/react/ui/modals/BuyModal/__tests__/store.test.ts +3 -3
- package/src/react/ui/modals/BuyModal/components/BuyModalRouter.tsx +5 -5
- package/src/react/ui/modals/BuyModal/components/ERC1155BuyModal.tsx +2 -2
- package/src/react/ui/modals/BuyModal/components/ERC1155QuantityModal.tsx +8 -8
- package/src/react/ui/modals/BuyModal/components/ERC1155ShopModal.tsx +2 -2
- package/src/react/ui/modals/BuyModal/hooks/useERC1155Checkout.ts +13 -2
- package/src/react/ui/modals/BuyModal/store.ts +6 -6
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +2 -1
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +1 -1
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +87 -89
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +2 -1
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +1 -1
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +2 -1
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +2 -1
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.test.tsx +20 -9
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +2 -2
- package/src/react/ui/modals/_internal/components/switchChainErrorModal/__tests__/SwitchChainErrorModal.test.tsx +80 -0
- package/src/react/ui/modals/_internal/components/switchChainErrorModal/index.tsx +64 -0
- package/src/react/ui/modals/_internal/components/switchChainErrorModal/store.ts +42 -0
- package/src/react/ui/modals/_internal/types.ts +0 -1
- package/src/styles/styles.ts +46 -24
- package/src/types/new-marketplace-types.ts +9 -18
- package/src/types/types.ts +1 -1
- package/test/globalSetup.ts +1 -1
- package/test/test-utils.tsx +1 -0
- package/dist/BellIcon-Cb9YEUzJ.js.map +0 -1
- package/dist/CollectibleCard-CYyWzk6u.d.ts +0 -8
- package/dist/api-BmEQfSQa.js.map +0 -1
- package/dist/create-config-6uynwTeb.js.map +0 -1
- package/dist/marketplace-logos-D8t86gsW.js.map +0 -1
- package/dist/marketplace.gen-JzNYpM0U.js.map +0 -1
- package/dist/marketplaceConfig-sNh-MA5M.js.map +0 -1
- package/dist/network-DnBEe1Ur.js.map +0 -1
- package/dist/queries-BYT4GJw3.js.map +0 -1
- package/dist/react-Ceq8mamy.js.map +0 -1
- package/dist/transaction-CC2KxNF6.js.map +0 -1
- package/dist/types-G2PWxiJR.js.map +0 -1
- package/dist/utils-CKJd-CRf.js.map +0 -1
- package/dist/utils-wquIhK6T.js.map +0 -1
- package/src/react/hooks/utils/useSwitchChainWithModal.ts +0 -38
- package/src/react/ui/components/marketplace-collectible-card/Footer.tsx +0 -238
- package/src/react/ui/modals/_internal/components/switchChainModal/__tests__/SwitchChainModal.test.tsx +0 -117
- package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +0 -124
- package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +0 -71
- /package/dist/{abi-Wr_aTZFi.js → abi-DYsUABe6.js} +0 -0
- /package/dist/{index-q7f-WDBS.d.ts → index-Cg5cFzs-.d.ts} +0 -0
- /package/dist/{wagmi-BhP3mdhP.js → wagmi-Bseovd6Q.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FilterCondition } from "./builder.gen-B9wR2nvF.js";
|
|
2
|
-
import { LaosAPI, balanceQueries, collectableKeys, collectionKeys, currencyKeys, getIndexerClient, getMarketplaceClient, getMetadataClient, getQueryClient, tokenKeys } from "./api-
|
|
3
|
-
import { OrderSide } from "./marketplace.gen-
|
|
4
|
-
import { compareAddress } from "./utils-
|
|
5
|
-
import { fetchMarketplaceConfig, marketplaceConfigOptions } from "./marketplaceConfig-
|
|
2
|
+
import { LaosAPI, balanceQueries, collectableKeys, collectionKeys, currencyKeys, getIndexerClient, getMarketplaceClient, getMetadataClient, getQueryClient, tokenKeys } from "./api-DuLKn__v.js";
|
|
3
|
+
import { OrderSide } from "./marketplace.gen-w2YvbEEo.js";
|
|
4
|
+
import { compareAddress } from "./utils-BZEkdqWK.js";
|
|
5
|
+
import { fetchMarketplaceConfig, marketplaceConfigOptions } from "./marketplaceConfig-BTy75Mbf.js";
|
|
6
6
|
import { infiniteQueryOptions, queryOptions, skipToken } from "@tanstack/react-query";
|
|
7
7
|
import { formatUnits, zeroAddress } from "viem";
|
|
8
8
|
|
|
@@ -15,22 +15,17 @@ import { formatUnits, zeroAddress } from "viem";
|
|
|
15
15
|
* @returns The balance data
|
|
16
16
|
*/
|
|
17
17
|
async function fetchBalanceOfCollectible(args, config) {
|
|
18
|
-
if (args.isLaos721) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
return response.balances[0] || null;
|
|
27
|
-
}
|
|
28
|
-
const indexerClient = getIndexerClient(args.chainId, config);
|
|
29
|
-
return indexerClient.getTokenBalances({
|
|
18
|
+
if (args.isLaos721) return (await new LaosAPI().getTokenBalances({
|
|
19
|
+
chainId: args.chainId.toString(),
|
|
20
|
+
contractAddress: args.collectionAddress,
|
|
21
|
+
accountAddress: args.userAddress,
|
|
22
|
+
includeMetadata: true
|
|
23
|
+
})).balances[0] || null;
|
|
24
|
+
return getIndexerClient(args.chainId, config).getTokenBalances({
|
|
30
25
|
accountAddress: args.userAddress,
|
|
31
26
|
contractAddress: args.collectionAddress,
|
|
32
27
|
tokenID: args.collectableId,
|
|
33
|
-
includeMetadata: false,
|
|
28
|
+
includeMetadata: args.includeMetadata ?? false,
|
|
34
29
|
metadataOptions: {
|
|
35
30
|
verifiedOnly: true,
|
|
36
31
|
includeContracts: [args.collectionAddress]
|
|
@@ -68,8 +63,7 @@ async function fetchCollectible(params) {
|
|
|
68
63
|
chainID: String(chainId),
|
|
69
64
|
tokenIDs: [collectibleId]
|
|
70
65
|
};
|
|
71
|
-
|
|
72
|
-
return result.tokenMetadata[0];
|
|
66
|
+
return (await metadataClient.getTokenMetadata(apiArgs)).tokenMetadata[0];
|
|
73
67
|
}
|
|
74
68
|
function collectibleQueryOptions(params) {
|
|
75
69
|
const enabled = Boolean(params.collectionAddress && params.collectibleId && params.chainId && params.config && (params.query?.enabled ?? true));
|
|
@@ -101,15 +95,13 @@ async function fetchCountOfCollectables(params) {
|
|
|
101
95
|
filter,
|
|
102
96
|
side
|
|
103
97
|
};
|
|
104
|
-
|
|
105
|
-
return result$1.count;
|
|
98
|
+
return (await client.getCountOfFilteredCollectibles(apiArgs$1)).count;
|
|
106
99
|
}
|
|
107
100
|
const apiArgs = {
|
|
108
101
|
contractAddress: collectionAddress,
|
|
109
102
|
chainId: String(chainId)
|
|
110
103
|
};
|
|
111
|
-
|
|
112
|
-
return result.count;
|
|
104
|
+
return (await client.getCountOfAllCollectibles(apiArgs)).count;
|
|
113
105
|
}
|
|
114
106
|
function countOfCollectablesQueryOptions(params) {
|
|
115
107
|
const enabled = Boolean(params.collectionAddress && params.chainId && params.config && (params.query?.enabled ?? true));
|
|
@@ -169,21 +161,17 @@ function listCollectibleActivitiesQueryOptions(params) {
|
|
|
169
161
|
//#endregion
|
|
170
162
|
//#region src/react/queries/listBalances.ts
|
|
171
163
|
async function fetchBalances(args, config, page) {
|
|
172
|
-
if (args.isLaos721 && args.accountAddress) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
const indexerClient = getIndexerClient(args.chainId, config);
|
|
186
|
-
return indexerClient.getTokenBalances({
|
|
164
|
+
if (args.isLaos721 && args.accountAddress) return new LaosAPI().getTokenBalances({
|
|
165
|
+
chainId: args.chainId.toString(),
|
|
166
|
+
accountAddress: args.accountAddress,
|
|
167
|
+
contractAddress: args.contractAddress,
|
|
168
|
+
includeMetadata: args.includeMetadata,
|
|
169
|
+
page: { sort: [{
|
|
170
|
+
column: "CREATED_AT",
|
|
171
|
+
order: "DESC"
|
|
172
|
+
}] }
|
|
173
|
+
});
|
|
174
|
+
return getIndexerClient(args.chainId, config).getTokenBalances({
|
|
187
175
|
...args,
|
|
188
176
|
tokenID: args.tokenId,
|
|
189
177
|
page
|
|
@@ -218,38 +206,24 @@ function listBalancesOptions(args, config) {
|
|
|
218
206
|
/**
|
|
219
207
|
* Fetches a list of collectibles with pagination support from the Marketplace API
|
|
220
208
|
*/
|
|
221
|
-
async function fetchListCollectibles(params,
|
|
209
|
+
async function fetchListCollectibles(params, page) {
|
|
222
210
|
const { collectionAddress, chainId, config,...additionalApiParams } = params;
|
|
223
211
|
const marketplaceClient = getMarketplaceClient(config);
|
|
212
|
+
const isMarketCollection = (await fetchMarketplaceConfig({ config }))?.market.collections.some((collection) => compareAddress(collection.itemsAddress, collectionAddress));
|
|
213
|
+
if (params.enabled === false || !isMarketCollection) return {
|
|
214
|
+
collectibles: [],
|
|
215
|
+
page: {
|
|
216
|
+
page: 1,
|
|
217
|
+
pageSize: 30,
|
|
218
|
+
more: false
|
|
219
|
+
}
|
|
220
|
+
};
|
|
224
221
|
const apiArgs = {
|
|
225
222
|
contractAddress: collectionAddress,
|
|
226
223
|
chainId: String(chainId),
|
|
227
224
|
page,
|
|
228
225
|
...additionalApiParams
|
|
229
226
|
};
|
|
230
|
-
if (params.marketplaceType === "shop") {
|
|
231
|
-
const shopCollection = marketplaceConfig.shop.collections.find((collection) => compareAddress(collection.itemsAddress, params.collectionAddress));
|
|
232
|
-
if (!shopCollection) return { collectibles: [] };
|
|
233
|
-
const primarySaleItemsList = await marketplaceClient.listPrimarySaleItems({
|
|
234
|
-
chainId: params.chainId.toString(),
|
|
235
|
-
primarySaleContractAddress: shopCollection.saleAddress
|
|
236
|
-
}, marketplaceConfig);
|
|
237
|
-
return { collectibles: primarySaleItemsList.primarySaleItems.map((item) => ({
|
|
238
|
-
metadata: item.metadata,
|
|
239
|
-
primarySale: {
|
|
240
|
-
price: {
|
|
241
|
-
amount: item.primarySaleItem.priceAmount,
|
|
242
|
-
formatted: item.primarySaleItem.priceAmountFormatted,
|
|
243
|
-
decimals: item.primarySaleItem.priceDecimals,
|
|
244
|
-
currencyAddress: item.primarySaleItem.currencyAddress
|
|
245
|
-
},
|
|
246
|
-
startDate: item.primarySaleItem.startDate,
|
|
247
|
-
endDate: item.primarySaleItem.endDate,
|
|
248
|
-
supplyCap: item.primarySaleItem.supply,
|
|
249
|
-
itemType: item.primarySaleItem.itemType
|
|
250
|
-
}
|
|
251
|
-
})) };
|
|
252
|
-
}
|
|
253
227
|
if (params.isLaos721 && params.side === OrderSide.listing) try {
|
|
254
228
|
const fetchBalancesArgs = {
|
|
255
229
|
chainId: params.chainId,
|
|
@@ -260,20 +234,19 @@ async function fetchListCollectibles(params, marketplaceConfig, page) {
|
|
|
260
234
|
isLaos721: true
|
|
261
235
|
};
|
|
262
236
|
const balances = await fetchBalances(fetchBalancesArgs, config, page);
|
|
263
|
-
const collectibles = balances.balances.map((balance) => {
|
|
264
|
-
if (!balance.tokenMetadata) throw new Error("Token metadata not found");
|
|
265
|
-
return { metadata: {
|
|
266
|
-
tokenId: balance.tokenID ?? "",
|
|
267
|
-
attributes: balance.tokenMetadata.attributes,
|
|
268
|
-
image: balance.tokenMetadata.image,
|
|
269
|
-
name: balance.tokenMetadata.name,
|
|
270
|
-
description: balance.tokenMetadata.description,
|
|
271
|
-
video: balance.tokenMetadata.video,
|
|
272
|
-
audio: balance.tokenMetadata.audio
|
|
273
|
-
} };
|
|
274
|
-
});
|
|
275
237
|
return {
|
|
276
|
-
collectibles
|
|
238
|
+
collectibles: balances.balances.map((balance) => {
|
|
239
|
+
if (!balance.tokenMetadata) throw new Error("Token metadata not found");
|
|
240
|
+
return { metadata: {
|
|
241
|
+
tokenId: balance.tokenID ?? "",
|
|
242
|
+
attributes: balance.tokenMetadata.attributes,
|
|
243
|
+
image: balance.tokenMetadata.image,
|
|
244
|
+
name: balance.tokenMetadata.name,
|
|
245
|
+
description: balance.tokenMetadata.description,
|
|
246
|
+
video: balance.tokenMetadata.video,
|
|
247
|
+
audio: balance.tokenMetadata.audio
|
|
248
|
+
} };
|
|
249
|
+
}),
|
|
277
250
|
page: balances.page
|
|
278
251
|
};
|
|
279
252
|
} catch (error) {
|
|
@@ -286,7 +259,6 @@ function listCollectiblesQueryOptions(params) {
|
|
|
286
259
|
return infiniteQueryOptions({
|
|
287
260
|
queryKey: [...collectableKeys.lists, params],
|
|
288
261
|
queryFn: async ({ pageParam }) => {
|
|
289
|
-
const marketplaceConfig = await fetchMarketplaceConfig({ config: params.config });
|
|
290
262
|
return fetchListCollectibles({
|
|
291
263
|
chainId: params.chainId,
|
|
292
264
|
collectionAddress: params.collectionAddress,
|
|
@@ -294,8 +266,8 @@ function listCollectiblesQueryOptions(params) {
|
|
|
294
266
|
side: params.side,
|
|
295
267
|
filter: params.filter,
|
|
296
268
|
isLaos721: params.isLaos721,
|
|
297
|
-
|
|
298
|
-
},
|
|
269
|
+
cardType: params.cardType
|
|
270
|
+
}, pageParam);
|
|
299
271
|
},
|
|
300
272
|
initialPageParam: {
|
|
301
273
|
page: 1,
|
|
@@ -356,12 +328,10 @@ function listCollectiblesPaginatedQueryOptions(params) {
|
|
|
356
328
|
*/
|
|
357
329
|
async function fetchCollection(params) {
|
|
358
330
|
const { collectionAddress, chainId, config } = params;
|
|
359
|
-
|
|
360
|
-
const result = await metadataClient.getContractInfo({
|
|
331
|
+
return (await getMetadataClient(config).getContractInfo({
|
|
361
332
|
chainID: chainId.toString(),
|
|
362
333
|
contractAddress: collectionAddress
|
|
363
|
-
});
|
|
364
|
-
return result.contractInfo;
|
|
334
|
+
})).contractInfo;
|
|
365
335
|
}
|
|
366
336
|
function collectionQueryOptions(params) {
|
|
367
337
|
const enabled = Boolean(params.collectionAddress && params.chainId && params.config && (params.query?.enabled ?? true));
|
|
@@ -390,8 +360,7 @@ async function fetchCollectionBalanceDetails(params) {
|
|
|
390
360
|
contractWhitelist: filter.contractWhitelist,
|
|
391
361
|
omitNativeBalances: filter.omitNativeBalances
|
|
392
362
|
} }));
|
|
393
|
-
const
|
|
394
|
-
const mergedResponse = responses.reduce((acc, curr) => {
|
|
363
|
+
const mergedResponse = (await Promise.all(promises)).reduce((acc, curr) => {
|
|
395
364
|
if (!curr) return acc;
|
|
396
365
|
return {
|
|
397
366
|
page: curr.page,
|
|
@@ -437,8 +406,7 @@ async function fetchCollectionDetails(params) {
|
|
|
437
406
|
chainId: String(chainId),
|
|
438
407
|
...additionalApiParams
|
|
439
408
|
};
|
|
440
|
-
|
|
441
|
-
return result.collection;
|
|
409
|
+
return (await marketplaceClient.getCollectionDetail(apiArgs)).collection;
|
|
442
410
|
}
|
|
443
411
|
function collectionDetailsQueryOptions(params) {
|
|
444
412
|
const enabled = Boolean(params.collectionAddress && params.chainId && params.config && (params.query?.enabled ?? true));
|
|
@@ -501,11 +469,11 @@ const allCollections = (marketplaceConfig) => {
|
|
|
501
469
|
* Fetches collections from the metadata API with marketplace config filtering
|
|
502
470
|
*/
|
|
503
471
|
async function fetchListCollections(params) {
|
|
504
|
-
const {
|
|
472
|
+
const { cardType, marketplaceConfig, config } = params;
|
|
505
473
|
const metadataClient = getMetadataClient(config);
|
|
506
474
|
let collections = allCollections(marketplaceConfig);
|
|
507
475
|
if (!collections?.length) return [];
|
|
508
|
-
if (
|
|
476
|
+
if (cardType) collections = collections.filter((collection) => collection.cardType === cardType);
|
|
509
477
|
const collectionsByChain = collections.reduce((acc, curr) => {
|
|
510
478
|
const { chainId, itemsAddress } = curr;
|
|
511
479
|
if (!acc[chainId]) acc[chainId] = [];
|
|
@@ -517,12 +485,9 @@ async function fetchListCollections(params) {
|
|
|
517
485
|
contractAddresses: addresses
|
|
518
486
|
}).then((resp) => Object.values(resp.contractInfoMap)));
|
|
519
487
|
const settled = await Promise.allSettled(promises);
|
|
520
|
-
if (settled.every((result) => result.status === "rejected"))
|
|
521
|
-
const firstError = settled[0];
|
|
522
|
-
throw firstError.reason;
|
|
523
|
-
}
|
|
488
|
+
if (settled.every((result) => result.status === "rejected")) throw settled[0].reason;
|
|
524
489
|
const results = settled.filter((r) => r.status === "fulfilled").flatMap((r) => r.value);
|
|
525
|
-
|
|
490
|
+
return collections.map((collection) => {
|
|
526
491
|
const metadata = results.find((result) => compareAddress(result.address, collection.itemsAddress));
|
|
527
492
|
return {
|
|
528
493
|
collection,
|
|
@@ -532,7 +497,6 @@ async function fetchListCollections(params) {
|
|
|
532
497
|
...collection,
|
|
533
498
|
...metadata
|
|
534
499
|
}));
|
|
535
|
-
return collectionsWithMetadata;
|
|
536
500
|
}
|
|
537
501
|
function listCollectionsQueryOptions(params) {
|
|
538
502
|
const enabled = Boolean(params.marketplaceConfig && params.config && (params.query?.enabled ?? true));
|
|
@@ -541,23 +505,23 @@ function listCollectionsQueryOptions(params) {
|
|
|
541
505
|
queryFn: enabled ? () => fetchListCollections({
|
|
542
506
|
marketplaceConfig: params.marketplaceConfig,
|
|
543
507
|
config: params.config,
|
|
544
|
-
|
|
508
|
+
cardType: params.cardType
|
|
545
509
|
}) : skipToken,
|
|
546
510
|
...params.query,
|
|
547
511
|
enabled
|
|
548
512
|
});
|
|
549
513
|
}
|
|
550
|
-
const listCollectionsOptions = ({
|
|
514
|
+
const listCollectionsOptions = ({ cardType, marketplaceConfig, config }) => {
|
|
551
515
|
return queryOptions({
|
|
552
516
|
queryKey: [...collectionKeys.list, {
|
|
553
|
-
|
|
517
|
+
cardType,
|
|
554
518
|
marketplaceConfig,
|
|
555
519
|
config
|
|
556
520
|
}],
|
|
557
521
|
queryFn: marketplaceConfig ? () => fetchListCollections({
|
|
558
522
|
marketplaceConfig,
|
|
559
523
|
config,
|
|
560
|
-
|
|
524
|
+
cardType
|
|
561
525
|
}) : skipToken,
|
|
562
526
|
enabled: Boolean(marketplaceConfig)
|
|
563
527
|
});
|
|
@@ -570,12 +534,8 @@ const listCollectionsOptions = ({ marketplaceType, marketplaceConfig, config })
|
|
|
570
534
|
*/
|
|
571
535
|
async function fetchCurrency(params) {
|
|
572
536
|
const { chainId, currencyAddress, config } = params;
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
if (!currencies) {
|
|
576
|
-
const marketplaceClient = getMarketplaceClient(config);
|
|
577
|
-
currencies = await marketplaceClient.listCurrencies({ chainId: String(chainId) }).then((resp) => resp.currencies);
|
|
578
|
-
}
|
|
537
|
+
let currencies = getQueryClient().getQueryData([...currencyKeys.lists, chainId]);
|
|
538
|
+
if (!currencies) currencies = await getMarketplaceClient(config).listCurrencies({ chainId: String(chainId) }).then((resp) => resp.currencies);
|
|
579
539
|
if (!currencies?.length) throw new Error("No currencies returned");
|
|
580
540
|
const currency = currencies.find((currency$1) => currency$1.contractAddress.toLowerCase() === currencyAddress.toLowerCase());
|
|
581
541
|
if (!currency) throw new Error("Currency not found");
|
|
@@ -603,15 +563,12 @@ function currencyQueryOptions(params) {
|
|
|
603
563
|
async function fetchMarketCurrencies(params) {
|
|
604
564
|
const { chainId, includeNativeCurrency, collectionAddress, config } = params;
|
|
605
565
|
const includeNativeCurrencyOption = includeNativeCurrency ?? true;
|
|
606
|
-
|
|
607
|
-
let currencies = await marketplaceClient.listCurrencies({ chainId: String(chainId) }).then((resp) => resp.currencies.map((currency) => ({
|
|
566
|
+
let currencies = await getMarketplaceClient(config).listCurrencies({ chainId: String(chainId) }).then((resp) => resp.currencies.map((currency) => ({
|
|
608
567
|
...currency,
|
|
609
568
|
contractAddress: currency.contractAddress || zeroAddress
|
|
610
569
|
})));
|
|
611
570
|
if (collectionAddress) {
|
|
612
|
-
const
|
|
613
|
-
const marketplaceConfig = await queryClient.fetchQuery(marketplaceConfigOptions(config));
|
|
614
|
-
const currenciesOptions = marketplaceConfig.market.collections.find((collection) => compareAddress(collection.itemsAddress, collectionAddress))?.currencyOptions;
|
|
571
|
+
const currenciesOptions = (await getQueryClient().fetchQuery(marketplaceConfigOptions(config))).market.collections.find((collection) => compareAddress(collection.itemsAddress, collectionAddress))?.currencyOptions;
|
|
615
572
|
if (currenciesOptions) currencies = currencies.filter((currency) => currenciesOptions.includes(currency.contractAddress));
|
|
616
573
|
}
|
|
617
574
|
if (!includeNativeCurrencyOption) currencies = currencies.filter((currency) => !currency.nativeCurrency);
|
|
@@ -646,8 +603,7 @@ async function fetchCountListingsForCollectible(params) {
|
|
|
646
603
|
tokenId: collectibleId,
|
|
647
604
|
filter
|
|
648
605
|
};
|
|
649
|
-
|
|
650
|
-
return result.count;
|
|
606
|
+
return (await client.getCountOfListingsForCollectible(apiArgs)).count;
|
|
651
607
|
}
|
|
652
608
|
function countListingsForCollectibleQueryOptions(params) {
|
|
653
609
|
const enabled = Boolean(params.collectionAddress && params.chainId && params.collectibleId && params.config && (params.query?.enabled ?? true));
|
|
@@ -679,8 +635,7 @@ async function fetchCountOffersForCollectible(params) {
|
|
|
679
635
|
tokenId: collectibleId,
|
|
680
636
|
filter
|
|
681
637
|
};
|
|
682
|
-
|
|
683
|
-
return result.count;
|
|
638
|
+
return (await client.getCountOfOffersForCollectible(apiArgs)).count;
|
|
684
639
|
}
|
|
685
640
|
function countOffersForCollectibleQueryOptions(params) {
|
|
686
641
|
const enabled = Boolean(params.collectionAddress && params.chainId && params.collectibleId && params.config && (params.query?.enabled ?? true));
|
|
@@ -711,8 +666,7 @@ async function fetchFloorOrder(params) {
|
|
|
711
666
|
chainId: String(chainId),
|
|
712
667
|
...additionalApiParams
|
|
713
668
|
};
|
|
714
|
-
|
|
715
|
-
return result.collectible;
|
|
669
|
+
return (await marketplaceClient.getFloorOrder(apiArgs)).collectible;
|
|
716
670
|
}
|
|
717
671
|
function floorOrderQueryOptions(params) {
|
|
718
672
|
const enabled = Boolean(params.collectionAddress && params.chainId && params.config && (params.query?.enabled ?? true));
|
|
@@ -742,8 +696,7 @@ async function fetchHighestOffer(params) {
|
|
|
742
696
|
chainId: String(chainId),
|
|
743
697
|
...additionalApiParams
|
|
744
698
|
};
|
|
745
|
-
|
|
746
|
-
return result.order ?? null;
|
|
699
|
+
return (await marketplaceClient.getCollectibleHighestOffer(apiArgs)).order ?? null;
|
|
747
700
|
}
|
|
748
701
|
function highestOfferQueryOptions(params) {
|
|
749
702
|
const enabled = Boolean(params.collectionAddress && params.chainId && params.tokenId && params.config && (params.query?.enabled ?? true));
|
|
@@ -793,6 +746,49 @@ function listListingsForCollectibleQueryOptions(params) {
|
|
|
793
746
|
});
|
|
794
747
|
}
|
|
795
748
|
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/react/queries/listOffersForCollectible.ts
|
|
751
|
+
/**
|
|
752
|
+
* Fetches offers for a specific collectible from the Marketplace API
|
|
753
|
+
*/
|
|
754
|
+
async function fetchListOffersForCollectible(params) {
|
|
755
|
+
const { collectionAddress, chainId, collectibleId, config, sort, page,...additionalApiParams } = params;
|
|
756
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
757
|
+
const finalSort = sort || (page && "sort" in page ? page.sort : void 0);
|
|
758
|
+
let finalPage;
|
|
759
|
+
if (page || finalSort) finalPage = {
|
|
760
|
+
page: page?.page ?? 1,
|
|
761
|
+
pageSize: page?.pageSize ?? 20,
|
|
762
|
+
...page?.more && { more: page.more },
|
|
763
|
+
...finalSort && { sort: finalSort }
|
|
764
|
+
};
|
|
765
|
+
const apiArgs = {
|
|
766
|
+
contractAddress: collectionAddress,
|
|
767
|
+
chainId: String(chainId),
|
|
768
|
+
tokenId: collectibleId,
|
|
769
|
+
page: finalPage,
|
|
770
|
+
...additionalApiParams
|
|
771
|
+
};
|
|
772
|
+
return await marketplaceClient.listCollectibleOffers(apiArgs);
|
|
773
|
+
}
|
|
774
|
+
function listOffersForCollectibleQueryOptions(params) {
|
|
775
|
+
const enabled = Boolean(params.collectionAddress && params.chainId && params.collectibleId && params.config && (params.query?.enabled ?? true));
|
|
776
|
+
return queryOptions({
|
|
777
|
+
queryKey: [...collectableKeys.offers, params],
|
|
778
|
+
queryFn: () => fetchListOffersForCollectible({
|
|
779
|
+
chainId: params.chainId,
|
|
780
|
+
collectionAddress: params.collectionAddress,
|
|
781
|
+
collectibleId: params.collectibleId,
|
|
782
|
+
config: params.config,
|
|
783
|
+
filter: params.filter,
|
|
784
|
+
page: params.page,
|
|
785
|
+
sort: params.sort
|
|
786
|
+
}),
|
|
787
|
+
...params.query,
|
|
788
|
+
enabled
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
|
|
796
792
|
//#endregion
|
|
797
793
|
//#region src/react/queries/lowestListing.ts
|
|
798
794
|
/**
|
|
@@ -806,8 +802,7 @@ async function fetchLowestListing(params) {
|
|
|
806
802
|
chainId: String(chainId),
|
|
807
803
|
...additionalApiParams
|
|
808
804
|
};
|
|
809
|
-
|
|
810
|
-
return result.order || null;
|
|
805
|
+
return (await marketplaceClient.getCollectibleLowestListing(apiArgs)).order || null;
|
|
811
806
|
}
|
|
812
807
|
function lowestListingQueryOptions(params) {
|
|
813
808
|
const enabled = Boolean(params.collectionAddress && params.chainId && params.tokenId && params.config && (params.query?.enabled ?? true));
|
|
@@ -842,8 +837,7 @@ async function fetchCheckoutOptions(params) {
|
|
|
842
837
|
})),
|
|
843
838
|
additionalFee: additionalFee ?? 0
|
|
844
839
|
};
|
|
845
|
-
|
|
846
|
-
return result;
|
|
840
|
+
return await client.checkoutOptionsMarketplace(apiArgs);
|
|
847
841
|
}
|
|
848
842
|
function checkoutOptionsQueryOptions(params) {
|
|
849
843
|
const enabled = Boolean(params.chainId && params.walletAddress && params.orders?.length && params.config && (params.query?.enabled ?? true));
|
|
@@ -880,8 +874,7 @@ async function fetchCheckoutOptionsSalesContract(params) {
|
|
|
880
874
|
collectionAddress,
|
|
881
875
|
items
|
|
882
876
|
};
|
|
883
|
-
|
|
884
|
-
return result;
|
|
877
|
+
return await client.checkoutOptionsSalesContract(apiArgs);
|
|
885
878
|
}
|
|
886
879
|
function checkoutOptionsSalesContractQueryOptions(params) {
|
|
887
880
|
const enabled = Boolean(params.chainId && params.walletAddress && params.contractAddress && params.collectionAddress && params.items?.length && params.config && (params.query?.enabled ?? true));
|
|
@@ -912,15 +905,12 @@ function checkoutOptionsSalesContractQueryOptions(params) {
|
|
|
912
905
|
*/
|
|
913
906
|
async function fetchConvertPriceToUSD(params) {
|
|
914
907
|
const { chainId, currencyAddress, amountRaw, config } = params;
|
|
915
|
-
const
|
|
916
|
-
const currencies = await queryClient.fetchQuery(marketCurrenciesQueryOptions({
|
|
908
|
+
const currencyDetails = (await getQueryClient().fetchQuery(marketCurrenciesQueryOptions({
|
|
917
909
|
chainId,
|
|
918
910
|
config
|
|
919
|
-
}));
|
|
920
|
-
const currencyDetails = currencies.find((c) => c.contractAddress.toLowerCase() === currencyAddress.toLowerCase());
|
|
911
|
+
}))).find((c) => c.contractAddress.toLowerCase() === currencyAddress.toLowerCase());
|
|
921
912
|
if (!currencyDetails) throw new Error("Currency not found");
|
|
922
|
-
const
|
|
923
|
-
const usdAmount = amountDecimal * currencyDetails.exchangeRate;
|
|
913
|
+
const usdAmount = Number(formatUnits(BigInt(amountRaw), currencyDetails.decimals)) * currencyDetails.exchangeRate;
|
|
924
914
|
return {
|
|
925
915
|
usdAmount,
|
|
926
916
|
usdAmountFormatted: usdAmount.toFixed(2)
|
|
@@ -1001,12 +991,11 @@ function comparePricesQueryOptions(params) {
|
|
|
1001
991
|
async function fetchCountOfPrimarySaleItems(args, config) {
|
|
1002
992
|
const marketplaceClient = getMarketplaceClient(config);
|
|
1003
993
|
const { chainId, primarySaleContractAddress, filter } = args;
|
|
1004
|
-
|
|
994
|
+
return (await marketplaceClient.getCountOfPrimarySaleItems({
|
|
1005
995
|
chainId: String(chainId),
|
|
1006
996
|
primarySaleContractAddress,
|
|
1007
997
|
filter
|
|
1008
|
-
});
|
|
1009
|
-
return data.count;
|
|
998
|
+
})).count;
|
|
1010
999
|
}
|
|
1011
1000
|
function countOfPrimarySaleItemsOptions(args, config) {
|
|
1012
1001
|
return queryOptions({
|
|
@@ -1023,25 +1012,23 @@ function countOfPrimarySaleItemsOptions(args, config) {
|
|
|
1023
1012
|
*/
|
|
1024
1013
|
async function fetchFilters(params) {
|
|
1025
1014
|
const { chainId, collectionAddress, showAllFilters, excludePropertyValues, config } = params;
|
|
1026
|
-
const
|
|
1027
|
-
const filters = await metadataClient.getTokenMetadataPropertyFilters({
|
|
1015
|
+
const filters = await getMetadataClient(config).getTokenMetadataPropertyFilters({
|
|
1028
1016
|
chainID: chainId.toString(),
|
|
1029
1017
|
contractAddress: collectionAddress,
|
|
1030
1018
|
excludeProperties: [],
|
|
1031
1019
|
excludePropertyValues
|
|
1032
1020
|
}).then((resp) => resp.filters);
|
|
1033
1021
|
if (showAllFilters) return filters;
|
|
1034
|
-
const
|
|
1035
|
-
const
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
const sortedFilters = filters.toSorted((a, b) => {
|
|
1022
|
+
const collectionFilters = (await getQueryClient().fetchQuery(marketplaceConfigOptions(config))).market.collections.find((c) => compareAddress(c.itemsAddress, collectionAddress))?.filterSettings;
|
|
1023
|
+
const filterOrder = collectionFilters?.filterOrder;
|
|
1024
|
+
const exclusions = collectionFilters?.exclusions;
|
|
1025
|
+
let sortedFilters = filters;
|
|
1026
|
+
if (filterOrder) sortedFilters = filters.toSorted((a, b) => {
|
|
1040
1027
|
const aIndex = filterOrder.indexOf(a.name) > -1 ? filterOrder.indexOf(a.name) : filterOrder.length;
|
|
1041
1028
|
const bIndex = filterOrder.indexOf(b.name) > -1 ? filterOrder.indexOf(b.name) : filterOrder.length;
|
|
1042
1029
|
return aIndex - bIndex;
|
|
1043
1030
|
});
|
|
1044
|
-
|
|
1031
|
+
if (exclusions) sortedFilters = sortedFilters.reduce((acc, filter) => {
|
|
1045
1032
|
const exclusionRule = exclusions.find((rule) => rule.key === filter.name);
|
|
1046
1033
|
if (!exclusionRule) {
|
|
1047
1034
|
acc.push(filter);
|
|
@@ -1057,7 +1044,7 @@ async function fetchFilters(params) {
|
|
|
1057
1044
|
}
|
|
1058
1045
|
return acc;
|
|
1059
1046
|
}, []);
|
|
1060
|
-
return
|
|
1047
|
+
return sortedFilters;
|
|
1061
1048
|
}
|
|
1062
1049
|
function filtersQueryOptions(params) {
|
|
1063
1050
|
const enabled = Boolean(params.chainId && params.collectionAddress && params.config && (params.query?.enabled ?? true));
|
|
@@ -1082,8 +1069,7 @@ function filtersQueryOptions(params) {
|
|
|
1082
1069
|
*/
|
|
1083
1070
|
async function fetchGetTokenRanges(params) {
|
|
1084
1071
|
const { chainId, collectionAddress, config } = params;
|
|
1085
|
-
const
|
|
1086
|
-
const response = await indexerClient.getTokenIDRanges({ contractAddress: collectionAddress });
|
|
1072
|
+
const response = await getIndexerClient(chainId, config).getTokenIDRanges({ contractAddress: collectionAddress });
|
|
1087
1073
|
if (!response) throw new Error("Failed to fetch token ranges");
|
|
1088
1074
|
return response;
|
|
1089
1075
|
}
|
|
@@ -1106,21 +1092,51 @@ function getTokenRangesQueryOptions(params) {
|
|
|
1106
1092
|
}
|
|
1107
1093
|
|
|
1108
1094
|
//#endregion
|
|
1109
|
-
//#region src/react/queries/
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1095
|
+
//#region src/react/queries/tokenBalances.ts
|
|
1096
|
+
/**
|
|
1097
|
+
* Fetches the token balances for a user
|
|
1098
|
+
*
|
|
1099
|
+
* @param args - Arguments for the API call
|
|
1100
|
+
* @param config - SDK configuration
|
|
1101
|
+
* @returns The balance data
|
|
1102
|
+
*/
|
|
1103
|
+
async function fetchTokenBalances(args, config) {
|
|
1104
|
+
if (args.isLaos721) return (await new LaosAPI().getTokenBalances({
|
|
1105
|
+
chainId: args.chainId.toString(),
|
|
1106
|
+
contractAddress: args.collectionAddress,
|
|
1107
|
+
accountAddress: args.userAddress,
|
|
1108
|
+
includeMetadata: true
|
|
1109
|
+
})).balances || [];
|
|
1110
|
+
return getIndexerClient(args.chainId, config).getTokenBalances({
|
|
1111
|
+
accountAddress: args.userAddress,
|
|
1112
|
+
contractAddress: args.collectionAddress,
|
|
1113
|
+
includeMetadata: args.includeMetadata ?? false,
|
|
1114
|
+
metadataOptions: {
|
|
1115
|
+
verifiedOnly: true,
|
|
1116
|
+
includeContracts: [args.collectionAddress]
|
|
1117
|
+
}
|
|
1118
|
+
}).then((res) => res.balances || []);
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Creates a tanstack query options object for the token balances query
|
|
1122
|
+
*
|
|
1123
|
+
* @param args - The query arguments
|
|
1124
|
+
* @param config - SDK configuration
|
|
1125
|
+
* @returns Query options configuration
|
|
1126
|
+
*/
|
|
1127
|
+
function tokenBalancesOptions(args, config) {
|
|
1128
|
+
const enabled = !!args.userAddress && !!args.collectionAddress && (args.query?.enabled ?? true);
|
|
1129
|
+
return queryOptions({
|
|
1130
|
+
queryKey: [...collectableKeys.userBalances, args],
|
|
1131
|
+
queryFn: enabled ? () => fetchTokenBalances({
|
|
1132
|
+
...args,
|
|
1133
|
+
userAddress: args.userAddress
|
|
1134
|
+
}, config) : skipToken
|
|
1121
1135
|
});
|
|
1122
|
-
return stateByCollection.get(collectionKey);
|
|
1123
1136
|
}
|
|
1137
|
+
|
|
1138
|
+
//#endregion
|
|
1139
|
+
//#region src/react/queries/inventory.ts
|
|
1124
1140
|
function collectibleFromTokenBalance(token) {
|
|
1125
1141
|
return {
|
|
1126
1142
|
metadata: {
|
|
@@ -1137,135 +1153,47 @@ function collectibleFromTokenBalance(token) {
|
|
|
1137
1153
|
balance: token.balance
|
|
1138
1154
|
};
|
|
1139
1155
|
}
|
|
1140
|
-
async function
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
page: { sort: [{
|
|
1149
|
-
column: "CREATED_AT",
|
|
1150
|
-
order: "DESC"
|
|
1151
|
-
}] }
|
|
1152
|
-
});
|
|
1153
|
-
for (const balance of balances) if (balance.tokenID) state.indexerTokenBalances.set(balance.tokenID, collectibleFromTokenBalance(balance));
|
|
1154
|
-
state.indexerTokensFetched = true;
|
|
1155
|
-
return;
|
|
1156
|
-
}
|
|
1157
|
-
const indexerClient = getIndexerClient(chainId, config);
|
|
1158
|
-
let page = { pageSize: 50 };
|
|
1159
|
-
while (true) {
|
|
1160
|
-
const { balances, page: nextPage } = await indexerClient.getTokenBalances({
|
|
1161
|
-
accountAddress,
|
|
1162
|
-
contractAddress: collectionAddress,
|
|
1163
|
-
includeMetadata: true,
|
|
1164
|
-
page
|
|
1165
|
-
});
|
|
1166
|
-
for (const balance of balances) if (balance.tokenID) state.indexerTokenBalances.set(balance.tokenID, collectibleFromTokenBalance(balance));
|
|
1167
|
-
if (!nextPage.more) break;
|
|
1168
|
-
page = nextPage;
|
|
1169
|
-
}
|
|
1170
|
-
state.indexerTokensFetched = true;
|
|
1171
|
-
}
|
|
1172
|
-
function processRemainingIndexerTokens(state, page) {
|
|
1173
|
-
const allTokens = Array.from(state.indexerTokenBalances.values());
|
|
1174
|
-
const newTokens = allTokens.filter((token) => !state.seenTokenIds.has(token.metadata.tokenId));
|
|
1175
|
-
const startIndex = (page.page - 1) * page.pageSize;
|
|
1176
|
-
const endIndex = startIndex + page.pageSize;
|
|
1177
|
-
const paginatedTokens = newTokens.slice(startIndex, endIndex);
|
|
1178
|
-
for (const token of paginatedTokens) state.seenTokenIds.add(token.metadata.tokenId);
|
|
1179
|
-
return {
|
|
1180
|
-
collectibles: paginatedTokens,
|
|
1181
|
-
page: {
|
|
1182
|
-
page: page.page,
|
|
1183
|
-
pageSize: page.pageSize,
|
|
1184
|
-
more: endIndex < newTokens.length
|
|
1185
|
-
}
|
|
1186
|
-
};
|
|
1187
|
-
}
|
|
1188
|
-
function processMarketplaceCollectibles(collectibles, state, page) {
|
|
1189
|
-
for (const c of collectibles) state.seenTokenIds.add(c.metadata.tokenId);
|
|
1190
|
-
const enrichedCollectibles = collectibles.map((c) => {
|
|
1191
|
-
const tokenId = c.metadata.tokenId;
|
|
1192
|
-
const indexerData = state.indexerTokenBalances.get(tokenId);
|
|
1193
|
-
return {
|
|
1194
|
-
...c,
|
|
1195
|
-
balance: indexerData?.balance,
|
|
1196
|
-
contractInfo: indexerData?.contractInfo,
|
|
1197
|
-
contractType: indexerData?.contractType
|
|
1198
|
-
};
|
|
1199
|
-
});
|
|
1200
|
-
const marketplaceTokenIds = new Set(enrichedCollectibles.map((c) => c.metadata.tokenId));
|
|
1201
|
-
const missingTokens = Array.from(state.indexerTokenBalances.entries()).filter(([tokenId]) => !marketplaceTokenIds.has(tokenId)).map(([_, balance]) => balance).slice(0, page.pageSize);
|
|
1202
|
-
return {
|
|
1203
|
-
enrichedCollectibles,
|
|
1204
|
-
missingTokens
|
|
1205
|
-
};
|
|
1156
|
+
async function fetchIndexerTokens(chainId, accountAddress, collectionAddress, config, isLaos721) {
|
|
1157
|
+
return { collectibles: (await getQueryClient().fetchQuery(tokenBalancesOptions({
|
|
1158
|
+
collectionAddress,
|
|
1159
|
+
userAddress: accountAddress,
|
|
1160
|
+
chainId,
|
|
1161
|
+
isLaos721,
|
|
1162
|
+
includeMetadata: true
|
|
1163
|
+
}, config))).map((balance) => collectibleFromTokenBalance(balance)) };
|
|
1206
1164
|
}
|
|
1207
1165
|
async function fetchInventory(args, config, page) {
|
|
1208
1166
|
const { accountAddress, collectionAddress, chainId, isLaos721 } = args;
|
|
1209
|
-
const
|
|
1210
|
-
const
|
|
1211
|
-
if (!state.indexerTokensFetched) await fetchAllIndexerTokens(chainId, accountAddress, collectionAddress, config, state, isLaos721);
|
|
1212
|
-
if (state.marketplaceFinished) return processRemainingIndexerTokens(state, page);
|
|
1213
|
-
const marketplaceConfig = await fetchMarketplaceConfig({ config });
|
|
1214
|
-
const collectibles = await fetchListCollectibles({
|
|
1215
|
-
chainId,
|
|
1216
|
-
collectionAddress,
|
|
1217
|
-
filter: {
|
|
1218
|
-
inAccounts: [accountAddress],
|
|
1219
|
-
includeEmpty: true
|
|
1220
|
-
},
|
|
1221
|
-
side: OrderSide.listing,
|
|
1222
|
-
config
|
|
1223
|
-
}, marketplaceConfig, page);
|
|
1224
|
-
const { enrichedCollectibles, missingTokens } = processMarketplaceCollectibles(collectibles.collectibles, state, page);
|
|
1225
|
-
if (!collectibles.page?.more) {
|
|
1226
|
-
state.marketplaceFinished = true;
|
|
1227
|
-
return {
|
|
1228
|
-
collectibles: [...enrichedCollectibles, ...missingTokens],
|
|
1229
|
-
page: {
|
|
1230
|
-
page: collectibles.page?.page ?? page.page,
|
|
1231
|
-
pageSize: collectibles.page?.pageSize ?? page.pageSize,
|
|
1232
|
-
more: missingTokens.length > 0
|
|
1233
|
-
}
|
|
1234
|
-
};
|
|
1235
|
-
}
|
|
1167
|
+
const isTradable = ((await fetchMarketplaceConfig({ config }))?.market.collections || []).some((collection) => compareAddress(collection.itemsAddress, collectionAddress));
|
|
1168
|
+
const { collectibles } = await fetchIndexerTokens(chainId, accountAddress, collectionAddress, config, isLaos721);
|
|
1236
1169
|
return {
|
|
1237
|
-
collectibles
|
|
1170
|
+
collectibles,
|
|
1238
1171
|
page: {
|
|
1239
|
-
page:
|
|
1240
|
-
pageSize:
|
|
1241
|
-
|
|
1242
|
-
|
|
1172
|
+
page: page.page,
|
|
1173
|
+
pageSize: page.pageSize
|
|
1174
|
+
},
|
|
1175
|
+
isTradable
|
|
1243
1176
|
};
|
|
1244
1177
|
}
|
|
1245
1178
|
function inventoryOptions(args, config) {
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const enabled = enabledQuery && !!args.accountAddress && !!args.collectionAddress;
|
|
1249
|
-
return infiniteQueryOptions({
|
|
1179
|
+
const enabled = (args.query?.enabled ?? true) && !!args.accountAddress && !!args.collectionAddress;
|
|
1180
|
+
return queryOptions({
|
|
1250
1181
|
queryKey: [
|
|
1251
1182
|
"inventory",
|
|
1252
1183
|
args.accountAddress,
|
|
1253
1184
|
args.collectionAddress,
|
|
1254
|
-
args.chainId
|
|
1185
|
+
args.chainId,
|
|
1186
|
+
args.query?.page ?? 1,
|
|
1187
|
+
args.query?.pageSize ?? 30
|
|
1255
1188
|
],
|
|
1256
|
-
queryFn: (
|
|
1189
|
+
queryFn: () => fetchInventory({
|
|
1257
1190
|
...args,
|
|
1258
1191
|
isLaos721: args.isLaos721 ?? false
|
|
1259
|
-
}, config,
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
getNextPageParam: (lastPage) => lastPage.page?.more ? lastPage.page : void 0,
|
|
1265
|
-
enabled,
|
|
1266
|
-
meta: { onInvalidate: () => {
|
|
1267
|
-
stateByCollection.delete(collectionKey);
|
|
1268
|
-
} }
|
|
1192
|
+
}, config, {
|
|
1193
|
+
page: args.query?.page ?? 1,
|
|
1194
|
+
pageSize: args.query?.pageSize ?? 30
|
|
1195
|
+
}),
|
|
1196
|
+
enabled
|
|
1269
1197
|
});
|
|
1270
1198
|
}
|
|
1271
1199
|
|
|
@@ -1276,13 +1204,11 @@ function inventoryOptions(args, config) {
|
|
|
1276
1204
|
*/
|
|
1277
1205
|
async function fetchListTokenMetadata(params) {
|
|
1278
1206
|
const { chainId, contractAddress, tokenIds, config } = params;
|
|
1279
|
-
|
|
1280
|
-
const response = await metadataClient.getTokenMetadata({
|
|
1207
|
+
return (await getMetadataClient(config).getTokenMetadata({
|
|
1281
1208
|
chainID: chainId.toString(),
|
|
1282
1209
|
contractAddress,
|
|
1283
1210
|
tokenIDs: tokenIds
|
|
1284
|
-
});
|
|
1285
|
-
return response.tokenMetadata;
|
|
1211
|
+
})).tokenMetadata;
|
|
1286
1212
|
}
|
|
1287
1213
|
function listTokenMetadataQueryOptions(params) {
|
|
1288
1214
|
const enabled = Boolean(params.chainId && params.contractAddress && params.tokenIds?.length && params.config && (params.query?.enabled ?? true));
|
|
@@ -1306,8 +1232,7 @@ function listTokenMetadataQueryOptions(params) {
|
|
|
1306
1232
|
*/
|
|
1307
1233
|
async function fetchPrimarySaleItems(params) {
|
|
1308
1234
|
const { chainId, primarySaleContractAddress, filter, page, config } = params;
|
|
1309
|
-
|
|
1310
|
-
return marketplaceClient.listPrimarySaleItems({
|
|
1235
|
+
return getMarketplaceClient(config).listPrimarySaleItems({
|
|
1311
1236
|
chainId: String(chainId),
|
|
1312
1237
|
primarySaleContractAddress,
|
|
1313
1238
|
filter,
|
|
@@ -1345,8 +1270,7 @@ const listPrimarySaleItemsQueryOptions = (params) => {
|
|
|
1345
1270
|
*/
|
|
1346
1271
|
async function fetchPrimarySaleItemsCount(params) {
|
|
1347
1272
|
const { chainId, primarySaleContractAddress, filter, config } = params;
|
|
1348
|
-
|
|
1349
|
-
return marketplaceClient.getCountOfPrimarySaleItems({
|
|
1273
|
+
return getMarketplaceClient(config).getCountOfPrimarySaleItems({
|
|
1350
1274
|
chainId: String(chainId),
|
|
1351
1275
|
primarySaleContractAddress,
|
|
1352
1276
|
filter
|
|
@@ -1374,8 +1298,7 @@ const primarySaleItemsCountQueryOptions = (args) => {
|
|
|
1374
1298
|
*/
|
|
1375
1299
|
async function fetchSearchTokenMetadata(params) {
|
|
1376
1300
|
const { chainId, collectionAddress, filter, page, config } = params;
|
|
1377
|
-
const
|
|
1378
|
-
const response = await metadataClient.searchTokenMetadata({
|
|
1301
|
+
const response = await getMetadataClient(config).searchTokenMetadata({
|
|
1379
1302
|
chainID: chainId.toString(),
|
|
1380
1303
|
contractAddress: collectionAddress,
|
|
1381
1304
|
filter: filter ?? {},
|
|
@@ -1432,21 +1355,19 @@ async function fetchTokenSupplies(params) {
|
|
|
1432
1355
|
column: sortBy.column,
|
|
1433
1356
|
order: sortBy.order
|
|
1434
1357
|
})) || [] } : void 0;
|
|
1435
|
-
|
|
1358
|
+
return await laosApi.getTokenSupplies({
|
|
1436
1359
|
chainId: chainId.toString(),
|
|
1437
1360
|
contractAddress: collectionAddress,
|
|
1438
1361
|
includeMetadata: rest.includeMetadata,
|
|
1439
1362
|
page: laosPage
|
|
1440
1363
|
});
|
|
1441
|
-
return result$1;
|
|
1442
1364
|
}
|
|
1443
1365
|
const indexerClient = getIndexerClient(chainId, config);
|
|
1444
1366
|
const apiArgs = {
|
|
1445
1367
|
contractAddress: collectionAddress,
|
|
1446
1368
|
...rest
|
|
1447
1369
|
};
|
|
1448
|
-
|
|
1449
|
-
return result;
|
|
1370
|
+
return await indexerClient.getTokenSupplies(apiArgs);
|
|
1450
1371
|
}
|
|
1451
1372
|
function tokenSuppliesQueryOptions(params) {
|
|
1452
1373
|
const enabled = Boolean(params.chainId && params.collectionAddress && params.config && (params.query?.enabled ?? true));
|
|
@@ -1474,5 +1395,5 @@ function tokenSuppliesQueryOptions(params) {
|
|
|
1474
1395
|
}
|
|
1475
1396
|
|
|
1476
1397
|
//#endregion
|
|
1477
|
-
export { balanceOfCollectibleOptions, checkoutOptionsQueryOptions, checkoutOptionsSalesContractQueryOptions,
|
|
1478
|
-
//# sourceMappingURL=queries-
|
|
1398
|
+
export { balanceOfCollectibleOptions, checkoutOptionsQueryOptions, checkoutOptionsSalesContractQueryOptions, collectibleQueryOptions, collectionBalanceDetailsQueryOptions, collectionDetailsQueryOptions, collectionQueryOptions, comparePricesQueryOptions, convertPriceToUSDQueryOptions, countListingsForCollectibleQueryOptions, countOfCollectablesQueryOptions, countOfPrimarySaleItemsOptions, countOffersForCollectibleQueryOptions, currencyQueryOptions, fetchBalanceOfCollectible, fetchBalances, fetchCheckoutOptions, fetchCheckoutOptionsSalesContract, fetchCollectible, fetchCollection, fetchCollectionBalanceDetails, fetchCollectionDetails, fetchComparePrices, fetchConvertPriceToUSD, fetchCountListingsForCollectible, fetchCountOfCollectables, fetchCountOfPrimarySaleItems, fetchCountOffersForCollectible, fetchCurrency, fetchFilters, fetchFloorOrder, fetchGetTokenRanges, fetchHighestOffer, fetchInventory, fetchListCollectibleActivities, fetchListCollectibles, fetchListCollectiblesPaginated, fetchListCollectionActivities, fetchListCollections, fetchListListingsForCollectible, fetchListOffersForCollectible, fetchListTokenMetadata, fetchLowestListing, fetchMarketCurrencies, fetchPrimarySaleItems, fetchPrimarySaleItemsCount, fetchSearchTokenMetadata, fetchTokenSupplies, filtersQueryOptions, floorOrderQueryOptions, getTokenRangesQueryOptions, highestOfferQueryOptions, inventoryOptions, listBalancesOptions, listCollectibleActivitiesQueryOptions, listCollectiblesPaginatedQueryOptions, listCollectiblesQueryOptions, listCollectionActivitiesQueryOptions, listCollectionsOptions, listCollectionsQueryOptions, listListingsForCollectibleQueryOptions, listOffersForCollectibleQueryOptions, listPrimarySaleItemsQueryOptions, listTokenMetadataQueryOptions, lowestListingQueryOptions, marketCurrenciesQueryOptions, primarySaleItemsCountQueryOptions, searchTokenMetadataQueryOptions, tokenSuppliesQueryOptions };
|
|
1399
|
+
//# sourceMappingURL=queries-EMA5CcwY.js.map
|