@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
|
@@ -158,12 +158,14 @@ describe('useProcessStep', () => {
|
|
|
158
158
|
message: 'Sign this message',
|
|
159
159
|
});
|
|
160
160
|
expect(mockExecute).toHaveBeenCalledWith({
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
params: {
|
|
162
|
+
chainId: '1',
|
|
163
|
+
signature: mockSignature,
|
|
164
|
+
method: 'POST',
|
|
165
|
+
endpoint: '/api/order',
|
|
166
|
+
body: { test: 'data' },
|
|
167
|
+
executeType: ExecuteType.order,
|
|
168
|
+
},
|
|
167
169
|
});
|
|
168
170
|
});
|
|
169
171
|
|
|
@@ -73,12 +73,14 @@ export const useProcessStep = () => {
|
|
|
73
73
|
// Call execute endpoint with signature
|
|
74
74
|
if (step.post) {
|
|
75
75
|
const result = await marketplaceClient.execute({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
params: {
|
|
77
|
+
chainId: String(chainId),
|
|
78
|
+
signature,
|
|
79
|
+
method: step.post.method,
|
|
80
|
+
endpoint: step.post.endpoint,
|
|
81
|
+
body: step.post.body,
|
|
82
|
+
executeType: ExecuteType.order,
|
|
83
|
+
},
|
|
82
84
|
});
|
|
83
85
|
|
|
84
86
|
return { type: 'signature', orderId: result.orderId };
|
|
@@ -61,7 +61,7 @@ describe('useComparePrices', () => {
|
|
|
61
61
|
// 1 ETH vs 1 USDC = 2000 vs 1 = 199900% difference
|
|
62
62
|
expect(result.current.data).toEqual({
|
|
63
63
|
percentageDifference: 199900,
|
|
64
|
-
percentageDifferenceFormatted: '
|
|
64
|
+
percentageDifferenceFormatted: '199,900.00',
|
|
65
65
|
status: 'above',
|
|
66
66
|
});
|
|
67
67
|
});
|
|
@@ -22,7 +22,8 @@ export const ModalProvider = observer(({ children }: ModalProviderProps) => {
|
|
|
22
22
|
const { shadowDom, experimentalShadowDomCssOverride } = sdkConfig;
|
|
23
23
|
|
|
24
24
|
const overrides = sdkConfig._internal?.overrides?.api?.marketplace;
|
|
25
|
-
const marketplaceApiUrl =
|
|
25
|
+
const marketplaceApiUrl =
|
|
26
|
+
overrides?.url || marketplaceApiURL(overrides?.env || 'production');
|
|
26
27
|
|
|
27
28
|
return (
|
|
28
29
|
<>
|
|
@@ -2,14 +2,13 @@ import { queryOptions, skipToken } from '@tanstack/react-query';
|
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
3
|
import type { UseQueryParameters } from 'wagmi/query';
|
|
4
4
|
import type { SdkConfig } from '../../../types';
|
|
5
|
-
import { collectableKeys, getIndexerClient
|
|
5
|
+
import { collectableKeys, getIndexerClient } from '../../_internal';
|
|
6
6
|
|
|
7
7
|
export type UseBalanceOfCollectibleArgs = {
|
|
8
8
|
collectionAddress: Address;
|
|
9
9
|
collectableId: string;
|
|
10
10
|
userAddress: Address | undefined;
|
|
11
11
|
chainId: number;
|
|
12
|
-
isLaos721?: boolean;
|
|
13
12
|
includeMetadata?: boolean;
|
|
14
13
|
query?: UseQueryParameters;
|
|
15
14
|
};
|
|
@@ -27,18 +26,6 @@ export async function fetchBalanceOfCollectible(
|
|
|
27
26
|
},
|
|
28
27
|
config: SdkConfig,
|
|
29
28
|
) {
|
|
30
|
-
if (args.isLaos721) {
|
|
31
|
-
const laosApi = new LaosAPI();
|
|
32
|
-
const response = await laosApi.getTokenBalances({
|
|
33
|
-
chainId: args.chainId.toString(),
|
|
34
|
-
contractAddress: args.collectionAddress,
|
|
35
|
-
accountAddress: args.userAddress,
|
|
36
|
-
includeMetadata: true,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
return response.balances[0] || null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
29
|
const indexerClient = getIndexerClient(args.chainId, config);
|
|
43
30
|
return indexerClient
|
|
44
31
|
.getTokenBalances({
|
|
@@ -69,7 +56,6 @@ export function getBalanceOfCollectibleQueryKey(
|
|
|
69
56
|
includeContracts: [args.collectionAddress],
|
|
70
57
|
}
|
|
71
58
|
: undefined,
|
|
72
|
-
isLaos721: args.isLaos721,
|
|
73
59
|
};
|
|
74
60
|
|
|
75
61
|
return [...collectableKeys.userBalances, apiArgs] as const;
|
|
@@ -9,25 +9,14 @@ import type {
|
|
|
9
9
|
QueryKeyArgs,
|
|
10
10
|
ValuesOptional,
|
|
11
11
|
} from '../../_internal';
|
|
12
|
-
import {
|
|
13
|
-
type CollectibleOrder,
|
|
14
|
-
collectableKeys,
|
|
15
|
-
getMarketplaceClient,
|
|
16
|
-
MetadataStatus,
|
|
17
|
-
OrderSide,
|
|
18
|
-
} from '../../_internal';
|
|
12
|
+
import { collectableKeys, getMarketplaceClient } from '../../_internal';
|
|
19
13
|
import type { StandardInfiniteQueryOptions } from '../../types/query';
|
|
20
14
|
import { fetchMarketplaceConfig } from '../market/marketplaceConfig';
|
|
21
|
-
import {
|
|
22
|
-
fetchBalances,
|
|
23
|
-
type UseListBalancesArgs,
|
|
24
|
-
} from '../tokens/listBalances';
|
|
25
15
|
|
|
26
16
|
export interface FetchListCollectiblesParams
|
|
27
17
|
extends Omit<ListCollectiblesArgs, 'chainId' | 'contractAddress'> {
|
|
28
18
|
chainId: number;
|
|
29
19
|
collectionAddress: Address;
|
|
30
|
-
isLaos721?: boolean;
|
|
31
20
|
cardType?: CardType;
|
|
32
21
|
config: SdkConfig;
|
|
33
22
|
enabled?: boolean;
|
|
@@ -66,47 +55,6 @@ export async function fetchListCollectibles(
|
|
|
66
55
|
...additionalApiParams,
|
|
67
56
|
};
|
|
68
57
|
|
|
69
|
-
if (params.isLaos721 && params.side === OrderSide.listing) {
|
|
70
|
-
try {
|
|
71
|
-
const fetchBalancesArgs = {
|
|
72
|
-
chainId: params.chainId,
|
|
73
|
-
accountAddress: params.filter?.inAccounts?.[0] as Address,
|
|
74
|
-
contractAddress: params.collectionAddress,
|
|
75
|
-
page: page,
|
|
76
|
-
includeMetadata: true,
|
|
77
|
-
isLaos721: true,
|
|
78
|
-
} satisfies UseListBalancesArgs;
|
|
79
|
-
|
|
80
|
-
const balances = await fetchBalances(fetchBalancesArgs, config, page);
|
|
81
|
-
const collectibles: CollectibleOrder[] = balances.balances.map(
|
|
82
|
-
(balance) => {
|
|
83
|
-
if (!balance.tokenMetadata)
|
|
84
|
-
throw new Error('Token metadata not found');
|
|
85
|
-
return {
|
|
86
|
-
metadata: {
|
|
87
|
-
tokenId: balance.tokenID ?? '',
|
|
88
|
-
attributes: balance.tokenMetadata.attributes,
|
|
89
|
-
image: balance.tokenMetadata.image,
|
|
90
|
-
name: balance.tokenMetadata.name,
|
|
91
|
-
description: balance.tokenMetadata.description,
|
|
92
|
-
video: balance.tokenMetadata.video,
|
|
93
|
-
audio: balance.tokenMetadata.audio,
|
|
94
|
-
status: MetadataStatus.AVAILABLE,
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
},
|
|
98
|
-
);
|
|
99
|
-
return {
|
|
100
|
-
collectibles: collectibles,
|
|
101
|
-
//@ts-expect-error
|
|
102
|
-
page: balances.page,
|
|
103
|
-
};
|
|
104
|
-
} catch (error) {
|
|
105
|
-
// If the request fails, ignore the error and return the collectibles from our indexer
|
|
106
|
-
console.error(error);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
58
|
return await marketplaceClient.listCollectibles(apiArgs);
|
|
111
59
|
}
|
|
112
60
|
|
|
@@ -153,7 +101,6 @@ export function listCollectiblesQueryOptions(
|
|
|
153
101
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
154
102
|
side: params.side!,
|
|
155
103
|
filter: params.filter,
|
|
156
|
-
isLaos721: params.isLaos721,
|
|
157
104
|
cardType: params.cardType,
|
|
158
105
|
},
|
|
159
106
|
pageParam,
|
|
@@ -2,13 +2,12 @@ import { queryOptions, skipToken } from '@tanstack/react-query';
|
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
3
|
import type { UseQueryParameters } from 'wagmi/query';
|
|
4
4
|
import type { SdkConfig } from '../../../types';
|
|
5
|
-
import { collectableKeys, getIndexerClient
|
|
5
|
+
import { collectableKeys, getIndexerClient } from '../../_internal';
|
|
6
6
|
|
|
7
7
|
export type UseTokenBalancesArgs = {
|
|
8
8
|
collectionAddress: Address;
|
|
9
9
|
userAddress: Address | undefined;
|
|
10
10
|
chainId: number;
|
|
11
|
-
isLaos721?: boolean;
|
|
12
11
|
includeMetadata?: boolean;
|
|
13
12
|
query?: UseQueryParameters;
|
|
14
13
|
};
|
|
@@ -26,18 +25,6 @@ export async function fetchTokenBalances(
|
|
|
26
25
|
},
|
|
27
26
|
config: SdkConfig,
|
|
28
27
|
) {
|
|
29
|
-
if (args.isLaos721) {
|
|
30
|
-
const laosApi = new LaosAPI();
|
|
31
|
-
const response = await laosApi.getTokenBalances({
|
|
32
|
-
chainId: args.chainId.toString(),
|
|
33
|
-
contractAddress: args.collectionAddress,
|
|
34
|
-
accountAddress: args.userAddress,
|
|
35
|
-
includeMetadata: true,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
return response.balances || [];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
28
|
const indexerClient = getIndexerClient(args.chainId, config);
|
|
42
29
|
return indexerClient
|
|
43
30
|
.getTokenBalances({
|
|
@@ -64,7 +51,6 @@ export function getTokenBalancesQueryKey(args: UseTokenBalancesArgs) {
|
|
|
64
51
|
includeContracts: [args.collectionAddress],
|
|
65
52
|
}
|
|
66
53
|
: undefined,
|
|
67
|
-
isLaos721: args.isLaos721,
|
|
68
54
|
};
|
|
69
55
|
|
|
70
56
|
return [...collectableKeys.userBalances, apiArgs] as const;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { SdkConfig } from '../../../types';
|
|
3
|
+
import {
|
|
4
|
+
collectionKeys,
|
|
5
|
+
type GetCollectionActiveListingsCurrenciesArgs,
|
|
6
|
+
type GetCollectionActiveListingsCurrenciesReturn,
|
|
7
|
+
getMarketplaceClient,
|
|
8
|
+
type QueryKeyArgs,
|
|
9
|
+
type ValuesOptional,
|
|
10
|
+
} from '../../_internal';
|
|
11
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
12
|
+
|
|
13
|
+
export interface FetchCollectionActiveListingsCurrenciesParams
|
|
14
|
+
extends Omit<
|
|
15
|
+
GetCollectionActiveListingsCurrenciesArgs,
|
|
16
|
+
'contractAddress' | 'chainId'
|
|
17
|
+
> {
|
|
18
|
+
collectionAddress: string;
|
|
19
|
+
chainId: number;
|
|
20
|
+
config: SdkConfig;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Fetches the active listings currencies for a collection from the marketplace API
|
|
25
|
+
*/
|
|
26
|
+
export async function fetchCollectionActiveListingsCurrencies(
|
|
27
|
+
params: FetchCollectionActiveListingsCurrenciesParams,
|
|
28
|
+
): Promise<GetCollectionActiveListingsCurrenciesReturn['currencies']> {
|
|
29
|
+
const { collectionAddress, chainId, config, ...additionalApiParams } = params;
|
|
30
|
+
|
|
31
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
32
|
+
|
|
33
|
+
const apiArgs: GetCollectionActiveListingsCurrenciesArgs = {
|
|
34
|
+
contractAddress: collectionAddress,
|
|
35
|
+
chainId: String(chainId),
|
|
36
|
+
...additionalApiParams,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const result =
|
|
40
|
+
await marketplaceClient.getCollectionActiveListingsCurrencies(apiArgs);
|
|
41
|
+
return result.currencies;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type CollectionActiveListingsCurrenciesQueryOptions =
|
|
45
|
+
ValuesOptional<FetchCollectionActiveListingsCurrenciesParams> & {
|
|
46
|
+
query?: StandardQueryOptions;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function getCollectionActiveListingsCurrenciesQueryKey(
|
|
50
|
+
params: CollectionActiveListingsCurrenciesQueryOptions,
|
|
51
|
+
) {
|
|
52
|
+
const apiArgs = {
|
|
53
|
+
chainId: String(params.chainId),
|
|
54
|
+
contractAddress: params.collectionAddress,
|
|
55
|
+
} satisfies QueryKeyArgs<GetCollectionActiveListingsCurrenciesArgs>;
|
|
56
|
+
|
|
57
|
+
return [...collectionKeys.activeListingsCurrencies, apiArgs] as const;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function collectionActiveListingsCurrenciesQueryOptions(
|
|
61
|
+
params: CollectionActiveListingsCurrenciesQueryOptions,
|
|
62
|
+
) {
|
|
63
|
+
const enabled = Boolean(
|
|
64
|
+
params.collectionAddress &&
|
|
65
|
+
params.chainId &&
|
|
66
|
+
params.config &&
|
|
67
|
+
(params.query?.enabled ?? true),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return queryOptions({
|
|
71
|
+
queryKey: getCollectionActiveListingsCurrenciesQueryKey(params),
|
|
72
|
+
queryFn: () =>
|
|
73
|
+
fetchCollectionActiveListingsCurrencies({
|
|
74
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
75
|
+
chainId: params.chainId!,
|
|
76
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
77
|
+
collectionAddress: params.collectionAddress!,
|
|
78
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
79
|
+
config: params.config!,
|
|
80
|
+
}),
|
|
81
|
+
...params.query,
|
|
82
|
+
enabled,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { SdkConfig } from '../../../types';
|
|
3
|
+
import {
|
|
4
|
+
collectionKeys,
|
|
5
|
+
type GetCollectionActiveOffersCurrenciesArgs,
|
|
6
|
+
type GetCollectionActiveOffersCurrenciesReturn,
|
|
7
|
+
getMarketplaceClient,
|
|
8
|
+
type QueryKeyArgs,
|
|
9
|
+
type ValuesOptional,
|
|
10
|
+
} from '../../_internal';
|
|
11
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
12
|
+
|
|
13
|
+
export interface FetchCollectionActiveOffersCurrenciesParams
|
|
14
|
+
extends Omit<
|
|
15
|
+
GetCollectionActiveOffersCurrenciesArgs,
|
|
16
|
+
'contractAddress' | 'chainId'
|
|
17
|
+
> {
|
|
18
|
+
collectionAddress: string;
|
|
19
|
+
chainId: number;
|
|
20
|
+
config: SdkConfig;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Fetches the active offers currencies for a collection from the marketplace API
|
|
25
|
+
*/
|
|
26
|
+
export async function fetchCollectionActiveOffersCurrencies(
|
|
27
|
+
params: FetchCollectionActiveOffersCurrenciesParams,
|
|
28
|
+
): Promise<GetCollectionActiveOffersCurrenciesReturn['currencies']> {
|
|
29
|
+
const { collectionAddress, chainId, config, ...additionalApiParams } = params;
|
|
30
|
+
|
|
31
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
32
|
+
|
|
33
|
+
const apiArgs: GetCollectionActiveOffersCurrenciesArgs = {
|
|
34
|
+
contractAddress: collectionAddress,
|
|
35
|
+
chainId: String(chainId),
|
|
36
|
+
...additionalApiParams,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const result =
|
|
40
|
+
await marketplaceClient.getCollectionActiveOffersCurrencies(apiArgs);
|
|
41
|
+
return result.currencies;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type CollectionActiveOffersCurrenciesQueryOptions =
|
|
45
|
+
ValuesOptional<FetchCollectionActiveOffersCurrenciesParams> & {
|
|
46
|
+
query?: StandardQueryOptions;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function getCollectionActiveOffersCurrenciesQueryKey(
|
|
50
|
+
params: CollectionActiveOffersCurrenciesQueryOptions,
|
|
51
|
+
) {
|
|
52
|
+
const apiArgs = {
|
|
53
|
+
chainId: String(params.chainId),
|
|
54
|
+
contractAddress: params.collectionAddress,
|
|
55
|
+
} satisfies QueryKeyArgs<GetCollectionActiveOffersCurrenciesArgs>;
|
|
56
|
+
|
|
57
|
+
return [...collectionKeys.activeOffersCurrencies, apiArgs] as const;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function collectionActiveOffersCurrenciesQueryOptions(
|
|
61
|
+
params: CollectionActiveOffersCurrenciesQueryOptions,
|
|
62
|
+
) {
|
|
63
|
+
const enabled = Boolean(
|
|
64
|
+
params.collectionAddress &&
|
|
65
|
+
params.chainId &&
|
|
66
|
+
params.config &&
|
|
67
|
+
(params.query?.enabled ?? true),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return queryOptions({
|
|
71
|
+
queryKey: getCollectionActiveOffersCurrenciesQueryKey(params),
|
|
72
|
+
queryFn: () =>
|
|
73
|
+
fetchCollectionActiveOffersCurrencies({
|
|
74
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
75
|
+
chainId: params.chainId!,
|
|
76
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
77
|
+
collectionAddress: params.collectionAddress!,
|
|
78
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
79
|
+
config: params.config!,
|
|
80
|
+
}),
|
|
81
|
+
...params.query,
|
|
82
|
+
enabled,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -15,7 +15,6 @@ export interface UseInventoryArgs {
|
|
|
15
15
|
accountAddress: Address;
|
|
16
16
|
collectionAddress: Address;
|
|
17
17
|
chainId: number;
|
|
18
|
-
isLaos721?: boolean;
|
|
19
18
|
includeNonTradable?: boolean;
|
|
20
19
|
query?: {
|
|
21
20
|
enabled?: boolean;
|
|
@@ -24,9 +23,7 @@ export interface UseInventoryArgs {
|
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
isLaos721: boolean;
|
|
29
|
-
}
|
|
26
|
+
type GetInventoryArgs = Omit<UseInventoryArgs, 'query'>;
|
|
30
27
|
|
|
31
28
|
interface CollectibleWithBalance {
|
|
32
29
|
metadata: {
|
|
@@ -77,7 +74,6 @@ async function fetchIndexerTokens(
|
|
|
77
74
|
accountAddress: Address,
|
|
78
75
|
collectionAddress: Address,
|
|
79
76
|
config: SdkConfig,
|
|
80
|
-
isLaos721: boolean,
|
|
81
77
|
): Promise<{ collectibles: CollectibleWithBalance[] }> {
|
|
82
78
|
const queryClient = getQueryClient();
|
|
83
79
|
const balances = await queryClient.fetchQuery(
|
|
@@ -86,7 +82,6 @@ async function fetchIndexerTokens(
|
|
|
86
82
|
collectionAddress,
|
|
87
83
|
userAddress: accountAddress,
|
|
88
84
|
chainId,
|
|
89
|
-
isLaos721,
|
|
90
85
|
includeMetadata: true,
|
|
91
86
|
},
|
|
92
87
|
config,
|
|
@@ -107,7 +102,7 @@ export async function fetchInventory(
|
|
|
107
102
|
config: SdkConfig,
|
|
108
103
|
page: Page,
|
|
109
104
|
): Promise<CollectiblesResponse> {
|
|
110
|
-
const { accountAddress, collectionAddress, chainId
|
|
105
|
+
const { accountAddress, collectionAddress, chainId } = args;
|
|
111
106
|
const marketplaceConfig = await fetchMarketplaceConfig({ config });
|
|
112
107
|
|
|
113
108
|
const marketCollections = marketplaceConfig?.market.collections || [];
|
|
@@ -125,7 +120,6 @@ export async function fetchInventory(
|
|
|
125
120
|
accountAddress,
|
|
126
121
|
collectionAddress,
|
|
127
122
|
config,
|
|
128
|
-
isLaos721,
|
|
129
123
|
);
|
|
130
124
|
|
|
131
125
|
return {
|
|
@@ -156,7 +150,6 @@ export function inventoryOptions(args: UseInventoryArgs, config: SdkConfig) {
|
|
|
156
150
|
fetchInventory(
|
|
157
151
|
{
|
|
158
152
|
...args,
|
|
159
|
-
isLaos721: args.isLaos721 ?? false,
|
|
160
153
|
},
|
|
161
154
|
config,
|
|
162
155
|
{
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
getMarketplaceClient,
|
|
8
8
|
getQueryClient,
|
|
9
9
|
type ListCurrenciesArgs,
|
|
10
|
+
OrderbookKind,
|
|
10
11
|
type QueryKeyArgs,
|
|
11
12
|
type ValuesOptional,
|
|
12
13
|
} from '../../_internal';
|
|
@@ -46,6 +47,11 @@ export async function fetchMarketCurrencies(
|
|
|
46
47
|
const marketplaceConfig = await queryClient.fetchQuery(
|
|
47
48
|
marketplaceConfigOptions(config),
|
|
48
49
|
);
|
|
50
|
+
const collection = marketplaceConfig.market.collections.find((collection) =>
|
|
51
|
+
compareAddress(collection.itemsAddress, collectionAddress),
|
|
52
|
+
);
|
|
53
|
+
const isOpensea =
|
|
54
|
+
collection?.destinationMarketplace === OrderbookKind.opensea;
|
|
49
55
|
|
|
50
56
|
const currenciesOptions = marketplaceConfig.market.collections.find(
|
|
51
57
|
(collection) =>
|
|
@@ -53,7 +59,8 @@ export async function fetchMarketCurrencies(
|
|
|
53
59
|
)?.currencyOptions;
|
|
54
60
|
|
|
55
61
|
// Filter currencies based on collection currency options
|
|
56
|
-
|
|
62
|
+
// Skip filtering for OpenSea as it uses API-based currency support flags
|
|
63
|
+
if (currenciesOptions && !isOpensea) {
|
|
57
64
|
currencies = currencies.filter((currency) =>
|
|
58
65
|
currenciesOptions.includes(currency.contractAddress),
|
|
59
66
|
);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { SdkConfig } from '../../../types';
|
|
3
|
+
import {
|
|
4
|
+
collectableKeys,
|
|
5
|
+
type GetPrimarySaleItemArgs,
|
|
6
|
+
getMarketplaceClient,
|
|
7
|
+
type QueryKeyArgs,
|
|
8
|
+
type ValuesOptional,
|
|
9
|
+
} from '../../_internal';
|
|
10
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
11
|
+
|
|
12
|
+
export interface FetchPrimarySaleItemParams
|
|
13
|
+
extends Omit<GetPrimarySaleItemArgs, 'chainId'> {
|
|
14
|
+
chainId: number;
|
|
15
|
+
config: SdkConfig;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Fetches a single primary sale item from the marketplace API
|
|
20
|
+
*/
|
|
21
|
+
export async function fetchPrimarySaleItem(params: FetchPrimarySaleItemParams) {
|
|
22
|
+
const { chainId, primarySaleContractAddress, tokenId, config } = params;
|
|
23
|
+
|
|
24
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
25
|
+
|
|
26
|
+
const apiArgs: GetPrimarySaleItemArgs = {
|
|
27
|
+
chainId: String(chainId),
|
|
28
|
+
primarySaleContractAddress,
|
|
29
|
+
tokenId,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const result = await marketplaceClient.getPrimarySaleItem(apiArgs);
|
|
33
|
+
return result.item;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type PrimarySaleItemQueryOptions =
|
|
37
|
+
ValuesOptional<FetchPrimarySaleItemParams> & {
|
|
38
|
+
query?: StandardQueryOptions;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export function getPrimarySaleItemQueryKey(
|
|
42
|
+
params: PrimarySaleItemQueryOptions,
|
|
43
|
+
) {
|
|
44
|
+
const apiArgs = {
|
|
45
|
+
chainId: String(params.chainId),
|
|
46
|
+
primarySaleContractAddress: params.primarySaleContractAddress,
|
|
47
|
+
tokenId: params.tokenId,
|
|
48
|
+
} satisfies QueryKeyArgs<GetPrimarySaleItemArgs>;
|
|
49
|
+
|
|
50
|
+
return [...collectableKeys.primarySaleItem, apiArgs] as const;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function primarySaleItemQueryOptions(
|
|
54
|
+
params: PrimarySaleItemQueryOptions,
|
|
55
|
+
) {
|
|
56
|
+
const enabled = Boolean(
|
|
57
|
+
params.chainId &&
|
|
58
|
+
params.primarySaleContractAddress &&
|
|
59
|
+
params.tokenId &&
|
|
60
|
+
params.config &&
|
|
61
|
+
(params.query?.enabled ?? true),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return queryOptions({
|
|
65
|
+
queryKey: getPrimarySaleItemQueryKey(params),
|
|
66
|
+
queryFn: () =>
|
|
67
|
+
fetchPrimarySaleItem({
|
|
68
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
69
|
+
chainId: params.chainId!,
|
|
70
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
71
|
+
primarySaleContractAddress: params.primarySaleContractAddress!,
|
|
72
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
73
|
+
tokenId: params.tokenId!,
|
|
74
|
+
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
75
|
+
config: params.config!,
|
|
76
|
+
}),
|
|
77
|
+
...params.query,
|
|
78
|
+
enabled,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { GetTokenBalancesReturn, Page } from '@0xsequence/indexer';
|
|
|
2
2
|
import { infiniteQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
import type { Address, Hex } from 'viem';
|
|
4
4
|
import type { SdkConfig } from '../../../types';
|
|
5
|
-
import { balanceQueries, getIndexerClient
|
|
5
|
+
import { balanceQueries, getIndexerClient } from '../../_internal';
|
|
6
6
|
|
|
7
7
|
export type UseListBalancesArgs = {
|
|
8
8
|
chainId: number;
|
|
@@ -17,7 +17,6 @@ export type UseListBalancesArgs = {
|
|
|
17
17
|
};
|
|
18
18
|
includeCollectionTokens?: boolean;
|
|
19
19
|
page?: Page;
|
|
20
|
-
isLaos721?: boolean;
|
|
21
20
|
//TODO: More options
|
|
22
21
|
query?: {
|
|
23
22
|
enabled?: boolean;
|
|
@@ -29,24 +28,6 @@ export async function fetchBalances(
|
|
|
29
28
|
config: SdkConfig,
|
|
30
29
|
page: Page,
|
|
31
30
|
): Promise<GetTokenBalancesReturn> {
|
|
32
|
-
if (args.isLaos721 && args.accountAddress) {
|
|
33
|
-
const laosClient = new LaosAPI();
|
|
34
|
-
return laosClient.getTokenBalances({
|
|
35
|
-
chainId: args.chainId.toString(),
|
|
36
|
-
accountAddress: args.accountAddress,
|
|
37
|
-
contractAddress: args.contractAddress as Address,
|
|
38
|
-
includeMetadata: args.includeMetadata,
|
|
39
|
-
page: {
|
|
40
|
-
sort: [
|
|
41
|
-
{
|
|
42
|
-
column: 'CREATED_AT',
|
|
43
|
-
order: 'DESC',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
31
|
const indexerClient = getIndexerClient(args.chainId, config);
|
|
51
32
|
return indexerClient.getTokenBalances({
|
|
52
33
|
...args,
|
|
@@ -64,7 +45,6 @@ export function getListBalancesQueryKey(args: UseListBalancesArgs) {
|
|
|
64
45
|
includeMetadata: args.includeMetadata,
|
|
65
46
|
metadataOptions: args.metadataOptions,
|
|
66
47
|
includeCollectionTokens: args.includeCollectionTokens,
|
|
67
|
-
isLaos721: args.isLaos721,
|
|
68
48
|
};
|
|
69
49
|
|
|
70
50
|
return [...balanceQueries.lists, apiArgs] as const;
|