@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
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
import { renderHook } from '@test';
|
|
2
|
-
import type { Address } from 'viem';
|
|
3
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import {
|
|
5
|
-
type CheckoutOptions,
|
|
6
|
-
TransactionCrypto,
|
|
7
|
-
} from '../../../../../_internal';
|
|
8
|
-
import { useERC1155Checkout } from '../useERC1155Checkout';
|
|
9
|
-
|
|
10
|
-
// Mock @0xsequence/checkout
|
|
11
|
-
vi.mock('@0xsequence/checkout', () => ({
|
|
12
|
-
useERC1155SaleContractCheckout: vi.fn(() => ({
|
|
13
|
-
openCheckoutModal: vi.fn(),
|
|
14
|
-
isLoading: false,
|
|
15
|
-
isError: false,
|
|
16
|
-
})),
|
|
17
|
-
}));
|
|
18
|
-
|
|
19
|
-
// Mock wagmi's useAccount hook
|
|
20
|
-
vi.mock('wagmi', async () => {
|
|
21
|
-
const actual = await vi.importActual('wagmi');
|
|
22
|
-
return {
|
|
23
|
-
...actual,
|
|
24
|
-
useAccount: vi.fn(() => ({
|
|
25
|
-
address: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' as Address,
|
|
26
|
-
})),
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// Mock store hooks
|
|
31
|
-
vi.mock('../../store', () => ({
|
|
32
|
-
useQuantity: vi.fn(() => 2),
|
|
33
|
-
useOnSuccess: vi.fn(() => vi.fn()),
|
|
34
|
-
useOnError: vi.fn(() => vi.fn()),
|
|
35
|
-
useBuyAnalyticsId: vi.fn(() => '123'),
|
|
36
|
-
useBuyModalProps: vi.fn(() => ({
|
|
37
|
-
chainId: 1,
|
|
38
|
-
collectionAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
|
|
39
|
-
marketplaceType: 'shop',
|
|
40
|
-
salesContractAddress: '0x1234567890123456789012345678901234567890',
|
|
41
|
-
items: [],
|
|
42
|
-
quantityDecimals: 0,
|
|
43
|
-
quantityRemaining: 100,
|
|
44
|
-
salePrice: {
|
|
45
|
-
amount: '1000000000000000000',
|
|
46
|
-
currencyAddress: '0x0000000000000000000000000000000000000000',
|
|
47
|
-
},
|
|
48
|
-
})),
|
|
49
|
-
buyModalStore: {
|
|
50
|
-
send: vi.fn(),
|
|
51
|
-
},
|
|
52
|
-
}));
|
|
53
|
-
|
|
54
|
-
const mockCheckoutOptions = {
|
|
55
|
-
crypto: TransactionCrypto.all,
|
|
56
|
-
swap: [],
|
|
57
|
-
nftCheckout: [],
|
|
58
|
-
onRamp: [],
|
|
59
|
-
} satisfies CheckoutOptions;
|
|
60
|
-
|
|
61
|
-
const mockItems = [
|
|
62
|
-
{ tokenId: '1', quantity: '2' },
|
|
63
|
-
{ tokenId: '2', quantity: '1' },
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
describe('useERC1155Checkout', () => {
|
|
67
|
-
let mockUseERC1155SaleContractCheckout: ReturnType<typeof vi.fn>;
|
|
68
|
-
|
|
69
|
-
beforeEach(async () => {
|
|
70
|
-
vi.clearAllMocks();
|
|
71
|
-
|
|
72
|
-
// Setup the mock for useERC1155SaleContractCheckout
|
|
73
|
-
mockUseERC1155SaleContractCheckout = vi.mocked(
|
|
74
|
-
(await import('@0xsequence/checkout')).useERC1155SaleContractCheckout,
|
|
75
|
-
);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
afterEach(() => {
|
|
79
|
-
vi.restoreAllMocks();
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('should call useERC1155SaleContractCheckout with correct parameters', () => {
|
|
83
|
-
const mockCheckout = {
|
|
84
|
-
openCheckoutModal: vi.fn(),
|
|
85
|
-
isLoading: false,
|
|
86
|
-
isError: false,
|
|
87
|
-
};
|
|
88
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
89
|
-
|
|
90
|
-
const { result } = renderHook(() =>
|
|
91
|
-
useERC1155Checkout({
|
|
92
|
-
chainId: 1,
|
|
93
|
-
salesContractAddress: '0x456',
|
|
94
|
-
collectionAddress: '0x123',
|
|
95
|
-
items: mockItems,
|
|
96
|
-
checkoutOptions: mockCheckoutOptions,
|
|
97
|
-
enabled: true,
|
|
98
|
-
}),
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
expect(
|
|
102
|
-
mockUseERC1155SaleContractCheckout.mock.calls,
|
|
103
|
-
).toMatchInlineSnapshot(`
|
|
104
|
-
[
|
|
105
|
-
[
|
|
106
|
-
{
|
|
107
|
-
"chain": 1,
|
|
108
|
-
"checkoutOptions": {
|
|
109
|
-
"crypto": "all",
|
|
110
|
-
"nftCheckout": [],
|
|
111
|
-
"onRamp": [],
|
|
112
|
-
"swap": [],
|
|
113
|
-
},
|
|
114
|
-
"collectionAddress": "0x123",
|
|
115
|
-
"contractAddress": "0x456",
|
|
116
|
-
"customProviderCallback": undefined,
|
|
117
|
-
"items": [
|
|
118
|
-
{
|
|
119
|
-
"quantity": "2",
|
|
120
|
-
"tokenId": "1",
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
"onClose": [Function],
|
|
124
|
-
"onError": [Function],
|
|
125
|
-
"onSuccess": [Function],
|
|
126
|
-
"successActionButtons": undefined,
|
|
127
|
-
"supplementaryAnalyticsInfo": {
|
|
128
|
-
"marketplaceType": "shop",
|
|
129
|
-
"saleAnalyticsId": "123",
|
|
130
|
-
},
|
|
131
|
-
"wallet": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
]
|
|
135
|
-
`);
|
|
136
|
-
|
|
137
|
-
expect(result.current.isEnabled).toBe(true);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it('should return isEnabled false when no wallet is connected', async () => {
|
|
141
|
-
const { useAccount } = vi.mocked(await import('wagmi'));
|
|
142
|
-
useAccount.mockReturnValue({
|
|
143
|
-
address: undefined,
|
|
144
|
-
isConnected: false,
|
|
145
|
-
isConnecting: false,
|
|
146
|
-
isDisconnected: true,
|
|
147
|
-
isReconnecting: false,
|
|
148
|
-
connector: null,
|
|
149
|
-
addresses: undefined,
|
|
150
|
-
chain: undefined,
|
|
151
|
-
chainId: undefined,
|
|
152
|
-
status: 'disconnected',
|
|
153
|
-
} as never);
|
|
154
|
-
|
|
155
|
-
const mockCheckout = {
|
|
156
|
-
openCheckoutModal: vi.fn(),
|
|
157
|
-
isLoading: false,
|
|
158
|
-
isError: false,
|
|
159
|
-
};
|
|
160
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
161
|
-
|
|
162
|
-
const { result } = renderHook(() =>
|
|
163
|
-
useERC1155Checkout({
|
|
164
|
-
chainId: 1,
|
|
165
|
-
salesContractAddress: '0x456',
|
|
166
|
-
collectionAddress: '0x123',
|
|
167
|
-
items: mockItems,
|
|
168
|
-
enabled: true,
|
|
169
|
-
}),
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
expect(result.current.isEnabled).toBe(false);
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
it('should return isEnabled false when explicitly disabled', () => {
|
|
176
|
-
const mockCheckout = {
|
|
177
|
-
openCheckoutModal: vi.fn(),
|
|
178
|
-
isLoading: false,
|
|
179
|
-
isError: false,
|
|
180
|
-
};
|
|
181
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
182
|
-
|
|
183
|
-
const { result } = renderHook(() =>
|
|
184
|
-
useERC1155Checkout({
|
|
185
|
-
chainId: 1,
|
|
186
|
-
salesContractAddress: '0x456',
|
|
187
|
-
collectionAddress: '0x123',
|
|
188
|
-
items: mockItems,
|
|
189
|
-
enabled: false,
|
|
190
|
-
}),
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
expect(result.current.isEnabled).toBe(false);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
it('should handle custom provider callback', () => {
|
|
197
|
-
const customCallback = vi.fn();
|
|
198
|
-
const mockCheckout = {
|
|
199
|
-
openCheckoutModal: vi.fn(),
|
|
200
|
-
isLoading: false,
|
|
201
|
-
isError: false,
|
|
202
|
-
};
|
|
203
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
204
|
-
|
|
205
|
-
renderHook(() =>
|
|
206
|
-
useERC1155Checkout({
|
|
207
|
-
chainId: 1,
|
|
208
|
-
salesContractAddress: '0x456',
|
|
209
|
-
collectionAddress: '0x123',
|
|
210
|
-
items: mockItems,
|
|
211
|
-
customProviderCallback: customCallback,
|
|
212
|
-
enabled: true,
|
|
213
|
-
}),
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
expect(mockUseERC1155SaleContractCheckout).toHaveBeenCalledWith(
|
|
217
|
-
expect.objectContaining({
|
|
218
|
-
customProviderCallback: customCallback,
|
|
219
|
-
}),
|
|
220
|
-
);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
it('should use default quantity of 1 when quantity store returns null', async () => {
|
|
224
|
-
const storeModule = await import('../../store');
|
|
225
|
-
const useQuantitySpy = vi.spyOn(storeModule, 'useQuantity');
|
|
226
|
-
useQuantitySpy.mockReturnValue(null);
|
|
227
|
-
|
|
228
|
-
const mockCheckout = {
|
|
229
|
-
openCheckoutModal: vi.fn(),
|
|
230
|
-
isLoading: false,
|
|
231
|
-
isError: false,
|
|
232
|
-
};
|
|
233
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
234
|
-
|
|
235
|
-
renderHook(() =>
|
|
236
|
-
useERC1155Checkout({
|
|
237
|
-
chainId: 1,
|
|
238
|
-
salesContractAddress: '0x456',
|
|
239
|
-
collectionAddress: '0x123',
|
|
240
|
-
items: mockItems,
|
|
241
|
-
enabled: true,
|
|
242
|
-
}),
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
expect(mockUseERC1155SaleContractCheckout).toHaveBeenCalledWith(
|
|
246
|
-
expect.objectContaining({
|
|
247
|
-
items: [
|
|
248
|
-
{
|
|
249
|
-
tokenId: '1',
|
|
250
|
-
quantity: '1', // Default value
|
|
251
|
-
},
|
|
252
|
-
],
|
|
253
|
-
}),
|
|
254
|
-
);
|
|
255
|
-
|
|
256
|
-
useQuantitySpy.mockRestore();
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
it('should handle different chain IDs', () => {
|
|
260
|
-
const mockCheckout = {
|
|
261
|
-
openCheckoutModal: vi.fn(),
|
|
262
|
-
isLoading: false,
|
|
263
|
-
isError: false,
|
|
264
|
-
};
|
|
265
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
266
|
-
|
|
267
|
-
renderHook(() =>
|
|
268
|
-
useERC1155Checkout({
|
|
269
|
-
chainId: 137, // Polygon
|
|
270
|
-
salesContractAddress: '0x456',
|
|
271
|
-
collectionAddress: '0x123',
|
|
272
|
-
items: mockItems,
|
|
273
|
-
enabled: true,
|
|
274
|
-
}),
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
expect(mockUseERC1155SaleContractCheckout).toHaveBeenCalledWith(
|
|
278
|
-
expect.objectContaining({
|
|
279
|
-
chain: 137,
|
|
280
|
-
}),
|
|
281
|
-
);
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
it('should omit checkoutOptions when not provided', () => {
|
|
285
|
-
const mockCheckout = {
|
|
286
|
-
openCheckoutModal: vi.fn(),
|
|
287
|
-
isLoading: false,
|
|
288
|
-
isError: false,
|
|
289
|
-
};
|
|
290
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
291
|
-
|
|
292
|
-
renderHook(() =>
|
|
293
|
-
useERC1155Checkout({
|
|
294
|
-
chainId: 1,
|
|
295
|
-
salesContractAddress: '0x456',
|
|
296
|
-
collectionAddress: '0x123',
|
|
297
|
-
items: mockItems,
|
|
298
|
-
enabled: true,
|
|
299
|
-
}),
|
|
300
|
-
);
|
|
301
|
-
|
|
302
|
-
const callArgs = mockUseERC1155SaleContractCheckout.mock.calls[0][0];
|
|
303
|
-
expect(callArgs).not.toHaveProperty('checkoutOptions');
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
it('should spread all properties from useERC1155SaleContractCheckout', () => {
|
|
307
|
-
const mockCheckout = {
|
|
308
|
-
openCheckoutModal: vi.fn(),
|
|
309
|
-
isLoading: false,
|
|
310
|
-
isError: false,
|
|
311
|
-
additionalProp: 'test',
|
|
312
|
-
};
|
|
313
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
314
|
-
|
|
315
|
-
const { result } = renderHook(() =>
|
|
316
|
-
useERC1155Checkout({
|
|
317
|
-
chainId: 1,
|
|
318
|
-
salesContractAddress: '0x456',
|
|
319
|
-
collectionAddress: '0x123',
|
|
320
|
-
items: mockItems,
|
|
321
|
-
enabled: true,
|
|
322
|
-
}),
|
|
323
|
-
);
|
|
324
|
-
|
|
325
|
-
expect(result.current.openCheckoutModal).toBe(
|
|
326
|
-
mockCheckout.openCheckoutModal,
|
|
327
|
-
);
|
|
328
|
-
expect(result.current.isLoading).toBe(mockCheckout.isLoading);
|
|
329
|
-
expect(result.current.isError).toBe(mockCheckout.isError);
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
it('should include callback functions in checkout params', () => {
|
|
333
|
-
const mockCheckout = {
|
|
334
|
-
openCheckoutModal: vi.fn(),
|
|
335
|
-
isLoading: false,
|
|
336
|
-
isError: false,
|
|
337
|
-
};
|
|
338
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
339
|
-
|
|
340
|
-
renderHook(() =>
|
|
341
|
-
useERC1155Checkout({
|
|
342
|
-
chainId: 1,
|
|
343
|
-
salesContractAddress: '0x456',
|
|
344
|
-
collectionAddress: '0x123',
|
|
345
|
-
items: mockItems,
|
|
346
|
-
enabled: true,
|
|
347
|
-
}),
|
|
348
|
-
);
|
|
349
|
-
|
|
350
|
-
const callArgs = mockUseERC1155SaleContractCheckout.mock.calls[0][0];
|
|
351
|
-
|
|
352
|
-
expect(callArgs.onSuccess).toBeInstanceOf(Function);
|
|
353
|
-
expect(callArgs.onError).toBeInstanceOf(Function);
|
|
354
|
-
expect(callArgs.onClose).toBeInstanceOf(Function);
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
it('should use empty wallet string when address is undefined', async () => {
|
|
358
|
-
const { useAccount } = vi.mocked(await import('wagmi'));
|
|
359
|
-
useAccount.mockReturnValue({
|
|
360
|
-
address: undefined,
|
|
361
|
-
isConnected: false,
|
|
362
|
-
isConnecting: false,
|
|
363
|
-
isDisconnected: true,
|
|
364
|
-
isReconnecting: false,
|
|
365
|
-
connector: null,
|
|
366
|
-
addresses: undefined,
|
|
367
|
-
chain: undefined,
|
|
368
|
-
chainId: undefined,
|
|
369
|
-
status: 'disconnected',
|
|
370
|
-
} as never);
|
|
371
|
-
|
|
372
|
-
const mockCheckout = {
|
|
373
|
-
openCheckoutModal: vi.fn(),
|
|
374
|
-
isLoading: false,
|
|
375
|
-
isError: false,
|
|
376
|
-
};
|
|
377
|
-
mockUseERC1155SaleContractCheckout.mockReturnValue(mockCheckout);
|
|
378
|
-
|
|
379
|
-
renderHook(() =>
|
|
380
|
-
useERC1155Checkout({
|
|
381
|
-
chainId: 1,
|
|
382
|
-
salesContractAddress: '0x456',
|
|
383
|
-
collectionAddress: '0x123',
|
|
384
|
-
items: mockItems,
|
|
385
|
-
enabled: true,
|
|
386
|
-
}),
|
|
387
|
-
);
|
|
388
|
-
|
|
389
|
-
expect(mockUseERC1155SaleContractCheckout).toHaveBeenCalledWith(
|
|
390
|
-
expect.objectContaining({
|
|
391
|
-
wallet: '',
|
|
392
|
-
}),
|
|
393
|
-
);
|
|
394
|
-
});
|
|
395
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { useERC1155SaleContractCheckout } from '@0xsequence/checkout';
|
|
2
|
-
import type { Hash } from 'viem';
|
|
3
|
-
import { useAccount } from 'wagmi';
|
|
4
|
-
import type {
|
|
5
|
-
CheckoutOptions,
|
|
6
|
-
CheckoutOptionsItem,
|
|
7
|
-
} from '../../../../_internal';
|
|
8
|
-
import {
|
|
9
|
-
balanceQueries,
|
|
10
|
-
collectableKeys,
|
|
11
|
-
getQueryClient,
|
|
12
|
-
} from '../../../../_internal';
|
|
13
|
-
import {
|
|
14
|
-
buyModalStore,
|
|
15
|
-
useBuyAnalyticsId,
|
|
16
|
-
useBuyModalProps,
|
|
17
|
-
useOnError,
|
|
18
|
-
useOnSuccess,
|
|
19
|
-
useQuantity,
|
|
20
|
-
} from '../store';
|
|
21
|
-
|
|
22
|
-
interface UseERC1155CheckoutParams {
|
|
23
|
-
chainId: number;
|
|
24
|
-
salesContractAddress: string;
|
|
25
|
-
collectionAddress: string;
|
|
26
|
-
items: Array<CheckoutOptionsItem>;
|
|
27
|
-
checkoutOptions?: CheckoutOptions;
|
|
28
|
-
customProviderCallback?: (
|
|
29
|
-
onSuccess: (txHash: string) => void,
|
|
30
|
-
onError: (error: Error) => void,
|
|
31
|
-
onClose: () => void,
|
|
32
|
-
) => void;
|
|
33
|
-
enabled?: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const useERC1155Checkout = ({
|
|
37
|
-
chainId,
|
|
38
|
-
salesContractAddress,
|
|
39
|
-
collectionAddress,
|
|
40
|
-
items,
|
|
41
|
-
checkoutOptions,
|
|
42
|
-
customProviderCallback,
|
|
43
|
-
enabled = true,
|
|
44
|
-
}: UseERC1155CheckoutParams) => {
|
|
45
|
-
const { address: accountAddress } = useAccount();
|
|
46
|
-
const quantity = useQuantity();
|
|
47
|
-
const onSuccess = useOnSuccess();
|
|
48
|
-
const onError = useOnError();
|
|
49
|
-
const saleAnalyticsId = useBuyAnalyticsId();
|
|
50
|
-
|
|
51
|
-
const buyModalProps = useBuyModalProps();
|
|
52
|
-
|
|
53
|
-
const checkout = useERC1155SaleContractCheckout({
|
|
54
|
-
chain: chainId,
|
|
55
|
-
contractAddress: salesContractAddress,
|
|
56
|
-
collectionAddress,
|
|
57
|
-
items: [
|
|
58
|
-
{
|
|
59
|
-
...items[0],
|
|
60
|
-
quantity: quantity?.toString() || '1',
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
wallet: accountAddress ?? '',
|
|
64
|
-
// Pass checkout options if available
|
|
65
|
-
...(checkoutOptions && { checkoutOptions }),
|
|
66
|
-
onSuccess: (txHash?: string) => {
|
|
67
|
-
if (txHash) {
|
|
68
|
-
onSuccess({ hash: txHash as Hash });
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
onError: (error: Error) => {
|
|
72
|
-
onError(error);
|
|
73
|
-
},
|
|
74
|
-
onClose: () => {
|
|
75
|
-
const queryClient = getQueryClient();
|
|
76
|
-
queryClient.invalidateQueries({
|
|
77
|
-
queryKey: balanceQueries.inventory,
|
|
78
|
-
});
|
|
79
|
-
queryClient.invalidateQueries({
|
|
80
|
-
queryKey: [...collectableKeys.userBalances],
|
|
81
|
-
refetchType: 'inactive',
|
|
82
|
-
});
|
|
83
|
-
queryClient.invalidateQueries({
|
|
84
|
-
queryKey: collectableKeys.listPrimarySaleItems,
|
|
85
|
-
});
|
|
86
|
-
buyModalStore.send({ type: 'close' });
|
|
87
|
-
},
|
|
88
|
-
customProviderCallback,
|
|
89
|
-
supplementaryAnalyticsInfo: {
|
|
90
|
-
marketplaceType: 'shop',
|
|
91
|
-
saleAnalyticsId,
|
|
92
|
-
},
|
|
93
|
-
successActionButtons: buyModalProps.successActionButtons,
|
|
94
|
-
...(buyModalProps.onRampProvider && {
|
|
95
|
-
onRampProvider: buyModalProps.onRampProvider,
|
|
96
|
-
}),
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
return {
|
|
100
|
-
...checkout,
|
|
101
|
-
isEnabled: Boolean(enabled && accountAddress),
|
|
102
|
-
};
|
|
103
|
-
};
|