@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { GetTokenBalancesReturn, Page } from '@0xsequence/indexer';
|
|
2
2
|
import { infiniteQueryOptions } from '@tanstack/react-query';
|
|
3
3
|
import type { Address, Hex } from 'viem';
|
|
4
|
-
import type { SdkConfig } from '
|
|
5
|
-
import { balanceQueries, getIndexerClient, LaosAPI } from '
|
|
4
|
+
import type { SdkConfig } from '../../../types';
|
|
5
|
+
import { balanceQueries, getIndexerClient, LaosAPI } from '../../_internal';
|
|
6
6
|
|
|
7
7
|
export type UseListBalancesArgs = {
|
|
8
8
|
chainId: number;
|
|
@@ -55,6 +55,21 @@ export async function fetchBalances(
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
export function getListBalancesQueryKey(args: UseListBalancesArgs) {
|
|
59
|
+
const apiArgs = {
|
|
60
|
+
chainId: args.chainId,
|
|
61
|
+
accountAddress: args.accountAddress,
|
|
62
|
+
contractAddress: args.contractAddress,
|
|
63
|
+
tokenID: args.tokenId,
|
|
64
|
+
includeMetadata: args.includeMetadata,
|
|
65
|
+
metadataOptions: args.metadataOptions,
|
|
66
|
+
includeCollectionTokens: args.includeCollectionTokens,
|
|
67
|
+
isLaos721: args.isLaos721,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return [...balanceQueries.lists, apiArgs] as const;
|
|
71
|
+
}
|
|
72
|
+
|
|
58
73
|
/**
|
|
59
74
|
* Creates a tanstack infinite query options object for the balances query
|
|
60
75
|
*
|
|
@@ -68,7 +83,7 @@ export function listBalancesOptions(
|
|
|
68
83
|
) {
|
|
69
84
|
return infiniteQueryOptions({
|
|
70
85
|
...args.query,
|
|
71
|
-
queryKey:
|
|
86
|
+
queryKey: getListBalancesQueryKey(args),
|
|
72
87
|
queryFn: ({ pageParam }) => fetchBalances(args, config, pageParam),
|
|
73
88
|
initialPageParam: { page: 1, pageSize: 30 } as Page,
|
|
74
89
|
getNextPageParam: (lastPage) => lastPage.page.after,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { GetTokenMetadataArgs } from '@0xsequence/metadata';
|
|
1
2
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
|
-
import type { SdkConfig } from '
|
|
3
|
+
import type { SdkConfig } from '../../../types';
|
|
3
4
|
import {
|
|
4
5
|
getMetadataClient,
|
|
6
|
+
type QueryKeyArgs,
|
|
5
7
|
tokenKeys,
|
|
6
8
|
type ValuesOptional,
|
|
7
|
-
} from '
|
|
8
|
-
import type { StandardQueryOptions } from '
|
|
9
|
+
} from '../../_internal';
|
|
10
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
9
11
|
|
|
10
12
|
export interface FetchListTokenMetadataParams {
|
|
11
13
|
chainId: number;
|
|
@@ -37,6 +39,18 @@ export type ListTokenMetadataQueryOptions =
|
|
|
37
39
|
query?: StandardQueryOptions;
|
|
38
40
|
};
|
|
39
41
|
|
|
42
|
+
export function getListTokenMetadataQueryKey(
|
|
43
|
+
params: ListTokenMetadataQueryOptions,
|
|
44
|
+
) {
|
|
45
|
+
const apiArgs = {
|
|
46
|
+
chainID: String(params.chainId),
|
|
47
|
+
contractAddress: params.contractAddress,
|
|
48
|
+
tokenIDs: params.tokenIds,
|
|
49
|
+
} satisfies QueryKeyArgs<GetTokenMetadataArgs>;
|
|
50
|
+
|
|
51
|
+
return [...tokenKeys.metadata, apiArgs] as const;
|
|
52
|
+
}
|
|
53
|
+
|
|
40
54
|
export function listTokenMetadataQueryOptions(
|
|
41
55
|
params: ListTokenMetadataQueryOptions,
|
|
42
56
|
) {
|
|
@@ -49,7 +63,7 @@ export function listTokenMetadataQueryOptions(
|
|
|
49
63
|
);
|
|
50
64
|
|
|
51
65
|
return queryOptions({
|
|
52
|
-
queryKey:
|
|
66
|
+
queryKey: getListTokenMetadataQueryKey(params),
|
|
53
67
|
queryFn: () =>
|
|
54
68
|
fetchListTokenMetadata({
|
|
55
69
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
Filter,
|
|
3
3
|
Page,
|
|
4
|
+
SearchTokenMetadataArgs,
|
|
4
5
|
SearchTokenMetadataReturn,
|
|
5
6
|
} from '@0xsequence/metadata';
|
|
6
7
|
import { infiniteQueryOptions } from '@tanstack/react-query';
|
|
7
|
-
import type { SdkConfig } from '
|
|
8
|
+
import type { SdkConfig } from '../../../types';
|
|
8
9
|
import {
|
|
9
10
|
getMetadataClient,
|
|
11
|
+
type QueryKeyArgs,
|
|
10
12
|
tokenKeys,
|
|
11
13
|
type ValuesOptional,
|
|
12
|
-
} from '
|
|
13
|
-
import type { StandardQueryOptions } from '
|
|
14
|
+
} from '../../_internal';
|
|
15
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
14
16
|
|
|
15
17
|
export interface FetchSearchTokenMetadataParams {
|
|
16
18
|
chainId: number;
|
|
@@ -47,6 +49,18 @@ export type SearchTokenMetadataQueryOptions =
|
|
|
47
49
|
query?: StandardQueryOptions;
|
|
48
50
|
};
|
|
49
51
|
|
|
52
|
+
export function getSearchTokenMetadataQueryKey(
|
|
53
|
+
params: SearchTokenMetadataQueryOptions,
|
|
54
|
+
) {
|
|
55
|
+
const apiArgs = {
|
|
56
|
+
chainID: String(params.chainId!),
|
|
57
|
+
contractAddress: params.collectionAddress!,
|
|
58
|
+
filter: params.filter,
|
|
59
|
+
} satisfies QueryKeyArgs<Omit<SearchTokenMetadataArgs, 'page'>>;
|
|
60
|
+
|
|
61
|
+
return [...tokenKeys.metadata, 'search', apiArgs] as const;
|
|
62
|
+
}
|
|
63
|
+
|
|
50
64
|
export function searchTokenMetadataQueryOptions(
|
|
51
65
|
params: SearchTokenMetadataQueryOptions,
|
|
52
66
|
) {
|
|
@@ -60,7 +74,7 @@ export function searchTokenMetadataQueryOptions(
|
|
|
60
74
|
const initialPageParam = { page: 1, pageSize: 30 };
|
|
61
75
|
|
|
62
76
|
return infiniteQueryOptions({
|
|
63
|
-
queryKey:
|
|
77
|
+
queryKey: getSearchTokenMetadataQueryKey(params),
|
|
64
78
|
queryFn: ({ pageParam = initialPageParam }) =>
|
|
65
79
|
fetchSearchTokenMetadata({
|
|
66
80
|
// biome-ignore lint/style/noNonNullAssertion: The enabled check above ensures these are not undefined
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { GetTokenSuppliesArgs, Page } from '@0xsequence/indexer';
|
|
2
2
|
import { infiniteQueryOptions } from '@tanstack/react-query';
|
|
3
|
-
import type { SdkConfig } from '
|
|
3
|
+
import type { SdkConfig } from '../../../types';
|
|
4
4
|
import {
|
|
5
5
|
getIndexerClient,
|
|
6
6
|
LaosAPI,
|
|
7
7
|
tokenKeys,
|
|
8
8
|
type ValuesOptional,
|
|
9
|
-
} from '
|
|
10
|
-
import type { StandardInfiniteQueryOptions } from '
|
|
9
|
+
} from '../../_internal';
|
|
10
|
+
import type { StandardInfiniteQueryOptions } from '../../types/query';
|
|
11
11
|
|
|
12
12
|
export interface FetchTokenSuppliesParams
|
|
13
13
|
extends Omit<GetTokenSuppliesArgs, 'contractAddress'> {
|
|
@@ -65,6 +65,18 @@ export type TokenSuppliesQueryOptions =
|
|
|
65
65
|
query?: StandardInfiniteQueryOptions;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
export function getTokenSuppliesQueryKey(params: TokenSuppliesQueryOptions) {
|
|
69
|
+
const apiArgs = {
|
|
70
|
+
chainId: params.chainId!,
|
|
71
|
+
contractAddress: params.collectionAddress!,
|
|
72
|
+
includeMetadata: params.includeMetadata,
|
|
73
|
+
metadataOptions: params.metadataOptions,
|
|
74
|
+
isLaos721: params.isLaos721,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return [...tokenKeys.supplies, apiArgs] as const;
|
|
78
|
+
}
|
|
79
|
+
|
|
68
80
|
export function tokenSuppliesQueryOptions(params: TokenSuppliesQueryOptions) {
|
|
69
81
|
const enabled = Boolean(
|
|
70
82
|
params.chainId &&
|
|
@@ -90,7 +102,7 @@ export function tokenSuppliesQueryOptions(params: TokenSuppliesQueryOptions) {
|
|
|
90
102
|
});
|
|
91
103
|
|
|
92
104
|
return infiniteQueryOptions({
|
|
93
|
-
queryKey:
|
|
105
|
+
queryKey: getTokenSuppliesQueryKey(params),
|
|
94
106
|
queryFn,
|
|
95
107
|
initialPageParam,
|
|
96
108
|
getNextPageParam: (lastPage) =>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { queryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import type { SdkConfig } from '
|
|
4
|
-
import type
|
|
5
|
-
import type { StandardQueryOptions } from '
|
|
3
|
+
import type { SdkConfig } from '../../../types';
|
|
4
|
+
import { currencyKeys, type ValuesOptional } from '../../_internal';
|
|
5
|
+
import type { StandardQueryOptions } from '../../types/query';
|
|
6
6
|
import { fetchConvertPriceToUSD } from './convertPriceToUSD';
|
|
7
7
|
|
|
8
8
|
export interface FetchComparePricesParams {
|
|
@@ -74,6 +74,18 @@ export type ComparePricesQueryOptions =
|
|
|
74
74
|
query?: StandardQueryOptions;
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
export function getComparePricesQueryKey(params: ComparePricesQueryOptions) {
|
|
78
|
+
const apiArgs = {
|
|
79
|
+
chainId: params.chainId!,
|
|
80
|
+
priceAmountRaw: params.priceAmountRaw!,
|
|
81
|
+
priceCurrencyAddress: params.priceCurrencyAddress!,
|
|
82
|
+
compareToPriceAmountRaw: params.compareToPriceAmountRaw!,
|
|
83
|
+
compareToPriceCurrencyAddress: params.compareToPriceCurrencyAddress!,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return [...currencyKeys.conversion, 'compare', apiArgs] as const;
|
|
87
|
+
}
|
|
88
|
+
|
|
77
89
|
export function comparePricesQueryOptions(params: ComparePricesQueryOptions) {
|
|
78
90
|
const enabled = Boolean(
|
|
79
91
|
params.chainId &&
|
|
@@ -86,7 +98,7 @@ export function comparePricesQueryOptions(params: ComparePricesQueryOptions) {
|
|
|
86
98
|
);
|
|
87
99
|
|
|
88
100
|
return queryOptions({
|
|
89
|
-
queryKey:
|
|
101
|
+
queryKey: getComparePricesQueryKey(params),
|
|
90
102
|
queryFn: () =>
|
|
91
103
|
fetchComparePrices({
|
|
92
104
|
// 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
|
+
};
|
|
@@ -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
|
);
|
|
@@ -22,6 +22,7 @@ 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;
|
|
@@ -66,6 +67,7 @@ export function MarketCard({
|
|
|
66
67
|
isShop={false}
|
|
67
68
|
onClick={() => onCollectibleClick?.(collectibleId)}
|
|
68
69
|
onKeyDown={handleKeyDown}
|
|
70
|
+
hideQuantitySelector={hideQuantitySelector}
|
|
69
71
|
>
|
|
70
72
|
<Footer
|
|
71
73
|
chainId={chainId}
|
|
@@ -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,6 +74,7 @@ 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}
|
|
@@ -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;
|