@0xsequence/marketplace-sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -5
- package/dist/{BellIcon-IpHHEy8h.js → BellIcon-DMKEumAz.js} +2 -2
- package/dist/BellIcon-DMKEumAz.js.map +1 -0
- package/dist/{CartIcon-C8zbor8H.js → CartIcon-UyB4NYKt.js} +3 -3
- package/dist/CartIcon-UyB4NYKt.js.map +1 -0
- package/dist/CollectibleCard-z05qWzKE.d.ts +8 -0
- package/dist/_internal-DkS2VUn5.js.map +1 -1
- package/dist/abi-fa-o9gH3.js +134 -0
- package/dist/abi-fa-o9gH3.js.map +1 -0
- package/dist/{alien_swap-BTJ7mSR-.js → alien_swap-Cq8LuElo.js} +1 -1
- package/dist/{alien_swap-BTJ7mSR-.js.map → alien_swap-Cq8LuElo.js.map} +1 -1
- package/dist/{api-DuLKn__v.js → api-GwTR0dBA.js} +13 -49
- package/dist/api-GwTR0dBA.js.map +1 -0
- package/dist/{aqua-xyz-BYJ9WSP_.js → aqua-xyz-0yye_c-Z.js} +1 -1
- package/dist/{aqua-xyz-BYJ9WSP_.js.map → aqua-xyz-0yye_c-Z.js.map} +1 -1
- package/dist/{aura-D7SUjgro.js → aura-TaxFvTFQ.js} +1 -1
- package/dist/{aura-D7SUjgro.js.map → aura-TaxFvTFQ.js.map} +1 -1
- package/dist/{blur-BcnRFCaV.js → blur-BupOTobO.js} +1 -1
- package/dist/{blur-BcnRFCaV.js.map → blur-BupOTobO.js.map} +1 -1
- package/dist/{builder-api-BFuZNOaN.js → builder-api-m4JAA6ee.js} +3 -3
- package/dist/builder-api-m4JAA6ee.js.map +1 -0
- package/dist/{builder.gen-B9wR2nvF.js → builder.gen--XD71cNL.js} +2 -2
- package/dist/builder.gen--XD71cNL.js.map +1 -0
- package/dist/{coinbase-ChoX9Hw2.js → coinbase-DTgZ4wDT.js} +1 -1
- package/dist/{coinbase-ChoX9Hw2.js.map → coinbase-DTgZ4wDT.js.map} +1 -1
- package/dist/collectibles-CZ6i8sXK.js +324 -0
- package/dist/collectibles-CZ6i8sXK.js.map +1 -0
- package/dist/collections-5NcU-7ZR.js +331 -0
- package/dist/collections-5NcU-7ZR.js.map +1 -0
- package/dist/{components-CUv-wQr8.js → components-CY8kx2kb.js} +13 -9
- package/dist/components-CY8kx2kb.js.map +1 -0
- package/dist/{contracts-D72LBOX3.js → contracts-DRJHF89h.js} +5 -4
- package/dist/{contracts-D72LBOX3.js.map → contracts-DRJHF89h.js.map} +1 -1
- package/dist/{create-config-CIfejoCk.js → create-config-BxyfYCEk.js} +6 -5
- package/dist/create-config-BxyfYCEk.js.map +1 -0
- package/dist/{create-config-DV_dtaLt.d.ts → create-config-CFBeD8CB.d.ts} +149 -57
- package/dist/{element-Dbcv5qya.js → element-D4dDznlu.js} +1 -1
- package/dist/{element-Dbcv5qya.js.map → element-D4dDznlu.js.map} +1 -1
- package/dist/filters-B5niI_fX.d.ts +60 -0
- package/dist/{foundation-QPhUEUy8.js → foundation-GHZOKAzN.js} +1 -1
- package/dist/{foundation-QPhUEUy8.js.map → foundation-GHZOKAzN.js.map} +1 -1
- package/dist/index-8scPf0CS.d.ts +55 -0
- package/dist/index-9qsplZ8r.d.ts +18 -0
- package/dist/index-BIuYTMc2.d.ts +122 -0
- package/dist/{index-BoNNplSx.d.ts → index-BNrz99xy.d.ts} +3 -3
- package/dist/{index-BaytncQc.d.ts → index-BYQOPS8e.d.ts} +108 -51
- package/dist/{index-CXscCUg7.d.ts → index-BkZ7SPLc.d.ts} +19 -29
- package/dist/{index-D6YMj82n.d.ts → index-BnUku_aF.d.ts} +109 -114
- package/dist/index-BtDAHMW_.d.ts +50 -0
- package/dist/index-C-c_M_sE.d.ts +107 -0
- package/dist/index-CKefEBrI.d.ts +1 -0
- package/dist/{index-CMPUveNz.d.ts → index-CNIiC8Z_.d.ts} +11 -8
- package/dist/{index-DLUjc7Bx.d.ts → index-CbERNN3s.d.ts} +201 -12
- package/dist/{index-C768pAfu.d.ts → index-CsfxsN0t.d.ts} +4 -4
- package/dist/{index-CQecU53t.d.ts → index-DASjaiJL.d.ts} +119 -24
- package/dist/{index-CT8ZorFd.d.ts → index-DD7Vc4cE.d.ts} +2 -2
- package/dist/{index-DpeWm_vF.d.ts → index-DIc8OqWV.d.ts} +7 -6
- package/dist/index-DVI_vggD.d.ts +171 -0
- package/dist/index-DgsCqh_P.d.ts +1 -0
- package/dist/{index-DMBMM16q.d.ts → index-DqxQeYT2.d.ts} +39 -36
- package/dist/{index-D-UXGo5d.d.ts → index-Dsf9FRtr.d.ts} +19 -3
- package/dist/{index-DJG0kiII.d.ts → index-DxAReMEO.d.ts} +45 -34
- package/dist/index-UXRoZmd_.d.ts +70 -0
- package/dist/{index-CM0ZTePs.d.ts → index-isFvc5gd.d.ts} +2 -2
- package/dist/{index-jGgfEHfQ.d.ts → index-j3nuJWyJ.d.ts} +18 -10
- package/dist/{index-B6aSbaw2.d.ts → index-nVb7o0hc.d.ts} +2 -2
- package/dist/{index-Bv5XVLjH.d.ts → index-pbE88Tt7.d.ts} +2 -2
- package/dist/index-xpO4AQyS.d.ts +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +13 -13
- package/dist/inventory--t6Zu55O.js +75 -0
- package/dist/inventory--t6Zu55O.js.map +1 -0
- package/dist/listCollectiblesPaginated-BlE5mSzh.d.ts +327 -0
- package/dist/listCollections-DWyqFSQ3.d.ts +828 -0
- package/dist/{looks-rare-C7cQztTR.js → looks-rare-2HBhMpOf.js} +1 -1
- package/dist/{looks-rare-C7cQztTR.js.map → looks-rare-2HBhMpOf.js.map} +1 -1
- package/dist/lowestListing-DsunDO1c.d.ts +475 -0
- package/dist/{magic-eden-D3r7jiBG.js → magic-eden-BYdTp-uk.js} +1 -1
- package/dist/{magic-eden-D3r7jiBG.js.map → magic-eden-BYdTp-uk.js.map} +1 -1
- package/dist/{manifold-DsX0CBP-.js → manifold-yE0x6ZmO.js} +1 -1
- package/dist/{manifold-DsX0CBP-.js.map → manifold-yE0x6ZmO.js.map} +1 -1
- package/dist/market-DuBpFsDg.js +219 -0
- package/dist/market-DuBpFsDg.js.map +1 -0
- package/dist/{marketCurrencies-Bzj8X4TL.d.ts → marketCurrencies-BgwmbGFk.d.ts} +57 -15
- package/dist/marketCurrencies-Bolonndy.js +59 -0
- package/dist/marketCurrencies-Bolonndy.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-Cz9RrtQo.js} +21 -21
- package/dist/marketplace-logos-Cz9RrtQo.js.map +1 -0
- package/dist/{marketplace.gen-w2YvbEEo.js → marketplace.gen-906FrJQJ.js} +75 -5
- package/dist/marketplace.gen-906FrJQJ.js.map +1 -0
- package/dist/{marketplaceConfig-BTy75Mbf.js → marketplaceConfig-Bqjo7NYO.js} +9 -5
- package/dist/marketplaceConfig-Bqjo7NYO.js.map +1 -0
- package/dist/{mintify-DiOoDmO1.js → mintify-BXQx3mZB.js} +1 -1
- package/dist/{mintify-DiOoDmO1.js.map → mintify-BXQx3mZB.js.map} +1 -1
- package/dist/{network-DtmiMhcg.js → network-DwdZ_5-7.js} +2 -2
- package/dist/network-DwdZ_5-7.js.map +1 -0
- package/dist/{networkconfigToWagmiChain-DbUf6HiO.js → networkconfigToWagmiChain-Ct-hGq8M.js} +4 -3
- package/dist/networkconfigToWagmiChain-Ct-hGq8M.js.map +1 -0
- package/dist/{nftx-CP82jNra.js → nftx-B929_3Ce.js} +1 -1
- package/dist/{nftx-CP82jNra.js.map → nftx-B929_3Ce.js.map} +1 -1
- package/dist/{okx-p9-4xRjs.js → okx-sZ0-Udny.js} +1 -1
- package/dist/{okx-p9-4xRjs.js.map → okx-sZ0-Udny.js.map} +1 -1
- package/dist/{open-sea-D2GwAmKS.js → open-sea-DO9PhTrz.js} +1 -1
- package/dist/{open-sea-D2GwAmKS.js.map → open-sea-DO9PhTrz.js.map} +1 -1
- package/dist/orders-DH76ym2e.js +469 -0
- package/dist/orders-DH76ym2e.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-CECrqatg.js +156 -0
- package/dist/primary-sales-CECrqatg.js.map +1 -0
- package/dist/{query-BG-MA1MB.d.ts → query-brXxOcH0.d.ts} +1 -1
- package/dist/{rarible-DqiiW9ki.js → rarible-Ccb2hs7y.js} +1 -1
- package/dist/{rarible-DqiiW9ki.js.map → rarible-Ccb2hs7y.js.map} +1 -1
- package/dist/react/_internal/api/index.d.ts +2 -2
- package/dist/react/_internal/api/index.js +6 -6
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +32 -22
- package/dist/react/_internal/index.d.ts +2 -2
- package/dist/react/_internal/index.js +8 -8
- package/dist/react/_internal/wagmi/index.d.ts +1 -1
- package/dist/react/_internal/wagmi/index.js +3 -3
- package/dist/react/hooks/config/index.d.ts +8 -8
- package/dist/react/hooks/config/index.js +32 -22
- package/dist/react/hooks/contracts/index.d.ts +6 -6
- package/dist/react/hooks/contracts/index.js +12 -12
- package/dist/react/hooks/data/collectibles/index.d.ts +10 -4
- package/dist/react/hooks/data/collectibles/index.js +32 -22
- package/dist/react/hooks/data/collections/index.d.ts +11 -11
- package/dist/react/hooks/data/collections/index.js +33 -23
- package/dist/react/hooks/data/index.d.ts +37 -29
- package/dist/react/hooks/data/index.js +33 -23
- package/dist/react/hooks/data/inventory/index.d.ts +36 -28
- package/dist/react/hooks/data/inventory/index.js +32 -22
- package/dist/react/hooks/data/market/index.d.ts +11 -5
- package/dist/react/hooks/data/market/index.js +32 -22
- package/dist/react/hooks/data/orders/index.d.ts +11 -5
- package/dist/react/hooks/data/orders/index.js +33 -23
- package/dist/react/hooks/data/primary-sales/index.d.ts +37 -29
- package/dist/react/hooks/data/primary-sales/index.js +33 -23
- package/dist/react/hooks/data/tokens/index.d.ts +4 -4
- package/dist/react/hooks/data/tokens/index.js +32 -22
- package/dist/react/hooks/index.d.ts +37 -29
- package/dist/react/hooks/index.js +33 -23
- package/dist/react/hooks/transactions/index.d.ts +2 -2
- package/dist/react/hooks/transactions/index.js +32 -22
- package/dist/react/hooks/ui/index.d.ts +4 -4
- package/dist/react/hooks/ui/index.js +32 -22
- package/dist/react/hooks/utils/index.d.ts +36 -28
- package/dist/react/hooks/utils/index.js +32 -22
- package/dist/react/index.d.ts +37 -29
- package/dist/react/index.js +33 -23
- package/dist/react/queries/collectibles/index.d.ts +11 -0
- package/dist/react/queries/collectibles/index.js +22 -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 +26 -16
- 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 +13 -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 +8 -8
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.d.ts +2 -2
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.js +16 -16
- 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 +32 -22
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +4 -4
- package/dist/react/ui/components/marketplace-collectible-card/index.js +32 -22
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +2 -2
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +8 -8
- package/dist/react/ui/components/marketplace-logos/index.d.ts +21 -21
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/icons/index.js +12 -12
- package/dist/react/ui/index.d.ts +4 -4
- package/dist/react/ui/index.js +32 -22
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +32 -22
- package/dist/react/utils/index.d.ts +3 -3
- package/dist/react/utils/index.js +6 -6
- package/dist/{react-BLJ4DkPx.js → react-CBsgOdVP.js} +1540 -474
- package/dist/react-CBsgOdVP.js.map +1 -0
- package/dist/{sequence-Bbb-TFKg.js → sequence-CRdb1yEs.js} +1 -1
- package/dist/{sequence-Bbb-TFKg.js.map → sequence-CRdb1yEs.js.map} +1 -1
- package/dist/styles/index.css +155 -1
- package/dist/{sudo-swap-CEPIM3Js.js → sudo-swap-BIklG2gq.js} +1 -1
- package/dist/{sudo-swap-CEPIM3Js.js.map → sudo-swap-BIklG2gq.js.map} +1 -1
- package/dist/{super-rare-CMEn9PoO.js → super-rare-h8645_5E.js} +1 -1
- package/dist/{super-rare-CMEn9PoO.js.map → super-rare-h8645_5E.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-CouzNX4j.js +57 -0
- package/dist/tokenBalances-CouzNX4j.js.map +1 -0
- package/dist/tokenSupplies-C3zJll0M.d.ts +265 -0
- package/dist/tokens-BvIRUCGG.js +225 -0
- package/dist/tokens-BvIRUCGG.js.map +1 -0
- package/dist/transaction-DZUW5RHu.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types-B_-cnkcP.js.map +1 -1
- package/dist/{types-D6LkVrF0.d.ts → types-CMDwfhfR.d.ts} +6 -5
- 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 +11 -11
- package/dist/{utils-BZEkdqWK.js → utils-9ToOvt-c.js} +50 -7
- package/dist/utils-9ToOvt-c.js.map +1 -0
- package/dist/{utils-oVZxdK0o.js → utils-B6di6O-C.js} +2 -2
- package/dist/utils-B6di6O-C.js.map +1 -0
- package/dist/utils-BCYTEOvy.js +122 -0
- package/dist/utils-BCYTEOvy.js.map +1 -0
- package/dist/waitForTransactionReceipt-CbSeUSXe.js +26 -0
- package/dist/waitForTransactionReceipt-CbSeUSXe.js.map +1 -0
- package/dist/{x2y2-DNe6JgtG.js → x2y2-OvF__ugj.js} +1 -1
- package/dist/{x2y2-DNe6JgtG.js.map → x2y2-OvF__ugj.js.map} +1 -1
- package/dist/{zora-w0Zqxxs4.js → zora-DzCeu-eE.js} +1 -1
- package/dist/{zora-w0Zqxxs4.js.map → zora-DzCeu-eE.js.map} +1 -1
- package/package.json +46 -41
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +15 -0
- package/src/react/_internal/api/index.ts +0 -1
- package/src/react/_internal/api/marketplace.gen.ts +1774 -2383
- package/src/react/_internal/api/query-keys.ts +23 -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 -10
- 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 +2 -17
- package/src/react/hooks/data/collectibles/useListCollectiblesPaginated.tsx +1 -1
- package/src/react/hooks/data/collectibles/useTokenBalances.tsx +1 -10
- package/src/react/hooks/data/collections/index.ts +2 -0
- package/src/react/hooks/data/collections/useCollection.tsx +1 -1
- 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/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 +2 -11
- 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.test.tsx +31 -2
- 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/index.ts +1 -0
- 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/primary-sales/usePrimarySaleItem.tsx +71 -0
- package/src/react/hooks/data/tokens/useGetTokenRanges.tsx +2 -2
- package/src/react/hooks/data/tokens/useListBalances.tsx +3 -12
- 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 +2 -14
- 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 +3 -0
- package/src/react/hooks/transactions/useGenerateSellTransaction.test.tsx +6 -0
- package/src/react/hooks/transactions/useProcessStep.test.tsx +8 -6
- package/src/react/hooks/transactions/useProcessStep.ts +8 -6
- 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.test.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 +14 -2
- package/src/react/queries/{balanceOfCollectible.ts → collectibles/balanceOfCollectible.ts} +23 -16
- 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} +22 -56
- package/src/react/queries/{listCollectiblesPaginated.ts → collectibles/listCollectiblesPaginated.ts} +22 -5
- package/src/react/queries/{tokenBalances.ts → collectibles/tokenBalances.ts} +20 -16
- package/src/react/queries/collections/activeListingsCurrencies.ts +84 -0
- package/src/react/queries/collections/activeOffersCurrencies.ts +84 -0
- 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 +7 -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/inventory/index.ts +1 -0
- package/src/react/queries/{inventory.ts → inventory/inventory.ts} +13 -14
- 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} +32 -6
- 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 +4 -0
- package/src/react/queries/primary-sales/primarySaleItem.ts +80 -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} +17 -22
- 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} +17 -34
- package/src/react/queries/{comparePrices.ts → utils/comparePrices.ts} +29 -5
- 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.stories.tsx +2 -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/components/footer/Footer.tsx +4 -18
- package/src/react/ui/components/marketplace-collectible-card/types.ts +1 -0
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +5 -2
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +2 -2
- package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +3 -0
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +1 -0
- package/src/react/ui/modals/BuyModal/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 -25
- 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 +77 -10
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +12 -0
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +6 -1
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +15 -26
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +3 -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 +34 -10
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +18 -9
- 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 +198 -11
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +58 -10
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +2 -0
- package/src/react/utils/waitForTransactionReceipt.ts +26 -32
- package/src/styles/index.css +1 -0
- package/src/styles/styles.ts +156 -2
- package/src/types/index.ts +1 -1
- package/src/utils/abi/index.ts +1 -0
- package/src/utils/abi/mainModule.ts +158 -0
- 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/dist/BellIcon-IpHHEy8h.js.map +0 -1
- package/dist/CartIcon-C8zbor8H.js.map +0 -1
- package/dist/CollectibleCard-C2EWF0zo.d.ts +0 -8
- package/dist/api-DuLKn__v.js.map +0 -1
- package/dist/builder-api-BFuZNOaN.js.map +0 -1
- package/dist/builder.gen-B9wR2nvF.js.map +0 -1
- package/dist/components-CUv-wQr8.js.map +0 -1
- package/dist/create-config-CIfejoCk.js.map +0 -1
- package/dist/filters-zkMJaPey.d.ts +0 -31
- package/dist/index-B8vaT3_s.d.ts +0 -18
- package/dist/index-Yobo6icm.d.ts +0 -234
- package/dist/listCollectiblesPaginated-Bq0QSOjJ.d.ts +0 -168
- package/dist/listCollections-dTCq00l5.d.ts +0 -669
- package/dist/lowestListing-CB5Te-Q9.d.ts +0 -168
- package/dist/marketplace-logos-Csv2MBwf.js.map +0 -1
- package/dist/marketplace.gen-w2YvbEEo.js.map +0 -1
- package/dist/marketplaceConfig-BTy75Mbf.js.map +0 -1
- package/dist/network-DtmiMhcg.js.map +0 -1
- package/dist/networkconfigToWagmiChain-DbUf6HiO.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/utils-BZEkdqWK.js.map +0 -1
- package/dist/utils-oVZxdK0o.js.map +0 -1
- package/dist/waitForTransactionReceipt-B08YZiDY.js +0 -26
- package/dist/waitForTransactionReceipt-B08YZiDY.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/__tests__/balanceOfCollectible.laos.test.ts +0 -123
- package/src/react/queries/__tests__/inventory.laos.test.ts +0 -499
- package/src/react/queries/__tests__/tokenBalances.laos.test.ts +0 -123
- /package/dist/{index-Cg5cFzs-.d.ts → index-CCggO_hw.d.ts} +0 -0
- /package/dist/{abi-DYsUABe6.js → queries-CyajGg_O.js} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
+
import * as dn from 'dnum';
|
|
2
3
|
import type { Address } from 'viem';
|
|
3
|
-
import type { SdkConfig } from '
|
|
4
|
-
import type
|
|
5
|
-
import type { StandardQueryOptions } from '
|
|
4
|
+
import type { SdkConfig } from '../../../types';
|
|
5
|
+
import { currencyKeys, type ValuesOptional } from '../../_internal';
|
|
6
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
6
7
|
import { fetchConvertPriceToUSD } from './convertPriceToUSD';
|
|
7
8
|
|
|
8
9
|
export interface FetchComparePricesParams {
|
|
@@ -62,9 +63,20 @@ export async function fetchComparePrices(
|
|
|
62
63
|
const isAbove = percentageDifference > 0;
|
|
63
64
|
const isSame = percentageDifference === 0;
|
|
64
65
|
|
|
66
|
+
// proper comma separators
|
|
67
|
+
const absPercentage = Math.abs(percentageDifference);
|
|
68
|
+
const formattedPercentage = dn.format(
|
|
69
|
+
[BigInt(Math.round(absPercentage * 100)), 2],
|
|
70
|
+
{
|
|
71
|
+
digits: 2,
|
|
72
|
+
trailingZeros: true,
|
|
73
|
+
locale: 'en-US',
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
65
77
|
return {
|
|
66
78
|
percentageDifference,
|
|
67
|
-
percentageDifferenceFormatted:
|
|
79
|
+
percentageDifferenceFormatted: formattedPercentage,
|
|
68
80
|
status: isAbove ? 'above' : isSame ? 'same' : 'below',
|
|
69
81
|
};
|
|
70
82
|
}
|
|
@@ -74,6 +86,18 @@ export type ComparePricesQueryOptions =
|
|
|
74
86
|
query?: StandardQueryOptions;
|
|
75
87
|
};
|
|
76
88
|
|
|
89
|
+
export function getComparePricesQueryKey(params: ComparePricesQueryOptions) {
|
|
90
|
+
const apiArgs = {
|
|
91
|
+
chainId: params.chainId!,
|
|
92
|
+
priceAmountRaw: params.priceAmountRaw!,
|
|
93
|
+
priceCurrencyAddress: params.priceCurrencyAddress!,
|
|
94
|
+
compareToPriceAmountRaw: params.compareToPriceAmountRaw!,
|
|
95
|
+
compareToPriceCurrencyAddress: params.compareToPriceCurrencyAddress!,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return [...currencyKeys.conversion, 'compare', apiArgs] as const;
|
|
99
|
+
}
|
|
100
|
+
|
|
77
101
|
export function comparePricesQueryOptions(params: ComparePricesQueryOptions) {
|
|
78
102
|
const enabled = Boolean(
|
|
79
103
|
params.chainId &&
|
|
@@ -86,7 +110,7 @@ export function comparePricesQueryOptions(params: ComparePricesQueryOptions) {
|
|
|
86
110
|
);
|
|
87
111
|
|
|
88
112
|
return queryOptions({
|
|
89
|
-
queryKey:
|
|
113
|
+
queryKey: getComparePricesQueryKey(params),
|
|
90
114
|
queryFn: () =>
|
|
91
115
|
fetchComparePrices({
|
|
92
116
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
2
|
import { type Address, formatUnits } from 'viem';
|
|
3
|
-
import type { SdkConfig } from '
|
|
3
|
+
import type { SdkConfig } from '../../../types';
|
|
4
4
|
import {
|
|
5
5
|
type Currency,
|
|
6
|
+
currencyKeys,
|
|
6
7
|
getQueryClient,
|
|
7
8
|
type ValuesOptional,
|
|
8
|
-
} from '
|
|
9
|
-
import type { StandardQueryOptions } from '
|
|
10
|
-
import { marketCurrenciesQueryOptions } from '
|
|
9
|
+
} from '../../_internal';
|
|
10
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
11
|
+
import { marketCurrenciesQueryOptions } from '../market/marketCurrencies';
|
|
11
12
|
|
|
12
13
|
export interface FetchConvertPriceToUSDParams {
|
|
13
14
|
chainId: number;
|
|
@@ -62,6 +63,18 @@ export type ConvertPriceToUSDQueryOptions =
|
|
|
62
63
|
query?: StandardQueryOptions;
|
|
63
64
|
};
|
|
64
65
|
|
|
66
|
+
export function getConvertPriceToUSDQueryKey(
|
|
67
|
+
params: ConvertPriceToUSDQueryOptions,
|
|
68
|
+
) {
|
|
69
|
+
const apiArgs = {
|
|
70
|
+
chainId: params.chainId!,
|
|
71
|
+
currencyAddress: params.currencyAddress!,
|
|
72
|
+
amountRaw: params.amountRaw!,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return [...currencyKeys.conversion, 'usd', apiArgs] as const;
|
|
76
|
+
}
|
|
77
|
+
|
|
65
78
|
export function convertPriceToUSDQueryOptions(
|
|
66
79
|
params: ConvertPriceToUSDQueryOptions,
|
|
67
80
|
) {
|
|
@@ -74,7 +87,7 @@ export function convertPriceToUSDQueryOptions(
|
|
|
74
87
|
);
|
|
75
88
|
|
|
76
89
|
return queryOptions({
|
|
77
|
-
queryKey:
|
|
90
|
+
queryKey: getConvertPriceToUSDQueryKey(params),
|
|
78
91
|
queryFn: () =>
|
|
79
92
|
fetchConvertPriceToUSD({
|
|
80
93
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -2,7 +2,7 @@ import { cookieToInitialState, type State } from 'wagmi';
|
|
|
2
2
|
import type { SdkConfig } from '../../types/sdk-config';
|
|
3
3
|
import { getQueryClient } from '../_internal/api/get-query-client';
|
|
4
4
|
import { createWagmiConfig } from '../_internal/wagmi/create-config';
|
|
5
|
-
import { marketplaceConfigOptions } from '../queries/marketplaceConfig';
|
|
5
|
+
import { marketplaceConfigOptions } from '../queries/market/marketplaceConfig';
|
|
6
6
|
|
|
7
7
|
type InitSSRClientArgs = {
|
|
8
8
|
cookie: string;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ChevronDownIcon,
|
|
5
|
+
ChevronUpIcon,
|
|
6
|
+
CloseIcon,
|
|
7
|
+
Text,
|
|
8
|
+
WarningIcon,
|
|
9
|
+
} from '@0xsequence/design-system';
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
|
|
12
|
+
export interface ErrorLogBoxProps {
|
|
13
|
+
title: string;
|
|
14
|
+
message: string;
|
|
15
|
+
error?: Error;
|
|
16
|
+
onDismiss?: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const ErrorLogBox = ({
|
|
20
|
+
title,
|
|
21
|
+
message,
|
|
22
|
+
error,
|
|
23
|
+
onDismiss,
|
|
24
|
+
}: ErrorLogBoxProps) => {
|
|
25
|
+
const [showFullError, setShowFullError] = useState(false);
|
|
26
|
+
|
|
27
|
+
const toggleFullError = () => {
|
|
28
|
+
setShowFullError(!showFullError);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="relative max-h-96 w-full overflow-y-auto rounded-lg border border-red-900 bg-[#2b0000] p-3">
|
|
33
|
+
<div className="flex items-start gap-3">
|
|
34
|
+
<WarningIcon
|
|
35
|
+
className="absolute mt-0.5 flex-shrink-0 text-red-500"
|
|
36
|
+
size="sm"
|
|
37
|
+
/>
|
|
38
|
+
<div className="min-w-0 flex-1">
|
|
39
|
+
<div className="relative ml-10 flex flex-col">
|
|
40
|
+
<Text className="font-bold text-red-400 text-sm">{title}</Text>
|
|
41
|
+
<Text className="mt-1 text-red-300 text-xs">{message}</Text>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
{error && (
|
|
45
|
+
<div className="mt-2">
|
|
46
|
+
<button
|
|
47
|
+
onClick={toggleFullError}
|
|
48
|
+
className="flex items-center gap-1 text-red-400 text-xs transition-colors hover:text-red-300"
|
|
49
|
+
type="button"
|
|
50
|
+
>
|
|
51
|
+
{showFullError ? 'Hide full error' : 'Show full error'}
|
|
52
|
+
{showFullError ? (
|
|
53
|
+
<ChevronUpIcon className="h-3 w-3" />
|
|
54
|
+
) : (
|
|
55
|
+
<ChevronDownIcon className="h-3 w-3" />
|
|
56
|
+
)}
|
|
57
|
+
</button>
|
|
58
|
+
|
|
59
|
+
{showFullError && <div className="mt-2 h-px bg-red-900" />}
|
|
60
|
+
|
|
61
|
+
{showFullError && (
|
|
62
|
+
<div className="mt-2 overflow-auto rounded-md bg-red-950 p-2">
|
|
63
|
+
<Text className="whitespace-pre-wrap break-words font-mono text-red-100 text-xs">
|
|
64
|
+
{JSON.stringify(error, null, 2)}
|
|
65
|
+
</Text>
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
{onDismiss && (
|
|
73
|
+
<button
|
|
74
|
+
onClick={onDismiss}
|
|
75
|
+
className="absolute right-4 flex-shrink-0 text-red-400 transition-colors hover:text-red-300"
|
|
76
|
+
type="button"
|
|
77
|
+
aria-label="Dismiss error"
|
|
78
|
+
>
|
|
79
|
+
<CloseIcon className="h-3 w-3" />
|
|
80
|
+
</button>
|
|
81
|
+
)}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -164,6 +164,7 @@ export const SellAction: Story = {
|
|
|
164
164
|
...MOCK_ORDER,
|
|
165
165
|
side: OrderSide.offer,
|
|
166
166
|
status: OrderStatus.active,
|
|
167
|
+
slug: 'test-order',
|
|
167
168
|
},
|
|
168
169
|
orderbookKind: OrderbookKind.sequence_marketplace_v1,
|
|
169
170
|
},
|
|
@@ -276,6 +277,7 @@ export const MarketBuyAction: Story = {
|
|
|
276
277
|
...MOCK_ORDER,
|
|
277
278
|
side: OrderSide.listing,
|
|
278
279
|
status: OrderStatus.active,
|
|
280
|
+
slug: 'test-order',
|
|
279
281
|
},
|
|
280
282
|
orderbookKind: OrderbookKind.sequence_marketplace_v1,
|
|
281
283
|
onCannotPerformAction: fn(),
|
|
@@ -30,6 +30,7 @@ type ActionButtonProps = {
|
|
|
30
30
|
quantityDecimals?: number;
|
|
31
31
|
quantityRemaining?: number;
|
|
32
32
|
unlimitedSupply?: boolean;
|
|
33
|
+
hideQuantitySelector?: boolean;
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
export function ActionButton({
|
|
@@ -49,6 +50,7 @@ export function ActionButton({
|
|
|
49
50
|
quantityDecimals,
|
|
50
51
|
quantityRemaining,
|
|
51
52
|
unlimitedSupply,
|
|
53
|
+
hideQuantitySelector,
|
|
52
54
|
}: ActionButtonProps) {
|
|
53
55
|
const { shouldShowAction, isOwnerAction } = useActionButtonLogic({
|
|
54
56
|
tokenId,
|
|
@@ -87,6 +89,7 @@ export function ActionButton({
|
|
|
87
89
|
quantityDecimals,
|
|
88
90
|
quantityRemaining,
|
|
89
91
|
unlimitedSupply,
|
|
92
|
+
hideQuantitySelector,
|
|
90
93
|
}
|
|
91
94
|
: {
|
|
92
95
|
cardType: 'market' as const,
|
|
@@ -98,6 +101,7 @@ export function ActionButton({
|
|
|
98
101
|
chainId,
|
|
99
102
|
quantityDecimals,
|
|
100
103
|
quantityRemaining,
|
|
104
|
+
hideQuantitySelector,
|
|
101
105
|
};
|
|
102
106
|
|
|
103
107
|
return <NonOwnerActions {...nonOwnerProps} />;
|
|
@@ -16,6 +16,7 @@ type NonOwnerActionsBaseProps = {
|
|
|
16
16
|
quantityDecimals?: number;
|
|
17
17
|
quantityRemaining?: number;
|
|
18
18
|
unlimitedSupply?: boolean;
|
|
19
|
+
hideQuantitySelector?: boolean;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
type ShopNonOwnerActionsProps = NonOwnerActionsBaseProps & {
|
|
@@ -51,6 +52,7 @@ export function NonOwnerActions(props: NonOwnerActionsProps) {
|
|
|
51
52
|
quantityRemaining,
|
|
52
53
|
unlimitedSupply,
|
|
53
54
|
cardType,
|
|
55
|
+
hideQuantitySelector,
|
|
54
56
|
} = props;
|
|
55
57
|
|
|
56
58
|
const { show: showBuyModal } = useBuyModal();
|
|
@@ -83,6 +85,7 @@ export function NonOwnerActions(props: NonOwnerActionsProps) {
|
|
|
83
85
|
quantityDecimals: quantityDecimals ?? 0,
|
|
84
86
|
quantityRemaining: quantityRemaining ?? 0,
|
|
85
87
|
unlimitedSupply,
|
|
88
|
+
hideQuantitySelector,
|
|
86
89
|
})
|
|
87
90
|
}
|
|
88
91
|
icon={SvgCartIcon}
|
|
@@ -111,6 +114,7 @@ export function NonOwnerActions(props: NonOwnerActionsProps) {
|
|
|
111
114
|
orderId: lowestListing.orderId,
|
|
112
115
|
marketplace: lowestListing.marketplace,
|
|
113
116
|
cardType: 'market',
|
|
117
|
+
hideQuantitySelector,
|
|
114
118
|
})
|
|
115
119
|
}
|
|
116
120
|
icon={SvgCartIcon}
|
package/src/react/ui/components/marketplace-collectible-card/components/ActionButtonWrapper.tsx
CHANGED
|
@@ -28,6 +28,7 @@ interface ActionButtonWrapperProps {
|
|
|
28
28
|
quantityDecimals?: number;
|
|
29
29
|
quantityRemaining?: number;
|
|
30
30
|
unlimitedSupply?: boolean;
|
|
31
|
+
hideQuantitySelector?: boolean;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export function ActionButtonWrapper({
|
|
@@ -48,6 +49,7 @@ export function ActionButtonWrapper({
|
|
|
48
49
|
quantityDecimals,
|
|
49
50
|
quantityRemaining,
|
|
50
51
|
unlimitedSupply,
|
|
52
|
+
hideQuantitySelector,
|
|
51
53
|
}: ActionButtonWrapperProps) {
|
|
52
54
|
if (!show) return null;
|
|
53
55
|
|
|
@@ -70,6 +72,7 @@ export function ActionButtonWrapper({
|
|
|
70
72
|
quantityDecimals={quantityDecimals}
|
|
71
73
|
quantityRemaining={quantityRemaining}
|
|
72
74
|
unlimitedSupply={unlimitedSupply}
|
|
75
|
+
hideQuantitySelector={hideQuantitySelector}
|
|
73
76
|
/>
|
|
74
77
|
</div>
|
|
75
78
|
);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type Currency,
|
|
10
10
|
type Order,
|
|
11
11
|
} from '../../../../../_internal';
|
|
12
|
-
import { useCurrency
|
|
12
|
+
import { useCurrency } from '../../../../../hooks';
|
|
13
13
|
import {
|
|
14
14
|
FooterName,
|
|
15
15
|
PriceDisplay,
|
|
@@ -19,13 +19,12 @@ import {
|
|
|
19
19
|
|
|
20
20
|
type FooterProps = {
|
|
21
21
|
chainId: number;
|
|
22
|
-
collectionAddress: Address;
|
|
23
|
-
collectibleId: string;
|
|
24
22
|
name: string;
|
|
25
23
|
type?: ContractType;
|
|
26
24
|
decimals?: number;
|
|
27
25
|
onOfferClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
28
26
|
highestOffer?: Order;
|
|
27
|
+
lowestListing?: Order;
|
|
29
28
|
balance?: string;
|
|
30
29
|
quantityInitial?: string | undefined;
|
|
31
30
|
quantityRemaining?: string | undefined;
|
|
@@ -37,13 +36,12 @@ type FooterProps = {
|
|
|
37
36
|
|
|
38
37
|
export const Footer = ({
|
|
39
38
|
chainId,
|
|
40
|
-
collectionAddress,
|
|
41
|
-
collectibleId,
|
|
42
39
|
name,
|
|
43
40
|
type,
|
|
44
41
|
decimals,
|
|
45
42
|
onOfferClick,
|
|
46
43
|
highestOffer,
|
|
44
|
+
lowestListing,
|
|
47
45
|
balance,
|
|
48
46
|
quantityInitial,
|
|
49
47
|
quantityRemaining,
|
|
@@ -56,16 +54,6 @@ export const Footer = ({
|
|
|
56
54
|
const isMarket = cardType === 'market';
|
|
57
55
|
const isInventoryNonTradable = cardType === 'inventory-non-tradable';
|
|
58
56
|
|
|
59
|
-
const { data: lowestListing, isLoading: isLowestListingLoading } =
|
|
60
|
-
useLowestListing({
|
|
61
|
-
chainId,
|
|
62
|
-
collectionAddress,
|
|
63
|
-
tokenId: collectibleId,
|
|
64
|
-
query: {
|
|
65
|
-
enabled: isMarket, // Only fetch for market cards
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
|
|
69
57
|
const { data: currency, isLoading: isCurrencyLoading } = useCurrency({
|
|
70
58
|
chainId,
|
|
71
59
|
currencyAddress: lowestListing?.priceCurrencyAddress as Address,
|
|
@@ -79,9 +67,7 @@ export const Footer = ({
|
|
|
79
67
|
|
|
80
68
|
// Show loading state when listing is loading, or when listing exists but currency is still loading
|
|
81
69
|
const isPriceLoading =
|
|
82
|
-
isMarket &&
|
|
83
|
-
(isLowestListingLoading ||
|
|
84
|
-
(!!lowestListing?.priceCurrencyAddress && isCurrencyLoading));
|
|
70
|
+
isMarket && !!lowestListing?.priceCurrencyAddress && isCurrencyLoading;
|
|
85
71
|
|
|
86
72
|
return (
|
|
87
73
|
<div className="relative flex flex-col items-start gap-2 whitespace-nowrap bg-background-primary p-4">
|
|
@@ -22,9 +22,11 @@ export function MarketCard({
|
|
|
22
22
|
balanceIsLoading = false,
|
|
23
23
|
onCannotPerformAction,
|
|
24
24
|
prioritizeOwnerActions,
|
|
25
|
+
hideQuantitySelector,
|
|
25
26
|
}: MarketCollectibleCardProps) {
|
|
26
27
|
const collectibleMetadata = collectible?.metadata;
|
|
27
28
|
const highestOffer = collectible?.offer;
|
|
29
|
+
const lowestListing = collectible?.listing;
|
|
28
30
|
|
|
29
31
|
if (!collectibleMetadata) {
|
|
30
32
|
console.error('Collectible metadata is undefined');
|
|
@@ -66,15 +68,15 @@ export function MarketCard({
|
|
|
66
68
|
isShop={false}
|
|
67
69
|
onClick={() => onCollectibleClick?.(collectibleId)}
|
|
68
70
|
onKeyDown={handleKeyDown}
|
|
71
|
+
hideQuantitySelector={hideQuantitySelector}
|
|
69
72
|
>
|
|
70
73
|
<Footer
|
|
71
74
|
chainId={chainId}
|
|
72
|
-
collectionAddress={collectionAddress}
|
|
73
|
-
collectibleId={collectibleId}
|
|
74
75
|
name={collectibleMetadata.name || ''}
|
|
75
76
|
type={collectionType}
|
|
76
77
|
onOfferClick={(e) => onOfferClick?.({ order: highestOffer, e })}
|
|
77
78
|
highestOffer={highestOffer}
|
|
79
|
+
lowestListing={lowestListing}
|
|
78
80
|
balance={balance}
|
|
79
81
|
decimals={collectibleMetadata.decimals}
|
|
80
82
|
quantityInitial={
|
|
@@ -107,6 +109,7 @@ export function MarketCard({
|
|
|
107
109
|
onCannotPerformAction={onCannotPerformAction}
|
|
108
110
|
cardType="market"
|
|
109
111
|
prioritizeOwnerActions={prioritizeOwnerActions}
|
|
112
|
+
hideQuantitySelector={hideQuantitySelector}
|
|
110
113
|
/>
|
|
111
114
|
</BaseCard>
|
|
112
115
|
);
|
|
@@ -23,6 +23,7 @@ export function ShopCard({
|
|
|
23
23
|
quantityInitial,
|
|
24
24
|
quantityRemaining,
|
|
25
25
|
unlimitedSupply,
|
|
26
|
+
hideQuantitySelector,
|
|
26
27
|
}: ShopCollectibleCardProps) {
|
|
27
28
|
const { data: saleCurrency, isLoading: saleCurrencyLoading } = useCurrency({
|
|
28
29
|
chainId,
|
|
@@ -73,11 +74,10 @@ export function ShopCard({
|
|
|
73
74
|
mediaClassName={mediaClassName}
|
|
74
75
|
contractType={collectionType as ContractType}
|
|
75
76
|
isShop={true}
|
|
77
|
+
hideQuantitySelector={hideQuantitySelector}
|
|
76
78
|
>
|
|
77
79
|
<Footer
|
|
78
80
|
chainId={chainId}
|
|
79
|
-
collectionAddress={collectionAddress}
|
|
80
|
-
collectibleId={collectibleId}
|
|
81
81
|
name={tokenMetadata.name || ''}
|
|
82
82
|
type={collectionType}
|
|
83
83
|
decimals={tokenMetadata.decimals}
|
|
@@ -140,6 +140,7 @@ const mockOrder = {
|
|
|
140
140
|
blockNumber: 1234567,
|
|
141
141
|
createdAt: new Date().toISOString(),
|
|
142
142
|
updatedAt: new Date().toISOString(),
|
|
143
|
+
slug: 'test-order',
|
|
143
144
|
};
|
|
144
145
|
|
|
145
146
|
const mockCheckoutOptions = {
|
|
@@ -161,6 +162,8 @@ const mockCurrency = {
|
|
|
161
162
|
exchangeRate: 3000,
|
|
162
163
|
defaultChainCurrency: true,
|
|
163
164
|
nativeCurrency: true,
|
|
165
|
+
openseaListing: true,
|
|
166
|
+
openseaOffer: true,
|
|
164
167
|
createdAt: new Date().toISOString(),
|
|
165
168
|
updatedAt: new Date().toISOString(),
|
|
166
169
|
};
|
|
@@ -8,6 +8,9 @@ import type { ContractInfo, TokenMetadata } from '@0xsequence/metadata';
|
|
|
8
8
|
import { useEffect } from 'react';
|
|
9
9
|
import type { Address } from 'viem';
|
|
10
10
|
import type { CheckoutOptions, Order } from '../../../../_internal';
|
|
11
|
+
import { ErrorLogBox } from '../../../components/_internals/ErrorLogBox';
|
|
12
|
+
import { ActionModal } from '../../_internal/components/actionModal';
|
|
13
|
+
import { LoadingModal } from '../../_internal/components/actionModal/LoadingModal';
|
|
11
14
|
import { usePaymentModalParams } from '../hooks/usePaymentModalParams';
|
|
12
15
|
import {
|
|
13
16
|
buyModalStore,
|
|
@@ -44,20 +47,43 @@ export const ERC1155BuyModal = ({
|
|
|
44
47
|
const quantityRemaining = isShop
|
|
45
48
|
? modalProps.quantityRemaining?.toString()
|
|
46
49
|
: order?.quantityRemaining;
|
|
50
|
+
const unlimitedSupply = isShop ? modalProps.unlimitedSupply : false;
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (modalProps.hideQuantitySelector && !quantity) {
|
|
54
|
+
const minQuantity = quantityDecimals > 0 ? 10 ** quantityDecimals : 1;
|
|
55
|
+
|
|
56
|
+
const autoQuantity = unlimitedSupply
|
|
57
|
+
? minQuantity
|
|
58
|
+
: Math.min(Number(quantityRemaining), minQuantity);
|
|
59
|
+
|
|
60
|
+
buyModalStore.send({
|
|
61
|
+
type: 'setQuantity',
|
|
62
|
+
quantity: autoQuantity,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, [
|
|
66
|
+
modalProps.hideQuantitySelector,
|
|
67
|
+
quantity,
|
|
68
|
+
quantityDecimals,
|
|
69
|
+
unlimitedSupply,
|
|
70
|
+
quantityRemaining,
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
if (!quantity && !modalProps.hideQuantitySelector) {
|
|
49
74
|
return (
|
|
50
75
|
<ERC1155QuantityModal
|
|
51
76
|
order={order}
|
|
52
77
|
cardType={cardType}
|
|
53
78
|
quantityDecimals={quantityDecimals}
|
|
54
79
|
quantityRemaining={quantityRemaining}
|
|
80
|
+
unlimitedSupply={unlimitedSupply}
|
|
55
81
|
chainId={chainId}
|
|
56
82
|
/>
|
|
57
83
|
);
|
|
58
84
|
}
|
|
59
85
|
|
|
60
|
-
if (!checkoutOptions) {
|
|
86
|
+
if (!checkoutOptions || !quantity) {
|
|
61
87
|
return null;
|
|
62
88
|
}
|
|
63
89
|
|
|
@@ -91,6 +117,7 @@ const Modal = ({
|
|
|
91
117
|
data: paymentModalParams,
|
|
92
118
|
isLoading: isPaymentModalParamsLoading,
|
|
93
119
|
isError: isPaymentModalParamsError,
|
|
120
|
+
failureReason,
|
|
94
121
|
} = usePaymentModalParams({
|
|
95
122
|
address,
|
|
96
123
|
quantity,
|
|
@@ -101,8 +128,43 @@ const Modal = ({
|
|
|
101
128
|
enabled: true,
|
|
102
129
|
});
|
|
103
130
|
|
|
131
|
+
if (failureReason) {
|
|
132
|
+
return (
|
|
133
|
+
<ActionModal
|
|
134
|
+
isOpen={true}
|
|
135
|
+
onClose={() => {
|
|
136
|
+
buyModalStore.send({ type: 'close' });
|
|
137
|
+
}}
|
|
138
|
+
title={'An error occurred while purchasing'}
|
|
139
|
+
children={
|
|
140
|
+
<ErrorLogBox
|
|
141
|
+
title={failureReason.name}
|
|
142
|
+
message={failureReason.message}
|
|
143
|
+
error={failureReason}
|
|
144
|
+
/>
|
|
145
|
+
}
|
|
146
|
+
ctas={[
|
|
147
|
+
{
|
|
148
|
+
label: 'Close',
|
|
149
|
+
onClick: () => {
|
|
150
|
+
buyModalStore.send({ type: 'close' });
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
]}
|
|
154
|
+
chainId={order.chainId}
|
|
155
|
+
/>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
104
159
|
if (isPaymentModalParamsLoading || !paymentModalParams) {
|
|
105
|
-
return
|
|
160
|
+
return (
|
|
161
|
+
<LoadingModal
|
|
162
|
+
isOpen={true}
|
|
163
|
+
chainId={order.chainId}
|
|
164
|
+
onClose={() => buyModalStore.send({ type: 'close' })}
|
|
165
|
+
title="Loading checkout"
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
106
168
|
}
|
|
107
169
|
|
|
108
170
|
if (isPaymentModalParamsError) {
|
|
@@ -8,6 +8,8 @@ import type { ContractInfo, TokenMetadata } from '@0xsequence/metadata';
|
|
|
8
8
|
import { useEffect } from 'react';
|
|
9
9
|
import type { Address } from 'viem';
|
|
10
10
|
import type { CheckoutOptions, Order } from '../../../../_internal';
|
|
11
|
+
import { ErrorLogBox } from '../../../components/_internals/ErrorLogBox';
|
|
12
|
+
import { ActionModal } from '../../_internal/components/actionModal';
|
|
11
13
|
import { usePaymentModalParams } from '../hooks/usePaymentModalParams';
|
|
12
14
|
import { buyModalStore, usePaymentModalState, useQuantity } from '../store';
|
|
13
15
|
|
|
@@ -39,6 +41,7 @@ export const ERC721BuyModal = ({
|
|
|
39
41
|
data: paymentModalParams,
|
|
40
42
|
isLoading: isPaymentModalParamsLoading,
|
|
41
43
|
isError: isPaymentModalParamsError,
|
|
44
|
+
failureReason,
|
|
42
45
|
} = usePaymentModalParams({
|
|
43
46
|
address,
|
|
44
47
|
quantity: quantity ?? undefined,
|
|
@@ -49,6 +52,34 @@ export const ERC721BuyModal = ({
|
|
|
49
52
|
enabled: true,
|
|
50
53
|
});
|
|
51
54
|
|
|
55
|
+
if (failureReason) {
|
|
56
|
+
return (
|
|
57
|
+
<ActionModal
|
|
58
|
+
isOpen={true}
|
|
59
|
+
onClose={() => {
|
|
60
|
+
buyModalStore.send({ type: 'close' });
|
|
61
|
+
}}
|
|
62
|
+
title={'An error occurred while purchasing'}
|
|
63
|
+
children={
|
|
64
|
+
<ErrorLogBox
|
|
65
|
+
title={failureReason.name}
|
|
66
|
+
message={failureReason.message}
|
|
67
|
+
error={failureReason}
|
|
68
|
+
/>
|
|
69
|
+
}
|
|
70
|
+
ctas={[
|
|
71
|
+
{
|
|
72
|
+
label: 'Close',
|
|
73
|
+
onClick: () => {
|
|
74
|
+
buyModalStore.send({ type: 'close' });
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
]}
|
|
78
|
+
chainId={order.chainId}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
52
83
|
// Show loading or error states would be handled by parent router
|
|
53
84
|
if (isPaymentModalParamsLoading || !paymentModalParams) {
|
|
54
85
|
return null;
|
|
@@ -59,6 +59,7 @@ describe('getERC721SalePaymentParams', () => {
|
|
|
59
59
|
nativeTokenAddress: undefined,
|
|
60
60
|
checkoutProvider: undefined,
|
|
61
61
|
quantity: 1,
|
|
62
|
+
onRampProvider: undefined,
|
|
62
63
|
};
|
|
63
64
|
|
|
64
65
|
const result = await getERC721SalePaymentParams(params);
|
|
@@ -101,6 +102,7 @@ describe('getERC721SalePaymentParams', () => {
|
|
|
101
102
|
nativeTokenAddress: undefined,
|
|
102
103
|
checkoutProvider: 'stripe',
|
|
103
104
|
quantity: 1,
|
|
105
|
+
onRampProvider: undefined,
|
|
104
106
|
};
|
|
105
107
|
|
|
106
108
|
const result = await getERC721SalePaymentParams(params);
|
|
@@ -122,6 +124,7 @@ describe('getERC721SalePaymentParams', () => {
|
|
|
122
124
|
nativeTokenAddress: undefined,
|
|
123
125
|
checkoutProvider: undefined,
|
|
124
126
|
quantity: 1,
|
|
127
|
+
onRampProvider: undefined,
|
|
125
128
|
};
|
|
126
129
|
|
|
127
130
|
const result = await getERC721SalePaymentParams(params);
|
|
@@ -143,6 +146,7 @@ describe('getERC721SalePaymentParams', () => {
|
|
|
143
146
|
nativeTokenAddress: undefined,
|
|
144
147
|
checkoutProvider: undefined,
|
|
145
148
|
quantity: 5,
|
|
149
|
+
onRampProvider: undefined,
|
|
146
150
|
};
|
|
147
151
|
|
|
148
152
|
const result = await getERC721SalePaymentParams(params);
|
|
@@ -245,7 +249,22 @@ describe('useERC721SalePaymentParams', () => {
|
|
|
245
249
|
expect(result.current.data).toBeUndefined();
|
|
246
250
|
});
|
|
247
251
|
|
|
248
|
-
it('should use proper query key', () => {
|
|
252
|
+
it('should use proper query key', async () => {
|
|
253
|
+
// Ensure useAccount returns a connected address
|
|
254
|
+
const { useAccount } = vi.mocked(await import('wagmi'));
|
|
255
|
+
useAccount.mockReturnValue({
|
|
256
|
+
address: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' as Address,
|
|
257
|
+
isConnected: true,
|
|
258
|
+
isConnecting: false,
|
|
259
|
+
isDisconnected: false,
|
|
260
|
+
isReconnecting: false,
|
|
261
|
+
connector: null,
|
|
262
|
+
addresses: undefined,
|
|
263
|
+
chain: undefined,
|
|
264
|
+
chainId: undefined,
|
|
265
|
+
status: 'connected',
|
|
266
|
+
} as never);
|
|
267
|
+
|
|
249
268
|
const args = {
|
|
250
269
|
salesContractAddress: mockSalesContractAddress,
|
|
251
270
|
collectionAddress: mockCollectionAddress,
|