@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,28 +1,37 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { DEFAULT_MARKETPLACE_FEE_PERCENTAGE } from "./src-Dz2CfBL0.js";
|
|
3
3
|
import { BaseError as BaseError$1, ChainSwitchError, InvalidContractTypeError, NoWalletConnectedError, TransactionExecutionError, TransactionSignatureError, UserRejectedRequestError as UserRejectedRequestError$1 } from "./transaction-DZUW5RHu.js";
|
|
4
|
-
import { balanceQueries, collectableKeys, getMarketplaceClient, getQueryClient, getSequenceApiClient } from "./api-
|
|
5
|
-
import { CollectionStatus, ContractType, ExecuteType, OrderSide, OrderbookKind, PropertyType, StepType, WalletKind } from "./marketplace.gen-
|
|
4
|
+
import { balanceQueries, collectableKeys, getMarketplaceClient, getQueryClient, getSequenceApiClient, marketplaceApiURL } from "./api-BoO0V5aJ.js";
|
|
5
|
+
import { CollectionStatus, ContractType, ExecuteType, OrderSide, OrderbookKind, PropertyType, StepType, WalletKind } from "./marketplace.gen-ksUafDqS.js";
|
|
6
6
|
import { getNetwork, getPresentableChainName } from "./network-DtmiMhcg.js";
|
|
7
7
|
import { PROVIDER_ID, TransactionType } from "./_internal-DkS2VUn5.js";
|
|
8
8
|
import { CollectibleCardAction } from "./types-B_-cnkcP.js";
|
|
9
|
-
import { EIP2981_ABI, SequenceMarketplaceV1_ABI } from "./marketplace-
|
|
10
|
-
import { ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "./primary-sale-
|
|
11
|
-
import { ERC1155_ABI, ERC721_ABI } from "./token-
|
|
12
|
-
import { calculateEarningsAfterFees, cn as cn$1, compareAddress, formatPriceWithFee, truncateMiddle } from "./utils-
|
|
13
|
-
import { marketplaceConfigOptions } from "./marketplaceConfig-
|
|
14
|
-
import { SalesContractVersion, useSalesContractABI } from "./contracts-
|
|
15
|
-
import { balanceOfCollectibleOptions,
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
9
|
+
import { EIP2981_ABI, SequenceMarketplaceV1_ABI } from "./marketplace-NQB-sEQL.js";
|
|
10
|
+
import { ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "./primary-sale-1u4QlPdA.js";
|
|
11
|
+
import { ERC1155_ABI, ERC721_ABI } from "./token-Cv7l2ZaL.js";
|
|
12
|
+
import { calculateEarningsAfterFees, cn as cn$1, compareAddress, formatPriceWithFee, truncateMiddle } from "./utils-BfpDVibN.js";
|
|
13
|
+
import { marketplaceConfigOptions } from "./marketplaceConfig-UHQMM9fq.js";
|
|
14
|
+
import { SalesContractVersion, useSalesContractABI } from "./contracts-BP_0vX48.js";
|
|
15
|
+
import { balanceOfCollectibleOptions, collectibleQueryOptions, countOfCollectablesQueryOptions, listCollectibleActivitiesQueryOptions, listCollectiblesPaginatedQueryOptions, listCollectiblesQueryOptions } from "./collectibles-C_H8jMGH.js";
|
|
16
|
+
import { listBalancesOptions } from "./listBalances-BxpxBCvn.js";
|
|
17
|
+
import { collectionBalanceDetailsQueryOptions, collectionDetailsQueryOptions, collectionQueryOptions, listCollectionActivitiesQueryOptions, listCollectionsQueryOptions } from "./collections-CKummc-R.js";
|
|
18
|
+
import { checkoutOptionsQueryOptions, checkoutOptionsSalesContractQueryOptions, currencyQueryOptions, filtersQueryOptions } from "./market-C3HV-awQ.js";
|
|
19
|
+
import { marketCurrenciesQueryOptions } from "./marketCurrencies-sKrTX0og.js";
|
|
20
|
+
import { countItemsOrdersForCollectionQueryOptions, countListingsForCollectibleQueryOptions, countOffersForCollectibleQueryOptions, floorOrderQueryOptions, getCountOfFilteredOrdersQueryOptions, highestOfferQueryOptions, listItemsOrdersForCollectionPaginatedQueryOptions, listItemsOrdersForCollectionQueryOptions, listListingsForCollectibleQueryOptions, listOffersForCollectibleQueryOptions, lowestListingQueryOptions } from "./orders-DnFfZAXV.js";
|
|
21
|
+
import { inventoryOptions } from "./inventory-Dd7TazvZ.js";
|
|
22
|
+
import { countOfPrimarySaleItemsOptions, listPrimarySaleItemsQueryOptions, primarySaleItemsCountQueryOptions } from "./primary-sales-Dmsi6bqj.js";
|
|
23
|
+
import { getTokenRangesQueryOptions, listTokenMetadataQueryOptions, searchTokenMetadataQueryOptions, tokenSuppliesQueryOptions } from "./tokens-cGxMadd8.js";
|
|
24
|
+
import { comparePricesQueryOptions, convertPriceToUSDQueryOptions } from "./utils-BCgNhBFR.js";
|
|
25
|
+
import { waitForTransactionReceipt } from "./waitForTransactionReceipt-DieAnV52.js";
|
|
26
|
+
import { CalendarIcon_default, CartIcon_default, InfoIcon_default } from "./CartIcon-Bt3rQYGk.js";
|
|
27
|
+
import { FooterName, PriceDisplay, SaleDetailsPill, TokenTypeBalancePill } from "./components-CosnX7F9.js";
|
|
19
28
|
import { NetworkType, networks } from "@0xsequence/network";
|
|
20
29
|
import { useAccount, useBalance, useChainId, usePublicClient, useReadContract, useReadContracts, useSendTransaction, useSignMessage, useSignTypedData, useSwitchChain, useWriteContract } from "wagmi";
|
|
21
30
|
import { useChain, useOpenConnectModal, useWaasFeeOptions } from "@0xsequence/connect";
|
|
22
31
|
import { Suspense, createContext, lazy, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
23
32
|
import { QueryClientProvider, queryOptions, skipToken, useInfiniteQuery, useMutation, useQuery } from "@tanstack/react-query";
|
|
24
33
|
import { TransactionStatus } from "@0xsequence/indexer";
|
|
25
|
-
import { AddIcon, Button, CheckmarkIcon, ChevronDownIcon, Divider, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger, ExternalLinkIcon, IconButton, Image, Modal, NetworkImage, NumericInput, Select, Skeleton, Spinner, SubtractIcon, Text, TextInput, ThemeProvider, TokenImage, Tooltip, WarningIcon, cn } from "@0xsequence/design-system";
|
|
34
|
+
import { AddIcon, Button, CheckmarkIcon, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Divider, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger, ExternalLinkIcon, IconButton, Image, Modal, NetworkImage, NumericInput, Select, Skeleton, Spinner, SubtractIcon, Text, TextInput, ThemeProvider, TimeIcon, TokenImage, Tooltip, WarningIcon, cn } from "@0xsequence/design-system";
|
|
26
35
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
27
36
|
import * as dn from "dnum";
|
|
28
37
|
import { BaseError, UserRejectedRequestError, WaitForTransactionReceiptTimeoutError, decodeFunctionData, encodeFunctionData, erc20Abi, erc721Abi, formatUnits, hexToBigInt, isAddress, isHex, maxUint256, parseEventLogs, parseUnits, toHex, zeroAddress } from "viem";
|
|
@@ -33,7 +42,7 @@ import { useSelector } from "@xstate/store/react";
|
|
|
33
42
|
import { createSerializer, parseAsBoolean, parseAsJson, parseAsString, useQueryState } from "nuqs";
|
|
34
43
|
import { SequenceCheckoutProvider, useERC1155SaleContractCheckout, useSelectPaymentModal } from "@0xsequence/checkout";
|
|
35
44
|
import { Show, observer, use$ } from "@legendapp/state/react";
|
|
36
|
-
import { addDays, differenceInDays, format, formatDistanceToNow, isSameDay, startOfDay } from "date-fns";
|
|
45
|
+
import { addDays, differenceInDays, endOfDay, format, formatDistanceToNow, getHours, getMinutes, isSameDay, setHours, setMinutes, startOfDay } from "date-fns";
|
|
37
46
|
import { avalanche, optimism } from "viem/chains";
|
|
38
47
|
import { DayPicker } from "react-day-picker";
|
|
39
48
|
import { addDays as addDays$1 } from "date-fns/addDays";
|
|
@@ -101,6 +110,36 @@ const useAnalytics = () => {
|
|
|
101
110
|
return useContext(MarketplaceSdkContext).analytics;
|
|
102
111
|
};
|
|
103
112
|
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/react/providers/analytics-provider.tsx
|
|
115
|
+
function AnalyticsProvider({ config, children }) {
|
|
116
|
+
const { address, isConnected } = useAccount();
|
|
117
|
+
const isWindowDefined = typeof window !== "undefined";
|
|
118
|
+
const analytics = useMemo(() => {
|
|
119
|
+
const server = "https://nodes.sequence.app";
|
|
120
|
+
const auth = {};
|
|
121
|
+
auth.headers = { "X-Access-Key": config.projectAccessKey };
|
|
122
|
+
return new DatabeatAnalytics(server, auth, {
|
|
123
|
+
defaultEnabled: true,
|
|
124
|
+
initProps: () => {
|
|
125
|
+
return { origin: isWindowDefined ? window.location.origin : "" };
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}, [config.projectAccessKey, isWindowDefined]);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (!isConnected || !address) {
|
|
131
|
+
analytics?.reset();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
analytics?.identify(address.toLowerCase());
|
|
135
|
+
}, [
|
|
136
|
+
analytics,
|
|
137
|
+
address,
|
|
138
|
+
isConnected
|
|
139
|
+
]);
|
|
140
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(analytics) });
|
|
141
|
+
}
|
|
142
|
+
|
|
104
143
|
//#endregion
|
|
105
144
|
//#region src/react/providers/theme-provider.tsx
|
|
106
145
|
const ThemeProvider$1 = ({ children, theme, root }) => {
|
|
@@ -118,36 +157,29 @@ const ThemeProvider$1 = ({ children, theme, root }) => {
|
|
|
118
157
|
const MarketplaceSdkContext = createContext({});
|
|
119
158
|
function MarketplaceProvider({ config, children, openConnectModal }) {
|
|
120
159
|
if (config.projectAccessKey === "" || !config.projectAccessKey) throw new InvalidProjectAccessKeyError(config.projectAccessKey);
|
|
121
|
-
|
|
122
|
-
const analytics = useMemo(() => {
|
|
123
|
-
const server = "https://nodes.sequence.app";
|
|
124
|
-
const auth = {};
|
|
125
|
-
auth.headers = { "X-Access-Key": config.projectAccessKey };
|
|
126
|
-
return new DatabeatAnalytics(server, auth, {
|
|
127
|
-
defaultEnabled: true,
|
|
128
|
-
initProps: () => {
|
|
129
|
-
return { origin: isWindowDefined ? window.location.origin : "" };
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}, [config.projectAccessKey, isWindowDefined]);
|
|
133
|
-
if (openConnectModal) {
|
|
134
|
-
const context = {
|
|
135
|
-
...config,
|
|
136
|
-
openConnectModal,
|
|
137
|
-
analytics
|
|
138
|
-
};
|
|
139
|
-
return /* @__PURE__ */ jsx(MarketplaceSdkContext.Provider, {
|
|
140
|
-
value: context,
|
|
141
|
-
children: /* @__PURE__ */ jsx(ThemeProvider$1, { children: /* @__PURE__ */ jsx("div", {
|
|
142
|
-
id: PROVIDER_ID,
|
|
143
|
-
children
|
|
144
|
-
}) })
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
return /* @__PURE__ */ jsx(MarketplaceProviderWithSequenceConnect, {
|
|
160
|
+
return /* @__PURE__ */ jsx(AnalyticsProvider, {
|
|
148
161
|
config,
|
|
149
|
-
analytics
|
|
150
|
-
|
|
162
|
+
children: (analytics) => {
|
|
163
|
+
if (openConnectModal) {
|
|
164
|
+
const context = {
|
|
165
|
+
...config,
|
|
166
|
+
openConnectModal,
|
|
167
|
+
analytics
|
|
168
|
+
};
|
|
169
|
+
return /* @__PURE__ */ jsx(MarketplaceSdkContext.Provider, {
|
|
170
|
+
value: context,
|
|
171
|
+
children: /* @__PURE__ */ jsx(ThemeProvider$1, { children: /* @__PURE__ */ jsx("div", {
|
|
172
|
+
id: PROVIDER_ID,
|
|
173
|
+
children
|
|
174
|
+
}) })
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return /* @__PURE__ */ jsx(MarketplaceProviderWithSequenceConnect, {
|
|
178
|
+
config,
|
|
179
|
+
analytics,
|
|
180
|
+
children: /* @__PURE__ */ jsx(ThemeProvider$1, { children })
|
|
181
|
+
});
|
|
182
|
+
}
|
|
151
183
|
});
|
|
152
184
|
}
|
|
153
185
|
function MarketplaceQueryClientProvider({ children }) {
|
|
@@ -938,7 +970,7 @@ const useSellModal = (callbacks) => {
|
|
|
938
970
|
|
|
939
971
|
//#endregion
|
|
940
972
|
//#region src/react/hooks/data/market/useListMarketCardData.tsx
|
|
941
|
-
function useListMarketCardData({ collectionAddress, chainId, orderbookKind, collectionType, filterOptions, searchText, showListedOnly = false, onCollectibleClick, onCannotPerformAction, prioritizeOwnerActions, assetSrcPrefixUrl }) {
|
|
973
|
+
function useListMarketCardData({ collectionAddress, chainId, orderbookKind, collectionType, filterOptions, searchText, showListedOnly = false, priceFilters, onCollectibleClick, onCannotPerformAction, prioritizeOwnerActions, assetSrcPrefixUrl, hideQuantitySelector }) {
|
|
942
974
|
const { address: accountAddress } = useAccount();
|
|
943
975
|
const { show: showSellModal } = useSellModal();
|
|
944
976
|
const { data: collectiblesList, isLoading: collectiblesListIsLoading, fetchNextPage, hasNextPage, isFetchingNextPage, error: collectiblesListError } = useListCollectibles({
|
|
@@ -948,7 +980,8 @@ function useListMarketCardData({ collectionAddress, chainId, orderbookKind, coll
|
|
|
948
980
|
filter: {
|
|
949
981
|
includeEmpty: !showListedOnly,
|
|
950
982
|
searchText,
|
|
951
|
-
properties: filterOptions
|
|
983
|
+
properties: filterOptions,
|
|
984
|
+
prices: priceFilters
|
|
952
985
|
},
|
|
953
986
|
query: { enabled: !!collectionAddress && !!chainId }
|
|
954
987
|
});
|
|
@@ -984,6 +1017,7 @@ function useListMarketCardData({ collectionAddress, chainId, orderbookKind, coll
|
|
|
984
1017
|
onCannotPerformAction,
|
|
985
1018
|
prioritizeOwnerActions,
|
|
986
1019
|
assetSrcPrefixUrl,
|
|
1020
|
+
hideQuantitySelector,
|
|
987
1021
|
onOfferClick: ({ order }) => {
|
|
988
1022
|
if (!accountAddress) return;
|
|
989
1023
|
if (balance) {
|
|
@@ -1066,6 +1100,69 @@ function useMarketCurrencies(params) {
|
|
|
1066
1100
|
return useQuery({ ...queryOptions$1 });
|
|
1067
1101
|
}
|
|
1068
1102
|
|
|
1103
|
+
//#endregion
|
|
1104
|
+
//#region src/react/hooks/data/orders/useCountItemsOrdersForCollection.tsx
|
|
1105
|
+
/**
|
|
1106
|
+
* Hook to get the count of orders for a collection
|
|
1107
|
+
*
|
|
1108
|
+
* Counts the total number of active orders (listings) for all tokens
|
|
1109
|
+
* in a collection. Useful for displaying order counts in collection UI.
|
|
1110
|
+
*
|
|
1111
|
+
* @param params - Configuration parameters
|
|
1112
|
+
* @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
|
|
1113
|
+
* @param params.collectionAddress - The collection contract address
|
|
1114
|
+
* @param params.filter - Optional filter criteria for orders
|
|
1115
|
+
* @param params.query - Optional React Query configuration
|
|
1116
|
+
*
|
|
1117
|
+
* @returns Query result containing the count of orders
|
|
1118
|
+
*
|
|
1119
|
+
* @example
|
|
1120
|
+
* Basic usage:
|
|
1121
|
+
* ```typescript
|
|
1122
|
+
* const { data: orderCount, isLoading } = useCountItemsOrdersForCollection({
|
|
1123
|
+
* chainId: 137,
|
|
1124
|
+
* collectionAddress: '0x...'
|
|
1125
|
+
* })
|
|
1126
|
+
* ```
|
|
1127
|
+
*
|
|
1128
|
+
* @example
|
|
1129
|
+
* With filter:
|
|
1130
|
+
* ```typescript
|
|
1131
|
+
* const { data: filteredCount } = useCountItemsOrdersForCollection({
|
|
1132
|
+
* chainId: 137,
|
|
1133
|
+
* collectionAddress: '0x...',
|
|
1134
|
+
* filter: {
|
|
1135
|
+
* marketplace: [MarketplaceKind.sequence_marketplace_v2]
|
|
1136
|
+
* }
|
|
1137
|
+
* })
|
|
1138
|
+
* ```
|
|
1139
|
+
*
|
|
1140
|
+
* @example
|
|
1141
|
+
* Combined with list hook:
|
|
1142
|
+
* ```typescript
|
|
1143
|
+
* const { data: totalCount } = useCountItemsOrdersForCollection({
|
|
1144
|
+
* chainId: 137,
|
|
1145
|
+
* collectionAddress: '0x...'
|
|
1146
|
+
* })
|
|
1147
|
+
*
|
|
1148
|
+
* const { data: orders } = useListItemsOrdersForCollection({
|
|
1149
|
+
* chainId: 137,
|
|
1150
|
+
* collectionAddress: '0x...'
|
|
1151
|
+
* })
|
|
1152
|
+
*
|
|
1153
|
+
* return <div>Showing {orders?.pages[0]?.listings.length ?? 0} of {totalCount} orders</div>
|
|
1154
|
+
* ```
|
|
1155
|
+
*/
|
|
1156
|
+
function useCountItemsOrdersForCollection(params) {
|
|
1157
|
+
const defaultConfig = useConfig();
|
|
1158
|
+
const { config = defaultConfig,...rest } = params;
|
|
1159
|
+
const queryOptions$1 = countItemsOrdersForCollectionQueryOptions({
|
|
1160
|
+
config,
|
|
1161
|
+
...rest
|
|
1162
|
+
});
|
|
1163
|
+
return useQuery({ ...queryOptions$1 });
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1069
1166
|
//#endregion
|
|
1070
1167
|
//#region src/react/hooks/data/orders/useCountListingsForCollectible.tsx
|
|
1071
1168
|
/**
|
|
@@ -1213,6 +1310,18 @@ function useFloorOrder(params) {
|
|
|
1213
1310
|
return useQuery({ ...queryOptions$1 });
|
|
1214
1311
|
}
|
|
1215
1312
|
|
|
1313
|
+
//#endregion
|
|
1314
|
+
//#region src/react/hooks/data/orders/useGetCountOfFilteredOrders.tsx
|
|
1315
|
+
function useGetCountOfFilteredOrders(params) {
|
|
1316
|
+
const defaultConfig = useConfig();
|
|
1317
|
+
const { config = defaultConfig,...rest } = params;
|
|
1318
|
+
const queryOptions$1 = getCountOfFilteredOrdersQueryOptions({
|
|
1319
|
+
config,
|
|
1320
|
+
...rest
|
|
1321
|
+
});
|
|
1322
|
+
return useQuery({ ...queryOptions$1 });
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1216
1325
|
//#endregion
|
|
1217
1326
|
//#region src/react/hooks/data/orders/useHighestOffer.tsx
|
|
1218
1327
|
/**
|
|
@@ -1263,6 +1372,138 @@ function useHighestOffer(params) {
|
|
|
1263
1372
|
return useQuery({ ...queryOptions$1 });
|
|
1264
1373
|
}
|
|
1265
1374
|
|
|
1375
|
+
//#endregion
|
|
1376
|
+
//#region src/react/hooks/data/orders/useListItemsOrdersForCollection.tsx
|
|
1377
|
+
/**
|
|
1378
|
+
* Hook to fetch all listings for a collection with infinite pagination support
|
|
1379
|
+
*
|
|
1380
|
+
* Fetches active listings (sales) for all tokens in a collection from the marketplace
|
|
1381
|
+
* with support for filtering and infinite scroll pagination.
|
|
1382
|
+
*
|
|
1383
|
+
* @param params - Configuration parameters
|
|
1384
|
+
* @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
|
|
1385
|
+
* @param params.collectionAddress - The collection contract address
|
|
1386
|
+
* @param params.filter - Optional filtering parameters (marketplace, currencies, etc.)
|
|
1387
|
+
* @param params.query - Optional React Query configuration
|
|
1388
|
+
*
|
|
1389
|
+
* @returns Infinite query result containing listings data with pagination
|
|
1390
|
+
*
|
|
1391
|
+
* @example
|
|
1392
|
+
* Basic usage:
|
|
1393
|
+
* ```typescript
|
|
1394
|
+
* const { data, isLoading, fetchNextPage, hasNextPage } = useListItemsOrdersForCollection({
|
|
1395
|
+
* chainId: 137,
|
|
1396
|
+
* collectionAddress: '0x...'
|
|
1397
|
+
* })
|
|
1398
|
+
* ```
|
|
1399
|
+
*
|
|
1400
|
+
* @example
|
|
1401
|
+
* With filtering:
|
|
1402
|
+
* ```typescript
|
|
1403
|
+
* const { data, fetchNextPage } = useListItemsOrdersForCollection({
|
|
1404
|
+
* chainId: 1,
|
|
1405
|
+
* collectionAddress: '0x...',
|
|
1406
|
+
* filter: {
|
|
1407
|
+
* marketplace: [MarketplaceKind.sequence_marketplace_v2],
|
|
1408
|
+
* currencies: ['0x...']
|
|
1409
|
+
* }
|
|
1410
|
+
* })
|
|
1411
|
+
* ```
|
|
1412
|
+
*
|
|
1413
|
+
* @example
|
|
1414
|
+
* Accessing paginated data:
|
|
1415
|
+
* ```typescript
|
|
1416
|
+
* const { data } = useListItemsOrdersForCollection({
|
|
1417
|
+
* chainId: 137,
|
|
1418
|
+
* collectionAddress: '0x...'
|
|
1419
|
+
* })
|
|
1420
|
+
*
|
|
1421
|
+
* const allListings = data?.pages.flatMap(page => page.listings) ?? []
|
|
1422
|
+
* ```
|
|
1423
|
+
*/
|
|
1424
|
+
function useListItemsOrdersForCollection(params) {
|
|
1425
|
+
const defaultConfig = useConfig();
|
|
1426
|
+
const { config = defaultConfig,...rest } = params;
|
|
1427
|
+
const queryOptions$1 = listItemsOrdersForCollectionQueryOptions({
|
|
1428
|
+
config,
|
|
1429
|
+
...rest
|
|
1430
|
+
});
|
|
1431
|
+
return useInfiniteQuery({ ...queryOptions$1 });
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
//#endregion
|
|
1435
|
+
//#region src/react/hooks/data/orders/useListItemsOrdersForCollectionPaginated.tsx
|
|
1436
|
+
/**
|
|
1437
|
+
* Hook to fetch all listings for a collection with pagination support
|
|
1438
|
+
*
|
|
1439
|
+
* Fetches active listings (sales) for all tokens in a collection from the marketplace
|
|
1440
|
+
* with support for filtering and pagination. Unlike the infinite query version,
|
|
1441
|
+
* this hook fetches a specific page of results.
|
|
1442
|
+
*
|
|
1443
|
+
* @param params - Configuration parameters
|
|
1444
|
+
* @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
|
|
1445
|
+
* @param params.collectionAddress - The collection contract address
|
|
1446
|
+
* @param params.side - Order side (listing or bid)
|
|
1447
|
+
* @param params.filter - Optional filtering parameters (marketplace, currencies, etc.)
|
|
1448
|
+
* @param params.page - Page number to fetch (default: 1)
|
|
1449
|
+
* @param params.pageSize - Number of items per page (default: 30)
|
|
1450
|
+
* @param params.query - Optional React Query configuration
|
|
1451
|
+
*
|
|
1452
|
+
* @returns Query result containing listings data for the specific page
|
|
1453
|
+
*
|
|
1454
|
+
* @example
|
|
1455
|
+
* Basic usage:
|
|
1456
|
+
* ```typescript
|
|
1457
|
+
* const { data, isLoading } = useListItemsOrdersForCollectionPaginated({
|
|
1458
|
+
* chainId: 137,
|
|
1459
|
+
* collectionAddress: '0x...',
|
|
1460
|
+
* side: OrderSide.listing,
|
|
1461
|
+
* page: 1,
|
|
1462
|
+
* pageSize: 20
|
|
1463
|
+
* })
|
|
1464
|
+
* ```
|
|
1465
|
+
*
|
|
1466
|
+
* @example
|
|
1467
|
+
* With filtering:
|
|
1468
|
+
* ```typescript
|
|
1469
|
+
* const { data } = useListItemsOrdersForCollectionPaginated({
|
|
1470
|
+
* chainId: 1,
|
|
1471
|
+
* collectionAddress: '0x...',
|
|
1472
|
+
* side: OrderSide.listing,
|
|
1473
|
+
* page: 2,
|
|
1474
|
+
* pageSize: 50,
|
|
1475
|
+
* filter: {
|
|
1476
|
+
* marketplace: [MarketplaceKind.sequence_marketplace_v2],
|
|
1477
|
+
* currencies: ['0x...']
|
|
1478
|
+
* }
|
|
1479
|
+
* })
|
|
1480
|
+
* ```
|
|
1481
|
+
*
|
|
1482
|
+
* @example
|
|
1483
|
+
* Controlled pagination:
|
|
1484
|
+
* ```typescript
|
|
1485
|
+
* const [currentPage, setCurrentPage] = useState(1);
|
|
1486
|
+
* const { data, isLoading } = useListItemsOrdersForCollectionPaginated({
|
|
1487
|
+
* chainId: 137,
|
|
1488
|
+
* collectionAddress: '0x...',
|
|
1489
|
+
* side: OrderSide.listing,
|
|
1490
|
+
* page: currentPage,
|
|
1491
|
+
* pageSize: 25
|
|
1492
|
+
* });
|
|
1493
|
+
*
|
|
1494
|
+
* const hasMorePages = data?.page?.more;
|
|
1495
|
+
* ```
|
|
1496
|
+
*/
|
|
1497
|
+
function useListItemsOrdersForCollectionPaginated(params) {
|
|
1498
|
+
const defaultConfig = useConfig();
|
|
1499
|
+
const { config = defaultConfig,...rest } = params;
|
|
1500
|
+
const queryOptions$1 = listItemsOrdersForCollectionPaginatedQueryOptions({
|
|
1501
|
+
config,
|
|
1502
|
+
...rest
|
|
1503
|
+
});
|
|
1504
|
+
return useQuery({ ...queryOptions$1 });
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1266
1507
|
//#endregion
|
|
1267
1508
|
//#region src/react/hooks/data/orders/useListListingsForCollectible.tsx
|
|
1268
1509
|
/**
|
|
@@ -2500,6 +2741,7 @@ function isTransactionStep(step) {
|
|
|
2500
2741
|
StepType.createListing
|
|
2501
2742
|
].includes(step.id);
|
|
2502
2743
|
}
|
|
2744
|
+
const clamp = (val, min, max) => Math.max(min, Math.min(max, val));
|
|
2503
2745
|
|
|
2504
2746
|
//#endregion
|
|
2505
2747
|
//#region src/react/hooks/transactions/useProcessStep.ts
|
|
@@ -3003,22 +3245,34 @@ const validateFilters = (value) => {
|
|
|
3003
3245
|
if (!Array.isArray(value)) return [];
|
|
3004
3246
|
return value.filter((f) => typeof f === "object" && typeof f.name === "string" && Object.values(PropertyType).includes(f.type));
|
|
3005
3247
|
};
|
|
3248
|
+
const validatePriceFilters = (value) => {
|
|
3249
|
+
if (!Array.isArray(value)) return [];
|
|
3250
|
+
return value.filter((f) => typeof f === "object" && typeof f.contractAddress === "string" && (f.min === void 0 || typeof f.min === "string") && (f.max === void 0 || typeof f.max === "string"));
|
|
3251
|
+
};
|
|
3006
3252
|
const filtersParser = parseAsJson(validateFilters).withDefault([]);
|
|
3007
3253
|
const searchParser = parseAsString.withDefault("");
|
|
3008
3254
|
const listedOnlyParser = parseAsBoolean.withDefault(false);
|
|
3255
|
+
const priceFilterParser = parseAsBoolean.withDefault(false);
|
|
3256
|
+
const priceFiltersParser = parseAsJson(validatePriceFilters).withDefault([]);
|
|
3009
3257
|
const serialize = createSerializer({
|
|
3010
3258
|
filters: filtersParser,
|
|
3011
3259
|
search: searchParser,
|
|
3012
|
-
listedOnly: listedOnlyParser
|
|
3260
|
+
listedOnly: listedOnlyParser,
|
|
3261
|
+
priceFilter: priceFilterParser,
|
|
3262
|
+
priceFilters: priceFiltersParser
|
|
3013
3263
|
}, { urlKeys: {
|
|
3014
3264
|
filters: "f",
|
|
3015
3265
|
search: "q",
|
|
3016
|
-
listedOnly: "l"
|
|
3266
|
+
listedOnly: "l",
|
|
3267
|
+
priceFilter: "p",
|
|
3268
|
+
priceFilters: "pf"
|
|
3017
3269
|
} });
|
|
3018
3270
|
function useFilterState() {
|
|
3019
3271
|
const [filterOptions, setFilterOptions] = useQueryState("filters", filtersParser);
|
|
3020
3272
|
const [searchText, setSearchText] = useQueryState("search", searchParser);
|
|
3021
3273
|
const [showListedOnly, setShowListedOnly] = useQueryState("listedOnly", listedOnlyParser);
|
|
3274
|
+
const [showPriceFilter, setShowPriceFilter] = useQueryState("priceFilter", priceFilterParser);
|
|
3275
|
+
const [priceFilters, setPriceFilters] = useQueryState("priceFilters", priceFiltersParser);
|
|
3022
3276
|
const helpers = useMemo(() => ({
|
|
3023
3277
|
getFilter: (name) => {
|
|
3024
3278
|
return filterOptions?.find((f) => f.name === name);
|
|
@@ -3092,24 +3346,52 @@ function useFilterState() {
|
|
|
3092
3346
|
max
|
|
3093
3347
|
}]);
|
|
3094
3348
|
},
|
|
3349
|
+
setPriceFilter: (contractAddress, min, max) => {
|
|
3350
|
+
const otherPriceFilters = priceFilters?.filter((f) => f.contractAddress !== contractAddress) ?? [];
|
|
3351
|
+
if (!min && !max) {
|
|
3352
|
+
setPriceFilters(otherPriceFilters);
|
|
3353
|
+
return;
|
|
3354
|
+
}
|
|
3355
|
+
const newPriceFilter = {
|
|
3356
|
+
contractAddress,
|
|
3357
|
+
...min && { min },
|
|
3358
|
+
...max && { max }
|
|
3359
|
+
};
|
|
3360
|
+
setPriceFilters([...otherPriceFilters, newPriceFilter]);
|
|
3361
|
+
},
|
|
3362
|
+
getPriceFilter: (contractAddress) => {
|
|
3363
|
+
return priceFilters?.find((f) => f.contractAddress === contractAddress);
|
|
3364
|
+
},
|
|
3365
|
+
clearPriceFilters: () => {
|
|
3366
|
+
setPriceFilters([]);
|
|
3367
|
+
},
|
|
3095
3368
|
clearAllFilters: () => {
|
|
3096
3369
|
setShowListedOnly(false);
|
|
3370
|
+
setShowPriceFilter(false);
|
|
3097
3371
|
setFilterOptions([]);
|
|
3098
3372
|
setSearchText("");
|
|
3373
|
+
setPriceFilters([]);
|
|
3099
3374
|
}
|
|
3100
3375
|
}), [
|
|
3101
3376
|
filterOptions,
|
|
3102
3377
|
setFilterOptions,
|
|
3103
3378
|
setShowListedOnly,
|
|
3104
|
-
setSearchText
|
|
3379
|
+
setSearchText,
|
|
3380
|
+
setShowPriceFilter,
|
|
3381
|
+
priceFilters,
|
|
3382
|
+
setPriceFilters
|
|
3105
3383
|
]);
|
|
3106
3384
|
return {
|
|
3107
3385
|
filterOptions,
|
|
3108
3386
|
searchText,
|
|
3109
3387
|
showListedOnly,
|
|
3388
|
+
showPriceFilter,
|
|
3389
|
+
priceFilters,
|
|
3110
3390
|
setFilterOptions,
|
|
3111
3391
|
setSearchText,
|
|
3112
3392
|
setShowListedOnly,
|
|
3393
|
+
setShowPriceFilter,
|
|
3394
|
+
setPriceFilters,
|
|
3113
3395
|
...helpers,
|
|
3114
3396
|
serialize
|
|
3115
3397
|
};
|
|
@@ -4446,6 +4728,65 @@ const useLoadData = () => {
|
|
|
4446
4728
|
};
|
|
4447
4729
|
};
|
|
4448
4730
|
|
|
4731
|
+
//#endregion
|
|
4732
|
+
//#region src/react/ui/components/_internals/ErrorLogBox.tsx
|
|
4733
|
+
const ErrorLogBox = ({ title, message, error, onDismiss }) => {
|
|
4734
|
+
const [showFullError, setShowFullError] = useState(false);
|
|
4735
|
+
const toggleFullError = () => {
|
|
4736
|
+
setShowFullError(!showFullError);
|
|
4737
|
+
};
|
|
4738
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4739
|
+
className: "relative max-h-96 w-full overflow-y-auto rounded-lg border border-red-900 bg-[#2b0000] p-3",
|
|
4740
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
4741
|
+
className: "flex items-start gap-3",
|
|
4742
|
+
children: [
|
|
4743
|
+
/* @__PURE__ */ jsx(WarningIcon, {
|
|
4744
|
+
className: "absolute mt-0.5 flex-shrink-0 text-red-500",
|
|
4745
|
+
size: "sm"
|
|
4746
|
+
}),
|
|
4747
|
+
/* @__PURE__ */ jsxs("div", {
|
|
4748
|
+
className: "min-w-0 flex-1",
|
|
4749
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
4750
|
+
className: "relative ml-10 flex flex-col",
|
|
4751
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
4752
|
+
className: "font-bold text-red-400 text-sm",
|
|
4753
|
+
children: title
|
|
4754
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
4755
|
+
className: "mt-1 text-red-300 text-xs",
|
|
4756
|
+
children: message
|
|
4757
|
+
})]
|
|
4758
|
+
}), error && /* @__PURE__ */ jsxs("div", {
|
|
4759
|
+
className: "mt-2",
|
|
4760
|
+
children: [
|
|
4761
|
+
/* @__PURE__ */ jsxs("button", {
|
|
4762
|
+
onClick: toggleFullError,
|
|
4763
|
+
className: "flex items-center gap-1 text-red-400 text-xs transition-colors hover:text-red-300",
|
|
4764
|
+
type: "button",
|
|
4765
|
+
children: [showFullError ? "Hide full error" : "Show full error", showFullError ? /* @__PURE__ */ jsx(ChevronUpIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(ChevronDownIcon, { className: "h-3 w-3" })]
|
|
4766
|
+
}),
|
|
4767
|
+
showFullError && /* @__PURE__ */ jsx("div", { className: "mt-2 h-px bg-red-900" }),
|
|
4768
|
+
showFullError && /* @__PURE__ */ jsx("div", {
|
|
4769
|
+
className: "mt-2 overflow-auto rounded-md bg-red-950 p-2",
|
|
4770
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
4771
|
+
className: "whitespace-pre-wrap break-words font-mono text-red-100 text-xs",
|
|
4772
|
+
children: JSON.stringify(error, null, 2)
|
|
4773
|
+
})
|
|
4774
|
+
})
|
|
4775
|
+
]
|
|
4776
|
+
})]
|
|
4777
|
+
}),
|
|
4778
|
+
onDismiss && /* @__PURE__ */ jsx("button", {
|
|
4779
|
+
onClick: onDismiss,
|
|
4780
|
+
className: "absolute right-4 flex-shrink-0 text-red-400 transition-colors hover:text-red-300",
|
|
4781
|
+
type: "button",
|
|
4782
|
+
"aria-label": "Dismiss error",
|
|
4783
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "h-3 w-3" })
|
|
4784
|
+
})
|
|
4785
|
+
]
|
|
4786
|
+
})
|
|
4787
|
+
});
|
|
4788
|
+
};
|
|
4789
|
+
|
|
4449
4790
|
//#endregion
|
|
4450
4791
|
//#region src/utils/decode/erc20.ts
|
|
4451
4792
|
function decodeERC20Approval(calldata) {
|
|
@@ -4463,7 +4804,7 @@ function decodeERC20Approval(calldata) {
|
|
|
4463
4804
|
|
|
4464
4805
|
//#endregion
|
|
4465
4806
|
//#region src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts
|
|
4466
|
-
const getBuyCollectableParams = async ({ chainId, collectionAddress, collectibleId, callbacks, priceCurrencyAddress, customCreditCardProviderCallback, config, address, marketplace, orderId, quantity, collectable, checkoutOptions, fee, skipNativeBalanceCheck, nativeTokenAddress, buyAnalyticsId }) => {
|
|
4807
|
+
const getBuyCollectableParams = async ({ chainId, collectionAddress, collectibleId, callbacks, priceCurrencyAddress, customCreditCardProviderCallback, config, address, marketplace, orderId, quantity, collectable, checkoutOptions, fee, skipNativeBalanceCheck, nativeTokenAddress, buyAnalyticsId, onRampProvider }) => {
|
|
4467
4808
|
const { steps: steps$2 } = await getMarketplaceClient(config).generateBuyTransaction({
|
|
4468
4809
|
chainId: String(chainId),
|
|
4469
4810
|
collectionAddress,
|
|
@@ -4506,8 +4847,8 @@ const getBuyCollectableParams = async ({ chainId, collectionAddress, collectible
|
|
|
4506
4847
|
collectionAddress,
|
|
4507
4848
|
recipientAddress: address,
|
|
4508
4849
|
creditCardProviders,
|
|
4509
|
-
onSuccess: (
|
|
4510
|
-
callbacks?.onSuccess?.({ hash });
|
|
4850
|
+
onSuccess: (txHash) => {
|
|
4851
|
+
if (txHash) callbacks?.onSuccess?.({ hash: txHash });
|
|
4511
4852
|
},
|
|
4512
4853
|
supplementaryAnalyticsInfo: {
|
|
4513
4854
|
requestId: orderId,
|
|
@@ -4527,13 +4868,14 @@ const getBuyCollectableParams = async ({ chainId, collectionAddress, collectible
|
|
|
4527
4868
|
buyModalStore.send({ type: "close" });
|
|
4528
4869
|
} },
|
|
4529
4870
|
...transakContractId && { transakConfig: { contractId: transakContractId } },
|
|
4871
|
+
onRampProvider,
|
|
4530
4872
|
successActionButtons: callbacks?.successActionButtons
|
|
4531
4873
|
};
|
|
4532
4874
|
};
|
|
4533
4875
|
const usePaymentModalParams = (args) => {
|
|
4534
4876
|
const { address, marketplace, collectable, checkoutOptions, priceCurrencyAddress, quantity, enabled } = args;
|
|
4535
4877
|
const buyModalProps = useBuyModalProps();
|
|
4536
|
-
const { chainId, collectionAddress, skipNativeBalanceCheck, nativeTokenAddress } = buyModalProps;
|
|
4878
|
+
const { chainId, collectionAddress, skipNativeBalanceCheck, nativeTokenAddress, onRampProvider } = buyModalProps;
|
|
4537
4879
|
const collectibleId = isMarketProps(buyModalProps) ? buyModalProps.collectibleId : "";
|
|
4538
4880
|
const orderId = isMarketProps(buyModalProps) ? buyModalProps.orderId : "";
|
|
4539
4881
|
const customCreditCardProviderCallback = isMarketProps(buyModalProps) ? buyModalProps.customCreditCardProviderCallback : void 0;
|
|
@@ -4573,8 +4915,10 @@ const usePaymentModalParams = (args) => {
|
|
|
4573
4915
|
customCreditCardProviderCallback,
|
|
4574
4916
|
skipNativeBalanceCheck,
|
|
4575
4917
|
nativeTokenAddress,
|
|
4576
|
-
buyAnalyticsId
|
|
4577
|
-
|
|
4918
|
+
buyAnalyticsId,
|
|
4919
|
+
onRampProvider
|
|
4920
|
+
}) : skipToken,
|
|
4921
|
+
retry: false
|
|
4578
4922
|
});
|
|
4579
4923
|
};
|
|
4580
4924
|
|
|
@@ -4588,7 +4932,7 @@ const ERC721BuyModal = ({ collectable, order, address, checkoutOptions }) => {
|
|
|
4588
4932
|
quantity: 1
|
|
4589
4933
|
});
|
|
4590
4934
|
}, [quantity]);
|
|
4591
|
-
const { data: paymentModalParams, isLoading: isPaymentModalParamsLoading, isError: isPaymentModalParamsError } = usePaymentModalParams({
|
|
4935
|
+
const { data: paymentModalParams, isLoading: isPaymentModalParamsLoading, isError: isPaymentModalParamsError, failureReason } = usePaymentModalParams({
|
|
4592
4936
|
address,
|
|
4593
4937
|
quantity: quantity ?? void 0,
|
|
4594
4938
|
marketplace: order?.marketplace,
|
|
@@ -4597,6 +4941,25 @@ const ERC721BuyModal = ({ collectable, order, address, checkoutOptions }) => {
|
|
|
4597
4941
|
priceCurrencyAddress: order?.priceCurrencyAddress,
|
|
4598
4942
|
enabled: true
|
|
4599
4943
|
});
|
|
4944
|
+
if (failureReason) return /* @__PURE__ */ jsx(ActionModal, {
|
|
4945
|
+
isOpen: true,
|
|
4946
|
+
onClose: () => {
|
|
4947
|
+
buyModalStore.send({ type: "close" });
|
|
4948
|
+
},
|
|
4949
|
+
title: "An error occurred while purchasing",
|
|
4950
|
+
children: /* @__PURE__ */ jsx(ErrorLogBox, {
|
|
4951
|
+
title: failureReason.name,
|
|
4952
|
+
message: failureReason.message,
|
|
4953
|
+
error: failureReason
|
|
4954
|
+
}),
|
|
4955
|
+
ctas: [{
|
|
4956
|
+
label: "Close",
|
|
4957
|
+
onClick: () => {
|
|
4958
|
+
buyModalStore.send({ type: "close" });
|
|
4959
|
+
}
|
|
4960
|
+
}],
|
|
4961
|
+
chainId: order.chainId
|
|
4962
|
+
});
|
|
4600
4963
|
if (isPaymentModalParamsLoading || !paymentModalParams) return null;
|
|
4601
4964
|
if (isPaymentModalParamsError) throw new Error("Failed to load payment parameters for ERC721 marketplace purchase");
|
|
4602
4965
|
return /* @__PURE__ */ jsx(PaymentModalOpener$2, { paymentModalParams });
|
|
@@ -4727,7 +5090,7 @@ const encodeERC721MintData = ({ to, amount, paymentToken, price, proof = DEFAULT
|
|
|
4727
5090
|
]
|
|
4728
5091
|
});
|
|
4729
5092
|
};
|
|
4730
|
-
const getERC721SalePaymentParams = async ({ chainId, address, salesContractAddress, collectionAddress, price, currencyAddress, callbacks, customCreditCardProviderCallback, skipNativeBalanceCheck, nativeTokenAddress, checkoutProvider, quantity, successActionButtons }) => {
|
|
5093
|
+
const getERC721SalePaymentParams = async ({ chainId, address, salesContractAddress, collectionAddress, price, currencyAddress, callbacks, customCreditCardProviderCallback, skipNativeBalanceCheck, nativeTokenAddress, checkoutProvider, quantity, successActionButtons, onRampProvider }) => {
|
|
4731
5094
|
try {
|
|
4732
5095
|
const purchaseTransactionData = encodeERC721MintData({
|
|
4733
5096
|
to: address,
|
|
@@ -4750,8 +5113,8 @@ const getERC721SalePaymentParams = async ({ chainId, address, salesContractAddre
|
|
|
4750
5113
|
collectionAddress,
|
|
4751
5114
|
recipientAddress: address,
|
|
4752
5115
|
creditCardProviders,
|
|
4753
|
-
onSuccess: (
|
|
4754
|
-
callbacks?.onSuccess?.({ hash });
|
|
5116
|
+
onSuccess: (txHash) => {
|
|
5117
|
+
if (txHash) callbacks?.onSuccess?.({ hash: txHash });
|
|
4755
5118
|
},
|
|
4756
5119
|
onError: callbacks?.onError,
|
|
4757
5120
|
onClose: () => {
|
|
@@ -4765,7 +5128,8 @@ const getERC721SalePaymentParams = async ({ chainId, address, salesContractAddre
|
|
|
4765
5128
|
customCreditCardProviderCallback(price.toString());
|
|
4766
5129
|
buyModalStore.send({ type: "close" });
|
|
4767
5130
|
} },
|
|
4768
|
-
successActionButtons
|
|
5131
|
+
successActionButtons,
|
|
5132
|
+
onRampProvider
|
|
4769
5133
|
};
|
|
4770
5134
|
} catch (error) {
|
|
4771
5135
|
throw BuyModalErrorFactory.priceCalculation("ERC721 payment params calculation", [price.toString(), quantity.toString()], error instanceof Error ? error.message : "Unknown error");
|
|
@@ -4795,7 +5159,8 @@ const useERC721SalePaymentParams = (args) => {
|
|
|
4795
5159
|
nativeTokenAddress: void 0,
|
|
4796
5160
|
checkoutProvider,
|
|
4797
5161
|
quantity,
|
|
4798
|
-
successActionButtons: buyModalProps.successActionButtons
|
|
5162
|
+
successActionButtons: buyModalProps.successActionButtons,
|
|
5163
|
+
onRampProvider: buyModalProps.onRampProvider
|
|
4799
5164
|
}) : skipToken
|
|
4800
5165
|
});
|
|
4801
5166
|
};
|
|
@@ -5075,14 +5440,32 @@ const ERC1155BuyModal = ({ collectable, order, address, checkoutOptions, chainId
|
|
|
5075
5440
|
const isShop = isShopProps(modalProps);
|
|
5076
5441
|
const quantityDecimals = isShop ? modalProps.quantityDecimals : collectable.decimals || 0;
|
|
5077
5442
|
const quantityRemaining = isShop ? modalProps.quantityRemaining?.toString() : order?.quantityRemaining;
|
|
5078
|
-
|
|
5443
|
+
const unlimitedSupply = isShop ? modalProps.unlimitedSupply : false;
|
|
5444
|
+
useEffect(() => {
|
|
5445
|
+
if (modalProps.hideQuantitySelector && !quantity) {
|
|
5446
|
+
const minQuantity = quantityDecimals > 0 ? 10 ** quantityDecimals : 1;
|
|
5447
|
+
const autoQuantity = unlimitedSupply ? minQuantity : Math.min(Number(quantityRemaining), minQuantity);
|
|
5448
|
+
buyModalStore.send({
|
|
5449
|
+
type: "setQuantity",
|
|
5450
|
+
quantity: autoQuantity
|
|
5451
|
+
});
|
|
5452
|
+
}
|
|
5453
|
+
}, [
|
|
5454
|
+
modalProps.hideQuantitySelector,
|
|
5455
|
+
quantity,
|
|
5456
|
+
quantityDecimals,
|
|
5457
|
+
unlimitedSupply,
|
|
5458
|
+
quantityRemaining
|
|
5459
|
+
]);
|
|
5460
|
+
if (!quantity && !modalProps.hideQuantitySelector) return /* @__PURE__ */ jsx(ERC1155QuantityModal, {
|
|
5079
5461
|
order,
|
|
5080
5462
|
cardType,
|
|
5081
5463
|
quantityDecimals,
|
|
5082
5464
|
quantityRemaining,
|
|
5465
|
+
unlimitedSupply,
|
|
5083
5466
|
chainId
|
|
5084
5467
|
});
|
|
5085
|
-
if (!checkoutOptions) return null;
|
|
5468
|
+
if (!checkoutOptions || !quantity) return null;
|
|
5086
5469
|
return /* @__PURE__ */ jsx(Modal$4, {
|
|
5087
5470
|
address,
|
|
5088
5471
|
quantity,
|
|
@@ -5092,7 +5475,7 @@ const ERC1155BuyModal = ({ collectable, order, address, checkoutOptions, chainId
|
|
|
5092
5475
|
});
|
|
5093
5476
|
};
|
|
5094
5477
|
const Modal$4 = ({ address, quantity, order, collectable, checkoutOptions }) => {
|
|
5095
|
-
const { data: paymentModalParams, isLoading: isPaymentModalParamsLoading, isError: isPaymentModalParamsError } = usePaymentModalParams({
|
|
5478
|
+
const { data: paymentModalParams, isLoading: isPaymentModalParamsLoading, isError: isPaymentModalParamsError, failureReason } = usePaymentModalParams({
|
|
5096
5479
|
address,
|
|
5097
5480
|
quantity,
|
|
5098
5481
|
marketplace: order?.marketplace,
|
|
@@ -5101,7 +5484,31 @@ const Modal$4 = ({ address, quantity, order, collectable, checkoutOptions }) =>
|
|
|
5101
5484
|
priceCurrencyAddress: order?.priceCurrencyAddress,
|
|
5102
5485
|
enabled: true
|
|
5103
5486
|
});
|
|
5104
|
-
if (
|
|
5487
|
+
if (failureReason) return /* @__PURE__ */ jsx(ActionModal, {
|
|
5488
|
+
isOpen: true,
|
|
5489
|
+
onClose: () => {
|
|
5490
|
+
buyModalStore.send({ type: "close" });
|
|
5491
|
+
},
|
|
5492
|
+
title: "An error occurred while purchasing",
|
|
5493
|
+
children: /* @__PURE__ */ jsx(ErrorLogBox, {
|
|
5494
|
+
title: failureReason.name,
|
|
5495
|
+
message: failureReason.message,
|
|
5496
|
+
error: failureReason
|
|
5497
|
+
}),
|
|
5498
|
+
ctas: [{
|
|
5499
|
+
label: "Close",
|
|
5500
|
+
onClick: () => {
|
|
5501
|
+
buyModalStore.send({ type: "close" });
|
|
5502
|
+
}
|
|
5503
|
+
}],
|
|
5504
|
+
chainId: order.chainId
|
|
5505
|
+
});
|
|
5506
|
+
if (isPaymentModalParamsLoading || !paymentModalParams) return /* @__PURE__ */ jsx(LoadingModal, {
|
|
5507
|
+
isOpen: true,
|
|
5508
|
+
chainId: order.chainId,
|
|
5509
|
+
onClose: () => buyModalStore.send({ type: "close" }),
|
|
5510
|
+
title: "Loading checkout"
|
|
5511
|
+
});
|
|
5105
5512
|
if (isPaymentModalParamsError) throw new Error("Failed to load payment parameters for ERC1155 marketplace purchase");
|
|
5106
5513
|
return /* @__PURE__ */ jsx(PaymentModalOpener, { paymentModalParams });
|
|
5107
5514
|
};
|
|
@@ -5142,8 +5549,8 @@ const useERC1155Checkout = ({ chainId, salesContractAddress, collectionAddress,
|
|
|
5142
5549
|
}],
|
|
5143
5550
|
wallet: accountAddress ?? "",
|
|
5144
5551
|
...checkoutOptions && { checkoutOptions },
|
|
5145
|
-
onSuccess: (
|
|
5146
|
-
onSuccess({ hash });
|
|
5552
|
+
onSuccess: (txHash) => {
|
|
5553
|
+
if (txHash) onSuccess({ hash: txHash });
|
|
5147
5554
|
},
|
|
5148
5555
|
onError: (error) => {
|
|
5149
5556
|
onError(error);
|
|
@@ -5163,7 +5570,8 @@ const useERC1155Checkout = ({ chainId, salesContractAddress, collectionAddress,
|
|
|
5163
5570
|
marketplaceType: "shop",
|
|
5164
5571
|
saleAnalyticsId
|
|
5165
5572
|
},
|
|
5166
|
-
successActionButtons: buyModalProps.successActionButtons
|
|
5573
|
+
successActionButtons: buyModalProps.successActionButtons,
|
|
5574
|
+
...buyModalProps.onRampProvider && { onRampProvider: buyModalProps.onRampProvider }
|
|
5167
5575
|
}),
|
|
5168
5576
|
isEnabled: Boolean(enabled && accountAddress)
|
|
5169
5577
|
};
|
|
@@ -5373,8 +5781,93 @@ function Calendar({ ...props }) {
|
|
|
5373
5781
|
...props
|
|
5374
5782
|
});
|
|
5375
5783
|
}
|
|
5376
|
-
Calendar.displayName = "Calendar";
|
|
5377
|
-
var calendar_default = Calendar;
|
|
5784
|
+
Calendar.displayName = "Calendar";
|
|
5785
|
+
var calendar_default = Calendar;
|
|
5786
|
+
|
|
5787
|
+
//#endregion
|
|
5788
|
+
//#region src/react/ui/modals/_internal/components/calendarDropdown/TimeSelector.tsx
|
|
5789
|
+
function TimeSelector({ selectedDate, onTimeChange }) {
|
|
5790
|
+
const minutesRef = useRef(null);
|
|
5791
|
+
const [draft, setDraft] = useState(null);
|
|
5792
|
+
const currentHours = getHours(selectedDate);
|
|
5793
|
+
const currentMinutes = getMinutes(selectedDate);
|
|
5794
|
+
const commitChange = () => {
|
|
5795
|
+
if (!draft) return;
|
|
5796
|
+
const now = /* @__PURE__ */ new Date();
|
|
5797
|
+
const parse = (val, fallback) => {
|
|
5798
|
+
const n = Number.parseInt(val, 10);
|
|
5799
|
+
return Number.isNaN(n) ? fallback : n;
|
|
5800
|
+
};
|
|
5801
|
+
let h = clamp(parse(draft.hours, currentHours), 0, 23);
|
|
5802
|
+
let m = clamp(parse(draft.minutes, currentMinutes), 0, 59);
|
|
5803
|
+
if (setMinutes(setHours(selectedDate, h), m) < now) {
|
|
5804
|
+
h = getHours(now);
|
|
5805
|
+
m = getMinutes(now);
|
|
5806
|
+
}
|
|
5807
|
+
onTimeChange(h, m);
|
|
5808
|
+
setDraft(null);
|
|
5809
|
+
};
|
|
5810
|
+
const handleKeyDown = (e, field) => {
|
|
5811
|
+
if (e.key === "Enter") {
|
|
5812
|
+
e.preventDefault();
|
|
5813
|
+
if (field === "hours") minutesRef.current?.focus();
|
|
5814
|
+
else commitChange();
|
|
5815
|
+
} else if (e.key === "Escape") {
|
|
5816
|
+
e.preventDefault();
|
|
5817
|
+
setDraft(null);
|
|
5818
|
+
e.currentTarget.blur();
|
|
5819
|
+
}
|
|
5820
|
+
};
|
|
5821
|
+
const hours = draft?.hours ?? currentHours.toString().padStart(2, "0");
|
|
5822
|
+
const minutes = draft?.minutes ?? currentMinutes.toString().padStart(2, "0");
|
|
5823
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
5824
|
+
className: "mt-3 flex items-center gap-6 border-border-base border-t pt-3",
|
|
5825
|
+
children: [/* @__PURE__ */ jsx(TimeIcon, { color: "white" }), /* @__PURE__ */ jsxs("div", {
|
|
5826
|
+
className: "flex flex-1 items-center justify-between gap-2",
|
|
5827
|
+
children: [
|
|
5828
|
+
/* @__PURE__ */ jsx("div", {
|
|
5829
|
+
className: "w-16 [&>label]:w-16",
|
|
5830
|
+
children: /* @__PURE__ */ jsx(NumericInput, {
|
|
5831
|
+
className: "h-9 [&>input]:text-xs",
|
|
5832
|
+
name: "hours",
|
|
5833
|
+
value: hours,
|
|
5834
|
+
onChange: (e) => setDraft({
|
|
5835
|
+
hours: e.target.value,
|
|
5836
|
+
minutes
|
|
5837
|
+
}),
|
|
5838
|
+
onBlur: commitChange,
|
|
5839
|
+
onKeyDown: (e) => handleKeyDown(e, "hours"),
|
|
5840
|
+
min: 0,
|
|
5841
|
+
max: 23,
|
|
5842
|
+
tabIndex: 0
|
|
5843
|
+
})
|
|
5844
|
+
}),
|
|
5845
|
+
/* @__PURE__ */ jsx(Text, {
|
|
5846
|
+
className: "font-medium text-sm text-text-80",
|
|
5847
|
+
children: ":"
|
|
5848
|
+
}),
|
|
5849
|
+
/* @__PURE__ */ jsx("div", {
|
|
5850
|
+
className: "w-16 [&>label]:w-16",
|
|
5851
|
+
children: /* @__PURE__ */ jsx(NumericInput, {
|
|
5852
|
+
ref: minutesRef,
|
|
5853
|
+
className: "h-9 [&>input]:text-xs",
|
|
5854
|
+
name: "minutes",
|
|
5855
|
+
value: minutes,
|
|
5856
|
+
onChange: (e) => setDraft({
|
|
5857
|
+
hours,
|
|
5858
|
+
minutes: e.target.value
|
|
5859
|
+
}),
|
|
5860
|
+
onBlur: commitChange,
|
|
5861
|
+
onKeyDown: (e) => handleKeyDown(e, "minutes"),
|
|
5862
|
+
min: 0,
|
|
5863
|
+
max: 59,
|
|
5864
|
+
tabIndex: 0
|
|
5865
|
+
})
|
|
5866
|
+
})
|
|
5867
|
+
]
|
|
5868
|
+
})]
|
|
5869
|
+
});
|
|
5870
|
+
}
|
|
5378
5871
|
|
|
5379
5872
|
//#endregion
|
|
5380
5873
|
//#region src/react/ui/modals/_internal/components/calendarDropdown/index.tsx
|
|
@@ -5394,6 +5887,11 @@ function getMatchingPreset(selectedDate) {
|
|
|
5394
5887
|
}
|
|
5395
5888
|
function CalendarDropdown({ selectedDate, setSelectedDate, onSelectPreset, isOpen, setIsOpen }) {
|
|
5396
5889
|
const matchingPreset = getMatchingPreset(selectedDate);
|
|
5890
|
+
const handleTimeChange = (hours, minutes) => {
|
|
5891
|
+
const newDate = new Date(selectedDate);
|
|
5892
|
+
newDate.setHours(hours, minutes, 0, 0);
|
|
5893
|
+
setSelectedDate(newDate);
|
|
5894
|
+
};
|
|
5397
5895
|
return /* @__PURE__ */ jsxs(DropdownMenuRoot, {
|
|
5398
5896
|
open: isOpen,
|
|
5399
5897
|
onOpenChange: setIsOpen,
|
|
@@ -5403,7 +5901,7 @@ function CalendarDropdown({ selectedDate, setSelectedDate, onSelectPreset, isOpe
|
|
|
5403
5901
|
leftIcon: CalendarIcon_default,
|
|
5404
5902
|
className: "h-9 flex-1 rounded-sm p-2 font-medium text-xs",
|
|
5405
5903
|
variant: "base",
|
|
5406
|
-
label: format(selectedDate, "
|
|
5904
|
+
label: format(selectedDate, "yyyy/MM/dd HH:mm"),
|
|
5407
5905
|
shape: "square",
|
|
5408
5906
|
onClick: () => setIsOpen(!isOpen)
|
|
5409
5907
|
})
|
|
@@ -5423,16 +5921,29 @@ function CalendarDropdown({ selectedDate, setSelectedDate, onSelectPreset, isOpe
|
|
|
5423
5921
|
},
|
|
5424
5922
|
variant: "text",
|
|
5425
5923
|
className: `w-full justify-start py-1.5 font-bold text-xs transition-colors ${isActive ? "text-text-100" : "text-text-50 hover:text-text-80"}`,
|
|
5924
|
+
tabIndex: 0,
|
|
5426
5925
|
children: preset.label
|
|
5427
5926
|
}, preset.value);
|
|
5428
5927
|
})
|
|
5429
|
-
}), /* @__PURE__ */
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5928
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
5929
|
+
className: "flex flex-col",
|
|
5930
|
+
children: [/* @__PURE__ */ jsx(calendar_default, {
|
|
5931
|
+
selectedDate,
|
|
5932
|
+
setSelectedDate: (date) => {
|
|
5933
|
+
const newDate = new Date(date);
|
|
5934
|
+
const today = startOfDay(/* @__PURE__ */ new Date());
|
|
5935
|
+
const selectedDay = startOfDay(newDate);
|
|
5936
|
+
if (isSameDay(selectedDay, today)) setSelectedDate(endOfDay(newDate));
|
|
5937
|
+
else {
|
|
5938
|
+
newDate.setHours(selectedDate.getHours(), selectedDate.getMinutes(), 0, 0);
|
|
5939
|
+
setSelectedDate(newDate);
|
|
5940
|
+
}
|
|
5941
|
+
},
|
|
5942
|
+
mode: "single"
|
|
5943
|
+
}), /* @__PURE__ */ jsx(TimeSelector, {
|
|
5944
|
+
selectedDate,
|
|
5945
|
+
onTimeChange: handleTimeChange
|
|
5946
|
+
})]
|
|
5436
5947
|
})]
|
|
5437
5948
|
})
|
|
5438
5949
|
}) })]
|
|
@@ -5441,11 +5952,6 @@ function CalendarDropdown({ selectedDate, setSelectedDate, onSelectPreset, isOpe
|
|
|
5441
5952
|
|
|
5442
5953
|
//#endregion
|
|
5443
5954
|
//#region src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx
|
|
5444
|
-
const setToEndOfDay = (date) => {
|
|
5445
|
-
const endOfDay = new Date(date);
|
|
5446
|
-
endOfDay.setHours(23, 59, 59, 999);
|
|
5447
|
-
return endOfDay;
|
|
5448
|
-
};
|
|
5449
5955
|
const PRESET_RANGES = {
|
|
5450
5956
|
TODAY: {
|
|
5451
5957
|
label: "Today",
|
|
@@ -5479,7 +5985,12 @@ const ExpirationDateSelect = function ExpirationDateSelect$1({ className, date,
|
|
|
5479
5985
|
const presetRange = Object.values(PRESET_RANGES).find((preset) => preset.value === range);
|
|
5480
5986
|
if (!presetRange) return;
|
|
5481
5987
|
const baseDate = /* @__PURE__ */ new Date();
|
|
5482
|
-
const
|
|
5988
|
+
const targetDate = presetRange.value === "today" ? baseDate : addDays(baseDate, presetRange.offset);
|
|
5989
|
+
const newDate = presetRange.value === "today" ? endOfDay(targetDate) : (() => {
|
|
5990
|
+
const preservedTimeDate = new Date(targetDate);
|
|
5991
|
+
preservedTimeDate.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
5992
|
+
return preservedTimeDate;
|
|
5993
|
+
})();
|
|
5483
5994
|
onDateChange(newDate);
|
|
5484
5995
|
}
|
|
5485
5996
|
function handleDateValueChange(date$1) {
|
|
@@ -5739,31 +6250,424 @@ const CustomSelect = ({ items, onValueChange, defaultValue, placeholder = "Selec
|
|
|
5739
6250
|
}) })] });
|
|
5740
6251
|
};
|
|
5741
6252
|
|
|
6253
|
+
//#endregion
|
|
6254
|
+
//#region src/react/ui/modals/_internal/constants/opensea-currencies.ts
|
|
6255
|
+
const OPENSEA_CHAIN_CURRENCIES = {
|
|
6256
|
+
"1": {
|
|
6257
|
+
chainId: 1,
|
|
6258
|
+
openseaId: "ethereum",
|
|
6259
|
+
name: "Ethereum",
|
|
6260
|
+
nativeCurrency: {
|
|
6261
|
+
symbol: "ETH",
|
|
6262
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6263
|
+
},
|
|
6264
|
+
wrappedNativeCurrency: { address: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" },
|
|
6265
|
+
offerCurrency: {
|
|
6266
|
+
symbol: "WETH",
|
|
6267
|
+
address: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
|
|
6268
|
+
},
|
|
6269
|
+
listingCurrency: {
|
|
6270
|
+
symbol: "ETH",
|
|
6271
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6272
|
+
}
|
|
6273
|
+
},
|
|
6274
|
+
"10": {
|
|
6275
|
+
chainId: 10,
|
|
6276
|
+
openseaId: "optimism",
|
|
6277
|
+
name: "Optimism",
|
|
6278
|
+
nativeCurrency: {
|
|
6279
|
+
symbol: "ETH",
|
|
6280
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6281
|
+
},
|
|
6282
|
+
wrappedNativeCurrency: { address: "0x4200000000000000000000000000000000000006" },
|
|
6283
|
+
offerCurrency: {
|
|
6284
|
+
symbol: "WETH",
|
|
6285
|
+
address: "0x4200000000000000000000000000000000000006"
|
|
6286
|
+
},
|
|
6287
|
+
listingCurrency: {
|
|
6288
|
+
symbol: "ETH",
|
|
6289
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6290
|
+
}
|
|
6291
|
+
},
|
|
6292
|
+
"137": {
|
|
6293
|
+
chainId: 137,
|
|
6294
|
+
openseaId: "matic",
|
|
6295
|
+
name: "Polygon",
|
|
6296
|
+
nativeCurrency: {
|
|
6297
|
+
symbol: "POL",
|
|
6298
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6299
|
+
},
|
|
6300
|
+
wrappedNativeCurrency: { address: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270" },
|
|
6301
|
+
offerCurrency: {
|
|
6302
|
+
symbol: "WETH",
|
|
6303
|
+
address: "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619"
|
|
6304
|
+
},
|
|
6305
|
+
listingCurrency: {
|
|
6306
|
+
symbol: "WETH",
|
|
6307
|
+
address: "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619"
|
|
6308
|
+
}
|
|
6309
|
+
},
|
|
6310
|
+
"360": {
|
|
6311
|
+
chainId: 360,
|
|
6312
|
+
openseaId: "shape",
|
|
6313
|
+
name: "Shape",
|
|
6314
|
+
nativeCurrency: {
|
|
6315
|
+
symbol: "ETH",
|
|
6316
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6317
|
+
},
|
|
6318
|
+
wrappedNativeCurrency: { address: "0x4200000000000000000000000000000000000006" },
|
|
6319
|
+
offerCurrency: {
|
|
6320
|
+
symbol: "WETH",
|
|
6321
|
+
address: "0x4200000000000000000000000000000000000006"
|
|
6322
|
+
},
|
|
6323
|
+
listingCurrency: {
|
|
6324
|
+
symbol: "ETH",
|
|
6325
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6326
|
+
}
|
|
6327
|
+
},
|
|
6328
|
+
"998": {
|
|
6329
|
+
chainId: 998,
|
|
6330
|
+
openseaId: "hyperevm",
|
|
6331
|
+
name: "HyperEVM",
|
|
6332
|
+
nativeCurrency: {
|
|
6333
|
+
symbol: "HYPE",
|
|
6334
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6335
|
+
},
|
|
6336
|
+
wrappedNativeCurrency: { address: "0x5555555555555555555555555555555555555555" },
|
|
6337
|
+
offerCurrency: {
|
|
6338
|
+
symbol: "WHYPE",
|
|
6339
|
+
address: "0x5555555555555555555555555555555555555555"
|
|
6340
|
+
},
|
|
6341
|
+
listingCurrency: {
|
|
6342
|
+
symbol: "HYPE",
|
|
6343
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6344
|
+
}
|
|
6345
|
+
},
|
|
6346
|
+
"130": {
|
|
6347
|
+
chainId: 130,
|
|
6348
|
+
openseaId: "unichain",
|
|
6349
|
+
name: "Unichain",
|
|
6350
|
+
nativeCurrency: {
|
|
6351
|
+
symbol: "ETH",
|
|
6352
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6353
|
+
},
|
|
6354
|
+
wrappedNativeCurrency: { address: "0x4200000000000000000000000000000000000006" },
|
|
6355
|
+
offerCurrency: {
|
|
6356
|
+
symbol: "WETH",
|
|
6357
|
+
address: "0x4200000000000000000000000000000000000006"
|
|
6358
|
+
},
|
|
6359
|
+
listingCurrency: {
|
|
6360
|
+
symbol: "ETH",
|
|
6361
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6362
|
+
}
|
|
6363
|
+
},
|
|
6364
|
+
"1329": {
|
|
6365
|
+
chainId: 1329,
|
|
6366
|
+
openseaId: "sei",
|
|
6367
|
+
name: "Sei",
|
|
6368
|
+
nativeCurrency: {
|
|
6369
|
+
symbol: "SEI",
|
|
6370
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6371
|
+
},
|
|
6372
|
+
wrappedNativeCurrency: { address: "0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7" },
|
|
6373
|
+
offerCurrency: {
|
|
6374
|
+
symbol: "WSEI",
|
|
6375
|
+
address: "0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7"
|
|
6376
|
+
},
|
|
6377
|
+
listingCurrency: {
|
|
6378
|
+
symbol: "SEI",
|
|
6379
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6380
|
+
}
|
|
6381
|
+
},
|
|
6382
|
+
"1868": {
|
|
6383
|
+
chainId: 1868,
|
|
6384
|
+
openseaId: "soneium",
|
|
6385
|
+
name: "Soneium",
|
|
6386
|
+
nativeCurrency: {
|
|
6387
|
+
symbol: "ETH",
|
|
6388
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6389
|
+
},
|
|
6390
|
+
wrappedNativeCurrency: { address: "0x4200000000000000000000000000000000000006" },
|
|
6391
|
+
offerCurrency: {
|
|
6392
|
+
symbol: "WETH",
|
|
6393
|
+
address: "0x4200000000000000000000000000000000000006"
|
|
6394
|
+
},
|
|
6395
|
+
listingCurrency: {
|
|
6396
|
+
symbol: "ETH",
|
|
6397
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6398
|
+
}
|
|
6399
|
+
},
|
|
6400
|
+
"2020": {
|
|
6401
|
+
chainId: 2020,
|
|
6402
|
+
openseaId: "ronin",
|
|
6403
|
+
name: "Ronin",
|
|
6404
|
+
nativeCurrency: {
|
|
6405
|
+
symbol: "RON",
|
|
6406
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6407
|
+
},
|
|
6408
|
+
wrappedNativeCurrency: { address: "0xe514d9deb7966c8be0ca922de8a064264ea6bcd4" },
|
|
6409
|
+
offerCurrency: {
|
|
6410
|
+
symbol: "WRON",
|
|
6411
|
+
address: "0xe514d9deb7966c8be0ca922de8a064264ea6bcd4"
|
|
6412
|
+
},
|
|
6413
|
+
listingCurrency: {
|
|
6414
|
+
symbol: "RON",
|
|
6415
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6416
|
+
}
|
|
6417
|
+
},
|
|
6418
|
+
"2741": {
|
|
6419
|
+
chainId: 2741,
|
|
6420
|
+
openseaId: "abstract",
|
|
6421
|
+
name: "Abstract",
|
|
6422
|
+
nativeCurrency: {
|
|
6423
|
+
symbol: "ETH",
|
|
6424
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6425
|
+
},
|
|
6426
|
+
wrappedNativeCurrency: { address: "0x3439153eb7af838ad19d56e1571fbd09333c2809" },
|
|
6427
|
+
offerCurrency: {
|
|
6428
|
+
symbol: "WETH",
|
|
6429
|
+
address: "0x3439153eb7af838ad19d56e1571fbd09333c2809"
|
|
6430
|
+
},
|
|
6431
|
+
listingCurrency: {
|
|
6432
|
+
symbol: "ETH",
|
|
6433
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6434
|
+
}
|
|
6435
|
+
},
|
|
6436
|
+
"8333": {
|
|
6437
|
+
chainId: 8333,
|
|
6438
|
+
openseaId: "b3",
|
|
6439
|
+
name: "B3",
|
|
6440
|
+
nativeCurrency: {
|
|
6441
|
+
symbol: "ETH",
|
|
6442
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6443
|
+
},
|
|
6444
|
+
wrappedNativeCurrency: { address: "0x4200000000000000000000000000000000000006" },
|
|
6445
|
+
offerCurrency: {
|
|
6446
|
+
symbol: "WETH",
|
|
6447
|
+
address: "0x4200000000000000000000000000000000000006"
|
|
6448
|
+
},
|
|
6449
|
+
listingCurrency: {
|
|
6450
|
+
symbol: "ETH",
|
|
6451
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6452
|
+
}
|
|
6453
|
+
},
|
|
6454
|
+
"8453": {
|
|
6455
|
+
chainId: 8453,
|
|
6456
|
+
openseaId: "base",
|
|
6457
|
+
name: "Base",
|
|
6458
|
+
nativeCurrency: {
|
|
6459
|
+
symbol: "ETH",
|
|
6460
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6461
|
+
},
|
|
6462
|
+
wrappedNativeCurrency: { address: "0x4200000000000000000000000000000000000006" },
|
|
6463
|
+
offerCurrency: {
|
|
6464
|
+
symbol: "WETH",
|
|
6465
|
+
address: "0x4200000000000000000000000000000000000006"
|
|
6466
|
+
},
|
|
6467
|
+
listingCurrency: {
|
|
6468
|
+
symbol: "ETH",
|
|
6469
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6470
|
+
}
|
|
6471
|
+
},
|
|
6472
|
+
"33139": {
|
|
6473
|
+
chainId: 33139,
|
|
6474
|
+
openseaId: "ape_chain",
|
|
6475
|
+
name: "ApeChain",
|
|
6476
|
+
nativeCurrency: {
|
|
6477
|
+
symbol: "APE",
|
|
6478
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6479
|
+
},
|
|
6480
|
+
wrappedNativeCurrency: { address: "0x48b62137edfa95a428d35c09e44256a739f6b557" },
|
|
6481
|
+
offerCurrency: {
|
|
6482
|
+
symbol: "WAPE",
|
|
6483
|
+
address: "0x48b62137edfa95a428d35c09e44256a739f6b557"
|
|
6484
|
+
},
|
|
6485
|
+
listingCurrency: {
|
|
6486
|
+
symbol: "APE",
|
|
6487
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6488
|
+
}
|
|
6489
|
+
},
|
|
6490
|
+
"42161": {
|
|
6491
|
+
chainId: 42161,
|
|
6492
|
+
openseaId: "arbitrum",
|
|
6493
|
+
name: "Arbitrum",
|
|
6494
|
+
nativeCurrency: {
|
|
6495
|
+
symbol: "ETH",
|
|
6496
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6497
|
+
},
|
|
6498
|
+
wrappedNativeCurrency: { address: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1" },
|
|
6499
|
+
offerCurrency: {
|
|
6500
|
+
symbol: "WETH",
|
|
6501
|
+
address: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1"
|
|
6502
|
+
},
|
|
6503
|
+
listingCurrency: {
|
|
6504
|
+
symbol: "ETH",
|
|
6505
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6506
|
+
}
|
|
6507
|
+
},
|
|
6508
|
+
"42170": {
|
|
6509
|
+
chainId: 42170,
|
|
6510
|
+
openseaId: "arbitrum_nova",
|
|
6511
|
+
name: "Arbitrum Nova",
|
|
6512
|
+
nativeCurrency: {
|
|
6513
|
+
symbol: "ETH",
|
|
6514
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6515
|
+
},
|
|
6516
|
+
wrappedNativeCurrency: { address: "0x722e8bdd2ce80a4422e880164f2079488e115365" },
|
|
6517
|
+
offerCurrency: {
|
|
6518
|
+
symbol: "WETH",
|
|
6519
|
+
address: "0x722e8bdd2ce80a4422e880164f2079488e115365"
|
|
6520
|
+
},
|
|
6521
|
+
listingCurrency: {
|
|
6522
|
+
symbol: "ETH",
|
|
6523
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6524
|
+
}
|
|
6525
|
+
},
|
|
6526
|
+
"43114": {
|
|
6527
|
+
chainId: 43114,
|
|
6528
|
+
openseaId: "avalanche",
|
|
6529
|
+
name: "Avalanche",
|
|
6530
|
+
nativeCurrency: {
|
|
6531
|
+
symbol: "AVAX",
|
|
6532
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6533
|
+
},
|
|
6534
|
+
wrappedNativeCurrency: { address: "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7" },
|
|
6535
|
+
offerCurrency: {
|
|
6536
|
+
symbol: "WAVAX",
|
|
6537
|
+
address: "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7"
|
|
6538
|
+
},
|
|
6539
|
+
listingCurrency: {
|
|
6540
|
+
symbol: "AVAX",
|
|
6541
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6542
|
+
}
|
|
6543
|
+
},
|
|
6544
|
+
"43419": {
|
|
6545
|
+
chainId: 43419,
|
|
6546
|
+
openseaId: "gunzilla",
|
|
6547
|
+
name: "GUNZ",
|
|
6548
|
+
nativeCurrency: {
|
|
6549
|
+
symbol: "GUN",
|
|
6550
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6551
|
+
},
|
|
6552
|
+
wrappedNativeCurrency: { address: "0x5aad7bba61d95c2c4e525a35f4062040264611f1" },
|
|
6553
|
+
offerCurrency: {
|
|
6554
|
+
symbol: "WGUN",
|
|
6555
|
+
address: "0x5aad7bba61d95c2c4e525a35f4062040264611f1"
|
|
6556
|
+
},
|
|
6557
|
+
listingCurrency: {
|
|
6558
|
+
symbol: "GUN",
|
|
6559
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6560
|
+
}
|
|
6561
|
+
},
|
|
6562
|
+
"50311": {
|
|
6563
|
+
chainId: 50311,
|
|
6564
|
+
openseaId: "somnia",
|
|
6565
|
+
name: "Somnia",
|
|
6566
|
+
nativeCurrency: {
|
|
6567
|
+
symbol: "SOMI",
|
|
6568
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6569
|
+
},
|
|
6570
|
+
wrappedNativeCurrency: { address: "0x046ede9564a72571df6f5e44d0405360c0f4dcab" },
|
|
6571
|
+
offerCurrency: {
|
|
6572
|
+
symbol: "WSOMI",
|
|
6573
|
+
address: "0x046ede9564a72571df6f5e44d0405360c0f4dcab"
|
|
6574
|
+
},
|
|
6575
|
+
listingCurrency: {
|
|
6576
|
+
symbol: "SOMI",
|
|
6577
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6578
|
+
}
|
|
6579
|
+
},
|
|
6580
|
+
"80094": {
|
|
6581
|
+
chainId: 80094,
|
|
6582
|
+
openseaId: "bera_chain",
|
|
6583
|
+
name: "Berachain",
|
|
6584
|
+
nativeCurrency: {
|
|
6585
|
+
symbol: "BERA",
|
|
6586
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6587
|
+
},
|
|
6588
|
+
wrappedNativeCurrency: { address: "0x6969696969696969696969696969696969696969" },
|
|
6589
|
+
offerCurrency: {
|
|
6590
|
+
symbol: "WBERA",
|
|
6591
|
+
address: "0x6969696969696969696969696969696969696969"
|
|
6592
|
+
},
|
|
6593
|
+
listingCurrency: {
|
|
6594
|
+
symbol: "BERA",
|
|
6595
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6596
|
+
}
|
|
6597
|
+
},
|
|
6598
|
+
"81457": {
|
|
6599
|
+
chainId: 81457,
|
|
6600
|
+
openseaId: "blast",
|
|
6601
|
+
name: "Blast",
|
|
6602
|
+
nativeCurrency: {
|
|
6603
|
+
symbol: "ETH",
|
|
6604
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6605
|
+
},
|
|
6606
|
+
wrappedNativeCurrency: { address: "0x4300000000000000000000000000000000000004" },
|
|
6607
|
+
offerCurrency: {
|
|
6608
|
+
symbol: "WETH",
|
|
6609
|
+
address: "0x4300000000000000000000000000000000000004"
|
|
6610
|
+
},
|
|
6611
|
+
listingCurrency: {
|
|
6612
|
+
symbol: "ETH",
|
|
6613
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6614
|
+
}
|
|
6615
|
+
},
|
|
6616
|
+
"7777777": {
|
|
6617
|
+
chainId: 7777777,
|
|
6618
|
+
openseaId: "zora",
|
|
6619
|
+
name: "Zora",
|
|
6620
|
+
nativeCurrency: {
|
|
6621
|
+
symbol: "ETH",
|
|
6622
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6623
|
+
},
|
|
6624
|
+
wrappedNativeCurrency: { address: "0x4200000000000000000000000000000000000006" },
|
|
6625
|
+
offerCurrency: {
|
|
6626
|
+
symbol: "WETH",
|
|
6627
|
+
address: "0x4200000000000000000000000000000000000006"
|
|
6628
|
+
},
|
|
6629
|
+
listingCurrency: {
|
|
6630
|
+
symbol: "ETH",
|
|
6631
|
+
address: "0x0000000000000000000000000000000000000000"
|
|
6632
|
+
}
|
|
6633
|
+
}
|
|
6634
|
+
};
|
|
6635
|
+
function getOpenseaCurrencyForChain(chainId, modalType) {
|
|
6636
|
+
const config = OPENSEA_CHAIN_CURRENCIES[chainId.toString()];
|
|
6637
|
+
if (!config) return;
|
|
6638
|
+
return modalType === "listing" ? config.listingCurrency : config.offerCurrency;
|
|
6639
|
+
}
|
|
6640
|
+
|
|
5742
6641
|
//#endregion
|
|
5743
6642
|
//#region src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx
|
|
5744
|
-
function CurrencyOptionsSelect({ chainId, collectionAddress, secondCurrencyAsDefault, selectedCurrency, onCurrencyChange, includeNativeCurrency }) {
|
|
6643
|
+
function CurrencyOptionsSelect({ chainId, collectionAddress, secondCurrencyAsDefault, selectedCurrency, onCurrencyChange, includeNativeCurrency, orderbookKind, modalType }) {
|
|
5745
6644
|
const { data: currencies, isLoading: currenciesLoading } = useMarketCurrencies({
|
|
5746
6645
|
chainId,
|
|
5747
6646
|
collectionAddress,
|
|
5748
6647
|
includeNativeCurrency
|
|
5749
6648
|
});
|
|
6649
|
+
let filteredCurrencies = currencies;
|
|
6650
|
+
if (currencies && orderbookKind === OrderbookKind.opensea && modalType) {
|
|
6651
|
+
const openseaCurrency = getOpenseaCurrencyForChain(chainId, modalType);
|
|
6652
|
+
if (openseaCurrency) filteredCurrencies = currencies.filter((currency) => compareAddress(currency.contractAddress, openseaCurrency.address));
|
|
6653
|
+
}
|
|
5750
6654
|
useEffect(() => {
|
|
5751
|
-
if (
|
|
5752
|
-
else onCurrencyChange(
|
|
6655
|
+
if (filteredCurrencies && filteredCurrencies.length > 0 && !selectedCurrency?.contractAddress) if (secondCurrencyAsDefault && filteredCurrencies.length > 1) onCurrencyChange(filteredCurrencies[1]);
|
|
6656
|
+
else onCurrencyChange(filteredCurrencies[0]);
|
|
5753
6657
|
}, [
|
|
5754
|
-
|
|
6658
|
+
filteredCurrencies,
|
|
5755
6659
|
selectedCurrency?.contractAddress,
|
|
5756
6660
|
secondCurrencyAsDefault,
|
|
5757
6661
|
onCurrencyChange
|
|
5758
6662
|
]);
|
|
5759
|
-
if (!
|
|
5760
|
-
const options =
|
|
6663
|
+
if (!filteredCurrencies || currenciesLoading || !selectedCurrency?.symbol) return /* @__PURE__ */ jsx(Skeleton, { className: "mr-3 h-7 w-20 rounded-2xl" });
|
|
6664
|
+
const options = filteredCurrencies.map((currency) => ({
|
|
5761
6665
|
label: currency.symbol,
|
|
5762
6666
|
value: currency.contractAddress,
|
|
5763
6667
|
content: currency.symbol
|
|
5764
6668
|
}));
|
|
5765
6669
|
const onChange = (value) => {
|
|
5766
|
-
const selectedCurrency$1 =
|
|
6670
|
+
const selectedCurrency$1 = filteredCurrencies.find((currency) => currency.contractAddress === value);
|
|
5767
6671
|
if (selectedCurrency$1) onCurrencyChange(selectedCurrency$1);
|
|
5768
6672
|
};
|
|
5769
6673
|
return /* @__PURE__ */ jsx(CustomSelect, {
|
|
@@ -5780,7 +6684,7 @@ var currencyOptionsSelect_default = CurrencyOptionsSelect;
|
|
|
5780
6684
|
|
|
5781
6685
|
//#endregion
|
|
5782
6686
|
//#region src/react/ui/modals/_internal/components/priceInput/index.tsx
|
|
5783
|
-
function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurrencyChange, checkBalance, secondCurrencyAsDefault, includeNativeCurrency, disabled }) {
|
|
6687
|
+
function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurrencyChange, checkBalance, secondCurrencyAsDefault, includeNativeCurrency, disabled, orderbookKind, setOpenseaLowestPriceCriteriaMet, modalType }) {
|
|
5784
6688
|
const { address: accountAddress } = useAccount();
|
|
5785
6689
|
const inputRef = useRef(null);
|
|
5786
6690
|
const currency = price?.currency;
|
|
@@ -5790,6 +6694,12 @@ function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurren
|
|
|
5790
6694
|
const handleCurrencyChange = (newCurrency) => {
|
|
5791
6695
|
if (price && onCurrencyChange) onCurrencyChange(newCurrency);
|
|
5792
6696
|
};
|
|
6697
|
+
const { data: conversion, isLoading: isConversionLoading } = useConvertPriceToUSD({
|
|
6698
|
+
chainId,
|
|
6699
|
+
currencyAddress,
|
|
6700
|
+
amountRaw: priceAmountRaw,
|
|
6701
|
+
query: { enabled: orderbookKind === OrderbookKind.opensea && !!currencyAddress && !!priceAmountRaw && !!setOpenseaLowestPriceCriteriaMet }
|
|
6702
|
+
});
|
|
5793
6703
|
useEffect(() => {
|
|
5794
6704
|
if (inputRef.current) inputRef.current.focus();
|
|
5795
6705
|
}, []);
|
|
@@ -5799,7 +6709,9 @@ function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurren
|
|
|
5799
6709
|
userAddress: accountAddress
|
|
5800
6710
|
});
|
|
5801
6711
|
const balanceError = !!checkBalance?.enabled && !!isBalanceSuccess && !!priceAmountRaw && !!currencyDecimals && BigInt(priceAmountRaw) > BigInt(balance?.value || 0n);
|
|
6712
|
+
const openseaLowestPriceCriteriaMet = orderbookKind === OrderbookKind.opensea && !!conversion?.usdAmount && conversion.usdAmount >= .01;
|
|
5802
6713
|
if (checkBalance?.enabled) checkBalance.callback(balanceError);
|
|
6714
|
+
if (setOpenseaLowestPriceCriteriaMet) setOpenseaLowestPriceCriteriaMet(openseaLowestPriceCriteriaMet);
|
|
5803
6715
|
const [value, setValue] = useState("0");
|
|
5804
6716
|
const prevCurrencyDecimals = useRef(currencyDecimals);
|
|
5805
6717
|
useEffect(() => {
|
|
@@ -5865,7 +6777,9 @@ function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurren
|
|
|
5865
6777
|
collectionAddress,
|
|
5866
6778
|
chainId,
|
|
5867
6779
|
secondCurrencyAsDefault,
|
|
5868
|
-
includeNativeCurrency
|
|
6780
|
+
includeNativeCurrency,
|
|
6781
|
+
orderbookKind,
|
|
6782
|
+
modalType
|
|
5869
6783
|
}),
|
|
5870
6784
|
value,
|
|
5871
6785
|
onChange: handleChange
|
|
@@ -5875,6 +6789,11 @@ function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurren
|
|
|
5875
6789
|
className: "-bottom-5 absolute font-body font-medium text-xs",
|
|
5876
6790
|
color: "negative",
|
|
5877
6791
|
children: "Insufficient balance"
|
|
6792
|
+
}),
|
|
6793
|
+
!balanceError && priceAmountRaw !== "0" && !openseaLowestPriceCriteriaMet && orderbookKind === OrderbookKind.opensea && !isConversionLoading && modalType === "offer" && /* @__PURE__ */ jsx(Text, {
|
|
6794
|
+
className: "-bottom-5 absolute font-body font-medium text-xs",
|
|
6795
|
+
color: "negative",
|
|
6796
|
+
children: "Lowest price must be at least $0.01"
|
|
5878
6797
|
})
|
|
5879
6798
|
]
|
|
5880
6799
|
});
|
|
@@ -6181,14 +7100,36 @@ function TransactionDetails({ collectibleId, collectionAddress, chainId, include
|
|
|
6181
7100
|
collectionAddress,
|
|
6182
7101
|
collectibleId
|
|
6183
7102
|
});
|
|
7103
|
+
const [overflow, setOverflow] = useState({
|
|
7104
|
+
status: false,
|
|
7105
|
+
amount: "0"
|
|
7106
|
+
});
|
|
6184
7107
|
const priceLoading = !price || marketplaceConfigLoading || royaltyLoading;
|
|
6185
|
-
|
|
6186
|
-
|
|
7108
|
+
const [formattedAmount, setFormattedAmount] = useState("0");
|
|
7109
|
+
useEffect(() => {
|
|
7110
|
+
if (!price || royaltyLoading || marketplaceConfigLoading) return;
|
|
6187
7111
|
const fees = [];
|
|
6188
7112
|
if (royalty !== null) fees.push(Number(royalty.percentage));
|
|
6189
7113
|
if (marketplaceFeePercentage > 0) fees.push(marketplaceFeePercentage);
|
|
6190
|
-
|
|
6191
|
-
|
|
7114
|
+
const newFormattedAmount = calculateEarningsAfterFees(BigInt(price.amountRaw), price.currency.decimals, fees);
|
|
7115
|
+
setFormattedAmount(newFormattedAmount);
|
|
7116
|
+
}, [
|
|
7117
|
+
price,
|
|
7118
|
+
royalty,
|
|
7119
|
+
marketplaceFeePercentage,
|
|
7120
|
+
royaltyLoading,
|
|
7121
|
+
marketplaceConfigLoading
|
|
7122
|
+
]);
|
|
7123
|
+
useEffect(() => {
|
|
7124
|
+
if (formattedAmount.length > 15) setOverflow((prev) => prev.status ? prev : {
|
|
7125
|
+
status: true,
|
|
7126
|
+
amount: formattedAmount.slice(0, 15)
|
|
7127
|
+
});
|
|
7128
|
+
else setOverflow({
|
|
7129
|
+
status: false,
|
|
7130
|
+
amount: formattedAmount
|
|
7131
|
+
});
|
|
7132
|
+
}, [formattedAmount]);
|
|
6192
7133
|
return /* @__PURE__ */ jsxs("div", {
|
|
6193
7134
|
className: "flex w-full items-center justify-between",
|
|
6194
7135
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
@@ -6200,14 +7141,36 @@ function TransactionDetails({ collectibleId, collectionAddress, chainId, include
|
|
|
6200
7141
|
children: [/* @__PURE__ */ jsx(Image, {
|
|
6201
7142
|
className: "h-3 w-3",
|
|
6202
7143
|
src: currencyImageUrl
|
|
6203
|
-
}), priceLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24 animate-shimmer" }) : /* @__PURE__ */
|
|
7144
|
+
}), priceLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24 animate-shimmer" }) : /* @__PURE__ */ jsx(Text, {
|
|
6204
7145
|
className: "font-body font-medium text-xs",
|
|
6205
7146
|
color: "text100",
|
|
6206
|
-
children:
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
price.currency.symbol
|
|
6210
|
-
|
|
7147
|
+
children: showPlaceholderPrice ? /* @__PURE__ */ jsxs(Text, {
|
|
7148
|
+
className: "font-body font-medium text-xs",
|
|
7149
|
+
color: "text100",
|
|
7150
|
+
children: ["0 ", price.currency.symbol]
|
|
7151
|
+
}) : overflow.status ? /* @__PURE__ */ jsx(Tooltip, {
|
|
7152
|
+
message: formattedAmount + " " + price.currency.symbol,
|
|
7153
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
7154
|
+
className: "flex items-center",
|
|
7155
|
+
children: [/* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3 text-text-100" }), /* @__PURE__ */ jsxs(Text, {
|
|
7156
|
+
className: "font-body font-medium text-xs",
|
|
7157
|
+
color: "text100",
|
|
7158
|
+
children: [
|
|
7159
|
+
overflow.amount,
|
|
7160
|
+
" ",
|
|
7161
|
+
price.currency.symbol
|
|
7162
|
+
]
|
|
7163
|
+
})]
|
|
7164
|
+
})
|
|
7165
|
+
}) : /* @__PURE__ */ jsxs(Text, {
|
|
7166
|
+
className: "font-body font-medium text-xs",
|
|
7167
|
+
color: "text100",
|
|
7168
|
+
children: [
|
|
7169
|
+
formattedAmount,
|
|
7170
|
+
" ",
|
|
7171
|
+
price.currency.symbol
|
|
7172
|
+
]
|
|
7173
|
+
})
|
|
6211
7174
|
})]
|
|
6212
7175
|
})]
|
|
6213
7176
|
});
|
|
@@ -6250,7 +7213,7 @@ const useGetTokenApprovalData$2 = (params) => {
|
|
|
6250
7213
|
expiry: String(Number(dateToUnixTime(/* @__PURE__ */ new Date())) + ONE_DAY_IN_SECONDS$1)
|
|
6251
7214
|
};
|
|
6252
7215
|
const isEnabled = address && (params.query?.enabled ?? true) && !!params.currencyAddress;
|
|
6253
|
-
const { data, isLoading, isSuccess } = useQuery({
|
|
7216
|
+
const { data, isLoading, isSuccess, isError, error } = useQuery({
|
|
6254
7217
|
queryKey: [
|
|
6255
7218
|
"token-approval-data",
|
|
6256
7219
|
params,
|
|
@@ -6264,7 +7227,8 @@ const useGetTokenApprovalData$2 = (params) => {
|
|
|
6264
7227
|
walletType: walletKind,
|
|
6265
7228
|
contractType: params.contractType,
|
|
6266
7229
|
orderbook: params.orderbook,
|
|
6267
|
-
listing
|
|
7230
|
+
listing,
|
|
7231
|
+
additionalFees: []
|
|
6268
7232
|
};
|
|
6269
7233
|
const tokenApprovalStep = (await marketplaceClient.generateListingTransaction(args).then((resp) => resp.steps)).find((step) => step.id === StepType.tokenApproval);
|
|
6270
7234
|
if (!tokenApprovalStep) return { step: null };
|
|
@@ -6274,7 +7238,9 @@ const useGetTokenApprovalData$2 = (params) => {
|
|
|
6274
7238
|
return {
|
|
6275
7239
|
data,
|
|
6276
7240
|
isLoading,
|
|
6277
|
-
isSuccess
|
|
7241
|
+
isSuccess,
|
|
7242
|
+
isError,
|
|
7243
|
+
error
|
|
6278
7244
|
};
|
|
6279
7245
|
};
|
|
6280
7246
|
|
|
@@ -6324,7 +7290,8 @@ const useTransactionSteps$2 = ({ listingInput, chainId, collectionAddress, order
|
|
|
6324
7290
|
listing: {
|
|
6325
7291
|
...listingInput.listing,
|
|
6326
7292
|
expiry: /* @__PURE__ */ new Date(Number(listingInput.listing.expiry) * 1e3)
|
|
6327
|
-
}
|
|
7293
|
+
},
|
|
7294
|
+
additionalFees: []
|
|
6328
7295
|
});
|
|
6329
7296
|
} catch (error) {
|
|
6330
7297
|
if (callbacks?.onError) callbacks.onError(error);
|
|
@@ -6440,7 +7407,7 @@ const useCreateListing = ({ listingInput, chainId, collectionAddress, orderbookK
|
|
|
6440
7407
|
const { data: marketplaceConfig, isLoading: marketplaceIsLoading } = useMarketplaceConfig();
|
|
6441
7408
|
const collectionConfig = marketplaceConfig?.market.collections.find((c) => compareAddress(c.itemsAddress, collectionAddress));
|
|
6442
7409
|
orderbookKind = orderbookKind ?? collectionConfig?.destinationMarketplace ?? OrderbookKind.sequence_marketplace_v2;
|
|
6443
|
-
const { data: tokenApproval, isLoading: tokenApprovalIsLoading } = useGetTokenApprovalData$2({
|
|
7410
|
+
const { data: tokenApproval, isLoading: tokenApprovalIsLoading, isError, error } = useGetTokenApprovalData$2({
|
|
6444
7411
|
chainId,
|
|
6445
7412
|
tokenId: listingInput.listing.tokenId,
|
|
6446
7413
|
collectionAddress,
|
|
@@ -6466,7 +7433,9 @@ const useCreateListing = ({ listingInput, chainId, collectionAddress, orderbookK
|
|
|
6466
7433
|
executeApproval,
|
|
6467
7434
|
createListing,
|
|
6468
7435
|
tokenApprovalStepExists: tokenApproval?.step !== null,
|
|
6469
|
-
tokenApprovalIsLoading
|
|
7436
|
+
tokenApprovalIsLoading,
|
|
7437
|
+
isError,
|
|
7438
|
+
error
|
|
6470
7439
|
};
|
|
6471
7440
|
};
|
|
6472
7441
|
|
|
@@ -6542,7 +7511,11 @@ const CreateListingModal = () => {
|
|
|
6542
7511
|
});
|
|
6543
7512
|
};
|
|
6544
7513
|
const Modal$3 = observer(() => {
|
|
6545
|
-
const { collectionAddress, chainId, listingPrice: listingPrice$1, collectibleId, orderbookKind, callbacks, listingIsBeingProcessed } = createListingModal$.get();
|
|
7514
|
+
const { collectionAddress, chainId, listingPrice: listingPrice$1, collectibleId, orderbookKind: orderbookKindProp, callbacks, listingIsBeingProcessed } = createListingModal$.get();
|
|
7515
|
+
const { data: marketplaceConfig } = useMarketplaceConfig();
|
|
7516
|
+
const [error, setError] = useState(void 0);
|
|
7517
|
+
const collectionConfig = marketplaceConfig?.market.collections.find((c) => c.itemsAddress === collectionAddress);
|
|
7518
|
+
const orderbookKind = orderbookKindProp ?? collectionConfig?.destinationMarketplace;
|
|
6546
7519
|
const steps$ = createListingModal$.steps;
|
|
6547
7520
|
const { isWaaS } = useConnectorMetadata();
|
|
6548
7521
|
const { isVisible: feeOptionsVisible, selectedFeeOption } = useSelectWaasFeeOptionsStore();
|
|
@@ -6574,7 +7547,7 @@ const Modal$3 = observer(() => {
|
|
|
6574
7547
|
userAddress: address ?? void 0
|
|
6575
7548
|
});
|
|
6576
7549
|
const balanceWithDecimals = balance?.balance ? dn.toNumber(dn.from([BigInt(balance.balance), collectible?.decimals || 0])) : 0;
|
|
6577
|
-
const { isLoading, executeApproval, createListing, tokenApprovalIsLoading } = useCreateListing({
|
|
7550
|
+
const { isLoading, executeApproval, createListing, tokenApprovalIsLoading, isError: tokenApprovalIsError } = useCreateListing({
|
|
6578
7551
|
listingInput: {
|
|
6579
7552
|
contractType: collection?.type,
|
|
6580
7553
|
listing: {
|
|
@@ -6592,7 +7565,7 @@ const Modal$3 = observer(() => {
|
|
|
6592
7565
|
closeMainModal: () => createListingModal$.close(),
|
|
6593
7566
|
steps$
|
|
6594
7567
|
});
|
|
6595
|
-
if (collectableIsError || collectionIsError || currenciesIsError) return /* @__PURE__ */ jsx(ErrorModal, {
|
|
7568
|
+
if (collectableIsError || collectionIsError || currenciesIsError || tokenApprovalIsError) return /* @__PURE__ */ jsx(ErrorModal, {
|
|
6596
7569
|
isOpen: createListingModal$.isOpen.get(),
|
|
6597
7570
|
chainId: Number(chainId),
|
|
6598
7571
|
onClose: createListingModal$.close,
|
|
@@ -6610,17 +7583,24 @@ const Modal$3 = observer(() => {
|
|
|
6610
7583
|
try {
|
|
6611
7584
|
if (isWaaS) selectWaasFeeOptionsStore.send({ type: "show" });
|
|
6612
7585
|
await createListing({ isTransactionExecuting: !!isWaaS });
|
|
6613
|
-
} catch (error) {
|
|
6614
|
-
console.error("Create listing failed:", error);
|
|
7586
|
+
} catch (error$1) {
|
|
7587
|
+
console.error("Create listing failed:", error$1);
|
|
7588
|
+
setError(error$1);
|
|
6615
7589
|
} finally {
|
|
6616
7590
|
createListingModal$.listingIsBeingProcessed.set(false);
|
|
6617
7591
|
steps$.transaction.isExecuting.set(false);
|
|
6618
7592
|
}
|
|
6619
7593
|
};
|
|
7594
|
+
const handleApproveToken = async () => {
|
|
7595
|
+
await executeApproval().catch((error$1) => {
|
|
7596
|
+
console.error("Approve TOKEN failed:", error$1);
|
|
7597
|
+
setError(error$1);
|
|
7598
|
+
});
|
|
7599
|
+
};
|
|
6620
7600
|
const listCtaLabel = getActionLabel("List item for sale");
|
|
6621
7601
|
const ctas = [{
|
|
6622
7602
|
label: "Approve TOKEN",
|
|
6623
|
-
onClick:
|
|
7603
|
+
onClick: handleApproveToken,
|
|
6624
7604
|
hidden: !steps$.approval.exist.get(),
|
|
6625
7605
|
pending: steps$?.approval.isExecuting.get(),
|
|
6626
7606
|
variant: "glass",
|
|
@@ -6663,7 +7643,9 @@ const Modal$3 = observer(() => {
|
|
|
6663
7643
|
onCurrencyChange: (newCurrency) => {
|
|
6664
7644
|
createListingModal$.listingPrice.currency.set(newCurrency);
|
|
6665
7645
|
},
|
|
6666
|
-
disabled: shouldHideListButton
|
|
7646
|
+
disabled: shouldHideListButton,
|
|
7647
|
+
orderbookKind,
|
|
7648
|
+
modalType: "listing"
|
|
6667
7649
|
}), listingPrice$1.amountRaw !== "0" && /* @__PURE__ */ jsx(FloorPriceText, {
|
|
6668
7650
|
tokenId: collectibleId,
|
|
6669
7651
|
chainId,
|
|
@@ -6700,6 +7682,11 @@ const Modal$3 = observer(() => {
|
|
|
6700
7682
|
steps$.transaction.isExecuting.set(false);
|
|
6701
7683
|
},
|
|
6702
7684
|
titleOnConfirm: "Processing listing..."
|
|
7685
|
+
}),
|
|
7686
|
+
error && /* @__PURE__ */ jsx(ErrorLogBox, {
|
|
7687
|
+
title: "An error occurred while listing",
|
|
7688
|
+
message: "Please try again",
|
|
7689
|
+
error
|
|
6703
7690
|
})
|
|
6704
7691
|
]
|
|
6705
7692
|
});
|
|
@@ -6736,7 +7723,7 @@ const useGetTokenApprovalData$1 = (params) => {
|
|
|
6736
7723
|
expiry: String(Number(dateToUnixTime(/* @__PURE__ */ new Date())) + ONE_DAY_IN_SECONDS)
|
|
6737
7724
|
};
|
|
6738
7725
|
const isEnabled = address && params.query?.enabled !== false;
|
|
6739
|
-
const { data, isLoading, isSuccess } = useQuery({
|
|
7726
|
+
const { data, isLoading, isSuccess, isError, error } = useQuery({
|
|
6740
7727
|
queryKey: ["token-approval-data", params.currencyAddress],
|
|
6741
7728
|
queryFn: isEnabled ? async () => {
|
|
6742
7729
|
const args = {
|
|
@@ -6746,7 +7733,8 @@ const useGetTokenApprovalData$1 = (params) => {
|
|
|
6746
7733
|
walletType: walletKind,
|
|
6747
7734
|
contractType: params.contractType,
|
|
6748
7735
|
orderbook: params.orderbook,
|
|
6749
|
-
offer
|
|
7736
|
+
offer,
|
|
7737
|
+
additionalFees: []
|
|
6750
7738
|
};
|
|
6751
7739
|
const tokenApprovalStep = (await marketplaceClient.generateOfferTransaction(args).then((resp) => resp.steps)).find((step) => step.id === StepType.tokenApproval);
|
|
6752
7740
|
if (!tokenApprovalStep) return { step: null };
|
|
@@ -6757,7 +7745,9 @@ const useGetTokenApprovalData$1 = (params) => {
|
|
|
6757
7745
|
return {
|
|
6758
7746
|
data,
|
|
6759
7747
|
isLoading,
|
|
6760
|
-
isSuccess
|
|
7748
|
+
isSuccess,
|
|
7749
|
+
isError,
|
|
7750
|
+
error
|
|
6761
7751
|
};
|
|
6762
7752
|
};
|
|
6763
7753
|
|
|
@@ -6793,7 +7783,8 @@ const useTransactionSteps$1 = ({ offerInput, chainId, collectionAddress, orderbo
|
|
|
6793
7783
|
offer: {
|
|
6794
7784
|
...offerInput.offer,
|
|
6795
7785
|
expiry: /* @__PURE__ */ new Date(Number(offerInput.offer.expiry) * 1e3)
|
|
6796
|
-
}
|
|
7786
|
+
},
|
|
7787
|
+
additionalFees: []
|
|
6797
7788
|
});
|
|
6798
7789
|
} catch (error) {
|
|
6799
7790
|
if (callbacks?.onError) callbacks.onError(error);
|
|
@@ -6898,17 +7889,13 @@ const useTransactionSteps$1 = ({ offerInput, chainId, collectionAddress, orderbo
|
|
|
6898
7889
|
//#endregion
|
|
6899
7890
|
//#region src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx
|
|
6900
7891
|
const useMakeOffer = ({ offerInput, chainId, collectionAddress, orderbookKind, callbacks, closeMainModal, steps$ }) => {
|
|
6901
|
-
const { data:
|
|
6902
|
-
const collectionConfig = marketplaceConfig?.market.collections.find((c) => c.itemsAddress === collectionAddress);
|
|
6903
|
-
orderbookKind = orderbookKind ?? collectionConfig?.destinationMarketplace ?? OrderbookKind.sequence_marketplace_v2;
|
|
6904
|
-
const { data: tokenApproval, isLoading: tokenApprovalIsLoading } = useGetTokenApprovalData$1({
|
|
7892
|
+
const { data: tokenApproval, isLoading: tokenApprovalIsLoading, isError, error } = useGetTokenApprovalData$1({
|
|
6905
7893
|
chainId,
|
|
6906
7894
|
tokenId: offerInput.offer.tokenId,
|
|
6907
7895
|
collectionAddress,
|
|
6908
7896
|
currencyAddress: offerInput.offer.currencyAddress,
|
|
6909
7897
|
contractType: offerInput.contractType,
|
|
6910
|
-
orderbook: orderbookKind
|
|
6911
|
-
query: { enabled: !marketplaceIsLoading }
|
|
7898
|
+
orderbook: orderbookKind || OrderbookKind.sequence_marketplace_v2
|
|
6912
7899
|
});
|
|
6913
7900
|
useEffect(() => {
|
|
6914
7901
|
if (!tokenApprovalIsLoading) steps$.approval.exist.set(!!tokenApproval?.step);
|
|
@@ -6927,7 +7914,9 @@ const useMakeOffer = ({ offerInput, chainId, collectionAddress, orderbookKind, c
|
|
|
6927
7914
|
executeApproval,
|
|
6928
7915
|
makeOffer,
|
|
6929
7916
|
tokenApprovalStepExists: tokenApproval?.step !== null,
|
|
6930
|
-
tokenApprovalIsLoading
|
|
7917
|
+
tokenApprovalIsLoading,
|
|
7918
|
+
isError,
|
|
7919
|
+
error
|
|
6931
7920
|
};
|
|
6932
7921
|
};
|
|
6933
7922
|
|
|
@@ -7001,9 +7990,14 @@ const MakeOfferModal = () => {
|
|
|
7001
7990
|
});
|
|
7002
7991
|
};
|
|
7003
7992
|
const Modal$2 = observer(() => {
|
|
7004
|
-
const { collectionAddress, chainId, offerPrice: offerPrice$1, offerPriceChanged, invalidQuantity, collectibleId, orderbookKind, callbacks } = makeOfferModal$.get();
|
|
7993
|
+
const { collectionAddress, chainId, offerPrice: offerPrice$1, offerPriceChanged, invalidQuantity, collectibleId, orderbookKind: orderbookKindProp, callbacks } = makeOfferModal$.get();
|
|
7994
|
+
const { data: marketplaceConfig } = useMarketplaceConfig();
|
|
7995
|
+
const [error, setError] = useState(void 0);
|
|
7996
|
+
const collectionConfig = marketplaceConfig?.market.collections.find((c) => c.itemsAddress === collectionAddress);
|
|
7997
|
+
const orderbookKind = orderbookKindProp ?? collectionConfig?.destinationMarketplace;
|
|
7005
7998
|
const steps$ = makeOfferModal$.steps;
|
|
7006
7999
|
const [insufficientBalance, setInsufficientBalance] = useState(false);
|
|
8000
|
+
const [openseaLowestPriceCriteriaMet, setOpenseaLowestPriceCriteriaMet] = useState(true);
|
|
7007
8001
|
const { data: collectible, isLoading: collectableIsLoading, isError: collectableIsError } = useCollectible({
|
|
7008
8002
|
chainId,
|
|
7009
8003
|
collectionAddress,
|
|
@@ -7026,7 +8020,7 @@ const Modal$2 = observer(() => {
|
|
|
7026
8020
|
includeNativeCurrency: false
|
|
7027
8021
|
});
|
|
7028
8022
|
const modalLoading = collectableIsLoading || collectionIsLoading || currenciesLoading;
|
|
7029
|
-
const { isLoading, executeApproval, makeOffer } = useMakeOffer({
|
|
8023
|
+
const { isLoading, executeApproval, makeOffer, isError: approvalIsError } = useMakeOffer({
|
|
7030
8024
|
offerInput: {
|
|
7031
8025
|
contractType: collection?.type,
|
|
7032
8026
|
offer: {
|
|
@@ -7039,8 +8033,8 @@ const Modal$2 = observer(() => {
|
|
|
7039
8033
|
},
|
|
7040
8034
|
chainId,
|
|
7041
8035
|
collectionAddress,
|
|
7042
|
-
orderbookKind,
|
|
7043
8036
|
callbacks,
|
|
8037
|
+
orderbookKind,
|
|
7044
8038
|
closeMainModal: () => makeOfferModal$.close(),
|
|
7045
8039
|
steps$
|
|
7046
8040
|
});
|
|
@@ -7051,7 +8045,7 @@ const Modal$2 = observer(() => {
|
|
|
7051
8045
|
collectionAddress,
|
|
7052
8046
|
filter: { currencies: [offerPrice$1.currency.contractAddress] }
|
|
7053
8047
|
});
|
|
7054
|
-
if (collectableIsError || collectionIsError || currenciesIsError) return /* @__PURE__ */ jsx(ErrorModal, {
|
|
8048
|
+
if (collectableIsError || collectionIsError || currenciesIsError || approvalIsError) return /* @__PURE__ */ jsx(ErrorModal, {
|
|
7055
8049
|
isOpen: makeOfferModal$.isOpen.get(),
|
|
7056
8050
|
chainId: Number(chainId),
|
|
7057
8051
|
onClose: makeOfferModal$.close,
|
|
@@ -7069,26 +8063,33 @@ const Modal$2 = observer(() => {
|
|
|
7069
8063
|
try {
|
|
7070
8064
|
if (isWaaS) selectWaasFeeOptionsStore.send({ type: "show" });
|
|
7071
8065
|
await makeOffer({ isTransactionExecuting: isWaaS ? getNetwork(Number(chainId)).type !== NetworkType.TESTNET : false });
|
|
7072
|
-
} catch (error) {
|
|
7073
|
-
console.error("Make offer failed:", error);
|
|
8066
|
+
} catch (error$1) {
|
|
8067
|
+
console.error("Make offer failed:", error$1);
|
|
8068
|
+
setError(error$1);
|
|
7074
8069
|
} finally {
|
|
7075
8070
|
makeOfferModal$.offerIsBeingProcessed.set(false);
|
|
7076
8071
|
steps$.transaction.isExecuting.set(false);
|
|
7077
8072
|
}
|
|
7078
8073
|
};
|
|
8074
|
+
const handleApproveToken = async () => {
|
|
8075
|
+
await executeApproval().catch((error$1) => {
|
|
8076
|
+
console.error("Approve TOKEN failed:", error$1);
|
|
8077
|
+
setError(error$1);
|
|
8078
|
+
});
|
|
8079
|
+
};
|
|
7079
8080
|
const offerCtaLabel = getActionLabel("Make offer");
|
|
7080
8081
|
const ctas = [{
|
|
7081
8082
|
label: "Approve TOKEN",
|
|
7082
|
-
onClick:
|
|
8083
|
+
onClick: handleApproveToken,
|
|
7083
8084
|
hidden: !steps$.approval.exist.get(),
|
|
7084
8085
|
pending: steps$.approval.isExecuting.get(),
|
|
7085
8086
|
variant: "glass",
|
|
7086
|
-
disabled: invalidQuantity || isLoading || insufficientBalance || offerPrice$1.amountRaw === "0" || !offerPriceChanged
|
|
8087
|
+
disabled: invalidQuantity || isLoading || insufficientBalance || offerPrice$1.amountRaw === "0" || !offerPriceChanged || orderbookKind === OrderbookKind.opensea && !openseaLowestPriceCriteriaMet
|
|
7087
8088
|
}, {
|
|
7088
8089
|
label: offerCtaLabel,
|
|
7089
8090
|
onClick: () => handleMakeOffer(),
|
|
7090
8091
|
pending: steps$?.transaction.isExecuting.get() || makeOfferModal$.offerIsBeingProcessed.get(),
|
|
7091
|
-
disabled: steps$.approval.isExecuting.get() || steps$.approval.exist.get() || offerPrice$1.amountRaw === "0" || insufficientBalance || isLoading || invalidQuantity
|
|
8092
|
+
disabled: steps$.approval.isExecuting.get() || steps$.approval.exist.get() || offerPrice$1.amountRaw === "0" || insufficientBalance || isLoading || invalidQuantity || orderbookKind === OrderbookKind.opensea && !openseaLowestPriceCriteriaMet
|
|
7092
8093
|
}];
|
|
7093
8094
|
return /* @__PURE__ */ jsxs(ActionModal, {
|
|
7094
8095
|
isOpen: makeOfferModal$.isOpen.get(),
|
|
@@ -7126,6 +8127,9 @@ const Modal$2 = observer(() => {
|
|
|
7126
8127
|
enabled: true,
|
|
7127
8128
|
callback: (state) => setInsufficientBalance(state)
|
|
7128
8129
|
},
|
|
8130
|
+
setOpenseaLowestPriceCriteriaMet: (state) => setOpenseaLowestPriceCriteriaMet(state),
|
|
8131
|
+
orderbookKind,
|
|
8132
|
+
modalType: "offer",
|
|
7129
8133
|
disabled: shouldHideOfferButton
|
|
7130
8134
|
}),
|
|
7131
8135
|
collection?.type === ContractType.ERC1155 && /* @__PURE__ */ jsx(QuantityInput, {
|
|
@@ -7165,6 +8169,11 @@ const Modal$2 = observer(() => {
|
|
|
7165
8169
|
steps$.transaction.isExecuting.set(false);
|
|
7166
8170
|
},
|
|
7167
8171
|
titleOnConfirm: "Processing offer..."
|
|
8172
|
+
}),
|
|
8173
|
+
error && /* @__PURE__ */ jsx(ErrorLogBox, {
|
|
8174
|
+
title: "An error occurred while making an offer",
|
|
8175
|
+
message: "Please try again",
|
|
8176
|
+
error
|
|
7168
8177
|
})
|
|
7169
8178
|
]
|
|
7170
8179
|
});
|
|
@@ -7207,7 +8216,7 @@ const useGetTokenApprovalData = (params) => {
|
|
|
7207
8216
|
chainId: Number(params.chainId),
|
|
7208
8217
|
collectionAddress: params.collectionAddress
|
|
7209
8218
|
});
|
|
7210
|
-
const { data, isLoading, isSuccess } = useQuery({
|
|
8219
|
+
const { data, isLoading, isSuccess, isError, error } = useQuery({
|
|
7211
8220
|
queryKey: ["token-approval-data", params.ordersData],
|
|
7212
8221
|
queryFn: address ? async () => {
|
|
7213
8222
|
const args = {
|
|
@@ -7231,7 +8240,9 @@ const useGetTokenApprovalData = (params) => {
|
|
|
7231
8240
|
return {
|
|
7232
8241
|
data,
|
|
7233
8242
|
isLoading,
|
|
7234
|
-
isSuccess
|
|
8243
|
+
isSuccess,
|
|
8244
|
+
isError,
|
|
8245
|
+
error
|
|
7235
8246
|
};
|
|
7236
8247
|
};
|
|
7237
8248
|
|
|
@@ -7378,7 +8389,7 @@ const useTransactionSteps = ({ collectibleId, chainId, collectionAddress, market
|
|
|
7378
8389
|
//#endregion
|
|
7379
8390
|
//#region src/react/ui/modals/SellModal/hooks/useSell.tsx
|
|
7380
8391
|
const useSell = ({ collectibleId, chainId, collectionAddress, marketplace, ordersData, callbacks, closeMainModal, steps$ }) => {
|
|
7381
|
-
const { data: tokenApproval, isLoading: tokenApprovalIsLoading } = useGetTokenApprovalData({
|
|
8392
|
+
const { data: tokenApproval, isLoading: tokenApprovalIsLoading, isError, error } = useGetTokenApprovalData({
|
|
7382
8393
|
chainId,
|
|
7383
8394
|
collectionAddress,
|
|
7384
8395
|
ordersData,
|
|
@@ -7402,7 +8413,9 @@ const useSell = ({ collectibleId, chainId, collectionAddress, marketplace, order
|
|
|
7402
8413
|
executeApproval,
|
|
7403
8414
|
sell,
|
|
7404
8415
|
tokenApprovalStepExists: tokenApproval?.step !== null,
|
|
7405
|
-
tokenApprovalIsLoading
|
|
8416
|
+
tokenApprovalIsLoading,
|
|
8417
|
+
isError,
|
|
8418
|
+
error
|
|
7406
8419
|
};
|
|
7407
8420
|
};
|
|
7408
8421
|
|
|
@@ -7421,6 +8434,7 @@ const Modal$1 = observer(() => {
|
|
|
7421
8434
|
chainId,
|
|
7422
8435
|
collectionAddress
|
|
7423
8436
|
});
|
|
8437
|
+
const [error, setError] = useState(void 0);
|
|
7424
8438
|
const { data: collection, isLoading: collectionLoading, isError: collectionError } = useCollection({
|
|
7425
8439
|
chainId,
|
|
7426
8440
|
collectionAddress
|
|
@@ -7438,7 +8452,7 @@ const Modal$1 = observer(() => {
|
|
|
7438
8452
|
feeOptionsVisible,
|
|
7439
8453
|
selectedFeeOption
|
|
7440
8454
|
});
|
|
7441
|
-
const { isLoading, executeApproval, sell } = useSell({
|
|
8455
|
+
const { isLoading, executeApproval, sell, isError } = useSell({
|
|
7442
8456
|
collectionAddress,
|
|
7443
8457
|
chainId,
|
|
7444
8458
|
collectibleId: tokenId,
|
|
@@ -7454,7 +8468,7 @@ const Modal$1 = observer(() => {
|
|
|
7454
8468
|
steps$
|
|
7455
8469
|
});
|
|
7456
8470
|
const modalLoading = collectionLoading || currencyLoading;
|
|
7457
|
-
if ((collectionError || order === void 0 || currencyError) && !modalLoading) return /* @__PURE__ */ jsx(ErrorModal, {
|
|
8471
|
+
if ((collectionError || order === void 0 || currencyError || isError) && !modalLoading) return /* @__PURE__ */ jsx(ErrorModal, {
|
|
7458
8472
|
isOpen: sellModal$.isOpen.get(),
|
|
7459
8473
|
chainId: Number(chainId),
|
|
7460
8474
|
onClose: sellModal$.close,
|
|
@@ -7465,17 +8479,23 @@ const Modal$1 = observer(() => {
|
|
|
7465
8479
|
try {
|
|
7466
8480
|
if (isWaaS) selectWaasFeeOptionsStore.send({ type: "show" });
|
|
7467
8481
|
await sell({ isTransactionExecuting: isWaaS ? !isTestnet : false });
|
|
7468
|
-
} catch (error) {
|
|
7469
|
-
console.error("Sell failed:", error);
|
|
8482
|
+
} catch (error$1) {
|
|
8483
|
+
console.error("Sell failed:", error$1);
|
|
7470
8484
|
} finally {
|
|
7471
8485
|
sellModal$.sellIsBeingProcessed.set(false);
|
|
7472
8486
|
steps$.transaction.isExecuting.set(false);
|
|
7473
8487
|
}
|
|
7474
8488
|
};
|
|
8489
|
+
const handleApproveToken = async () => {
|
|
8490
|
+
await executeApproval().catch((error$1) => {
|
|
8491
|
+
console.error("Approve TOKEN failed:", error$1);
|
|
8492
|
+
setError(error$1);
|
|
8493
|
+
});
|
|
8494
|
+
};
|
|
7475
8495
|
const sellCtaLabel = isProcessing ? isWaaS && !isTestnet ? "Loading fee options" : "Accept" : "Accept";
|
|
7476
8496
|
const ctas = [{
|
|
7477
8497
|
label: "Approve TOKEN",
|
|
7478
|
-
onClick:
|
|
8498
|
+
onClick: handleApproveToken,
|
|
7479
8499
|
hidden: !steps$.approval.exist.get(),
|
|
7480
8500
|
pending: steps$.approval.isExecuting.get(),
|
|
7481
8501
|
variant: "glass",
|
|
@@ -7530,6 +8550,11 @@ const Modal$1 = observer(() => {
|
|
|
7530
8550
|
steps$.transaction.isExecuting.set(false);
|
|
7531
8551
|
},
|
|
7532
8552
|
titleOnConfirm: "Accepting offer..."
|
|
8553
|
+
}),
|
|
8554
|
+
error && /* @__PURE__ */ jsx(ErrorLogBox, {
|
|
8555
|
+
title: "An error occurred while selling",
|
|
8556
|
+
message: error.message,
|
|
8557
|
+
error
|
|
7533
8558
|
})
|
|
7534
8559
|
]
|
|
7535
8560
|
});
|
|
@@ -8158,7 +9183,12 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
8158
9183
|
:root, :host {
|
|
8159
9184
|
--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
|
8160
9185
|
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
9186
|
+
--color-red-100: oklch(93.6% 0.032 17.717);
|
|
9187
|
+
--color-red-300: oklch(80.8% 0.114 19.571);
|
|
9188
|
+
--color-red-400: oklch(70.4% 0.191 22.216);
|
|
8161
9189
|
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
9190
|
+
--color-red-900: oklch(39.6% 0.141 25.723);
|
|
9191
|
+
--color-red-950: oklch(25.8% 0.092 26.042);
|
|
8162
9192
|
--color-green-500: oklch(72.3% 0.219 149.579);
|
|
8163
9193
|
--color-blue-500: oklch(62.3% 0.214 259.815);
|
|
8164
9194
|
--color-indigo-400: oklch(67.3% 0.182 276.935);
|
|
@@ -8576,6 +9606,9 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
8576
9606
|
.ml-5 {
|
|
8577
9607
|
margin-left: calc(var(--spacing) * 5);
|
|
8578
9608
|
}
|
|
9609
|
+
.ml-10 {
|
|
9610
|
+
margin-left: calc(var(--spacing) * 10);
|
|
9611
|
+
}
|
|
8579
9612
|
.block {
|
|
8580
9613
|
display: block;
|
|
8581
9614
|
}
|
|
@@ -8699,6 +9732,9 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
8699
9732
|
.h-px {
|
|
8700
9733
|
height: 1px;
|
|
8701
9734
|
}
|
|
9735
|
+
.max-h-96 {
|
|
9736
|
+
max-height: calc(var(--spacing) * 96);
|
|
9737
|
+
}
|
|
8702
9738
|
.max-h-\[240px\] {
|
|
8703
9739
|
max-height: 240px;
|
|
8704
9740
|
}
|
|
@@ -8855,6 +9891,9 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
8855
9891
|
.flex-shrink {
|
|
8856
9892
|
flex-shrink: 1;
|
|
8857
9893
|
}
|
|
9894
|
+
.flex-shrink-0 {
|
|
9895
|
+
flex-shrink: 0;
|
|
9896
|
+
}
|
|
8858
9897
|
.shrink-0 {
|
|
8859
9898
|
flex-shrink: 0;
|
|
8860
9899
|
}
|
|
@@ -9111,6 +10150,10 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
9111
10150
|
border-style: var(--tw-border-style);
|
|
9112
10151
|
border-width: 2px;
|
|
9113
10152
|
}
|
|
10153
|
+
.border-t {
|
|
10154
|
+
border-top-style: var(--tw-border-style);
|
|
10155
|
+
border-top-width: 1px;
|
|
10156
|
+
}
|
|
9114
10157
|
.border-b-2 {
|
|
9115
10158
|
border-bottom-style: var(--tw-border-style);
|
|
9116
10159
|
border-bottom-width: 2px;
|
|
@@ -9142,6 +10185,9 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
9142
10185
|
.border-border-normal {
|
|
9143
10186
|
border-color: var(--seq-color-border-normal);
|
|
9144
10187
|
}
|
|
10188
|
+
.border-red-900 {
|
|
10189
|
+
border-color: var(--color-red-900);
|
|
10190
|
+
}
|
|
9145
10191
|
.border-transparent {
|
|
9146
10192
|
border-color: transparent;
|
|
9147
10193
|
}
|
|
@@ -9154,6 +10200,9 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
9154
10200
|
.border-b-transparent {
|
|
9155
10201
|
border-bottom-color: transparent;
|
|
9156
10202
|
}
|
|
10203
|
+
.bg-\[\#2b0000\] {
|
|
10204
|
+
background-color: #2b0000;
|
|
10205
|
+
}
|
|
9157
10206
|
.bg-\[\#35a554\] {
|
|
9158
10207
|
background-color: #35a554;
|
|
9159
10208
|
}
|
|
@@ -9226,6 +10275,12 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
9226
10275
|
.bg-red-500 {
|
|
9227
10276
|
background-color: var(--color-red-500);
|
|
9228
10277
|
}
|
|
10278
|
+
.bg-red-900 {
|
|
10279
|
+
background-color: var(--color-red-900);
|
|
10280
|
+
}
|
|
10281
|
+
.bg-red-950 {
|
|
10282
|
+
background-color: var(--color-red-950);
|
|
10283
|
+
}
|
|
9229
10284
|
.bg-surface-neutral {
|
|
9230
10285
|
background-color: var(--color-surface-neutral);
|
|
9231
10286
|
}
|
|
@@ -9535,12 +10590,18 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
9535
10590
|
--tw-tracking: var(--tracking-widest);
|
|
9536
10591
|
letter-spacing: var(--tracking-widest);
|
|
9537
10592
|
}
|
|
10593
|
+
.break-words {
|
|
10594
|
+
overflow-wrap: break-word;
|
|
10595
|
+
}
|
|
9538
10596
|
.text-ellipsis {
|
|
9539
10597
|
text-overflow: ellipsis;
|
|
9540
10598
|
}
|
|
9541
10599
|
.whitespace-nowrap {
|
|
9542
10600
|
white-space: nowrap;
|
|
9543
10601
|
}
|
|
10602
|
+
.whitespace-pre-wrap {
|
|
10603
|
+
white-space: pre-wrap;
|
|
10604
|
+
}
|
|
9544
10605
|
.text-background-raised {
|
|
9545
10606
|
color: var(--seq-color-background-raised);
|
|
9546
10607
|
}
|
|
@@ -9577,6 +10638,15 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
9577
10638
|
.text-primary {
|
|
9578
10639
|
color: var(--seq-color-primary);
|
|
9579
10640
|
}
|
|
10641
|
+
.text-red-100 {
|
|
10642
|
+
color: var(--color-red-100);
|
|
10643
|
+
}
|
|
10644
|
+
.text-red-300 {
|
|
10645
|
+
color: var(--color-red-300);
|
|
10646
|
+
}
|
|
10647
|
+
.text-red-400 {
|
|
10648
|
+
color: var(--color-red-400);
|
|
10649
|
+
}
|
|
9580
10650
|
.text-red-500 {
|
|
9581
10651
|
color: var(--color-red-500);
|
|
9582
10652
|
}
|
|
@@ -10149,6 +11219,13 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
10149
11219
|
}
|
|
10150
11220
|
}
|
|
10151
11221
|
}
|
|
11222
|
+
.hover\:text-red-300 {
|
|
11223
|
+
&:hover {
|
|
11224
|
+
@media (hover: hover) {
|
|
11225
|
+
color: var(--color-red-300);
|
|
11226
|
+
}
|
|
11227
|
+
}
|
|
11228
|
+
}
|
|
10152
11229
|
.hover\:text-text-80 {
|
|
10153
11230
|
&:hover {
|
|
10154
11231
|
@media (hover: hover) {
|
|
@@ -10540,6 +11617,11 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
10540
11617
|
display: flex;
|
|
10541
11618
|
}
|
|
10542
11619
|
}
|
|
11620
|
+
.\[\&\>label\]\:w-16 {
|
|
11621
|
+
&>label {
|
|
11622
|
+
width: calc(var(--spacing) * 16);
|
|
11623
|
+
}
|
|
11624
|
+
}
|
|
10543
11625
|
.\[\&\>label\]\:w-full {
|
|
10544
11626
|
&>label {
|
|
10545
11627
|
width: 100%;
|
|
@@ -11128,6 +12210,103 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
11128
12210
|
.rdp-caption_before_exit {
|
|
11129
12211
|
animation: rdp-fade_out var(--rdp-animation_duration) var(--rdp-animation_timing) forwards;
|
|
11130
12212
|
}
|
|
12213
|
+
.rdp-root {
|
|
12214
|
+
width: 100% !important;
|
|
12215
|
+
padding: 0 !important;
|
|
12216
|
+
user-select: none;
|
|
12217
|
+
}
|
|
12218
|
+
.rdp-nav {
|
|
12219
|
+
position: absolute;
|
|
12220
|
+
width: 100%;
|
|
12221
|
+
height: fit-content !important;
|
|
12222
|
+
display: flex;
|
|
12223
|
+
align-items: center;
|
|
12224
|
+
justify-content: space-between;
|
|
12225
|
+
}
|
|
12226
|
+
.rdp-caption_label {
|
|
12227
|
+
color: var(--color-text-100) !important;
|
|
12228
|
+
}
|
|
12229
|
+
.rdp-months {
|
|
12230
|
+
width: 100%;
|
|
12231
|
+
max-width: unset !important;
|
|
12232
|
+
}
|
|
12233
|
+
.rdp-month_caption {
|
|
12234
|
+
text-align: center;
|
|
12235
|
+
width: 100%;
|
|
12236
|
+
height: 36px !important;
|
|
12237
|
+
display: block !important;
|
|
12238
|
+
font-size: 14px !important;
|
|
12239
|
+
}
|
|
12240
|
+
.rdp-month_grid {
|
|
12241
|
+
width: 100%;
|
|
12242
|
+
}
|
|
12243
|
+
.rdp-month {
|
|
12244
|
+
width: 100%;
|
|
12245
|
+
}
|
|
12246
|
+
.rdp-button_previous {
|
|
12247
|
+
background-color: var(--color-overlay-light) !important;
|
|
12248
|
+
border-radius: 50%;
|
|
12249
|
+
}
|
|
12250
|
+
.rdp-button_previous:hover {
|
|
12251
|
+
background-color: var(--color-overlay-glass) !important;
|
|
12252
|
+
}
|
|
12253
|
+
.rdp-button_previous > svg {
|
|
12254
|
+
fill: var(--color-text-100) !important;
|
|
12255
|
+
width: 16px !important;
|
|
12256
|
+
height: 16px !important;
|
|
12257
|
+
}
|
|
12258
|
+
.rdp-button_next {
|
|
12259
|
+
background-color: var(--color-overlay-light) !important;
|
|
12260
|
+
border-radius: 50%;
|
|
12261
|
+
}
|
|
12262
|
+
.rdp-button_next:hover {
|
|
12263
|
+
background-color: var(--color-overlay-glass) !important;
|
|
12264
|
+
}
|
|
12265
|
+
.rdp-button_next > svg {
|
|
12266
|
+
fill: var(--color-text-100) !important;
|
|
12267
|
+
width: 16px !important;
|
|
12268
|
+
height: 16px !important;
|
|
12269
|
+
}
|
|
12270
|
+
.rdp-weekdays {
|
|
12271
|
+
display: flex;
|
|
12272
|
+
justify-content: space-between;
|
|
12273
|
+
}
|
|
12274
|
+
.rdp-weekday {
|
|
12275
|
+
padding: 16px 0 !important;
|
|
12276
|
+
font-size: 14px !important;
|
|
12277
|
+
font-weight: var(--font-weight-medium) !important;
|
|
12278
|
+
color: var(--color-text-80) !important;
|
|
12279
|
+
}
|
|
12280
|
+
.rdp-weeks {
|
|
12281
|
+
display: flex;
|
|
12282
|
+
flex-direction: column;
|
|
12283
|
+
gap: 4px;
|
|
12284
|
+
}
|
|
12285
|
+
.rdp-week {
|
|
12286
|
+
display: flex;
|
|
12287
|
+
justify-content: space-between;
|
|
12288
|
+
}
|
|
12289
|
+
.rdp-day {
|
|
12290
|
+
width: 24px !important;
|
|
12291
|
+
height: 24px !important;
|
|
12292
|
+
}
|
|
12293
|
+
.rdp-day_button {
|
|
12294
|
+
width: 24px !important;
|
|
12295
|
+
height: 24px !important;
|
|
12296
|
+
font-size: var(--text-xs) !important;
|
|
12297
|
+
color: var(--color-text-80) !important;
|
|
12298
|
+
}
|
|
12299
|
+
.rdp-day_button:disabled {
|
|
12300
|
+
color: var(--color-text-50) !important;
|
|
12301
|
+
}
|
|
12302
|
+
.rdp-day.rdp-today {
|
|
12303
|
+
outline: 1px solid var(--color-violet-700) !important;
|
|
12304
|
+
border-radius: 50% !important;
|
|
12305
|
+
}
|
|
12306
|
+
.rdp-day.rdp-selected {
|
|
12307
|
+
background: var(--seq-color-gradient-primary) !important;
|
|
12308
|
+
border-radius: 50% !important;
|
|
12309
|
+
}
|
|
11131
12310
|
@keyframes fadeIn {
|
|
11132
12311
|
0% {
|
|
11133
12312
|
opacity: 0;
|
|
@@ -11463,21 +12642,27 @@ const ShadowRoot = (props) => {
|
|
|
11463
12642
|
//#endregion
|
|
11464
12643
|
//#region src/react/providers/modal-provider.tsx
|
|
11465
12644
|
const ModalProvider = observer(({ children }) => {
|
|
11466
|
-
const
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11480
|
-
|
|
12645
|
+
const sdkConfig = useConfig();
|
|
12646
|
+
const { shadowDom, experimentalShadowDomCssOverride } = sdkConfig;
|
|
12647
|
+
const overrides = sdkConfig._internal?.overrides?.api?.marketplace;
|
|
12648
|
+
const marketplaceApiUrl = overrides?.url || marketplaceApiURL(overrides?.env || "production");
|
|
12649
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx(SequenceCheckoutProvider, {
|
|
12650
|
+
config: { env: { marketplaceApiUrl } },
|
|
12651
|
+
children: /* @__PURE__ */ jsxs(ShadowRoot, {
|
|
12652
|
+
enabled: shadowDom ?? true,
|
|
12653
|
+
customCSS: experimentalShadowDomCssOverride,
|
|
12654
|
+
children: [
|
|
12655
|
+
/* @__PURE__ */ jsx(CreateListingModal, {}),
|
|
12656
|
+
/* @__PURE__ */ jsx(MakeOfferModal, {}),
|
|
12657
|
+
/* @__PURE__ */ jsx(TransferModal, {}),
|
|
12658
|
+
/* @__PURE__ */ jsx(SellModal, {}),
|
|
12659
|
+
/* @__PURE__ */ jsx(BuyModal, {}),
|
|
12660
|
+
/* @__PURE__ */ jsx(SuccessfulPurchaseModal_default, {}),
|
|
12661
|
+
/* @__PURE__ */ jsx(switchChainErrorModal_default, {}),
|
|
12662
|
+
/* @__PURE__ */ jsx(transactionStatusModal_default, {})
|
|
12663
|
+
]
|
|
12664
|
+
})
|
|
12665
|
+
})] });
|
|
11481
12666
|
});
|
|
11482
12667
|
|
|
11483
12668
|
//#endregion
|
|
@@ -11563,7 +12748,7 @@ function ActionButtonBody({ tokenId, label, onClick, icon, action }) {
|
|
|
11563
12748
|
//#endregion
|
|
11564
12749
|
//#region src/react/ui/components/_internals/action-button/components/NonOwnerActions.tsx
|
|
11565
12750
|
function NonOwnerActions(props) {
|
|
11566
|
-
const { action, tokenId, collectionAddress, chainId, quantityDecimals, quantityRemaining, unlimitedSupply, cardType } = props;
|
|
12751
|
+
const { action, tokenId, collectionAddress, chainId, quantityDecimals, quantityRemaining, unlimitedSupply, cardType, hideQuantitySelector } = props;
|
|
11567
12752
|
const { show: showBuyModal } = useBuyModal();
|
|
11568
12753
|
const { show: showMakeOfferModal } = useMakeOfferModal();
|
|
11569
12754
|
if (cardType === "shop") {
|
|
@@ -11587,7 +12772,8 @@ function NonOwnerActions(props) {
|
|
|
11587
12772
|
},
|
|
11588
12773
|
quantityDecimals: quantityDecimals ?? 0,
|
|
11589
12774
|
quantityRemaining: quantityRemaining ?? 0,
|
|
11590
|
-
unlimitedSupply
|
|
12775
|
+
unlimitedSupply,
|
|
12776
|
+
hideQuantitySelector
|
|
11591
12777
|
}),
|
|
11592
12778
|
icon: CartIcon_default
|
|
11593
12779
|
});
|
|
@@ -11605,7 +12791,8 @@ function NonOwnerActions(props) {
|
|
|
11605
12791
|
collectibleId: tokenId,
|
|
11606
12792
|
orderId: lowestListing.orderId,
|
|
11607
12793
|
marketplace: lowestListing.marketplace,
|
|
11608
|
-
cardType: "market"
|
|
12794
|
+
cardType: "market",
|
|
12795
|
+
hideQuantitySelector
|
|
11609
12796
|
}),
|
|
11610
12797
|
icon: CartIcon_default
|
|
11611
12798
|
});
|
|
@@ -11727,7 +12914,7 @@ const useActionButtonLogic = ({ tokenId, owned, action, onCannotPerformAction })
|
|
|
11727
12914
|
|
|
11728
12915
|
//#endregion
|
|
11729
12916
|
//#region src/react/ui/components/_internals/action-button/ActionButton.tsx
|
|
11730
|
-
function ActionButton({ collectionAddress, chainId, tokenId, orderbookKind, action, owned, highestOffer, lowestListing, onCannotPerformAction, cardType, salesContractAddress, prioritizeOwnerActions, salePrice, quantityDecimals, quantityRemaining, unlimitedSupply }) {
|
|
12917
|
+
function ActionButton({ collectionAddress, chainId, tokenId, orderbookKind, action, owned, highestOffer, lowestListing, onCannotPerformAction, cardType, salesContractAddress, prioritizeOwnerActions, salePrice, quantityDecimals, quantityRemaining, unlimitedSupply, hideQuantitySelector }) {
|
|
11731
12918
|
const { shouldShowAction, isOwnerAction } = useActionButtonLogic({
|
|
11732
12919
|
tokenId,
|
|
11733
12920
|
owned,
|
|
@@ -11753,7 +12940,8 @@ function ActionButton({ collectionAddress, chainId, tokenId, orderbookKind, acti
|
|
|
11753
12940
|
chainId,
|
|
11754
12941
|
quantityDecimals,
|
|
11755
12942
|
quantityRemaining,
|
|
11756
|
-
unlimitedSupply
|
|
12943
|
+
unlimitedSupply,
|
|
12944
|
+
hideQuantitySelector
|
|
11757
12945
|
} : {
|
|
11758
12946
|
cardType: "market",
|
|
11759
12947
|
orderbookKind,
|
|
@@ -11763,13 +12951,14 @@ function ActionButton({ collectionAddress, chainId, tokenId, orderbookKind, acti
|
|
|
11763
12951
|
collectionAddress,
|
|
11764
12952
|
chainId,
|
|
11765
12953
|
quantityDecimals,
|
|
11766
|
-
quantityRemaining
|
|
12954
|
+
quantityRemaining,
|
|
12955
|
+
hideQuantitySelector
|
|
11767
12956
|
} });
|
|
11768
12957
|
}
|
|
11769
12958
|
|
|
11770
12959
|
//#endregion
|
|
11771
12960
|
//#region src/react/ui/components/marketplace-collectible-card/components/ActionButtonWrapper.tsx
|
|
11772
|
-
function ActionButtonWrapper({ show, chainId, collectionAddress, tokenId, orderbookKind, action, highestOffer, lowestListing, owned, onCannotPerformAction, cardType, salesContractAddress, prioritizeOwnerActions, salePrice, quantityDecimals, quantityRemaining, unlimitedSupply }) {
|
|
12961
|
+
function ActionButtonWrapper({ show, chainId, collectionAddress, tokenId, orderbookKind, action, highestOffer, lowestListing, owned, onCannotPerformAction, cardType, salesContractAddress, prioritizeOwnerActions, salePrice, quantityDecimals, quantityRemaining, unlimitedSupply, hideQuantitySelector }) {
|
|
11773
12962
|
if (!show) return null;
|
|
11774
12963
|
return /* @__PURE__ */ jsx("div", {
|
|
11775
12964
|
className: "-bottom-16 absolute flex w-full origin-bottom items-center justify-center bg-overlay-light p-2 backdrop-blur transition-transform duration-200 ease-in-out group-hover:translate-y-[-64px]",
|
|
@@ -11789,7 +12978,8 @@ function ActionButtonWrapper({ show, chainId, collectionAddress, tokenId, orderb
|
|
|
11789
12978
|
salePrice,
|
|
11790
12979
|
quantityDecimals,
|
|
11791
12980
|
quantityRemaining,
|
|
11792
|
-
unlimitedSupply
|
|
12981
|
+
unlimitedSupply,
|
|
12982
|
+
hideQuantitySelector
|
|
11793
12983
|
})
|
|
11794
12984
|
});
|
|
11795
12985
|
}
|
|
@@ -12246,7 +13436,7 @@ const NonTradableInventoryFooter = ({ name, balance, decimals, type }) => {
|
|
|
12246
13436
|
|
|
12247
13437
|
//#endregion
|
|
12248
13438
|
//#region src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx
|
|
12249
|
-
function MarketCard({ collectibleId, chainId, collectionAddress, collectionType, assetSrcPrefixUrl, cardLoading, orderbookKind, collectible, onCollectibleClick, onOfferClick, balance, balanceIsLoading = false, onCannotPerformAction, prioritizeOwnerActions }) {
|
|
13439
|
+
function MarketCard({ collectibleId, chainId, collectionAddress, collectionType, assetSrcPrefixUrl, cardLoading, orderbookKind, collectible, onCollectibleClick, onOfferClick, balance, balanceIsLoading = false, onCannotPerformAction, prioritizeOwnerActions, hideQuantitySelector }) {
|
|
12250
13440
|
const collectibleMetadata = collectible?.metadata;
|
|
12251
13441
|
const highestOffer = collectible?.offer;
|
|
12252
13442
|
if (!collectibleMetadata) {
|
|
@@ -12274,6 +13464,7 @@ function MarketCard({ collectibleId, chainId, collectionAddress, collectionType,
|
|
|
12274
13464
|
isShop: false,
|
|
12275
13465
|
onClick: () => onCollectibleClick?.(collectibleId),
|
|
12276
13466
|
onKeyDown: handleKeyDown,
|
|
13467
|
+
hideQuantitySelector,
|
|
12277
13468
|
children: [/* @__PURE__ */ jsx(Footer, {
|
|
12278
13469
|
chainId,
|
|
12279
13470
|
collectionAddress,
|
|
@@ -12302,7 +13493,8 @@ function MarketCard({ collectibleId, chainId, collectionAddress, collectionType,
|
|
|
12302
13493
|
owned: !!balance,
|
|
12303
13494
|
onCannotPerformAction,
|
|
12304
13495
|
cardType: "market",
|
|
12305
|
-
prioritizeOwnerActions
|
|
13496
|
+
prioritizeOwnerActions,
|
|
13497
|
+
hideQuantitySelector
|
|
12306
13498
|
})]
|
|
12307
13499
|
});
|
|
12308
13500
|
}
|
|
@@ -12334,7 +13526,7 @@ function NonTradableInventoryCard({ collectibleId, chainId, collectionAddress, c
|
|
|
12334
13526
|
|
|
12335
13527
|
//#endregion
|
|
12336
13528
|
//#region src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx
|
|
12337
|
-
function ShopCard({ collectibleId, chainId, collectionAddress, collectionType, assetSrcPrefixUrl, cardLoading, cardType, salesContractAddress, tokenMetadata, salePrice, quantityDecimals, quantityInitial, quantityRemaining, unlimitedSupply }) {
|
|
13529
|
+
function ShopCard({ collectibleId, chainId, collectionAddress, collectionType, assetSrcPrefixUrl, cardLoading, cardType, salesContractAddress, tokenMetadata, salePrice, quantityDecimals, quantityInitial, quantityRemaining, unlimitedSupply, hideQuantitySelector }) {
|
|
12338
13530
|
const { data: saleCurrency, isLoading: saleCurrencyLoading } = useCurrency({
|
|
12339
13531
|
chainId,
|
|
12340
13532
|
currencyAddress: salePrice?.currencyAddress,
|
|
@@ -12365,6 +13557,7 @@ function ShopCard({ collectibleId, chainId, collectionAddress, collectionType, a
|
|
|
12365
13557
|
mediaClassName,
|
|
12366
13558
|
contractType: collectionType,
|
|
12367
13559
|
isShop: true,
|
|
13560
|
+
hideQuantitySelector,
|
|
12368
13561
|
children: [/* @__PURE__ */ jsx(Footer, {
|
|
12369
13562
|
chainId,
|
|
12370
13563
|
collectionAddress,
|
|
@@ -12406,5 +13599,5 @@ function CollectibleCard(props) {
|
|
|
12406
13599
|
}
|
|
12407
13600
|
|
|
12408
13601
|
//#endregion
|
|
12409
|
-
export { ActionModal, CollectibleCard, DatabeatAnalytics, Footer, MarketplaceProvider, MarketplaceQueryClientProvider, MarketplaceSdkContext, Media, ModalProvider, NonTradableInventoryFooter, collectionDetailsPollingOptions, generateCancelTransaction, generateListingTransaction, generateOfferTransaction, generateSellTransaction, useAnalytics, useAutoSelectFeeOption, useBalanceOfCollectible, useBuyModal, useCancelOrder, useCancelTransactionSteps, useCheckoutOptions$1 as useCheckoutOptions, useCheckoutOptionsSalesContract, useCollectible, useCollection, useCollectionBalanceDetails, useCollectionDetails, useCollectionDetailsPolling, useComparePrices, useConfig, useConnectorMetadata, useConvertPriceToUSD, useCountListingsForCollectible, useCountOfCollectables, useCountOfPrimarySaleItems, useCountOffersForCollectible, useCreateListingModal, useCurrency, useEnsureCorrectChain, useErc721SaleDetails, useFilterState, useFilters, useFiltersProgressive, useFloorOrder, useGenerateCancelTransaction, useGenerateListingTransaction, useGenerateOfferTransaction, useGenerateSellTransaction, useGetCountOfPrimarySaleItems, useGetReceiptFromHash, useGetTokenRanges, useHighestOffer, useInventory, useList1155ShopCardData, useList721ShopCardData, useListBalances, useListCollectibleActivities, useListCollectibles, useListCollectiblesPaginated, useListCollectionActivities, useListCollections, useListListingsForCollectible, useListMarketCardData, useListOffersForCollectible, useListPrimarySaleItems, useListTokenMetadata, useLowestListing, useMakeOfferModal, useMarketCurrencies, useMarketplaceConfig, useOpenConnectModal$1 as useOpenConnectModal, useOrderSteps, useProcessStep, useRoyalty, useSearchTokenMetadata, useSellModal, useSuccessfulPurchaseModal, useTokenSupplies, useTransferModal, useTransferTokens };
|
|
12410
|
-
//# sourceMappingURL=react-
|
|
13602
|
+
export { ActionModal, CollectibleCard, DatabeatAnalytics, Footer, MarketplaceProvider, MarketplaceQueryClientProvider, MarketplaceSdkContext, Media, ModalProvider, NonTradableInventoryFooter, collectionDetailsPollingOptions, generateCancelTransaction, generateListingTransaction, generateOfferTransaction, generateSellTransaction, useAnalytics, useAutoSelectFeeOption, useBalanceOfCollectible, useBuyModal, useCancelOrder, useCancelTransactionSteps, useCheckoutOptions$1 as useCheckoutOptions, useCheckoutOptionsSalesContract, useCollectible, useCollection, useCollectionBalanceDetails, useCollectionDetails, useCollectionDetailsPolling, useComparePrices, useConfig, useConnectorMetadata, useConvertPriceToUSD, useCountItemsOrdersForCollection, useCountListingsForCollectible, useCountOfCollectables, useCountOfPrimarySaleItems, useCountOffersForCollectible, useCreateListingModal, useCurrency, useEnsureCorrectChain, useErc721SaleDetails, useFilterState, useFilters, useFiltersProgressive, useFloorOrder, useGenerateCancelTransaction, useGenerateListingTransaction, useGenerateOfferTransaction, useGenerateSellTransaction, useGetCountOfFilteredOrders, useGetCountOfPrimarySaleItems, useGetReceiptFromHash, useGetTokenRanges, useHighestOffer, useInventory, useList1155ShopCardData, useList721ShopCardData, useListBalances, useListCollectibleActivities, useListCollectibles, useListCollectiblesPaginated, useListCollectionActivities, useListCollections, useListItemsOrdersForCollection, useListItemsOrdersForCollectionPaginated, useListListingsForCollectible, useListMarketCardData, useListOffersForCollectible, useListPrimarySaleItems, useListTokenMetadata, useLowestListing, useMakeOfferModal, useMarketCurrencies, useMarketplaceConfig, useOpenConnectModal$1 as useOpenConnectModal, useOrderSteps, useProcessStep, useRoyalty, useSearchTokenMetadata, useSellModal, useSuccessfulPurchaseModal, useTokenSupplies, useTransferModal, useTransferTokens };
|
|
13603
|
+
//# sourceMappingURL=react-DE852KeT.js.map
|