@0xsequence/marketplace-sdk 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -3
- package/dist/{BellIcon-ByhygxBO.js → BellIcon.js} +4 -4
- package/dist/BellIcon.js.map +1 -0
- package/dist/{CartIcon-Bt3rQYGk.js → CartIcon.js} +7 -7
- package/dist/CartIcon.js.map +1 -0
- package/dist/CollectibleCard.d.ts +8 -0
- package/dist/{_internal-DkS2VUn5.js → _internal.js} +2 -2
- package/dist/_internal.js.map +1 -0
- package/dist/{abi-fa-o9gH3.js → abi.js} +2 -2
- package/dist/abi.js.map +1 -0
- package/dist/{alien_swap-DoY6XfMA.js → alien_swap.js} +1 -1
- package/dist/alien_swap.js.map +1 -0
- package/dist/{api-BoO0V5aJ.js → api.js} +13 -64
- package/dist/api.js.map +1 -0
- package/dist/{aqua-xyz-BBDxnG14.js → aqua-xyz.js} +1 -1
- package/dist/aqua-xyz.js.map +1 -0
- package/dist/{aura-DGx2zwvF.js → aura.js} +1 -1
- package/dist/aura.js.map +1 -0
- package/dist/{blur-D8GKrRrq.js → blur.js} +1 -1
- package/dist/blur.js.map +1 -0
- package/dist/{builder-api-BFuZNOaN.js → builder-api.js} +3 -3
- package/dist/builder-api.js.map +1 -0
- package/dist/{builder.gen-B9wR2nvF.js → builder.gen.js} +3 -6
- package/dist/builder.gen.js.map +1 -0
- package/dist/{coinbase-DOry4PXY.js → coinbase.js} +1 -1
- package/dist/coinbase.js.map +1 -0
- package/dist/{collectibles-C_H8jMGH.js → collectibles.js} +9 -48
- package/dist/collectibles.js.map +1 -0
- package/dist/{collections-CKummc-R.js → collections.js} +79 -8
- package/dist/collections.js.map +1 -0
- package/dist/{components-CosnX7F9.js → components.js} +12 -14
- package/dist/components.js.map +1 -0
- package/dist/{contracts-BP_0vX48.js → contracts.js} +4 -4
- package/dist/contracts.js.map +1 -0
- package/dist/{create-config-ZOB7i4ZJ.d.ts → create-config.d.ts} +47 -60
- package/dist/{create-config-CIfejoCk.js → create-config.js} +10 -13
- package/dist/create-config.js.map +1 -0
- package/dist/{element-ciybd_VF.js → element.js} +1 -1
- package/dist/element.js.map +1 -0
- package/dist/{filters-V-V8Dn8f.d.ts → filters.d.ts} +7 -7
- package/dist/{foundation-Bq4lRz4x.js → foundation.js} +1 -1
- package/dist/foundation.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +16 -16
- package/dist/{index-DUXfvhxs.d.ts → index10.d.ts} +14 -29
- package/dist/{index-CxA34wP1.d.ts → index11.d.ts} +101 -23
- package/dist/{index-BtWMBHeP.d.ts → index12.d.ts} +11 -9
- package/dist/{index-DmudgrsN.d.ts → index13.d.ts} +16 -16
- package/dist/{index-U-zp70of.d.ts → index14.d.ts} +9 -13
- package/dist/{index-Stm5u0I0.d.ts → index16.d.ts} +7 -10
- package/dist/{index-BZIJTQT0.d.ts → index17.d.ts} +9 -9
- package/dist/{index-CnEbXm_t.d.ts → index19.d.ts} +50 -12
- package/dist/{index-C-745li7.d.ts → index2.d.ts} +2 -2
- package/dist/{index-BOiHR01C.d.ts → index21.d.ts} +9 -9
- package/dist/{index-Bsx6XsC2.d.ts → index23.d.ts} +100 -59
- package/dist/{index-CPzvNmq9.d.ts → index24.d.ts} +36 -36
- package/dist/{index-DFEnA6Wa.d.ts → index25.d.ts} +18 -18
- package/dist/{index-DqXd1EeB.d.ts → index26.d.ts} +14 -7
- package/dist/{index-NlPMNcqh.d.ts → index27.d.ts} +102 -114
- package/dist/{index-DWt6yrIG.d.ts → index28.d.ts} +8 -8
- package/dist/{index-C4MUKshG.d.ts → index29.d.ts} +3 -3
- package/dist/{index-BeRV-7AX.d.ts → index3.d.ts} +2 -2
- package/dist/{index-Bxzjy0d1.d.ts → index4.d.ts} +2 -2
- package/dist/{index-DwKr18CI.d.ts → index5.d.ts} +2 -2
- package/dist/{index-D9LPlmbC.d.ts → index6.d.ts} +2 -2
- package/dist/{index-CS65jqOq.d.ts → index7.d.ts} +19 -3
- package/dist/index8.d.ts +18 -0
- package/dist/{index-CxpFwGvR.d.ts → index9.d.ts} +4 -4
- package/dist/{inventory-Dd7TazvZ.js → inventory.js} +11 -15
- package/dist/inventory.js.map +1 -0
- package/dist/{listCollectiblesPaginated-Cy2_qEZA.d.ts → listCollectiblesPaginated.d.ts} +24 -29
- package/dist/{listCollections-BB9FxKj2.d.ts → listCollections.d.ts} +170 -100
- package/dist/{looks-rare-6H--x3AM.js → looks-rare.js} +1 -1
- package/dist/looks-rare.js.map +1 -0
- package/dist/{lowestListing-Cbsi6M1K.d.ts → lowestListing.d.ts} +28 -28
- package/dist/{magic-eden-BoxEQ1Li.js → magic-eden.js} +1 -1
- package/dist/magic-eden.js.map +1 -0
- package/dist/{manifold-DycKsljb.js → manifold.js} +1 -1
- package/dist/manifold.js.map +1 -0
- package/dist/{market-C3HV-awQ.js → market.js} +7 -9
- package/dist/market.js.map +1 -0
- package/dist/{marketCurrencies-Bpw1bIO0.d.ts → marketCurrencies.d.ts} +19 -9
- package/dist/{marketCurrencies-sKrTX0og.js → marketCurrencies.js} +10 -7
- package/dist/marketCurrencies.js.map +1 -0
- package/dist/{marketplace-logos-D4dS1Foy.js → marketplace-logos.js} +23 -23
- package/dist/marketplace-logos.js.map +1 -0
- package/dist/{marketplace.gen-ksUafDqS.js → marketplace.gen.js} +25 -9
- package/dist/marketplace.gen.js.map +1 -0
- package/dist/{marketplace-NQB-sEQL.js → marketplace.js} +2 -2
- package/dist/marketplace.js.map +1 -0
- package/dist/{marketplaceConfig-UHQMM9fq.js → marketplaceConfig.js} +3 -3
- package/dist/marketplaceConfig.js.map +1 -0
- package/dist/{mintify-Dyqyo8jQ.js → mintify.js} +1 -1
- package/dist/mintify.js.map +1 -0
- package/dist/{network-DtmiMhcg.js → network.js} +3 -3
- package/dist/network.js.map +1 -0
- package/dist/{networkconfigToWagmiChain-DbUf6HiO.js → networkconfigToWagmiChain.js} +4 -3
- package/dist/networkconfigToWagmiChain.js.map +1 -0
- package/dist/{nftx-2LbFjj9Q.js → nftx.js} +1 -1
- package/dist/nftx.js.map +1 -0
- package/dist/{okx-CBEWJNsR.js → okx.js} +1 -1
- package/dist/okx.js.map +1 -0
- package/dist/{open-sea-Dxntz_PA.js → open-sea.js} +1 -1
- package/dist/open-sea.js.map +1 -0
- package/dist/{orders-DnFfZAXV.js → orders.js} +10 -10
- package/dist/orders.js.map +1 -0
- package/dist/{primary-sale-1u4QlPdA.js → primary-sale.js} +2 -2
- package/dist/primary-sale.js.map +1 -0
- package/dist/{primary-sales-Dmsi6bqj.js → primary-sales.js} +41 -3
- package/dist/primary-sales.js.map +1 -0
- package/dist/{query-BWbCsXLY.d.ts → query.d.ts} +2 -2
- package/dist/{rarible-CS0SupHr.js → rarible.js} +1 -1
- package/dist/rarible.js.map +1 -0
- package/dist/react/_internal/api/index.d.ts +2 -2
- package/dist/react/_internal/api/index.js +7 -7
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +37 -38
- package/dist/react/_internal/index.d.ts +2 -2
- package/dist/react/_internal/index.js +11 -11
- package/dist/react/_internal/wagmi/index.d.ts +1 -1
- package/dist/react/_internal/wagmi/index.js +5 -5
- package/dist/react/hooks/config/index.d.ts +8 -8
- package/dist/react/hooks/config/index.js +37 -38
- package/dist/react/hooks/contracts/index.d.ts +6 -6
- package/dist/react/hooks/contracts/index.js +15 -15
- package/dist/react/hooks/data/collectibles/index.d.ts +4 -10
- package/dist/react/hooks/data/collectibles/index.js +37 -38
- package/dist/react/hooks/data/collections/index.d.ts +11 -11
- package/dist/react/hooks/data/collections/index.js +38 -39
- package/dist/react/hooks/data/index.d.ts +37 -37
- package/dist/react/hooks/data/index.js +38 -39
- package/dist/react/hooks/data/inventory/index.d.ts +36 -36
- package/dist/react/hooks/data/inventory/index.js +37 -38
- package/dist/react/hooks/data/market/index.d.ts +5 -11
- package/dist/react/hooks/data/market/index.js +37 -38
- package/dist/react/hooks/data/orders/index.d.ts +4 -10
- package/dist/react/hooks/data/orders/index.js +37 -38
- package/dist/react/hooks/data/primary-sales/index.d.ts +37 -37
- package/dist/react/hooks/data/primary-sales/index.js +38 -39
- package/dist/react/hooks/data/tokens/index.d.ts +4 -4
- package/dist/react/hooks/data/tokens/index.js +37 -38
- package/dist/react/hooks/index.d.ts +37 -37
- package/dist/react/hooks/index.js +38 -39
- package/dist/react/hooks/transactions/index.d.ts +2 -2
- package/dist/react/hooks/transactions/index.js +37 -38
- package/dist/react/hooks/ui/index.d.ts +4 -4
- package/dist/react/hooks/ui/index.js +37 -38
- package/dist/react/hooks/utils/index.d.ts +36 -36
- package/dist/react/hooks/utils/index.js +37 -38
- package/dist/react/index.d.ts +37 -37
- package/dist/react/index.js +38 -39
- package/dist/react/queries/collectibles/index.d.ts +4 -10
- package/dist/react/queries/collectibles/index.js +20 -21
- package/dist/react/queries/collections/index.d.ts +11 -11
- package/dist/react/queries/collections/index.js +19 -19
- package/dist/react/queries/index.d.ts +24 -24
- package/dist/react/queries/index.js +30 -31
- package/dist/react/queries/inventory/index.d.ts +2 -2
- package/dist/react/queries/inventory/index.js +20 -20
- package/dist/react/queries/market/index.d.ts +5 -5
- package/dist/react/queries/market/index.js +20 -20
- package/dist/react/queries/orders/index.d.ts +4 -10
- package/dist/react/queries/orders/index.js +11 -11
- package/dist/react/queries/primary-sales/index.d.ts +4 -4
- package/dist/react/queries/primary-sales/index.js +12 -12
- package/dist/react/queries/tokens/index.d.ts +4 -4
- package/dist/react/queries/tokens/index.js +11 -12
- package/dist/react/queries/utils/index.d.ts +3 -3
- package/dist/react/queries/utils/index.js +20 -20
- package/dist/react/ssr/index.d.ts +7 -7
- package/dist/react/ssr/index.js +13 -16
- 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 +20 -20
- 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 +37 -38
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +4 -4
- package/dist/react/ui/components/marketplace-collectible-card/index.js +37 -38
- 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 +11 -11
- 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 +14 -14
- package/dist/react/ui/index.d.ts +4 -4
- package/dist/react/ui/index.js +37 -38
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +37 -38
- package/dist/react/utils/index.d.ts +1 -1
- package/dist/react/utils/index.js +7 -7
- package/dist/{react-DE852KeT.js → react.js} +720 -926
- package/dist/react.js.map +1 -0
- package/dist/{sequence-paCCener.js → sequence.js} +1 -1
- package/dist/sequence.js.map +1 -0
- package/dist/{src-Dz2CfBL0.js → src.js} +2 -2
- package/dist/src.js.map +1 -0
- package/dist/styles/index.css +1 -1
- package/dist/{sudo-swap-9rH2EgfT.js → sudo-swap.js} +1 -1
- package/dist/sudo-swap.js.map +1 -0
- package/dist/{super-rare-DHIuWtRw.js → super-rare.js} +1 -1
- package/dist/super-rare.js.map +1 -0
- package/dist/{token-Cv7l2ZaL.js → token.js} +2 -2
- package/dist/token.js.map +1 -0
- package/dist/{tokenBalances-ibDerNmM.js → tokenBalances.js} +4 -11
- package/dist/tokenBalances.js.map +1 -0
- package/dist/{tokenSupplies-Bfe8RHzI.d.ts → tokenSupplies.d.ts} +19 -30
- package/dist/{tokens-cGxMadd8.js → tokens.js} +47 -22
- package/dist/tokens.js.map +1 -0
- package/dist/{transaction-DZUW5RHu.js → transaction.js} +2 -2
- package/dist/transaction.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +3 -3
- package/dist/{types-D2TJ1dwv.d.ts → types.d.ts} +3 -3
- package/dist/{types-B_-cnkcP.js → types.js} +2 -2
- package/dist/types.js.map +1 -0
- 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 +7 -7
- package/dist/utils/index.js +13 -13
- package/dist/{utils-BfpDVibN.js → utils.js} +42 -4
- package/dist/utils.js.map +1 -0
- package/dist/{utils-BCgNhBFR.js → utils2.js} +11 -5
- package/dist/utils2.js.map +1 -0
- package/dist/{utils-BqxcalL2.js → utils3.js} +3 -3
- package/dist/utils3.js.map +1 -0
- package/dist/{waitForTransactionReceipt-DieAnV52.js → waitForTransactionReceipt.js} +3 -3
- package/dist/waitForTransactionReceipt.js.map +1 -0
- package/dist/{x2y2-45WDooeh.js → x2y2.js} +1 -1
- package/dist/x2y2.js.map +1 -0
- package/dist/{zora-CbeBoLvQ.js → zora.js} +1 -1
- package/dist/zora.js.map +1 -0
- package/package.json +42 -42
- 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/_internal/wagmi/get-connectors.ts +12 -1
- 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__/ERC1155ShopModal.test.tsx +152 -141
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +1 -0
- package/src/react/ui/modals/BuyModal/components/ERC1155ShopModal.tsx +44 -60
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC1155SalePaymentParams.test.tsx +381 -0
- package/src/react/ui/modals/BuyModal/hooks/useERC1155SalePaymentParams.ts +257 -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/TransferModal/_views/enterWalletAddress/index.tsx +1 -1
- package/src/react/ui/modals/TransferModal/index.tsx +24 -2
- 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 +2 -2
- 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/tsdown.config.ts +1 -0
- 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/_internal-DkS2VUn5.js.map +0 -1
- package/dist/abi-fa-o9gH3.js.map +0 -1
- package/dist/alien_swap-DoY6XfMA.js.map +0 -1
- package/dist/api-BoO0V5aJ.js.map +0 -1
- package/dist/aqua-xyz-BBDxnG14.js.map +0 -1
- package/dist/aura-DGx2zwvF.js.map +0 -1
- package/dist/blur-D8GKrRrq.js.map +0 -1
- package/dist/builder-api-BFuZNOaN.js.map +0 -1
- package/dist/builder.gen-B9wR2nvF.js.map +0 -1
- package/dist/coinbase-DOry4PXY.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/contracts-BP_0vX48.js.map +0 -1
- package/dist/create-config-CIfejoCk.js.map +0 -1
- package/dist/element-ciybd_VF.js.map +0 -1
- package/dist/foundation-Bq4lRz4x.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/looks-rare-6H--x3AM.js.map +0 -1
- package/dist/magic-eden-BoxEQ1Li.js.map +0 -1
- package/dist/manifold-DycKsljb.js.map +0 -1
- package/dist/market-C3HV-awQ.js.map +0 -1
- package/dist/marketCurrencies-sKrTX0og.js.map +0 -1
- package/dist/marketplace-NQB-sEQL.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/mintify-Dyqyo8jQ.js.map +0 -1
- package/dist/network-DtmiMhcg.js.map +0 -1
- package/dist/networkconfigToWagmiChain-DbUf6HiO.js.map +0 -1
- package/dist/nftx-2LbFjj9Q.js.map +0 -1
- package/dist/okx-CBEWJNsR.js.map +0 -1
- package/dist/open-sea-Dxntz_PA.js.map +0 -1
- package/dist/orders-DnFfZAXV.js.map +0 -1
- package/dist/primary-sale-1u4QlPdA.js.map +0 -1
- package/dist/primary-sales-Dmsi6bqj.js.map +0 -1
- package/dist/rarible-CS0SupHr.js.map +0 -1
- package/dist/react-DE852KeT.js.map +0 -1
- package/dist/sequence-paCCener.js.map +0 -1
- package/dist/src-Dz2CfBL0.js.map +0 -1
- package/dist/sudo-swap-9rH2EgfT.js.map +0 -1
- package/dist/super-rare-DHIuWtRw.js.map +0 -1
- package/dist/token-Cv7l2ZaL.js.map +0 -1
- package/dist/tokenBalances-ibDerNmM.js.map +0 -1
- package/dist/tokens-cGxMadd8.js.map +0 -1
- package/dist/transaction-DZUW5RHu.js.map +0 -1
- package/dist/types-B_-cnkcP.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/dist/waitForTransactionReceipt-DieAnV52.js.map +0 -1
- package/dist/x2y2-45WDooeh.js.map +0 -1
- package/dist/zora-CbeBoLvQ.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/BuyModal/hooks/__tests__/useERC1155Checkout.test.tsx +0 -395
- package/src/react/ui/modals/BuyModal/hooks/useERC1155Checkout.ts +0 -103
- package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +0 -481
- /package/dist/{index-6wsMChsg.d.ts → index15.d.ts} +0 -0
- /package/dist/{index-CZUtOTjh.d.ts → index18.d.ts} +0 -0
- /package/dist/{index-DW3njUfb.d.ts → index20.d.ts} +0 -0
- /package/dist/{index-DewGsFz5.d.ts → index22.d.ts} +0 -0
- /package/dist/{queries-KOcILNJO.js → queries.js} +0 -0
- /package/dist/{wagmi-Bseovd6Q.js → wagmi.js} +0 -0
package/dist/blur.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blur.js","names":[],"sources":["../src/react/ui/images/marketplaces/blur.png"],"sourcesContent":["\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAACZwSURBVHgB7XxrjF3Xdd7a55x779y5dx4ckqJJMxYdy7ElurEBBf3RujFTKECKFGjtlg4apP2RtHWAoEUKBEgQFNUQQYr+aYqirfsu0tZxWtFx4LRoHFewqcRpkMKUYFlDWRFtjSRqKJLDedyZ+zqvnW+ttfc5584dCk4s/Qn2Gh6exz1nP9Z7rf0gChAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQL8mQJryciZyPC1P9OfAvjbo/dHn73d8E6WP9cfa+fqqvDXwNmD2nT0+++27dGDfuCK6oPmj/X1COfIrksZSvB1aQzO63Lm36zl944rw7rfbX3PZVhftz6Tstbp+O+rs/2OkCDv0nxZs+XbBhO795uMTY3f3go/vuxmf4AzRo/02x9KdNNkAnkP/Xa/u0PKcN/XONXyG3X+CQXGHIckMkZYi640fn/MXd9w5y2cH/c/4uL2xL270SjtItHZDUv+xdtLuL7myruM66vyjy6uW3pynetzsO6KAvEv88Vlvb96VS9vrNvqvSdJr7nb3HNjLB3tk++ntdpl6Rd/y3Wuu3oua1suX+U+2qoNTz5p6coVU53lGeq/sl7jxrf9scvu2dW68huXDD12zc7g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ND6zznfuOt73is5de5LLdn4u51I+9w+5vv+s2uPDxJVmlxRVc7e+B9EHjrvutu+zxfDpd/7rrHn61w6co5ulPYWzAAzW4UycSQPfFAED955KzrUHNfvObmhk3YcIRg8Hvw+U0imxs+kp1t1tHNKsU0XVKG0LLMbJ0XaWajRd6o0m8nVwG+lz31+NrtGcjny01JA3IZkV7ijoOtRn90RSqqvqbPfL/mYF03prwIPG6ctlL3xWbb1nUjygr85TE00S67+0Y/mnsassonP4ZG9mhrHpzipIZJ8G/xtq2yS6Z/st5stJtdTLpj5uWLVu6fpMYOoPON8q2ow9HqUdVY3UbV1nMtvJk6DvyKoCv+mup2ye+ku3w6dSg1afSjy+Rn+umeP6j8Zp/q3+vJbjNwlLGdNHt8ekl3yBB82HpDJ9d7WdU7U74hhzmHQdnVtFb1fhtd86D9Bt5usPTOb+4cIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAH+24I8Bj3saOyb764YAAAAASUVORK5CYII=\""],"mappings":";mBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MarketplaceService } from "./builder.gen
|
|
1
|
+
import { n as MarketplaceService } from "./builder.gen.js";
|
|
2
2
|
|
|
3
3
|
//#region src/react/_internal/api/builder-api.ts
|
|
4
4
|
var BuilderAPI = class extends MarketplaceService {
|
|
@@ -24,5 +24,5 @@ var BuilderAPI = class extends MarketplaceService {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
export { BuilderAPI };
|
|
28
|
-
//# sourceMappingURL=builder-api
|
|
27
|
+
export { BuilderAPI as t };
|
|
28
|
+
//# sourceMappingURL=builder-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder-api.js","names":["projectAccessKey?: string","jwtAuth?: string","headers: Record<string, string>"],"sources":["../src/react/_internal/api/builder-api.ts"],"sourcesContent":["import { MarketplaceService } from './builder.gen';\n\nexport class BuilderAPI extends MarketplaceService {\n\tconstructor(\n\t\thostname: string,\n\t\tpublic projectAccessKey?: string,\n\t\tpublic jwtAuth?: string,\n\t) {\n\t\tsuper(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);\n\t\tthis.fetch = this._fetch;\n\t}\n\n\t_fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {\n\t\tconst headers: Record<string, string> = {};\n\n\t\tconst jwtAuth = this.jwtAuth;\n\t\tconst projectAccessKey = this.projectAccessKey;\n\n\t\tif (jwtAuth && jwtAuth.length > 0) {\n\t\t\theaders.Authorization = `BEARER ${jwtAuth}`;\n\t\t}\n\n\t\tif (projectAccessKey && projectAccessKey.length > 0) {\n\t\t\theaders['X-Access-Key'] = projectAccessKey;\n\t\t}\n\n\t\tconst requestInit = init || {};\n\t\trequestInit.headers = { ...init?.headers, ...headers };\n\n\t\treturn fetch(input, requestInit);\n\t};\n}\n"],"mappings":";;;AAEA,IAAa,aAAb,cAAgC,mBAAmB;CAClD,YACC,UACA,AAAOA,kBACP,AAAOC,SACN;AACD,QAAM,SAAS,SAAS,IAAI,GAAG,SAAS,MAAM,GAAG,GAAG,GAAG,UAAU,MAAM;EAHhE;EACA;AAGP,OAAK,QAAQ,KAAK;;CAGnB,UAAU,OAAoB,SAA0C;EACvE,MAAMC,UAAkC,EAAE;EAE1C,MAAM,UAAU,KAAK;EACrB,MAAM,mBAAmB,KAAK;AAE9B,MAAI,WAAW,QAAQ,SAAS,EAC/B,SAAQ,gBAAgB,UAAU;AAGnC,MAAI,oBAAoB,iBAAiB,SAAS,EACjD,SAAQ,kBAAkB;EAG3B,MAAM,cAAc,QAAQ,EAAE;AAC9B,cAAY,UAAU;GAAE,GAAG,MAAM;GAAS,GAAG;GAAS;AAEtD,SAAO,MAAM,OAAO,YAAY"}
|
|
@@ -290,14 +290,11 @@ const buildResponse = (res) => {
|
|
|
290
290
|
cause: `JSON.parse(): ${message}: response text: ${text}`
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
if (!res.ok)
|
|
294
|
-
const code = typeof data.code === "number" ? data.code : 0;
|
|
295
|
-
throw (webrpcErrorByCode[code] || WebrpcError).new(data);
|
|
296
|
-
}
|
|
293
|
+
if (!res.ok) throw (webrpcErrorByCode[typeof data.code === "number" ? data.code : 0] || WebrpcError).new(data);
|
|
297
294
|
return data;
|
|
298
295
|
});
|
|
299
296
|
};
|
|
300
297
|
|
|
301
298
|
//#endregion
|
|
302
|
-
export {
|
|
303
|
-
//# sourceMappingURL=builder.gen
|
|
299
|
+
export { MarketplaceService as n, MarketplaceWalletType as r, FilterCondition as t };
|
|
300
|
+
//# sourceMappingURL=builder.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.gen.js","names":["webrpcErrorByCode: { [code: number]: any }","reqHeaders: { [key: string]: string }"],"sources":["../src/react/_internal/api/builder.gen.ts"],"sourcesContent":["// Relevant parts for lookupMarketplace & common Webrpc utilities\n// sequence-builder v0.1.0 52bd730f3b821fe99051d69ced824442369efe4a\n// --\n// Code generated by webrpc-gen@v0.26.0 with typescript generator. DO NOT EDIT.\n//\n// webrpc-gen -schema=builder.main.ridl -target=typescript -client -out=../../webapp/src/rpc/proto/builder.gen.ts\n\nexport const WebrpcHeader = \"Webrpc\";\nexport const WebrpcHeaderValue =\n \"webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-builder@v0.1.0\";\n\n//\n// Types for lookupMarketplace\n//\n\nexport enum MarketplaceWalletType {\n UNIVERSAL = \"UNIVERSAL\",\n EMBEDDED = \"EMBEDDED\",\n ECOSYSTEM = \"ECOSYSTEM\",\n}\n\nexport enum FilterCondition {\n ENTIRE_KEY = \"ENTIRE_KEY\",\n SPECIFIC_VALUE = \"SPECIFIC_VALUE\",\n}\n\nexport interface LookupMarketplaceArgs {\n projectId?: number;\n domain?: string;\n userAddress?: string;\n}\n\nexport interface LookupMarketplaceReturn {\n marketplace: Marketplace;\n marketCollections: Array<MarketCollection>;\n shopCollections: Array<ShopCollection>;\n}\n\nexport interface Marketplace {\n projectId: number;\n settings: MarketplaceSettings;\n market: MarketplacePage;\n shop: MarketplacePage;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface MarketplaceSettings {\n style: { [key: string]: any };\n publisherId: string;\n title: string;\n socials: MarketplaceSocials;\n faviconUrl: string;\n walletOptions: MarketplaceWallet;\n logoUrl: string;\n fontUrl: string;\n accessKey?: string;\n}\n\nexport interface MarketplacePage {\n enabled: boolean;\n bannerUrl: string;\n ogImage: string;\n private: boolean;\n}\n\nexport interface MarketplaceSocials {\n twitter: string;\n discord: string;\n website: string;\n tiktok: string;\n instagram: string;\n youtube: string;\n}\n\nexport interface MarketplaceWallet {\n walletType: MarketplaceWalletType;\n oidcIssuers: { [key: string]: string };\n connectors: Array<string>;\n includeEIP6963Wallets: boolean;\n ecosystem?: MarketplaceWalletEcosystem;\n embedded?: MarketplaceWalletEmbedded;\n}\n\nexport interface MarketplaceWalletEcosystem {\n walletUrl: string;\n walletAppName: string;\n logoLightUrl?: string;\n logoDarkUrl?: string;\n}\n\nexport interface MarketplaceWalletEmbedded {\n tenantKey: string;\n emailEnabled: boolean;\n providers: Array<OpenIdProvider>;\n}\n\nexport interface OpenIdProvider {\n iss: string;\n aud: Array<string>;\n}\n\nexport interface MarketCollection {\n id: number;\n projectId: number;\n chainId: number;\n itemsAddress: string;\n contractType: string;\n bannerUrl: string;\n feePercentage: number;\n currencyOptions: Array<string>;\n destinationMarketplace: string;\n filterSettings?: CollectionFilterSettings;\n sortOrder?: number;\n private: boolean;\n createdAt?: string;\n updatedAt?: string;\n}\n\nexport interface CollectionFilterSettings {\n filterOrder: Array<string>;\n exclusions: Array<MetadataFilterRule>;\n}\n\nexport interface MetadataFilterRule {\n key: string;\n condition: FilterCondition;\n value?: string;\n}\n\nexport interface ShopCollection {\n id: number;\n projectId: number;\n chainId: number;\n itemsAddress: string;\n saleAddress: string;\n name: string;\n bannerUrl: string;\n tokenIds: Array<string>;\n customTokenIds: Array<string>;\n sortOrder?: number;\n private: boolean;\n createdAt?: string;\n updatedAt?: string;\n}\n\n//\n// Service Interface Definition for MarketplaceService (relevant part)\n//\nexport interface MarketplaceService {\n /**\n * Public Methods\n */\n lookupMarketplace(\n args: LookupMarketplaceArgs,\n headers?: object,\n signal?: AbortSignal\n ): Promise<LookupMarketplaceReturn>;\n}\n\n//\n// Errors (Complete set from original)\n//\n\nexport class WebrpcError extends Error {\n name: string;\n code: number;\n message: string;\n status: number;\n cause?: string;\n\n /** @deprecated Use message instead of msg. Deprecated in webrpc v0.11.0. */\n msg: string;\n\n constructor(\n name: string,\n code: number,\n message: string,\n status: number,\n cause?: string\n ) {\n super(message);\n this.name = name || \"WebrpcError\";\n this.code = typeof code === \"number\" ? code : 0;\n this.message = message || `endpoint error ${this.code}`;\n this.msg = this.message;\n this.status = typeof status === \"number\" ? status : 0;\n this.cause = cause;\n Object.setPrototypeOf(this, WebrpcError.prototype);\n }\n\n static new(payload: any): WebrpcError {\n return new this(\n payload.error,\n payload.code,\n payload.message || payload.msg,\n payload.status,\n payload.cause\n );\n }\n}\n\n// Webrpc errors\n\nexport class WebrpcEndpointError extends WebrpcError {\n constructor(\n name: string = \"WebrpcEndpoint\",\n code: number = 0,\n message: string = `endpoint error`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcEndpointError.prototype);\n }\n}\n\nexport class WebrpcRequestFailedError extends WebrpcError {\n constructor(\n name: string = \"WebrpcRequestFailed\",\n code: number = -1,\n message: string = `request failed`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);\n }\n}\n\nexport class WebrpcBadRouteError extends WebrpcError {\n constructor(\n name: string = \"WebrpcBadRoute\",\n code: number = -2,\n message: string = `bad route`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);\n }\n}\n\nexport class WebrpcBadMethodError extends WebrpcError {\n constructor(\n name: string = \"WebrpcBadMethod\",\n code: number = -3,\n message: string = `bad method`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);\n }\n}\n\nexport class WebrpcBadRequestError extends WebrpcError {\n constructor(\n name: string = \"WebrpcBadRequest\",\n code: number = -4,\n message: string = `bad request`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);\n }\n}\n\nexport class WebrpcBadResponseError extends WebrpcError {\n constructor(\n name: string = \"WebrpcBadResponse\",\n code: number = -5,\n message: string = `bad response`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);\n }\n}\n\nexport class WebrpcServerPanicError extends WebrpcError {\n constructor(\n name: string = \"WebrpcServerPanic\",\n code: number = -6,\n message: string = `server panic`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);\n }\n}\n\nexport class WebrpcInternalErrorError extends WebrpcError {\n // Name as per original\n constructor(\n name: string = \"WebrpcInternalError\",\n code: number = -7,\n message: string = `internal error`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);\n }\n}\n\nexport class WebrpcClientDisconnectedError extends WebrpcError {\n constructor(\n name: string = \"WebrpcClientDisconnected\",\n code: number = -8,\n message: string = `client disconnected`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype);\n }\n}\n\nexport class WebrpcStreamLostError extends WebrpcError {\n constructor(\n name: string = \"WebrpcStreamLost\",\n code: number = -9,\n message: string = `stream lost`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);\n }\n}\n\nexport class WebrpcStreamFinishedError extends WebrpcError {\n constructor(\n name: string = \"WebrpcStreamFinished\",\n code: number = -10,\n message: string = `stream finished`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);\n }\n}\n\n// Schema errors\n\nexport class UnauthorizedError extends WebrpcError {\n constructor(\n name: string = \"Unauthorized\",\n code: number = 1000,\n message: string = `Unauthorized access`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n\nexport class PermissionDeniedError extends WebrpcError {\n constructor(\n name: string = \"PermissionDenied\",\n code: number = 1001,\n message: string = `Permission denied`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, PermissionDeniedError.prototype);\n }\n}\n\nexport class SessionExpiredError extends WebrpcError {\n constructor(\n name: string = \"SessionExpired\",\n code: number = 1002,\n message: string = `Session expired`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, SessionExpiredError.prototype);\n }\n}\n\nexport class MethodNotFoundError extends WebrpcError {\n constructor(\n name: string = \"MethodNotFound\",\n code: number = 1003,\n message: string = `Method not found`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, MethodNotFoundError.prototype);\n }\n}\n\nexport class RequestConflictError extends WebrpcError {\n constructor(\n name: string = \"RequestConflict\",\n code: number = 1004,\n message: string = `Conflict with target resource`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, RequestConflictError.prototype);\n }\n}\n\nexport class ServiceDisabledError extends WebrpcError {\n constructor(\n name: string = \"ServiceDisabled\",\n code: number = 1005,\n message: string = `Service disabled`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, ServiceDisabledError.prototype);\n }\n}\n\nexport class TimeoutError extends WebrpcError {\n constructor(\n name: string = \"Timeout\",\n code: number = 2000,\n message: string = `Request timed out`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, TimeoutError.prototype);\n }\n}\n\nexport class InvalidArgumentError extends WebrpcError {\n constructor(\n name: string = \"InvalidArgument\",\n code: number = 2001,\n message: string = `Invalid argument`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, InvalidArgumentError.prototype);\n }\n}\n\nexport class NotFoundError extends WebrpcError {\n constructor(\n name: string = \"NotFound\",\n code: number = 3000,\n message: string = `Resource not found`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n\nexport class UserNotFoundError extends WebrpcError {\n constructor(\n name: string = \"UserNotFound\",\n code: number = 3001,\n message: string = `User not found`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, UserNotFoundError.prototype);\n }\n}\n\nexport class ProjectNotFoundError extends WebrpcError {\n constructor(\n name: string = \"ProjectNotFound\",\n code: number = 3002,\n message: string = `Project not found`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, ProjectNotFoundError.prototype);\n }\n}\n\nexport class InvalidTierError extends WebrpcError {\n constructor(\n name: string = \"InvalidTier\",\n code: number = 3003,\n message: string = `Invalid subscription tier`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, InvalidTierError.prototype);\n }\n}\n\nexport class EmailTemplateExistsError extends WebrpcError {\n constructor(\n name: string = \"EmailTemplateExists\",\n code: number = 3004,\n message: string = `Email Template exists`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, EmailTemplateExistsError.prototype);\n }\n}\n\nexport class SubscriptionLimitError extends WebrpcError {\n constructor(\n name: string = \"SubscriptionLimit\",\n code: number = 3005,\n message: string = `Subscription limit reached`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, SubscriptionLimitError.prototype);\n }\n}\n\nexport class FeatureNotIncludedError extends WebrpcError {\n constructor(\n name: string = \"FeatureNotIncluded\",\n code: number = 3006,\n message: string = `Feature not included`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, FeatureNotIncludedError.prototype);\n }\n}\n\nexport class InvalidNetworkError extends WebrpcError {\n constructor(\n name: string = \"InvalidNetwork\",\n code: number = 3007,\n message: string = `Invalid network`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, InvalidNetworkError.prototype);\n }\n}\n\nexport class InvitationExpiredError extends WebrpcError {\n constructor(\n name: string = \"InvitationExpired\",\n code: number = 4000,\n message: string = `Invitation code is expired`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, InvitationExpiredError.prototype);\n }\n}\n\nexport class AlreadyCollaboratorError extends WebrpcError {\n constructor(\n name: string = \"AlreadyCollaborator\",\n code: number = 4001,\n message: string = `Already a collaborator`,\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause);\n Object.setPrototypeOf(this, AlreadyCollaboratorError.prototype);\n }\n}\n\nexport enum errors {\n WebrpcEndpoint = \"WebrpcEndpoint\",\n WebrpcRequestFailed = \"WebrpcRequestFailed\",\n WebrpcBadRoute = \"WebrpcBadRoute\",\n WebrpcBadMethod = \"WebrpcBadMethod\",\n WebrpcBadRequest = \"WebrpcBadRequest\",\n WebrpcBadResponse = \"WebrpcBadResponse\",\n WebrpcServerPanic = \"WebrpcServerPanic\",\n WebrpcInternalError = \"WebrpcInternalError\",\n WebrpcClientDisconnected = \"WebrpcClientDisconnected\",\n WebrpcStreamLost = \"WebrpcStreamLost\",\n WebrpcStreamFinished = \"WebrpcStreamFinished\",\n Unauthorized = \"Unauthorized\",\n PermissionDenied = \"PermissionDenied\",\n SessionExpired = \"SessionExpired\",\n MethodNotFound = \"MethodNotFound\",\n RequestConflict = \"RequestConflict\",\n ServiceDisabled = \"ServiceDisabled\",\n Timeout = \"Timeout\",\n InvalidArgument = \"InvalidArgument\",\n NotFound = \"NotFound\",\n UserNotFound = \"UserNotFound\",\n ProjectNotFound = \"ProjectNotFound\",\n InvalidTier = \"InvalidTier\",\n EmailTemplateExists = \"EmailTemplateExists\",\n SubscriptionLimit = \"SubscriptionLimit\",\n FeatureNotIncluded = \"FeatureNotIncluded\",\n InvalidNetwork = \"InvalidNetwork\",\n InvitationExpired = \"InvitationExpired\",\n AlreadyCollaborator = \"AlreadyCollaborator\",\n}\n\nexport enum WebrpcErrorCodes {\n WebrpcEndpoint = 0,\n WebrpcRequestFailed = -1,\n WebrpcBadRoute = -2,\n WebrpcBadMethod = -3,\n WebrpcBadRequest = -4,\n WebrpcBadResponse = -5,\n WebrpcServerPanic = -6,\n WebrpcInternalError = -7,\n WebrpcClientDisconnected = -8,\n WebrpcStreamLost = -9,\n WebrpcStreamFinished = -10,\n Unauthorized = 1000,\n PermissionDenied = 1001,\n SessionExpired = 1002,\n MethodNotFound = 1003,\n RequestConflict = 1004,\n ServiceDisabled = 1005,\n Timeout = 2000,\n InvalidArgument = 2001,\n NotFound = 3000,\n UserNotFound = 3001,\n ProjectNotFound = 3002,\n InvalidTier = 3003,\n EmailTemplateExists = 3004,\n SubscriptionLimit = 3005,\n FeatureNotIncluded = 3006,\n InvalidNetwork = 3007,\n InvitationExpired = 4000,\n AlreadyCollaborator = 4001,\n}\n\nexport const webrpcErrorByCode: { [code: number]: any } = {\n [0]: WebrpcEndpointError,\n [-1]: WebrpcRequestFailedError,\n [-2]: WebrpcBadRouteError,\n [-3]: WebrpcBadMethodError,\n [-4]: WebrpcBadRequestError,\n [-5]: WebrpcBadResponseError,\n [-6]: WebrpcServerPanicError,\n [-7]: WebrpcInternalErrorError, // Name as per original\n [-8]: WebrpcClientDisconnectedError,\n [-9]: WebrpcStreamLostError,\n [-10]: WebrpcStreamFinishedError,\n [1000]: UnauthorizedError,\n [1001]: PermissionDeniedError,\n [1002]: SessionExpiredError,\n [1003]: MethodNotFoundError,\n [1004]: RequestConflictError,\n [1005]: ServiceDisabledError,\n [2000]: TimeoutError,\n [2001]: InvalidArgumentError,\n [3000]: NotFoundError,\n [3001]: UserNotFoundError,\n [3002]: ProjectNotFoundError,\n [3003]: InvalidTierError,\n [3004]: EmailTemplateExistsError,\n [3005]: SubscriptionLimitError,\n [3006]: FeatureNotIncludedError,\n [3007]: InvalidNetworkError,\n [4000]: InvitationExpiredError,\n [4001]: AlreadyCollaboratorError,\n};\n\n//\n// Client Implementation for MarketplaceService (relevant part)\n//\nexport type Fetch = (\n input: RequestInfo,\n init?: RequestInit\n) => Promise<Response>;\n\nexport class MarketplaceService {\n protected hostname: string;\n protected fetch: Fetch;\n protected path = \"/rpc/MarketplaceService/\";\n\n constructor(hostname: string, fetch: Fetch) {\n this.hostname = hostname.replace(/\\/*$/, \"\");\n this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init);\n }\n\n private url(name: string): string {\n return this.hostname + this.path + name;\n }\n\n lookupMarketplace = (\n args: LookupMarketplaceArgs,\n headers?: object,\n signal?: AbortSignal\n ): Promise<LookupMarketplaceReturn> => {\n return this.fetch(\n this.url(\"LookupMarketplace\"),\n createHTTPRequest(args, headers, signal)\n ).then(\n (res) => {\n return buildResponse(res).then((_data) => {\n return {\n marketplace: <Marketplace>_data.marketplace,\n marketCollections: <Array<MarketCollection>>_data.marketCollections,\n shopCollections: <Array<ShopCollection>>_data.shopCollections,\n };\n });\n },\n (error) => {\n throw WebrpcRequestFailedError.new({\n cause: `lookupMarketplace(): ${error.message || \"\"}`,\n });\n }\n );\n };\n}\n\n//\n// Helper Functions\n//\nconst createHTTPRequest = (\n body: object = {},\n headers: object = {},\n signal: AbortSignal | null = null\n): object => {\n const reqHeaders: { [key: string]: string } = {\n ...headers,\n \"Content-Type\": \"application/json\",\n };\n reqHeaders[WebrpcHeader] = WebrpcHeaderValue;\n\n return {\n method: \"POST\",\n headers: reqHeaders,\n body: JSON.stringify(body || {}),\n signal,\n };\n};\n\nconst buildResponse = (res: Response): Promise<any> => {\n return res.text().then((text) => {\n let data;\n try {\n data = JSON.parse(text);\n } catch (error) {\n let message = \"\";\n if (error instanceof Error) {\n message = error.message;\n }\n throw WebrpcBadResponseError.new({\n status: res.status,\n cause: `JSON.parse(): ${message}: response text: ${text}`,\n });\n }\n if (!res.ok) {\n const code: number = typeof data.code === \"number\" ? data.code : 0;\n throw (webrpcErrorByCode[code] || WebrpcError).new(data);\n }\n return data;\n });\n};\n"],"mappings":";AAOA,MAAa,eAAe;AAC5B,MAAa,oBACX;AAMF,IAAY,0EAAL;AACL;AACA;AACA;;;AAGF,IAAY,8DAAL;AACL;AACA;;;AA6IF,IAAa,cAAb,MAAa,oBAAoB,MAAM;CACrC;CACA;CACA;CACA;CACA;;CAGA;CAEA,YACE,MACA,MACA,SACA,QACA,OACA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO,QAAQ;AACpB,OAAK,OAAO,OAAO,SAAS,WAAW,OAAO;AAC9C,OAAK,UAAU,WAAW,kBAAkB,KAAK;AACjD,OAAK,MAAM,KAAK;AAChB,OAAK,SAAS,OAAO,WAAW,WAAW,SAAS;AACpD,OAAK,QAAQ;AACb,SAAO,eAAe,MAAM,YAAY,UAAU;;CAGpD,OAAO,IAAI,SAA2B;AACpC,SAAO,IAAI,KACT,QAAQ,OACR,QAAQ,MACR,QAAQ,WAAW,QAAQ,KAC3B,QAAQ,QACR,QAAQ,MACT;;;AAML,IAAa,sBAAb,MAAa,4BAA4B,YAAY;CACnD,YACE,OAAe,kBACf,OAAe,GACf,UAAkB,kBA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c,IAAI,CAAC,MAAM,UAAU;AACxC,WAAO;KACL,aAA0B,MAAM;KAChC,mBAA4C,MAAM;KAClD,iBAAwC,MAAM;KAC/C;KACD;MAEH,UAAU;AACT,SAAM,yBAAyB,IAAI,EACjC,OAAO,wBAAwB,MAAM,WAAW,MACjD,CAAC;IAEL;;;AAOL,MAAM,qBACJ,OAAe,EAAE,EACjB,UAAkB,EAAE,EACpB,SAA6B,SAClB;CACX,MAAMC,aAAwC;EAC5C,GAAG;EACH,gBAAgB;EACjB;AACD,YAAW,gBAAgB;AAE3B,QAAO;EACL,QAAQ;EACR,SAAS;EACT,MAAM,KAAK,UAAU,QAAQ,EAAE,CAAC;EAChC;EACD;;AAGH,MAAM,iBAAiB,QAAgC;AACrD,QAAO,IAAI,MAAM,CAAC,MAAM,SAAS;EAC/B,IAAI;AACJ,MAAI;AACF,UAAO,KAAK,MAAM,KAAK;WAChB,OAAO;GACd,IAAI,UAAU;AACd,OAAI,iBAAiB,MACnB,WAAU,MAAM;AAElB,SAAM,uBAAuB,IAAI;IAC/B,QAAQ,IAAI;IACZ,OAAO,iBAAiB,QAAQ,mBAAmB;IACpD,CAAC;;AAEJ,MAAI,CAAC,IAAI,GAEP,QAAO,kBADc,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO,MAC/B,aAAa,IAAI,KAAK;AAE1D,SAAO;GACP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coinbase.js","names":[],"sources":["../src/react/ui/images/marketplaces/coinbase.png"],"sourcesContent":["\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACBCAYAAAAIYrJuAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABmJSURBVHgB7V0HnFX1lf7uzNDrIEUBBQQxAoKgYkEUjagEQRCHYkUh1kQ3BDVx111QV7PiGhtGiLoYMBaKFAWJCqiIClIUEQUElN57nXL3++5/BmZwmHruKzPz8bu8+968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AAAASUVORK5CYII=\""],"mappings":";uBAAA"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { fetchMarketplaceConfig } from "./marketplaceConfig-UHQMM9fq.js";
|
|
5
|
-
import { fetchBalances } from "./listBalances-BxpxBCvn.js";
|
|
1
|
+
import { i as getMetadataClient, n as getIndexerClient, r as getMarketplaceClient, u as collectableKeys } from "./api.js";
|
|
2
|
+
import { l as compareAddress } from "./utils.js";
|
|
3
|
+
import { t as fetchMarketplaceConfig } from "./marketplaceConfig.js";
|
|
6
4
|
import { infiniteQueryOptions, queryOptions, skipToken } from "@tanstack/react-query";
|
|
7
5
|
|
|
8
6
|
//#region src/react/queries/collectibles/balanceOfCollectible.ts
|
|
@@ -14,12 +12,6 @@ import { infiniteQueryOptions, queryOptions, skipToken } from "@tanstack/react-q
|
|
|
14
12
|
* @returns The balance data
|
|
15
13
|
*/
|
|
16
14
|
async function fetchBalanceOfCollectible(args, config) {
|
|
17
|
-
if (args.isLaos721) return (await new LaosAPI().getTokenBalances({
|
|
18
|
-
chainId: args.chainId.toString(),
|
|
19
|
-
contractAddress: args.collectionAddress,
|
|
20
|
-
accountAddress: args.userAddress,
|
|
21
|
-
includeMetadata: true
|
|
22
|
-
})).balances[0] || null;
|
|
23
15
|
return getIndexerClient(args.chainId, config).getTokenBalances({
|
|
24
16
|
accountAddress: args.userAddress,
|
|
25
17
|
contractAddress: args.collectionAddress,
|
|
@@ -41,8 +33,7 @@ function getBalanceOfCollectibleQueryKey(args) {
|
|
|
41
33
|
metadataOptions: args.userAddress ? {
|
|
42
34
|
verifiedOnly: true,
|
|
43
35
|
includeContracts: [args.collectionAddress]
|
|
44
|
-
} : void 0
|
|
45
|
-
isLaos721: args.isLaos721
|
|
36
|
+
} : void 0
|
|
46
37
|
};
|
|
47
38
|
return [...collectableKeys.userBalances, apiArgs];
|
|
48
39
|
}
|
|
@@ -163,7 +154,7 @@ function countOfCollectablesQueryOptions(params) {
|
|
|
163
154
|
* Fetches collectible activities from the Marketplace API
|
|
164
155
|
*/
|
|
165
156
|
async function fetchListCollectibleActivities(params) {
|
|
166
|
-
const { collectionAddress, chainId, config, page, pageSize, sort
|
|
157
|
+
const { collectionAddress, chainId, config, page, pageSize, sort, ...additionalApiParams } = params;
|
|
167
158
|
const marketplaceClient = getMarketplaceClient(config);
|
|
168
159
|
const pageParams = page || pageSize || sort ? {
|
|
169
160
|
page: page ?? 1,
|
|
@@ -216,7 +207,7 @@ function listCollectibleActivitiesQueryOptions(params) {
|
|
|
216
207
|
* Fetches a list of collectibles with pagination support from the Marketplace API
|
|
217
208
|
*/
|
|
218
209
|
async function fetchListCollectibles(params, page) {
|
|
219
|
-
const { collectionAddress, chainId, config
|
|
210
|
+
const { collectionAddress, chainId, config, ...additionalApiParams } = params;
|
|
220
211
|
const marketplaceClient = getMarketplaceClient(config);
|
|
221
212
|
const isMarketCollection = (await fetchMarketplaceConfig({ config }))?.market.collections.some((collection) => compareAddress(collection.itemsAddress, collectionAddress));
|
|
222
213
|
if (params.enabled === false || !isMarketCollection) return {
|
|
@@ -233,35 +224,6 @@ async function fetchListCollectibles(params, page) {
|
|
|
233
224
|
page,
|
|
234
225
|
...additionalApiParams
|
|
235
226
|
};
|
|
236
|
-
if (params.isLaos721 && params.side === OrderSide.listing) try {
|
|
237
|
-
const fetchBalancesArgs = {
|
|
238
|
-
chainId: params.chainId,
|
|
239
|
-
accountAddress: params.filter?.inAccounts?.[0],
|
|
240
|
-
contractAddress: params.collectionAddress,
|
|
241
|
-
page,
|
|
242
|
-
includeMetadata: true,
|
|
243
|
-
isLaos721: true
|
|
244
|
-
};
|
|
245
|
-
const balances = await fetchBalances(fetchBalancesArgs, config, page);
|
|
246
|
-
return {
|
|
247
|
-
collectibles: balances.balances.map((balance) => {
|
|
248
|
-
if (!balance.tokenMetadata) throw new Error("Token metadata not found");
|
|
249
|
-
return { metadata: {
|
|
250
|
-
tokenId: balance.tokenID ?? "",
|
|
251
|
-
attributes: balance.tokenMetadata.attributes,
|
|
252
|
-
image: balance.tokenMetadata.image,
|
|
253
|
-
name: balance.tokenMetadata.name,
|
|
254
|
-
description: balance.tokenMetadata.description,
|
|
255
|
-
video: balance.tokenMetadata.video,
|
|
256
|
-
audio: balance.tokenMetadata.audio,
|
|
257
|
-
status: MetadataStatus.AVAILABLE
|
|
258
|
-
} };
|
|
259
|
-
}),
|
|
260
|
-
page: balances.page
|
|
261
|
-
};
|
|
262
|
-
} catch (error) {
|
|
263
|
-
console.error(error);
|
|
264
|
-
}
|
|
265
227
|
return await marketplaceClient.listCollectibles(apiArgs);
|
|
266
228
|
}
|
|
267
229
|
function getListCollectiblesQueryKey(params) {
|
|
@@ -284,7 +246,6 @@ function listCollectiblesQueryOptions(params) {
|
|
|
284
246
|
config: params.config,
|
|
285
247
|
side: params.side,
|
|
286
248
|
filter: params.filter,
|
|
287
|
-
isLaos721: params.isLaos721,
|
|
288
249
|
cardType: params.cardType
|
|
289
250
|
}, pageParam);
|
|
290
251
|
},
|
|
@@ -304,7 +265,7 @@ function listCollectiblesQueryOptions(params) {
|
|
|
304
265
|
* Fetches a list of collectibles with pagination support from the Marketplace API
|
|
305
266
|
*/
|
|
306
267
|
async function fetchListCollectiblesPaginated(params) {
|
|
307
|
-
const { collectionAddress, chainId, config, page = 1, pageSize = 30
|
|
268
|
+
const { collectionAddress, chainId, config, page = 1, pageSize = 30, ...additionalApiParams } = params;
|
|
308
269
|
const marketplaceClient = getMarketplaceClient(config);
|
|
309
270
|
const pageParams = {
|
|
310
271
|
page,
|
|
@@ -354,5 +315,5 @@ function listCollectiblesPaginatedQueryOptions(params) {
|
|
|
354
315
|
}
|
|
355
316
|
|
|
356
317
|
//#endregion
|
|
357
|
-
export {
|
|
358
|
-
//# sourceMappingURL=collectibles
|
|
318
|
+
export { fetchBalanceOfCollectible as _, getListCollectiblesQueryKey as a, getListCollectibleActivitiesQueryKey as c, fetchCountOfCollectables as d, getCountOfCollectablesQueryKey as f, balanceOfCollectibleOptions as g, getCollectibleQueryKey as h, fetchListCollectibles as i, listCollectibleActivitiesQueryOptions as l, fetchCollectible as m, getListCollectiblesPaginatedQueryKey as n, listCollectiblesQueryOptions as o, collectibleQueryOptions as p, listCollectiblesPaginatedQueryOptions as r, fetchListCollectibleActivities as s, fetchListCollectiblesPaginated as t, countOfCollectablesQueryOptions as u, getBalanceOfCollectibleQueryKey as v };
|
|
319
|
+
//# sourceMappingURL=collectibles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectibles.js","names":["apiArgs: GetTokenMetadataArgs","apiArgs: GetCountOfFilteredCollectiblesArgs","apiArgs","apiArgs: GetCountOfAllCollectiblesArgs","pageParams: Page | undefined","apiArgs: ListCollectibleActivitiesArgs","apiArgs: ListCollectiblesArgs","pageParams: Page","apiArgs: ListCollectiblesArgs"],"sources":["../src/react/queries/collectibles/balanceOfCollectible.ts","../src/react/queries/collectibles/collectible.ts","../src/react/queries/collectibles/countOfCollectables.ts","../src/react/queries/collectibles/listCollectibleActivities.ts","../src/react/queries/collectibles/listCollectibles.ts","../src/react/queries/collectibles/listCollectiblesPaginated.ts"],"sourcesContent":["import { queryOptions, skipToken } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { UseQueryParameters } from 'wagmi/query';\nimport type { SdkConfig } from '../../../types';\nimport { collectableKeys, getIndexerClient } from '../../_internal';\n\nexport type UseBalanceOfCollectibleArgs = {\n\tcollectionAddress: Address;\n\tcollectableId: string;\n\tuserAddress: Address | undefined;\n\tchainId: number;\n\tincludeMetadata?: boolean;\n\tquery?: UseQueryParameters;\n};\n\n/**\n * Fetches the balance of a specific collectible for a user\n *\n * @param args - Arguments for the API call\n * @param config - SDK configuration\n * @returns The balance data\n */\nexport async function fetchBalanceOfCollectible(\n\targs: Omit<UseBalanceOfCollectibleArgs, 'userAddress'> & {\n\t\tuserAddress: Address;\n\t},\n\tconfig: SdkConfig,\n) {\n\tconst indexerClient = getIndexerClient(args.chainId, config);\n\treturn indexerClient\n\t\t.getTokenBalances({\n\t\t\taccountAddress: args.userAddress,\n\t\t\tcontractAddress: args.collectionAddress,\n\t\t\ttokenID: args.collectableId,\n\t\t\tincludeMetadata: args.includeMetadata ?? false,\n\t\t\tmetadataOptions: {\n\t\t\t\tverifiedOnly: true,\n\t\t\t\tincludeContracts: [args.collectionAddress],\n\t\t\t},\n\t\t})\n\t\t.then((res) => res.balances[0] || null);\n}\n\nexport function getBalanceOfCollectibleQueryKey(\n\targs: UseBalanceOfCollectibleArgs,\n) {\n\tconst apiArgs = {\n\t\tchainId: args.chainId,\n\t\taccountAddress: args.userAddress,\n\t\tcontractAddress: args.collectionAddress,\n\t\ttokenID: args.collectableId,\n\t\tincludeMetadata: args.includeMetadata,\n\t\tmetadataOptions: args.userAddress\n\t\t\t? {\n\t\t\t\t\tverifiedOnly: true,\n\t\t\t\t\tincludeContracts: [args.collectionAddress],\n\t\t\t\t}\n\t\t\t: undefined,\n\t};\n\n\treturn [...collectableKeys.userBalances, apiArgs] as const;\n}\n\n/**\n * Creates a tanstack query options object for the balance query\n *\n * @param args - The query arguments\n * @param config - SDK configuration\n * @returns Query options configuration\n */\nexport function balanceOfCollectibleOptions(\n\targs: UseBalanceOfCollectibleArgs,\n\tconfig: SdkConfig,\n) {\n\tconst enabled = !!args.userAddress && (args.query?.enabled ?? true);\n\treturn queryOptions({\n\t\tqueryKey: getBalanceOfCollectibleQueryKey(args),\n\t\tqueryFn: enabled\n\t\t\t? () =>\n\t\t\t\t\tfetchBalanceOfCollectible(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...args,\n\t\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: this is guaranteed by the userAddress check above\n\t\t\t\t\t\t\tuserAddress: args.userAddress!,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t)\n\t\t\t: skipToken,\n\t});\n}\n","import type { GetTokenMetadataArgs } from '@0xsequence/metadata';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMetadataClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport { collectableKeys } from '../../_internal/api/query-keys';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCollectibleParams\n\textends Omit<\n\t\tGetTokenMetadataArgs,\n\t\t'chainID' | 'contractAddress' | 'tokenIDs'\n\t> {\n\tchainId: number;\n\tcollectionAddress: string;\n\tcollectibleId: string;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collectible metadata from the metadata API\n */\nexport async function fetchCollectible(params: FetchCollectibleParams) {\n\tconst { collectionAddress, collectibleId, chainId, config } = params;\n\n\tconst metadataClient = getMetadataClient(config);\n\n\tconst apiArgs: GetTokenMetadataArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainID: String(chainId),\n\t\ttokenIDs: [collectibleId],\n\t};\n\n\tconst result = await metadataClient.getTokenMetadata(apiArgs);\n\treturn result.tokenMetadata[0];\n}\n\nexport type CollectibleQueryOptions = ValuesOptional<FetchCollectibleParams> & {\n\tquery?: StandardQueryOptions;\n};\n\nexport function getCollectibleQueryKey(params: CollectibleQueryOptions) {\n\tconst apiArgs = {\n\t\tchainID: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\t// biome-ignore lint/style/noNonNullAssertion: Dont need to validate here\n\t\ttokenIDs: [params.collectibleId!],\n\t} satisfies QueryKeyArgs<GetTokenMetadataArgs>;\n\n\treturn [...collectableKeys.details, apiArgs] as const;\n}\n\nexport function collectibleQueryOptions(params: CollectibleQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.collectibleId &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectibleQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollectible({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectibleId: params.collectibleId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMarketplaceClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type {\n\tCollectiblesFilter,\n\tGetCountOfAllCollectiblesArgs,\n\tGetCountOfFilteredCollectiblesArgs,\n\tOrderSide,\n} from '../../_internal/api/marketplace.gen';\nimport { collectableKeys } from '../../_internal/api/query-keys';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCountOfCollectablesParams {\n\tchainId: number;\n\tcollectionAddress: string;\n\tconfig: SdkConfig;\n\tfilter?: CollectiblesFilter;\n\tside?: OrderSide;\n}\n\n/**\n * Fetches count of collectibles from the marketplace API\n */\nexport async function fetchCountOfCollectables(\n\tparams: FetchCountOfCollectablesParams,\n) {\n\tconst { collectionAddress, chainId, config, filter, side } = params;\n\n\tconst client = getMarketplaceClient(config);\n\n\tif (filter && side) {\n\t\tconst apiArgs: GetCountOfFilteredCollectiblesArgs = {\n\t\t\tcontractAddress: collectionAddress,\n\t\t\tchainId: String(chainId),\n\t\t\tfilter,\n\t\t\tside,\n\t\t};\n\n\t\tconst result = await client.getCountOfFilteredCollectibles(apiArgs);\n\t\treturn result.count;\n\t}\n\n\tconst apiArgs: GetCountOfAllCollectiblesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t};\n\n\tconst result = await client.getCountOfAllCollectibles(apiArgs);\n\treturn result.count;\n}\n\nexport type CountOfCollectablesQueryOptions =\n\tValuesOptional<FetchCountOfCollectablesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCountOfCollectablesQueryKey(\n\tparams: CountOfCollectablesQueryOptions,\n) {\n\tif (params.filter && params.side) {\n\t\tconst apiArgs = {\n\t\t\tchainId: String(params.chainId),\n\t\t\tcontractAddress: params.collectionAddress,\n\t\t\tfilter: params.filter,\n\t\t\tside: params.side,\n\t\t} satisfies QueryKeyArgs<GetCountOfFilteredCollectiblesArgs>;\n\n\t\treturn [...collectableKeys.counts, apiArgs] as const;\n\t}\n\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t} satisfies QueryKeyArgs<GetCountOfAllCollectiblesArgs>;\n\n\treturn [...collectableKeys.counts, apiArgs] as const;\n}\n\nexport function countOfCollectablesQueryOptions(\n\tparams: CountOfCollectablesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCountOfCollectablesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCountOfCollectables({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t\tfilter: params.filter,\n\t\t\t\tside: params.side,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { Page, SdkConfig } from '../../../types';\nimport type {\n\tListCollectibleActivitiesArgs,\n\tListCollectibleActivitiesReturn,\n\tQueryKeyArgs,\n\tSortBy,\n\tValuesOptional,\n} from '../../_internal';\nimport { collectableKeys, getMarketplaceClient } from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchListCollectibleActivitiesParams\n\textends Omit<\n\t\tListCollectibleActivitiesArgs,\n\t\t'chainId' | 'contractAddress' | 'page'\n\t> {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tpage?: number;\n\tpageSize?: number;\n\tsort?: SortBy[];\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collectible activities from the Marketplace API\n */\nexport async function fetchListCollectibleActivities(\n\tparams: FetchListCollectibleActivitiesParams,\n): Promise<ListCollectibleActivitiesReturn> {\n\tconst {\n\t\tcollectionAddress,\n\t\tchainId,\n\t\tconfig,\n\t\tpage,\n\t\tpageSize,\n\t\tsort,\n\t\t...additionalApiParams\n\t} = params;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst pageParams: Page | undefined =\n\t\tpage || pageSize || sort\n\t\t\t? {\n\t\t\t\t\tpage: page ?? 1,\n\t\t\t\t\tpageSize: pageSize ?? 10,\n\t\t\t\t\tsort,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst apiArgs: ListCollectibleActivitiesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\tpage: pageParams,\n\t\t...additionalApiParams,\n\t};\n\n\treturn await marketplaceClient.listCollectibleActivities(apiArgs);\n}\n\nexport type ListCollectibleActivitiesQueryOptions =\n\tValuesOptional<FetchListCollectibleActivitiesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListCollectibleActivitiesQueryKey(\n\tparams: ListCollectibleActivitiesQueryOptions,\n) {\n\t// TODO: Do we actually want to do the page like this?\n\tconst page =\n\t\tparams.page || params.pageSize || params.sort\n\t\t\t? {\n\t\t\t\t\tpage: params.page ?? 1,\n\t\t\t\t\tpageSize: params.pageSize ?? 10,\n\t\t\t\t\tsort: params.sort,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\ttokenId: params.tokenId,\n\t\tpage: page,\n\t} satisfies QueryKeyArgs<ListCollectibleActivitiesArgs>;\n\n\treturn [...collectableKeys.collectibleActivities, apiArgs] as const;\n}\n\nexport function listCollectibleActivitiesQueryOptions(\n\tparams: ListCollectibleActivitiesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.tokenId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListCollectibleActivitiesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchListCollectibleActivities({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\ttokenId: params.tokenId!,\n\t\t\t\tpage: params.page,\n\t\t\t\tpageSize: params.pageSize,\n\t\t\t\tsort: params.sort,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { infiniteQueryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { Page, SdkConfig } from '../../../types';\nimport type { CardType } from '../../../types/types';\nimport { compareAddress } from '../../../utils';\nimport type {\n\tListCollectiblesArgs,\n\tListCollectiblesReturn,\n\tQueryKeyArgs,\n\tValuesOptional,\n} from '../../_internal';\nimport { collectableKeys, getMarketplaceClient } from '../../_internal';\nimport type { StandardInfiniteQueryOptions } from '../../types/query';\nimport { fetchMarketplaceConfig } from '../market/marketplaceConfig';\n\nexport interface FetchListCollectiblesParams\n\textends Omit<ListCollectiblesArgs, 'chainId' | 'contractAddress'> {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tcardType?: CardType;\n\tconfig: SdkConfig;\n\tenabled?: boolean;\n}\n\n/**\n * Fetches a list of collectibles with pagination support from the Marketplace API\n */\nexport async function fetchListCollectibles(\n\tparams: FetchListCollectiblesParams,\n\tpage: Page,\n): Promise<ListCollectiblesReturn> {\n\tconst { collectionAddress, chainId, config, ...additionalApiParams } = params;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\tconst marketplaceConfig = await fetchMarketplaceConfig({ config });\n\tconst isMarketCollection = marketplaceConfig?.market.collections.some(\n\t\t(collection) => compareAddress(collection.itemsAddress, collectionAddress),\n\t);\n\n\t// If it's not a market collection, return an empty list. those collections are not compatible with the ListCollectibles endpoint.\n\tif (params.enabled === false || !isMarketCollection) {\n\t\treturn {\n\t\t\tcollectibles: [],\n\t\t\tpage: {\n\t\t\t\tpage: 1,\n\t\t\t\tpageSize: 30,\n\t\t\t\tmore: false,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst apiArgs: ListCollectiblesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\tpage: page,\n\t\t...additionalApiParams,\n\t};\n\n\treturn await marketplaceClient.listCollectibles(apiArgs);\n}\n\nexport type ListCollectiblesQueryOptions =\n\tValuesOptional<FetchListCollectiblesParams> & {\n\t\tquery?: StandardInfiniteQueryOptions;\n\t};\n\nexport function getListCollectiblesQueryKey(\n\tparams: ListCollectiblesQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\tside: params.side,\n\t\tfilter: params.filter,\n\t} satisfies QueryKeyArgs<Omit<ListCollectiblesArgs, 'page'>>;\n\n\treturn [...collectableKeys.lists, apiArgs] as const;\n}\n\nexport function listCollectiblesQueryOptions(\n\tparams: ListCollectiblesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.side &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn infiniteQueryOptions({\n\t\tqueryKey: getListCollectiblesQueryKey(params),\n\t\tqueryFn: async ({ pageParam }) => {\n\t\t\treturn fetchListCollectibles(\n\t\t\t\t{\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\tchainId: params.chainId!,\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\tconfig: params.config!,\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\tside: params.side!,\n\t\t\t\t\tfilter: params.filter,\n\t\t\t\t\tcardType: params.cardType,\n\t\t\t\t},\n\t\t\t\tpageParam,\n\t\t\t);\n\t\t},\n\t\tinitialPageParam: { page: 1, pageSize: 30 } as Page,\n\t\tgetNextPageParam: (lastPage) =>\n\t\t\tlastPage.page?.more ? lastPage.page : undefined,\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { Page, SdkConfig } from '../../../types';\nimport type {\n\tListCollectiblesArgs,\n\tListCollectiblesReturn,\n\tQueryKeyArgs,\n\tValuesOptional,\n} from '../../_internal';\nimport { collectableKeys, getMarketplaceClient } from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchListCollectiblesPaginatedParams\n\textends Omit<ListCollectiblesArgs, 'chainId' | 'contractAddress' | 'page'> {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tpage?: number;\n\tpageSize?: number;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches a list of collectibles with pagination support from the Marketplace API\n */\nexport async function fetchListCollectiblesPaginated(\n\tparams: FetchListCollectiblesPaginatedParams,\n): Promise<ListCollectiblesReturn> {\n\tconst {\n\t\tcollectionAddress,\n\t\tchainId,\n\t\tconfig,\n\t\tpage = 1,\n\t\tpageSize = 30,\n\t\t...additionalApiParams\n\t} = params;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst pageParams: Page = {\n\t\tpage,\n\t\tpageSize,\n\t};\n\n\tconst apiArgs: ListCollectiblesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\tpage: pageParams,\n\t\t...additionalApiParams,\n\t};\n\n\treturn await marketplaceClient.listCollectibles(apiArgs);\n}\n\nexport type ListCollectiblesPaginatedQueryOptions =\n\tValuesOptional<FetchListCollectiblesPaginatedParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListCollectiblesPaginatedQueryKey(\n\tparams: ListCollectiblesPaginatedQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\tside: params.side,\n\t\tfilter: params.filter,\n\t\tpage: params.page\n\t\t\t? { page: params.page, pageSize: params.pageSize ?? 30 }\n\t\t\t: undefined,\n\t} satisfies QueryKeyArgs<ListCollectiblesArgs>;\n\n\treturn [...collectableKeys.lists, 'paginated', apiArgs] as const;\n}\n\nexport function listCollectiblesPaginatedQueryOptions(\n\tparams: ListCollectiblesPaginatedQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.side &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListCollectiblesPaginatedQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchListCollectiblesPaginated({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tside: params.side!,\n\t\t\t\tfilter: params.filter,\n\t\t\t\tpage: params.page,\n\t\t\t\tpageSize: params.pageSize,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;AAsBA,eAAsB,0BACrB,MAGA,QACC;AAED,QADsB,iBAAiB,KAAK,SAAS,OAAO,CAE1D,iBAAiB;EACjB,gBAAgB,KAAK;EACrB,iBAAiB,KAAK;EACtB,SAAS,KAAK;EACd,iBAAiB,KAAK,mBAAmB;EACzC,iBAAiB;GAChB,cAAc;GACd,kBAAkB,CAAC,KAAK,kBAAkB;GAC1C;EACD,CAAC,CACD,MAAM,QAAQ,IAAI,SAAS,MAAM,KAAK;;AAGzC,SAAgB,gCACf,MACC;CACD,MAAM,UAAU;EACf,SAAS,KAAK;EACd,gBAAgB,KAAK;EACrB,iBAAiB,KAAK;EACtB,SAAS,KAAK;EACd,iBAAiB,KAAK;EACtB,iBAAiB,KAAK,cACnB;GACA,cAAc;GACd,kBAAkB,CAAC,KAAK,kBAAkB;GAC1C,GACA;EACH;AAED,QAAO,CAAC,GAAG,gBAAgB,cAAc,QAAQ;;;;;;;;;AAUlD,SAAgB,4BACf,MACA,QACC;CACD,MAAM,UAAU,CAAC,CAAC,KAAK,gBAAgB,KAAK,OAAO,WAAW;AAC9D,QAAO,aAAa;EACnB,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ACjB,CAAC;EACH,GAAG,OAAO;EACV;EACA,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { balanceQueries, collectionKeys, getIndexerClient, getMarketplaceClient
|
|
2
|
-
import { compareAddress } from "./utils
|
|
1
|
+
import { c as balanceQueries, d as collectionKeys, i as getMetadataClient, n as getIndexerClient, r as getMarketplaceClient } from "./api.js";
|
|
2
|
+
import { l as compareAddress } from "./utils.js";
|
|
3
3
|
import { queryOptions, skipToken } from "@tanstack/react-query";
|
|
4
4
|
|
|
5
5
|
//#region src/react/queries/collections/collection.ts
|
|
@@ -34,6 +34,78 @@ function collectionQueryOptions(params) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/react/queries/collections/activeListingsCurrencies.ts
|
|
39
|
+
/**
|
|
40
|
+
* Fetches the active listings currencies for a collection from the marketplace API
|
|
41
|
+
*/
|
|
42
|
+
async function fetchCollectionActiveListingsCurrencies(params) {
|
|
43
|
+
const { collectionAddress, chainId, config, ...additionalApiParams } = params;
|
|
44
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
45
|
+
const apiArgs = {
|
|
46
|
+
contractAddress: collectionAddress,
|
|
47
|
+
chainId: String(chainId),
|
|
48
|
+
...additionalApiParams
|
|
49
|
+
};
|
|
50
|
+
return (await marketplaceClient.getCollectionActiveListingsCurrencies(apiArgs)).currencies;
|
|
51
|
+
}
|
|
52
|
+
function getCollectionActiveListingsCurrenciesQueryKey(params) {
|
|
53
|
+
const apiArgs = {
|
|
54
|
+
chainId: String(params.chainId),
|
|
55
|
+
contractAddress: params.collectionAddress
|
|
56
|
+
};
|
|
57
|
+
return [...collectionKeys.activeListingsCurrencies, apiArgs];
|
|
58
|
+
}
|
|
59
|
+
function collectionActiveListingsCurrenciesQueryOptions(params) {
|
|
60
|
+
const enabled = Boolean(params.collectionAddress && params.chainId && params.config && (params.query?.enabled ?? true));
|
|
61
|
+
return queryOptions({
|
|
62
|
+
queryKey: getCollectionActiveListingsCurrenciesQueryKey(params),
|
|
63
|
+
queryFn: () => fetchCollectionActiveListingsCurrencies({
|
|
64
|
+
chainId: params.chainId,
|
|
65
|
+
collectionAddress: params.collectionAddress,
|
|
66
|
+
config: params.config
|
|
67
|
+
}),
|
|
68
|
+
...params.query,
|
|
69
|
+
enabled
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/react/queries/collections/activeOffersCurrencies.ts
|
|
75
|
+
/**
|
|
76
|
+
* Fetches the active offers currencies for a collection from the marketplace API
|
|
77
|
+
*/
|
|
78
|
+
async function fetchCollectionActiveOffersCurrencies(params) {
|
|
79
|
+
const { collectionAddress, chainId, config, ...additionalApiParams } = params;
|
|
80
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
81
|
+
const apiArgs = {
|
|
82
|
+
contractAddress: collectionAddress,
|
|
83
|
+
chainId: String(chainId),
|
|
84
|
+
...additionalApiParams
|
|
85
|
+
};
|
|
86
|
+
return (await marketplaceClient.getCollectionActiveOffersCurrencies(apiArgs)).currencies;
|
|
87
|
+
}
|
|
88
|
+
function getCollectionActiveOffersCurrenciesQueryKey(params) {
|
|
89
|
+
const apiArgs = {
|
|
90
|
+
chainId: String(params.chainId),
|
|
91
|
+
contractAddress: params.collectionAddress
|
|
92
|
+
};
|
|
93
|
+
return [...collectionKeys.activeOffersCurrencies, apiArgs];
|
|
94
|
+
}
|
|
95
|
+
function collectionActiveOffersCurrenciesQueryOptions(params) {
|
|
96
|
+
const enabled = Boolean(params.collectionAddress && params.chainId && params.config && (params.query?.enabled ?? true));
|
|
97
|
+
return queryOptions({
|
|
98
|
+
queryKey: getCollectionActiveOffersCurrenciesQueryKey(params),
|
|
99
|
+
queryFn: () => fetchCollectionActiveOffersCurrencies({
|
|
100
|
+
chainId: params.chainId,
|
|
101
|
+
collectionAddress: params.collectionAddress,
|
|
102
|
+
config: params.config
|
|
103
|
+
}),
|
|
104
|
+
...params.query,
|
|
105
|
+
enabled
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
37
109
|
//#endregion
|
|
38
110
|
//#region src/react/queries/collections/collectionBalanceDetails.ts
|
|
39
111
|
/**
|
|
@@ -89,7 +161,7 @@ function collectionBalanceDetailsQueryOptions(params) {
|
|
|
89
161
|
* Fetches collection details from the marketplace API
|
|
90
162
|
*/
|
|
91
163
|
async function fetchCollectionDetails(params) {
|
|
92
|
-
const { collectionAddress, chainId, config
|
|
164
|
+
const { collectionAddress, chainId, config, ...additionalApiParams } = params;
|
|
93
165
|
const marketplaceClient = getMarketplaceClient(config);
|
|
94
166
|
const apiArgs = {
|
|
95
167
|
contractAddress: collectionAddress,
|
|
@@ -125,7 +197,7 @@ function collectionDetailsQueryOptions(params) {
|
|
|
125
197
|
* Fetches collection activities from the Marketplace API
|
|
126
198
|
*/
|
|
127
199
|
async function fetchListCollectionActivities(params) {
|
|
128
|
-
const { collectionAddress, chainId, config, page, pageSize, sort
|
|
200
|
+
const { collectionAddress, chainId, config, page, pageSize, sort, ...additionalApiParams } = params;
|
|
129
201
|
const marketplaceClient = getMarketplaceClient(config);
|
|
130
202
|
const pageParams = page || pageSize || sort ? {
|
|
131
203
|
page: page ?? 1,
|
|
@@ -198,10 +270,9 @@ async function fetchListCollections(params) {
|
|
|
198
270
|
if (settled.every((result) => result.status === "rejected")) throw settled[0].reason;
|
|
199
271
|
const results = settled.filter((r) => r.status === "fulfilled").flatMap((r) => r.value);
|
|
200
272
|
return collections.map((collection) => {
|
|
201
|
-
const metadata = results.find((result) => compareAddress(result.address, collection.itemsAddress));
|
|
202
273
|
return {
|
|
203
274
|
collection,
|
|
204
|
-
metadata
|
|
275
|
+
metadata: results.find((result) => compareAddress(result.address, collection.itemsAddress))
|
|
205
276
|
};
|
|
206
277
|
}).filter((item) => item.metadata !== void 0).map(({ collection, metadata }) => ({
|
|
207
278
|
...collection,
|
|
@@ -245,5 +316,5 @@ const listCollectionsOptions = ({ cardType, marketplaceConfig, config }) => {
|
|
|
245
316
|
};
|
|
246
317
|
|
|
247
318
|
//#endregion
|
|
248
|
-
export {
|
|
249
|
-
//# sourceMappingURL=collections
|
|
319
|
+
export { getCollectionQueryKey as S, collectionActiveListingsCurrenciesQueryOptions as _, fetchListCollectionActivities as a, collectionQueryOptions as b, collectionDetailsQueryOptions as c, collectionBalanceDetailsQueryOptions as d, fetchCollectionBalanceDetails as f, getCollectionActiveOffersCurrenciesQueryKey as g, fetchCollectionActiveOffersCurrencies as h, listCollectionsQueryOptions as i, fetchCollectionDetails as l, collectionActiveOffersCurrenciesQueryOptions as m, getListCollectionsQueryKey as n, getListCollectionActivitiesQueryKey as o, getCollectionBalanceDetailsQueryKey as p, listCollectionsOptions as r, listCollectionActivitiesQueryOptions as s, fetchListCollections as t, getCollectionDetailsQueryKey as u, fetchCollectionActiveListingsCurrencies as v, fetchCollection as x, getCollectionActiveListingsCurrenciesQueryKey as y };
|
|
320
|
+
//# sourceMappingURL=collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.js","names":["apiArgs: GetCollectionActiveListingsCurrenciesArgs","apiArgs: GetCollectionActiveOffersCurrenciesArgs","apiArgs: GetCollectionDetailArgs","pageParams: Page | undefined","apiArgs: ListCollectionActivitiesArgs"],"sources":["../src/react/queries/collections/collection.ts","../src/react/queries/collections/activeListingsCurrencies.ts","../src/react/queries/collections/activeOffersCurrencies.ts","../src/react/queries/collections/collectionBalanceDetails.ts","../src/react/queries/collections/collectionDetails.ts","../src/react/queries/collections/listCollectionActivities.ts","../src/react/queries/collections/listCollections.ts"],"sourcesContent":["import type { GetContractInfoArgs } from '@0xsequence/metadata';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMetadataClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport { collectionKeys } from '../../_internal/api/query-keys';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCollectionParams {\n\tchainId: number;\n\tcollectionAddress: string;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collection information from the metadata API\n */\nexport async function fetchCollection(params: FetchCollectionParams) {\n\tconst { collectionAddress, chainId, config } = params;\n\n\tconst metadataClient = getMetadataClient(config);\n\n\tconst result = await metadataClient.getContractInfo({\n\t\tchainID: chainId.toString(),\n\t\tcontractAddress: collectionAddress,\n\t});\n\n\treturn result.contractInfo;\n}\n\nexport type CollectionQueryOptions = ValuesOptional<FetchCollectionParams> & {\n\tquery?: StandardQueryOptions;\n};\n\nexport function getCollectionQueryKey(params: CollectionQueryOptions) {\n\tconst apiArgs = {\n\t\tchainID: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t} satisfies QueryKeyArgs<GetContractInfoArgs>;\n\n\treturn [...collectionKeys.detail, apiArgs] as const;\n}\n\nexport function collectionQueryOptions(params: CollectionQueryOptions) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectionQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollection({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tcollectionKeys,\n\ttype GetCollectionActiveListingsCurrenciesArgs,\n\ttype GetCollectionActiveListingsCurrenciesReturn,\n\tgetMarketplaceClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCollectionActiveListingsCurrenciesParams\n\textends Omit<\n\t\tGetCollectionActiveListingsCurrenciesArgs,\n\t\t'contractAddress' | 'chainId'\n\t> {\n\tcollectionAddress: string;\n\tchainId: number;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches the active listings currencies for a collection from the marketplace API\n */\nexport async function fetchCollectionActiveListingsCurrencies(\n\tparams: FetchCollectionActiveListingsCurrenciesParams,\n): Promise<GetCollectionActiveListingsCurrenciesReturn['currencies']> {\n\tconst { collectionAddress, chainId, config, ...additionalApiParams } = params;\n\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst apiArgs: GetCollectionActiveListingsCurrenciesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\t...additionalApiParams,\n\t};\n\n\tconst result =\n\t\tawait marketplaceClient.getCollectionActiveListingsCurrencies(apiArgs);\n\treturn result.currencies;\n}\n\nexport type CollectionActiveListingsCurrenciesQueryOptions =\n\tValuesOptional<FetchCollectionActiveListingsCurrenciesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCollectionActiveListingsCurrenciesQueryKey(\n\tparams: CollectionActiveListingsCurrenciesQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t} satisfies QueryKeyArgs<GetCollectionActiveListingsCurrenciesArgs>;\n\n\treturn [...collectionKeys.activeListingsCurrencies, apiArgs] as const;\n}\n\nexport function collectionActiveListingsCurrenciesQueryOptions(\n\tparams: CollectionActiveListingsCurrenciesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectionActiveListingsCurrenciesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollectionActiveListingsCurrencies({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tcollectionKeys,\n\ttype GetCollectionActiveOffersCurrenciesArgs,\n\ttype GetCollectionActiveOffersCurrenciesReturn,\n\tgetMarketplaceClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCollectionActiveOffersCurrenciesParams\n\textends Omit<\n\t\tGetCollectionActiveOffersCurrenciesArgs,\n\t\t'contractAddress' | 'chainId'\n\t> {\n\tcollectionAddress: string;\n\tchainId: number;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches the active offers currencies for a collection from the marketplace API\n */\nexport async function fetchCollectionActiveOffersCurrencies(\n\tparams: FetchCollectionActiveOffersCurrenciesParams,\n): Promise<GetCollectionActiveOffersCurrenciesReturn['currencies']> {\n\tconst { collectionAddress, chainId, config, ...additionalApiParams } = params;\n\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst apiArgs: GetCollectionActiveOffersCurrenciesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\t...additionalApiParams,\n\t};\n\n\tconst result =\n\t\tawait marketplaceClient.getCollectionActiveOffersCurrencies(apiArgs);\n\treturn result.currencies;\n}\n\nexport type CollectionActiveOffersCurrenciesQueryOptions =\n\tValuesOptional<FetchCollectionActiveOffersCurrenciesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCollectionActiveOffersCurrenciesQueryKey(\n\tparams: CollectionActiveOffersCurrenciesQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t} satisfies QueryKeyArgs<GetCollectionActiveOffersCurrenciesArgs>;\n\n\treturn [...collectionKeys.activeOffersCurrencies, apiArgs] as const;\n}\n\nexport function collectionActiveOffersCurrenciesQueryOptions(\n\tparams: CollectionActiveOffersCurrenciesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectionActiveOffersCurrenciesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollectionActiveOffersCurrencies({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import type { GetTokenBalancesDetailsReturn } from '@0xsequence/indexer';\nimport { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tbalanceQueries,\n\tgetIndexerClient,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface CollectionBalanceFilter {\n\taccountAddresses: Array<Address>;\n\tcontractWhitelist?: Array<Address>;\n\tomitNativeBalances: boolean;\n}\n\nexport interface FetchCollectionBalanceDetailsParams {\n\tchainId: number;\n\tfilter: CollectionBalanceFilter;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches detailed balance information for multiple accounts from the Indexer API\n */\nexport async function fetchCollectionBalanceDetails(\n\tparams: FetchCollectionBalanceDetailsParams,\n): Promise<GetTokenBalancesDetailsReturn> {\n\tconst { chainId, filter, config } = params;\n\n\tconst indexerClient = getIndexerClient(chainId, config);\n\n\tconst promises = filter.accountAddresses.map((accountAddress) =>\n\t\tindexerClient.getTokenBalancesDetails({\n\t\t\tfilter: {\n\t\t\t\taccountAddresses: [accountAddress],\n\t\t\t\tcontractWhitelist: filter.contractWhitelist,\n\t\t\t\tomitNativeBalances: filter.omitNativeBalances,\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst responses = await Promise.all(promises);\n\tconst mergedResponse = responses.reduce<GetTokenBalancesDetailsReturn>(\n\t\t(acc, curr) => {\n\t\t\tif (!curr) return acc;\n\t\t\treturn {\n\t\t\t\tpage: curr.page,\n\t\t\t\tnativeBalances: [\n\t\t\t\t\t...(acc.nativeBalances || []),\n\t\t\t\t\t...(curr.nativeBalances || []),\n\t\t\t\t],\n\t\t\t\tbalances: [...(acc.balances || []), ...(curr.balances || [])],\n\t\t\t};\n\t\t},\n\t\t{ page: {}, nativeBalances: [], balances: [] },\n\t);\n\n\tif (!mergedResponse) {\n\t\tthrow new Error('Failed to fetch collection balance details');\n\t}\n\n\treturn mergedResponse;\n}\n\nexport type CollectionBalanceDetailsQueryOptions =\n\tValuesOptional<FetchCollectionBalanceDetailsParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCollectionBalanceDetailsQueryKey(\n\tparams: CollectionBalanceDetailsQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: params.chainId!,\n\t\tfilter: params.filter!,\n\t};\n\n\treturn [...balanceQueries.collectionBalanceDetails, apiArgs] as const;\n}\n\nexport function collectionBalanceDetailsQueryOptions(\n\tparams: CollectionBalanceDetailsQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.chainId &&\n\t\t\tparams.filter?.accountAddresses?.length &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectionBalanceDetailsQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollectionBalanceDetails({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tfilter: params.filter!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../../types';\nimport {\n\tgetMarketplaceClient,\n\ttype QueryKeyArgs,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { GetCollectionDetailArgs } from '../../_internal/api/marketplace.gen';\nimport { collectionKeys } from '../../_internal/api/query-keys';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchCollectionDetailsParams\n\textends Omit<GetCollectionDetailArgs, 'chainId' | 'contractAddress'> {\n\tchainId: number;\n\tcollectionAddress: string;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collection details from the marketplace API\n */\nexport async function fetchCollectionDetails(\n\tparams: FetchCollectionDetailsParams,\n) {\n\tconst { collectionAddress, chainId, config, ...additionalApiParams } = params;\n\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst apiArgs: GetCollectionDetailArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\t...additionalApiParams,\n\t};\n\n\tconst result = await marketplaceClient.getCollectionDetail(apiArgs);\n\treturn result.collection;\n}\n\nexport type CollectionDetailsQueryOptions =\n\tValuesOptional<FetchCollectionDetailsParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getCollectionDetailsQueryKey(\n\tparams: CollectionDetailsQueryOptions,\n) {\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t} satisfies QueryKeyArgs<GetCollectionDetailArgs>;\n\n\treturn [...collectionKeys.detail, apiArgs] as const;\n}\n\nexport function collectionDetailsQueryOptions(\n\tparams: CollectionDetailsQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getCollectionDetailsQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchCollectionDetails({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Address } from 'viem';\nimport type { Page, SdkConfig } from '../../../types';\nimport type {\n\tListCollectionActivitiesArgs,\n\tListCollectionActivitiesReturn,\n\tQueryKeyArgs,\n\tSortBy,\n\tValuesOptional,\n} from '../../_internal';\nimport { getMarketplaceClient } from '../../_internal';\nimport { collectionKeys } from '../../_internal/api';\nimport type { StandardQueryOptions } from '../../types/query';\n\nexport interface FetchListCollectionActivitiesParams\n\textends Omit<\n\t\tListCollectionActivitiesArgs,\n\t\t'chainId' | 'contractAddress' | 'page'\n\t> {\n\tchainId: number;\n\tcollectionAddress: Address;\n\tpage?: number;\n\tpageSize?: number;\n\tsort?: SortBy[];\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collection activities from the Marketplace API\n */\nexport async function fetchListCollectionActivities(\n\tparams: FetchListCollectionActivitiesParams,\n): Promise<ListCollectionActivitiesReturn> {\n\tconst {\n\t\tcollectionAddress,\n\t\tchainId,\n\t\tconfig,\n\t\tpage,\n\t\tpageSize,\n\t\tsort,\n\t\t...additionalApiParams\n\t} = params;\n\tconst marketplaceClient = getMarketplaceClient(config);\n\n\tconst pageParams: Page | undefined =\n\t\tpage || pageSize || sort\n\t\t\t? {\n\t\t\t\t\tpage: page ?? 1,\n\t\t\t\t\tpageSize: pageSize ?? 10,\n\t\t\t\t\tsort,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst apiArgs: ListCollectionActivitiesArgs = {\n\t\tcontractAddress: collectionAddress,\n\t\tchainId: String(chainId),\n\t\tpage: pageParams,\n\t\t...additionalApiParams,\n\t};\n\n\treturn await marketplaceClient.listCollectionActivities(apiArgs);\n}\n\nexport type ListCollectionActivitiesQueryOptions =\n\tValuesOptional<FetchListCollectionActivitiesParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListCollectionActivitiesQueryKey(\n\tparams: ListCollectionActivitiesQueryOptions,\n) {\n\tconst page =\n\t\tparams.page || params.pageSize || params.sort\n\t\t\t? {\n\t\t\t\t\tpage: params.page ?? 1,\n\t\t\t\t\tpageSize: params.pageSize ?? 10,\n\t\t\t\t\tsort: params.sort,\n\t\t\t\t}\n\t\t\t: undefined;\n\n\tconst apiArgs = {\n\t\tchainId: String(params.chainId),\n\t\tcontractAddress: params.collectionAddress,\n\t\tpage: page,\n\t} satisfies QueryKeyArgs<ListCollectionActivitiesArgs>;\n\n\treturn [...collectionKeys.collectionActivities, apiArgs] as const;\n}\n\nexport function listCollectionActivitiesQueryOptions(\n\tparams: ListCollectionActivitiesQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.collectionAddress &&\n\t\t\tparams.chainId &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListCollectionActivitiesQueryKey(params),\n\t\tqueryFn: () =>\n\t\t\tfetchListCollectionActivities({\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tchainId: params.chainId!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tcollectionAddress: params.collectionAddress!,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\tconfig: params.config!,\n\t\t\t\tpage: params.page,\n\t\t\t\tpageSize: params.pageSize,\n\t\t\t\tsort: params.sort,\n\t\t\t}),\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n","import type { ContractInfo } from '@0xsequence/metadata';\nimport { queryOptions, skipToken } from '@tanstack/react-query';\nimport type { CardType, SdkConfig } from '../../../types';\nimport type {\n\tMarketCollection,\n\tMarketplaceConfig,\n\tShopCollection,\n} from '../../../types/new-marketplace-types';\nimport { compareAddress } from '../../../utils';\nimport {\n\tcollectionKeys,\n\tgetMetadataClient,\n\ttype ValuesOptional,\n} from '../../_internal';\nimport type { StandardQueryOptions } from '../../types/query';\n\nconst allCollections = (marketplaceConfig: MarketplaceConfig) => {\n\treturn [\n\t\t...marketplaceConfig.market.collections,\n\t\t...marketplaceConfig.shop.collections,\n\t];\n};\n\nexport interface FetchListCollectionsParams {\n\tcardType?: CardType;\n\tmarketplaceConfig: MarketplaceConfig;\n\tconfig: SdkConfig;\n}\n\n/**\n * Fetches collections from the metadata API with marketplace config filtering\n */\nexport async function fetchListCollections(params: FetchListCollectionsParams) {\n\tconst { cardType, marketplaceConfig, config } = params;\n\tconst metadataClient = getMetadataClient(config);\n\n\tlet collections = allCollections(marketplaceConfig);\n\n\tif (!collections?.length) {\n\t\treturn [];\n\t}\n\n\tif (cardType) {\n\t\tcollections = collections.filter(\n\t\t\t(collection) => collection.cardType === cardType,\n\t\t);\n\t}\n\n\t// Group collections by chainId\n\tconst collectionsByChain = collections.reduce<Record<string, string[]>>(\n\t\t(acc, curr) => {\n\t\t\tconst { chainId, itemsAddress } = curr;\n\t\t\tif (!acc[chainId]) {\n\t\t\t\tacc[chainId] = [];\n\t\t\t}\n\t\t\tacc[chainId].push(itemsAddress);\n\t\t\treturn acc;\n\t\t},\n\t\t{},\n\t);\n\n\t// Fetch collections for each chain\n\tconst promises = Object.entries(collectionsByChain).map(\n\t\t([chainId, addresses]) =>\n\t\t\tmetadataClient\n\t\t\t\t.getContractInfoBatch({\n\t\t\t\t\tchainID: chainId,\n\t\t\t\t\tcontractAddresses: addresses,\n\t\t\t\t})\n\t\t\t\t.then((resp) => Object.values(resp.contractInfoMap)),\n\t);\n\n\tconst settled = await Promise.allSettled(promises);\n\n\t// If all promises failed, throw the first error\n\tif (settled.every((result) => result.status === 'rejected')) {\n\t\tconst firstError = settled[0] as PromiseRejectedResult;\n\t\tthrow firstError.reason;\n\t}\n\n\tconst results = settled\n\t\t.filter(\n\t\t\t(r): r is PromiseFulfilledResult<ContractInfo[]> =>\n\t\t\t\tr.status === 'fulfilled',\n\t\t)\n\t\t.flatMap((r) => r.value);\n\n\tconst collectionsWithMetadata = collections\n\t\t.map((collection) => {\n\t\t\tconst metadata = results.find((result) =>\n\t\t\t\tcompareAddress(result.address, collection.itemsAddress),\n\t\t\t);\n\t\t\treturn { collection, metadata };\n\t\t})\n\t\t.filter(\n\t\t\t(\n\t\t\t\titem,\n\t\t\t): item is {\n\t\t\t\tcollection: MarketCollection | ShopCollection;\n\t\t\t\tmetadata: ContractInfo;\n\t\t\t} => item.metadata !== undefined,\n\t\t)\n\t\t.map(({ collection, metadata }) => ({\n\t\t\t...collection,\n\t\t\t...metadata,\n\t\t}));\n\n\treturn collectionsWithMetadata;\n}\n\nexport type ListCollectionsQueryOptions =\n\tValuesOptional<FetchListCollectionsParams> & {\n\t\tquery?: StandardQueryOptions;\n\t};\n\nexport function getListCollectionsQueryKey(\n\tparams: ListCollectionsQueryOptions,\n) {\n\tconst queryKeyParams = {\n\t\tcardType: params.cardType,\n\t\tmarketplaceConfig: params.marketplaceConfig,\n\t} as const;\n\n\treturn [...collectionKeys.list, queryKeyParams] as const;\n}\n\nexport function listCollectionsQueryOptions(\n\tparams: ListCollectionsQueryOptions,\n) {\n\tconst enabled = Boolean(\n\t\tparams.marketplaceConfig &&\n\t\t\tparams.config &&\n\t\t\t(params.query?.enabled ?? true),\n\t);\n\n\treturn queryOptions({\n\t\tqueryKey: getListCollectionsQueryKey(params),\n\t\tqueryFn: enabled\n\t\t\t? () =>\n\t\t\t\t\tfetchListCollections({\n\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\t\tmarketplaceConfig: params.marketplaceConfig!,\n\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined\n\t\t\t\t\t\tconfig: params.config!,\n\t\t\t\t\t\tcardType: params.cardType,\n\t\t\t\t\t})\n\t\t\t: skipToken,\n\t\t...params.query,\n\t\tenabled,\n\t});\n}\n\n// Keep old function for backward compatibility during migration\nexport const listCollectionsOptions = ({\n\tcardType,\n\tmarketplaceConfig,\n\tconfig,\n}: {\n\tcardType?: CardType;\n\tmarketplaceConfig: MarketplaceConfig | undefined;\n\tconfig: SdkConfig;\n}) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectionKeys.list, { cardType, marketplaceConfig, config }],\n\t\tqueryFn: marketplaceConfig\n\t\t\t? () =>\n\t\t\t\t\tfetchListCollections({\n\t\t\t\t\t\tmarketplaceConfig,\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t\tcardType,\n\t\t\t\t\t})\n\t\t\t: skipToken,\n\t\tenabled: Boolean(marketplaceConfig),\n\t});\n};\n"],"mappings":";;;;;;;;AAoBA,eAAsB,gBAAgB,QAA+B;CACpE,MAAM,EAAE,mBAAmB,SAAS,WAAW;AAS/C,SALe,MAFQ,kBAAkB,OAAO,CAEZ,gBAAgB;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ACtC,UACA,mBACA,aAKK;AACL,QAAO,aAAa;EACnB,UAAU,CAAC,GAAG,eAAe,MAAM;GAAE;GAAU;GAAmB;GAAQ,CAAC;EAC3E,SAAS,0BAEN,qBAAqB;GACpB;GACA;GACA;GACA,CAAC,GACF;EACH,SAAS,QAAQ,kBAAkB;EACnC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ContractType } from "./marketplace.gen
|
|
2
|
-
import { compareAddress } from "./utils
|
|
3
|
-
import { BellIcon_default } from "./BellIcon
|
|
4
|
-
import { formatPriceNumber, getSupplyStatusText } from "./
|
|
1
|
+
import { s as ContractType } from "./marketplace.gen.js";
|
|
2
|
+
import { l as compareAddress } from "./utils.js";
|
|
3
|
+
import { t as BellIcon_default } from "./BellIcon.js";
|
|
4
|
+
import { i as formatPriceNumber, t as getSupplyStatusText } from "./utils3.js";
|
|
5
5
|
import { useAccount } from "wagmi";
|
|
6
6
|
import { ChevronLeftIcon, ChevronRightIcon, IconButton, Image, Text, cn } from "@0xsequence/design-system";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -93,27 +93,25 @@ const PriceDisplay = ({ amount, currency, showCurrencyIcon = true, className })
|
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/react/ui/components/marketplace-collectible-card/components/footer/components/SaleDetailsPill.tsx
|
|
95
95
|
const SaleDetailsPill = ({ quantityRemaining, collectionType, unlimitedSupply }) => {
|
|
96
|
-
const supplyText = getSupplyStatusText({
|
|
97
|
-
quantityRemaining,
|
|
98
|
-
collectionType,
|
|
99
|
-
unlimitedSupply
|
|
100
|
-
});
|
|
101
96
|
return /* @__PURE__ */ jsx(Text, {
|
|
102
97
|
className: "rounded-lg bg-background-secondary px-2 py-1 text-left font-medium text-text-80 text-xs",
|
|
103
|
-
children:
|
|
98
|
+
children: getSupplyStatusText({
|
|
99
|
+
quantityRemaining,
|
|
100
|
+
collectionType,
|
|
101
|
+
unlimitedSupply
|
|
102
|
+
})
|
|
104
103
|
});
|
|
105
104
|
};
|
|
106
105
|
|
|
107
106
|
//#endregion
|
|
108
107
|
//#region src/react/ui/components/marketplace-collectible-card/components/footer/components/TokenTypeBalancePill.tsx
|
|
109
108
|
const TokenTypeBalancePill = ({ balance, type, decimals }) => {
|
|
110
|
-
const displayText = type === ContractType.ERC1155 ? balance ? `Owned: ${formatUnits(BigInt(balance), decimals ?? 0)}` : "ERC-1155" : "ERC-721";
|
|
111
109
|
return /* @__PURE__ */ jsx(Text, {
|
|
112
110
|
className: "rounded-lg bg-background-secondary px-2 py-1 text-left font-medium text-text-80 text-xs",
|
|
113
|
-
children:
|
|
111
|
+
children: type === ContractType.ERC1155 ? balance ? `Owned: ${formatUnits(BigInt(balance), decimals ?? 0)}` : "ERC-1155" : "ERC-721"
|
|
114
112
|
});
|
|
115
113
|
};
|
|
116
114
|
|
|
117
115
|
//#endregion
|
|
118
|
-
export { FooterName,
|
|
119
|
-
//# sourceMappingURL=components
|
|
116
|
+
export { FooterName as a, formatPrice as i, SaleDetailsPill as n, PriceDisplay as r, TokenTypeBalancePill as t };
|
|
117
|
+
//# sourceMappingURL=components.js.map
|