@0xsequence/marketplace-sdk 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -3
- package/dist/{BellIcon-ByhygxBO.js → BellIcon.js} +4 -4
- package/dist/BellIcon.js.map +1 -0
- package/dist/{CartIcon-Bt3rQYGk.js → CartIcon.js} +7 -7
- package/dist/CartIcon.js.map +1 -0
- package/dist/CollectibleCard.d.ts +8 -0
- package/dist/{_internal-DkS2VUn5.js → _internal.js} +2 -2
- package/dist/_internal.js.map +1 -0
- package/dist/{abi-fa-o9gH3.js → abi.js} +2 -2
- package/dist/abi.js.map +1 -0
- package/dist/{alien_swap-DoY6XfMA.js → alien_swap.js} +1 -1
- package/dist/alien_swap.js.map +1 -0
- package/dist/{api-BoO0V5aJ.js → api.js} +13 -64
- package/dist/api.js.map +1 -0
- package/dist/{aqua-xyz-BBDxnG14.js → aqua-xyz.js} +1 -1
- package/dist/aqua-xyz.js.map +1 -0
- package/dist/{aura-DGx2zwvF.js → aura.js} +1 -1
- package/dist/aura.js.map +1 -0
- package/dist/{blur-D8GKrRrq.js → blur.js} +1 -1
- package/dist/blur.js.map +1 -0
- package/dist/{builder-api-BFuZNOaN.js → builder-api.js} +3 -3
- package/dist/builder-api.js.map +1 -0
- package/dist/{builder.gen-B9wR2nvF.js → builder.gen.js} +3 -6
- package/dist/builder.gen.js.map +1 -0
- package/dist/{coinbase-DOry4PXY.js → coinbase.js} +1 -1
- package/dist/coinbase.js.map +1 -0
- package/dist/{collectibles-C_H8jMGH.js → collectibles.js} +9 -48
- package/dist/collectibles.js.map +1 -0
- package/dist/{collections-CKummc-R.js → collections.js} +79 -8
- package/dist/collections.js.map +1 -0
- package/dist/{components-CosnX7F9.js → components.js} +12 -14
- package/dist/components.js.map +1 -0
- package/dist/{contracts-BP_0vX48.js → contracts.js} +4 -4
- package/dist/contracts.js.map +1 -0
- package/dist/{create-config-ZOB7i4ZJ.d.ts → create-config.d.ts} +47 -60
- package/dist/{create-config-CIfejoCk.js → create-config.js} +10 -13
- package/dist/create-config.js.map +1 -0
- package/dist/{element-ciybd_VF.js → element.js} +1 -1
- package/dist/element.js.map +1 -0
- package/dist/{filters-V-V8Dn8f.d.ts → filters.d.ts} +7 -7
- package/dist/{foundation-Bq4lRz4x.js → foundation.js} +1 -1
- package/dist/foundation.js.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +16 -16
- package/dist/{index-DUXfvhxs.d.ts → index10.d.ts} +14 -29
- package/dist/{index-CxA34wP1.d.ts → index11.d.ts} +101 -23
- package/dist/{index-BtWMBHeP.d.ts → index12.d.ts} +11 -9
- package/dist/{index-DmudgrsN.d.ts → index13.d.ts} +16 -16
- package/dist/{index-U-zp70of.d.ts → index14.d.ts} +9 -13
- package/dist/{index-Stm5u0I0.d.ts → index16.d.ts} +7 -10
- package/dist/{index-BZIJTQT0.d.ts → index17.d.ts} +9 -9
- package/dist/{index-CnEbXm_t.d.ts → index19.d.ts} +50 -12
- package/dist/{index-C-745li7.d.ts → index2.d.ts} +2 -2
- package/dist/{index-BOiHR01C.d.ts → index21.d.ts} +9 -9
- package/dist/{index-Bsx6XsC2.d.ts → index23.d.ts} +100 -59
- package/dist/{index-CPzvNmq9.d.ts → index24.d.ts} +36 -36
- package/dist/{index-DFEnA6Wa.d.ts → index25.d.ts} +18 -18
- package/dist/{index-DqXd1EeB.d.ts → index26.d.ts} +14 -7
- package/dist/{index-NlPMNcqh.d.ts → index27.d.ts} +102 -114
- package/dist/{index-DWt6yrIG.d.ts → index28.d.ts} +8 -8
- package/dist/{index-C4MUKshG.d.ts → index29.d.ts} +3 -3
- package/dist/{index-BeRV-7AX.d.ts → index3.d.ts} +2 -2
- package/dist/{index-Bxzjy0d1.d.ts → index4.d.ts} +2 -2
- package/dist/{index-DwKr18CI.d.ts → index5.d.ts} +2 -2
- package/dist/{index-D9LPlmbC.d.ts → index6.d.ts} +2 -2
- package/dist/{index-CS65jqOq.d.ts → index7.d.ts} +19 -3
- package/dist/index8.d.ts +18 -0
- package/dist/{index-CxpFwGvR.d.ts → index9.d.ts} +4 -4
- package/dist/{inventory-Dd7TazvZ.js → inventory.js} +11 -15
- package/dist/inventory.js.map +1 -0
- package/dist/{listCollectiblesPaginated-Cy2_qEZA.d.ts → listCollectiblesPaginated.d.ts} +24 -29
- package/dist/{listCollections-BB9FxKj2.d.ts → listCollections.d.ts} +170 -100
- package/dist/{looks-rare-6H--x3AM.js → looks-rare.js} +1 -1
- package/dist/looks-rare.js.map +1 -0
- package/dist/{lowestListing-Cbsi6M1K.d.ts → lowestListing.d.ts} +28 -28
- package/dist/{magic-eden-BoxEQ1Li.js → magic-eden.js} +1 -1
- package/dist/magic-eden.js.map +1 -0
- package/dist/{manifold-DycKsljb.js → manifold.js} +1 -1
- package/dist/manifold.js.map +1 -0
- package/dist/{market-C3HV-awQ.js → market.js} +7 -9
- package/dist/market.js.map +1 -0
- package/dist/{marketCurrencies-Bpw1bIO0.d.ts → marketCurrencies.d.ts} +19 -9
- package/dist/{marketCurrencies-sKrTX0og.js → marketCurrencies.js} +10 -7
- package/dist/marketCurrencies.js.map +1 -0
- package/dist/{marketplace-logos-D4dS1Foy.js → marketplace-logos.js} +23 -23
- package/dist/marketplace-logos.js.map +1 -0
- package/dist/{marketplace.gen-ksUafDqS.js → marketplace.gen.js} +25 -9
- package/dist/marketplace.gen.js.map +1 -0
- package/dist/{marketplace-NQB-sEQL.js → marketplace.js} +2 -2
- package/dist/marketplace.js.map +1 -0
- package/dist/{marketplaceConfig-UHQMM9fq.js → marketplaceConfig.js} +3 -3
- package/dist/marketplaceConfig.js.map +1 -0
- package/dist/{mintify-Dyqyo8jQ.js → mintify.js} +1 -1
- package/dist/mintify.js.map +1 -0
- package/dist/{network-DtmiMhcg.js → network.js} +3 -3
- package/dist/network.js.map +1 -0
- package/dist/{networkconfigToWagmiChain-DbUf6HiO.js → networkconfigToWagmiChain.js} +4 -3
- package/dist/networkconfigToWagmiChain.js.map +1 -0
- package/dist/{nftx-2LbFjj9Q.js → nftx.js} +1 -1
- package/dist/nftx.js.map +1 -0
- package/dist/{okx-CBEWJNsR.js → okx.js} +1 -1
- package/dist/okx.js.map +1 -0
- package/dist/{open-sea-Dxntz_PA.js → open-sea.js} +1 -1
- package/dist/open-sea.js.map +1 -0
- package/dist/{orders-DnFfZAXV.js → orders.js} +10 -10
- package/dist/orders.js.map +1 -0
- package/dist/{primary-sale-1u4QlPdA.js → primary-sale.js} +2 -2
- package/dist/primary-sale.js.map +1 -0
- package/dist/{primary-sales-Dmsi6bqj.js → primary-sales.js} +41 -3
- package/dist/primary-sales.js.map +1 -0
- package/dist/{query-BWbCsXLY.d.ts → query.d.ts} +2 -2
- package/dist/{rarible-CS0SupHr.js → rarible.js} +1 -1
- package/dist/rarible.js.map +1 -0
- package/dist/react/_internal/api/index.d.ts +2 -2
- package/dist/react/_internal/api/index.js +7 -7
- package/dist/react/_internal/databeat/index.d.ts +1 -1
- package/dist/react/_internal/databeat/index.js +37 -38
- package/dist/react/_internal/index.d.ts +2 -2
- package/dist/react/_internal/index.js +11 -11
- package/dist/react/_internal/wagmi/index.d.ts +1 -1
- package/dist/react/_internal/wagmi/index.js +5 -5
- package/dist/react/hooks/config/index.d.ts +8 -8
- package/dist/react/hooks/config/index.js +37 -38
- package/dist/react/hooks/contracts/index.d.ts +6 -6
- package/dist/react/hooks/contracts/index.js +15 -15
- package/dist/react/hooks/data/collectibles/index.d.ts +4 -10
- package/dist/react/hooks/data/collectibles/index.js +37 -38
- package/dist/react/hooks/data/collections/index.d.ts +11 -11
- package/dist/react/hooks/data/collections/index.js +38 -39
- package/dist/react/hooks/data/index.d.ts +37 -37
- package/dist/react/hooks/data/index.js +38 -39
- package/dist/react/hooks/data/inventory/index.d.ts +36 -36
- package/dist/react/hooks/data/inventory/index.js +37 -38
- package/dist/react/hooks/data/market/index.d.ts +5 -11
- package/dist/react/hooks/data/market/index.js +37 -38
- package/dist/react/hooks/data/orders/index.d.ts +4 -10
- package/dist/react/hooks/data/orders/index.js +37 -38
- package/dist/react/hooks/data/primary-sales/index.d.ts +37 -37
- package/dist/react/hooks/data/primary-sales/index.js +38 -39
- package/dist/react/hooks/data/tokens/index.d.ts +4 -4
- package/dist/react/hooks/data/tokens/index.js +37 -38
- package/dist/react/hooks/index.d.ts +37 -37
- package/dist/react/hooks/index.js +38 -39
- package/dist/react/hooks/transactions/index.d.ts +2 -2
- package/dist/react/hooks/transactions/index.js +37 -38
- package/dist/react/hooks/ui/index.d.ts +4 -4
- package/dist/react/hooks/ui/index.js +37 -38
- package/dist/react/hooks/utils/index.d.ts +36 -36
- package/dist/react/hooks/utils/index.js +37 -38
- package/dist/react/index.d.ts +37 -37
- package/dist/react/index.js +38 -39
- package/dist/react/queries/collectibles/index.d.ts +4 -10
- package/dist/react/queries/collectibles/index.js +20 -21
- package/dist/react/queries/collections/index.d.ts +11 -11
- package/dist/react/queries/collections/index.js +19 -19
- package/dist/react/queries/index.d.ts +24 -24
- package/dist/react/queries/index.js +30 -31
- package/dist/react/queries/inventory/index.d.ts +2 -2
- package/dist/react/queries/inventory/index.js +20 -20
- package/dist/react/queries/market/index.d.ts +5 -5
- package/dist/react/queries/market/index.js +20 -20
- package/dist/react/queries/orders/index.d.ts +4 -10
- package/dist/react/queries/orders/index.js +11 -11
- package/dist/react/queries/primary-sales/index.d.ts +4 -4
- package/dist/react/queries/primary-sales/index.js +12 -12
- package/dist/react/queries/tokens/index.d.ts +4 -4
- package/dist/react/queries/tokens/index.js +11 -12
- package/dist/react/queries/utils/index.d.ts +3 -3
- package/dist/react/queries/utils/index.js +20 -20
- package/dist/react/ssr/index.d.ts +7 -7
- package/dist/react/ssr/index.js +13 -16
- 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 +20 -20
- 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 +37 -38
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +4 -4
- package/dist/react/ui/components/marketplace-collectible-card/index.js +37 -38
- 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 +11 -11
- 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 +14 -14
- package/dist/react/ui/index.d.ts +4 -4
- package/dist/react/ui/index.js +37 -38
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +2 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +37 -38
- package/dist/react/utils/index.d.ts +1 -1
- package/dist/react/utils/index.js +7 -7
- package/dist/{react-DE852KeT.js → react.js} +720 -926
- package/dist/react.js.map +1 -0
- package/dist/{sequence-paCCener.js → sequence.js} +1 -1
- package/dist/sequence.js.map +1 -0
- package/dist/{src-Dz2CfBL0.js → src.js} +2 -2
- package/dist/src.js.map +1 -0
- package/dist/styles/index.css +1 -1
- package/dist/{sudo-swap-9rH2EgfT.js → sudo-swap.js} +1 -1
- package/dist/sudo-swap.js.map +1 -0
- package/dist/{super-rare-DHIuWtRw.js → super-rare.js} +1 -1
- package/dist/super-rare.js.map +1 -0
- package/dist/{token-Cv7l2ZaL.js → token.js} +2 -2
- package/dist/token.js.map +1 -0
- package/dist/{tokenBalances-ibDerNmM.js → tokenBalances.js} +4 -11
- package/dist/tokenBalances.js.map +1 -0
- package/dist/{tokenSupplies-Bfe8RHzI.d.ts → tokenSupplies.d.ts} +19 -30
- package/dist/{tokens-cGxMadd8.js → tokens.js} +47 -22
- package/dist/tokens.js.map +1 -0
- package/dist/{transaction-DZUW5RHu.js → transaction.js} +2 -2
- package/dist/transaction.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +3 -3
- package/dist/{types-D2TJ1dwv.d.ts → types.d.ts} +3 -3
- package/dist/{types-B_-cnkcP.js → types.js} +2 -2
- package/dist/types.js.map +1 -0
- package/dist/utils/abi/index.d.ts +4 -4
- package/dist/utils/abi/index.js +4 -4
- package/dist/utils/abi/marketplace/index.d.ts +1 -1
- package/dist/utils/abi/marketplace/index.js +1 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1 -1
- package/dist/utils/abi/primary-sale/index.js +1 -1
- package/dist/utils/abi/token/index.d.ts +1 -1
- package/dist/utils/abi/token/index.js +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.js +13 -13
- package/dist/{utils-BfpDVibN.js → utils.js} +42 -4
- package/dist/utils.js.map +1 -0
- package/dist/{utils-BCgNhBFR.js → utils2.js} +11 -5
- package/dist/utils2.js.map +1 -0
- package/dist/{utils-BqxcalL2.js → utils3.js} +3 -3
- package/dist/utils3.js.map +1 -0
- package/dist/{waitForTransactionReceipt-DieAnV52.js → waitForTransactionReceipt.js} +3 -3
- package/dist/waitForTransactionReceipt.js.map +1 -0
- package/dist/{x2y2-45WDooeh.js → x2y2.js} +1 -1
- package/dist/x2y2.js.map +1 -0
- package/dist/{zora-CbeBoLvQ.js → zora.js} +1 -1
- package/dist/zora.js.map +1 -0
- package/package.json +42 -42
- 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/_internal/wagmi/get-connectors.ts +12 -1
- 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__/ERC1155ShopModal.test.tsx +152 -141
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +1 -0
- package/src/react/ui/modals/BuyModal/components/ERC1155ShopModal.tsx +44 -60
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC1155SalePaymentParams.test.tsx +381 -0
- package/src/react/ui/modals/BuyModal/hooks/useERC1155SalePaymentParams.ts +257 -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/TransferModal/_views/enterWalletAddress/index.tsx +1 -1
- package/src/react/ui/modals/TransferModal/index.tsx +24 -2
- 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 +2 -2
- 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/tsdown.config.ts +1 -0
- 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/_internal-DkS2VUn5.js.map +0 -1
- package/dist/abi-fa-o9gH3.js.map +0 -1
- package/dist/alien_swap-DoY6XfMA.js.map +0 -1
- package/dist/api-BoO0V5aJ.js.map +0 -1
- package/dist/aqua-xyz-BBDxnG14.js.map +0 -1
- package/dist/aura-DGx2zwvF.js.map +0 -1
- package/dist/blur-D8GKrRrq.js.map +0 -1
- package/dist/builder-api-BFuZNOaN.js.map +0 -1
- package/dist/builder.gen-B9wR2nvF.js.map +0 -1
- package/dist/coinbase-DOry4PXY.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/contracts-BP_0vX48.js.map +0 -1
- package/dist/create-config-CIfejoCk.js.map +0 -1
- package/dist/element-ciybd_VF.js.map +0 -1
- package/dist/foundation-Bq4lRz4x.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/looks-rare-6H--x3AM.js.map +0 -1
- package/dist/magic-eden-BoxEQ1Li.js.map +0 -1
- package/dist/manifold-DycKsljb.js.map +0 -1
- package/dist/market-C3HV-awQ.js.map +0 -1
- package/dist/marketCurrencies-sKrTX0og.js.map +0 -1
- package/dist/marketplace-NQB-sEQL.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/mintify-Dyqyo8jQ.js.map +0 -1
- package/dist/network-DtmiMhcg.js.map +0 -1
- package/dist/networkconfigToWagmiChain-DbUf6HiO.js.map +0 -1
- package/dist/nftx-2LbFjj9Q.js.map +0 -1
- package/dist/okx-CBEWJNsR.js.map +0 -1
- package/dist/open-sea-Dxntz_PA.js.map +0 -1
- package/dist/orders-DnFfZAXV.js.map +0 -1
- package/dist/primary-sale-1u4QlPdA.js.map +0 -1
- package/dist/primary-sales-Dmsi6bqj.js.map +0 -1
- package/dist/rarible-CS0SupHr.js.map +0 -1
- package/dist/react-DE852KeT.js.map +0 -1
- package/dist/sequence-paCCener.js.map +0 -1
- package/dist/src-Dz2CfBL0.js.map +0 -1
- package/dist/sudo-swap-9rH2EgfT.js.map +0 -1
- package/dist/super-rare-DHIuWtRw.js.map +0 -1
- package/dist/token-Cv7l2ZaL.js.map +0 -1
- package/dist/tokenBalances-ibDerNmM.js.map +0 -1
- package/dist/tokens-cGxMadd8.js.map +0 -1
- package/dist/transaction-DZUW5RHu.js.map +0 -1
- package/dist/types-B_-cnkcP.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/dist/waitForTransactionReceipt-DieAnV52.js.map +0 -1
- package/dist/x2y2-45WDooeh.js.map +0 -1
- package/dist/zora-CbeBoLvQ.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/BuyModal/hooks/__tests__/useERC1155Checkout.test.tsx +0 -395
- package/src/react/ui/modals/BuyModal/hooks/useERC1155Checkout.ts +0 -103
- package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +0 -481
- /package/dist/{index-6wsMChsg.d.ts → index15.d.ts} +0 -0
- /package/dist/{index-CZUtOTjh.d.ts → index18.d.ts} +0 -0
- /package/dist/{index-DW3njUfb.d.ts → index20.d.ts} +0 -0
- /package/dist/{index-DewGsFz5.d.ts → index22.d.ts} +0 -0
- /package/dist/{queries-KOcILNJO.js → queries.js} +0 -0
- /package/dist/{wagmi-Bseovd6Q.js → wagmi.js} +0 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type { SelectPaymentSettings } from '@0xsequence/checkout';
|
|
2
|
+
import { skipToken, useQuery } from '@tanstack/react-query';
|
|
3
|
+
import {
|
|
4
|
+
type Address,
|
|
5
|
+
encodeFunctionData,
|
|
6
|
+
type Hash,
|
|
7
|
+
type Hex,
|
|
8
|
+
toHex,
|
|
9
|
+
} from 'viem';
|
|
10
|
+
import { useAccount } from 'wagmi';
|
|
11
|
+
import { ContractType } from '../../../../../types';
|
|
12
|
+
import { BuyModalErrorFactory } from '../../../../../types/buyModalErrors';
|
|
13
|
+
import {
|
|
14
|
+
getQueryClient,
|
|
15
|
+
type TransactionOnRampProvider,
|
|
16
|
+
} from '../../../../_internal';
|
|
17
|
+
import { useSalesContractABI } from '../../../../hooks/contracts/useSalesContractABI';
|
|
18
|
+
import type { ActionButton, ModalCallbacks } from '../../_internal/types';
|
|
19
|
+
import {
|
|
20
|
+
buyModalStore,
|
|
21
|
+
useBuyAnalyticsId,
|
|
22
|
+
useBuyModalProps,
|
|
23
|
+
useOnError,
|
|
24
|
+
useOnSuccess,
|
|
25
|
+
useQuantity,
|
|
26
|
+
} from '../store';
|
|
27
|
+
|
|
28
|
+
interface ERC1155MintArgs {
|
|
29
|
+
to: Address;
|
|
30
|
+
tokenIds: bigint[];
|
|
31
|
+
amounts: bigint[];
|
|
32
|
+
data: Hex;
|
|
33
|
+
paymentToken: Address;
|
|
34
|
+
maxTotal: bigint;
|
|
35
|
+
proof: Hex[];
|
|
36
|
+
abi: readonly unknown[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const DEFAULT_PROOF = [toHex(0, { size: 32 })] as Hex[];
|
|
40
|
+
|
|
41
|
+
const encodeERC1155MintData = ({
|
|
42
|
+
to,
|
|
43
|
+
tokenIds,
|
|
44
|
+
amounts,
|
|
45
|
+
data = '0x' as Hex,
|
|
46
|
+
paymentToken,
|
|
47
|
+
maxTotal,
|
|
48
|
+
proof = DEFAULT_PROOF,
|
|
49
|
+
abi,
|
|
50
|
+
}: ERC1155MintArgs): Hex => {
|
|
51
|
+
return encodeFunctionData({
|
|
52
|
+
abi,
|
|
53
|
+
functionName: 'mint',
|
|
54
|
+
args: [to, tokenIds, amounts, data, paymentToken, maxTotal, proof],
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
interface GetERC1155SalePaymentParams {
|
|
59
|
+
chainId: number;
|
|
60
|
+
address: Address;
|
|
61
|
+
salesContractAddress: string;
|
|
62
|
+
collectionAddress: string;
|
|
63
|
+
tokenId: string;
|
|
64
|
+
quantity: number;
|
|
65
|
+
price: bigint;
|
|
66
|
+
currencyAddress: string;
|
|
67
|
+
callbacks: ModalCallbacks | undefined;
|
|
68
|
+
customCreditCardProviderCallback: ((price: string) => void) | undefined;
|
|
69
|
+
skipNativeBalanceCheck: boolean | undefined;
|
|
70
|
+
nativeTokenAddress: string | undefined;
|
|
71
|
+
checkoutProvider?: string;
|
|
72
|
+
successActionButtons?: ActionButton[];
|
|
73
|
+
onRampProvider: TransactionOnRampProvider | undefined;
|
|
74
|
+
saleAnalyticsId: string | undefined;
|
|
75
|
+
abi: readonly unknown[];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const getERC1155SalePaymentParams = async ({
|
|
79
|
+
chainId,
|
|
80
|
+
address,
|
|
81
|
+
salesContractAddress,
|
|
82
|
+
collectionAddress,
|
|
83
|
+
tokenId,
|
|
84
|
+
quantity,
|
|
85
|
+
price,
|
|
86
|
+
currencyAddress,
|
|
87
|
+
callbacks,
|
|
88
|
+
customCreditCardProviderCallback,
|
|
89
|
+
skipNativeBalanceCheck,
|
|
90
|
+
nativeTokenAddress,
|
|
91
|
+
checkoutProvider,
|
|
92
|
+
successActionButtons,
|
|
93
|
+
onRampProvider,
|
|
94
|
+
saleAnalyticsId,
|
|
95
|
+
abi,
|
|
96
|
+
}: GetERC1155SalePaymentParams) => {
|
|
97
|
+
try {
|
|
98
|
+
const totalPrice = price * BigInt(quantity);
|
|
99
|
+
const tokenIdBigInt = BigInt(tokenId);
|
|
100
|
+
|
|
101
|
+
const purchaseTransactionData = encodeERC1155MintData({
|
|
102
|
+
to: address,
|
|
103
|
+
tokenIds: [tokenIdBigInt],
|
|
104
|
+
amounts: [BigInt(quantity)],
|
|
105
|
+
data: '0x' as Hex,
|
|
106
|
+
paymentToken: currencyAddress as Address,
|
|
107
|
+
maxTotal: totalPrice,
|
|
108
|
+
proof: DEFAULT_PROOF,
|
|
109
|
+
abi,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const creditCardProviders = customCreditCardProviderCallback
|
|
113
|
+
? ['custom']
|
|
114
|
+
: checkoutProvider
|
|
115
|
+
? [checkoutProvider]
|
|
116
|
+
: [];
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
chain: chainId,
|
|
120
|
+
collectibles: [
|
|
121
|
+
{
|
|
122
|
+
quantity: quantity.toString(),
|
|
123
|
+
decimals: 0,
|
|
124
|
+
tokenId: tokenId,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
currencyAddress,
|
|
128
|
+
price: price.toString(),
|
|
129
|
+
targetContractAddress: salesContractAddress,
|
|
130
|
+
txData: purchaseTransactionData,
|
|
131
|
+
collectionAddress,
|
|
132
|
+
recipientAddress: address,
|
|
133
|
+
creditCardProviders,
|
|
134
|
+
onSuccess: (txHash?: string) => {
|
|
135
|
+
if (txHash) {
|
|
136
|
+
callbacks?.onSuccess?.({ hash: txHash as Hash });
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
onError: callbacks?.onError,
|
|
140
|
+
onClose: () => {
|
|
141
|
+
const queryClient = getQueryClient();
|
|
142
|
+
queryClient.invalidateQueries({
|
|
143
|
+
predicate: (query) => !query.meta?.persistent,
|
|
144
|
+
});
|
|
145
|
+
buyModalStore.send({ type: 'close' });
|
|
146
|
+
},
|
|
147
|
+
skipNativeBalanceCheck,
|
|
148
|
+
supplementaryAnalyticsInfo: {
|
|
149
|
+
marketplaceType: 'shop',
|
|
150
|
+
...(saleAnalyticsId && { saleAnalyticsId }),
|
|
151
|
+
},
|
|
152
|
+
nativeTokenAddress,
|
|
153
|
+
...(customCreditCardProviderCallback && {
|
|
154
|
+
customProviderCallback: () => {
|
|
155
|
+
customCreditCardProviderCallback(price.toString());
|
|
156
|
+
buyModalStore.send({ type: 'close' });
|
|
157
|
+
},
|
|
158
|
+
}),
|
|
159
|
+
successActionButtons,
|
|
160
|
+
onRampProvider,
|
|
161
|
+
} satisfies SelectPaymentSettings;
|
|
162
|
+
} catch (error) {
|
|
163
|
+
// Convert to structured error for better debugging
|
|
164
|
+
throw BuyModalErrorFactory.priceCalculation(
|
|
165
|
+
'ERC1155 payment params calculation',
|
|
166
|
+
[price.toString(), quantity.toString(), tokenId],
|
|
167
|
+
error instanceof Error ? error.message : 'Unknown error',
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
interface UseERC1155SalePaymentParams {
|
|
173
|
+
salesContractAddress: string | undefined;
|
|
174
|
+
collectionAddress: string | undefined;
|
|
175
|
+
tokenId: string | undefined;
|
|
176
|
+
price: string | undefined;
|
|
177
|
+
currencyAddress: string | undefined;
|
|
178
|
+
enabled?: boolean;
|
|
179
|
+
checkoutProvider?: string;
|
|
180
|
+
chainId: number;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const useERC1155SalePaymentParams = (
|
|
184
|
+
args: UseERC1155SalePaymentParams,
|
|
185
|
+
) => {
|
|
186
|
+
const {
|
|
187
|
+
salesContractAddress,
|
|
188
|
+
collectionAddress,
|
|
189
|
+
tokenId,
|
|
190
|
+
price,
|
|
191
|
+
currencyAddress,
|
|
192
|
+
enabled = true,
|
|
193
|
+
checkoutProvider,
|
|
194
|
+
chainId,
|
|
195
|
+
} = args;
|
|
196
|
+
|
|
197
|
+
const { address } = useAccount();
|
|
198
|
+
const quantity = useQuantity();
|
|
199
|
+
const onSuccess = useOnSuccess();
|
|
200
|
+
const onError = useOnError();
|
|
201
|
+
const buyModalProps = useBuyModalProps();
|
|
202
|
+
const saleAnalyticsId = useBuyAnalyticsId();
|
|
203
|
+
|
|
204
|
+
const {
|
|
205
|
+
abi,
|
|
206
|
+
isLoading: isABILoading,
|
|
207
|
+
version,
|
|
208
|
+
} = useSalesContractABI({
|
|
209
|
+
contractAddress: salesContractAddress as Address,
|
|
210
|
+
contractType: ContractType.ERC1155,
|
|
211
|
+
chainId,
|
|
212
|
+
enabled: enabled && !!salesContractAddress,
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
const queryEnabled =
|
|
216
|
+
enabled &&
|
|
217
|
+
!!address &&
|
|
218
|
+
!!salesContractAddress &&
|
|
219
|
+
!!collectionAddress &&
|
|
220
|
+
!!tokenId &&
|
|
221
|
+
price !== undefined &&
|
|
222
|
+
!!currencyAddress &&
|
|
223
|
+
!!quantity &&
|
|
224
|
+
!!abi &&
|
|
225
|
+
!isABILoading;
|
|
226
|
+
|
|
227
|
+
return useQuery({
|
|
228
|
+
queryKey: ['erc1155SalePaymentParams', args, quantity, version],
|
|
229
|
+
queryFn:
|
|
230
|
+
queryEnabled && abi
|
|
231
|
+
? () =>
|
|
232
|
+
getERC1155SalePaymentParams({
|
|
233
|
+
chainId,
|
|
234
|
+
address,
|
|
235
|
+
salesContractAddress,
|
|
236
|
+
collectionAddress,
|
|
237
|
+
tokenId,
|
|
238
|
+
quantity,
|
|
239
|
+
price: BigInt(price!),
|
|
240
|
+
currencyAddress,
|
|
241
|
+
callbacks: {
|
|
242
|
+
onSuccess,
|
|
243
|
+
onError,
|
|
244
|
+
},
|
|
245
|
+
customCreditCardProviderCallback: undefined, // Can be added as a prop if needed
|
|
246
|
+
skipNativeBalanceCheck: false, // Can be added as a prop if needed
|
|
247
|
+
nativeTokenAddress: undefined, // Can be added as a prop if needed
|
|
248
|
+
checkoutProvider,
|
|
249
|
+
successActionButtons: buyModalProps.successActionButtons,
|
|
250
|
+
onRampProvider: buyModalProps.onRampProvider,
|
|
251
|
+
saleAnalyticsId,
|
|
252
|
+
abi,
|
|
253
|
+
})
|
|
254
|
+
: skipToken,
|
|
255
|
+
enabled: queryEnabled,
|
|
256
|
+
});
|
|
257
|
+
};
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
type AdditionalFee,
|
|
9
9
|
getMarketplaceClient,
|
|
10
10
|
getQueryClient,
|
|
11
|
-
getSequenceApiClient,
|
|
12
11
|
type MarketplaceKind,
|
|
13
12
|
type Step,
|
|
14
13
|
StepType,
|
|
@@ -100,23 +99,6 @@ export const getBuyCollectableParams = async ({
|
|
|
100
99
|
? ['custom']
|
|
101
100
|
: checkoutOptions.nftCheckout || [];
|
|
102
101
|
|
|
103
|
-
const isTransakSupported = creditCardProviders.includes('transak');
|
|
104
|
-
|
|
105
|
-
let transakContractId: string | undefined;
|
|
106
|
-
|
|
107
|
-
if (isTransakSupported) {
|
|
108
|
-
const sequenceApiClient = getSequenceApiClient(config);
|
|
109
|
-
const transakContractIdResponse =
|
|
110
|
-
await sequenceApiClient.checkoutOptionsGetTransakContractID({
|
|
111
|
-
chainId,
|
|
112
|
-
contractAddress: buyStep.to,
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
if (transakContractIdResponse.contractId !== '') {
|
|
116
|
-
transakContractId = transakContractIdResponse.contractId;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
102
|
return {
|
|
121
103
|
chain: chainId,
|
|
122
104
|
collectibles: [
|
|
@@ -161,11 +143,6 @@ export const getBuyCollectableParams = async ({
|
|
|
161
143
|
buyModalStore.send({ type: 'close' });
|
|
162
144
|
},
|
|
163
145
|
}),
|
|
164
|
-
...(transakContractId && {
|
|
165
|
-
transakConfig: {
|
|
166
|
-
contractId: transakContractId,
|
|
167
|
-
},
|
|
168
|
-
}),
|
|
169
146
|
onRampProvider,
|
|
170
147
|
successActionButtons: callbacks?.successActionButtons,
|
|
171
148
|
} satisfies SelectPaymentSettings;
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
useMarketplaceConfig,
|
|
17
17
|
} from '../../../hooks';
|
|
18
18
|
import { useConnectorMetadata } from '../../../hooks/config/useConnectorMetadata';
|
|
19
|
+
import { useRoyalty } from '../../../hooks/utils/useRoyalty';
|
|
19
20
|
import { ErrorLogBox } from '../../components/_internals/ErrorLogBox';
|
|
20
21
|
import { ActionModal } from '../_internal/components/actionModal/ActionModal';
|
|
21
22
|
import { ErrorModal } from '../_internal/components/actionModal/ErrorModal';
|
|
@@ -100,10 +101,21 @@ const Modal = observer(() => {
|
|
|
100
101
|
isError: currenciesIsError,
|
|
101
102
|
} = useMarketCurrencies({
|
|
102
103
|
chainId,
|
|
104
|
+
collectionAddress,
|
|
103
105
|
includeNativeCurrency: false,
|
|
104
106
|
});
|
|
107
|
+
|
|
108
|
+
const { data: royalty, isLoading: royaltyLoading } = useRoyalty({
|
|
109
|
+
chainId,
|
|
110
|
+
collectionAddress,
|
|
111
|
+
collectibleId,
|
|
112
|
+
});
|
|
113
|
+
|
|
105
114
|
const modalLoading =
|
|
106
|
-
collectableIsLoading ||
|
|
115
|
+
collectableIsLoading ||
|
|
116
|
+
collectionIsLoading ||
|
|
117
|
+
currenciesLoading ||
|
|
118
|
+
royaltyLoading;
|
|
107
119
|
|
|
108
120
|
const {
|
|
109
121
|
isLoading,
|
|
@@ -159,7 +171,12 @@ const Modal = observer(() => {
|
|
|
159
171
|
);
|
|
160
172
|
}
|
|
161
173
|
|
|
162
|
-
|
|
174
|
+
const shouldShowNoERC20Error =
|
|
175
|
+
!currenciesLoading &&
|
|
176
|
+
!currenciesIsError &&
|
|
177
|
+
(!currencies || currencies.length === 0);
|
|
178
|
+
|
|
179
|
+
if (shouldShowNoERC20Error) {
|
|
163
180
|
return (
|
|
164
181
|
<ErrorModal
|
|
165
182
|
isOpen={makeOfferModal$.isOpen.get()}
|
|
@@ -280,6 +297,9 @@ const Modal = observer(() => {
|
|
|
280
297
|
orderbookKind={orderbookKind}
|
|
281
298
|
modalType="offer"
|
|
282
299
|
disabled={shouldHideOfferButton}
|
|
300
|
+
feeData={{
|
|
301
|
+
royaltyPercentage: royalty ? Number(royalty.percentage) : 0,
|
|
302
|
+
}}
|
|
283
303
|
/>
|
|
284
304
|
|
|
285
305
|
{collection?.type === ContractType.ERC1155 && (
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
type CreateReq,
|
|
7
7
|
type GenerateOfferTransactionArgs,
|
|
8
8
|
getMarketplaceClient,
|
|
9
|
+
OfferType,
|
|
9
10
|
type OrderbookKind,
|
|
10
11
|
type QueryArg,
|
|
11
12
|
StepType,
|
|
@@ -55,6 +56,7 @@ export const useGetTokenApprovalData = (
|
|
|
55
56
|
orderbook: params.orderbook,
|
|
56
57
|
offer,
|
|
57
58
|
additionalFees: [],
|
|
59
|
+
offerType: OfferType.item,
|
|
58
60
|
} satisfies GenerateOfferTransactionArgs;
|
|
59
61
|
const steps = await marketplaceClient
|
|
60
62
|
.generateOfferTransaction(args)
|
|
@@ -6,6 +6,7 @@ import { getSequenceMarketplaceRequestId } from '../../../../../utils/getSequenc
|
|
|
6
6
|
import {
|
|
7
7
|
balanceQueries,
|
|
8
8
|
collectableKeys,
|
|
9
|
+
OfferType,
|
|
9
10
|
StepType,
|
|
10
11
|
type TransactionSteps,
|
|
11
12
|
} from '../../../../_internal';
|
|
@@ -78,6 +79,7 @@ export const useTransactionSteps = ({
|
|
|
78
79
|
expiry: new Date(Number(offerInput.offer.expiry) * 1000),
|
|
79
80
|
},
|
|
80
81
|
additionalFees: [],
|
|
82
|
+
offerType: OfferType.item,
|
|
81
83
|
});
|
|
82
84
|
|
|
83
85
|
return steps;
|
|
@@ -57,7 +57,7 @@ const EnterWalletAddressView = () => {
|
|
|
57
57
|
query: { enabled: !!connectedAddress },
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
const balanceAmount = tokenBalance?.pages[0]
|
|
60
|
+
const balanceAmount = tokenBalance?.pages[0]?.balances[0]?.balance;
|
|
61
61
|
|
|
62
62
|
let insufficientBalance = true;
|
|
63
63
|
if (balanceAmount !== undefined && quantity) {
|
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { Modal } from '@0xsequence/design-system';
|
|
4
4
|
import type { Address } from 'viem';
|
|
5
|
+
import { useAccount } from 'wagmi';
|
|
5
6
|
import type { FeeOption } from '../../../../types/waas-types';
|
|
6
7
|
import type { CollectionType } from '../../../_internal';
|
|
7
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
useConnectorMetadata,
|
|
10
|
+
useEnsureCorrectChain,
|
|
11
|
+
useListBalances,
|
|
12
|
+
} from '../../../hooks';
|
|
8
13
|
import { MODAL_OVERLAY_PROPS } from '../_internal/components/consts';
|
|
9
14
|
import SelectWaasFeeOptions from '../_internal/components/selectWaasFeeOptions';
|
|
10
15
|
import {
|
|
@@ -25,8 +30,25 @@ export type ShowTransferModalArgs = {
|
|
|
25
30
|
callbacks?: ModalCallbacks;
|
|
26
31
|
};
|
|
27
32
|
|
|
28
|
-
export
|
|
33
|
+
export type UseTransferModalArgs = {
|
|
34
|
+
prefetch?: {
|
|
35
|
+
collectibleId: string;
|
|
36
|
+
chainId: number;
|
|
37
|
+
collectionAddress: Address;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const useTransferModal = (args?: UseTransferModalArgs) => {
|
|
29
42
|
const { ensureCorrectChain } = useEnsureCorrectChain();
|
|
43
|
+
const { address: accountAddress } = useAccount();
|
|
44
|
+
// Prefetch balances if `prefetch` is provided
|
|
45
|
+
useListBalances({
|
|
46
|
+
chainId: args?.prefetch?.chainId!,
|
|
47
|
+
contractAddress: args?.prefetch?.collectionAddress,
|
|
48
|
+
tokenId: args?.prefetch?.collectibleId,
|
|
49
|
+
accountAddress,
|
|
50
|
+
query: { enabled: !!accountAddress && !!args?.prefetch },
|
|
51
|
+
});
|
|
30
52
|
|
|
31
53
|
const openModal = (args: ShowTransferModalArgs) => {
|
|
32
54
|
transferModalStore.send({ type: 'open', ...args });
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
import { Skeleton } from '@0xsequence/design-system';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
import type { Address } from 'viem';
|
|
6
|
-
import { compareAddress } from '../../../../../../utils';
|
|
7
6
|
import { type Currency, OrderbookKind } from '../../../../../_internal';
|
|
8
7
|
import { useMarketCurrencies } from '../../../../../hooks/data/market/useMarketCurrencies';
|
|
9
8
|
import {
|
|
10
9
|
CustomSelect,
|
|
11
10
|
type SelectItem,
|
|
12
11
|
} from '../../../../components/_internals/custom-select/CustomSelect';
|
|
13
|
-
import { getOpenseaCurrencyForChain } from '../../constants/opensea-currencies';
|
|
14
12
|
|
|
15
13
|
type CurrencyOptionsSelectProps = {
|
|
16
14
|
collectionAddress: Address;
|
|
@@ -42,17 +40,18 @@ function CurrencyOptionsSelect({
|
|
|
42
40
|
|
|
43
41
|
// Filter currencies for OpenSea
|
|
44
42
|
let filteredCurrencies = currencies;
|
|
43
|
+
|
|
45
44
|
if (currencies && orderbookKind === OrderbookKind.opensea && modalType) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
45
|
+
// Filter currencies based on OpenSea support flags from API
|
|
46
|
+
filteredCurrencies = currencies.filter((currency) => {
|
|
47
|
+
if (modalType === 'listing') {
|
|
48
|
+
return currency.openseaListing;
|
|
49
|
+
}
|
|
50
|
+
if (modalType === 'offer') {
|
|
51
|
+
return currency.openseaOffer;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
});
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
// set default currency
|
|
@@ -99,6 +98,9 @@ function CurrencyOptionsSelect({
|
|
|
99
98
|
}
|
|
100
99
|
};
|
|
101
100
|
|
|
101
|
+
// Disable dropdown for OpenSea since there's typically only one currency
|
|
102
|
+
const isDropdownDisabled = orderbookKind === OrderbookKind.opensea;
|
|
103
|
+
|
|
102
104
|
return (
|
|
103
105
|
<CustomSelect
|
|
104
106
|
items={options}
|
|
@@ -107,6 +109,7 @@ function CurrencyOptionsSelect({
|
|
|
107
109
|
value: selectedCurrency.contractAddress,
|
|
108
110
|
content: selectedCurrency.symbol,
|
|
109
111
|
}}
|
|
112
|
+
disabled={isDropdownDisabled}
|
|
110
113
|
testId="currency-select"
|
|
111
114
|
/>
|
|
112
115
|
);
|
|
@@ -68,7 +68,7 @@ export default function FloorPriceText({
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
return (
|
|
71
|
-
<div className="flex w-full items-center justify-between gap-2">
|
|
71
|
+
<div className="flex w-full flex-wrap items-center justify-between gap-2">
|
|
72
72
|
<Text className="text-left font-body font-medium text-muted text-xs">
|
|
73
73
|
{floorPriceDifferenceText}
|
|
74
74
|
</Text>
|