@0xsequence/marketplace-sdk 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -3
- package/dist/{BellIcon-ByhygxBO.js → BellIcon-DMKEumAz.js} +2 -2
- package/dist/BellIcon-DMKEumAz.js.map +1 -0
- package/dist/{CartIcon-Bt3rQYGk.js → CartIcon-UyB4NYKt.js} +3 -3
- package/dist/CartIcon-UyB4NYKt.js.map +1 -0
- package/dist/CollectibleCard-z05qWzKE.d.ts +8 -0
- package/dist/_internal-DkS2VUn5.js.map +1 -1
- package/dist/abi-fa-o9gH3.js.map +1 -1
- package/dist/{alien_swap-DoY6XfMA.js → alien_swap-Cq8LuElo.js} +1 -1
- package/dist/{alien_swap-DoY6XfMA.js.map → alien_swap-Cq8LuElo.js.map} +1 -1
- package/dist/{api-BoO0V5aJ.js → api-GwTR0dBA.js} +8 -49
- package/dist/api-GwTR0dBA.js.map +1 -0
- package/dist/{aqua-xyz-BBDxnG14.js → aqua-xyz-0yye_c-Z.js} +1 -1
- package/dist/{aqua-xyz-BBDxnG14.js.map → aqua-xyz-0yye_c-Z.js.map} +1 -1
- package/dist/{aura-DGx2zwvF.js → aura-TaxFvTFQ.js} +1 -1
- package/dist/{aura-DGx2zwvF.js.map → aura-TaxFvTFQ.js.map} +1 -1
- package/dist/{blur-D8GKrRrq.js → blur-BupOTobO.js} +1 -1
- package/dist/{blur-D8GKrRrq.js.map → blur-BupOTobO.js.map} +1 -1
- package/dist/{builder-api-BFuZNOaN.js → builder-api-m4JAA6ee.js} +3 -3
- package/dist/builder-api-m4JAA6ee.js.map +1 -0
- package/dist/{builder.gen-B9wR2nvF.js → builder.gen--XD71cNL.js} +2 -2
- package/dist/builder.gen--XD71cNL.js.map +1 -0
- package/dist/{coinbase-DOry4PXY.js → coinbase-DTgZ4wDT.js} +1 -1
- package/dist/{coinbase-DOry4PXY.js.map → coinbase-DTgZ4wDT.js.map} +1 -1
- package/dist/{collectibles-C_H8jMGH.js → collectibles-CZ6i8sXK.js} +15 -49
- package/dist/collectibles-CZ6i8sXK.js.map +1 -0
- package/dist/{collections-CKummc-R.js → collections-5NcU-7ZR.js} +92 -10
- package/dist/collections-5NcU-7ZR.js.map +1 -0
- package/dist/{components-CosnX7F9.js → components-CY8kx2kb.js} +13 -9
- package/dist/components-CY8kx2kb.js.map +1 -0
- package/dist/{contracts-BP_0vX48.js → contracts-DRJHF89h.js} +4 -3
- package/dist/{contracts-BP_0vX48.js.map → contracts-DRJHF89h.js.map} +1 -1
- package/dist/{create-config-CIfejoCk.js → create-config-BxyfYCEk.js} +6 -5
- package/dist/create-config-BxyfYCEk.js.map +1 -0
- package/dist/{create-config-ZOB7i4ZJ.d.ts → create-config-CFBeD8CB.d.ts} +47 -60
- package/dist/{element-ciybd_VF.js → element-D4dDznlu.js} +1 -1
- package/dist/{element-ciybd_VF.js.map → element-D4dDznlu.js.map} +1 -1
- package/dist/{filters-V-V8Dn8f.d.ts → filters-B5niI_fX.d.ts} +7 -7
- package/dist/{foundation-Bq4lRz4x.js → foundation-GHZOKAzN.js} +1 -1
- package/dist/{foundation-Bq4lRz4x.js.map → foundation-GHZOKAzN.js.map} +1 -1
- package/dist/{index-BeRV-7AX.d.ts → index-8scPf0CS.d.ts} +2 -2
- package/dist/index-9qsplZ8r.d.ts +18 -0
- package/dist/{index-BZIJTQT0.d.ts → index-BIuYTMc2.d.ts} +10 -9
- package/dist/{index-C4MUKshG.d.ts → index-BNrz99xy.d.ts} +3 -3
- package/dist/{index-Bsx6XsC2.d.ts → index-BYQOPS8e.d.ts} +116 -62
- package/dist/{index-DUXfvhxs.d.ts → index-BkZ7SPLc.d.ts} +19 -29
- package/dist/{index-NlPMNcqh.d.ts → index-BnUku_aF.d.ts} +109 -114
- package/dist/{index-Stm5u0I0.d.ts → index-BtDAHMW_.d.ts} +9 -12
- package/dist/{index-BOiHR01C.d.ts → index-C-c_M_sE.d.ts} +10 -9
- package/dist/{index-DWt6yrIG.d.ts → index-CNIiC8Z_.d.ts} +11 -8
- package/dist/{index-DmudgrsN.d.ts → index-CbERNN3s.d.ts} +26 -16
- package/dist/{index-CxpFwGvR.d.ts → index-CsfxsN0t.d.ts} +4 -4
- package/dist/{index-CxA34wP1.d.ts → index-DASjaiJL.d.ts} +105 -19
- package/dist/{index-Bxzjy0d1.d.ts → index-DD7Vc4cE.d.ts} +2 -2
- package/dist/{index-DqXd1EeB.d.ts → index-DIc8OqWV.d.ts} +7 -6
- package/dist/{index-CnEbXm_t.d.ts → index-DVI_vggD.d.ts} +53 -12
- package/dist/{index-CPzvNmq9.d.ts → index-DqxQeYT2.d.ts} +39 -36
- package/dist/{index-CS65jqOq.d.ts → index-Dsf9FRtr.d.ts} +19 -3
- package/dist/{index-DFEnA6Wa.d.ts → index-DxAReMEO.d.ts} +34 -34
- package/dist/{index-U-zp70of.d.ts → index-UXRoZmd_.d.ts} +8 -12
- package/dist/{index-DwKr18CI.d.ts → index-isFvc5gd.d.ts} +2 -2
- package/dist/{index-BtWMBHeP.d.ts → index-j3nuJWyJ.d.ts} +13 -9
- package/dist/{index-C-745li7.d.ts → index-nVb7o0hc.d.ts} +2 -2
- package/dist/{index-D9LPlmbC.d.ts → index-pbE88Tt7.d.ts} +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -9
- package/dist/{inventory-Dd7TazvZ.js → inventory--t6Zu55O.js} +21 -18
- package/dist/inventory--t6Zu55O.js.map +1 -0
- package/dist/{listCollectiblesPaginated-Cy2_qEZA.d.ts → listCollectiblesPaginated-BlE5mSzh.d.ts} +32 -32
- package/dist/{listCollections-BB9FxKj2.d.ts → listCollections-DWyqFSQ3.d.ts} +143 -66
- package/dist/{looks-rare-6H--x3AM.js → looks-rare-2HBhMpOf.js} +1 -1
- package/dist/{looks-rare-6H--x3AM.js.map → looks-rare-2HBhMpOf.js.map} +1 -1
- package/dist/{lowestListing-Cbsi6M1K.d.ts → lowestListing-DsunDO1c.d.ts} +38 -28
- package/dist/{magic-eden-BoxEQ1Li.js → magic-eden-BYdTp-uk.js} +1 -1
- package/dist/{magic-eden-BoxEQ1Li.js.map → magic-eden-BYdTp-uk.js.map} +1 -1
- package/dist/{manifold-DycKsljb.js → manifold-yE0x6ZmO.js} +1 -1
- package/dist/{manifold-DycKsljb.js.map → manifold-yE0x6ZmO.js.map} +1 -1
- package/dist/{market-C3HV-awQ.js → market-DuBpFsDg.js} +27 -17
- package/dist/market-DuBpFsDg.js.map +1 -0
- package/dist/{marketCurrencies-Bpw1bIO0.d.ts → marketCurrencies-BgwmbGFk.d.ts} +20 -9
- package/dist/{marketCurrencies-sKrTX0og.js → marketCurrencies-Bolonndy.js} +13 -7
- package/dist/marketCurrencies-Bolonndy.js.map +1 -0
- package/dist/marketplace-NQB-sEQL.js.map +1 -1
- package/dist/{marketplace-logos-D4dS1Foy.js → marketplace-logos-Cz9RrtQo.js} +21 -21
- package/dist/marketplace-logos-Cz9RrtQo.js.map +1 -0
- package/dist/{marketplace.gen-ksUafDqS.js → marketplace.gen-906FrJQJ.js} +24 -5
- package/dist/marketplace.gen-906FrJQJ.js.map +1 -0
- package/dist/{marketplaceConfig-UHQMM9fq.js → marketplaceConfig-Bqjo7NYO.js} +8 -4
- package/dist/marketplaceConfig-Bqjo7NYO.js.map +1 -0
- package/dist/{mintify-Dyqyo8jQ.js → mintify-BXQx3mZB.js} +1 -1
- package/dist/{mintify-Dyqyo8jQ.js.map → mintify-BXQx3mZB.js.map} +1 -1
- package/dist/{network-DtmiMhcg.js → network-DwdZ_5-7.js} +2 -2
- package/dist/network-DwdZ_5-7.js.map +1 -0
- package/dist/{networkconfigToWagmiChain-DbUf6HiO.js → networkconfigToWagmiChain-Ct-hGq8M.js} +4 -3
- package/dist/networkconfigToWagmiChain-Ct-hGq8M.js.map +1 -0
- package/dist/{nftx-2LbFjj9Q.js → nftx-B929_3Ce.js} +1 -1
- package/dist/{nftx-2LbFjj9Q.js.map → nftx-B929_3Ce.js.map} +1 -1
- package/dist/{okx-CBEWJNsR.js → okx-sZ0-Udny.js} +1 -1
- package/dist/{okx-CBEWJNsR.js.map → okx-sZ0-Udny.js.map} +1 -1
- package/dist/{open-sea-Dxntz_PA.js → open-sea-DO9PhTrz.js} +1 -1
- package/dist/{open-sea-Dxntz_PA.js.map → open-sea-DO9PhTrz.js.map} +1 -1
- package/dist/{orders-DnFfZAXV.js → orders-DH76ym2e.js} +16 -9
- package/dist/orders-DH76ym2e.js.map +1 -0
- package/dist/primary-sale-1u4QlPdA.js.map +1 -1
- package/dist/{primary-sales-Dmsi6bqj.js → primary-sales-CECrqatg.js} +49 -7
- package/dist/primary-sales-CECrqatg.js.map +1 -0
- package/dist/{query-BWbCsXLY.d.ts → query-brXxOcH0.d.ts} +1 -1
- package/dist/{rarible-CS0SupHr.js → rarible-Ccb2hs7y.js} +1 -1
- package/dist/{rarible-CS0SupHr.js.map → rarible-Ccb2hs7y.js.map} +1 -1
- package/dist/react/_internal/api/index.d.ts +2 -2
- package/dist/react/_internal/api/index.js +6 -6
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +28 -29
- package/dist/react/_internal/index.d.ts +2 -2
- package/dist/react/_internal/index.js +8 -8
- package/dist/react/_internal/wagmi/index.d.ts +1 -1
- package/dist/react/_internal/wagmi/index.js +3 -3
- package/dist/react/hooks/config/index.d.ts +8 -8
- package/dist/react/hooks/config/index.js +28 -29
- package/dist/react/hooks/contracts/index.d.ts +6 -6
- package/dist/react/hooks/contracts/index.js +8 -8
- package/dist/react/hooks/data/collectibles/index.d.ts +10 -10
- package/dist/react/hooks/data/collectibles/index.js +28 -29
- package/dist/react/hooks/data/collections/index.d.ts +11 -11
- package/dist/react/hooks/data/collections/index.js +29 -30
- package/dist/react/hooks/data/index.d.ts +37 -37
- package/dist/react/hooks/data/index.js +29 -30
- package/dist/react/hooks/data/inventory/index.d.ts +36 -36
- package/dist/react/hooks/data/inventory/index.js +28 -29
- package/dist/react/hooks/data/market/index.d.ts +11 -11
- package/dist/react/hooks/data/market/index.js +28 -29
- package/dist/react/hooks/data/orders/index.d.ts +10 -10
- package/dist/react/hooks/data/orders/index.js +28 -29
- package/dist/react/hooks/data/primary-sales/index.d.ts +37 -37
- package/dist/react/hooks/data/primary-sales/index.js +29 -30
- package/dist/react/hooks/data/tokens/index.d.ts +4 -4
- package/dist/react/hooks/data/tokens/index.js +28 -29
- package/dist/react/hooks/index.d.ts +37 -37
- package/dist/react/hooks/index.js +29 -30
- package/dist/react/hooks/transactions/index.d.ts +2 -2
- package/dist/react/hooks/transactions/index.js +28 -29
- package/dist/react/hooks/ui/index.d.ts +4 -4
- package/dist/react/hooks/ui/index.js +28 -29
- package/dist/react/hooks/utils/index.d.ts +36 -36
- package/dist/react/hooks/utils/index.js +28 -29
- package/dist/react/index.d.ts +37 -37
- package/dist/react/index.js +29 -30
- package/dist/react/queries/collectibles/index.d.ts +10 -10
- package/dist/react/queries/collectibles/index.js +12 -13
- package/dist/react/queries/collections/index.d.ts +11 -11
- package/dist/react/queries/collections/index.js +11 -11
- package/dist/react/queries/index.d.ts +24 -24
- package/dist/react/queries/index.js +22 -23
- package/dist/react/queries/inventory/index.d.ts +2 -2
- package/dist/react/queries/inventory/index.js +12 -12
- package/dist/react/queries/market/index.d.ts +5 -5
- package/dist/react/queries/market/index.js +12 -12
- package/dist/react/queries/orders/index.d.ts +10 -10
- package/dist/react/queries/orders/index.js +8 -8
- package/dist/react/queries/primary-sales/index.d.ts +4 -4
- package/dist/react/queries/primary-sales/index.js +9 -9
- package/dist/react/queries/tokens/index.d.ts +4 -4
- package/dist/react/queries/tokens/index.js +8 -9
- package/dist/react/queries/utils/index.d.ts +3 -3
- package/dist/react/queries/utils/index.js +12 -12
- package/dist/react/ssr/index.d.ts +7 -7
- package/dist/react/ssr/index.js +8 -8
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.d.ts +2 -2
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.js +12 -12
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +7 -10
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +28 -29
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +4 -4
- package/dist/react/ui/components/marketplace-collectible-card/index.js +28 -29
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +2 -2
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +8 -8
- package/dist/react/ui/components/marketplace-logos/index.d.ts +21 -21
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/icons/index.js +8 -8
- package/dist/react/ui/index.d.ts +4 -4
- package/dist/react/ui/index.js +28 -29
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +28 -29
- package/dist/react/utils/index.d.ts +1 -1
- package/dist/react/utils/index.js +6 -6
- package/dist/{react-DE852KeT.js → react-CBsgOdVP.js} +608 -735
- package/dist/react-CBsgOdVP.js.map +1 -0
- package/dist/{sequence-paCCener.js → sequence-CRdb1yEs.js} +1 -1
- package/dist/{sequence-paCCener.js.map → sequence-CRdb1yEs.js.map} +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/{sudo-swap-9rH2EgfT.js → sudo-swap-BIklG2gq.js} +1 -1
- package/dist/{sudo-swap-9rH2EgfT.js.map → sudo-swap-BIklG2gq.js.map} +1 -1
- package/dist/{super-rare-DHIuWtRw.js → super-rare-h8645_5E.js} +1 -1
- package/dist/{super-rare-DHIuWtRw.js.map → super-rare-h8645_5E.js.map} +1 -1
- package/dist/token-Cv7l2ZaL.js.map +1 -1
- package/dist/{tokenBalances-ibDerNmM.js → tokenBalances-CouzNX4j.js} +6 -12
- package/dist/tokenBalances-CouzNX4j.js.map +1 -0
- package/dist/{tokenSupplies-Bfe8RHzI.d.ts → tokenSupplies-C3zJll0M.d.ts} +32 -39
- package/dist/{tokens-cGxMadd8.js → tokens-BvIRUCGG.js} +58 -27
- package/dist/tokens-BvIRUCGG.js.map +1 -0
- package/dist/transaction-DZUW5RHu.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types-B_-cnkcP.js.map +1 -1
- package/dist/{types-D2TJ1dwv.d.ts → types-CMDwfhfR.d.ts} +5 -5
- package/dist/utils/abi/index.d.ts +4 -4
- package/dist/utils/abi/marketplace/index.d.ts +1 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1 -1
- package/dist/utils/abi/token/index.d.ts +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.js +7 -7
- package/dist/{utils-BfpDVibN.js → utils-9ToOvt-c.js} +50 -7
- package/dist/utils-9ToOvt-c.js.map +1 -0
- package/dist/{utils-BqxcalL2.js → utils-B6di6O-C.js} +2 -2
- package/dist/utils-B6di6O-C.js.map +1 -0
- package/dist/{utils-BCgNhBFR.js → utils-BCYTEOvy.js} +17 -7
- package/dist/utils-BCYTEOvy.js.map +1 -0
- package/dist/{waitForTransactionReceipt-DieAnV52.js → waitForTransactionReceipt-CbSeUSXe.js} +5 -4
- package/dist/{waitForTransactionReceipt-DieAnV52.js.map → waitForTransactionReceipt-CbSeUSXe.js.map} +1 -1
- package/dist/{x2y2-45WDooeh.js → x2y2-OvF__ugj.js} +1 -1
- package/dist/{x2y2-45WDooeh.js.map → x2y2-OvF__ugj.js.map} +1 -1
- package/dist/{zora-CbeBoLvQ.js → zora-DzCeu-eE.js} +1 -1
- package/dist/{zora-CbeBoLvQ.js.map → zora-DzCeu-eE.js.map} +1 -1
- package/package.json +38 -38
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +13 -0
- package/src/react/_internal/api/index.ts +0 -1
- package/src/react/_internal/api/marketplace.gen.ts +70 -26
- package/src/react/_internal/api/query-keys.ts +9 -0
- package/src/react/hooks/data/collectibles/useBalanceOfCollectible.tsx +0 -9
- package/src/react/hooks/data/collectibles/useListCollectibles.tsx +1 -16
- package/src/react/hooks/data/collectibles/useTokenBalances.tsx +0 -9
- package/src/react/hooks/data/collections/index.ts +2 -0
- package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.test.tsx +112 -0
- package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.tsx +74 -0
- package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.test.tsx +110 -0
- package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.tsx +74 -0
- package/src/react/hooks/data/inventory/useInventory.tsx +1 -10
- package/src/react/hooks/data/market/useMarketCurrencies.test.tsx +31 -2
- package/src/react/hooks/data/primary-sales/index.ts +1 -0
- package/src/react/hooks/data/primary-sales/usePrimarySaleItem.tsx +71 -0
- package/src/react/hooks/data/tokens/useListBalances.tsx +1 -10
- package/src/react/hooks/data/tokens/useTokenSupplies.ts +1 -13
- package/src/react/hooks/transactions/useGenerateOfferTransaction.test.tsx +2 -0
- package/src/react/hooks/transactions/useProcessStep.test.tsx +8 -6
- package/src/react/hooks/transactions/useProcessStep.ts +8 -6
- package/src/react/hooks/utils/useComparePrices.test.tsx +1 -1
- package/src/react/providers/modal-provider.tsx +2 -1
- package/src/react/queries/collectibles/balanceOfCollectible.ts +1 -15
- package/src/react/queries/collectibles/listCollectibles.ts +1 -54
- package/src/react/queries/collectibles/tokenBalances.ts +1 -15
- package/src/react/queries/collections/activeListingsCurrencies.ts +84 -0
- package/src/react/queries/collections/activeOffersCurrencies.ts +84 -0
- package/src/react/queries/collections/index.ts +2 -0
- package/src/react/queries/inventory/inventory.ts +2 -9
- package/src/react/queries/market/marketCurrencies.ts +8 -1
- package/src/react/queries/primary-sales/index.ts +1 -0
- package/src/react/queries/primary-sales/primarySaleItem.ts +80 -0
- package/src/react/queries/tokens/listBalances.ts +1 -21
- package/src/react/queries/tokens/tokenSupplies.ts +2 -31
- package/src/react/queries/utils/comparePrices.ts +13 -1
- package/src/react/ui/components/_internals/action-button/ActionButton.stories.tsx +2 -0
- package/src/react/ui/components/marketplace-collectible-card/components/footer/Footer.tsx +4 -18
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +2 -2
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +0 -2
- package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +3 -0
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +1 -0
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +0 -23
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +22 -2
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +2 -0
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +2 -0
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +2 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +15 -12
- package/src/react/ui/modals/_internal/components/floorPriceText/__tests__/FloorPriceText.test.tsx +2 -0
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +148 -11
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +2 -0
- package/src/styles/styles.ts +1 -1
- package/src/utils/networkconfigToWagmiChain.ts +7 -0
- package/src/utils/price.ts +58 -0
- package/test/const.ts +2 -0
- package/test/server-setup.ts +0 -2
- package/.changeset/honest-peas-arrive.md +0 -5
- package/.changeset/real-tips-stick.md +0 -8
- package/.changeset/tall-pandas-wear.md +0 -8
- package/dist/BellIcon-ByhygxBO.js.map +0 -1
- package/dist/CartIcon-Bt3rQYGk.js.map +0 -1
- package/dist/CollectibleCard-CVpdgXA8.d.ts +0 -8
- package/dist/api-BoO0V5aJ.js.map +0 -1
- package/dist/builder-api-BFuZNOaN.js.map +0 -1
- package/dist/builder.gen-B9wR2nvF.js.map +0 -1
- package/dist/collectibles-C_H8jMGH.js.map +0 -1
- package/dist/collections-CKummc-R.js.map +0 -1
- package/dist/components-CosnX7F9.js.map +0 -1
- package/dist/create-config-CIfejoCk.js.map +0 -1
- package/dist/index-DNNUeZEq.d.ts +0 -18
- package/dist/inventory-Dd7TazvZ.js.map +0 -1
- package/dist/listBalances-BxpxBCvn.js +0 -57
- package/dist/listBalances-BxpxBCvn.js.map +0 -1
- package/dist/market-C3HV-awQ.js.map +0 -1
- package/dist/marketCurrencies-sKrTX0og.js.map +0 -1
- package/dist/marketplace-logos-D4dS1Foy.js.map +0 -1
- package/dist/marketplace.gen-ksUafDqS.js.map +0 -1
- package/dist/marketplaceConfig-UHQMM9fq.js.map +0 -1
- package/dist/network-DtmiMhcg.js.map +0 -1
- package/dist/networkconfigToWagmiChain-DbUf6HiO.js.map +0 -1
- package/dist/orders-DnFfZAXV.js.map +0 -1
- package/dist/primary-sales-Dmsi6bqj.js.map +0 -1
- package/dist/react-DE852KeT.js.map +0 -1
- package/dist/tokenBalances-ibDerNmM.js.map +0 -1
- package/dist/tokens-cGxMadd8.js.map +0 -1
- package/dist/utils-BCgNhBFR.js.map +0 -1
- package/dist/utils-BfpDVibN.js.map +0 -1
- package/dist/utils-BqxcalL2.js.map +0 -1
- package/src/react/_internal/api/__mocks__/laos.msw.ts +0 -387
- package/src/react/_internal/api/__tests__/laos-api.test.ts +0 -756
- package/src/react/_internal/api/laos-api.ts +0 -106
- package/src/react/hooks/data/collectibles/useBalanceOfCollectible.laos.test.tsx +0 -367
- package/src/react/queries/collectibles/__tests__/balanceOfCollectible.laos.test.ts +0 -123
- package/src/react/queries/collectibles/__tests__/tokenBalances.laos.test.ts +0 -123
- package/src/react/queries/inventory/__tests__/inventory.laos.test.ts +0 -499
- package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +0 -481
- /package/dist/{index-6wsMChsg.d.ts → index-CCggO_hw.d.ts} +0 -0
- /package/dist/{index-CZUtOTjh.d.ts → index-CKefEBrI.d.ts} +0 -0
- /package/dist/{index-DW3njUfb.d.ts → index-DgsCqh_P.d.ts} +0 -0
- /package/dist/{index-DewGsFz5.d.ts → index-xpO4AQyS.d.ts} +0 -0
- /package/dist/{queries-KOcILNJO.js → queries-CyajGg_O.js} +0 -0
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { DEFAULT_MARKETPLACE_FEE_PERCENTAGE } from "./src-Dz2CfBL0.js";
|
|
3
|
-
import { BaseError
|
|
4
|
-
import { balanceQueries, collectableKeys, getMarketplaceClient, getQueryClient,
|
|
5
|
-
import { CollectionStatus, ContractType, ExecuteType, OrderSide, OrderbookKind, PropertyType, StepType, WalletKind } from "./marketplace.gen-
|
|
6
|
-
import { getNetwork, getPresentableChainName } from "./network-
|
|
3
|
+
import { BaseError, ChainSwitchError, InvalidContractTypeError, NoWalletConnectedError, TransactionExecutionError, TransactionSignatureError, UserRejectedRequestError } from "./transaction-DZUW5RHu.js";
|
|
4
|
+
import { balanceQueries, collectableKeys, getMarketplaceClient, getQueryClient, marketplaceApiURL } from "./api-GwTR0dBA.js";
|
|
5
|
+
import { CollectionStatus$1 as CollectionStatus, ContractType$1 as ContractType, ExecuteType$1 as ExecuteType, OfferType$1 as OfferType, OrderSide$1 as OrderSide, OrderbookKind$1 as OrderbookKind, PropertyType$1 as PropertyType, StepType$1 as StepType, WalletKind$1 as WalletKind } from "./marketplace.gen-906FrJQJ.js";
|
|
6
|
+
import { getNetwork$1 as getNetwork, getPresentableChainName$1 as getPresentableChainName } from "./network-DwdZ_5-7.js";
|
|
7
7
|
import { PROVIDER_ID, TransactionType } from "./_internal-DkS2VUn5.js";
|
|
8
8
|
import { CollectibleCardAction } from "./types-B_-cnkcP.js";
|
|
9
9
|
import { EIP2981_ABI, SequenceMarketplaceV1_ABI } from "./marketplace-NQB-sEQL.js";
|
|
10
10
|
import { ERC721_SALE_ABI_V0, ERC721_SALE_ABI_V1 } from "./primary-sale-1u4QlPdA.js";
|
|
11
11
|
import { ERC1155_ABI, ERC721_ABI } from "./token-Cv7l2ZaL.js";
|
|
12
|
-
import { calculateEarningsAfterFees,
|
|
13
|
-
import { marketplaceConfigOptions } from "./marketplaceConfig-
|
|
14
|
-
import { SalesContractVersion, useSalesContractABI } from "./contracts-
|
|
15
|
-
import { balanceOfCollectibleOptions, collectibleQueryOptions, countOfCollectablesQueryOptions, listCollectibleActivitiesQueryOptions, listCollectiblesPaginatedQueryOptions, listCollectiblesQueryOptions } from "./collectibles-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { FooterName, PriceDisplay, SaleDetailsPill, TokenTypeBalancePill } from "./components-CosnX7F9.js";
|
|
12
|
+
import { calculateEarningsAfterFees, calculateTotalOfferCost, cn, compareAddress, formatPriceWithFee, truncateMiddle, validateOpenseaOfferDecimals } from "./utils-9ToOvt-c.js";
|
|
13
|
+
import { marketplaceConfigOptions$1 as marketplaceConfigOptions } from "./marketplaceConfig-Bqjo7NYO.js";
|
|
14
|
+
import { SalesContractVersion, useSalesContractABI } from "./contracts-DRJHF89h.js";
|
|
15
|
+
import { balanceOfCollectibleOptions, collectibleQueryOptions, countOfCollectablesQueryOptions, listCollectibleActivitiesQueryOptions, listCollectiblesPaginatedQueryOptions, listCollectiblesQueryOptions } from "./collectibles-CZ6i8sXK.js";
|
|
16
|
+
import { collectionActiveListingsCurrenciesQueryOptions, collectionActiveOffersCurrenciesQueryOptions, collectionBalanceDetailsQueryOptions, collectionDetailsQueryOptions, collectionQueryOptions, listCollectionActivitiesQueryOptions, listCollectionsQueryOptions } from "./collections-5NcU-7ZR.js";
|
|
17
|
+
import { checkoutOptionsQueryOptions, checkoutOptionsSalesContractQueryOptions, currencyQueryOptions, filtersQueryOptions } from "./market-DuBpFsDg.js";
|
|
18
|
+
import { marketCurrenciesQueryOptions } from "./marketCurrencies-Bolonndy.js";
|
|
19
|
+
import { countItemsOrdersForCollectionQueryOptions, countListingsForCollectibleQueryOptions, countOffersForCollectibleQueryOptions, floorOrderQueryOptions, getCountOfFilteredOrdersQueryOptions, highestOfferQueryOptions, listItemsOrdersForCollectionPaginatedQueryOptions, listItemsOrdersForCollectionQueryOptions, listListingsForCollectibleQueryOptions, listOffersForCollectibleQueryOptions, lowestListingQueryOptions } from "./orders-DH76ym2e.js";
|
|
20
|
+
import { inventoryOptions } from "./inventory--t6Zu55O.js";
|
|
21
|
+
import { countOfPrimarySaleItemsOptions, listPrimarySaleItemsQueryOptions, primarySaleItemQueryOptions, primarySaleItemsCountQueryOptions } from "./primary-sales-CECrqatg.js";
|
|
22
|
+
import { getTokenRangesQueryOptions, listBalancesOptions, listTokenMetadataQueryOptions, searchTokenMetadataQueryOptions, tokenSuppliesQueryOptions } from "./tokens-BvIRUCGG.js";
|
|
23
|
+
import { comparePricesQueryOptions, convertPriceToUSDQueryOptions } from "./utils-BCYTEOvy.js";
|
|
24
|
+
import { waitForTransactionReceipt } from "./waitForTransactionReceipt-CbSeUSXe.js";
|
|
25
|
+
import { CalendarIcon_default, CartIcon_default, InfoIcon_default } from "./CartIcon-UyB4NYKt.js";
|
|
26
|
+
import { FooterName, PriceDisplay, SaleDetailsPill, TokenTypeBalancePill } from "./components-CY8kx2kb.js";
|
|
28
27
|
import { NetworkType, networks } from "@0xsequence/network";
|
|
29
28
|
import { useAccount, useBalance, useChainId, usePublicClient, useReadContract, useReadContracts, useSendTransaction, useSignMessage, useSignTypedData, useSwitchChain, useWriteContract } from "wagmi";
|
|
30
29
|
import { useChain, useOpenConnectModal, useWaasFeeOptions } from "@0xsequence/connect";
|
|
31
30
|
import { Suspense, createContext, lazy, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
32
31
|
import { QueryClientProvider, queryOptions, skipToken, useInfiniteQuery, useMutation, useQuery } from "@tanstack/react-query";
|
|
33
32
|
import { TransactionStatus } from "@0xsequence/indexer";
|
|
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";
|
|
33
|
+
import { AddIcon, Button, CheckmarkIcon, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Divider, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuPortal, DropdownMenuRoot, DropdownMenuTrigger, ExternalLinkIcon, IconButton, Image, InfoIcon, Modal, NetworkImage, NumericInput, Select, Skeleton, Spinner, SubtractIcon, Text, TextInput, ThemeProvider, TimeIcon, TokenImage, Tooltip, WarningIcon, cn as cn$1 } from "@0xsequence/design-system";
|
|
35
34
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
36
35
|
import * as dn from "dnum";
|
|
37
|
-
import
|
|
36
|
+
import * as dnum from "dnum";
|
|
37
|
+
import { BaseError as BaseError$1, UserRejectedRequestError as UserRejectedRequestError$1, WaitForTransactionReceiptTimeoutError, decodeFunctionData, encodeFunctionData, erc20Abi, erc721Abi, formatUnits, hexToBigInt, isAddress, isHex, maxUint256, parseEventLogs, parseUnits, toHex, zeroAddress } from "viem";
|
|
38
38
|
import { Databeat } from "@databeat/tracker";
|
|
39
39
|
import { observable } from "@legendapp/state";
|
|
40
40
|
import { createStore } from "@xstate/store";
|
|
@@ -49,7 +49,7 @@ import { addDays as addDays$1 } from "date-fns/addDays";
|
|
|
49
49
|
import { createPortal } from "react-dom";
|
|
50
50
|
|
|
51
51
|
//#region src/utils/_internal/error/context.ts
|
|
52
|
-
var MarketplaceSdkProviderNotFoundError = class extends BaseError
|
|
52
|
+
var MarketplaceSdkProviderNotFoundError = class extends BaseError {
|
|
53
53
|
name = "MarketplaceSDKProviderNotFoundError";
|
|
54
54
|
constructor() {
|
|
55
55
|
super("`useConfig` must be used within `MarketplaceSdkProvider`.");
|
|
@@ -58,7 +58,7 @@ var MarketplaceSdkProviderNotFoundError = class extends BaseError$1 {
|
|
|
58
58
|
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/utils/_internal/error/config.ts
|
|
61
|
-
var ConfigError = class extends BaseError
|
|
61
|
+
var ConfigError = class extends BaseError {
|
|
62
62
|
name = "ConfigError";
|
|
63
63
|
};
|
|
64
64
|
var InvalidProjectAccessKeyError = class extends ConfigError {
|
|
@@ -107,7 +107,8 @@ var DatabeatAnalytics = class extends Databeat {
|
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
const useAnalytics = () => {
|
|
110
|
-
|
|
110
|
+
const context = useContext(MarketplaceSdkContext);
|
|
111
|
+
return context.analytics;
|
|
111
112
|
};
|
|
112
113
|
|
|
113
114
|
//#endregion
|
|
@@ -258,12 +259,7 @@ const useMarketplaceConfig = () => {
|
|
|
258
259
|
*/
|
|
259
260
|
function useBalanceOfCollectible(args) {
|
|
260
261
|
const config = useConfig();
|
|
261
|
-
|
|
262
|
-
const isLaos721 = (marketplaceConfig?.market.collections.find((collection) => collection.itemsAddress === args.collectionAddress))?.contractType === ContractType.LAOS_ERC_721;
|
|
263
|
-
return useQuery(balanceOfCollectibleOptions({
|
|
264
|
-
...args,
|
|
265
|
-
isLaos721
|
|
266
|
-
}, config));
|
|
262
|
+
return useQuery(balanceOfCollectibleOptions({ ...args }, config));
|
|
267
263
|
}
|
|
268
264
|
|
|
269
265
|
//#endregion
|
|
@@ -433,14 +429,13 @@ function useListCollectibleActivities(params) {
|
|
|
433
429
|
* Hook to fetch a list of collectibles with infinite pagination support
|
|
434
430
|
*
|
|
435
431
|
* Fetches collectibles from the marketplace with support for filtering, pagination,
|
|
436
|
-
* and special handling for shop marketplace types
|
|
432
|
+
* and special handling for shop marketplace types.
|
|
437
433
|
*
|
|
438
434
|
* @param params - Configuration parameters
|
|
439
435
|
* @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
|
|
440
436
|
* @param params.collectionAddress - The collection contract address
|
|
441
437
|
* @param params.side - Order side (listing or bid)
|
|
442
438
|
* @param params.filter - Optional filtering parameters
|
|
443
|
-
* @param params.isLaos721 - Whether the collection is a LAOS721 contract
|
|
444
439
|
* @param params.marketplaceType - Type of marketplace (shop, etc.)
|
|
445
440
|
* @param params.query - Optional React Query configuration
|
|
446
441
|
*
|
|
@@ -470,20 +465,6 @@ function useListCollectibleActivities(params) {
|
|
|
470
465
|
* }
|
|
471
466
|
* })
|
|
472
467
|
* ```
|
|
473
|
-
*
|
|
474
|
-
* @example
|
|
475
|
-
* For LAOS721 collections:
|
|
476
|
-
* ```typescript
|
|
477
|
-
* const { data } = useListCollectibles({
|
|
478
|
-
* chainId: 137,
|
|
479
|
-
* collectionAddress: '0x...',
|
|
480
|
-
* side: OrderSide.listing,
|
|
481
|
-
* isLaos721: true,
|
|
482
|
-
* filter: {
|
|
483
|
-
* inAccounts: ['0x...']
|
|
484
|
-
* }
|
|
485
|
-
* })
|
|
486
|
-
* ```
|
|
487
468
|
*/
|
|
488
469
|
function useListCollectibles(params) {
|
|
489
470
|
const defaultConfig = useConfig();
|
|
@@ -614,6 +595,100 @@ function useCollection(params) {
|
|
|
614
595
|
return useQuery({ ...queryOptions$1 });
|
|
615
596
|
}
|
|
616
597
|
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.tsx
|
|
600
|
+
/**
|
|
601
|
+
* Hook to fetch the active listings currencies for a collection
|
|
602
|
+
*
|
|
603
|
+
* Retrieves all currencies that are currently being used in active listings
|
|
604
|
+
* for a specific collection from the marketplace.
|
|
605
|
+
*
|
|
606
|
+
* @param params - Configuration parameters
|
|
607
|
+
* @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
|
|
608
|
+
* @param params.collectionAddress - The collection contract address
|
|
609
|
+
* @param params.query - Optional React Query configuration
|
|
610
|
+
*
|
|
611
|
+
* @returns Query result containing the array of currencies used in active listings
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* Basic usage:
|
|
615
|
+
* ```typescript
|
|
616
|
+
* const { data, isLoading } = useCollectionActiveListingsCurrencies({
|
|
617
|
+
* chainId: 137,
|
|
618
|
+
* collectionAddress: '0x...'
|
|
619
|
+
* })
|
|
620
|
+
* ```
|
|
621
|
+
*
|
|
622
|
+
* @example
|
|
623
|
+
* With custom query options:
|
|
624
|
+
* ```typescript
|
|
625
|
+
* const { data, isLoading } = useCollectionActiveListingsCurrencies({
|
|
626
|
+
* chainId: 1,
|
|
627
|
+
* collectionAddress: '0x...',
|
|
628
|
+
* query: {
|
|
629
|
+
* refetchInterval: 30000,
|
|
630
|
+
* enabled: hasCollectionAddress
|
|
631
|
+
* }
|
|
632
|
+
* })
|
|
633
|
+
* ```
|
|
634
|
+
*/
|
|
635
|
+
function useCollectionActiveListingsCurrencies(params) {
|
|
636
|
+
const defaultConfig = useConfig();
|
|
637
|
+
const { config = defaultConfig,...rest } = params;
|
|
638
|
+
const queryOptions$1 = collectionActiveListingsCurrenciesQueryOptions({
|
|
639
|
+
config,
|
|
640
|
+
...rest
|
|
641
|
+
});
|
|
642
|
+
return useQuery({ ...queryOptions$1 });
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
//#endregion
|
|
646
|
+
//#region src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.tsx
|
|
647
|
+
/**
|
|
648
|
+
* Hook to fetch the active offers currencies for a collection
|
|
649
|
+
*
|
|
650
|
+
* Retrieves all currencies that are currently being used in active offers
|
|
651
|
+
* for a specific collection from the marketplace.
|
|
652
|
+
*
|
|
653
|
+
* @param params - Configuration parameters
|
|
654
|
+
* @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
|
|
655
|
+
* @param params.collectionAddress - The collection contract address
|
|
656
|
+
* @param params.query - Optional React Query configuration
|
|
657
|
+
*
|
|
658
|
+
* @returns Query result containing the array of currencies used in active offers
|
|
659
|
+
*
|
|
660
|
+
* @example
|
|
661
|
+
* Basic usage:
|
|
662
|
+
* ```typescript
|
|
663
|
+
* const { data, isLoading } = useCollectionActiveOffersCurrencies({
|
|
664
|
+
* chainId: 137,
|
|
665
|
+
* collectionAddress: '0x...'
|
|
666
|
+
* })
|
|
667
|
+
* ```
|
|
668
|
+
*
|
|
669
|
+
* @example
|
|
670
|
+
* With custom query options:
|
|
671
|
+
* ```typescript
|
|
672
|
+
* const { data, isLoading } = useCollectionActiveOffersCurrencies({
|
|
673
|
+
* chainId: 1,
|
|
674
|
+
* collectionAddress: '0x...',
|
|
675
|
+
* query: {
|
|
676
|
+
* refetchInterval: 30000,
|
|
677
|
+
* enabled: hasCollectionAddress
|
|
678
|
+
* }
|
|
679
|
+
* })
|
|
680
|
+
* ```
|
|
681
|
+
*/
|
|
682
|
+
function useCollectionActiveOffersCurrencies(params) {
|
|
683
|
+
const defaultConfig = useConfig();
|
|
684
|
+
const { config = defaultConfig,...rest } = params;
|
|
685
|
+
const queryOptions$1 = collectionActiveOffersCurrenciesQueryOptions({
|
|
686
|
+
config,
|
|
687
|
+
...rest
|
|
688
|
+
});
|
|
689
|
+
return useQuery({ ...queryOptions$1 });
|
|
690
|
+
}
|
|
691
|
+
|
|
617
692
|
//#endregion
|
|
618
693
|
//#region src/react/hooks/data/collections/useCollectionBalanceDetails.tsx
|
|
619
694
|
/**
|
|
@@ -748,7 +823,8 @@ const collectionDetailsPollingOptions = (args, config) => {
|
|
|
748
823
|
if (data && isTerminalState(data.status)) return false;
|
|
749
824
|
const currentAttempt = (query.state.dataUpdateCount || 0) + 1;
|
|
750
825
|
if (currentAttempt >= MAX_ATTEMPTS) return false;
|
|
751
|
-
|
|
826
|
+
const interval = Math.min(INITIAL_POLLING_INTERVAL * 1.5 ** currentAttempt, MAX_POLLING_INTERVAL);
|
|
827
|
+
return interval;
|
|
752
828
|
},
|
|
753
829
|
refetchOnWindowFocus: false,
|
|
754
830
|
retry: false,
|
|
@@ -998,56 +1074,58 @@ function useListMarketCardData({ collectionAddress, chainId, orderbookKind, coll
|
|
|
998
1074
|
if (!collectiblesList?.pages) return [];
|
|
999
1075
|
return collectiblesList.pages.flatMap((page) => page.collectibles);
|
|
1000
1076
|
}, [collectiblesList?.pages]);
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
return;
|
|
1031
|
-
}
|
|
1077
|
+
const collectibleCards = useMemo(() => {
|
|
1078
|
+
return allCollectibles.map((collectible) => {
|
|
1079
|
+
const balance = collectionBalance?.balances.find((balance$1) => balance$1.tokenID === collectible.metadata.tokenId)?.balance;
|
|
1080
|
+
const cardProps = {
|
|
1081
|
+
collectibleId: collectible.metadata.tokenId,
|
|
1082
|
+
chainId,
|
|
1083
|
+
collectionAddress,
|
|
1084
|
+
collectionType,
|
|
1085
|
+
cardLoading: collectiblesListIsLoading || balanceLoading,
|
|
1086
|
+
cardType: "market",
|
|
1087
|
+
orderbookKind,
|
|
1088
|
+
collectible,
|
|
1089
|
+
onCollectibleClick,
|
|
1090
|
+
balance,
|
|
1091
|
+
balanceIsLoading: balanceLoading,
|
|
1092
|
+
onCannotPerformAction,
|
|
1093
|
+
prioritizeOwnerActions,
|
|
1094
|
+
assetSrcPrefixUrl,
|
|
1095
|
+
hideQuantitySelector,
|
|
1096
|
+
onOfferClick: ({ order }) => {
|
|
1097
|
+
if (!accountAddress) return;
|
|
1098
|
+
if (balance) {
|
|
1099
|
+
showSellModal({
|
|
1100
|
+
chainId,
|
|
1101
|
+
collectionAddress,
|
|
1102
|
+
tokenId: collectible.metadata.tokenId,
|
|
1103
|
+
order
|
|
1104
|
+
});
|
|
1105
|
+
return;
|
|
1032
1106
|
}
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
return cardProps;
|
|
1110
|
+
});
|
|
1111
|
+
}, [
|
|
1112
|
+
allCollectibles,
|
|
1113
|
+
chainId,
|
|
1114
|
+
collectionAddress,
|
|
1115
|
+
collectionType,
|
|
1116
|
+
collectiblesListIsLoading,
|
|
1117
|
+
balanceLoading,
|
|
1118
|
+
orderbookKind,
|
|
1119
|
+
onCollectibleClick,
|
|
1120
|
+
collectionBalance?.balances,
|
|
1121
|
+
onCannotPerformAction,
|
|
1122
|
+
prioritizeOwnerActions,
|
|
1123
|
+
assetSrcPrefixUrl,
|
|
1124
|
+
accountAddress,
|
|
1125
|
+
showSellModal
|
|
1126
|
+
]);
|
|
1127
|
+
return {
|
|
1128
|
+
collectibleCards,
|
|
1051
1129
|
isLoading: collectiblesListIsLoading || balanceLoading,
|
|
1052
1130
|
error: collectiblesListError,
|
|
1053
1131
|
hasNextPage,
|
|
@@ -1698,11 +1776,15 @@ function useErc721SaleDetails({ chainId, salesContractAddress, itemsContractAddr
|
|
|
1698
1776
|
itemsContractAddress,
|
|
1699
1777
|
enabled: enabled && !versionLoading && version === SalesContractVersion.V1
|
|
1700
1778
|
});
|
|
1779
|
+
const saleDetails = saleDetailsV0 || saleDetailsV1;
|
|
1780
|
+
const quantityMinted = quantityMintedV0 || quantityMintedV1;
|
|
1781
|
+
const quantityTotal = quantityTotalV0 || quantityTotalV1;
|
|
1782
|
+
const quantityRemaining = quantityRemainingV0 || quantityRemainingV1;
|
|
1701
1783
|
return {
|
|
1702
|
-
saleDetails
|
|
1703
|
-
quantityMinted
|
|
1704
|
-
quantityTotal
|
|
1705
|
-
quantityRemaining
|
|
1784
|
+
saleDetails,
|
|
1785
|
+
quantityMinted,
|
|
1786
|
+
quantityTotal,
|
|
1787
|
+
quantityRemaining,
|
|
1706
1788
|
isLoading: versionLoading || saleDetailsLoadingV0 || saleDetailsLoadingV1,
|
|
1707
1789
|
error: versionError || saleDetailsErrorV0 || saleDetailsErrorV1
|
|
1708
1790
|
};
|
|
@@ -1875,12 +1957,7 @@ function useGetTokenRanges(params) {
|
|
|
1875
1957
|
*/
|
|
1876
1958
|
function useListBalances(args) {
|
|
1877
1959
|
const config = useConfig();
|
|
1878
|
-
|
|
1879
|
-
const isLaos721 = marketplaceConfig?.market?.collections?.find((c) => c.itemsAddress === args.contractAddress && c.chainId === args.chainId)?.contractType === ContractType.LAOS_ERC_721;
|
|
1880
|
-
return useInfiniteQuery(listBalancesOptions({
|
|
1881
|
-
...args,
|
|
1882
|
-
isLaos721
|
|
1883
|
-
}, config));
|
|
1960
|
+
return useInfiniteQuery(listBalancesOptions({ ...args }, config));
|
|
1884
1961
|
}
|
|
1885
1962
|
|
|
1886
1963
|
//#endregion
|
|
@@ -1937,15 +2014,13 @@ function useListTokenMetadata(params) {
|
|
|
1937
2014
|
//#endregion
|
|
1938
2015
|
//#region src/react/hooks/data/tokens/useTokenSupplies.ts
|
|
1939
2016
|
/**
|
|
1940
|
-
* Hook to fetch token supplies from the indexer
|
|
2017
|
+
* Hook to fetch token supplies from the indexer
|
|
1941
2018
|
*
|
|
1942
2019
|
* Retrieves supply information for tokens from a specific collection.
|
|
1943
|
-
* Automatically chooses between indexer and LAOS APIs based on the isLaos721 flag.
|
|
1944
2020
|
*
|
|
1945
2021
|
* @param params - Configuration parameters
|
|
1946
2022
|
* @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
|
|
1947
2023
|
* @param params.collectionAddress - The collection contract address
|
|
1948
|
-
* @param params.isLaos721 - Whether to use LAOS API instead of indexer
|
|
1949
2024
|
* @param params.includeMetadata - Whether to include token metadata
|
|
1950
2025
|
* @param params.page - Pagination options
|
|
1951
2026
|
* @param params.query - Optional React Query configuration
|
|
@@ -1962,16 +2037,6 @@ function useListTokenMetadata(params) {
|
|
|
1962
2037
|
* ```
|
|
1963
2038
|
*
|
|
1964
2039
|
* @example
|
|
1965
|
-
* With LAOS API:
|
|
1966
|
-
* ```typescript
|
|
1967
|
-
* const { data, isLoading } = useTokenSupplies({
|
|
1968
|
-
* chainId: 1,
|
|
1969
|
-
* collectionAddress: '0x...',
|
|
1970
|
-
* isLaos721: true
|
|
1971
|
-
* })
|
|
1972
|
-
* ```
|
|
1973
|
-
*
|
|
1974
|
-
* @example
|
|
1975
2040
|
* With conditional fetching:
|
|
1976
2041
|
* ```typescript
|
|
1977
2042
|
* const { data, isLoading } = useTokenSupplies({
|
|
@@ -2127,13 +2192,14 @@ function useList721ShopCardData({ primarySaleItemsWithMetadata, chainId, contrac
|
|
|
2127
2192
|
});
|
|
2128
2193
|
const config = useConfig();
|
|
2129
2194
|
const tokenSuppliesEnabled = Boolean(chainId && contractAddress && config && (enabled ?? true));
|
|
2130
|
-
const
|
|
2195
|
+
const tokenSuppliesQuery = useInfiniteQuery({ ...tokenSuppliesQueryOptions({
|
|
2131
2196
|
chainId,
|
|
2132
2197
|
collectionAddress: contractAddress,
|
|
2133
2198
|
includeMetadata: true,
|
|
2134
2199
|
config,
|
|
2135
2200
|
query: { enabled: tokenSuppliesEnabled }
|
|
2136
2201
|
}) });
|
|
2202
|
+
const { data: tokenSuppliesData, fetchNextPage: fetchNextTokenSuppliesPage, hasNextPage: hasNextSuppliesPage, isFetchingNextPage: isFetchingNextSuppliesPage, isLoading: tokenSuppliesLoading } = tokenSuppliesQuery;
|
|
2137
2203
|
useEffect(() => {
|
|
2138
2204
|
async function fetchAllPages() {
|
|
2139
2205
|
if (!tokenSuppliesEnabled) return;
|
|
@@ -2161,7 +2227,8 @@ function useList721ShopCardData({ primarySaleItemsWithMetadata, chainId, contrac
|
|
|
2161
2227
|
functionName: "saleDetails",
|
|
2162
2228
|
query: { enabled: enabled && !versionLoading && !!abi }
|
|
2163
2229
|
});
|
|
2164
|
-
const
|
|
2230
|
+
const unmintedPrimarySaleItems = primarySaleItemsWithMetadata.filter((item) => !matchingTokenSupplies?.some((supply) => supply.tokenID === item.metadata.tokenId));
|
|
2231
|
+
const primarySaleItemsCollectibleCards = unmintedPrimarySaleItems.map((item) => {
|
|
2165
2232
|
const { metadata, primarySaleItem } = item;
|
|
2166
2233
|
const salePrice = {
|
|
2167
2234
|
amount: primarySaleItem.priceAmount?.toString(),
|
|
@@ -2242,33 +2309,34 @@ function useList1155ShopCardData({ primarySaleItemsWithMetadata, chainId, contra
|
|
|
2242
2309
|
query: { enabled: enabled && !versionLoading && !!abi }
|
|
2243
2310
|
});
|
|
2244
2311
|
const isLoading = versionLoading || collectionLoading || paymentTokenLoading;
|
|
2312
|
+
const collectibleCards = primarySaleItemsWithMetadata.map((item) => {
|
|
2313
|
+
const { metadata, primarySaleItem: saleData } = item;
|
|
2314
|
+
const salePrice = {
|
|
2315
|
+
amount: saleData?.priceAmount?.toString() || "",
|
|
2316
|
+
currencyAddress: saleData?.currencyAddress || paymentToken || "0x"
|
|
2317
|
+
};
|
|
2318
|
+
const supply = saleData?.supply?.toString();
|
|
2319
|
+
const unlimitedSupply = saleData?.unlimitedSupply;
|
|
2320
|
+
return {
|
|
2321
|
+
collectibleId: metadata.tokenId,
|
|
2322
|
+
chainId,
|
|
2323
|
+
collectionAddress: contractAddress,
|
|
2324
|
+
collectionType: ContractType.ERC1155,
|
|
2325
|
+
tokenMetadata: metadata,
|
|
2326
|
+
cardLoading: isLoading,
|
|
2327
|
+
salesContractAddress,
|
|
2328
|
+
salePrice,
|
|
2329
|
+
quantityInitial: supply,
|
|
2330
|
+
quantityDecimals: collection?.decimals || 0,
|
|
2331
|
+
quantityRemaining: supply,
|
|
2332
|
+
unlimitedSupply,
|
|
2333
|
+
saleStartsAt: saleData?.startDate?.toString(),
|
|
2334
|
+
saleEndsAt: saleData?.endDate?.toString(),
|
|
2335
|
+
cardType: "shop"
|
|
2336
|
+
};
|
|
2337
|
+
});
|
|
2245
2338
|
return {
|
|
2246
|
-
collectibleCards
|
|
2247
|
-
const { metadata, primarySaleItem: saleData } = item;
|
|
2248
|
-
const salePrice = {
|
|
2249
|
-
amount: saleData?.priceAmount?.toString() || "",
|
|
2250
|
-
currencyAddress: saleData?.currencyAddress || paymentToken || "0x"
|
|
2251
|
-
};
|
|
2252
|
-
const supply = saleData?.supply?.toString();
|
|
2253
|
-
const unlimitedSupply = saleData?.unlimitedSupply;
|
|
2254
|
-
return {
|
|
2255
|
-
collectibleId: metadata.tokenId,
|
|
2256
|
-
chainId,
|
|
2257
|
-
collectionAddress: contractAddress,
|
|
2258
|
-
collectionType: ContractType.ERC1155,
|
|
2259
|
-
tokenMetadata: metadata,
|
|
2260
|
-
cardLoading: isLoading,
|
|
2261
|
-
salesContractAddress,
|
|
2262
|
-
salePrice,
|
|
2263
|
-
quantityInitial: supply,
|
|
2264
|
-
quantityDecimals: collection?.decimals || 0,
|
|
2265
|
-
quantityRemaining: supply,
|
|
2266
|
-
unlimitedSupply,
|
|
2267
|
-
saleStartsAt: saleData?.startDate?.toString(),
|
|
2268
|
-
saleEndsAt: saleData?.endDate?.toString(),
|
|
2269
|
-
cardType: "shop"
|
|
2270
|
-
};
|
|
2271
|
-
}),
|
|
2339
|
+
collectibleCards,
|
|
2272
2340
|
tokenMetadataError: null,
|
|
2273
2341
|
tokenSaleDetailsError: null,
|
|
2274
2342
|
isLoading: enabled && isLoading
|
|
@@ -2325,16 +2393,60 @@ function useListPrimarySaleItems(params) {
|
|
|
2325
2393
|
return useInfiniteQuery(queryOptions$1);
|
|
2326
2394
|
}
|
|
2327
2395
|
|
|
2396
|
+
//#endregion
|
|
2397
|
+
//#region src/react/hooks/data/primary-sales/usePrimarySaleItem.tsx
|
|
2398
|
+
/**
|
|
2399
|
+
* Hook to fetch a single primary sale item
|
|
2400
|
+
*
|
|
2401
|
+
* Retrieves details for a specific primary sale item from a primary sale contract.
|
|
2402
|
+
*
|
|
2403
|
+
* @param params - Configuration parameters
|
|
2404
|
+
* @param params.chainId - The chain ID (must be number, e.g., 1 for Ethereum, 137 for Polygon)
|
|
2405
|
+
* @param params.primarySaleContractAddress - The primary sale contract address
|
|
2406
|
+
* @param params.tokenId - The token ID of the primary sale item
|
|
2407
|
+
* @param params.query - Optional React Query configuration
|
|
2408
|
+
*
|
|
2409
|
+
* @returns Query result containing the primary sale item data
|
|
2410
|
+
*
|
|
2411
|
+
* @example
|
|
2412
|
+
* Basic usage:
|
|
2413
|
+
* ```typescript
|
|
2414
|
+
* const { data: item, isLoading } = usePrimarySaleItem({
|
|
2415
|
+
* chainId: 137,
|
|
2416
|
+
* primarySaleContractAddress: '0x...',
|
|
2417
|
+
* tokenId: '1',
|
|
2418
|
+
* })
|
|
2419
|
+
* ```
|
|
2420
|
+
*
|
|
2421
|
+
* @example
|
|
2422
|
+
* With custom query options:
|
|
2423
|
+
* ```typescript
|
|
2424
|
+
* const { data } = usePrimarySaleItem({
|
|
2425
|
+
* chainId: 1,
|
|
2426
|
+
* primarySaleContractAddress: '0x...',
|
|
2427
|
+
* tokenId: '42',
|
|
2428
|
+
* query: {
|
|
2429
|
+
* enabled: Boolean(primarySaleContractAddress && tokenId),
|
|
2430
|
+
* staleTime: 30_000
|
|
2431
|
+
* }
|
|
2432
|
+
* })
|
|
2433
|
+
* ```
|
|
2434
|
+
*/
|
|
2435
|
+
function usePrimarySaleItem(params) {
|
|
2436
|
+
const defaultConfig = useConfig();
|
|
2437
|
+
const { config = defaultConfig,...rest } = params;
|
|
2438
|
+
const queryOptions$1 = primarySaleItemQueryOptions({
|
|
2439
|
+
config,
|
|
2440
|
+
...rest
|
|
2441
|
+
});
|
|
2442
|
+
return useQuery({ ...queryOptions$1 });
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2328
2445
|
//#endregion
|
|
2329
2446
|
//#region src/react/hooks/data/inventory/useInventory.tsx
|
|
2330
2447
|
function useInventory(args) {
|
|
2331
2448
|
const config = useConfig();
|
|
2332
|
-
|
|
2333
|
-
const isLaos721 = marketplaceConfig?.market?.collections?.find((c) => c.itemsAddress === args.collectionAddress && c.chainId === args.chainId)?.contractType === ContractType.LAOS_ERC_721;
|
|
2334
|
-
return useQuery(inventoryOptions({
|
|
2335
|
-
...args,
|
|
2336
|
-
isLaos721
|
|
2337
|
-
}, config));
|
|
2449
|
+
return useQuery(inventoryOptions({ ...args }, config));
|
|
2338
2450
|
}
|
|
2339
2451
|
|
|
2340
2452
|
//#endregion
|
|
@@ -2437,7 +2549,7 @@ function useAutoSelectFeeOption({ pendingFeeOptionConfirmation, enabled }) {
|
|
|
2437
2549
|
useEffect(() => {
|
|
2438
2550
|
if (combinedBalances) console.debug("currency balances", combinedBalances);
|
|
2439
2551
|
}, [combinedBalances]);
|
|
2440
|
-
|
|
2552
|
+
const autoSelectedOption = useCallback(async () => {
|
|
2441
2553
|
if (!userAddress) return {
|
|
2442
2554
|
selectedOption: null,
|
|
2443
2555
|
error: AutoSelectFeeOptionError.UserNotConnected
|
|
@@ -2475,7 +2587,8 @@ function useAutoSelectFeeOption({ pendingFeeOptionConfirmation, enabled }) {
|
|
|
2475
2587
|
isBalanceDetailsLoading,
|
|
2476
2588
|
isBalanceDetailsError,
|
|
2477
2589
|
combinedBalances
|
|
2478
|
-
])
|
|
2590
|
+
]);
|
|
2591
|
+
return autoSelectedOption();
|
|
2479
2592
|
}
|
|
2480
2593
|
|
|
2481
2594
|
//#endregion
|
|
@@ -2684,22 +2797,23 @@ const useEnsureCorrectChain = () => {
|
|
|
2684
2797
|
switchChainAsync,
|
|
2685
2798
|
showSwitchChainErrorModal
|
|
2686
2799
|
]);
|
|
2800
|
+
const ensureCorrectChain = useCallback((targetChainId, callbacks) => {
|
|
2801
|
+
if (currentChainId === targetChainId) {
|
|
2802
|
+
callbacks?.onSuccess?.();
|
|
2803
|
+
return;
|
|
2804
|
+
}
|
|
2805
|
+
switchChain({ chainId: targetChainId }, {
|
|
2806
|
+
onSuccess: callbacks?.onSuccess,
|
|
2807
|
+
onError: () => showSwitchChainErrorModal({ chainIdToSwitchTo: targetChainId })
|
|
2808
|
+
});
|
|
2809
|
+
}, [
|
|
2810
|
+
currentChainId,
|
|
2811
|
+
isWaaS,
|
|
2812
|
+
switchChain,
|
|
2813
|
+
showSwitchChainErrorModal
|
|
2814
|
+
]);
|
|
2687
2815
|
return {
|
|
2688
|
-
ensureCorrectChain
|
|
2689
|
-
if (currentChainId === targetChainId) {
|
|
2690
|
-
callbacks?.onSuccess?.();
|
|
2691
|
-
return;
|
|
2692
|
-
}
|
|
2693
|
-
switchChain({ chainId: targetChainId }, {
|
|
2694
|
-
onSuccess: callbacks?.onSuccess,
|
|
2695
|
-
onError: () => showSwitchChainErrorModal({ chainIdToSwitchTo: targetChainId })
|
|
2696
|
-
});
|
|
2697
|
-
}, [
|
|
2698
|
-
currentChainId,
|
|
2699
|
-
isWaaS,
|
|
2700
|
-
switchChain,
|
|
2701
|
-
showSwitchChainErrorModal
|
|
2702
|
-
]),
|
|
2816
|
+
ensureCorrectChain,
|
|
2703
2817
|
ensureCorrectChainAsync,
|
|
2704
2818
|
currentChainId
|
|
2705
2819
|
};
|
|
@@ -2708,7 +2822,8 @@ const useEnsureCorrectChain = () => {
|
|
|
2708
2822
|
//#endregion
|
|
2709
2823
|
//#region src/react/hooks/transactions/useGenerateCancelTransaction.tsx
|
|
2710
2824
|
const generateCancelTransaction = async (args, config) => {
|
|
2711
|
-
|
|
2825
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
2826
|
+
return marketplaceClient.generateCancelTransaction({
|
|
2712
2827
|
...args,
|
|
2713
2828
|
chainId: String(args.chainId)
|
|
2714
2829
|
}).then((data) => data.steps);
|
|
@@ -2752,9 +2867,8 @@ const useProcessStep = () => {
|
|
|
2752
2867
|
const config = useConfig();
|
|
2753
2868
|
const marketplaceClient = getMarketplaceClient(config);
|
|
2754
2869
|
const processStep = async (step, chainId) => {
|
|
2755
|
-
if (isTransactionStep(step))
|
|
2756
|
-
|
|
2757
|
-
hash: await sendTransactionAsync({
|
|
2870
|
+
if (isTransactionStep(step)) {
|
|
2871
|
+
const hash = await sendTransactionAsync({
|
|
2758
2872
|
chainId,
|
|
2759
2873
|
to: step.to,
|
|
2760
2874
|
data: step.data,
|
|
@@ -2762,8 +2876,12 @@ const useProcessStep = () => {
|
|
|
2762
2876
|
...step.maxFeePerGas && { maxFeePerGas: hexToBigInt(step.maxFeePerGas) },
|
|
2763
2877
|
...step.maxPriorityFeePerGas && { maxPriorityFeePerGas: hexToBigInt(step.maxPriorityFeePerGas) },
|
|
2764
2878
|
...step.gas && { gas: hexToBigInt(step.gas) }
|
|
2765
|
-
})
|
|
2766
|
-
|
|
2879
|
+
});
|
|
2880
|
+
return {
|
|
2881
|
+
type: "transaction",
|
|
2882
|
+
hash
|
|
2883
|
+
};
|
|
2884
|
+
}
|
|
2767
2885
|
if (isSignatureStep(step)) {
|
|
2768
2886
|
let signature;
|
|
2769
2887
|
if (step.id === StepType.signEIP191) {
|
|
@@ -2779,17 +2897,20 @@ const useProcessStep = () => {
|
|
|
2779
2897
|
});
|
|
2780
2898
|
}
|
|
2781
2899
|
if (!signature) throw new Error("Failed to sign message");
|
|
2782
|
-
if (step.post)
|
|
2783
|
-
|
|
2784
|
-
orderId: (await marketplaceClient.execute({
|
|
2900
|
+
if (step.post) {
|
|
2901
|
+
const result = await marketplaceClient.execute({ params: {
|
|
2785
2902
|
chainId: String(chainId),
|
|
2786
2903
|
signature,
|
|
2787
2904
|
method: step.post.method,
|
|
2788
2905
|
endpoint: step.post.endpoint,
|
|
2789
2906
|
body: step.post.body,
|
|
2790
2907
|
executeType: ExecuteType.order
|
|
2791
|
-
})
|
|
2792
|
-
|
|
2908
|
+
} });
|
|
2909
|
+
return {
|
|
2910
|
+
type: "signature",
|
|
2911
|
+
orderId: result.orderId
|
|
2912
|
+
};
|
|
2913
|
+
}
|
|
2793
2914
|
return {
|
|
2794
2915
|
type: "signature",
|
|
2795
2916
|
signature
|
|
@@ -2812,13 +2933,14 @@ const useCancelTransactionSteps = ({ collectionAddress, chainId, callbacks, setS
|
|
|
2812
2933
|
try {
|
|
2813
2934
|
if (!address) throw new NoWalletConnectedError();
|
|
2814
2935
|
if (!address) throw new Error("Wallet address not found");
|
|
2815
|
-
|
|
2936
|
+
const steps$2 = await generateCancelTransactionAsync({
|
|
2816
2937
|
chainId,
|
|
2817
2938
|
collectionAddress,
|
|
2818
2939
|
maker: address,
|
|
2819
2940
|
marketplace,
|
|
2820
2941
|
orderId
|
|
2821
2942
|
});
|
|
2943
|
+
return steps$2;
|
|
2822
2944
|
} catch (error) {
|
|
2823
2945
|
if (callbacks?.onError) callbacks.onError(error);
|
|
2824
2946
|
else console.debug("onError callback not provided:", error);
|
|
@@ -2973,7 +3095,8 @@ const generateListingTransaction = async (params, config) => {
|
|
|
2973
3095
|
expiry: dateToUnixTime(params.listing.expiry)
|
|
2974
3096
|
}
|
|
2975
3097
|
};
|
|
2976
|
-
|
|
3098
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
3099
|
+
return (await marketplaceClient.generateListingTransaction(args)).steps;
|
|
2977
3100
|
};
|
|
2978
3101
|
const useGenerateListingTransaction = (params) => {
|
|
2979
3102
|
const config = useConfig();
|
|
@@ -3003,7 +3126,8 @@ const generateOfferTransaction = async (params, config, walletKind) => {
|
|
|
3003
3126
|
},
|
|
3004
3127
|
walletType: walletKind
|
|
3005
3128
|
};
|
|
3006
|
-
|
|
3129
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
3130
|
+
return (await marketplaceClient.generateOfferTransaction(args)).steps;
|
|
3007
3131
|
};
|
|
3008
3132
|
const useGenerateOfferTransaction = (params) => {
|
|
3009
3133
|
const config = useConfig();
|
|
@@ -3101,7 +3225,7 @@ const useTransactionOperations = () => {
|
|
|
3101
3225
|
} catch (e) {
|
|
3102
3226
|
const error = e;
|
|
3103
3227
|
logger.error("Chain switch failed", error);
|
|
3104
|
-
if (error.name === "UserRejectedRequestError") throw new UserRejectedRequestError
|
|
3228
|
+
if (error.name === "UserRejectedRequestError") throw new UserRejectedRequestError();
|
|
3105
3229
|
throw new ChainSwitchError(0, chainId);
|
|
3106
3230
|
}
|
|
3107
3231
|
};
|
|
@@ -3127,8 +3251,9 @@ const useTransactionOperations = () => {
|
|
|
3127
3251
|
} catch (e) {
|
|
3128
3252
|
const error = e;
|
|
3129
3253
|
logger.error("Signature failed", error);
|
|
3130
|
-
if (error.cause instanceof BaseError) {
|
|
3131
|
-
|
|
3254
|
+
if (error.cause instanceof BaseError$1) {
|
|
3255
|
+
const viemError = error.cause;
|
|
3256
|
+
if (viemError instanceof UserRejectedRequestError$1) throw new UserRejectedRequestError();
|
|
3132
3257
|
}
|
|
3133
3258
|
throw new TransactionSignatureError(stepItem.id, error);
|
|
3134
3259
|
}
|
|
@@ -3152,8 +3277,9 @@ const useTransactionOperations = () => {
|
|
|
3152
3277
|
} catch (e) {
|
|
3153
3278
|
const error = e;
|
|
3154
3279
|
logger.error("Transaction failed", error);
|
|
3155
|
-
if (error.cause instanceof BaseError) {
|
|
3156
|
-
|
|
3280
|
+
if (error.cause instanceof BaseError$1) {
|
|
3281
|
+
const viemError = error.cause;
|
|
3282
|
+
if (viemError instanceof UserRejectedRequestError$1) throw new UserRejectedRequestError();
|
|
3157
3283
|
}
|
|
3158
3284
|
throw new TransactionExecutionError(stepItem.id || "unknown", error);
|
|
3159
3285
|
}
|
|
@@ -3537,7 +3663,8 @@ function useFiltersProgressive(params) {
|
|
|
3537
3663
|
//#endregion
|
|
3538
3664
|
//#region src/react/hooks/ui/useOpenConnectModal.tsx
|
|
3539
3665
|
const useOpenConnectModal$1 = () => {
|
|
3540
|
-
|
|
3666
|
+
const context = useConfig();
|
|
3667
|
+
return { openConnectModal: context.openConnectModal };
|
|
3541
3668
|
};
|
|
3542
3669
|
|
|
3543
3670
|
//#endregion
|
|
@@ -3815,10 +3942,12 @@ function useConvertPriceToUSD(params) {
|
|
|
3815
3942
|
*/
|
|
3816
3943
|
const useGetReceiptFromHash = () => {
|
|
3817
3944
|
const publicClient = usePublicClient();
|
|
3818
|
-
|
|
3945
|
+
const waitForReceipt = useCallback(async (transactionHash) => {
|
|
3819
3946
|
if (!publicClient) throw new Error("Public client not found");
|
|
3820
|
-
|
|
3821
|
-
|
|
3947
|
+
const receipt = await publicClient.waitForTransactionReceipt({ hash: transactionHash });
|
|
3948
|
+
return receipt;
|
|
3949
|
+
}, [publicClient]);
|
|
3950
|
+
return { waitForReceipt };
|
|
3822
3951
|
};
|
|
3823
3952
|
|
|
3824
3953
|
//#endregion
|
|
@@ -4133,7 +4262,7 @@ const TransactionPreview = ({ orderId, price, collectionAddress, chainId, collec
|
|
|
4133
4262
|
chainId: Number(chainId),
|
|
4134
4263
|
size: "xs"
|
|
4135
4264
|
}),
|
|
4136
|
-
isConfirming && /* @__PURE__ */ jsx(TimeAgo, { date:
|
|
4265
|
+
isConfirming && /* @__PURE__ */ jsx(TimeAgo, { date: new Date() })
|
|
4137
4266
|
]
|
|
4138
4267
|
}), /* @__PURE__ */ jsxs("div", {
|
|
4139
4268
|
className: "mt-2 flex items-center",
|
|
@@ -4221,7 +4350,7 @@ const useTransactionStatus = (hash, chainId, callbacks) => {
|
|
|
4221
4350
|
return;
|
|
4222
4351
|
}
|
|
4223
4352
|
setStatus("FAILED");
|
|
4224
|
-
callbacks?.onError?.(
|
|
4353
|
+
callbacks?.onError?.(new Error("Transaction failed"));
|
|
4225
4354
|
}, [
|
|
4226
4355
|
confirmationResult,
|
|
4227
4356
|
error,
|
|
@@ -4301,7 +4430,8 @@ const useTransactionStatusModal = () => {
|
|
|
4301
4430
|
};
|
|
4302
4431
|
};
|
|
4303
4432
|
const TransactionStatusModal = () => {
|
|
4304
|
-
|
|
4433
|
+
const isOpen = useIsOpen$3();
|
|
4434
|
+
return isOpen ? /* @__PURE__ */ jsx(TransactionStatusModalContent, {}) : null;
|
|
4305
4435
|
};
|
|
4306
4436
|
function TransactionStatusModalContent() {
|
|
4307
4437
|
const { transactionType: type, hash, orderId, price, collectionAddress, chainId, collectibleId, callbacks, queriesToInvalidate } = useTransactionModalState();
|
|
@@ -4419,8 +4549,8 @@ const initialContext$2 = {
|
|
|
4419
4549
|
isOpen: false,
|
|
4420
4550
|
props: null,
|
|
4421
4551
|
buyAnalyticsId: "",
|
|
4422
|
-
onError: (
|
|
4423
|
-
onSuccess: (
|
|
4552
|
+
onError: () => {},
|
|
4553
|
+
onSuccess: () => {},
|
|
4424
4554
|
quantity: null,
|
|
4425
4555
|
modalState: "idle",
|
|
4426
4556
|
paymentModalState: "idle",
|
|
@@ -4614,7 +4744,8 @@ const useMarketPlatformFee = (params) => {
|
|
|
4614
4744
|
};
|
|
4615
4745
|
const { chainId, collectionAddress } = params;
|
|
4616
4746
|
const marketCollection = marketplaceConfig?.market?.collections?.find((col) => compareAddress(col.itemsAddress, collectionAddress) && String(col.chainId) === String(chainId));
|
|
4617
|
-
const
|
|
4747
|
+
const avalancheOrOptimism = chainId === avalanche.id || chainId === optimism.id;
|
|
4748
|
+
const receiver = avalancheOrOptimism ? avalancheAndOptimismPlatformFeeRecipient : defaultPlatformFeeRecipient;
|
|
4618
4749
|
const percentageToBPS = (percentage) => Number(percentage) * 1e4 / 100;
|
|
4619
4750
|
const feePercentage = marketCollection?.feePercentage ?? defaultFee;
|
|
4620
4751
|
return {
|
|
@@ -4652,14 +4783,15 @@ const useCheckoutOptions = (input) => {
|
|
|
4652
4783
|
}],
|
|
4653
4784
|
additionalFee: Number(fees.amount)
|
|
4654
4785
|
});
|
|
4655
|
-
const
|
|
4786
|
+
const orderResponse = await marketplaceClient.getOrders({
|
|
4656
4787
|
chainId: String(input.chainId),
|
|
4657
4788
|
input: [{
|
|
4658
4789
|
contractAddress: input.collectionAddress,
|
|
4659
4790
|
orderId: input.orderId,
|
|
4660
4791
|
marketplace: input.marketplace
|
|
4661
4792
|
}]
|
|
4662
|
-
})
|
|
4793
|
+
});
|
|
4794
|
+
const order = orderResponse.orders[0];
|
|
4663
4795
|
return {
|
|
4664
4796
|
...response.options,
|
|
4665
4797
|
order
|
|
@@ -4805,7 +4937,8 @@ function decodeERC20Approval(calldata) {
|
|
|
4805
4937
|
//#endregion
|
|
4806
4938
|
//#region src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts
|
|
4807
4939
|
const getBuyCollectableParams = async ({ chainId, collectionAddress, collectibleId, callbacks, priceCurrencyAddress, customCreditCardProviderCallback, config, address, marketplace, orderId, quantity, collectable, checkoutOptions, fee, skipNativeBalanceCheck, nativeTokenAddress, buyAnalyticsId, onRampProvider }) => {
|
|
4808
|
-
const
|
|
4940
|
+
const marketplaceClient = getMarketplaceClient(config);
|
|
4941
|
+
const { steps: steps$2 } = await marketplaceClient.generateBuyTransaction({
|
|
4809
4942
|
chainId: String(chainId),
|
|
4810
4943
|
collectionAddress,
|
|
4811
4944
|
buyer: address,
|
|
@@ -4823,15 +4956,6 @@ const getBuyCollectableParams = async ({ chainId, collectionAddress, collectible
|
|
|
4823
4956
|
const approvedSpenderAddress = approveStep ? decodeERC20Approval(approveStep.data).spender : void 0;
|
|
4824
4957
|
if (!buyStep) throw new Error("Buy step not found");
|
|
4825
4958
|
const creditCardProviders = customCreditCardProviderCallback ? ["custom"] : checkoutOptions.nftCheckout || [];
|
|
4826
|
-
const isTransakSupported = creditCardProviders.includes("transak");
|
|
4827
|
-
let transakContractId;
|
|
4828
|
-
if (isTransakSupported) {
|
|
4829
|
-
const transakContractIdResponse = await getSequenceApiClient(config).checkoutOptionsGetTransakContractID({
|
|
4830
|
-
chainId,
|
|
4831
|
-
contractAddress: buyStep.to
|
|
4832
|
-
});
|
|
4833
|
-
if (transakContractIdResponse.contractId !== "") transakContractId = transakContractIdResponse.contractId;
|
|
4834
|
-
}
|
|
4835
4959
|
return {
|
|
4836
4960
|
chain: chainId,
|
|
4837
4961
|
collectibles: [{
|
|
@@ -4858,7 +4982,8 @@ const getBuyCollectableParams = async ({ chainId, collectionAddress, collectible
|
|
|
4858
4982
|
},
|
|
4859
4983
|
onError: callbacks?.onError,
|
|
4860
4984
|
onClose: () => {
|
|
4861
|
-
|
|
4985
|
+
const queryClient = getQueryClient();
|
|
4986
|
+
queryClient.invalidateQueries({ predicate: (query) => !query.meta?.persistent });
|
|
4862
4987
|
buyModalStore.send({ type: "close" });
|
|
4863
4988
|
},
|
|
4864
4989
|
skipNativeBalanceCheck,
|
|
@@ -4867,7 +4992,6 @@ const getBuyCollectableParams = async ({ chainId, collectionAddress, collectible
|
|
|
4867
4992
|
customCreditCardProviderCallback(buyStep);
|
|
4868
4993
|
buyModalStore.send({ type: "close" });
|
|
4869
4994
|
} },
|
|
4870
|
-
...transakContractId && { transakConfig: { contractId: transakContractId } },
|
|
4871
4995
|
onRampProvider,
|
|
4872
4996
|
successActionButtons: callbacks?.successActionButtons
|
|
4873
4997
|
};
|
|
@@ -4887,6 +5011,7 @@ const usePaymentModalParams = (args) => {
|
|
|
4887
5011
|
const onSuccess = useOnSuccess();
|
|
4888
5012
|
const onError = useOnError();
|
|
4889
5013
|
const buyAnalyticsId = useBuyAnalyticsId();
|
|
5014
|
+
const queryEnabled = !!address && !!marketplace && !!collectable && !!checkoutOptions && !!priceCurrencyAddress && !!quantity && enabled;
|
|
4890
5015
|
return useQuery({
|
|
4891
5016
|
queryKey: [
|
|
4892
5017
|
"buyCollectableParams",
|
|
@@ -4894,7 +5019,7 @@ const usePaymentModalParams = (args) => {
|
|
|
4894
5019
|
args,
|
|
4895
5020
|
fee
|
|
4896
5021
|
],
|
|
4897
|
-
queryFn:
|
|
5022
|
+
queryFn: queryEnabled ? () => getBuyCollectableParams({
|
|
4898
5023
|
chainId,
|
|
4899
5024
|
config,
|
|
4900
5025
|
address,
|
|
@@ -5118,7 +5243,8 @@ const getERC721SalePaymentParams = async ({ chainId, address, salesContractAddre
|
|
|
5118
5243
|
},
|
|
5119
5244
|
onError: callbacks?.onError,
|
|
5120
5245
|
onClose: () => {
|
|
5121
|
-
|
|
5246
|
+
const queryClient = getQueryClient();
|
|
5247
|
+
queryClient.invalidateQueries({ predicate: (query) => !query.meta?.persistent });
|
|
5122
5248
|
buyModalStore.send({ type: "close" });
|
|
5123
5249
|
},
|
|
5124
5250
|
skipNativeBalanceCheck,
|
|
@@ -5141,9 +5267,10 @@ const useERC721SalePaymentParams = (args) => {
|
|
|
5141
5267
|
const onSuccess = useOnSuccess();
|
|
5142
5268
|
const onError = useOnError();
|
|
5143
5269
|
const buyModalProps = useBuyModalProps();
|
|
5270
|
+
const queryEnabled = enabled && !!address && !!salesContractAddress && !!collectionAddress && !!price && !!currencyAddress;
|
|
5144
5271
|
return useQuery({
|
|
5145
5272
|
queryKey: ["erc721SalePaymentParams", args],
|
|
5146
|
-
queryFn:
|
|
5273
|
+
queryFn: queryEnabled ? () => getERC721SalePaymentParams({
|
|
5147
5274
|
chainId,
|
|
5148
5275
|
address,
|
|
5149
5276
|
salesContractAddress,
|
|
@@ -5252,7 +5379,8 @@ function QuantityInput({ quantity, invalidQuantity, onQuantityChange, onInvalidQ
|
|
|
5252
5379
|
}
|
|
5253
5380
|
const dnValue = dn.from(value, decimals);
|
|
5254
5381
|
const isBiggerThanMax = dn.greaterThan(dnValue, dnMaxQuantity);
|
|
5255
|
-
|
|
5382
|
+
const isLessThanMin = dn.lessThan(dnValue, dnMin);
|
|
5383
|
+
if (isLessThanMin) {
|
|
5256
5384
|
setQuantity({
|
|
5257
5385
|
value,
|
|
5258
5386
|
isValid: false
|
|
@@ -5294,7 +5422,7 @@ function QuantityInput({ quantity, invalidQuantity, onQuantityChange, onInvalidQ
|
|
|
5294
5422
|
});
|
|
5295
5423
|
}
|
|
5296
5424
|
return /* @__PURE__ */ jsxs("div", {
|
|
5297
|
-
className: cn
|
|
5425
|
+
className: cn("flex w-full flex-col [&>label>div>div>div:has(:disabled):hover]:opacity-100 [&>label>div>div>div:has(:disabled)]:opacity-100 [&>label>div>div>div>input]:text-xs [&>label>div>div>div]:h-9 [&>label>div>div>div]:rounded [&>label>div>div>div]:pr-0 [&>label>div>div>div]:pl-3 [&>label>div>div>div]:text-xs [&>label]:gap-[2px]", className, disabled && "pointer-events-none opacity-50"),
|
|
5298
5426
|
children: [/* @__PURE__ */ jsx(NumericInput, {
|
|
5299
5427
|
className: "w-full pl-1",
|
|
5300
5428
|
name: "quantity",
|
|
@@ -5384,7 +5512,8 @@ const TotalPrice = ({ order, quantityStr, salePrice, chainId, cardType, quantity
|
|
|
5384
5512
|
let formattedPrice = "0";
|
|
5385
5513
|
const quantityForCalculation = parseUnits(quantityStr, quantityDecimals);
|
|
5386
5514
|
if (isMarket && currency && order) try {
|
|
5387
|
-
const
|
|
5515
|
+
const marketCollection = marketplaceConfig?.market?.collections?.find((col) => col.itemsAddress.toLowerCase() === order.collectionContractAddress.toLowerCase() && col.chainId === chainId);
|
|
5516
|
+
const marketplaceFeePercentage = marketCollection?.feePercentage ?? DEFAULT_MARKETPLACE_FEE_PERCENTAGE;
|
|
5388
5517
|
const totalPriceRaw = BigInt(order ? order.priceAmount : "0") * quantityForCalculation;
|
|
5389
5518
|
formattedPrice = formatPriceWithFee(totalPriceRaw, currency.decimals, marketplaceFeePercentage);
|
|
5390
5519
|
} catch (e) {
|
|
@@ -5538,41 +5667,42 @@ const useERC1155Checkout = ({ chainId, salesContractAddress, collectionAddress,
|
|
|
5538
5667
|
const onError = useOnError();
|
|
5539
5668
|
const saleAnalyticsId = useBuyAnalyticsId();
|
|
5540
5669
|
const buyModalProps = useBuyModalProps();
|
|
5670
|
+
const checkout = useERC1155SaleContractCheckout({
|
|
5671
|
+
chain: chainId,
|
|
5672
|
+
contractAddress: salesContractAddress,
|
|
5673
|
+
collectionAddress,
|
|
5674
|
+
items: [{
|
|
5675
|
+
...items[0],
|
|
5676
|
+
quantity: quantity?.toString() || "1"
|
|
5677
|
+
}],
|
|
5678
|
+
wallet: accountAddress ?? "",
|
|
5679
|
+
...checkoutOptions && { checkoutOptions },
|
|
5680
|
+
onSuccess: (txHash) => {
|
|
5681
|
+
if (txHash) onSuccess({ hash: txHash });
|
|
5682
|
+
},
|
|
5683
|
+
onError: (error) => {
|
|
5684
|
+
onError(error);
|
|
5685
|
+
},
|
|
5686
|
+
onClose: () => {
|
|
5687
|
+
const queryClient = getQueryClient();
|
|
5688
|
+
queryClient.invalidateQueries({ queryKey: balanceQueries.inventory });
|
|
5689
|
+
queryClient.invalidateQueries({
|
|
5690
|
+
queryKey: [...collectableKeys.userBalances],
|
|
5691
|
+
refetchType: "inactive"
|
|
5692
|
+
});
|
|
5693
|
+
queryClient.invalidateQueries({ queryKey: collectableKeys.listPrimarySaleItems });
|
|
5694
|
+
buyModalStore.send({ type: "close" });
|
|
5695
|
+
},
|
|
5696
|
+
customProviderCallback,
|
|
5697
|
+
supplementaryAnalyticsInfo: {
|
|
5698
|
+
marketplaceType: "shop",
|
|
5699
|
+
saleAnalyticsId
|
|
5700
|
+
},
|
|
5701
|
+
successActionButtons: buyModalProps.successActionButtons,
|
|
5702
|
+
...buyModalProps.onRampProvider && { onRampProvider: buyModalProps.onRampProvider }
|
|
5703
|
+
});
|
|
5541
5704
|
return {
|
|
5542
|
-
...
|
|
5543
|
-
chain: chainId,
|
|
5544
|
-
contractAddress: salesContractAddress,
|
|
5545
|
-
collectionAddress,
|
|
5546
|
-
items: [{
|
|
5547
|
-
...items[0],
|
|
5548
|
-
quantity: quantity?.toString() || "1"
|
|
5549
|
-
}],
|
|
5550
|
-
wallet: accountAddress ?? "",
|
|
5551
|
-
...checkoutOptions && { checkoutOptions },
|
|
5552
|
-
onSuccess: (txHash) => {
|
|
5553
|
-
if (txHash) onSuccess({ hash: txHash });
|
|
5554
|
-
},
|
|
5555
|
-
onError: (error) => {
|
|
5556
|
-
onError(error);
|
|
5557
|
-
},
|
|
5558
|
-
onClose: () => {
|
|
5559
|
-
const queryClient = getQueryClient();
|
|
5560
|
-
queryClient.invalidateQueries({ queryKey: balanceQueries.inventory });
|
|
5561
|
-
queryClient.invalidateQueries({
|
|
5562
|
-
queryKey: [...collectableKeys.userBalances],
|
|
5563
|
-
refetchType: "inactive"
|
|
5564
|
-
});
|
|
5565
|
-
queryClient.invalidateQueries({ queryKey: collectableKeys.listPrimarySaleItems });
|
|
5566
|
-
buyModalStore.send({ type: "close" });
|
|
5567
|
-
},
|
|
5568
|
-
customProviderCallback,
|
|
5569
|
-
supplementaryAnalyticsInfo: {
|
|
5570
|
-
marketplaceType: "shop",
|
|
5571
|
-
saleAnalyticsId
|
|
5572
|
-
},
|
|
5573
|
-
successActionButtons: buyModalProps.successActionButtons,
|
|
5574
|
-
...buyModalProps.onRampProvider && { onRampProvider: buyModalProps.onRampProvider }
|
|
5575
|
-
}),
|
|
5705
|
+
...checkout,
|
|
5576
5706
|
isEnabled: Boolean(enabled && accountAddress)
|
|
5577
5707
|
};
|
|
5578
5708
|
};
|
|
@@ -5724,7 +5854,7 @@ const BuyModalRouter = () => {
|
|
|
5724
5854
|
});
|
|
5725
5855
|
}
|
|
5726
5856
|
}
|
|
5727
|
-
onError(
|
|
5857
|
+
onError(new Error(`Unsupported configuration: ${collection.type} in ${isShop ? "shop" : "market"} mode`));
|
|
5728
5858
|
return /* @__PURE__ */ jsx(ErrorModal, {
|
|
5729
5859
|
isOpen: true,
|
|
5730
5860
|
chainId,
|
|
@@ -5736,7 +5866,8 @@ const BuyModalRouter = () => {
|
|
|
5736
5866
|
//#endregion
|
|
5737
5867
|
//#region src/react/ui/modals/BuyModal/components/Modal.tsx
|
|
5738
5868
|
const BuyModal = () => {
|
|
5739
|
-
|
|
5869
|
+
const isOpen = useIsOpen$2();
|
|
5870
|
+
if (!isOpen) return null;
|
|
5740
5871
|
return /* @__PURE__ */ jsx(BuyModalRouter, {});
|
|
5741
5872
|
};
|
|
5742
5873
|
|
|
@@ -5745,7 +5876,7 @@ const BuyModal = () => {
|
|
|
5745
5876
|
function Calendar({ ...props }) {
|
|
5746
5877
|
const { selectedDate, setSelectedDate } = props;
|
|
5747
5878
|
return /* @__PURE__ */ jsx(DayPicker, {
|
|
5748
|
-
disabled: { before:
|
|
5879
|
+
disabled: { before: new Date() },
|
|
5749
5880
|
selected: selectedDate,
|
|
5750
5881
|
onDayClick: setSelectedDate,
|
|
5751
5882
|
defaultMonth: selectedDate,
|
|
@@ -5793,14 +5924,15 @@ function TimeSelector({ selectedDate, onTimeChange }) {
|
|
|
5793
5924
|
const currentMinutes = getMinutes(selectedDate);
|
|
5794
5925
|
const commitChange = () => {
|
|
5795
5926
|
if (!draft) return;
|
|
5796
|
-
const now =
|
|
5927
|
+
const now = new Date();
|
|
5797
5928
|
const parse = (val, fallback) => {
|
|
5798
5929
|
const n = Number.parseInt(val, 10);
|
|
5799
5930
|
return Number.isNaN(n) ? fallback : n;
|
|
5800
5931
|
};
|
|
5801
5932
|
let h = clamp(parse(draft.hours, currentHours), 0, 23);
|
|
5802
5933
|
let m = clamp(parse(draft.minutes, currentMinutes), 0, 59);
|
|
5803
|
-
|
|
5934
|
+
const newDate = setMinutes(setHours(selectedDate, h), m);
|
|
5935
|
+
if (newDate < now) {
|
|
5804
5936
|
h = getHours(now);
|
|
5805
5937
|
m = getMinutes(now);
|
|
5806
5938
|
}
|
|
@@ -5875,7 +6007,7 @@ function TimeSelector({ selectedDate, onTimeChange }) {
|
|
|
5875
6007
|
* Determines if the selected date matches a preset range
|
|
5876
6008
|
*/
|
|
5877
6009
|
function getMatchingPreset(selectedDate) {
|
|
5878
|
-
const today = startOfDay(
|
|
6010
|
+
const today = startOfDay(new Date());
|
|
5879
6011
|
const selectedDay = startOfDay(selectedDate);
|
|
5880
6012
|
const daysDifference = differenceInDays(selectedDay, today);
|
|
5881
6013
|
if (isSameDay(selectedDay, today)) return PRESET_RANGES.TODAY.value;
|
|
@@ -5931,7 +6063,7 @@ function CalendarDropdown({ selectedDate, setSelectedDate, onSelectPreset, isOpe
|
|
|
5931
6063
|
selectedDate,
|
|
5932
6064
|
setSelectedDate: (date) => {
|
|
5933
6065
|
const newDate = new Date(date);
|
|
5934
|
-
const today = startOfDay(
|
|
6066
|
+
const today = startOfDay(new Date());
|
|
5935
6067
|
const selectedDay = startOfDay(newDate);
|
|
5936
6068
|
if (isSameDay(selectedDay, today)) setSelectedDate(endOfDay(newDate));
|
|
5937
6069
|
else {
|
|
@@ -5984,7 +6116,7 @@ const ExpirationDateSelect = function ExpirationDateSelect$1({ className, date,
|
|
|
5984
6116
|
function handleSelectPresetRange(range) {
|
|
5985
6117
|
const presetRange = Object.values(PRESET_RANGES).find((preset) => preset.value === range);
|
|
5986
6118
|
if (!presetRange) return;
|
|
5987
|
-
const baseDate =
|
|
6119
|
+
const baseDate = new Date();
|
|
5988
6120
|
const targetDate = presetRange.value === "today" ? baseDate : addDays(baseDate, presetRange.offset);
|
|
5989
6121
|
const newDate = presetRange.value === "today" ? endOfDay(targetDate) : (() => {
|
|
5990
6122
|
const preservedTimeDate = new Date(targetDate);
|
|
@@ -5998,7 +6130,7 @@ const ExpirationDateSelect = function ExpirationDateSelect$1({ className, date,
|
|
|
5998
6130
|
}
|
|
5999
6131
|
if (!date) return /* @__PURE__ */ jsx(Skeleton, { className: "mr-3 h-7 w-20 rounded-2xl" });
|
|
6000
6132
|
return /* @__PURE__ */ jsxs("div", {
|
|
6001
|
-
className: cn
|
|
6133
|
+
className: cn("relative w-full", disabled && "pointer-events-none opacity-50"),
|
|
6002
6134
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
6003
6135
|
className: "w-full text-left font-body font-medium text-xs",
|
|
6004
6136
|
fontWeight: "medium",
|
|
@@ -6049,7 +6181,7 @@ function FloorPriceText({ chainId, collectionAddress, tokenId, price, onBuyNow }
|
|
|
6049
6181
|
showBuyNowButton = true;
|
|
6050
6182
|
}
|
|
6051
6183
|
return /* @__PURE__ */ jsxs("div", {
|
|
6052
|
-
className: "flex w-full items-center justify-between gap-2",
|
|
6184
|
+
className: "flex w-full flex-wrap items-center justify-between gap-2",
|
|
6053
6185
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
6054
6186
|
className: "text-left font-body font-medium text-muted text-xs",
|
|
6055
6187
|
children: floorPriceDifferenceText
|
|
@@ -6250,394 +6382,6 @@ const CustomSelect = ({ items, onValueChange, defaultValue, placeholder = "Selec
|
|
|
6250
6382
|
}) })] });
|
|
6251
6383
|
};
|
|
6252
6384
|
|
|
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
|
-
|
|
6641
6385
|
//#endregion
|
|
6642
6386
|
//#region src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx
|
|
6643
6387
|
function CurrencyOptionsSelect({ chainId, collectionAddress, secondCurrencyAsDefault, selectedCurrency, onCurrencyChange, includeNativeCurrency, orderbookKind, modalType }) {
|
|
@@ -6647,10 +6391,11 @@ function CurrencyOptionsSelect({ chainId, collectionAddress, secondCurrencyAsDef
|
|
|
6647
6391
|
includeNativeCurrency
|
|
6648
6392
|
});
|
|
6649
6393
|
let filteredCurrencies = currencies;
|
|
6650
|
-
if (currencies && orderbookKind === OrderbookKind.opensea && modalType) {
|
|
6651
|
-
|
|
6652
|
-
if (
|
|
6653
|
-
|
|
6394
|
+
if (currencies && orderbookKind === OrderbookKind.opensea && modalType) filteredCurrencies = currencies.filter((currency) => {
|
|
6395
|
+
if (modalType === "listing") return currency.openseaListing;
|
|
6396
|
+
if (modalType === "offer") return currency.openseaOffer;
|
|
6397
|
+
return false;
|
|
6398
|
+
});
|
|
6654
6399
|
useEffect(() => {
|
|
6655
6400
|
if (filteredCurrencies && filteredCurrencies.length > 0 && !selectedCurrency?.contractAddress) if (secondCurrencyAsDefault && filteredCurrencies.length > 1) onCurrencyChange(filteredCurrencies[1]);
|
|
6656
6401
|
else onCurrencyChange(filteredCurrencies[0]);
|
|
@@ -6670,6 +6415,7 @@ function CurrencyOptionsSelect({ chainId, collectionAddress, secondCurrencyAsDef
|
|
|
6670
6415
|
const selectedCurrency$1 = filteredCurrencies.find((currency) => currency.contractAddress === value);
|
|
6671
6416
|
if (selectedCurrency$1) onCurrencyChange(selectedCurrency$1);
|
|
6672
6417
|
};
|
|
6418
|
+
const isDropdownDisabled = orderbookKind === OrderbookKind.opensea;
|
|
6673
6419
|
return /* @__PURE__ */ jsx(CustomSelect, {
|
|
6674
6420
|
items: options,
|
|
6675
6421
|
onValueChange: onChange,
|
|
@@ -6677,6 +6423,7 @@ function CurrencyOptionsSelect({ chainId, collectionAddress, secondCurrencyAsDef
|
|
|
6677
6423
|
value: selectedCurrency.contractAddress,
|
|
6678
6424
|
content: selectedCurrency.symbol
|
|
6679
6425
|
},
|
|
6426
|
+
disabled: isDropdownDisabled,
|
|
6680
6427
|
testId: "currency-select"
|
|
6681
6428
|
});
|
|
6682
6429
|
}
|
|
@@ -6684,7 +6431,7 @@ var currencyOptionsSelect_default = CurrencyOptionsSelect;
|
|
|
6684
6431
|
|
|
6685
6432
|
//#endregion
|
|
6686
6433
|
//#region src/react/ui/modals/_internal/components/priceInput/index.tsx
|
|
6687
|
-
function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurrencyChange, checkBalance, secondCurrencyAsDefault, includeNativeCurrency, disabled, orderbookKind, setOpenseaLowestPriceCriteriaMet, modalType }) {
|
|
6434
|
+
function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurrencyChange, checkBalance, secondCurrencyAsDefault, includeNativeCurrency, disabled, orderbookKind, setOpenseaLowestPriceCriteriaMet, modalType, feeData }) {
|
|
6688
6435
|
const { address: accountAddress } = useAccount();
|
|
6689
6436
|
const inputRef = useRef(null);
|
|
6690
6437
|
const currency = price?.currency;
|
|
@@ -6708,12 +6455,47 @@ function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurren
|
|
|
6708
6455
|
chainId,
|
|
6709
6456
|
userAddress: accountAddress
|
|
6710
6457
|
});
|
|
6711
|
-
const
|
|
6458
|
+
const getTotalRequiredBalance = () => {
|
|
6459
|
+
if (!priceAmountRaw || !currencyDecimals) return BigInt(0);
|
|
6460
|
+
const offerAmountRaw = BigInt(priceAmountRaw);
|
|
6461
|
+
if (modalType === "offer" && feeData) return calculateTotalOfferCost(offerAmountRaw, currencyDecimals, feeData.royaltyPercentage || 0);
|
|
6462
|
+
return offerAmountRaw;
|
|
6463
|
+
};
|
|
6464
|
+
const balanceError = !!checkBalance?.enabled && !!isBalanceSuccess && !!priceAmountRaw && !!currencyDecimals && getTotalRequiredBalance() > BigInt(balance?.value || 0n);
|
|
6465
|
+
const hasEnoughForBaseOffer = !!isBalanceSuccess && !!priceAmountRaw && BigInt(priceAmountRaw) <= BigInt(balance?.value || 0n);
|
|
6466
|
+
const getRoyaltyFeeAmount = () => {
|
|
6467
|
+
if (!priceAmountRaw || !currencyDecimals || !feeData?.royaltyPercentage) return null;
|
|
6468
|
+
const offerAmount = BigInt(priceAmountRaw);
|
|
6469
|
+
const royaltyFeeAmount = offerAmount * BigInt(Math.round(feeData.royaltyPercentage * 100)) / BigInt(1e4);
|
|
6470
|
+
return formatUnits(royaltyFeeAmount, currencyDecimals);
|
|
6471
|
+
};
|
|
6472
|
+
const royaltyFeeFormatted = getRoyaltyFeeAmount();
|
|
6473
|
+
const RoyaltyFeeTooltip = ({ children }) => /* @__PURE__ */ jsx(Tooltip, {
|
|
6474
|
+
message: /* @__PURE__ */ jsxs("div", {
|
|
6475
|
+
className: "flex flex-col gap-1",
|
|
6476
|
+
children: [
|
|
6477
|
+
/* @__PURE__ */ jsx(Text, {
|
|
6478
|
+
className: "font-body font-medium text-xs",
|
|
6479
|
+
children: "A royalty fee is a percentage of each resale"
|
|
6480
|
+
}),
|
|
6481
|
+
/* @__PURE__ */ jsx(Text, {
|
|
6482
|
+
className: "font-body font-medium text-xs",
|
|
6483
|
+
children: "price that automatically compensates the original"
|
|
6484
|
+
}),
|
|
6485
|
+
/* @__PURE__ */ jsx(Text, {
|
|
6486
|
+
className: "font-body font-medium text-xs",
|
|
6487
|
+
children: "creator every time their collectible changes hands."
|
|
6488
|
+
})
|
|
6489
|
+
]
|
|
6490
|
+
}),
|
|
6491
|
+
children
|
|
6492
|
+
});
|
|
6712
6493
|
const openseaLowestPriceCriteriaMet = orderbookKind === OrderbookKind.opensea && !!conversion?.usdAmount && conversion.usdAmount >= .01;
|
|
6713
6494
|
if (checkBalance?.enabled) checkBalance.callback(balanceError);
|
|
6714
6495
|
if (setOpenseaLowestPriceCriteriaMet) setOpenseaLowestPriceCriteriaMet(openseaLowestPriceCriteriaMet);
|
|
6715
6496
|
const [value, setValue] = useState("0");
|
|
6716
6497
|
const prevCurrencyDecimals = useRef(currencyDecimals);
|
|
6498
|
+
const [openseaDecimalError, setOpenseaDecimalError] = useState(null);
|
|
6717
6499
|
useEffect(() => {
|
|
6718
6500
|
if (prevCurrencyDecimals.current !== currencyDecimals && value !== "0" && price && onPriceChange) try {
|
|
6719
6501
|
const parsedAmount = parseUnits(value, Number(currencyDecimals));
|
|
@@ -6740,6 +6522,28 @@ function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurren
|
|
|
6740
6522
|
const newValue = event.target.value;
|
|
6741
6523
|
setValue(newValue);
|
|
6742
6524
|
if (!price || !onPriceChange) return;
|
|
6525
|
+
if (orderbookKind === OrderbookKind.opensea && modalType === "offer") {
|
|
6526
|
+
const validation = validateOpenseaOfferDecimals(newValue);
|
|
6527
|
+
if (!validation.isValid) {
|
|
6528
|
+
setOpenseaDecimalError(validation.errorMessage || null);
|
|
6529
|
+
try {
|
|
6530
|
+
const parsedAmount = parseUnits(newValue, Number(currencyDecimals));
|
|
6531
|
+
const updatedPrice = {
|
|
6532
|
+
...price,
|
|
6533
|
+
amountRaw: parsedAmount.toString()
|
|
6534
|
+
};
|
|
6535
|
+
onPriceChange(updatedPrice);
|
|
6536
|
+
} catch {
|
|
6537
|
+
const updatedPrice = {
|
|
6538
|
+
...price,
|
|
6539
|
+
amountRaw: "0"
|
|
6540
|
+
};
|
|
6541
|
+
onPriceChange(updatedPrice);
|
|
6542
|
+
}
|
|
6543
|
+
return;
|
|
6544
|
+
}
|
|
6545
|
+
setOpenseaDecimalError(null);
|
|
6546
|
+
}
|
|
6743
6547
|
try {
|
|
6744
6548
|
const parsedAmount = parseUnits(newValue, Number(currencyDecimals));
|
|
6745
6549
|
const updatedPrice = {
|
|
@@ -6756,7 +6560,7 @@ function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurren
|
|
|
6756
6560
|
}
|
|
6757
6561
|
};
|
|
6758
6562
|
return /* @__PURE__ */ jsxs("div", {
|
|
6759
|
-
className: cn
|
|
6563
|
+
className: cn("price-input relative flex w-full flex-col", disabled && "pointer-events-none opacity-50"),
|
|
6760
6564
|
children: [
|
|
6761
6565
|
/* @__PURE__ */ jsx("div", {
|
|
6762
6566
|
className: "absolute top-8 left-2 flex items-center",
|
|
@@ -6785,15 +6589,58 @@ function PriceInput({ chainId, collectionAddress, price, onPriceChange, onCurren
|
|
|
6785
6589
|
onChange: handleChange
|
|
6786
6590
|
})
|
|
6787
6591
|
}),
|
|
6788
|
-
balanceError && /* @__PURE__ */ jsx(
|
|
6789
|
-
className: "-
|
|
6790
|
-
|
|
6791
|
-
|
|
6592
|
+
balanceError && /* @__PURE__ */ jsx("div", {
|
|
6593
|
+
className: "mt-2",
|
|
6594
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
6595
|
+
className: "font-body font-medium text-xs",
|
|
6596
|
+
color: "negative",
|
|
6597
|
+
children: modalType === "offer" && hasEnoughForBaseOffer && royaltyFeeFormatted && Number(royaltyFeeFormatted) > 0 ? /* @__PURE__ */ jsx(RoyaltyFeeTooltip, { children: /* @__PURE__ */ jsxs("div", {
|
|
6598
|
+
className: "flex items-center gap-1",
|
|
6599
|
+
children: [/* @__PURE__ */ jsx(InfoIcon, { className: "h-4 w-4 text-negative" }), /* @__PURE__ */ jsxs(Text, {
|
|
6600
|
+
className: "font-body font-medium text-xs",
|
|
6601
|
+
color: "negative",
|
|
6602
|
+
children: [
|
|
6603
|
+
"You need ",
|
|
6604
|
+
royaltyFeeFormatted,
|
|
6605
|
+
" ",
|
|
6606
|
+
currency?.symbol,
|
|
6607
|
+
" for royalty fees"
|
|
6608
|
+
]
|
|
6609
|
+
})]
|
|
6610
|
+
}) }) : "Insufficient balance"
|
|
6611
|
+
})
|
|
6792
6612
|
}),
|
|
6793
|
-
!balanceError &&
|
|
6613
|
+
!balanceError && modalType === "offer" && royaltyFeeFormatted && Number(royaltyFeeFormatted) > 0 && /* @__PURE__ */ jsx("div", {
|
|
6614
|
+
className: "mt-2",
|
|
6615
|
+
children: /* @__PURE__ */ jsx(RoyaltyFeeTooltip, { children: /* @__PURE__ */ jsxs("div", {
|
|
6616
|
+
className: "flex items-center gap-1",
|
|
6617
|
+
children: [/* @__PURE__ */ jsx(InfoIcon, { className: "h-4 w-4 text-text-50" }), /* @__PURE__ */ jsxs(Text, {
|
|
6618
|
+
className: "font-body font-medium text-xs",
|
|
6619
|
+
color: "text50",
|
|
6620
|
+
children: [
|
|
6621
|
+
"Total:",
|
|
6622
|
+
" ",
|
|
6623
|
+
(Number(value) + Number(royaltyFeeFormatted)).toFixed(6).replace(/\.?0+$/, ""),
|
|
6624
|
+
" ",
|
|
6625
|
+
currency?.symbol,
|
|
6626
|
+
" (includes ",
|
|
6627
|
+
royaltyFeeFormatted,
|
|
6628
|
+
" ",
|
|
6629
|
+
currency?.symbol,
|
|
6630
|
+
" royalty fee)"
|
|
6631
|
+
]
|
|
6632
|
+
})]
|
|
6633
|
+
}) })
|
|
6634
|
+
}),
|
|
6635
|
+
!balanceError && priceAmountRaw !== "0" && !openseaLowestPriceCriteriaMet && orderbookKind === OrderbookKind.opensea && !isConversionLoading && modalType === "offer" && !openseaDecimalError && /* @__PURE__ */ jsx(Text, {
|
|
6794
6636
|
className: "-bottom-5 absolute font-body font-medium text-xs",
|
|
6795
6637
|
color: "negative",
|
|
6796
6638
|
children: "Lowest price must be at least $0.01"
|
|
6639
|
+
}),
|
|
6640
|
+
!balanceError && openseaDecimalError && orderbookKind === OrderbookKind.opensea && modalType === "offer" && /* @__PURE__ */ jsx(Text, {
|
|
6641
|
+
className: "font-body font-medium text-xs",
|
|
6642
|
+
color: "negative",
|
|
6643
|
+
children: openseaDecimalError
|
|
6797
6644
|
})
|
|
6798
6645
|
]
|
|
6799
6646
|
});
|
|
@@ -7015,7 +6862,7 @@ const SelectWaasFeeOptions = ({ chainId, onCancel, titleOnConfirm, className })
|
|
|
7015
6862
|
const isSponsored = pendingFeeOptionConfirmation?.options?.length === 0;
|
|
7016
6863
|
if (!isVisible || isSponsored || !selectedFeeOption) return null;
|
|
7017
6864
|
return /* @__PURE__ */ jsxs("div", {
|
|
7018
|
-
className: cn
|
|
6865
|
+
className: cn("flex w-full flex-col gap-2 rounded-2xl bg-button-emphasis p-0 backdrop-blur-md", className),
|
|
7019
6866
|
children: [
|
|
7020
6867
|
/* @__PURE__ */ jsx(Divider, { className: "mt-0 mb-4" }),
|
|
7021
6868
|
/* @__PURE__ */ jsx(Text, {
|
|
@@ -7024,7 +6871,7 @@ const SelectWaasFeeOptions = ({ chainId, onCancel, titleOnConfirm, className })
|
|
|
7024
6871
|
}),
|
|
7025
6872
|
!feeOptionsConfirmed && !pendingFeeOptionConfirmation && /* @__PURE__ */ jsx(Skeleton, { className: "h-[52px] w-full animate-shimmer rounded-xl" }),
|
|
7026
6873
|
(feeOptionsConfirmed || pendingFeeOptionConfirmation) && /* @__PURE__ */ jsx("div", {
|
|
7027
|
-
className: cn
|
|
6874
|
+
className: cn("[&>label>button>span]:overflow-hidden [&>label>button]:w-full [&>label>button]:text-xs [&>label>div]:w-full [&>label]:flex [&>label]:w-full", feeOptionsConfirmed && "pointer-events-none opacity-70"),
|
|
7028
6875
|
children: /* @__PURE__ */ jsx(WaasFeeOptionsSelect_default, {
|
|
7029
6876
|
options: pendingFeeOptionConfirmation?.options || [selectedFeeOption],
|
|
7030
6877
|
selectedFeeOption,
|
|
@@ -7149,7 +6996,7 @@ function TransactionDetails({ collectibleId, collectionAddress, chainId, include
|
|
|
7149
6996
|
color: "text100",
|
|
7150
6997
|
children: ["0 ", price.currency.symbol]
|
|
7151
6998
|
}) : overflow.status ? /* @__PURE__ */ jsx(Tooltip, {
|
|
7152
|
-
message: formattedAmount
|
|
6999
|
+
message: `${formattedAmount} ${price.currency.symbol}`,
|
|
7153
7000
|
children: /* @__PURE__ */ jsxs("div", {
|
|
7154
7001
|
className: "flex items-center",
|
|
7155
7002
|
children: [/* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3 text-text-100" }), /* @__PURE__ */ jsxs(Text, {
|
|
@@ -7199,7 +7046,7 @@ const useSelectWaasFeeOptions = ({ isProcessing, feeOptionsVisible, selectedFeeO
|
|
|
7199
7046
|
|
|
7200
7047
|
//#endregion
|
|
7201
7048
|
//#region src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts
|
|
7202
|
-
const ONE_DAY_IN_SECONDS$1 =
|
|
7049
|
+
const ONE_DAY_IN_SECONDS$1 = 60 * 60 * 24;
|
|
7203
7050
|
const useGetTokenApprovalData$2 = (params) => {
|
|
7204
7051
|
const config = useConfig();
|
|
7205
7052
|
const { walletKind } = useConnectorMetadata();
|
|
@@ -7210,7 +7057,7 @@ const useGetTokenApprovalData$2 = (params) => {
|
|
|
7210
7057
|
quantity: "1",
|
|
7211
7058
|
currencyAddress: params.currencyAddress,
|
|
7212
7059
|
pricePerToken: "100000",
|
|
7213
|
-
expiry: String(Number(dateToUnixTime(
|
|
7060
|
+
expiry: String(Number(dateToUnixTime(new Date())) + ONE_DAY_IN_SECONDS$1)
|
|
7214
7061
|
};
|
|
7215
7062
|
const isEnabled = address && (params.query?.enabled ?? true) && !!params.currencyAddress;
|
|
7216
7063
|
const { data, isLoading, isSuccess, isError, error } = useQuery({
|
|
@@ -7230,7 +7077,8 @@ const useGetTokenApprovalData$2 = (params) => {
|
|
|
7230
7077
|
listing,
|
|
7231
7078
|
additionalFees: []
|
|
7232
7079
|
};
|
|
7233
|
-
const
|
|
7080
|
+
const steps$2 = await marketplaceClient.generateListingTransaction(args).then((resp) => resp.steps);
|
|
7081
|
+
const tokenApprovalStep = steps$2.find((step) => step.id === StepType.tokenApproval);
|
|
7234
7082
|
if (!tokenApprovalStep) return { step: null };
|
|
7235
7083
|
return { step: tokenApprovalStep };
|
|
7236
7084
|
} : skipToken
|
|
@@ -7249,12 +7097,13 @@ const useGetTokenApprovalData$2 = (params) => {
|
|
|
7249
7097
|
const getSequenceMarketplaceRequestId = async (hash, publicClient, walletAddress) => {
|
|
7250
7098
|
try {
|
|
7251
7099
|
const receipt = await publicClient.getTransactionReceipt({ hash });
|
|
7252
|
-
|
|
7100
|
+
const logs = parseEventLogs({
|
|
7253
7101
|
abi: SequenceMarketplaceV1_ABI,
|
|
7254
7102
|
eventName: "RequestCreated",
|
|
7255
7103
|
args: { creator: walletAddress },
|
|
7256
7104
|
logs: receipt.logs
|
|
7257
|
-
})
|
|
7105
|
+
});
|
|
7106
|
+
return logs[0].args.requestId.toString();
|
|
7258
7107
|
} catch (error) {
|
|
7259
7108
|
console.error(error);
|
|
7260
7109
|
}
|
|
@@ -7281,7 +7130,7 @@ const useTransactionSteps$2 = ({ listingInput, chainId, collectionAddress, order
|
|
|
7281
7130
|
const getListingSteps = async () => {
|
|
7282
7131
|
if (!address) return;
|
|
7283
7132
|
try {
|
|
7284
|
-
|
|
7133
|
+
const steps$2 = await generateListingTransactionAsync({
|
|
7285
7134
|
collectionAddress,
|
|
7286
7135
|
owner: address,
|
|
7287
7136
|
walletType: walletKind,
|
|
@@ -7289,10 +7138,11 @@ const useTransactionSteps$2 = ({ listingInput, chainId, collectionAddress, order
|
|
|
7289
7138
|
orderbook: orderbookKind,
|
|
7290
7139
|
listing: {
|
|
7291
7140
|
...listingInput.listing,
|
|
7292
|
-
expiry:
|
|
7141
|
+
expiry: new Date(Number(listingInput.listing.expiry) * 1e3)
|
|
7293
7142
|
},
|
|
7294
7143
|
additionalFees: []
|
|
7295
7144
|
});
|
|
7145
|
+
return steps$2;
|
|
7296
7146
|
} catch (error) {
|
|
7297
7147
|
if (callbacks?.onError) callbacks.onError(error);
|
|
7298
7148
|
else console.debug("onError callback not provided:", error);
|
|
@@ -7470,7 +7320,7 @@ const initialState$1 = {
|
|
|
7470
7320
|
listingPrice: { ...listingPrice },
|
|
7471
7321
|
quantity: "1",
|
|
7472
7322
|
invalidQuantity: false,
|
|
7473
|
-
expiry: new Date(addDays$1(
|
|
7323
|
+
expiry: new Date(addDays$1(new Date(), 7).toJSON()),
|
|
7474
7324
|
callbacks: void 0,
|
|
7475
7325
|
steps: { ...steps$1 },
|
|
7476
7326
|
listingIsBeingProcessed: false
|
|
@@ -7511,7 +7361,8 @@ const CreateListingModal = () => {
|
|
|
7511
7361
|
});
|
|
7512
7362
|
};
|
|
7513
7363
|
const Modal$3 = observer(() => {
|
|
7514
|
-
const
|
|
7364
|
+
const state = createListingModal$.get();
|
|
7365
|
+
const { collectionAddress, chainId, listingPrice: listingPrice$1, collectibleId, orderbookKind: orderbookKindProp, callbacks, listingIsBeingProcessed } = state;
|
|
7515
7366
|
const { data: marketplaceConfig } = useMarketplaceConfig();
|
|
7516
7367
|
const [error, setError] = useState(void 0);
|
|
7517
7368
|
const collectionConfig = marketplaceConfig?.market.collections.find((c) => c.itemsAddress === collectionAddress);
|
|
@@ -7546,7 +7397,7 @@ const Modal$3 = observer(() => {
|
|
|
7546
7397
|
collectableId: collectibleId,
|
|
7547
7398
|
userAddress: address ?? void 0
|
|
7548
7399
|
});
|
|
7549
|
-
const balanceWithDecimals = balance?.balance ?
|
|
7400
|
+
const balanceWithDecimals = balance?.balance ? dnum.toNumber(dnum.from([BigInt(balance.balance), collectible?.decimals || 0])) : 0;
|
|
7550
7401
|
const { isLoading, executeApproval, createListing, tokenApprovalIsLoading, isError: tokenApprovalIsError } = useCreateListing({
|
|
7551
7402
|
listingInput: {
|
|
7552
7403
|
contractType: collection?.type,
|
|
@@ -7709,7 +7560,7 @@ const useBuyModal = (callbacks) => {
|
|
|
7709
7560
|
|
|
7710
7561
|
//#endregion
|
|
7711
7562
|
//#region src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx
|
|
7712
|
-
const ONE_DAY_IN_SECONDS =
|
|
7563
|
+
const ONE_DAY_IN_SECONDS = 60 * 60 * 24;
|
|
7713
7564
|
const useGetTokenApprovalData$1 = (params) => {
|
|
7714
7565
|
const config = useConfig();
|
|
7715
7566
|
const { address } = useAccount();
|
|
@@ -7720,7 +7571,7 @@ const useGetTokenApprovalData$1 = (params) => {
|
|
|
7720
7571
|
quantity: "1",
|
|
7721
7572
|
currencyAddress: params.currencyAddress,
|
|
7722
7573
|
pricePerToken: "1",
|
|
7723
|
-
expiry: String(Number(dateToUnixTime(
|
|
7574
|
+
expiry: String(Number(dateToUnixTime(new Date())) + ONE_DAY_IN_SECONDS)
|
|
7724
7575
|
};
|
|
7725
7576
|
const isEnabled = address && params.query?.enabled !== false;
|
|
7726
7577
|
const { data, isLoading, isSuccess, isError, error } = useQuery({
|
|
@@ -7734,9 +7585,11 @@ const useGetTokenApprovalData$1 = (params) => {
|
|
|
7734
7585
|
contractType: params.contractType,
|
|
7735
7586
|
orderbook: params.orderbook,
|
|
7736
7587
|
offer,
|
|
7737
|
-
additionalFees: []
|
|
7588
|
+
additionalFees: [],
|
|
7589
|
+
offerType: OfferType.item
|
|
7738
7590
|
};
|
|
7739
|
-
const
|
|
7591
|
+
const steps$2 = await marketplaceClient.generateOfferTransaction(args).then((resp) => resp.steps);
|
|
7592
|
+
const tokenApprovalStep = steps$2.find((step) => step.id === StepType.tokenApproval);
|
|
7740
7593
|
if (!tokenApprovalStep) return { step: null };
|
|
7741
7594
|
return { step: tokenApprovalStep };
|
|
7742
7595
|
} : skipToken,
|
|
@@ -7774,7 +7627,7 @@ const useTransactionSteps$1 = ({ offerInput, chainId, collectionAddress, orderbo
|
|
|
7774
7627
|
const getOfferSteps = async () => {
|
|
7775
7628
|
if (!address) return;
|
|
7776
7629
|
try {
|
|
7777
|
-
|
|
7630
|
+
const steps$2 = await generateOfferTransactionAsync({
|
|
7778
7631
|
collectionAddress,
|
|
7779
7632
|
maker: address,
|
|
7780
7633
|
walletType: walletKind,
|
|
@@ -7782,10 +7635,12 @@ const useTransactionSteps$1 = ({ offerInput, chainId, collectionAddress, orderbo
|
|
|
7782
7635
|
orderbook: orderbookKind,
|
|
7783
7636
|
offer: {
|
|
7784
7637
|
...offerInput.offer,
|
|
7785
|
-
expiry:
|
|
7638
|
+
expiry: new Date(Number(offerInput.offer.expiry) * 1e3)
|
|
7786
7639
|
},
|
|
7787
|
-
additionalFees: []
|
|
7640
|
+
additionalFees: [],
|
|
7641
|
+
offerType: OfferType.item
|
|
7788
7642
|
});
|
|
7643
|
+
return steps$2;
|
|
7789
7644
|
} catch (error) {
|
|
7790
7645
|
if (callbacks?.onError) callbacks.onError(error);
|
|
7791
7646
|
else console.debug("onError callback not provided:", error);
|
|
@@ -7851,6 +7706,10 @@ const useTransactionSteps$1 = ({ offerInput, chainId, collectionAddress, orderbo
|
|
|
7851
7706
|
steps$.transaction.isExecuting.set(false);
|
|
7852
7707
|
steps$.transaction.exist.set(false);
|
|
7853
7708
|
}
|
|
7709
|
+
if (orderId) {
|
|
7710
|
+
steps$.transaction.isExecuting.set(false);
|
|
7711
|
+
steps$.transaction.exist.set(false);
|
|
7712
|
+
}
|
|
7854
7713
|
if (hash || orderId) {
|
|
7855
7714
|
const currencyDecimal = currency?.decimals || 0;
|
|
7856
7715
|
const currencyValueRaw = Number(offerInput.offer.pricePerToken);
|
|
@@ -7951,7 +7810,7 @@ const initialState = {
|
|
|
7951
7810
|
offerPriceChanged: false,
|
|
7952
7811
|
quantity: "1",
|
|
7953
7812
|
invalidQuantity: false,
|
|
7954
|
-
expiry: new Date(addDays$1(
|
|
7813
|
+
expiry: new Date(addDays$1(new Date(), 7).toJSON()),
|
|
7955
7814
|
collectionType: void 0,
|
|
7956
7815
|
steps: { ...steps },
|
|
7957
7816
|
offerIsBeingProcessed: false
|
|
@@ -7990,7 +7849,8 @@ const MakeOfferModal = () => {
|
|
|
7990
7849
|
});
|
|
7991
7850
|
};
|
|
7992
7851
|
const Modal$2 = observer(() => {
|
|
7993
|
-
const
|
|
7852
|
+
const state = makeOfferModal$.get();
|
|
7853
|
+
const { collectionAddress, chainId, offerPrice: offerPrice$1, offerPriceChanged, invalidQuantity, collectibleId, orderbookKind: orderbookKindProp, callbacks } = state;
|
|
7994
7854
|
const { data: marketplaceConfig } = useMarketplaceConfig();
|
|
7995
7855
|
const [error, setError] = useState(void 0);
|
|
7996
7856
|
const collectionConfig = marketplaceConfig?.market.collections.find((c) => c.itemsAddress === collectionAddress);
|
|
@@ -8017,9 +7877,15 @@ const Modal$2 = observer(() => {
|
|
|
8017
7877
|
});
|
|
8018
7878
|
const { data: currencies, isLoading: currenciesLoading, isError: currenciesIsError } = useMarketCurrencies({
|
|
8019
7879
|
chainId,
|
|
7880
|
+
collectionAddress,
|
|
8020
7881
|
includeNativeCurrency: false
|
|
8021
7882
|
});
|
|
8022
|
-
const
|
|
7883
|
+
const { data: royalty, isLoading: royaltyLoading } = useRoyalty({
|
|
7884
|
+
chainId,
|
|
7885
|
+
collectionAddress,
|
|
7886
|
+
collectibleId
|
|
7887
|
+
});
|
|
7888
|
+
const modalLoading = collectableIsLoading || collectionIsLoading || currenciesLoading || royaltyLoading;
|
|
8023
7889
|
const { isLoading, executeApproval, makeOffer, isError: approvalIsError } = useMakeOffer({
|
|
8024
7890
|
offerInput: {
|
|
8025
7891
|
contractType: collection?.type,
|
|
@@ -8051,7 +7917,8 @@ const Modal$2 = observer(() => {
|
|
|
8051
7917
|
onClose: makeOfferModal$.close,
|
|
8052
7918
|
title: "Make an offer"
|
|
8053
7919
|
});
|
|
8054
|
-
|
|
7920
|
+
const shouldShowNoERC20Error = !currenciesLoading && !currenciesIsError && (!currencies || currencies.length === 0);
|
|
7921
|
+
if (shouldShowNoERC20Error) return /* @__PURE__ */ jsx(ErrorModal, {
|
|
8055
7922
|
isOpen: makeOfferModal$.isOpen.get(),
|
|
8056
7923
|
chainId: Number(chainId),
|
|
8057
7924
|
onClose: makeOfferModal$.close,
|
|
@@ -8125,12 +7992,13 @@ const Modal$2 = observer(() => {
|
|
|
8125
7992
|
includeNativeCurrency: false,
|
|
8126
7993
|
checkBalance: {
|
|
8127
7994
|
enabled: true,
|
|
8128
|
-
callback: (state) => setInsufficientBalance(state)
|
|
7995
|
+
callback: (state$1) => setInsufficientBalance(state$1)
|
|
8129
7996
|
},
|
|
8130
|
-
setOpenseaLowestPriceCriteriaMet: (state) => setOpenseaLowestPriceCriteriaMet(state),
|
|
7997
|
+
setOpenseaLowestPriceCriteriaMet: (state$1) => setOpenseaLowestPriceCriteriaMet(state$1),
|
|
8131
7998
|
orderbookKind,
|
|
8132
7999
|
modalType: "offer",
|
|
8133
|
-
disabled: shouldHideOfferButton
|
|
8000
|
+
disabled: shouldHideOfferButton,
|
|
8001
|
+
feeData: { royaltyPercentage: royalty ? Number(royalty.percentage) : 0 }
|
|
8134
8002
|
}),
|
|
8135
8003
|
collection?.type === ContractType.ERC1155 && /* @__PURE__ */ jsx(QuantityInput, {
|
|
8136
8004
|
quantity: use$(makeOfferModal$.quantity),
|
|
@@ -8231,7 +8099,8 @@ const useGetTokenApprovalData = (params) => {
|
|
|
8231
8099
|
receiver
|
|
8232
8100
|
}]
|
|
8233
8101
|
};
|
|
8234
|
-
const
|
|
8102
|
+
const steps$2 = await marketplaceClient.generateSellTransaction(args).then((resp) => resp.steps);
|
|
8103
|
+
const tokenApprovalStep = steps$2.find((step) => step.id === StepType.tokenApproval);
|
|
8235
8104
|
if (!tokenApprovalStep) return { step: null };
|
|
8236
8105
|
return { step: tokenApprovalStep };
|
|
8237
8106
|
} : skipToken,
|
|
@@ -8269,7 +8138,7 @@ const useTransactionSteps = ({ collectibleId, chainId, collectionAddress, market
|
|
|
8269
8138
|
const getSellSteps = async () => {
|
|
8270
8139
|
if (!address) return;
|
|
8271
8140
|
try {
|
|
8272
|
-
|
|
8141
|
+
const steps$2 = await generateSellTransactionAsync({
|
|
8273
8142
|
collectionAddress,
|
|
8274
8143
|
walletType: walletKind,
|
|
8275
8144
|
marketplace,
|
|
@@ -8280,6 +8149,7 @@ const useTransactionSteps = ({ collectibleId, chainId, collectionAddress, market
|
|
|
8280
8149
|
}],
|
|
8281
8150
|
seller: address
|
|
8282
8151
|
});
|
|
8152
|
+
return steps$2;
|
|
8283
8153
|
} catch (error) {
|
|
8284
8154
|
if (callbacks?.onError) callbacks.onError(error);
|
|
8285
8155
|
else console.debug("onError callback not provided:", error);
|
|
@@ -8445,7 +8315,8 @@ const Modal$1 = observer(() => {
|
|
|
8445
8315
|
});
|
|
8446
8316
|
const { isWaaS } = useConnectorMetadata();
|
|
8447
8317
|
const { isVisible: feeOptionsVisible, selectedFeeOption } = useSelectWaasFeeOptionsStore();
|
|
8448
|
-
const
|
|
8318
|
+
const network = getNetwork(Number(chainId));
|
|
8319
|
+
const isTestnet = network.type === NetworkType.TESTNET;
|
|
8449
8320
|
const isProcessing = sellModal$.sellIsBeingProcessed.get();
|
|
8450
8321
|
const { shouldHideActionButton: shouldHideSellButton } = useSelectWaasFeeOptions({
|
|
8451
8322
|
isProcessing,
|
|
@@ -8799,12 +8670,13 @@ const TokenQuantityInput = ({ balanceAmount, collection, isProcessingWithWaaS })
|
|
|
8799
8670
|
const [invalidQuantity, setInvalidQuantity] = useState(false);
|
|
8800
8671
|
let insufficientBalance = true;
|
|
8801
8672
|
if (balanceAmount !== void 0 && modalState.quantity) try {
|
|
8802
|
-
|
|
8673
|
+
const quantityBigInt = BigInt(modalState.quantity);
|
|
8674
|
+
insufficientBalance = quantityBigInt > balanceAmount;
|
|
8803
8675
|
} catch (_e) {
|
|
8804
8676
|
insufficientBalance = true;
|
|
8805
8677
|
}
|
|
8806
8678
|
return /* @__PURE__ */ jsxs("div", {
|
|
8807
|
-
className: cn("flex flex-col gap-3", isProcessingWithWaaS && "pointer-events-none opacity-50"),
|
|
8679
|
+
className: cn$1("flex flex-col gap-3", isProcessingWithWaaS && "pointer-events-none opacity-50"),
|
|
8808
8680
|
children: [/* @__PURE__ */ jsx(QuantityInput, {
|
|
8809
8681
|
quantity: modalState.quantity,
|
|
8810
8682
|
invalidQuantity,
|
|
@@ -8877,7 +8749,8 @@ const MAX_WALLET_ADDRESS_LENGTH = 42;
|
|
|
8877
8749
|
const WalletAddressInput = () => {
|
|
8878
8750
|
const { address: connectedAddress } = useAccount();
|
|
8879
8751
|
const { receiverAddress, transferIsProcessing } = useModalState();
|
|
8880
|
-
const
|
|
8752
|
+
const isWalletAddressValid = isAddress(receiverAddress);
|
|
8753
|
+
const isSelfTransfer = isWalletAddressValid && connectedAddress && receiverAddress.toLowerCase() === connectedAddress.toLowerCase();
|
|
8881
8754
|
const handleChangeWalletAddress = (event) => {
|
|
8882
8755
|
transferModalStore.send({
|
|
8883
8756
|
type: "updateTransferDetails",
|
|
@@ -8990,7 +8863,8 @@ const EnterWalletAddressView = () => {
|
|
|
8990
8863
|
const balanceAmount = tokenBalance?.pages[0].balances[0].balance;
|
|
8991
8864
|
let insufficientBalance = true;
|
|
8992
8865
|
if (balanceAmount !== void 0 && quantity) try {
|
|
8993
|
-
|
|
8866
|
+
const quantityBigInt = BigInt(quantity);
|
|
8867
|
+
insufficientBalance = quantityBigInt > BigInt(balanceAmount);
|
|
8994
8868
|
} catch (_e) {
|
|
8995
8869
|
insufficientBalance = true;
|
|
8996
8870
|
}
|
|
@@ -9008,7 +8882,8 @@ const EnterWalletAddressView = () => {
|
|
|
9008
8882
|
console.error("Transfer failed:", error);
|
|
9009
8883
|
}
|
|
9010
8884
|
};
|
|
9011
|
-
const
|
|
8885
|
+
const isErc1155 = collection?.type === ContractType.ERC1155;
|
|
8886
|
+
const showQuantityInput = isErc1155 && !!balanceAmount;
|
|
9012
8887
|
const isTransferDisabled = transferIsProcessing || !isWalletAddressValid || insufficientBalance || !quantity || Number(quantity) === 0 || isSelfTransfer;
|
|
9013
8888
|
return /* @__PURE__ */ jsxs("div", {
|
|
9014
8889
|
className: "grid grow gap-6",
|
|
@@ -9136,7 +9011,7 @@ const TransferModal = () => {
|
|
|
9136
9011
|
onCancel: () => {
|
|
9137
9012
|
transferModalStore.send({
|
|
9138
9013
|
type: "failTransfer",
|
|
9139
|
-
error:
|
|
9014
|
+
error: new Error("Transfer cancelled")
|
|
9140
9015
|
});
|
|
9141
9016
|
},
|
|
9142
9017
|
titleOnConfirm: "Processing transfer...",
|
|
@@ -9176,7 +9051,7 @@ const styles = String.raw`/* Modified Tailwind CSS, to avoid issues with shadow
|
|
|
9176
9051
|
--tw-gradient-via-position: 50%;
|
|
9177
9052
|
--tw-gradient-to-position: 100%;
|
|
9178
9053
|
}
|
|
9179
|
-
/*! tailwindcss v4.1.
|
|
9054
|
+
/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */
|
|
9180
9055
|
@layer properties;
|
|
9181
9056
|
@layer theme, base, components, utilities;
|
|
9182
9057
|
@layer theme {
|
|
@@ -12714,7 +12589,7 @@ const useActionButtonStore = () => {
|
|
|
12714
12589
|
if (!pendingAction) return;
|
|
12715
12590
|
const { timestamp, callback } = pendingAction;
|
|
12716
12591
|
if (timestamp && callback) {
|
|
12717
|
-
if (Date.now() - timestamp <
|
|
12592
|
+
if (Date.now() - timestamp < 5 * 60 * 1e3 && typeof callback === "function") callback();
|
|
12718
12593
|
}
|
|
12719
12594
|
}
|
|
12720
12595
|
};
|
|
@@ -12930,7 +12805,7 @@ function ActionButton({ collectionAddress, chainId, tokenId, orderbookKind, acti
|
|
|
12930
12805
|
orderbookKind,
|
|
12931
12806
|
highestOffer
|
|
12932
12807
|
});
|
|
12933
|
-
|
|
12808
|
+
const nonOwnerProps = cardType === "shop" && salesContractAddress && salePrice ? {
|
|
12934
12809
|
cardType: "shop",
|
|
12935
12810
|
salesContractAddress,
|
|
12936
12811
|
salePrice,
|
|
@@ -12953,7 +12828,8 @@ function ActionButton({ collectionAddress, chainId, tokenId, orderbookKind, acti
|
|
|
12953
12828
|
quantityDecimals,
|
|
12954
12829
|
quantityRemaining,
|
|
12955
12830
|
hideQuantitySelector
|
|
12956
|
-
}
|
|
12831
|
+
};
|
|
12832
|
+
return /* @__PURE__ */ jsx(NonOwnerActions, { ...nonOwnerProps });
|
|
12957
12833
|
}
|
|
12958
12834
|
|
|
12959
12835
|
//#endregion
|
|
@@ -12994,7 +12870,7 @@ function ActionButtonWrapper({ show, chainId, collectionAddress, tokenId, orderb
|
|
|
12994
12870
|
function fetchContentType(url) {
|
|
12995
12871
|
return new Promise((resolve, reject) => {
|
|
12996
12872
|
if (typeof XMLHttpRequest === "undefined") {
|
|
12997
|
-
reject(
|
|
12873
|
+
reject(new Error("XMLHttpRequest is not supported in this environment."));
|
|
12998
12874
|
return;
|
|
12999
12875
|
}
|
|
13000
12876
|
if (!url) return;
|
|
@@ -13104,22 +12980,26 @@ function MediaSkeleton() {
|
|
|
13104
12980
|
//#endregion
|
|
13105
12981
|
//#region src/react/ui/components/media/utils.ts
|
|
13106
12982
|
const isImage = (fileName) => {
|
|
13107
|
-
|
|
12983
|
+
const isImage$1 = /.*\.(png|jpg|jpeg|gif|svg|webp)$/.test(fileName?.toLowerCase() || "");
|
|
12984
|
+
return isImage$1;
|
|
13108
12985
|
};
|
|
13109
12986
|
const isHtml = (fileName) => {
|
|
13110
|
-
|
|
12987
|
+
const isHtml$1 = /.*\.(html\?.+|html)$/.test(fileName?.toLowerCase() || "");
|
|
12988
|
+
return isHtml$1;
|
|
13111
12989
|
};
|
|
13112
12990
|
const isVideo = (fileName) => {
|
|
13113
|
-
|
|
12991
|
+
const isVideo$1 = /.*\.(mp4|ogg|webm)$/.test(fileName?.toLowerCase() || "");
|
|
12992
|
+
return isVideo$1;
|
|
13114
12993
|
};
|
|
13115
12994
|
const is3dModel = (fileName) => {
|
|
13116
|
-
|
|
12995
|
+
const is3dFile = /.*\.(gltf|glb|obj|fbx|stl|usdz)$/.test(fileName?.toLowerCase() || "");
|
|
12996
|
+
return is3dFile;
|
|
13117
12997
|
};
|
|
13118
12998
|
const getContentType = (url) => {
|
|
13119
12999
|
return new Promise((resolve, reject) => {
|
|
13120
13000
|
const type = isHtml(url) ? "html" : isVideo(url) ? "video" : isImage(url) ? "image" : is3dModel(url) ? "3d-model" : null;
|
|
13121
13001
|
if (type) resolve(type);
|
|
13122
|
-
else reject(
|
|
13002
|
+
else reject(new Error("Unsupported file type"));
|
|
13123
13003
|
});
|
|
13124
13004
|
};
|
|
13125
13005
|
|
|
@@ -13153,9 +13033,10 @@ function Media({ name, assets, assetSrcPrefixUrl, className = "", containerClass
|
|
|
13153
13033
|
useEffect(() => {
|
|
13154
13034
|
setIsSafari(/^((?!chrome|android).)*safari/i.test(navigator.userAgent));
|
|
13155
13035
|
}, []);
|
|
13156
|
-
const
|
|
13036
|
+
const validAssets = assets.filter((asset) => !!asset);
|
|
13037
|
+
const assetUrl = validAssets[currentAssetIndex];
|
|
13157
13038
|
const proxiedAssetUrl = assetUrl ? assetSrcPrefixUrl ? `${assetSrcPrefixUrl}${assetUrl}` : assetUrl : "";
|
|
13158
|
-
const containerClassNames = cn
|
|
13039
|
+
const containerClassNames = cn("relative aspect-square overflow-hidden bg-background-secondary", containerClassName || className);
|
|
13159
13040
|
useEffect(() => {
|
|
13160
13041
|
if (!assetUrl) {
|
|
13161
13042
|
setContentType({
|
|
@@ -13206,11 +13087,11 @@ function Media({ name, assets, assetSrcPrefixUrl, className = "", containerClass
|
|
|
13206
13087
|
};
|
|
13207
13088
|
const renderFallback = () => {
|
|
13208
13089
|
if (fallbackContent) return /* @__PURE__ */ jsx("div", {
|
|
13209
|
-
className: cn
|
|
13090
|
+
className: cn("flex h-full w-full items-center justify-center", containerClassNames),
|
|
13210
13091
|
children: fallbackContent
|
|
13211
13092
|
});
|
|
13212
13093
|
return /* @__PURE__ */ jsx("div", {
|
|
13213
|
-
className: cn
|
|
13094
|
+
className: cn("h-full w-full", containerClassNames),
|
|
13214
13095
|
children: /* @__PURE__ */ jsx("img", {
|
|
13215
13096
|
src: chess_tile_default,
|
|
13216
13097
|
alt: name || "Collectible",
|
|
@@ -13224,10 +13105,10 @@ function Media({ name, assets, assetSrcPrefixUrl, className = "", containerClass
|
|
|
13224
13105
|
};
|
|
13225
13106
|
if (assetLoadFailed || !isLoading && contentType.failed || !assetUrl) return renderFallback();
|
|
13226
13107
|
if (contentType.type === "html" && !assetLoadFailed) return /* @__PURE__ */ jsxs("div", {
|
|
13227
|
-
className: cn
|
|
13108
|
+
className: cn("flex w-full items-center justify-center rounded-lg", containerClassNames),
|
|
13228
13109
|
children: [(assetLoading || contentType.loading || isLoading) && /* @__PURE__ */ jsx(MediaSkeleton, {}), /* @__PURE__ */ jsx("iframe", {
|
|
13229
13110
|
title: name || "Collectible",
|
|
13230
|
-
className: cn
|
|
13111
|
+
className: cn("aspect-square w-full", mediaClassname),
|
|
13231
13112
|
src: proxiedAssetUrl,
|
|
13232
13113
|
allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",
|
|
13233
13114
|
sandbox: "allow-scripts",
|
|
@@ -13237,7 +13118,7 @@ function Media({ name, assets, assetSrcPrefixUrl, className = "", containerClass
|
|
|
13237
13118
|
})]
|
|
13238
13119
|
});
|
|
13239
13120
|
if (contentType.type === "3d-model" && !assetLoadFailed) return /* @__PURE__ */ jsx("div", {
|
|
13240
|
-
className: cn
|
|
13121
|
+
className: cn("h-full w-full", containerClassNames),
|
|
13241
13122
|
children: /* @__PURE__ */ jsx(ModelViewer_default, {
|
|
13242
13123
|
src: proxiedAssetUrl,
|
|
13243
13124
|
posterSrc: chess_tile_default,
|
|
@@ -13246,7 +13127,7 @@ function Media({ name, assets, assetSrcPrefixUrl, className = "", containerClass
|
|
|
13246
13127
|
})
|
|
13247
13128
|
});
|
|
13248
13129
|
if (contentType.type === "video" && !assetLoadFailed) {
|
|
13249
|
-
const videoClassNames = cn
|
|
13130
|
+
const videoClassNames = cn("absolute inset-0 h-full w-full object-cover transition-transform duration-200 ease-in-out group-hover:scale-hover", assetLoading || isLoading ? "invisible" : "visible", isSafari && "pointer-events-none", mediaClassname);
|
|
13250
13131
|
return /* @__PURE__ */ jsxs("div", {
|
|
13251
13132
|
className: containerClassNames,
|
|
13252
13133
|
children: [(assetLoading || contentType.loading || isLoading) && /* @__PURE__ */ jsx(MediaSkeleton, {}), /* @__PURE__ */ jsx("video", {
|
|
@@ -13266,7 +13147,7 @@ function Media({ name, assets, assetSrcPrefixUrl, className = "", containerClass
|
|
|
13266
13147
|
});
|
|
13267
13148
|
}
|
|
13268
13149
|
const imgSrc = assetLoadFailed || contentType.failed ? chess_tile_default : proxiedAssetUrl;
|
|
13269
|
-
const imgClassNames = cn
|
|
13150
|
+
const imgClassNames = cn("absolute inset-0 h-full w-full object-cover transition-transform duration-200 ease-in-out group-hover:scale-hover", assetLoading || contentType.loading || isLoading ? "invisible" : "visible", mediaClassname);
|
|
13270
13151
|
return /* @__PURE__ */ jsxs("div", {
|
|
13271
13152
|
className: containerClassNames,
|
|
13272
13153
|
children: [(assetLoading || contentType.loading || isLoading) && /* @__PURE__ */ jsx(MediaSkeleton, {}), /* @__PURE__ */ jsx("img", {
|
|
@@ -13338,7 +13219,7 @@ function BaseCard({ name, image, video, animationUrl, onClick, onKeyDown, assetS
|
|
|
13338
13219
|
animationUrl
|
|
13339
13220
|
],
|
|
13340
13221
|
assetSrcPrefixUrl,
|
|
13341
|
-
mediaClassname: cn("object-contain", mediaClassName)
|
|
13222
|
+
mediaClassname: cn$1("object-contain", mediaClassName)
|
|
13342
13223
|
}), children]
|
|
13343
13224
|
})
|
|
13344
13225
|
})
|
|
@@ -13347,23 +13228,17 @@ function BaseCard({ name, image, video, animationUrl, onClick, onKeyDown, assetS
|
|
|
13347
13228
|
|
|
13348
13229
|
//#endregion
|
|
13349
13230
|
//#region src/react/ui/components/marketplace-collectible-card/components/footer/Footer.tsx
|
|
13350
|
-
const Footer = ({ chainId,
|
|
13231
|
+
const Footer = ({ chainId, name, type, decimals, onOfferClick, highestOffer, lowestListing, balance, quantityInitial, quantityRemaining, unlimitedSupply, cardType, salePriceAmount, salePriceCurrency }) => {
|
|
13351
13232
|
const isShop = cardType === "shop";
|
|
13352
13233
|
const isMarket = cardType === "market";
|
|
13353
13234
|
const isInventoryNonTradable = cardType === "inventory-non-tradable";
|
|
13354
|
-
const { data: lowestListing, isLoading: isLowestListingLoading } = useLowestListing({
|
|
13355
|
-
chainId,
|
|
13356
|
-
collectionAddress,
|
|
13357
|
-
tokenId: collectibleId,
|
|
13358
|
-
query: { enabled: isMarket }
|
|
13359
|
-
});
|
|
13360
13235
|
const { data: currency, isLoading: isCurrencyLoading } = useCurrency({
|
|
13361
13236
|
chainId,
|
|
13362
13237
|
currencyAddress: lowestListing?.priceCurrencyAddress,
|
|
13363
13238
|
query: { enabled: isMarket && !!lowestListing?.priceCurrencyAddress }
|
|
13364
13239
|
});
|
|
13365
13240
|
const listed = !!lowestListing?.priceAmount && !!lowestListing?.priceCurrencyAddress;
|
|
13366
|
-
const isPriceLoading = isMarket &&
|
|
13241
|
+
const isPriceLoading = isMarket && !!lowestListing?.priceCurrencyAddress && isCurrencyLoading;
|
|
13367
13242
|
return /* @__PURE__ */ jsxs("div", {
|
|
13368
13243
|
className: "relative flex flex-col items-start gap-2 whitespace-nowrap bg-background-primary p-4",
|
|
13369
13244
|
children: [
|
|
@@ -13377,7 +13252,7 @@ const Footer = ({ chainId, collectionAddress, collectibleId, name, type, decimal
|
|
|
13377
13252
|
balance
|
|
13378
13253
|
}),
|
|
13379
13254
|
/* @__PURE__ */ jsxs("div", {
|
|
13380
|
-
className: cn
|
|
13255
|
+
className: cn("flex items-center gap-1", isShop && type === ContractType.ERC721 && "hidden"),
|
|
13381
13256
|
children: [
|
|
13382
13257
|
isPriceLoading && /* @__PURE__ */ jsx(Skeleton, {
|
|
13383
13258
|
size: "sm",
|
|
@@ -13439,6 +13314,7 @@ const NonTradableInventoryFooter = ({ name, balance, decimals, type }) => {
|
|
|
13439
13314
|
function MarketCard({ collectibleId, chainId, collectionAddress, collectionType, assetSrcPrefixUrl, cardLoading, orderbookKind, collectible, onCollectibleClick, onOfferClick, balance, balanceIsLoading = false, onCannotPerformAction, prioritizeOwnerActions, hideQuantitySelector }) {
|
|
13440
13315
|
const collectibleMetadata = collectible?.metadata;
|
|
13441
13316
|
const highestOffer = collectible?.offer;
|
|
13317
|
+
const lowestListing = collectible?.listing;
|
|
13442
13318
|
if (!collectibleMetadata) {
|
|
13443
13319
|
console.error("Collectible metadata is undefined");
|
|
13444
13320
|
return null;
|
|
@@ -13467,8 +13343,6 @@ function MarketCard({ collectibleId, chainId, collectionAddress, collectionType,
|
|
|
13467
13343
|
hideQuantitySelector,
|
|
13468
13344
|
children: [/* @__PURE__ */ jsx(Footer, {
|
|
13469
13345
|
chainId,
|
|
13470
|
-
collectionAddress,
|
|
13471
|
-
collectibleId,
|
|
13472
13346
|
name: collectibleMetadata.name || "",
|
|
13473
13347
|
type: collectionType,
|
|
13474
13348
|
onOfferClick: (e) => onOfferClick?.({
|
|
@@ -13476,6 +13350,7 @@ function MarketCard({ collectibleId, chainId, collectionAddress, collectionType,
|
|
|
13476
13350
|
e
|
|
13477
13351
|
}),
|
|
13478
13352
|
highestOffer,
|
|
13353
|
+
lowestListing,
|
|
13479
13354
|
balance,
|
|
13480
13355
|
decimals: collectibleMetadata.decimals,
|
|
13481
13356
|
quantityInitial: highestOffer?.quantityInitial !== void 0 ? highestOffer.quantityInitial : collectible?.listing?.quantityInitial !== void 0 ? collectible.listing.quantityInitial : void 0,
|
|
@@ -13560,8 +13435,6 @@ function ShopCard({ collectibleId, chainId, collectionAddress, collectionType, a
|
|
|
13560
13435
|
hideQuantitySelector,
|
|
13561
13436
|
children: [/* @__PURE__ */ jsx(Footer, {
|
|
13562
13437
|
chainId,
|
|
13563
|
-
collectionAddress,
|
|
13564
|
-
collectibleId,
|
|
13565
13438
|
name: tokenMetadata.name || "",
|
|
13566
13439
|
type: collectionType,
|
|
13567
13440
|
decimals: tokenMetadata.decimals,
|
|
@@ -13599,5 +13472,5 @@ function CollectibleCard(props) {
|
|
|
13599
13472
|
}
|
|
13600
13473
|
|
|
13601
13474
|
//#endregion
|
|
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-
|
|
13475
|
+
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, useCollectionActiveListingsCurrencies, useCollectionActiveOffersCurrencies, 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, usePrimarySaleItem, useProcessStep, useRoyalty, useSearchTokenMetadata, useSellModal, useSuccessfulPurchaseModal, useTokenSupplies, useTransferModal, useTransferTokens };
|
|
13476
|
+
//# sourceMappingURL=react-CBsgOdVP.js.map
|