@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.
- package/CHANGELOG.md +34 -3
- package/dist/{BellIcon-ByhygxBO.js → BellIcon-DMKEumAz.js} +2 -2
- package/dist/BellIcon-DMKEumAz.js.map +1 -0
- package/dist/{CartIcon-Bt3rQYGk.js → CartIcon-UyB4NYKt.js} +3 -3
- package/dist/CartIcon-UyB4NYKt.js.map +1 -0
- package/dist/CollectibleCard-z05qWzKE.d.ts +8 -0
- package/dist/_internal-DkS2VUn5.js.map +1 -1
- package/dist/abi-fa-o9gH3.js.map +1 -1
- package/dist/{alien_swap-DoY6XfMA.js → alien_swap-Cq8LuElo.js} +1 -1
- package/dist/{alien_swap-DoY6XfMA.js.map → alien_swap-Cq8LuElo.js.map} +1 -1
- package/dist/{api-BoO0V5aJ.js → api-GwTR0dBA.js} +8 -49
- package/dist/api-GwTR0dBA.js.map +1 -0
- package/dist/{aqua-xyz-BBDxnG14.js → aqua-xyz-0yye_c-Z.js} +1 -1
- package/dist/{aqua-xyz-BBDxnG14.js.map → aqua-xyz-0yye_c-Z.js.map} +1 -1
- package/dist/{aura-DGx2zwvF.js → aura-TaxFvTFQ.js} +1 -1
- package/dist/{aura-DGx2zwvF.js.map → aura-TaxFvTFQ.js.map} +1 -1
- package/dist/{blur-D8GKrRrq.js → blur-BupOTobO.js} +1 -1
- package/dist/{blur-D8GKrRrq.js.map → blur-BupOTobO.js.map} +1 -1
- package/dist/{builder-api-BFuZNOaN.js → builder-api-m4JAA6ee.js} +3 -3
- package/dist/builder-api-m4JAA6ee.js.map +1 -0
- package/dist/{builder.gen-B9wR2nvF.js → builder.gen--XD71cNL.js} +2 -2
- package/dist/builder.gen--XD71cNL.js.map +1 -0
- package/dist/{coinbase-DOry4PXY.js → coinbase-DTgZ4wDT.js} +1 -1
- package/dist/{coinbase-DOry4PXY.js.map → coinbase-DTgZ4wDT.js.map} +1 -1
- package/dist/{collectibles-C_H8jMGH.js → collectibles-CZ6i8sXK.js} +15 -49
- package/dist/collectibles-CZ6i8sXK.js.map +1 -0
- package/dist/{collections-CKummc-R.js → collections-5NcU-7ZR.js} +92 -10
- package/dist/collections-5NcU-7ZR.js.map +1 -0
- package/dist/{components-CosnX7F9.js → components-CY8kx2kb.js} +13 -9
- package/dist/components-CY8kx2kb.js.map +1 -0
- package/dist/{contracts-BP_0vX48.js → contracts-DRJHF89h.js} +4 -3
- package/dist/{contracts-BP_0vX48.js.map → contracts-DRJHF89h.js.map} +1 -1
- package/dist/{create-config-CIfejoCk.js → create-config-BxyfYCEk.js} +6 -5
- package/dist/create-config-BxyfYCEk.js.map +1 -0
- package/dist/{create-config-ZOB7i4ZJ.d.ts → create-config-CFBeD8CB.d.ts} +47 -60
- package/dist/{element-ciybd_VF.js → element-D4dDznlu.js} +1 -1
- package/dist/{element-ciybd_VF.js.map → element-D4dDznlu.js.map} +1 -1
- package/dist/{filters-V-V8Dn8f.d.ts → filters-B5niI_fX.d.ts} +7 -7
- package/dist/{foundation-Bq4lRz4x.js → foundation-GHZOKAzN.js} +1 -1
- package/dist/{foundation-Bq4lRz4x.js.map → foundation-GHZOKAzN.js.map} +1 -1
- package/dist/{index-BeRV-7AX.d.ts → index-8scPf0CS.d.ts} +2 -2
- package/dist/index-9qsplZ8r.d.ts +18 -0
- package/dist/{index-BZIJTQT0.d.ts → index-BIuYTMc2.d.ts} +10 -9
- package/dist/{index-C4MUKshG.d.ts → index-BNrz99xy.d.ts} +3 -3
- package/dist/{index-Bsx6XsC2.d.ts → index-BYQOPS8e.d.ts} +116 -62
- package/dist/{index-DUXfvhxs.d.ts → index-BkZ7SPLc.d.ts} +19 -29
- package/dist/{index-NlPMNcqh.d.ts → index-BnUku_aF.d.ts} +109 -114
- package/dist/{index-Stm5u0I0.d.ts → index-BtDAHMW_.d.ts} +9 -12
- package/dist/{index-BOiHR01C.d.ts → index-C-c_M_sE.d.ts} +10 -9
- package/dist/{index-DWt6yrIG.d.ts → index-CNIiC8Z_.d.ts} +11 -8
- package/dist/{index-DmudgrsN.d.ts → index-CbERNN3s.d.ts} +26 -16
- package/dist/{index-CxpFwGvR.d.ts → index-CsfxsN0t.d.ts} +4 -4
- package/dist/{index-CxA34wP1.d.ts → index-DASjaiJL.d.ts} +105 -19
- package/dist/{index-Bxzjy0d1.d.ts → index-DD7Vc4cE.d.ts} +2 -2
- package/dist/{index-DqXd1EeB.d.ts → index-DIc8OqWV.d.ts} +7 -6
- package/dist/{index-CnEbXm_t.d.ts → index-DVI_vggD.d.ts} +53 -12
- package/dist/{index-CPzvNmq9.d.ts → index-DqxQeYT2.d.ts} +39 -36
- package/dist/{index-CS65jqOq.d.ts → index-Dsf9FRtr.d.ts} +19 -3
- package/dist/{index-DFEnA6Wa.d.ts → index-DxAReMEO.d.ts} +34 -34
- package/dist/{index-U-zp70of.d.ts → index-UXRoZmd_.d.ts} +8 -12
- package/dist/{index-DwKr18CI.d.ts → index-isFvc5gd.d.ts} +2 -2
- package/dist/{index-BtWMBHeP.d.ts → index-j3nuJWyJ.d.ts} +13 -9
- package/dist/{index-C-745li7.d.ts → index-nVb7o0hc.d.ts} +2 -2
- package/dist/{index-D9LPlmbC.d.ts → index-pbE88Tt7.d.ts} +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -9
- package/dist/{inventory-Dd7TazvZ.js → inventory--t6Zu55O.js} +21 -18
- package/dist/inventory--t6Zu55O.js.map +1 -0
- package/dist/{listCollectiblesPaginated-Cy2_qEZA.d.ts → listCollectiblesPaginated-BlE5mSzh.d.ts} +32 -32
- package/dist/{listCollections-BB9FxKj2.d.ts → listCollections-DWyqFSQ3.d.ts} +143 -66
- package/dist/{looks-rare-6H--x3AM.js → looks-rare-2HBhMpOf.js} +1 -1
- package/dist/{looks-rare-6H--x3AM.js.map → looks-rare-2HBhMpOf.js.map} +1 -1
- package/dist/{lowestListing-Cbsi6M1K.d.ts → lowestListing-DsunDO1c.d.ts} +38 -28
- package/dist/{magic-eden-BoxEQ1Li.js → magic-eden-BYdTp-uk.js} +1 -1
- package/dist/{magic-eden-BoxEQ1Li.js.map → magic-eden-BYdTp-uk.js.map} +1 -1
- package/dist/{manifold-DycKsljb.js → manifold-yE0x6ZmO.js} +1 -1
- package/dist/{manifold-DycKsljb.js.map → manifold-yE0x6ZmO.js.map} +1 -1
- package/dist/{market-C3HV-awQ.js → market-DuBpFsDg.js} +27 -17
- package/dist/market-DuBpFsDg.js.map +1 -0
- package/dist/{marketCurrencies-Bpw1bIO0.d.ts → marketCurrencies-BgwmbGFk.d.ts} +20 -9
- package/dist/{marketCurrencies-sKrTX0og.js → marketCurrencies-Bolonndy.js} +13 -7
- package/dist/marketCurrencies-Bolonndy.js.map +1 -0
- package/dist/marketplace-NQB-sEQL.js.map +1 -1
- package/dist/{marketplace-logos-D4dS1Foy.js → marketplace-logos-Cz9RrtQo.js} +21 -21
- package/dist/marketplace-logos-Cz9RrtQo.js.map +1 -0
- package/dist/{marketplace.gen-ksUafDqS.js → marketplace.gen-906FrJQJ.js} +24 -5
- package/dist/marketplace.gen-906FrJQJ.js.map +1 -0
- package/dist/{marketplaceConfig-UHQMM9fq.js → marketplaceConfig-Bqjo7NYO.js} +8 -4
- package/dist/marketplaceConfig-Bqjo7NYO.js.map +1 -0
- package/dist/{mintify-Dyqyo8jQ.js → mintify-BXQx3mZB.js} +1 -1
- package/dist/{mintify-Dyqyo8jQ.js.map → mintify-BXQx3mZB.js.map} +1 -1
- package/dist/{network-DtmiMhcg.js → network-DwdZ_5-7.js} +2 -2
- package/dist/network-DwdZ_5-7.js.map +1 -0
- package/dist/{networkconfigToWagmiChain-DbUf6HiO.js → networkconfigToWagmiChain-Ct-hGq8M.js} +4 -3
- package/dist/networkconfigToWagmiChain-Ct-hGq8M.js.map +1 -0
- package/dist/{nftx-2LbFjj9Q.js → nftx-B929_3Ce.js} +1 -1
- package/dist/{nftx-2LbFjj9Q.js.map → nftx-B929_3Ce.js.map} +1 -1
- package/dist/{okx-CBEWJNsR.js → okx-sZ0-Udny.js} +1 -1
- package/dist/{okx-CBEWJNsR.js.map → okx-sZ0-Udny.js.map} +1 -1
- package/dist/{open-sea-Dxntz_PA.js → open-sea-DO9PhTrz.js} +1 -1
- package/dist/{open-sea-Dxntz_PA.js.map → open-sea-DO9PhTrz.js.map} +1 -1
- package/dist/{orders-DnFfZAXV.js → orders-DH76ym2e.js} +16 -9
- package/dist/orders-DH76ym2e.js.map +1 -0
- package/dist/primary-sale-1u4QlPdA.js.map +1 -1
- package/dist/{primary-sales-Dmsi6bqj.js → primary-sales-CECrqatg.js} +49 -7
- package/dist/primary-sales-CECrqatg.js.map +1 -0
- package/dist/{query-BWbCsXLY.d.ts → query-brXxOcH0.d.ts} +1 -1
- package/dist/{rarible-CS0SupHr.js → rarible-Ccb2hs7y.js} +1 -1
- package/dist/{rarible-CS0SupHr.js.map → rarible-Ccb2hs7y.js.map} +1 -1
- package/dist/react/_internal/api/index.d.ts +2 -2
- package/dist/react/_internal/api/index.js +6 -6
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +28 -29
- package/dist/react/_internal/index.d.ts +2 -2
- package/dist/react/_internal/index.js +8 -8
- package/dist/react/_internal/wagmi/index.d.ts +1 -1
- package/dist/react/_internal/wagmi/index.js +3 -3
- package/dist/react/hooks/config/index.d.ts +8 -8
- package/dist/react/hooks/config/index.js +28 -29
- package/dist/react/hooks/contracts/index.d.ts +6 -6
- package/dist/react/hooks/contracts/index.js +8 -8
- package/dist/react/hooks/data/collectibles/index.d.ts +10 -10
- package/dist/react/hooks/data/collectibles/index.js +28 -29
- package/dist/react/hooks/data/collections/index.d.ts +11 -11
- package/dist/react/hooks/data/collections/index.js +29 -30
- package/dist/react/hooks/data/index.d.ts +37 -37
- package/dist/react/hooks/data/index.js +29 -30
- package/dist/react/hooks/data/inventory/index.d.ts +36 -36
- package/dist/react/hooks/data/inventory/index.js +28 -29
- package/dist/react/hooks/data/market/index.d.ts +11 -11
- package/dist/react/hooks/data/market/index.js +28 -29
- package/dist/react/hooks/data/orders/index.d.ts +10 -10
- package/dist/react/hooks/data/orders/index.js +28 -29
- package/dist/react/hooks/data/primary-sales/index.d.ts +37 -37
- package/dist/react/hooks/data/primary-sales/index.js +29 -30
- package/dist/react/hooks/data/tokens/index.d.ts +4 -4
- package/dist/react/hooks/data/tokens/index.js +28 -29
- package/dist/react/hooks/index.d.ts +37 -37
- package/dist/react/hooks/index.js +29 -30
- package/dist/react/hooks/transactions/index.d.ts +2 -2
- package/dist/react/hooks/transactions/index.js +28 -29
- package/dist/react/hooks/ui/index.d.ts +4 -4
- package/dist/react/hooks/ui/index.js +28 -29
- package/dist/react/hooks/utils/index.d.ts +36 -36
- package/dist/react/hooks/utils/index.js +28 -29
- package/dist/react/index.d.ts +37 -37
- package/dist/react/index.js +29 -30
- package/dist/react/queries/collectibles/index.d.ts +10 -10
- package/dist/react/queries/collectibles/index.js +12 -13
- package/dist/react/queries/collections/index.d.ts +11 -11
- package/dist/react/queries/collections/index.js +11 -11
- package/dist/react/queries/index.d.ts +24 -24
- package/dist/react/queries/index.js +22 -23
- package/dist/react/queries/inventory/index.d.ts +2 -2
- package/dist/react/queries/inventory/index.js +12 -12
- package/dist/react/queries/market/index.d.ts +5 -5
- package/dist/react/queries/market/index.js +12 -12
- package/dist/react/queries/orders/index.d.ts +10 -10
- package/dist/react/queries/orders/index.js +8 -8
- package/dist/react/queries/primary-sales/index.d.ts +4 -4
- package/dist/react/queries/primary-sales/index.js +9 -9
- package/dist/react/queries/tokens/index.d.ts +4 -4
- package/dist/react/queries/tokens/index.js +8 -9
- package/dist/react/queries/utils/index.d.ts +3 -3
- package/dist/react/queries/utils/index.js +12 -12
- package/dist/react/ssr/index.d.ts +7 -7
- package/dist/react/ssr/index.js +8 -8
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.d.ts +2 -2
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.js +12 -12
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +7 -10
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +28 -29
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +4 -4
- package/dist/react/ui/components/marketplace-collectible-card/index.js +28 -29
- 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 +8 -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 +8 -8
- package/dist/react/ui/index.d.ts +4 -4
- package/dist/react/ui/index.js +28 -29
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +28 -29
- package/dist/react/utils/index.d.ts +1 -1
- package/dist/react/utils/index.js +6 -6
- package/dist/{react-DE852KeT.js → react-CBsgOdVP.js} +608 -735
- package/dist/react-CBsgOdVP.js.map +1 -0
- package/dist/{sequence-paCCener.js → sequence-CRdb1yEs.js} +1 -1
- package/dist/{sequence-paCCener.js.map → sequence-CRdb1yEs.js.map} +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/{sudo-swap-9rH2EgfT.js → sudo-swap-BIklG2gq.js} +1 -1
- package/dist/{sudo-swap-9rH2EgfT.js.map → sudo-swap-BIklG2gq.js.map} +1 -1
- package/dist/{super-rare-DHIuWtRw.js → super-rare-h8645_5E.js} +1 -1
- package/dist/{super-rare-DHIuWtRw.js.map → super-rare-h8645_5E.js.map} +1 -1
- package/dist/token-Cv7l2ZaL.js.map +1 -1
- package/dist/{tokenBalances-ibDerNmM.js → tokenBalances-CouzNX4j.js} +6 -12
- package/dist/tokenBalances-CouzNX4j.js.map +1 -0
- package/dist/{tokenSupplies-Bfe8RHzI.d.ts → tokenSupplies-C3zJll0M.d.ts} +32 -39
- package/dist/{tokens-cGxMadd8.js → tokens-BvIRUCGG.js} +58 -27
- package/dist/tokens-BvIRUCGG.js.map +1 -0
- package/dist/transaction-DZUW5RHu.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types-B_-cnkcP.js.map +1 -1
- package/dist/{types-D2TJ1dwv.d.ts → types-CMDwfhfR.d.ts} +5 -5
- package/dist/utils/abi/index.d.ts +4 -4
- package/dist/utils/abi/marketplace/index.d.ts +1 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1 -1
- package/dist/utils/abi/token/index.d.ts +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.js +7 -7
- package/dist/{utils-BfpDVibN.js → utils-9ToOvt-c.js} +50 -7
- package/dist/utils-9ToOvt-c.js.map +1 -0
- package/dist/{utils-BqxcalL2.js → utils-B6di6O-C.js} +2 -2
- package/dist/utils-B6di6O-C.js.map +1 -0
- package/dist/{utils-BCgNhBFR.js → utils-BCYTEOvy.js} +17 -7
- package/dist/utils-BCYTEOvy.js.map +1 -0
- package/dist/{waitForTransactionReceipt-DieAnV52.js → waitForTransactionReceipt-CbSeUSXe.js} +5 -4
- package/dist/{waitForTransactionReceipt-DieAnV52.js.map → waitForTransactionReceipt-CbSeUSXe.js.map} +1 -1
- package/dist/{x2y2-45WDooeh.js → x2y2-OvF__ugj.js} +1 -1
- package/dist/{x2y2-45WDooeh.js.map → x2y2-OvF__ugj.js.map} +1 -1
- package/dist/{zora-CbeBoLvQ.js → zora-DzCeu-eE.js} +1 -1
- package/dist/{zora-CbeBoLvQ.js.map → zora-DzCeu-eE.js.map} +1 -1
- package/package.json +38 -38
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +13 -0
- package/src/react/_internal/api/index.ts +0 -1
- package/src/react/_internal/api/marketplace.gen.ts +70 -26
- package/src/react/_internal/api/query-keys.ts +9 -0
- package/src/react/hooks/data/collectibles/useBalanceOfCollectible.tsx +0 -9
- package/src/react/hooks/data/collectibles/useListCollectibles.tsx +1 -16
- package/src/react/hooks/data/collectibles/useTokenBalances.tsx +0 -9
- package/src/react/hooks/data/collections/index.ts +2 -0
- package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.test.tsx +112 -0
- package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.tsx +74 -0
- package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.test.tsx +110 -0
- package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.tsx +74 -0
- package/src/react/hooks/data/inventory/useInventory.tsx +1 -10
- package/src/react/hooks/data/market/useMarketCurrencies.test.tsx +31 -2
- package/src/react/hooks/data/primary-sales/index.ts +1 -0
- package/src/react/hooks/data/primary-sales/usePrimarySaleItem.tsx +71 -0
- package/src/react/hooks/data/tokens/useListBalances.tsx +1 -10
- package/src/react/hooks/data/tokens/useTokenSupplies.ts +1 -13
- package/src/react/hooks/transactions/useGenerateOfferTransaction.test.tsx +2 -0
- package/src/react/hooks/transactions/useProcessStep.test.tsx +8 -6
- package/src/react/hooks/transactions/useProcessStep.ts +8 -6
- package/src/react/hooks/utils/useComparePrices.test.tsx +1 -1
- package/src/react/providers/modal-provider.tsx +2 -1
- package/src/react/queries/collectibles/balanceOfCollectible.ts +1 -15
- package/src/react/queries/collectibles/listCollectibles.ts +1 -54
- package/src/react/queries/collectibles/tokenBalances.ts +1 -15
- package/src/react/queries/collections/activeListingsCurrencies.ts +84 -0
- package/src/react/queries/collections/activeOffersCurrencies.ts +84 -0
- package/src/react/queries/collections/index.ts +2 -0
- package/src/react/queries/inventory/inventory.ts +2 -9
- package/src/react/queries/market/marketCurrencies.ts +8 -1
- package/src/react/queries/primary-sales/index.ts +1 -0
- package/src/react/queries/primary-sales/primarySaleItem.ts +80 -0
- package/src/react/queries/tokens/listBalances.ts +1 -21
- package/src/react/queries/tokens/tokenSupplies.ts +2 -31
- package/src/react/queries/utils/comparePrices.ts +13 -1
- package/src/react/ui/components/_internals/action-button/ActionButton.stories.tsx +2 -0
- package/src/react/ui/components/marketplace-collectible-card/components/footer/Footer.tsx +4 -18
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +2 -2
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +0 -2
- package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +3 -0
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +1 -0
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +0 -23
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +22 -2
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +2 -0
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +2 -0
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +2 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +15 -12
- package/src/react/ui/modals/_internal/components/floorPriceText/__tests__/FloorPriceText.test.tsx +2 -0
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +148 -11
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +2 -0
- package/src/styles/styles.ts +1 -1
- package/src/utils/networkconfigToWagmiChain.ts +7 -0
- package/src/utils/price.ts +58 -0
- package/test/const.ts +2 -0
- package/test/server-setup.ts +0 -2
- package/.changeset/honest-peas-arrive.md +0 -5
- package/.changeset/real-tips-stick.md +0 -8
- package/.changeset/tall-pandas-wear.md +0 -8
- package/dist/BellIcon-ByhygxBO.js.map +0 -1
- package/dist/CartIcon-Bt3rQYGk.js.map +0 -1
- package/dist/CollectibleCard-CVpdgXA8.d.ts +0 -8
- package/dist/api-BoO0V5aJ.js.map +0 -1
- package/dist/builder-api-BFuZNOaN.js.map +0 -1
- package/dist/builder.gen-B9wR2nvF.js.map +0 -1
- package/dist/collectibles-C_H8jMGH.js.map +0 -1
- package/dist/collections-CKummc-R.js.map +0 -1
- package/dist/components-CosnX7F9.js.map +0 -1
- package/dist/create-config-CIfejoCk.js.map +0 -1
- package/dist/index-DNNUeZEq.d.ts +0 -18
- package/dist/inventory-Dd7TazvZ.js.map +0 -1
- package/dist/listBalances-BxpxBCvn.js +0 -57
- package/dist/listBalances-BxpxBCvn.js.map +0 -1
- package/dist/market-C3HV-awQ.js.map +0 -1
- package/dist/marketCurrencies-sKrTX0og.js.map +0 -1
- package/dist/marketplace-logos-D4dS1Foy.js.map +0 -1
- package/dist/marketplace.gen-ksUafDqS.js.map +0 -1
- package/dist/marketplaceConfig-UHQMM9fq.js.map +0 -1
- package/dist/network-DtmiMhcg.js.map +0 -1
- package/dist/networkconfigToWagmiChain-DbUf6HiO.js.map +0 -1
- package/dist/orders-DnFfZAXV.js.map +0 -1
- package/dist/primary-sales-Dmsi6bqj.js.map +0 -1
- package/dist/react-DE852KeT.js.map +0 -1
- package/dist/tokenBalances-ibDerNmM.js.map +0 -1
- package/dist/tokens-cGxMadd8.js.map +0 -1
- package/dist/utils-BCgNhBFR.js.map +0 -1
- package/dist/utils-BfpDVibN.js.map +0 -1
- package/dist/utils-BqxcalL2.js.map +0 -1
- package/src/react/_internal/api/__mocks__/laos.msw.ts +0 -387
- package/src/react/_internal/api/__tests__/laos-api.test.ts +0 -756
- package/src/react/_internal/api/laos-api.ts +0 -106
- package/src/react/hooks/data/collectibles/useBalanceOfCollectible.laos.test.tsx +0 -367
- package/src/react/queries/collectibles/__tests__/balanceOfCollectible.laos.test.ts +0 -123
- package/src/react/queries/collectibles/__tests__/tokenBalances.laos.test.ts +0 -123
- package/src/react/queries/inventory/__tests__/inventory.laos.test.ts +0 -499
- package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +0 -481
- /package/dist/{index-6wsMChsg.d.ts → index-CCggO_hw.d.ts} +0 -0
- /package/dist/{index-CZUtOTjh.d.ts → index-CKefEBrI.d.ts} +0 -0
- /package/dist/{index-DW3njUfb.d.ts → index-DgsCqh_P.d.ts} +0 -0
- /package/dist/{index-DewGsFz5.d.ts → index-xpO4AQyS.d.ts} +0 -0
- /package/dist/{queries-KOcILNJO.js → queries-CyajGg_O.js} +0 -0
|
@@ -2,13 +2,12 @@ import { queryOptions, skipToken } from '@tanstack/react-query';
|
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
3
|
import type { UseQueryParameters } from 'wagmi/query';
|
|
4
4
|
import type { SdkConfig } from '../../../types';
|
|
5
|
-
import { collectableKeys, getIndexerClient
|
|
5
|
+
import { collectableKeys, getIndexerClient } from '../../_internal';
|
|
6
6
|
|
|
7
7
|
export type UseTokenBalancesArgs = {
|
|
8
8
|
collectionAddress: Address;
|
|
9
9
|
userAddress: Address | undefined;
|
|
10
10
|
chainId: number;
|
|
11
|
-
isLaos721?: boolean;
|
|
12
11
|
includeMetadata?: boolean;
|
|
13
12
|
query?: UseQueryParameters;
|
|
14
13
|
};
|
|
@@ -26,18 +25,6 @@ export async function fetchTokenBalances(
|
|
|
26
25
|
},
|
|
27
26
|
config: SdkConfig,
|
|
28
27
|
) {
|
|
29
|
-
if (args.isLaos721) {
|
|
30
|
-
const laosApi = new LaosAPI();
|
|
31
|
-
const response = await laosApi.getTokenBalances({
|
|
32
|
-
chainId: args.chainId.toString(),
|
|
33
|
-
contractAddress: args.collectionAddress,
|
|
34
|
-
accountAddress: args.userAddress,
|
|
35
|
-
includeMetadata: true,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
return response.balances || [];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
28
|
const indexerClient = getIndexerClient(args.chainId, config);
|
|
42
29
|
return indexerClient
|
|
43
30
|
.getTokenBalances({
|
|
@@ -64,7 +51,6 @@ export function getTokenBalancesQueryKey(args: UseTokenBalancesArgs) {
|
|
|
64
51
|
includeContracts: [args.collectionAddress],
|
|
65
52
|
}
|
|
66
53
|
: undefined,
|
|
67
|
-
isLaos721: args.isLaos721,
|
|
68
54
|
};
|
|
69
55
|
|
|
70
56
|
return [...collectableKeys.userBalances, apiArgs] as const;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { SdkConfig } from '../../../types';
|
|
3
|
+
import {
|
|
4
|
+
collectionKeys,
|
|
5
|
+
type GetCollectionActiveListingsCurrenciesArgs,
|
|
6
|
+
type GetCollectionActiveListingsCurrenciesReturn,
|
|
7
|
+
getMarketplaceClient,
|
|
8
|
+
type QueryKeyArgs,
|
|
9
|
+
type ValuesOptional,
|
|
10
|
+
} from '../../_internal';
|
|
11
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
12
|
+
|
|
13
|
+
export interface FetchCollectionActiveListingsCurrenciesParams
|
|
14
|
+
extends Omit<
|
|
15
|
+
GetCollectionActiveListingsCurrenciesArgs,
|
|
16
|
+
'contractAddress' | 'chainId'
|
|
17
|
+
> {
|
|
18
|
+
collectionAddress: string;
|
|
19
|
+
chainId: number;
|
|
20
|
+
config: SdkConfig;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Fetches the active listings currencies for a collection from the marketplace API
|
|
25
|
+
*/
|
|
26
|
+
export async function fetchCollectionActiveListingsCurrencies(
|
|
27
|
+
params: FetchCollectionActiveListingsCurrenciesParams,
|
|
28
|
+
): Promise<GetCollectionActiveListingsCurrenciesReturn['currencies']> {
|
|
29
|
+
const { collectionAddress, chainId, config, ...additionalApiParams } = params;
|
|
30
|
+
|
|
31
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
32
|
+
|
|
33
|
+
const apiArgs: GetCollectionActiveListingsCurrenciesArgs = {
|
|
34
|
+
contractAddress: collectionAddress,
|
|
35
|
+
chainId: String(chainId),
|
|
36
|
+
...additionalApiParams,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const result =
|
|
40
|
+
await marketplaceClient.getCollectionActiveListingsCurrencies(apiArgs);
|
|
41
|
+
return result.currencies;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type CollectionActiveListingsCurrenciesQueryOptions =
|
|
45
|
+
ValuesOptional<FetchCollectionActiveListingsCurrenciesParams> & {
|
|
46
|
+
query?: StandardQueryOptions;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function getCollectionActiveListingsCurrenciesQueryKey(
|
|
50
|
+
params: CollectionActiveListingsCurrenciesQueryOptions,
|
|
51
|
+
) {
|
|
52
|
+
const apiArgs = {
|
|
53
|
+
chainId: String(params.chainId),
|
|
54
|
+
contractAddress: params.collectionAddress,
|
|
55
|
+
} satisfies QueryKeyArgs<GetCollectionActiveListingsCurrenciesArgs>;
|
|
56
|
+
|
|
57
|
+
return [...collectionKeys.activeListingsCurrencies, apiArgs] as const;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function collectionActiveListingsCurrenciesQueryOptions(
|
|
61
|
+
params: CollectionActiveListingsCurrenciesQueryOptions,
|
|
62
|
+
) {
|
|
63
|
+
const enabled = Boolean(
|
|
64
|
+
params.collectionAddress &&
|
|
65
|
+
params.chainId &&
|
|
66
|
+
params.config &&
|
|
67
|
+
(params.query?.enabled ?? true),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return queryOptions({
|
|
71
|
+
queryKey: getCollectionActiveListingsCurrenciesQueryKey(params),
|
|
72
|
+
queryFn: () =>
|
|
73
|
+
fetchCollectionActiveListingsCurrencies({
|
|
74
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
75
|
+
chainId: params.chainId!,
|
|
76
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
77
|
+
collectionAddress: params.collectionAddress!,
|
|
78
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
79
|
+
config: params.config!,
|
|
80
|
+
}),
|
|
81
|
+
...params.query,
|
|
82
|
+
enabled,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { SdkConfig } from '../../../types';
|
|
3
|
+
import {
|
|
4
|
+
collectionKeys,
|
|
5
|
+
type GetCollectionActiveOffersCurrenciesArgs,
|
|
6
|
+
type GetCollectionActiveOffersCurrenciesReturn,
|
|
7
|
+
getMarketplaceClient,
|
|
8
|
+
type QueryKeyArgs,
|
|
9
|
+
type ValuesOptional,
|
|
10
|
+
} from '../../_internal';
|
|
11
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
12
|
+
|
|
13
|
+
export interface FetchCollectionActiveOffersCurrenciesParams
|
|
14
|
+
extends Omit<
|
|
15
|
+
GetCollectionActiveOffersCurrenciesArgs,
|
|
16
|
+
'contractAddress' | 'chainId'
|
|
17
|
+
> {
|
|
18
|
+
collectionAddress: string;
|
|
19
|
+
chainId: number;
|
|
20
|
+
config: SdkConfig;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Fetches the active offers currencies for a collection from the marketplace API
|
|
25
|
+
*/
|
|
26
|
+
export async function fetchCollectionActiveOffersCurrencies(
|
|
27
|
+
params: FetchCollectionActiveOffersCurrenciesParams,
|
|
28
|
+
): Promise<GetCollectionActiveOffersCurrenciesReturn['currencies']> {
|
|
29
|
+
const { collectionAddress, chainId, config, ...additionalApiParams } = params;
|
|
30
|
+
|
|
31
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
32
|
+
|
|
33
|
+
const apiArgs: GetCollectionActiveOffersCurrenciesArgs = {
|
|
34
|
+
contractAddress: collectionAddress,
|
|
35
|
+
chainId: String(chainId),
|
|
36
|
+
...additionalApiParams,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const result =
|
|
40
|
+
await marketplaceClient.getCollectionActiveOffersCurrencies(apiArgs);
|
|
41
|
+
return result.currencies;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type CollectionActiveOffersCurrenciesQueryOptions =
|
|
45
|
+
ValuesOptional<FetchCollectionActiveOffersCurrenciesParams> & {
|
|
46
|
+
query?: StandardQueryOptions;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function getCollectionActiveOffersCurrenciesQueryKey(
|
|
50
|
+
params: CollectionActiveOffersCurrenciesQueryOptions,
|
|
51
|
+
) {
|
|
52
|
+
const apiArgs = {
|
|
53
|
+
chainId: String(params.chainId),
|
|
54
|
+
contractAddress: params.collectionAddress,
|
|
55
|
+
} satisfies QueryKeyArgs<GetCollectionActiveOffersCurrenciesArgs>;
|
|
56
|
+
|
|
57
|
+
return [...collectionKeys.activeOffersCurrencies, apiArgs] as const;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function collectionActiveOffersCurrenciesQueryOptions(
|
|
61
|
+
params: CollectionActiveOffersCurrenciesQueryOptions,
|
|
62
|
+
) {
|
|
63
|
+
const enabled = Boolean(
|
|
64
|
+
params.collectionAddress &&
|
|
65
|
+
params.chainId &&
|
|
66
|
+
params.config &&
|
|
67
|
+
(params.query?.enabled ?? true),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return queryOptions({
|
|
71
|
+
queryKey: getCollectionActiveOffersCurrenciesQueryKey(params),
|
|
72
|
+
queryFn: () =>
|
|
73
|
+
fetchCollectionActiveOffersCurrencies({
|
|
74
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
75
|
+
chainId: params.chainId!,
|
|
76
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
77
|
+
collectionAddress: params.collectionAddress!,
|
|
78
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
79
|
+
config: params.config!,
|
|
80
|
+
}),
|
|
81
|
+
...params.query,
|
|
82
|
+
enabled,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -15,7 +15,6 @@ export interface UseInventoryArgs {
|
|
|
15
15
|
accountAddress: Address;
|
|
16
16
|
collectionAddress: Address;
|
|
17
17
|
chainId: number;
|
|
18
|
-
isLaos721?: boolean;
|
|
19
18
|
includeNonTradable?: boolean;
|
|
20
19
|
query?: {
|
|
21
20
|
enabled?: boolean;
|
|
@@ -24,9 +23,7 @@ export interface UseInventoryArgs {
|
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
isLaos721: boolean;
|
|
29
|
-
}
|
|
26
|
+
type GetInventoryArgs = Omit<UseInventoryArgs, 'query'>;
|
|
30
27
|
|
|
31
28
|
interface CollectibleWithBalance {
|
|
32
29
|
metadata: {
|
|
@@ -77,7 +74,6 @@ async function fetchIndexerTokens(
|
|
|
77
74
|
accountAddress: Address,
|
|
78
75
|
collectionAddress: Address,
|
|
79
76
|
config: SdkConfig,
|
|
80
|
-
isLaos721: boolean,
|
|
81
77
|
): Promise<{ collectibles: CollectibleWithBalance[] }> {
|
|
82
78
|
const queryClient = getQueryClient();
|
|
83
79
|
const balances = await queryClient.fetchQuery(
|
|
@@ -86,7 +82,6 @@ async function fetchIndexerTokens(
|
|
|
86
82
|
collectionAddress,
|
|
87
83
|
userAddress: accountAddress,
|
|
88
84
|
chainId,
|
|
89
|
-
isLaos721,
|
|
90
85
|
includeMetadata: true,
|
|
91
86
|
},
|
|
92
87
|
config,
|
|
@@ -107,7 +102,7 @@ export async function fetchInventory(
|
|
|
107
102
|
config: SdkConfig,
|
|
108
103
|
page: Page,
|
|
109
104
|
): Promise<CollectiblesResponse> {
|
|
110
|
-
const { accountAddress, collectionAddress, chainId
|
|
105
|
+
const { accountAddress, collectionAddress, chainId } = args;
|
|
111
106
|
const marketplaceConfig = await fetchMarketplaceConfig({ config });
|
|
112
107
|
|
|
113
108
|
const marketCollections = marketplaceConfig?.market.collections || [];
|
|
@@ -125,7 +120,6 @@ export async function fetchInventory(
|
|
|
125
120
|
accountAddress,
|
|
126
121
|
collectionAddress,
|
|
127
122
|
config,
|
|
128
|
-
isLaos721,
|
|
129
123
|
);
|
|
130
124
|
|
|
131
125
|
return {
|
|
@@ -156,7 +150,6 @@ export function inventoryOptions(args: UseInventoryArgs, config: SdkConfig) {
|
|
|
156
150
|
fetchInventory(
|
|
157
151
|
{
|
|
158
152
|
...args,
|
|
159
|
-
isLaos721: args.isLaos721 ?? false,
|
|
160
153
|
},
|
|
161
154
|
config,
|
|
162
155
|
{
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
getMarketplaceClient,
|
|
8
8
|
getQueryClient,
|
|
9
9
|
type ListCurrenciesArgs,
|
|
10
|
+
OrderbookKind,
|
|
10
11
|
type QueryKeyArgs,
|
|
11
12
|
type ValuesOptional,
|
|
12
13
|
} from '../../_internal';
|
|
@@ -46,6 +47,11 @@ export async function fetchMarketCurrencies(
|
|
|
46
47
|
const marketplaceConfig = await queryClient.fetchQuery(
|
|
47
48
|
marketplaceConfigOptions(config),
|
|
48
49
|
);
|
|
50
|
+
const collection = marketplaceConfig.market.collections.find((collection) =>
|
|
51
|
+
compareAddress(collection.itemsAddress, collectionAddress),
|
|
52
|
+
);
|
|
53
|
+
const isOpensea =
|
|
54
|
+
collection?.destinationMarketplace === OrderbookKind.opensea;
|
|
49
55
|
|
|
50
56
|
const currenciesOptions = marketplaceConfig.market.collections.find(
|
|
51
57
|
(collection) =>
|
|
@@ -53,7 +59,8 @@ export async function fetchMarketCurrencies(
|
|
|
53
59
|
)?.currencyOptions;
|
|
54
60
|
|
|
55
61
|
// Filter currencies based on collection currency options
|
|
56
|
-
|
|
62
|
+
// Skip filtering for OpenSea as it uses API-based currency support flags
|
|
63
|
+
if (currenciesOptions && !isOpensea) {
|
|
57
64
|
currencies = currencies.filter((currency) =>
|
|
58
65
|
currenciesOptions.includes(currency.contractAddress),
|
|
59
66
|
);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { SdkConfig } from '../../../types';
|
|
3
|
+
import {
|
|
4
|
+
collectableKeys,
|
|
5
|
+
type GetPrimarySaleItemArgs,
|
|
6
|
+
getMarketplaceClient,
|
|
7
|
+
type QueryKeyArgs,
|
|
8
|
+
type ValuesOptional,
|
|
9
|
+
} from '../../_internal';
|
|
10
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
11
|
+
|
|
12
|
+
export interface FetchPrimarySaleItemParams
|
|
13
|
+
extends Omit<GetPrimarySaleItemArgs, 'chainId'> {
|
|
14
|
+
chainId: number;
|
|
15
|
+
config: SdkConfig;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Fetches a single primary sale item from the marketplace API
|
|
20
|
+
*/
|
|
21
|
+
export async function fetchPrimarySaleItem(params: FetchPrimarySaleItemParams) {
|
|
22
|
+
const { chainId, primarySaleContractAddress, tokenId, config } = params;
|
|
23
|
+
|
|
24
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
25
|
+
|
|
26
|
+
const apiArgs: GetPrimarySaleItemArgs = {
|
|
27
|
+
chainId: String(chainId),
|
|
28
|
+
primarySaleContractAddress,
|
|
29
|
+
tokenId,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const result = await marketplaceClient.getPrimarySaleItem(apiArgs);
|
|
33
|
+
return result.item;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type PrimarySaleItemQueryOptions =
|
|
37
|
+
ValuesOptional<FetchPrimarySaleItemParams> & {
|
|
38
|
+
query?: StandardQueryOptions;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export function getPrimarySaleItemQueryKey(
|
|
42
|
+
params: PrimarySaleItemQueryOptions,
|
|
43
|
+
) {
|
|
44
|
+
const apiArgs = {
|
|
45
|
+
chainId: String(params.chainId),
|
|
46
|
+
primarySaleContractAddress: params.primarySaleContractAddress,
|
|
47
|
+
tokenId: params.tokenId,
|
|
48
|
+
} satisfies QueryKeyArgs<GetPrimarySaleItemArgs>;
|
|
49
|
+
|
|
50
|
+
return [...collectableKeys.primarySaleItem, apiArgs] as const;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function primarySaleItemQueryOptions(
|
|
54
|
+
params: PrimarySaleItemQueryOptions,
|
|
55
|
+
) {
|
|
56
|
+
const enabled = Boolean(
|
|
57
|
+
params.chainId &&
|
|
58
|
+
params.primarySaleContractAddress &&
|
|
59
|
+
params.tokenId &&
|
|
60
|
+
params.config &&
|
|
61
|
+
(params.query?.enabled ?? true),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return queryOptions({
|
|
65
|
+
queryKey: getPrimarySaleItemQueryKey(params),
|
|
66
|
+
queryFn: () =>
|
|
67
|
+
fetchPrimarySaleItem({
|
|
68
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
69
|
+
chainId: params.chainId!,
|
|
70
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
71
|
+
primarySaleContractAddress: params.primarySaleContractAddress!,
|
|
72
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
73
|
+
tokenId: params.tokenId!,
|
|
74
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
75
|
+
config: params.config!,
|
|
76
|
+
}),
|
|
77
|
+
...params.query,
|
|
78
|
+
enabled,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { GetTokenBalancesReturn, Page } from '@0xsequence/indexer';
|
|
|
2
2
|
import { infiniteQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
import type { Address, Hex } from 'viem';
|
|
4
4
|
import type { SdkConfig } from '../../../types';
|
|
5
|
-
import { balanceQueries, getIndexerClient
|
|
5
|
+
import { balanceQueries, getIndexerClient } from '../../_internal';
|
|
6
6
|
|
|
7
7
|
export type UseListBalancesArgs = {
|
|
8
8
|
chainId: number;
|
|
@@ -17,7 +17,6 @@ export type UseListBalancesArgs = {
|
|
|
17
17
|
};
|
|
18
18
|
includeCollectionTokens?: boolean;
|
|
19
19
|
page?: Page;
|
|
20
|
-
isLaos721?: boolean;
|
|
21
20
|
//TODO: More options
|
|
22
21
|
query?: {
|
|
23
22
|
enabled?: boolean;
|
|
@@ -29,24 +28,6 @@ export async function fetchBalances(
|
|
|
29
28
|
config: SdkConfig,
|
|
30
29
|
page: Page,
|
|
31
30
|
): Promise<GetTokenBalancesReturn> {
|
|
32
|
-
if (args.isLaos721 && args.accountAddress) {
|
|
33
|
-
const laosClient = new LaosAPI();
|
|
34
|
-
return laosClient.getTokenBalances({
|
|
35
|
-
chainId: args.chainId.toString(),
|
|
36
|
-
accountAddress: args.accountAddress,
|
|
37
|
-
contractAddress: args.contractAddress as Address,
|
|
38
|
-
includeMetadata: args.includeMetadata,
|
|
39
|
-
page: {
|
|
40
|
-
sort: [
|
|
41
|
-
{
|
|
42
|
-
column: 'CREATED_AT',
|
|
43
|
-
order: 'DESC',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
31
|
const indexerClient = getIndexerClient(args.chainId, config);
|
|
51
32
|
return indexerClient.getTokenBalances({
|
|
52
33
|
...args,
|
|
@@ -64,7 +45,6 @@ export function getListBalancesQueryKey(args: UseListBalancesArgs) {
|
|
|
64
45
|
includeMetadata: args.includeMetadata,
|
|
65
46
|
metadataOptions: args.metadataOptions,
|
|
66
47
|
includeCollectionTokens: args.includeCollectionTokens,
|
|
67
|
-
isLaos721: args.isLaos721,
|
|
68
48
|
};
|
|
69
49
|
|
|
70
50
|
return [...balanceQueries.lists, apiArgs] as const;
|
|
@@ -3,7 +3,6 @@ import { infiniteQueryOptions } from '@tanstack/react-query';
|
|
|
3
3
|
import type { SdkConfig } from '../../../types';
|
|
4
4
|
import {
|
|
5
5
|
getIndexerClient,
|
|
6
|
-
LaosAPI,
|
|
7
6
|
tokenKeys,
|
|
8
7
|
type ValuesOptional,
|
|
9
8
|
} from '../../_internal';
|
|
@@ -14,40 +13,14 @@ export interface FetchTokenSuppliesParams
|
|
|
14
13
|
chainId: number;
|
|
15
14
|
collectionAddress: string;
|
|
16
15
|
config: SdkConfig;
|
|
17
|
-
isLaos721?: boolean;
|
|
18
16
|
page?: Page;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
* Fetches token supplies with support for
|
|
23
|
-
* Uses the more efficient single-contract APIs from both services
|
|
20
|
+
* Fetches token supplies with support for indexer API
|
|
24
21
|
*/
|
|
25
22
|
export async function fetchTokenSupplies(params: FetchTokenSuppliesParams) {
|
|
26
|
-
const { chainId, collectionAddress, config,
|
|
27
|
-
|
|
28
|
-
if (isLaos721) {
|
|
29
|
-
const laosApi = new LaosAPI();
|
|
30
|
-
|
|
31
|
-
// Convert indexer Page format to LAOS PaginationOptions format
|
|
32
|
-
const laosPage = rest.page
|
|
33
|
-
? {
|
|
34
|
-
sort:
|
|
35
|
-
rest.page.sort?.map((sortBy) => ({
|
|
36
|
-
column: sortBy.column,
|
|
37
|
-
order: sortBy.order,
|
|
38
|
-
})) || [],
|
|
39
|
-
}
|
|
40
|
-
: undefined;
|
|
41
|
-
|
|
42
|
-
const result = await laosApi.getTokenSupplies({
|
|
43
|
-
chainId: chainId.toString(),
|
|
44
|
-
contractAddress: collectionAddress,
|
|
45
|
-
includeMetadata: rest.includeMetadata,
|
|
46
|
-
page: laosPage,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
23
|
+
const { chainId, collectionAddress, config, ...rest } = params;
|
|
51
24
|
|
|
52
25
|
const indexerClient = getIndexerClient(chainId, config);
|
|
53
26
|
|
|
@@ -71,7 +44,6 @@ export function getTokenSuppliesQueryKey(params: TokenSuppliesQueryOptions) {
|
|
|
71
44
|
contractAddress: params.collectionAddress!,
|
|
72
45
|
includeMetadata: params.includeMetadata,
|
|
73
46
|
metadataOptions: params.metadataOptions,
|
|
74
|
-
isLaos721: params.isLaos721,
|
|
75
47
|
};
|
|
76
48
|
|
|
77
49
|
return [...tokenKeys.supplies, apiArgs] as const;
|
|
@@ -95,7 +67,6 @@ export function tokenSuppliesQueryOptions(params: TokenSuppliesQueryOptions) {
|
|
|
95
67
|
collectionAddress: params.collectionAddress!,
|
|
96
68
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
97
69
|
config: params.config!,
|
|
98
|
-
isLaos721: params.isLaos721,
|
|
99
70
|
includeMetadata: params.includeMetadata,
|
|
100
71
|
metadataOptions: params.metadataOptions,
|
|
101
72
|
page: pageParam,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
import * as dn from 'dnum';
|
|
2
3
|
import type { Address } from 'viem';
|
|
3
4
|
import type { SdkConfig } from '../../../types';
|
|
4
5
|
import { currencyKeys, type ValuesOptional } from '../../_internal';
|
|
@@ -62,9 +63,20 @@ export async function fetchComparePrices(
|
|
|
62
63
|
const isAbove = percentageDifference > 0;
|
|
63
64
|
const isSame = percentageDifference === 0;
|
|
64
65
|
|
|
66
|
+
// proper comma separators
|
|
67
|
+
const absPercentage = Math.abs(percentageDifference);
|
|
68
|
+
const formattedPercentage = dn.format(
|
|
69
|
+
[BigInt(Math.round(absPercentage * 100)), 2],
|
|
70
|
+
{
|
|
71
|
+
digits: 2,
|
|
72
|
+
trailingZeros: true,
|
|
73
|
+
locale: 'en-US',
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
65
77
|
return {
|
|
66
78
|
percentageDifference,
|
|
67
|
-
percentageDifferenceFormatted:
|
|
79
|
+
percentageDifferenceFormatted: formattedPercentage,
|
|
68
80
|
status: isAbove ? 'above' : isSame ? 'same' : 'below',
|
|
69
81
|
};
|
|
70
82
|
}
|
|
@@ -164,6 +164,7 @@ export const SellAction: Story = {
|
|
|
164
164
|
...MOCK_ORDER,
|
|
165
165
|
side: OrderSide.offer,
|
|
166
166
|
status: OrderStatus.active,
|
|
167
|
+
slug: 'test-order',
|
|
167
168
|
},
|
|
168
169
|
orderbookKind: OrderbookKind.sequence_marketplace_v1,
|
|
169
170
|
},
|
|
@@ -276,6 +277,7 @@ export const MarketBuyAction: Story = {
|
|
|
276
277
|
...MOCK_ORDER,
|
|
277
278
|
side: OrderSide.listing,
|
|
278
279
|
status: OrderStatus.active,
|
|
280
|
+
slug: 'test-order',
|
|
279
281
|
},
|
|
280
282
|
orderbookKind: OrderbookKind.sequence_marketplace_v1,
|
|
281
283
|
onCannotPerformAction: fn(),
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type Currency,
|
|
10
10
|
type Order,
|
|
11
11
|
} from '../../../../../_internal';
|
|
12
|
-
import { useCurrency
|
|
12
|
+
import { useCurrency } from '../../../../../hooks';
|
|
13
13
|
import {
|
|
14
14
|
FooterName,
|
|
15
15
|
PriceDisplay,
|
|
@@ -19,13 +19,12 @@ import {
|
|
|
19
19
|
|
|
20
20
|
type FooterProps = {
|
|
21
21
|
chainId: number;
|
|
22
|
-
collectionAddress: Address;
|
|
23
|
-
collectibleId: string;
|
|
24
22
|
name: string;
|
|
25
23
|
type?: ContractType;
|
|
26
24
|
decimals?: number;
|
|
27
25
|
onOfferClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
28
26
|
highestOffer?: Order;
|
|
27
|
+
lowestListing?: Order;
|
|
29
28
|
balance?: string;
|
|
30
29
|
quantityInitial?: string | undefined;
|
|
31
30
|
quantityRemaining?: string | undefined;
|
|
@@ -37,13 +36,12 @@ type FooterProps = {
|
|
|
37
36
|
|
|
38
37
|
export const Footer = ({
|
|
39
38
|
chainId,
|
|
40
|
-
collectionAddress,
|
|
41
|
-
collectibleId,
|
|
42
39
|
name,
|
|
43
40
|
type,
|
|
44
41
|
decimals,
|
|
45
42
|
onOfferClick,
|
|
46
43
|
highestOffer,
|
|
44
|
+
lowestListing,
|
|
47
45
|
balance,
|
|
48
46
|
quantityInitial,
|
|
49
47
|
quantityRemaining,
|
|
@@ -56,16 +54,6 @@ export const Footer = ({
|
|
|
56
54
|
const isMarket = cardType === 'market';
|
|
57
55
|
const isInventoryNonTradable = cardType === 'inventory-non-tradable';
|
|
58
56
|
|
|
59
|
-
const { data: lowestListing, isLoading: isLowestListingLoading } =
|
|
60
|
-
useLowestListing({
|
|
61
|
-
chainId,
|
|
62
|
-
collectionAddress,
|
|
63
|
-
tokenId: collectibleId,
|
|
64
|
-
query: {
|
|
65
|
-
enabled: isMarket, // Only fetch for market cards
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
|
|
69
57
|
const { data: currency, isLoading: isCurrencyLoading } = useCurrency({
|
|
70
58
|
chainId,
|
|
71
59
|
currencyAddress: lowestListing?.priceCurrencyAddress as Address,
|
|
@@ -79,9 +67,7 @@ export const Footer = ({
|
|
|
79
67
|
|
|
80
68
|
// Show loading state when listing is loading, or when listing exists but currency is still loading
|
|
81
69
|
const isPriceLoading =
|
|
82
|
-
isMarket &&
|
|
83
|
-
(isLowestListingLoading ||
|
|
84
|
-
(!!lowestListing?.priceCurrencyAddress && isCurrencyLoading));
|
|
70
|
+
isMarket && !!lowestListing?.priceCurrencyAddress && isCurrencyLoading;
|
|
85
71
|
|
|
86
72
|
return (
|
|
87
73
|
<div className="relative flex flex-col items-start gap-2 whitespace-nowrap bg-background-primary p-4">
|
|
@@ -26,6 +26,7 @@ export function MarketCard({
|
|
|
26
26
|
}: MarketCollectibleCardProps) {
|
|
27
27
|
const collectibleMetadata = collectible?.metadata;
|
|
28
28
|
const highestOffer = collectible?.offer;
|
|
29
|
+
const lowestListing = collectible?.listing;
|
|
29
30
|
|
|
30
31
|
if (!collectibleMetadata) {
|
|
31
32
|
console.error('Collectible metadata is undefined');
|
|
@@ -71,12 +72,11 @@ export function MarketCard({
|
|
|
71
72
|
>
|
|
72
73
|
<Footer
|
|
73
74
|
chainId={chainId}
|
|
74
|
-
collectionAddress={collectionAddress}
|
|
75
|
-
collectibleId={collectibleId}
|
|
76
75
|
name={collectibleMetadata.name || ''}
|
|
77
76
|
type={collectionType}
|
|
78
77
|
onOfferClick={(e) => onOfferClick?.({ order: highestOffer, e })}
|
|
79
78
|
highestOffer={highestOffer}
|
|
79
|
+
lowestListing={lowestListing}
|
|
80
80
|
balance={balance}
|
|
81
81
|
decimals={collectibleMetadata.decimals}
|
|
82
82
|
quantityInitial={
|
|
@@ -140,6 +140,7 @@ const mockOrder = {
|
|
|
140
140
|
blockNumber: 1234567,
|
|
141
141
|
createdAt: new Date().toISOString(),
|
|
142
142
|
updatedAt: new Date().toISOString(),
|
|
143
|
+
slug: 'test-order',
|
|
143
144
|
};
|
|
144
145
|
|
|
145
146
|
const mockCheckoutOptions = {
|
|
@@ -161,6 +162,8 @@ const mockCurrency = {
|
|
|
161
162
|
exchangeRate: 3000,
|
|
162
163
|
defaultChainCurrency: true,
|
|
163
164
|
nativeCurrency: true,
|
|
165
|
+
openseaListing: true,
|
|
166
|
+
openseaOffer: true,
|
|
164
167
|
createdAt: new Date().toISOString(),
|
|
165
168
|
updatedAt: new Date().toISOString(),
|
|
166
169
|
};
|