@0xsequence/marketplace-sdk 1.1.0 → 1.1.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/.changeset/honest-peas-arrive.md +5 -0
- package/.changeset/real-tips-stick.md +8 -0
- package/.changeset/tall-pandas-wear.md +8 -0
- package/CHANGELOG.md +24 -2
- package/dist/{BellIcon-IpHHEy8h.js → BellIcon-ByhygxBO.js} +2 -2
- package/dist/{BellIcon-IpHHEy8h.js.map → BellIcon-ByhygxBO.js.map} +1 -1
- package/dist/{CartIcon-C8zbor8H.js → CartIcon-Bt3rQYGk.js} +3 -3
- package/dist/{CartIcon-C8zbor8H.js.map → CartIcon-Bt3rQYGk.js.map} +1 -1
- package/dist/CollectibleCard-CVpdgXA8.d.ts +8 -0
- package/dist/_internal-DkS2VUn5.js.map +1 -1
- package/dist/abi-fa-o9gH3.js +134 -0
- package/dist/abi-fa-o9gH3.js.map +1 -0
- package/dist/{alien_swap-BTJ7mSR-.js → alien_swap-DoY6XfMA.js} +1 -1
- package/dist/{alien_swap-BTJ7mSR-.js.map → alien_swap-DoY6XfMA.js.map} +1 -1
- package/dist/{api-DuLKn__v.js → api-BoO0V5aJ.js} +8 -3
- package/dist/api-BoO0V5aJ.js.map +1 -0
- package/dist/{aqua-xyz-BYJ9WSP_.js → aqua-xyz-BBDxnG14.js} +1 -1
- package/dist/{aqua-xyz-BYJ9WSP_.js.map → aqua-xyz-BBDxnG14.js.map} +1 -1
- package/dist/{aura-D7SUjgro.js → aura-DGx2zwvF.js} +1 -1
- package/dist/{aura-D7SUjgro.js.map → aura-DGx2zwvF.js.map} +1 -1
- package/dist/{blur-BcnRFCaV.js → blur-D8GKrRrq.js} +1 -1
- package/dist/{blur-BcnRFCaV.js.map → blur-D8GKrRrq.js.map} +1 -1
- package/dist/{coinbase-ChoX9Hw2.js → coinbase-DOry4PXY.js} +1 -1
- package/dist/{coinbase-ChoX9Hw2.js.map → coinbase-DOry4PXY.js.map} +1 -1
- package/dist/collectibles-C_H8jMGH.js +358 -0
- package/dist/collectibles-C_H8jMGH.js.map +1 -0
- package/dist/collections-CKummc-R.js +249 -0
- package/dist/collections-CKummc-R.js.map +1 -0
- package/dist/{components-CUv-wQr8.js → components-CosnX7F9.js} +5 -5
- package/dist/{components-CUv-wQr8.js.map → components-CosnX7F9.js.map} +1 -1
- package/dist/{contracts-D72LBOX3.js → contracts-BP_0vX48.js} +3 -3
- package/dist/{contracts-D72LBOX3.js.map → contracts-BP_0vX48.js.map} +1 -1
- package/dist/{create-config-DV_dtaLt.d.ts → create-config-ZOB7i4ZJ.d.ts} +117 -12
- package/dist/{element-Dbcv5qya.js → element-ciybd_VF.js} +1 -1
- package/dist/{element-Dbcv5qya.js.map → element-ciybd_VF.js.map} +1 -1
- package/dist/filters-V-V8Dn8f.d.ts +60 -0
- package/dist/{foundation-QPhUEUy8.js → foundation-Bq4lRz4x.js} +1 -1
- package/dist/{foundation-QPhUEUy8.js.map → foundation-Bq4lRz4x.js.map} +1 -1
- package/dist/index-BOiHR01C.d.ts +106 -0
- package/dist/index-BZIJTQT0.d.ts +121 -0
- package/dist/index-BeRV-7AX.d.ts +55 -0
- package/dist/{index-BaytncQc.d.ts → index-Bsx6XsC2.d.ts} +58 -55
- package/dist/{index-jGgfEHfQ.d.ts → index-BtWMBHeP.d.ts} +13 -9
- package/dist/{index-CT8ZorFd.d.ts → index-Bxzjy0d1.d.ts} +1 -1
- package/dist/{index-B6aSbaw2.d.ts → index-C-745li7.d.ts} +1 -1
- package/dist/{index-BoNNplSx.d.ts → index-C4MUKshG.d.ts} +2 -2
- package/dist/{index-DMBMM16q.d.ts → index-CPzvNmq9.d.ts} +35 -35
- package/dist/{index-D-UXGo5d.d.ts → index-CS65jqOq.d.ts} +2 -2
- package/dist/index-CZUtOTjh.d.ts +1 -0
- package/dist/index-CnEbXm_t.d.ts +130 -0
- package/dist/{index-CQecU53t.d.ts → index-CxA34wP1.d.ts} +32 -23
- package/dist/{index-C768pAfu.d.ts → index-CxpFwGvR.d.ts} +3 -3
- package/dist/{index-Bv5XVLjH.d.ts → index-D9LPlmbC.d.ts} +1 -1
- package/dist/{index-DJG0kiII.d.ts → index-DFEnA6Wa.d.ts} +28 -17
- package/dist/{index-B8vaT3_s.d.ts → index-DNNUeZEq.d.ts} +4 -4
- package/dist/{index-CXscCUg7.d.ts → index-DUXfvhxs.d.ts} +12 -12
- package/dist/index-DW3njUfb.d.ts +1 -0
- package/dist/{index-CMPUveNz.d.ts → index-DWt6yrIG.d.ts} +7 -7
- package/dist/index-DewGsFz5.d.ts +1 -0
- package/dist/{index-DLUjc7Bx.d.ts → index-DmudgrsN.d.ts} +191 -12
- package/dist/{index-DpeWm_vF.d.ts → index-DqXd1EeB.d.ts} +5 -5
- package/dist/{index-CM0ZTePs.d.ts → index-DwKr18CI.d.ts} +1 -1
- package/dist/{index-D6YMj82n.d.ts → index-NlPMNcqh.d.ts} +100 -100
- package/dist/index-Stm5u0I0.d.ts +53 -0
- package/dist/index-U-zp70of.d.ts +74 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +8 -8
- package/dist/inventory-Dd7TazvZ.js +72 -0
- package/dist/inventory-Dd7TazvZ.js.map +1 -0
- package/dist/listBalances-BxpxBCvn.js +57 -0
- package/dist/listBalances-BxpxBCvn.js.map +1 -0
- package/dist/listCollectiblesPaginated-Cy2_qEZA.d.ts +327 -0
- package/dist/{listCollections-dTCq00l5.d.ts → listCollections-BB9FxKj2.d.ts} +193 -111
- package/dist/{looks-rare-C7cQztTR.js → looks-rare-6H--x3AM.js} +1 -1
- package/dist/{looks-rare-C7cQztTR.js.map → looks-rare-6H--x3AM.js.map} +1 -1
- package/dist/lowestListing-Cbsi6M1K.d.ts +465 -0
- package/dist/{magic-eden-D3r7jiBG.js → magic-eden-BoxEQ1Li.js} +1 -1
- package/dist/{magic-eden-D3r7jiBG.js.map → magic-eden-BoxEQ1Li.js.map} +1 -1
- package/dist/{manifold-DsX0CBP-.js → manifold-DycKsljb.js} +1 -1
- package/dist/{manifold-DsX0CBP-.js.map → manifold-DycKsljb.js.map} +1 -1
- package/dist/market-C3HV-awQ.js +209 -0
- package/dist/market-C3HV-awQ.js.map +1 -0
- package/dist/{marketCurrencies-Bzj8X4TL.d.ts → marketCurrencies-Bpw1bIO0.d.ts} +46 -15
- package/dist/marketCurrencies-sKrTX0og.js +53 -0
- package/dist/marketCurrencies-sKrTX0og.js.map +1 -0
- package/dist/{marketplace-BYY8OloA.js → marketplace-NQB-sEQL.js} +1 -1
- package/dist/{marketplace-BYY8OloA.js.map → marketplace-NQB-sEQL.js.map} +1 -1
- package/dist/{marketplace-logos-Csv2MBwf.js → marketplace-logos-D4dS1Foy.js} +21 -21
- package/dist/{marketplace-logos-Csv2MBwf.js.map → marketplace-logos-D4dS1Foy.js.map} +1 -1
- package/dist/{marketplace.gen-w2YvbEEo.js → marketplace.gen-ksUafDqS.js} +56 -5
- package/dist/marketplace.gen-ksUafDqS.js.map +1 -0
- package/dist/{marketplaceConfig-BTy75Mbf.js → marketplaceConfig-UHQMM9fq.js} +3 -3
- package/dist/marketplaceConfig-UHQMM9fq.js.map +1 -0
- package/dist/{mintify-DiOoDmO1.js → mintify-Dyqyo8jQ.js} +1 -1
- package/dist/{mintify-DiOoDmO1.js.map → mintify-Dyqyo8jQ.js.map} +1 -1
- package/dist/{nftx-CP82jNra.js → nftx-2LbFjj9Q.js} +1 -1
- package/dist/{nftx-CP82jNra.js.map → nftx-2LbFjj9Q.js.map} +1 -1
- package/dist/{okx-p9-4xRjs.js → okx-CBEWJNsR.js} +1 -1
- package/dist/{okx-p9-4xRjs.js.map → okx-CBEWJNsR.js.map} +1 -1
- package/dist/{open-sea-D2GwAmKS.js → open-sea-Dxntz_PA.js} +1 -1
- package/dist/{open-sea-D2GwAmKS.js.map → open-sea-Dxntz_PA.js.map} +1 -1
- package/dist/orders-DnFfZAXV.js +462 -0
- package/dist/orders-DnFfZAXV.js.map +1 -0
- package/dist/{primary-sale-DOmNDq2P.js → primary-sale-1u4QlPdA.js} +1 -1
- package/dist/{primary-sale-DOmNDq2P.js.map → primary-sale-1u4QlPdA.js.map} +1 -1
- package/dist/primary-sales-Dmsi6bqj.js +114 -0
- package/dist/primary-sales-Dmsi6bqj.js.map +1 -0
- package/dist/{query-BG-MA1MB.d.ts → query-BWbCsXLY.d.ts} +1 -1
- package/dist/{rarible-DqiiW9ki.js → rarible-CS0SupHr.js} +1 -1
- package/dist/{rarible-DqiiW9ki.js.map → rarible-CS0SupHr.js.map} +1 -1
- package/dist/react/_internal/api/index.d.ts +2 -2
- package/dist/react/_internal/api/index.js +3 -3
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +28 -17
- package/dist/react/_internal/index.d.ts +2 -2
- package/dist/react/_internal/index.js +3 -3
- package/dist/react/_internal/wagmi/index.d.ts +1 -1
- package/dist/react/hooks/config/index.d.ts +8 -8
- package/dist/react/hooks/config/index.js +28 -17
- package/dist/react/hooks/contracts/index.d.ts +6 -6
- package/dist/react/hooks/contracts/index.js +7 -7
- package/dist/react/hooks/data/collectibles/index.d.ts +10 -4
- package/dist/react/hooks/data/collectibles/index.js +28 -17
- package/dist/react/hooks/data/collections/index.d.ts +10 -10
- package/dist/react/hooks/data/collections/index.js +28 -17
- package/dist/react/hooks/data/index.d.ts +37 -29
- package/dist/react/hooks/data/index.js +29 -18
- package/dist/react/hooks/data/inventory/index.d.ts +36 -28
- package/dist/react/hooks/data/inventory/index.js +28 -17
- package/dist/react/hooks/data/market/index.d.ts +11 -5
- package/dist/react/hooks/data/market/index.js +28 -17
- package/dist/react/hooks/data/orders/index.d.ts +11 -5
- package/dist/react/hooks/data/orders/index.js +29 -18
- package/dist/react/hooks/data/primary-sales/index.d.ts +36 -28
- package/dist/react/hooks/data/primary-sales/index.js +28 -17
- package/dist/react/hooks/data/tokens/index.d.ts +4 -4
- package/dist/react/hooks/data/tokens/index.js +28 -17
- package/dist/react/hooks/index.d.ts +37 -29
- package/dist/react/hooks/index.js +29 -18
- package/dist/react/hooks/transactions/index.d.ts +2 -2
- package/dist/react/hooks/transactions/index.js +28 -17
- package/dist/react/hooks/ui/index.d.ts +4 -4
- package/dist/react/hooks/ui/index.js +28 -17
- package/dist/react/hooks/utils/index.d.ts +36 -28
- package/dist/react/hooks/utils/index.js +28 -17
- package/dist/react/index.d.ts +37 -29
- package/dist/react/index.js +29 -18
- package/dist/react/queries/collectibles/index.d.ts +11 -0
- package/dist/react/queries/collectibles/index.js +23 -0
- package/dist/react/queries/collections/index.d.ts +11 -0
- package/dist/react/queries/collections/index.js +20 -0
- package/dist/react/queries/index.d.ts +24 -16
- package/dist/react/queries/index.js +22 -11
- package/dist/react/queries/inventory/index.d.ts +3 -0
- package/dist/react/queries/inventory/index.js +22 -0
- package/dist/react/queries/market/index.d.ts +6 -0
- package/dist/react/queries/market/index.js +22 -0
- package/dist/react/queries/orders/index.d.ts +11 -0
- package/dist/react/queries/orders/index.js +13 -0
- package/dist/react/queries/primary-sales/index.d.ts +4 -0
- package/dist/react/queries/primary-sales/index.js +13 -0
- package/dist/react/queries/tokens/index.d.ts +5 -0
- package/dist/react/queries/tokens/index.js +14 -0
- package/dist/react/queries/utils/index.d.ts +4 -0
- package/dist/react/queries/utils/index.js +22 -0
- package/dist/react/ssr/index.d.ts +7 -7
- package/dist/react/ssr/index.js +3 -3
- 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 +11 -11
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +5 -5
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +28 -17
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +4 -4
- package/dist/react/ui/components/marketplace-collectible-card/index.js +28 -17
- 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 +3 -3
- 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 +9 -9
- package/dist/react/ui/index.d.ts +4 -4
- package/dist/react/ui/index.js +28 -17
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +28 -17
- package/dist/react/utils/index.d.ts +3 -3
- package/dist/react/utils/index.js +3 -3
- package/dist/{react-BLJ4DkPx.js → react-DE852KeT.js} +1365 -172
- package/dist/react-DE852KeT.js.map +1 -0
- package/dist/{sequence-Bbb-TFKg.js → sequence-paCCener.js} +1 -1
- package/dist/{sequence-Bbb-TFKg.js.map → sequence-paCCener.js.map} +1 -1
- package/dist/styles/index.css +154 -0
- package/dist/{sudo-swap-CEPIM3Js.js → sudo-swap-9rH2EgfT.js} +1 -1
- package/dist/{sudo-swap-CEPIM3Js.js.map → sudo-swap-9rH2EgfT.js.map} +1 -1
- package/dist/{super-rare-CMEn9PoO.js → super-rare-DHIuWtRw.js} +1 -1
- package/dist/{super-rare-CMEn9PoO.js.map → super-rare-DHIuWtRw.js.map} +1 -1
- package/dist/{token-CcyLz8Z8.js → token-Cv7l2ZaL.js} +1 -1
- package/dist/{token-CcyLz8Z8.js.map → token-Cv7l2ZaL.js.map} +1 -1
- package/dist/tokenBalances-ibDerNmM.js +63 -0
- package/dist/tokenBalances-ibDerNmM.js.map +1 -0
- package/dist/tokenSupplies-Bfe8RHzI.d.ts +272 -0
- package/dist/tokens-cGxMadd8.js +194 -0
- package/dist/tokens-cGxMadd8.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/{types-D6LkVrF0.d.ts → types-D2TJ1dwv.d.ts} +3 -2
- package/dist/utils/abi/index.d.ts +5 -5
- package/dist/utils/abi/index.js +5 -5
- 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 +8 -8
- package/dist/utils-BCgNhBFR.js +112 -0
- package/dist/utils-BCgNhBFR.js.map +1 -0
- package/dist/{utils-BZEkdqWK.js → utils-BfpDVibN.js} +3 -3
- package/dist/{utils-BZEkdqWK.js.map → utils-BfpDVibN.js.map} +1 -1
- package/dist/{utils-oVZxdK0o.js → utils-BqxcalL2.js} +2 -2
- package/dist/{utils-oVZxdK0o.js.map → utils-BqxcalL2.js.map} +1 -1
- package/dist/waitForTransactionReceipt-DieAnV52.js +25 -0
- package/dist/waitForTransactionReceipt-DieAnV52.js.map +1 -0
- package/dist/{x2y2-DNe6JgtG.js → x2y2-45WDooeh.js} +1 -1
- package/dist/{x2y2-DNe6JgtG.js.map → x2y2-45WDooeh.js.map} +1 -1
- package/dist/{zora-w0Zqxxs4.js → zora-CbeBoLvQ.js} +1 -1
- package/dist/{zora-w0Zqxxs4.js.map → zora-CbeBoLvQ.js.map} +1 -1
- package/package.json +10 -5
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +2 -0
- package/src/react/_internal/api/marketplace.gen.ts +1730 -2383
- package/src/react/_internal/api/query-keys.ts +14 -0
- package/src/react/_internal/api/services.ts +1 -1
- package/src/react/_internal/databeat/types.ts +1 -0
- package/src/react/_internal/types.ts +14 -0
- package/src/react/_internal/utils.ts +3 -0
- package/src/react/hooks/config/useMarketplaceConfig.tsx +1 -1
- package/src/react/hooks/data/collectibles/useBalanceOfCollectible.tsx +1 -1
- package/src/react/hooks/data/collectibles/useCollectible.tsx +1 -1
- package/src/react/hooks/data/collectibles/useCountOfCollectables.tsx +1 -1
- package/src/react/hooks/data/collectibles/useListCollectibleActivities.tsx +1 -1
- package/src/react/hooks/data/collectibles/useListCollectibles.tsx +1 -1
- package/src/react/hooks/data/collectibles/useListCollectiblesPaginated.tsx +1 -1
- package/src/react/hooks/data/collectibles/useTokenBalances.tsx +1 -1
- package/src/react/hooks/data/collections/useCollection.tsx +1 -1
- package/src/react/hooks/data/collections/useCollectionBalanceDetails.tsx +1 -1
- package/src/react/hooks/data/collections/useCollectionDetails.ts +1 -1
- package/src/react/hooks/data/collections/useListCollectionActivities.tsx +1 -1
- package/src/react/hooks/data/collections/useListCollections.tsx +1 -1
- package/src/react/hooks/data/inventory/useInventory.tsx +1 -1
- package/src/react/hooks/data/market/useCurrency.tsx +1 -1
- package/src/react/hooks/data/market/useListMarketCardData.tsx +7 -0
- package/src/react/hooks/data/market/useMarketCurrencies.tsx +1 -1
- package/src/react/hooks/data/orders/index.ts +4 -0
- package/src/react/hooks/data/orders/useCountItemsOrdersForCollection.tsx +90 -0
- package/src/react/hooks/data/orders/useCountListingsForCollectible.tsx +1 -1
- package/src/react/hooks/data/orders/useCountOffersForCollectible.tsx +1 -1
- package/src/react/hooks/data/orders/useFloorOrder.tsx +1 -1
- package/src/react/hooks/data/orders/useGetCountOfFilteredOrders.tsx +39 -0
- package/src/react/hooks/data/orders/useHighestOffer.tsx +1 -1
- package/src/react/hooks/data/orders/useListItemsOrdersForCollection.tsx +93 -0
- package/src/react/hooks/data/orders/useListItemsOrdersForCollectionPaginated.tsx +108 -0
- package/src/react/hooks/data/orders/useListListingsForCollectible.tsx +1 -1
- package/src/react/hooks/data/orders/useListOffersForCollectible.tsx +1 -1
- package/src/react/hooks/data/orders/useLowestListing.tsx +1 -1
- package/src/react/hooks/data/primary-sales/useGetCountOfPrimarySaleItems.tsx +2 -2
- package/src/react/hooks/data/primary-sales/useListPrimarySaleItems.tsx +1 -1
- package/src/react/hooks/data/tokens/useGetTokenRanges.tsx +2 -2
- package/src/react/hooks/data/tokens/useListBalances.tsx +2 -2
- package/src/react/hooks/data/tokens/useListTokenMetadata.tsx +1 -1
- package/src/react/hooks/data/tokens/useSearchTokenMetadata.tsx +1 -1
- package/src/react/hooks/data/tokens/useTokenSupplies.ts +1 -1
- package/src/react/hooks/transactions/useGenerateCancelTransaction.test.tsx +1 -0
- package/src/react/hooks/transactions/useGenerateListingTransaction.test.tsx +13 -0
- package/src/react/hooks/transactions/useGenerateOfferTransaction.test.tsx +1 -0
- package/src/react/hooks/transactions/useGenerateSellTransaction.test.tsx +6 -0
- package/src/react/hooks/ui/useFilterState.tsx +72 -2
- package/src/react/hooks/ui/useFilters.tsx +1 -1
- package/src/react/hooks/utils/useCheckoutOptions.tsx +2 -2
- package/src/react/hooks/utils/useCheckoutOptionsSalesContract.tsx +1 -1
- package/src/react/hooks/utils/useComparePrices.tsx +1 -1
- package/src/react/hooks/utils/useConvertPriceToUSD.tsx +1 -1
- package/src/react/providers/analytics-provider.tsx +45 -0
- package/src/react/providers/index.tsx +30 -41
- package/src/react/providers/modal-provider.tsx +13 -2
- package/src/react/queries/{__tests__ → collectibles/__tests__}/balanceOfCollectible.laos.test.ts +1 -1
- package/src/react/queries/{__tests__ → collectibles/__tests__}/tokenBalances.laos.test.ts +1 -1
- package/src/react/queries/{balanceOfCollectible.ts → collectibles/balanceOfCollectible.ts} +24 -3
- package/src/react/queries/{collectible.ts → collectibles/collectible.ts} +20 -5
- package/src/react/queries/{countOfCollectables.ts → collectibles/countOfCollectables.ts} +32 -6
- package/src/react/queries/collectibles/index.ts +7 -0
- package/src/react/queries/{listCollectibleActivities.ts → collectibles/listCollectibleActivities.ts} +29 -5
- package/src/react/queries/{listCollectibles.ts → collectibles/listCollectibles.ts} +28 -9
- package/src/react/queries/{listCollectiblesPaginated.ts → collectibles/listCollectiblesPaginated.ts} +22 -5
- package/src/react/queries/{tokenBalances.ts → collectibles/tokenBalances.ts} +21 -3
- package/src/react/queries/{collection.ts → collections/collection.ts} +19 -5
- package/src/react/queries/{collectionBalanceDetails.ts → collections/collectionBalanceDetails.ts} +19 -4
- package/src/react/queries/{collectionDetails.ts → collections/collectionDetails.ts} +21 -6
- package/src/react/queries/collections/index.ts +5 -0
- package/src/react/queries/{listCollectionActivities.ts → collections/listCollectionActivities.ts} +28 -6
- package/src/react/queries/{listCollections.ts → collections/listCollections.ts} +17 -6
- package/src/react/queries/index.ts +7 -34
- package/src/react/queries/{__tests__ → inventory/__tests__}/inventory.laos.test.ts +4 -4
- package/src/react/queries/inventory/index.ts +1 -0
- package/src/react/queries/{inventory.ts → inventory/inventory.ts} +11 -5
- package/src/react/queries/{checkoutOptions.ts → market/checkoutOptions.ts} +28 -6
- package/src/react/queries/{checkoutOptionsSalesContract.ts → market/checkoutOptionsSalesContract.ts} +24 -5
- package/src/react/queries/{currency.ts → market/currency.ts} +13 -4
- package/src/react/queries/{filters.ts → market/filters.ts} +25 -6
- package/src/react/queries/market/index.ts +6 -0
- package/src/react/queries/{marketCurrencies.ts → market/marketCurrencies.ts} +24 -5
- package/src/react/queries/{marketplaceConfig.ts → market/marketplaceConfig.ts} +5 -5
- package/src/react/queries/orders/countItemsOrdersForCollection.ts +86 -0
- package/src/react/queries/{countListingsForCollectible.ts → orders/countListingsForCollectible.ts} +23 -6
- package/src/react/queries/{countOffersForCollectible.ts → orders/countOffersForCollectible.ts} +23 -6
- package/src/react/queries/{floorOrder.ts → orders/floorOrder.ts} +15 -4
- package/src/react/queries/orders/getCountOfFilteredOrders.ts +88 -0
- package/src/react/queries/{highestOffer.ts → orders/highestOffer.ts} +16 -4
- package/src/react/queries/orders/index.ts +11 -0
- package/src/react/queries/orders/listItemsOrdersForCollection.ts +90 -0
- package/src/react/queries/orders/listItemsOrdersForCollectionPaginated.ts +90 -0
- package/src/react/queries/{listListingsForCollectible.ts → orders/listListingsForCollectible.ts} +20 -5
- package/src/react/queries/{listOffersForCollectible.ts → orders/listOffersForCollectible.ts} +20 -5
- package/src/react/queries/{lowestListing.ts → orders/lowestListing.ts} +16 -4
- package/src/react/queries/{countOfPrimarySaleItems.ts → primary-sales/countOfPrimarySaleItems.ts} +17 -3
- package/src/react/queries/primary-sales/index.ts +3 -0
- package/src/react/queries/{primarySaleItems.ts → primary-sales/primarySaleItems.ts} +18 -4
- package/src/react/queries/{primarySaleItemsCount.ts → primary-sales/primarySaleItemsCount.ts} +19 -4
- package/src/react/queries/{getTokenRanges.ts → tokens/getTokenRanges.ts} +17 -4
- package/src/react/queries/tokens/index.ts +5 -0
- package/src/react/queries/{listBalances.ts → tokens/listBalances.ts} +18 -3
- package/src/react/queries/{listTokenMetadata.ts → tokens/listTokenMetadata.ts} +18 -4
- package/src/react/queries/{searchTokenMetadata.ts → tokens/searchTokenMetadata.ts} +18 -4
- package/src/react/queries/{tokenSupplies.ts → tokens/tokenSupplies.ts} +16 -4
- package/src/react/queries/{comparePrices.ts → utils/comparePrices.ts} +16 -4
- package/src/react/queries/{convertPriceToUSD.ts → utils/convertPriceToUSD.ts} +18 -5
- package/src/react/queries/utils/index.ts +2 -0
- package/src/react/ssr/create-ssr-client.ts +1 -1
- package/src/react/ui/components/_internals/ErrorLogBox.tsx +85 -0
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +4 -0
- package/src/react/ui/components/_internals/action-button/components/NonOwnerActions.tsx +4 -0
- package/src/react/ui/components/marketplace-collectible-card/components/ActionButtonWrapper.tsx +3 -0
- package/src/react/ui/components/marketplace-collectible-card/types.ts +1 -0
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +3 -0
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +2 -0
- package/src/react/ui/modals/BuyModal/components/ERC1155BuyModal.tsx +65 -3
- package/src/react/ui/modals/BuyModal/components/ERC721BuyModal.tsx +31 -0
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC721SalePaymentParams.test.tsx +20 -1
- package/src/react/ui/modals/BuyModal/hooks/useERC1155Checkout.ts +7 -2
- package/src/react/ui/modals/BuyModal/hooks/useERC721SalePaymentParams.ts +12 -3
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +11 -2
- package/src/react/ui/modals/BuyModal/store.ts +3 -0
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +63 -24
- package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +4 -0
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +18 -12
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +4 -1
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +1 -0
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +55 -8
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +10 -0
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +4 -1
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +15 -26
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +1 -0
- package/src/react/ui/modals/SellModal/Modal.tsx +21 -3
- package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +2 -0
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +3 -1
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +13 -7
- package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +9 -0
- package/src/react/ui/modals/_internal/components/calendarDropdown/TimeSelector.tsx +105 -0
- package/src/react/ui/modals/_internal/components/calendarDropdown/index.tsx +45 -12
- package/src/react/ui/modals/_internal/components/calendarDropdown/overrides.css +39 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +31 -10
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +18 -9
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +51 -1
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +58 -10
- package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +481 -0
- package/src/react/utils/waitForTransactionReceipt.ts +26 -32
- package/src/styles/index.css +1 -0
- package/src/styles/styles.ts +155 -1
- package/src/types/index.ts +1 -1
- package/src/utils/abi/index.ts +1 -0
- package/src/utils/abi/mainModule.ts +158 -0
- package/dist/CollectibleCard-C2EWF0zo.d.ts +0 -8
- package/dist/api-DuLKn__v.js.map +0 -1
- package/dist/filters-zkMJaPey.d.ts +0 -31
- package/dist/index-Yobo6icm.d.ts +0 -234
- package/dist/listCollectiblesPaginated-Bq0QSOjJ.d.ts +0 -168
- package/dist/lowestListing-CB5Te-Q9.d.ts +0 -168
- package/dist/marketplace.gen-w2YvbEEo.js.map +0 -1
- package/dist/marketplaceConfig-BTy75Mbf.js.map +0 -1
- package/dist/queries-EMA5CcwY.js +0 -1399
- package/dist/queries-EMA5CcwY.js.map +0 -1
- package/dist/react-BLJ4DkPx.js.map +0 -1
- package/dist/react-F03jPjPk.css +0 -80
- package/dist/react-F03jPjPk.css.map +0 -1
- package/dist/tokenSupplies-C470zTT0.d.ts +0 -147
- package/dist/waitForTransactionReceipt-B08YZiDY.js +0 -26
- package/dist/waitForTransactionReceipt-B08YZiDY.js.map +0 -1
- /package/dist/{index-Cg5cFzs-.d.ts → index-6wsMChsg.d.ts} +0 -0
- /package/dist/{abi-DYsUABe6.js → queries-KOcILNJO.js} +0 -0
package/src/react/queries/{__tests__ → collectibles/__tests__}/balanceOfCollectible.laos.test.ts
RENAMED
|
@@ -3,7 +3,7 @@ import { afterEach, describe, expect, it } from 'vitest';
|
|
|
3
3
|
import {
|
|
4
4
|
laosHandlers,
|
|
5
5
|
mockTokenBalancesResponse,
|
|
6
|
-
} from '
|
|
6
|
+
} from '../../../_internal/api/__mocks__/laos.msw';
|
|
7
7
|
import { fetchBalanceOfCollectible } from '../balanceOfCollectible';
|
|
8
8
|
|
|
9
9
|
describe('fetchBalanceOfCollectible with LAOS', () => {
|
|
@@ -3,7 +3,7 @@ import { afterEach, describe, expect, it } from 'vitest';
|
|
|
3
3
|
import {
|
|
4
4
|
laosHandlers,
|
|
5
5
|
mockTokenBalancesResponse,
|
|
6
|
-
} from '
|
|
6
|
+
} from '../../../_internal/api/__mocks__/laos.msw';
|
|
7
7
|
import { fetchTokenBalances } from '../tokenBalances';
|
|
8
8
|
|
|
9
9
|
describe('fetchTokenBalances with LAOS', () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { queryOptions, skipToken } from '@tanstack/react-query';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
3
|
import type { UseQueryParameters } from 'wagmi/query';
|
|
4
|
-
import type { SdkConfig } from '
|
|
5
|
-
import { collectableKeys, getIndexerClient, LaosAPI } from '
|
|
4
|
+
import type { SdkConfig } from '../../../types';
|
|
5
|
+
import { collectableKeys, getIndexerClient, LaosAPI } from '../../_internal';
|
|
6
6
|
|
|
7
7
|
export type UseBalanceOfCollectibleArgs = {
|
|
8
8
|
collectionAddress: Address;
|
|
@@ -54,6 +54,27 @@ export async function fetchBalanceOfCollectible(
|
|
|
54
54
|
.then((res) => res.balances[0] || null);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
export function getBalanceOfCollectibleQueryKey(
|
|
58
|
+
args: UseBalanceOfCollectibleArgs,
|
|
59
|
+
) {
|
|
60
|
+
const apiArgs = {
|
|
61
|
+
chainId: args.chainId,
|
|
62
|
+
accountAddress: args.userAddress,
|
|
63
|
+
contractAddress: args.collectionAddress,
|
|
64
|
+
tokenID: args.collectableId,
|
|
65
|
+
includeMetadata: args.includeMetadata,
|
|
66
|
+
metadataOptions: args.userAddress
|
|
67
|
+
? {
|
|
68
|
+
verifiedOnly: true,
|
|
69
|
+
includeContracts: [args.collectionAddress],
|
|
70
|
+
}
|
|
71
|
+
: undefined,
|
|
72
|
+
isLaos721: args.isLaos721,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return [...collectableKeys.userBalances, apiArgs] as const;
|
|
76
|
+
}
|
|
77
|
+
|
|
57
78
|
/**
|
|
58
79
|
* Creates a tanstack query options object for the balance query
|
|
59
80
|
*
|
|
@@ -67,7 +88,7 @@ export function balanceOfCollectibleOptions(
|
|
|
67
88
|
) {
|
|
68
89
|
const enabled = !!args.userAddress && (args.query?.enabled ?? true);
|
|
69
90
|
return queryOptions({
|
|
70
|
-
queryKey:
|
|
91
|
+
queryKey: getBalanceOfCollectibleQueryKey(args),
|
|
71
92
|
queryFn: enabled
|
|
72
93
|
? () =>
|
|
73
94
|
fetchBalanceOfCollectible(
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { GetTokenMetadataArgs } from '@0xsequence/metadata';
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
|
-
import type { SdkConfig } from '
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import type { SdkConfig } from '../../../types';
|
|
4
|
+
import {
|
|
5
|
+
getMetadataClient,
|
|
6
|
+
type QueryKeyArgs,
|
|
7
|
+
type ValuesOptional,
|
|
8
|
+
} from '../../_internal';
|
|
9
|
+
import { collectableKeys } from '../../_internal/api/query-keys';
|
|
10
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
7
11
|
|
|
8
12
|
export interface FetchCollectibleParams
|
|
9
13
|
extends Omit<
|
|
@@ -38,6 +42,17 @@ export type CollectibleQueryOptions = ValuesOptional<FetchCollectibleParams> & {
|
|
|
38
42
|
query?: StandardQueryOptions;
|
|
39
43
|
};
|
|
40
44
|
|
|
45
|
+
export function getCollectibleQueryKey(params: CollectibleQueryOptions) {
|
|
46
|
+
const apiArgs = {
|
|
47
|
+
chainID: String(params.chainId),
|
|
48
|
+
contractAddress: params.collectionAddress,
|
|
49
|
+
// biome-ignore lint/style/noNonNullAssertion: Dont need to validate here
|
|
50
|
+
tokenIDs: [params.collectibleId!],
|
|
51
|
+
} satisfies QueryKeyArgs<GetTokenMetadataArgs>;
|
|
52
|
+
|
|
53
|
+
return [...collectableKeys.details, apiArgs] as const;
|
|
54
|
+
}
|
|
55
|
+
|
|
41
56
|
export function collectibleQueryOptions(params: CollectibleQueryOptions) {
|
|
42
57
|
const enabled = Boolean(
|
|
43
58
|
params.collectionAddress &&
|
|
@@ -48,7 +63,7 @@ export function collectibleQueryOptions(params: CollectibleQueryOptions) {
|
|
|
48
63
|
);
|
|
49
64
|
|
|
50
65
|
return queryOptions({
|
|
51
|
-
queryKey:
|
|
66
|
+
queryKey: getCollectibleQueryKey(params),
|
|
52
67
|
queryFn: () =>
|
|
53
68
|
fetchCollectible({
|
|
54
69
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
-
import type { SdkConfig } from '
|
|
3
|
-
import {
|
|
2
|
+
import type { SdkConfig } from '../../../types';
|
|
3
|
+
import {
|
|
4
|
+
getMarketplaceClient,
|
|
5
|
+
type QueryKeyArgs,
|
|
6
|
+
type ValuesOptional,
|
|
7
|
+
} from '../../_internal';
|
|
4
8
|
import type {
|
|
5
9
|
CollectiblesFilter,
|
|
6
10
|
GetCountOfAllCollectiblesArgs,
|
|
7
11
|
GetCountOfFilteredCollectiblesArgs,
|
|
8
12
|
OrderSide,
|
|
9
|
-
} from '
|
|
10
|
-
import { collectableKeys } from '
|
|
11
|
-
import type { StandardQueryOptions } from '
|
|
13
|
+
} from '../../_internal/api/marketplace.gen';
|
|
14
|
+
import { collectableKeys } from '../../_internal/api/query-keys';
|
|
15
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
12
16
|
|
|
13
17
|
export interface FetchCountOfCollectablesParams {
|
|
14
18
|
chainId: number;
|
|
@@ -54,6 +58,28 @@ export type CountOfCollectablesQueryOptions =
|
|
|
54
58
|
query?: StandardQueryOptions;
|
|
55
59
|
};
|
|
56
60
|
|
|
61
|
+
export function getCountOfCollectablesQueryKey(
|
|
62
|
+
params: CountOfCollectablesQueryOptions,
|
|
63
|
+
) {
|
|
64
|
+
if (params.filter && params.side) {
|
|
65
|
+
const apiArgs = {
|
|
66
|
+
chainId: String(params.chainId),
|
|
67
|
+
contractAddress: params.collectionAddress,
|
|
68
|
+
filter: params.filter,
|
|
69
|
+
side: params.side,
|
|
70
|
+
} satisfies QueryKeyArgs<GetCountOfFilteredCollectiblesArgs>;
|
|
71
|
+
|
|
72
|
+
return [...collectableKeys.counts, apiArgs] as const;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const apiArgs = {
|
|
76
|
+
chainId: String(params.chainId),
|
|
77
|
+
contractAddress: params.collectionAddress,
|
|
78
|
+
} satisfies QueryKeyArgs<GetCountOfAllCollectiblesArgs>;
|
|
79
|
+
|
|
80
|
+
return [...collectableKeys.counts, apiArgs] as const;
|
|
81
|
+
}
|
|
82
|
+
|
|
57
83
|
export function countOfCollectablesQueryOptions(
|
|
58
84
|
params: CountOfCollectablesQueryOptions,
|
|
59
85
|
) {
|
|
@@ -65,7 +91,7 @@ export function countOfCollectablesQueryOptions(
|
|
|
65
91
|
);
|
|
66
92
|
|
|
67
93
|
return queryOptions({
|
|
68
|
-
queryKey:
|
|
94
|
+
queryKey: getCountOfCollectablesQueryKey(params),
|
|
69
95
|
queryFn: () =>
|
|
70
96
|
fetchCountOfCollectables({
|
|
71
97
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './balanceOfCollectible';
|
|
2
|
+
export * from './collectible';
|
|
3
|
+
export * from './countOfCollectables';
|
|
4
|
+
export * from './listCollectibleActivities';
|
|
5
|
+
export * from './listCollectibles';
|
|
6
|
+
export * from './listCollectiblesPaginated';
|
|
7
|
+
export * from './tokenBalances';
|
package/src/react/queries/{listCollectibleActivities.ts → collectibles/listCollectibleActivities.ts}
RENAMED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import type { Page, SdkConfig } from '
|
|
3
|
+
import type { Page, SdkConfig } from '../../../types';
|
|
4
4
|
import type {
|
|
5
5
|
ListCollectibleActivitiesArgs,
|
|
6
6
|
ListCollectibleActivitiesReturn,
|
|
7
|
+
QueryKeyArgs,
|
|
7
8
|
SortBy,
|
|
8
9
|
ValuesOptional,
|
|
9
|
-
} from '
|
|
10
|
-
import { collectableKeys, getMarketplaceClient } from '
|
|
11
|
-
import type { StandardQueryOptions } from '
|
|
10
|
+
} from '../../_internal';
|
|
11
|
+
import { collectableKeys, getMarketplaceClient } from '../../_internal';
|
|
12
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
12
13
|
|
|
13
14
|
export interface FetchListCollectibleActivitiesParams
|
|
14
15
|
extends Omit<
|
|
@@ -64,6 +65,29 @@ export type ListCollectibleActivitiesQueryOptions =
|
|
|
64
65
|
query?: StandardQueryOptions;
|
|
65
66
|
};
|
|
66
67
|
|
|
68
|
+
export function getListCollectibleActivitiesQueryKey(
|
|
69
|
+
params: ListCollectibleActivitiesQueryOptions,
|
|
70
|
+
) {
|
|
71
|
+
// TODO: Do we actually want to do the page like this?
|
|
72
|
+
const page =
|
|
73
|
+
params.page || params.pageSize || params.sort
|
|
74
|
+
? {
|
|
75
|
+
page: params.page ?? 1,
|
|
76
|
+
pageSize: params.pageSize ?? 10,
|
|
77
|
+
sort: params.sort,
|
|
78
|
+
}
|
|
79
|
+
: undefined;
|
|
80
|
+
|
|
81
|
+
const apiArgs = {
|
|
82
|
+
chainId: String(params.chainId),
|
|
83
|
+
contractAddress: params.collectionAddress,
|
|
84
|
+
tokenId: params.tokenId,
|
|
85
|
+
page: page,
|
|
86
|
+
} satisfies QueryKeyArgs<ListCollectibleActivitiesArgs>;
|
|
87
|
+
|
|
88
|
+
return [...collectableKeys.collectibleActivities, apiArgs] as const;
|
|
89
|
+
}
|
|
90
|
+
|
|
67
91
|
export function listCollectibleActivitiesQueryOptions(
|
|
68
92
|
params: ListCollectibleActivitiesQueryOptions,
|
|
69
93
|
) {
|
|
@@ -76,7 +100,7 @@ export function listCollectibleActivitiesQueryOptions(
|
|
|
76
100
|
);
|
|
77
101
|
|
|
78
102
|
return queryOptions({
|
|
79
|
-
queryKey:
|
|
103
|
+
queryKey: getListCollectibleActivitiesQueryKey(params),
|
|
80
104
|
queryFn: () =>
|
|
81
105
|
fetchListCollectibleActivities({
|
|
82
106
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { infiniteQueryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import type { Page, SdkConfig } from '
|
|
4
|
-
import type { CardType } from '
|
|
5
|
-
import { compareAddress } from '
|
|
3
|
+
import type { Page, SdkConfig } from '../../../types';
|
|
4
|
+
import type { CardType } from '../../../types/types';
|
|
5
|
+
import { compareAddress } from '../../../utils';
|
|
6
6
|
import type {
|
|
7
7
|
ListCollectiblesArgs,
|
|
8
8
|
ListCollectiblesReturn,
|
|
9
|
+
QueryKeyArgs,
|
|
9
10
|
ValuesOptional,
|
|
10
|
-
} from '
|
|
11
|
+
} from '../../_internal';
|
|
11
12
|
import {
|
|
12
13
|
type CollectibleOrder,
|
|
13
14
|
collectableKeys,
|
|
14
15
|
getMarketplaceClient,
|
|
16
|
+
MetadataStatus,
|
|
15
17
|
OrderSide,
|
|
16
|
-
} from '
|
|
17
|
-
import type { StandardInfiniteQueryOptions } from '
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
} from '../../_internal';
|
|
19
|
+
import type { StandardInfiniteQueryOptions } from '../../types/query';
|
|
20
|
+
import { fetchMarketplaceConfig } from '../market/marketplaceConfig';
|
|
21
|
+
import {
|
|
22
|
+
fetchBalances,
|
|
23
|
+
type UseListBalancesArgs,
|
|
24
|
+
} from '../tokens/listBalances';
|
|
20
25
|
|
|
21
26
|
export interface FetchListCollectiblesParams
|
|
22
27
|
extends Omit<ListCollectiblesArgs, 'chainId' | 'contractAddress'> {
|
|
@@ -86,6 +91,7 @@ export async function fetchListCollectibles(
|
|
|
86
91
|
description: balance.tokenMetadata.description,
|
|
87
92
|
video: balance.tokenMetadata.video,
|
|
88
93
|
audio: balance.tokenMetadata.audio,
|
|
94
|
+
status: MetadataStatus.AVAILABLE,
|
|
89
95
|
},
|
|
90
96
|
};
|
|
91
97
|
},
|
|
@@ -109,6 +115,19 @@ export type ListCollectiblesQueryOptions =
|
|
|
109
115
|
query?: StandardInfiniteQueryOptions;
|
|
110
116
|
};
|
|
111
117
|
|
|
118
|
+
export function getListCollectiblesQueryKey(
|
|
119
|
+
params: ListCollectiblesQueryOptions,
|
|
120
|
+
) {
|
|
121
|
+
const apiArgs = {
|
|
122
|
+
chainId: String(params.chainId),
|
|
123
|
+
contractAddress: params.collectionAddress,
|
|
124
|
+
side: params.side,
|
|
125
|
+
filter: params.filter,
|
|
126
|
+
} satisfies QueryKeyArgs<Omit<ListCollectiblesArgs, 'page'>>;
|
|
127
|
+
|
|
128
|
+
return [...collectableKeys.lists, apiArgs] as const;
|
|
129
|
+
}
|
|
130
|
+
|
|
112
131
|
export function listCollectiblesQueryOptions(
|
|
113
132
|
params: ListCollectiblesQueryOptions,
|
|
114
133
|
) {
|
|
@@ -121,7 +140,7 @@ export function listCollectiblesQueryOptions(
|
|
|
121
140
|
);
|
|
122
141
|
|
|
123
142
|
return infiniteQueryOptions({
|
|
124
|
-
queryKey:
|
|
143
|
+
queryKey: getListCollectiblesQueryKey(params),
|
|
125
144
|
queryFn: async ({ pageParam }) => {
|
|
126
145
|
return fetchListCollectibles(
|
|
127
146
|
{
|
package/src/react/queries/{listCollectiblesPaginated.ts → collectibles/listCollectiblesPaginated.ts}
RENAMED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import type { Page, SdkConfig } from '
|
|
3
|
+
import type { Page, SdkConfig } from '../../../types';
|
|
4
4
|
import type {
|
|
5
5
|
ListCollectiblesArgs,
|
|
6
6
|
ListCollectiblesReturn,
|
|
7
|
+
QueryKeyArgs,
|
|
7
8
|
ValuesOptional,
|
|
8
|
-
} from '
|
|
9
|
-
import { collectableKeys, getMarketplaceClient } from '
|
|
10
|
-
import type { StandardQueryOptions } from '
|
|
9
|
+
} from '../../_internal';
|
|
10
|
+
import { collectableKeys, getMarketplaceClient } from '../../_internal';
|
|
11
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
11
12
|
|
|
12
13
|
export interface FetchListCollectiblesPaginatedParams
|
|
13
14
|
extends Omit<ListCollectiblesArgs, 'chainId' | 'contractAddress' | 'page'> {
|
|
@@ -54,6 +55,22 @@ export type ListCollectiblesPaginatedQueryOptions =
|
|
|
54
55
|
query?: StandardQueryOptions;
|
|
55
56
|
};
|
|
56
57
|
|
|
58
|
+
export function getListCollectiblesPaginatedQueryKey(
|
|
59
|
+
params: ListCollectiblesPaginatedQueryOptions,
|
|
60
|
+
) {
|
|
61
|
+
const apiArgs = {
|
|
62
|
+
chainId: String(params.chainId),
|
|
63
|
+
contractAddress: params.collectionAddress,
|
|
64
|
+
side: params.side,
|
|
65
|
+
filter: params.filter,
|
|
66
|
+
page: params.page
|
|
67
|
+
? { page: params.page, pageSize: params.pageSize ?? 30 }
|
|
68
|
+
: undefined,
|
|
69
|
+
} satisfies QueryKeyArgs<ListCollectiblesArgs>;
|
|
70
|
+
|
|
71
|
+
return [...collectableKeys.lists, 'paginated', apiArgs] as const;
|
|
72
|
+
}
|
|
73
|
+
|
|
57
74
|
export function listCollectiblesPaginatedQueryOptions(
|
|
58
75
|
params: ListCollectiblesPaginatedQueryOptions,
|
|
59
76
|
) {
|
|
@@ -66,7 +83,7 @@ export function listCollectiblesPaginatedQueryOptions(
|
|
|
66
83
|
);
|
|
67
84
|
|
|
68
85
|
return queryOptions({
|
|
69
|
-
queryKey:
|
|
86
|
+
queryKey: getListCollectiblesPaginatedQueryKey(params),
|
|
70
87
|
queryFn: () =>
|
|
71
88
|
fetchListCollectiblesPaginated({
|
|
72
89
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { queryOptions, skipToken } from '@tanstack/react-query';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
3
|
import type { UseQueryParameters } from 'wagmi/query';
|
|
4
|
-
import type { SdkConfig } from '
|
|
5
|
-
import { collectableKeys, getIndexerClient, LaosAPI } from '
|
|
4
|
+
import type { SdkConfig } from '../../../types';
|
|
5
|
+
import { collectableKeys, getIndexerClient, LaosAPI } from '../../_internal';
|
|
6
6
|
|
|
7
7
|
export type UseTokenBalancesArgs = {
|
|
8
8
|
collectionAddress: Address;
|
|
@@ -52,6 +52,24 @@ export async function fetchTokenBalances(
|
|
|
52
52
|
.then((res) => res.balances || []);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
export function getTokenBalancesQueryKey(args: UseTokenBalancesArgs) {
|
|
56
|
+
const apiArgs = {
|
|
57
|
+
chainId: args.chainId,
|
|
58
|
+
accountAddress: args.userAddress,
|
|
59
|
+
contractAddress: args.collectionAddress,
|
|
60
|
+
includeMetadata: args.includeMetadata,
|
|
61
|
+
metadataOptions: args.userAddress
|
|
62
|
+
? {
|
|
63
|
+
verifiedOnly: true,
|
|
64
|
+
includeContracts: [args.collectionAddress],
|
|
65
|
+
}
|
|
66
|
+
: undefined,
|
|
67
|
+
isLaos721: args.isLaos721,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return [...collectableKeys.userBalances, apiArgs] as const;
|
|
71
|
+
}
|
|
72
|
+
|
|
55
73
|
/**
|
|
56
74
|
* Creates a tanstack query options object for the token balances query
|
|
57
75
|
*
|
|
@@ -69,7 +87,7 @@ export function tokenBalancesOptions(
|
|
|
69
87
|
(args.query?.enabled ?? true);
|
|
70
88
|
|
|
71
89
|
return queryOptions({
|
|
72
|
-
queryKey:
|
|
90
|
+
queryKey: getTokenBalancesQueryKey(args),
|
|
73
91
|
queryFn: enabled
|
|
74
92
|
? () =>
|
|
75
93
|
fetchTokenBalances(
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import type { GetContractInfoArgs } from '@0xsequence/metadata';
|
|
1
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
-
import type { SdkConfig } from '
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { SdkConfig } from '../../../types';
|
|
4
|
+
import {
|
|
5
|
+
getMetadataClient,
|
|
6
|
+
type QueryKeyArgs,
|
|
7
|
+
type ValuesOptional,
|
|
8
|
+
} from '../../_internal';
|
|
9
|
+
import { collectionKeys } from '../../_internal/api/query-keys';
|
|
10
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
6
11
|
|
|
7
12
|
export interface FetchCollectionParams {
|
|
8
13
|
chainId: number;
|
|
@@ -30,6 +35,15 @@ export type CollectionQueryOptions = ValuesOptional<FetchCollectionParams> & {
|
|
|
30
35
|
query?: StandardQueryOptions;
|
|
31
36
|
};
|
|
32
37
|
|
|
38
|
+
export function getCollectionQueryKey(params: CollectionQueryOptions) {
|
|
39
|
+
const apiArgs = {
|
|
40
|
+
chainID: String(params.chainId),
|
|
41
|
+
contractAddress: params.collectionAddress,
|
|
42
|
+
} satisfies QueryKeyArgs<GetContractInfoArgs>;
|
|
43
|
+
|
|
44
|
+
return [...collectionKeys.detail, apiArgs] as const;
|
|
45
|
+
}
|
|
46
|
+
|
|
33
47
|
export function collectionQueryOptions(params: CollectionQueryOptions) {
|
|
34
48
|
const enabled = Boolean(
|
|
35
49
|
params.collectionAddress &&
|
|
@@ -39,7 +53,7 @@ export function collectionQueryOptions(params: CollectionQueryOptions) {
|
|
|
39
53
|
);
|
|
40
54
|
|
|
41
55
|
return queryOptions({
|
|
42
|
-
queryKey:
|
|
56
|
+
queryKey: getCollectionQueryKey(params),
|
|
43
57
|
queryFn: () =>
|
|
44
58
|
fetchCollection({
|
|
45
59
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
package/src/react/queries/{collectionBalanceDetails.ts → collections/collectionBalanceDetails.ts}
RENAMED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { GetTokenBalancesDetailsReturn } from '@0xsequence/indexer';
|
|
2
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
3
3
|
import type { Address } from 'viem';
|
|
4
|
-
import type { SdkConfig } from '
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import type { SdkConfig } from '../../../types';
|
|
5
|
+
import {
|
|
6
|
+
balanceQueries,
|
|
7
|
+
getIndexerClient,
|
|
8
|
+
type ValuesOptional,
|
|
9
|
+
} from '../../_internal';
|
|
10
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
7
11
|
|
|
8
12
|
export interface CollectionBalanceFilter {
|
|
9
13
|
accountAddresses: Array<Address>;
|
|
@@ -65,6 +69,17 @@ export type CollectionBalanceDetailsQueryOptions =
|
|
|
65
69
|
query?: StandardQueryOptions;
|
|
66
70
|
};
|
|
67
71
|
|
|
72
|
+
export function getCollectionBalanceDetailsQueryKey(
|
|
73
|
+
params: CollectionBalanceDetailsQueryOptions,
|
|
74
|
+
) {
|
|
75
|
+
const apiArgs = {
|
|
76
|
+
chainId: params.chainId!,
|
|
77
|
+
filter: params.filter!,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return [...balanceQueries.collectionBalanceDetails, apiArgs] as const;
|
|
81
|
+
}
|
|
82
|
+
|
|
68
83
|
export function collectionBalanceDetailsQueryOptions(
|
|
69
84
|
params: CollectionBalanceDetailsQueryOptions,
|
|
70
85
|
) {
|
|
@@ -76,7 +91,7 @@ export function collectionBalanceDetailsQueryOptions(
|
|
|
76
91
|
);
|
|
77
92
|
|
|
78
93
|
return queryOptions({
|
|
79
|
-
queryKey:
|
|
94
|
+
queryKey: getCollectionBalanceDetailsQueryKey(params),
|
|
80
95
|
queryFn: () =>
|
|
81
96
|
fetchCollectionBalanceDetails({
|
|
82
97
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
-
import type { SdkConfig } from '
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import type { SdkConfig } from '../../../types';
|
|
3
|
+
import {
|
|
4
|
+
getMarketplaceClient,
|
|
5
|
+
type QueryKeyArgs,
|
|
6
|
+
type ValuesOptional,
|
|
7
|
+
} from '../../_internal';
|
|
8
|
+
import type { GetCollectionDetailArgs } from '../../_internal/api/marketplace.gen';
|
|
9
|
+
import { collectionKeys } from '../../_internal/api/query-keys';
|
|
10
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
7
11
|
|
|
8
12
|
export interface FetchCollectionDetailsParams
|
|
9
13
|
extends Omit<GetCollectionDetailArgs, 'chainId' | 'contractAddress'> {
|
|
@@ -37,6 +41,17 @@ export type CollectionDetailsQueryOptions =
|
|
|
37
41
|
query?: StandardQueryOptions;
|
|
38
42
|
};
|
|
39
43
|
|
|
44
|
+
export function getCollectionDetailsQueryKey(
|
|
45
|
+
params: CollectionDetailsQueryOptions,
|
|
46
|
+
) {
|
|
47
|
+
const apiArgs = {
|
|
48
|
+
chainId: String(params.chainId),
|
|
49
|
+
contractAddress: params.collectionAddress,
|
|
50
|
+
} satisfies QueryKeyArgs<GetCollectionDetailArgs>;
|
|
51
|
+
|
|
52
|
+
return [...collectionKeys.detail, apiArgs] as const;
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
export function collectionDetailsQueryOptions(
|
|
41
56
|
params: CollectionDetailsQueryOptions,
|
|
42
57
|
) {
|
|
@@ -48,7 +63,7 @@ export function collectionDetailsQueryOptions(
|
|
|
48
63
|
);
|
|
49
64
|
|
|
50
65
|
return queryOptions({
|
|
51
|
-
queryKey:
|
|
66
|
+
queryKey: getCollectionDetailsQueryKey(params),
|
|
52
67
|
queryFn: () =>
|
|
53
68
|
fetchCollectionDetails({
|
|
54
69
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
package/src/react/queries/{listCollectionActivities.ts → collections/listCollectionActivities.ts}
RENAMED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import type { Page, SdkConfig } from '
|
|
3
|
+
import type { Page, SdkConfig } from '../../../types';
|
|
4
4
|
import type {
|
|
5
5
|
ListCollectionActivitiesArgs,
|
|
6
6
|
ListCollectionActivitiesReturn,
|
|
7
|
+
QueryKeyArgs,
|
|
7
8
|
SortBy,
|
|
8
9
|
ValuesOptional,
|
|
9
|
-
} from '
|
|
10
|
-
import { getMarketplaceClient } from '
|
|
11
|
-
import { collectionKeys } from '
|
|
12
|
-
import type { StandardQueryOptions } from '
|
|
10
|
+
} from '../../_internal';
|
|
11
|
+
import { getMarketplaceClient } from '../../_internal';
|
|
12
|
+
import { collectionKeys } from '../../_internal/api';
|
|
13
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
13
14
|
|
|
14
15
|
export interface FetchListCollectionActivitiesParams
|
|
15
16
|
extends Omit<
|
|
@@ -65,6 +66,27 @@ export type ListCollectionActivitiesQueryOptions =
|
|
|
65
66
|
query?: StandardQueryOptions;
|
|
66
67
|
};
|
|
67
68
|
|
|
69
|
+
export function getListCollectionActivitiesQueryKey(
|
|
70
|
+
params: ListCollectionActivitiesQueryOptions,
|
|
71
|
+
) {
|
|
72
|
+
const page =
|
|
73
|
+
params.page || params.pageSize || params.sort
|
|
74
|
+
? {
|
|
75
|
+
page: params.page ?? 1,
|
|
76
|
+
pageSize: params.pageSize ?? 10,
|
|
77
|
+
sort: params.sort,
|
|
78
|
+
}
|
|
79
|
+
: undefined;
|
|
80
|
+
|
|
81
|
+
const apiArgs = {
|
|
82
|
+
chainId: String(params.chainId),
|
|
83
|
+
contractAddress: params.collectionAddress,
|
|
84
|
+
page: page,
|
|
85
|
+
} satisfies QueryKeyArgs<ListCollectionActivitiesArgs>;
|
|
86
|
+
|
|
87
|
+
return [...collectionKeys.collectionActivities, apiArgs] as const;
|
|
88
|
+
}
|
|
89
|
+
|
|
68
90
|
export function listCollectionActivitiesQueryOptions(
|
|
69
91
|
params: ListCollectionActivitiesQueryOptions,
|
|
70
92
|
) {
|
|
@@ -76,7 +98,7 @@ export function listCollectionActivitiesQueryOptions(
|
|
|
76
98
|
);
|
|
77
99
|
|
|
78
100
|
return queryOptions({
|
|
79
|
-
queryKey:
|
|
101
|
+
queryKey: getListCollectionActivitiesQueryKey(params),
|
|
80
102
|
queryFn: () =>
|
|
81
103
|
fetchListCollectionActivities({
|
|
82
104
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { ContractInfo } from '@0xsequence/metadata';
|
|
2
2
|
import { queryOptions, skipToken } from '@tanstack/react-query';
|
|
3
|
-
import type { CardType, SdkConfig } from '
|
|
3
|
+
import type { CardType, SdkConfig } from '../../../types';
|
|
4
4
|
import type {
|
|
5
5
|
MarketCollection,
|
|
6
6
|
MarketplaceConfig,
|
|
7
7
|
ShopCollection,
|
|
8
|
-
} from '
|
|
9
|
-
import { compareAddress } from '
|
|
8
|
+
} from '../../../types/new-marketplace-types';
|
|
9
|
+
import { compareAddress } from '../../../utils';
|
|
10
10
|
import {
|
|
11
11
|
collectionKeys,
|
|
12
12
|
getMetadataClient,
|
|
13
13
|
type ValuesOptional,
|
|
14
|
-
} from '
|
|
15
|
-
import type { StandardQueryOptions } from '
|
|
14
|
+
} from '../../_internal';
|
|
15
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
16
16
|
|
|
17
17
|
const allCollections = (marketplaceConfig: MarketplaceConfig) => {
|
|
18
18
|
return [
|
|
@@ -113,6 +113,17 @@ export type ListCollectionsQueryOptions =
|
|
|
113
113
|
query?: StandardQueryOptions;
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
+
export function getListCollectionsQueryKey(
|
|
117
|
+
params: ListCollectionsQueryOptions,
|
|
118
|
+
) {
|
|
119
|
+
const queryKeyParams = {
|
|
120
|
+
cardType: params.cardType,
|
|
121
|
+
marketplaceConfig: params.marketplaceConfig,
|
|
122
|
+
} as const;
|
|
123
|
+
|
|
124
|
+
return [...collectionKeys.list, queryKeyParams] as const;
|
|
125
|
+
}
|
|
126
|
+
|
|
116
127
|
export function listCollectionsQueryOptions(
|
|
117
128
|
params: ListCollectionsQueryOptions,
|
|
118
129
|
) {
|
|
@@ -123,7 +134,7 @@ export function listCollectionsQueryOptions(
|
|
|
123
134
|
);
|
|
124
135
|
|
|
125
136
|
return queryOptions({
|
|
126
|
-
queryKey:
|
|
137
|
+
queryKey: getListCollectionsQueryKey(params),
|
|
127
138
|
queryFn: enabled
|
|
128
139
|
? () =>
|
|
129
140
|
fetchListCollections({
|