@0xsequence/marketplace-sdk 0.8.12 → 0.9.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 +91 -23
- package/dist/{CartIcon-Bll1rbxv.js → CalendarIcon-DbQ7Vxcw.js} +38 -38
- package/dist/CalendarIcon-DbQ7Vxcw.js.map +1 -0
- package/dist/{types-BIJOaL4j.d.ts → CollectibleCard-C8Ae64Ab.d.ts} +7 -4
- package/dist/{_internal-69NEWNUE.js → _internal-BgWcRIak.js} +2 -14
- package/dist/_internal-BgWcRIak.js.map +1 -0
- package/dist/{api-1KFxYh7o.js → api-DTIan01C.js} +73 -64
- package/dist/api-DTIan01C.js.map +1 -0
- package/dist/{builder-api-BQvzykoU.js → builder-api-BFuZNOaN.js} +2 -2
- package/dist/{builder-api-BQvzykoU.js.map → builder-api-BFuZNOaN.js.map} +1 -1
- package/dist/{builder-api-DoK3907S.d.ts → builder-api-C_zj5mr3.d.ts} +2 -2
- package/dist/{builder.gen-CxP9NT1p.js → builder.gen-B9wR2nvF.js} +1 -1
- package/dist/builder.gen-B9wR2nvF.js.map +1 -0
- package/dist/{index-Cl7PQOGu.d.ts → index-21LE7OhL.d.ts} +24 -24
- package/dist/{index-1bezgsFq.d.ts → index-BL9RUSEK.d.ts} +929 -255
- package/dist/index-BQsgAvtX.d.ts +2938 -0
- package/dist/{index-DafWjEb4.d.ts → index-BUVWziLP.d.ts} +9 -14
- package/dist/{index-BIMIpDiI.d.ts → index-ByznONYE.d.ts} +98 -99
- package/dist/{index-BjIwVzc4.d.ts → index-CLy8y5hm.d.ts} +238 -238
- package/dist/{index-CN8puQQJ.d.ts → index-COt10OgI.d.ts} +4 -4
- package/dist/index-DPNWNa7t.d.ts +414 -0
- package/dist/{index-BEYefG1G.d.ts → index-DaE5ZNHb.d.ts} +2 -2
- package/dist/{index-BfH21xmk.d.ts → index-DsfCs3-x.d.ts} +46 -41
- package/dist/{index-4-kfOFdx.d.ts → index-dUb6wb4Y.d.ts} +5 -5
- package/dist/index.css +14 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -7
- package/dist/marketplace-logos-CSeGcPW4.js.map +1 -1
- package/dist/{marketplace.gen-Dqk8vRmD.js → marketplace.gen-BSDIX7NZ.js} +12 -3
- package/dist/marketplace.gen-BSDIX7NZ.js.map +1 -0
- package/dist/{marketplaceConfig-D2MYFqll.js → marketplaceConfig-C6X1SUik.js} +2 -2
- package/dist/marketplaceConfig-C6X1SUik.js.map +1 -0
- package/dist/{sdk-config-DJzxVPld.d.ts → new-marketplace-types-Bfis0U4J.d.ts} +65 -54
- package/dist/options-B4QN7Xou.js +0 -0
- package/dist/{primary-sale-Cw95phYC.js → primary-sale-C55ALnfQ.js} +279 -279
- package/dist/primary-sale-C55ALnfQ.js.map +1 -0
- package/dist/{queries-DPvwtnO7.js → queries-CUU65uYZ.js} +247 -134
- package/dist/queries-CUU65uYZ.js.map +1 -0
- package/dist/react/_internal/api/index.d.ts +4 -4
- package/dist/react/_internal/api/index.js +5 -5
- package/dist/react/_internal/databeat/index.d.ts +3 -3
- package/dist/react/_internal/databeat/index.js +15 -15
- package/dist/react/_internal/index.d.ts +7 -7
- package/dist/react/_internal/index.js +7 -7
- package/dist/react/_internal/wagmi/index.d.ts +3 -3
- package/dist/react/_internal/wagmi/index.js +2 -2
- package/dist/react/hooks/index.d.ts +15 -14
- package/dist/react/hooks/index.js +16 -16
- package/dist/react/hooks/options/index.d.ts +4 -5
- package/dist/react/hooks/options/index.js +9 -9
- package/dist/react/index.d.ts +15 -37
- package/dist/react/index.js +16 -16
- package/dist/react/queries/index.d.ts +8 -8
- package/dist/react/queries/index.js +12 -12
- package/dist/react/ssr/index.d.ts +6 -6
- package/dist/react/ssr/index.js +7 -7
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +8 -9
- package/dist/react/ui/components/marketplace-collectible-card/index.js +15 -15
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +7 -7
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +7 -7
- package/dist/react/ui/components/marketplace-logos/index.d.ts +21 -21
- package/dist/react/ui/icons/index.js +6 -6
- package/dist/react/ui/index.d.ts +8 -9
- package/dist/react/ui/index.js +15 -15
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +5 -5
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +15 -15
- package/dist/{react-BG7o4PId.js → react-DAIicQPT.js} +7422 -6835
- package/dist/react-DAIicQPT.js.map +1 -0
- package/dist/{token-CO5llIla.js → token-Da4TdyUk.js} +1540 -761
- package/dist/token-Da4TdyUk.js.map +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +2 -2
- package/dist/types-DwWE6xOF.js.map +1 -1
- package/dist/utils/abi/index.d.ts +3 -3
- package/dist/utils/abi/index.js +3 -3
- 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 +2 -2
- package/dist/utils/abi/token/index.js +2 -2
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/index.js +6 -6
- package/dist/{utils-Cat9_pef.js → utils-BPYfgDSL.js} +2 -2
- package/dist/{utils-Cat9_pef.js.map → utils-BPYfgDSL.js.map} +1 -1
- package/dist/{utils-BFdxaToy.js → utils-CW2NA5KG.js} +87 -87
- package/dist/utils-CW2NA5KG.js.map +1 -0
- package/dist/{wagmi-DRctYEk6.js → wagmi-CDzEQbfk.js} +19 -12
- package/dist/wagmi-CDzEQbfk.js.map +1 -0
- package/eslint/use-client.js +0 -6
- package/package.json +30 -31
- package/src/index.ts +1 -1
- package/src/react/_internal/api/__mocks__/builder.msw.ts +5 -3
- package/src/react/_internal/api/__mocks__/indexer.msw.ts +8 -8
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +4 -6
- package/src/react/_internal/api/__mocks__/metadata.msw.ts +1 -1
- package/src/react/_internal/api/builder.gen.ts +6 -6
- package/src/react/_internal/api/get-query-client.ts +2 -2
- package/src/react/_internal/api/index.ts +2 -2
- package/src/react/_internal/api/marketplace.gen.ts +42 -4
- package/src/react/_internal/api/query-keys.ts +13 -6
- package/src/react/_internal/api/services.ts +28 -31
- package/src/react/_internal/index.ts +1 -1
- package/src/react/_internal/types.ts +10 -23
- package/src/react/_internal/utils.ts +1 -2
- package/src/react/_internal/wagmi/create-config.ts +20 -11
- package/src/react/_internal/wagmi/get-connectors.ts +9 -7
- package/src/react/_internal/wallet/__tests__/wallet.test.ts +1 -1
- package/src/react/_internal/wallet/wallet.ts +18 -18
- package/src/react/hooks/__tests__/__snapshots__/useListCollections.test.tsx.snap +20 -0
- package/src/react/hooks/__tests__/__snapshots__/useMarketplaceConfig.test.tsx.snap +12 -2
- package/src/react/hooks/__tests__/useAutoSelectFeeOption.test.tsx +1 -1
- package/src/react/hooks/__tests__/useBalanceOfCollectible.test.tsx +1 -1
- package/src/react/hooks/__tests__/useCancelOrder.test.tsx +4 -4
- package/src/react/hooks/__tests__/useCancelTransactionSteps.test.tsx +1 -1
- package/src/react/hooks/__tests__/useCollectible.test.tsx +14 -16
- package/src/react/hooks/__tests__/useCollection.test.tsx +4 -4
- package/src/react/hooks/__tests__/useCollectionBalanceDetails.test.tsx +1 -27
- package/src/react/hooks/__tests__/useCollectionDetails.test.tsx +1 -1
- package/src/react/hooks/__tests__/useCollectionDetailsPolling.test.tsx +1 -1
- package/src/react/hooks/__tests__/useComparePrices.test.tsx +7 -6
- package/src/react/hooks/__tests__/useConvertPriceToUSD.test.tsx +1 -1
- package/src/react/hooks/__tests__/useCountListingsForCollectible.test.tsx +2 -2
- package/src/react/hooks/__tests__/useCountOfCollectables.test.tsx +5 -5
- package/src/react/hooks/__tests__/useCountOffersForCollectible.test.tsx +2 -2
- package/src/react/hooks/__tests__/useCurrency.test.tsx +5 -3
- package/src/react/hooks/__tests__/useFilters.test.tsx +1 -1
- package/src/react/hooks/__tests__/useFloorOrder.test.tsx +4 -4
- package/src/react/hooks/__tests__/useGenerateCancelTransaction.test.tsx +3 -3
- package/src/react/hooks/__tests__/useGenerateListingTransaction.test.tsx +1 -1
- package/src/react/hooks/__tests__/useGenerateOfferTransaction.test.tsx +1 -1
- package/src/react/hooks/__tests__/useGenerateSellTransaction.test.tsx +1 -1
- package/src/react/hooks/__tests__/useGetTokenSuppliesMap.test.tsx +104 -0
- package/src/react/hooks/__tests__/useHighestOffer.test.tsx +4 -4
- package/src/react/hooks/__tests__/useInventory.test.tsx +1 -1
- package/src/react/hooks/__tests__/useListCollectibleActivities.test.tsx +11 -13
- package/src/react/hooks/__tests__/useListCollectibles.test.tsx +5 -5
- package/src/react/hooks/__tests__/useListCollectiblesPaginated.test.tsx +10 -15
- package/src/react/hooks/__tests__/useListCollectionActivities.test.tsx +13 -15
- package/src/react/hooks/__tests__/useListCollections.test.tsx +3 -3
- package/src/react/hooks/__tests__/useListListingsForCollectible.test.tsx +3 -2
- package/src/react/hooks/__tests__/useListMarketCardData.test.tsx +301 -0
- package/src/react/hooks/__tests__/useListOffersForCollectible.test.tsx +1 -1
- package/src/react/hooks/__tests__/useListTokenMetadata.test.tsx +111 -0
- package/src/react/hooks/__tests__/useLowestListing.test.tsx +1 -1
- package/src/react/hooks/__tests__/useMarketCurrencies.test.tsx +1 -1
- package/src/react/hooks/__tests__/useRoyalty.test.tsx +0 -23
- package/src/react/hooks/index.ts +27 -24
- package/src/react/hooks/options/index.ts +0 -1
- package/src/react/hooks/useAutoSelectFeeOption.tsx +1 -1
- package/src/react/hooks/useBalanceOfCollectible.tsx +1 -1
- package/src/react/hooks/useCancelTransactionSteps.tsx +2 -2
- package/src/react/hooks/useCheckoutOptionsSalesContract.tsx +1 -1
- package/src/react/hooks/useCollectible.tsx +64 -49
- package/src/react/hooks/useCollection.tsx +60 -11
- package/src/react/hooks/useCollectionBalanceDetails.tsx +20 -27
- package/src/react/hooks/useCollectionDetails.ts +69 -0
- package/src/react/hooks/useCollectionDetailsPolling.tsx +10 -2
- package/src/react/hooks/useComparePrices.tsx +18 -21
- package/src/react/hooks/useConvertPriceToUSD.tsx +20 -37
- package/src/react/hooks/useCountListingsForCollectible.tsx +64 -53
- package/src/react/hooks/useCountOfCollectables.tsx +60 -69
- package/src/react/hooks/useCountOfPrimarySaleItems.tsx +13 -0
- package/src/react/hooks/useCountOffersForCollectible.tsx +64 -53
- package/src/react/hooks/useCurrency.tsx +56 -64
- package/src/react/hooks/useFilterState.tsx +1 -2
- package/src/react/hooks/useFloorOrder.tsx +65 -40
- package/src/react/hooks/useGenerateCancelTransaction.tsx +5 -10
- package/src/react/hooks/useGenerateListingTransaction.tsx +1 -1
- package/src/react/hooks/useGenerateOfferTransaction.tsx +1 -1
- package/src/react/hooks/useGenerateSellTransaction.tsx +5 -10
- package/src/react/hooks/useGetReceiptFromHash.tsx +32 -3
- package/src/react/hooks/{useGetTokenSuppliesMap.ts → useGetTokenRanges.tsx} +15 -17
- package/src/react/hooks/useGetTokenSuppliesMap.tsx +73 -0
- package/src/react/hooks/useHighestOffer.tsx +68 -4
- package/src/react/hooks/useInventory.tsx +1 -1
- package/src/react/hooks/useList1155ShopCardData.tsx +55 -82
- package/src/react/hooks/useList721ShopCardData.tsx +93 -63
- package/src/react/hooks/useListBalances.tsx +1 -1
- package/src/react/hooks/useListCollectibleActivities.tsx +89 -50
- package/src/react/hooks/useListCollectibles.tsx +81 -16
- package/src/react/hooks/useListCollectiblesPaginated.tsx +96 -66
- package/src/react/hooks/useListCollectionActivities.tsx +84 -50
- package/src/react/hooks/useListCollections.tsx +72 -18
- package/src/react/hooks/useListListingsForCollectible.tsx +90 -50
- package/src/react/hooks/useListMarketCardData.tsx +1 -1
- package/src/react/hooks/useListOffersForCollectible.tsx +9 -14
- package/src/react/hooks/useListPrimarySaleItems.ts +72 -12
- package/src/react/hooks/useListShopCardData.tsx +70 -0
- package/src/react/hooks/useListTokenMetadata.tsx +73 -0
- package/src/react/hooks/useLowestListing.tsx +68 -4
- package/src/react/hooks/useMarketCurrencies.tsx +62 -5
- package/src/react/hooks/useRoyalty.tsx +57 -13
- package/src/react/hooks/useShopCollectibleSaleData.tsx +349 -0
- package/src/react/hooks/useTransferTokens.tsx +1 -1
- package/src/react/hooks/util/optimisticCancelUpdates.ts +5 -7
- package/src/react/index.ts +5 -3
- package/src/react/queries/balanceOfCollectible.ts +1 -1
- package/src/react/queries/collectible.ts +66 -0
- package/src/react/queries/collection.ts +55 -0
- package/src/react/queries/collectionDetails.ts +64 -0
- package/src/react/queries/countListingsForCollectible.ts +73 -0
- package/src/react/queries/countOfCollectables.ts +83 -0
- package/src/react/queries/countOfPrimarySaleItems.ts +48 -0
- package/src/react/queries/countOffersForCollectible.ts +73 -0
- package/src/react/queries/currency.ts +83 -0
- package/src/react/queries/floorOrder.ts +63 -0
- package/src/react/queries/getTokenSuppliesMap.ts +77 -0
- package/src/react/queries/highestOffer.ts +46 -40
- package/src/react/queries/index.ts +7 -4
- package/src/react/queries/inventory.ts +4 -4
- package/src/react/queries/listBalances.ts +1 -1
- package/src/react/queries/listCollectibleActivities.ts +97 -0
- package/src/react/queries/listCollectibles.ts +67 -50
- package/src/react/queries/listCollectiblesPaginated.ts +87 -0
- package/src/react/queries/listCollectionActivities.ts +95 -0
- package/src/react/queries/listCollections.ts +47 -8
- package/src/react/queries/listListingsForCollectible.ts +82 -0
- package/src/react/queries/listTokenMetadata.ts +47 -23
- package/src/react/queries/lowestListing.ts +46 -31
- package/src/react/queries/marketCurrencies.ts +42 -29
- package/src/react/queries/marketplaceConfig.ts +3 -3
- package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +12 -2
- package/src/react/ssr/create-ssr-client.ts +1 -1
- package/src/react/types/query.ts +34 -0
- package/src/react/ui/components/ModelViewer.tsx +1 -1
- package/src/react/ui/components/_internals/action-button/__tests__/useActionButtonLogic.test.tsx +14 -8
- package/src/react/ui/components/_internals/action-button/hooks/useActionButtonLogic.ts +12 -15
- package/src/react/ui/components/_internals/action-button/store.ts +46 -18
- package/src/react/ui/components/marketplace-collectible-card/CollectibleCard.tsx +1 -1
- package/src/react/ui/components/marketplace-collectible-card/Footer.tsx +1 -1
- package/src/react/ui/components/marketplace-collectible-card/components/BaseCard.tsx +3 -0
- package/src/react/ui/components/marketplace-collectible-card/index.ts +1 -1
- package/src/react/ui/components/marketplace-collectible-card/types.ts +7 -4
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +3 -2
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +2 -5
- package/src/react/ui/components/marketplace-logos/marketplace-logos.tsx +1 -1
- package/src/react/ui/components/media/Media.tsx +5 -1
- package/src/react/ui/index.ts +8 -10
- package/src/react/ui/modals/BuyModal/__tests__/ERC1155ShopModal.test.tsx +94 -87
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +4 -4
- package/src/react/ui/modals/BuyModal/__tests__/store.test.ts +1 -1
- package/src/react/ui/modals/BuyModal/components/ERC1155QuantityModal.tsx +3 -4
- package/src/react/ui/modals/BuyModal/components/ERC1155ShopModal.tsx +1 -1
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useCheckoutOptions.test.tsx +1 -1
- package/src/react/ui/modals/BuyModal/hooks/useCheckoutOptions.ts +1 -1
- package/src/react/ui/modals/BuyModal/hooks/useERC721SalePaymentParams.ts +1 -1
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +3 -3
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +1 -1
- package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +2 -2
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +0 -1
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +2 -2
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +7 -6
- package/src/react/ui/modals/CreateListingModal/index.tsx +1 -1
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +2 -2
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +1 -1
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +1 -1
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +0 -1
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +7 -7
- package/src/react/ui/modals/MakeOfferModal/index.tsx +1 -1
- package/src/react/ui/modals/SellModal/Modal.tsx +3 -3
- package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +6 -4
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +1 -1
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +0 -1
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +6 -6
- package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +1 -1
- package/src/react/ui/modals/TransferModal/_store.ts +1 -7
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/TokenQuantityInput.tsx +2 -3
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +2 -2
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.test.tsx +1 -1
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +2 -4
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +1 -1
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +0 -1
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +4 -4
- package/src/react/ui/modals/_internal/components/quantityInput/QuantityInputBase.tsx +166 -0
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +12 -141
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +1 -1
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/_components/BalanceIndicator.tsx +1 -2
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +0 -1
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/hooks/useTransactionStatus.ts +0 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +1 -1
- package/src/react/ui/modals/_internal/components/waasFeeOptionsSelect/WaasFeeOptionsSelect.tsx +1 -1
- package/src/react/ui/modals/modal-provider.tsx +2 -3
- package/src/types/api-types.ts +36 -36
- package/src/types/buyModalErrors.ts +1 -1
- package/src/types/index.ts +5 -5
- package/src/types/new-marketplace-types.ts +1 -1
- package/src/types/sdk-config.ts +2 -1
- package/src/types/types.ts +1 -0
- package/src/types/waas-types.ts +1 -1
- package/src/utils/abi/index.ts +1 -1
- package/src/utils/abi/primary-sale/index.ts +1 -1
- package/src/utils/abi/token/index.ts +2 -1
- package/src/utils/decode/erc20.ts +1 -1
- package/src/utils/index.ts +3 -3
- package/test/const.ts +3 -1
- package/test/mocks/wallet.ts +1 -1
- package/test/test-utils.tsx +3 -4
- package/.changeset/fluffy-jokes-lay.md +0 -5
- package/.changeset/wise-bugs-boil.md +0 -8
- package/dist/CartIcon-Bll1rbxv.js.map +0 -1
- package/dist/CollectibleCard-CLQTl0_6.d.ts +0 -8
- package/dist/_internal-69NEWNUE.js.map +0 -1
- package/dist/api-1KFxYh7o.js.map +0 -1
- package/dist/builder.gen-CxP9NT1p.js.map +0 -1
- package/dist/index-BHiSG-Yi.d.ts +0 -312
- package/dist/index-BQW0PUkQ.d.ts +0 -3973
- package/dist/marketplace.gen-Dqk8vRmD.js.map +0 -1
- package/dist/marketplaceConfig-D2MYFqll.js.map +0 -1
- package/dist/options-DCi6_23w.js +0 -34
- package/dist/options-DCi6_23w.js.map +0 -1
- package/dist/primary-sale-Cw95phYC.js.map +0 -1
- package/dist/queries-DPvwtnO7.js.map +0 -1
- package/dist/react-BG7o4PId.js.map +0 -1
- package/dist/token-CO5llIla.js.map +0 -1
- package/dist/useCollection-C-mclKU0.d.ts +0 -66
- package/dist/utils-BFdxaToy.js.map +0 -1
- package/dist/wagmi-DRctYEk6.js.map +0 -1
- package/src/react/_internal/api/zod-schema.ts +0 -678
- package/src/react/hooks/options/collectionOptions.ts +0 -41
- package/src/react/hooks/useCheckoutOptions.tsx +0 -66
- package/src/react/hooks/useCollectionDetails.tsx +0 -50
- package/src/react/hooks/useListTokenMetadata.ts +0 -19
- package/src/react/queries/getTokenSupplies.ts +0 -38
- package/tsconfig.tsbuildinfo +0 -1
- /package/dist/{index-ij9f8GAA.d.ts → index-DvpBZgor.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wagmi-CDzEQbfk.js","names":["marketplaceConfig: MarketplaceConfig","sdkConfig: SdkConfig","config: SdkConfig","wallets: Wallet[]","url: string | undefined","name: string","env: Env","marketplaceConfig: MarketplaceConfig","sdkConfig: SdkConfig","ssr?: boolean","marketConfig: MarketplaceConfig","chains: [Chain, ...Chain[]]","projectAccessKey: string","nodeGatewayEnv: Env | undefined","nodeGatewayUrl?: string","rpcUrl: string"],"sources":["../src/react/_internal/consts.ts","../src/react/_internal/wagmi/get-connectors.ts","../src/react/_internal/wagmi/create-config.ts"],"sourcesContent":["export const DEFAULT_NETWORK = 137;\n","import {\n\tapple,\n\tappleWaas,\n\tcoinbaseWallet,\n\tecosystemWallet,\n\temail,\n\temailWaas,\n\tfacebook,\n\tgetConnectWallets,\n\tgoogle,\n\tgoogleWaas,\n\ttype SequenceOptions,\n\tsequence,\n\ttwitch,\n\ttype Wallet,\n\twalletConnect,\n} from '@0xsequence/connect';\nimport React, { type FunctionComponent } from 'react';\nimport type { CreateConnectorFn } from 'wagmi';\nimport type { Env, SdkConfig } from '../../../types';\nimport type { MarketplaceConfig } from '../../../types/new-marketplace-types';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { MarketplaceWalletType } from '../api/builder.gen';\nimport { DEFAULT_NETWORK } from '../consts';\n\nexport function getConnectors({\n\tmarketplaceConfig,\n\tsdkConfig,\n\twalletType,\n}: {\n\tmarketplaceConfig: MarketplaceConfig;\n\tsdkConfig: SdkConfig;\n\twalletType: MarketplaceWalletType;\n}): CreateConnectorFn[] {\n\tconst connectors = commonConnectors(marketplaceConfig, sdkConfig);\n\n\tif (walletType === MarketplaceWalletType.UNIVERSAL) {\n\t\tconnectors.push(...getUniversalWalletConfigs(sdkConfig, marketplaceConfig));\n\t} else if (walletType === MarketplaceWalletType.EMBEDDED) {\n\t\tconnectors.push(...getWaasConnectors(sdkConfig, marketplaceConfig));\n\t} else if (walletType === MarketplaceWalletType.ECOSYSTEM) {\n\t\tconnectors.push(getEcosystemConnector(marketplaceConfig, sdkConfig));\n\t} else {\n\t\tthrow new Error('Invalid wallet type');\n\t}\n\n\treturn getConnectWallets(sdkConfig.projectAccessKey, connectors);\n}\n\nfunction commonConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n) {\n\tconst wallets = [];\n\tconst { title: appName } = marketplaceConfig.settings;\n\tconst walletOptions = marketplaceConfig.settings.walletOptions;\n\tconst walletConnectProjectId = sdkConfig.walletConnectProjectId;\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(\n\t\t\tcoinbaseWallet({\n\t\t\t\tappName,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(\n\t\t\twalletConnect({\n\t\t\t\tprojectId: walletConnectProjectId,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn wallets;\n}\n\nfunction getUniversalWalletConfigs(\n\tconfig: SdkConfig,\n\tmarketplaceConfig: MarketplaceConfig,\n): Wallet[] {\n\tconst sequenceWalletOverrides =\n\t\tconfig._internal?.overrides?.api?.sequenceWallet;\n\tconst sequenceWalletUrl =\n\t\tsequenceWalletOverrides?.url ||\n\t\tgetSequenceWalletURL(sequenceWalletOverrides?.env || 'production');\n\tconst projectAccessKey =\n\t\tsequenceWalletOverrides?.accessKey || config.projectAccessKey;\n\n\tconst sequenceWalletOptions = {\n\t\twalletAppURL: sequenceWalletUrl,\n\t\tdefaultNetwork: DEFAULT_NETWORK,\n\t\tconnect: {\n\t\t\tprojectAccessKey,\n\t\t\tapp: marketplaceConfig.settings.title,\n\t\t\tsettings: {\n\t\t\t\t// TODO: make a separate config for this?\n\t\t\t\tbannerUrl: marketplaceConfig.market.ogImage,\n\t\t\t},\n\t\t},\n\t} satisfies SequenceOptions;\n\n\treturn [\n\t\tsequence(sequenceWalletOptions),\n\t\temail(sequenceWalletOptions),\n\t\tfacebook(sequenceWalletOptions),\n\t\tgoogle(sequenceWalletOptions),\n\t\tapple(sequenceWalletOptions),\n\t\ttwitch(sequenceWalletOptions),\n\t] as const;\n}\n\nexport function getWaasConnectors(\n\tconfig: SdkConfig,\n\tmarketplaceConfig: MarketplaceConfig,\n): Wallet[] {\n\tconst { projectAccessKey } = config;\n\n\tconst waasConfigKey =\n\t\tmarketplaceConfig.settings.walletOptions.embedded?.tenantKey;\n\n\tif (!waasConfigKey)\n\t\tthrow new MissingConfigError(\n\t\t\t'Embedded wallet config is missing, please check your access key',\n\t\t);\n\n\tconst waasOptions = marketplaceConfig.settings.walletOptions.oidcIssuers;\n\tconst googleClientId = waasOptions.google;\n\tconst appleClientId = waasOptions.apple;\n\tconst appleRedirectURI =\n\t\ttypeof window !== 'undefined'\n\t\t\t? `${window.location.origin}${window.location.pathname}`\n\t\t\t: undefined;\n\n\tconst wallets: Wallet[] = [];\n\n\tif (marketplaceConfig.settings.walletOptions.embedded?.emailEnabled) {\n\t\twallets.push(\n\t\t\temailWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\twaasConfigKey,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (googleClientId) {\n\t\twallets.push(\n\t\t\tgoogleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tgoogleClientId,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (appleClientId) {\n\t\twallets.push(\n\t\t\tappleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tappleClientId,\n\t\t\t\tappleRedirectURI,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn wallets;\n}\n\nexport function getEcosystemConnector(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n): Wallet {\n\tconst ecosystemOptions = marketplaceConfig.settings.walletOptions.ecosystem;\n\tif (!ecosystemOptions) throw new MissingConfigError('ecosystem');\n\tconst { walletAppName, walletUrl, logoDarkUrl, logoLightUrl } =\n\t\tecosystemOptions;\n\n\treturn ecosystemWallet({\n\t\tprojectAccessKey: sdkConfig.projectAccessKey,\n\t\twalletUrl,\n\t\tname: walletAppName,\n\t\tdefaultNetwork: DEFAULT_NETWORK,\n\t\tlogoDark: getEcosystemLogo(logoDarkUrl, walletAppName),\n\t\tlogoLight: getEcosystemLogo(logoLightUrl, walletAppName),\n\t});\n}\n\nfunction getEcosystemLogo(\n\turl: string | undefined,\n\tname: string,\n): FunctionComponent {\n\tif (!url) return () => null;\n\tconst Logo = () =>\n\t\tReact.createElement('img', { src: url, alt: name, width: 32, height: 32 });\n\tLogo.displayName = 'EcosystemLogo';\n\treturn Logo;\n}\n\nfunction getSequenceWalletURL(env: Env) {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\treturn 'https://dev.sequence.app';\n\t\tcase 'next':\n\t\t\treturn 'https://next.sequence.app';\n\t\t// biome-ignore lint/complexity/noUselessSwitchCase: Production case kept for readability alongside other environments\n\t\tcase 'production':\n\t\tdefault:\n\t\t\treturn 'https://sequence.app';\n\t}\n}\n","import { getDefaultChains } from '@0xsequence/connect';\nimport { allNetworks, findNetworkConfig } from '@0xsequence/network';\nimport type { Chain, Transport } from 'viem';\nimport { cookieStorage, createConfig, createStorage, http } from 'wagmi';\nimport type { Env, SdkConfig } from '../../../types';\nimport type { MarketplaceConfig } from '../../../types/new-marketplace-types';\nimport { DEFAULT_NETWORK } from '../consts';\nimport { getConnectors } from './get-connectors';\n\nexport const createWagmiConfig = (\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n\tssr?: boolean,\n) => {\n\tconst chains = getChainConfigs(marketplaceConfig);\n\tconst nodeGatewayOverrides = sdkConfig._internal?.overrides?.api?.nodeGateway;\n\tconst nodeGatewayEnv = nodeGatewayOverrides?.env ?? 'production';\n\tconst nodeGatewayUrl = nodeGatewayOverrides?.url;\n\tconst projectAccessKey =\n\t\tnodeGatewayOverrides?.accessKey ?? sdkConfig.projectAccessKey;\n\n\tconst transports = getTransportConfigs(\n\t\tchains,\n\t\tprojectAccessKey,\n\t\tnodeGatewayEnv,\n\t\tnodeGatewayUrl,\n\t);\n\n\tconst walletType = marketplaceConfig.settings.walletOptions.walletType;\n\n\tconst connectors = getConnectors({\n\t\tmarketplaceConfig,\n\t\tsdkConfig,\n\t\twalletType,\n\t});\n\n\tconst multiInjectedProviderDiscovery =\n\t\tmarketplaceConfig.settings.walletOptions.includeEIP6963Wallets;\n\n\treturn createConfig({\n\t\tconnectors,\n\t\tchains,\n\t\tssr,\n\t\tmultiInjectedProviderDiscovery,\n\t\tstorage: ssr\n\t\t\t? createStorage({\n\t\t\t\t\tstorage: cookieStorage,\n\t\t\t\t})\n\t\t\t: undefined,\n\t\ttransports,\n\t});\n};\n\nfunction getAllCollections(marketConfig: MarketplaceConfig) {\n\treturn [...marketConfig.market.collections, ...marketConfig.shop.collections];\n}\n\nfunction getChainConfigs(marketConfig: MarketplaceConfig): [Chain, ...Chain[]] {\n\tconst supportedChainIds = new Set(\n\t\tgetAllCollections(marketConfig).map((c) => c.chainId),\n\t);\n\n\tif (supportedChainIds.size === 0) {\n\t\tsupportedChainIds.add(DEFAULT_NETWORK);\n\t}\n\n\tconst chains = getDefaultChains([...supportedChainIds]);\n\n\treturn chains;\n}\n\nfunction getTransportConfigs(\n\tchains: [Chain, ...Chain[]],\n\tprojectAccessKey: string,\n\tnodeGatewayEnv: Env | undefined,\n\tnodeGatewayUrl?: string,\n): Record<number, Transport> {\n\treturn chains.reduce(\n\t\t(acc, chain) => {\n\t\t\tconst network = findNetworkConfig(allNetworks, chain.id);\n\t\t\tif (network) {\n\t\t\t\tlet rpcUrl: string;\n\t\t\t\tif (nodeGatewayUrl) {\n\t\t\t\t\t// Use manual URL if provided\n\t\t\t\t\trpcUrl = nodeGatewayUrl;\n\t\t\t\t} else {\n\t\t\t\t\t// Use default URL with environment prefix\n\t\t\t\t\trpcUrl = network.rpcUrl;\n\t\t\t\t\tif (nodeGatewayEnv === 'development') {\n\t\t\t\t\t\trpcUrl = rpcUrl.replace('nodes.', 'dev-nodes.');\n\t\t\t\t\t}\n\t\t\t\t\tif (!network.rpcUrl.endsWith(projectAccessKey))\n\t\t\t\t\t\trpcUrl = `${rpcUrl}/${projectAccessKey}`;\n\t\t\t\t}\n\t\t\t\tacc[chain.id] = http(rpcUrl);\n\t\t\t}\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<number, Transport>,\n\t);\n}\n"],"mappings":";;;;;;;;AAAA,MAAa,kBAAkB;;;;ACyB/B,SAAgB,cAAc,EAC7B,mBACA,WACA,YAKA,EAAuB;CACvB,MAAM,aAAa,iBAAiB,mBAAmB,UAAU;AAEjE,KAAI,eAAe,sBAAsB,UACxC,YAAW,KAAK,GAAG,0BAA0B,WAAW,kBAAkB,CAAC;UACjE,eAAe,sBAAsB,SAC/C,YAAW,KAAK,GAAG,kBAAkB,WAAW,kBAAkB,CAAC;UACzD,eAAe,sBAAsB,UAC/C,YAAW,KAAK,sBAAsB,mBAAmB,UAAU,CAAC;KAEpE,OAAM,IAAI,MAAM;AAGjB,QAAO,kBAAkB,UAAU,kBAAkB,WAAW;AAChE;AAED,SAAS,iBACRA,mBACAC,WACC;CACD,MAAM,UAAU,CAAE;CAClB,MAAM,EAAE,OAAO,SAAS,GAAG,kBAAkB;CAC7C,MAAM,gBAAgB,kBAAkB,SAAS;CACjD,MAAM,yBAAyB,UAAU;AAEzC,KAAI,cAAc,WAAW,SAAS,WAAW,CAChD,SAAQ,KACP,eAAe,EACd,QACA,EAAC,CACF;AAGF,KACC,0BACA,cAAc,WAAW,SAAS,gBAAgB,CAElD,SAAQ,KACP,cAAc,EACb,WAAW,uBACX,EAAC,CACF;AAGF,QAAO;AACP;AAED,SAAS,0BACRC,QACAF,mBACW;CACX,MAAM,0BACL,OAAO,WAAW,WAAW,KAAK;CACnC,MAAM,oBACL,yBAAyB,OACzB,qBAAqB,yBAAyB,OAAO,aAAa;CACnE,MAAM,mBACL,yBAAyB,aAAa,OAAO;CAE9C,MAAM,wBAAwB;EAC7B,cAAc;EACd,gBAAgB;EAChB,SAAS;GACR;GACA,KAAK,kBAAkB,SAAS;GAChC,UAAU,EAET,WAAW,kBAAkB,OAAO,QACpC;EACD;CACD;AAED,QAAO;EACN,SAAS,sBAAsB;EAC/B,MAAM,sBAAsB;EAC5B,SAAS,sBAAsB;EAC/B,OAAO,sBAAsB;EAC7B,MAAM,sBAAsB;EAC5B,OAAO,sBAAsB;CAC7B;AACD;AAED,SAAgB,kBACfE,QACAF,mBACW;CACX,MAAM,EAAE,kBAAkB,GAAG;CAE7B,MAAM,gBACL,kBAAkB,SAAS,cAAc,UAAU;AAEpD,MAAK,cACJ,OAAM,IAAI,mBACT;CAGF,MAAM,cAAc,kBAAkB,SAAS,cAAc;CAC7D,MAAM,iBAAiB,YAAY;CACnC,MAAM,gBAAgB,YAAY;CAClC,MAAM,0BACE,WAAW,eACd,EAAE,OAAO,SAAS,OAAO,EAAE,OAAO,SAAS,SAAS;CAGzD,MAAMG,UAAoB,CAAE;AAE5B,KAAI,kBAAkB,SAAS,cAAc,UAAU,aACtD,SAAQ,KACP,UAAU;EACT;EACA;CACA,EAAC,CACF;AAGF,KAAI,eACH,SAAQ,KACP,WAAW;EACV;EACA;EACA;EACA,SAAS;CACT,EAAC,CACF;AAGF,KAAI,cACH,SAAQ,KACP,UAAU;EACT;EACA;EACA;EACA;EACA,SAAS;CACT,EAAC,CACF;AAGF,QAAO;AACP;AAED,SAAgB,sBACfH,mBACAC,WACS;CACT,MAAM,mBAAmB,kBAAkB,SAAS,cAAc;AAClE,MAAK,iBAAkB,OAAM,IAAI,mBAAmB;CACpD,MAAM,EAAE,eAAe,WAAW,aAAa,cAAc,GAC5D;AAED,QAAO,gBAAgB;EACtB,kBAAkB,UAAU;EAC5B;EACA,MAAM;EACN,gBAAgB;EAChB,UAAU,iBAAiB,aAAa,cAAc;EACtD,WAAW,iBAAiB,cAAc,cAAc;CACxD,EAAC;AACF;AAED,SAAS,iBACRG,KACAC,MACoB;AACpB,MAAK,IAAK,QAAO,MAAM;CACvB,MAAM,OAAO,MACZ,MAAM,cAAc,OAAO;EAAE,KAAK;EAAK,KAAK;EAAM,OAAO;EAAI,QAAQ;CAAI,EAAC;AAC3E,MAAK,cAAc;AACnB,QAAO;AACP;AAED,SAAS,qBAAqBC,KAAU;AACvC,SAAQ,KAAR;EACC,KAAK,cACJ,QAAO;EACR,KAAK,OACJ,QAAO;EAER,KAAK;EACL,QACC,QAAO;CACR;AACD;;;;AC9MD,MAAa,oBAAoB,CAChCC,mBACAC,WACAC,QACI;CACJ,MAAM,SAAS,gBAAgB,kBAAkB;CACjD,MAAM,uBAAuB,UAAU,WAAW,WAAW,KAAK;CAClE,MAAM,iBAAiB,sBAAsB,OAAO;CACpD,MAAM,iBAAiB,sBAAsB;CAC7C,MAAM,mBACL,sBAAsB,aAAa,UAAU;CAE9C,MAAM,aAAa,oBAClB,QACA,kBACA,gBACA,eACA;CAED,MAAM,aAAa,kBAAkB,SAAS,cAAc;CAE5D,MAAM,aAAa,cAAc;EAChC;EACA;EACA;CACA,EAAC;CAEF,MAAM,iCACL,kBAAkB,SAAS,cAAc;AAE1C,QAAO,aAAa;EACnB;EACA;EACA;EACA;EACA,SAAS,MACN,cAAc,EACd,SAAS,cACT,EAAC;EAEJ;CACA,EAAC;AACF;AAED,SAAS,kBAAkBC,cAAiC;AAC3D,QAAO,CAAC,GAAG,aAAa,OAAO,aAAa,GAAG,aAAa,KAAK,WAAY;AAC7E;AAED,SAAS,gBAAgBA,cAAsD;CAC9E,MAAM,oBAAoB,IAAI,IAC7B,kBAAkB,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ;AAGtD,KAAI,kBAAkB,SAAS,EAC9B,mBAAkB,IAAI,gBAAgB;CAGvC,MAAM,SAAS,iBAAiB,CAAC,GAAG,iBAAkB,EAAC;AAEvD,QAAO;AACP;AAED,SAAS,oBACRC,QACAC,kBACAC,gBACAC,gBAC4B;AAC5B,QAAO,OAAO,OACb,CAAC,KAAK,UAAU;EACf,MAAM,UAAU,kBAAkB,aAAa,MAAM,GAAG;AACxD,MAAI,SAAS;GACZ,IAAIC;AACJ,OAAI,eAEH,UAAS;QACH;AAEN,aAAS,QAAQ;AACjB,QAAI,mBAAmB,cACtB,UAAS,OAAO,QAAQ,UAAU,aAAa;AAEhD,SAAK,QAAQ,OAAO,SAAS,iBAAiB,CAC7C,WAAU,EAAE,OAAO,GAAG,iBAAiB;GACxC;AACD,OAAI,MAAM,MAAM,KAAK,OAAO;EAC5B;AACD,SAAO;CACP,GACD,CAAE,EACF;AACD"}
|
package/eslint/use-client.js
CHANGED
|
@@ -266,14 +266,12 @@ const ClientComponents = {
|
|
|
266
266
|
}
|
|
267
267
|
parentNode = node;
|
|
268
268
|
const scope = sourceCode.getScope(node);
|
|
269
|
-
// biome-ignore lint/complexity/noForEach: <explanation>
|
|
270
269
|
scope.through.forEach((reference) => {
|
|
271
270
|
undeclaredReferences.add(reference.identifier.name);
|
|
272
271
|
});
|
|
273
272
|
},
|
|
274
273
|
ImportDeclaration(node) {
|
|
275
274
|
if (node.source.value === 'react') {
|
|
276
|
-
// biome-ignore lint/complexity/noForEach: <explanation>
|
|
277
275
|
node.specifiers
|
|
278
276
|
.filter((spec) => spec.type === 'ImportSpecifier')
|
|
279
277
|
.forEach((spac) => {
|
|
@@ -355,18 +353,14 @@ const ClientComponents = {
|
|
|
355
353
|
JSXOpeningElement(node) {
|
|
356
354
|
const scope = sourceCode.getScope(node);
|
|
357
355
|
const fnsInScope = [];
|
|
358
|
-
//biome-ignore lint/complexity/noForEach: <explanation>
|
|
359
356
|
scope.variables.forEach((variable) => {
|
|
360
|
-
//biome-ignore lint/complexity/noForEach: <explanation>
|
|
361
357
|
variable.defs.forEach((def) => {
|
|
362
358
|
if (isFunction(def)) {
|
|
363
359
|
fnsInScope.push(variable.name);
|
|
364
360
|
}
|
|
365
361
|
});
|
|
366
362
|
});
|
|
367
|
-
//biome-ignore lint/complexity/noForEach: <explanation>
|
|
368
363
|
scope.upper?.set.forEach((variable) => {
|
|
369
|
-
//biome-ignore lint/complexity/noForEach: <explanation>
|
|
370
364
|
variable.defs.forEach((def) => {
|
|
371
365
|
if (isFunction(def)) {
|
|
372
366
|
fnsInScope.push(variable.name);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/marketplace-sdk",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.css"
|
|
@@ -43,60 +43,59 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@databeat/tracker": "^0.9.3",
|
|
46
|
-
"@legendapp/state": "^3.0.0-beta.
|
|
47
|
-
"@tailwindcss/cli": "^4.1.
|
|
46
|
+
"@legendapp/state": "^3.0.0-beta.31",
|
|
47
|
+
"@tailwindcss/cli": "^4.1.10",
|
|
48
48
|
"@xstate/store": "^3.6.2",
|
|
49
49
|
"class-variance-authority": "^0.7.1",
|
|
50
50
|
"clsx": "^2.1.1",
|
|
51
51
|
"date-fns": "^4.1.0",
|
|
52
|
-
"dnum": "^2.
|
|
52
|
+
"dnum": "^2.15.0",
|
|
53
53
|
"nuqs": "^2.4.3",
|
|
54
54
|
"react-day-picker": "^9.7.0",
|
|
55
|
-
"tailwind-merge": "^3.3.
|
|
56
|
-
"zod": "^3.25.7"
|
|
55
|
+
"tailwind-merge": "^3.3.1"
|
|
57
56
|
},
|
|
58
57
|
"peerDependencies": {
|
|
59
|
-
"0xsequence": "^2.3.
|
|
60
|
-
"@0xsequence/api": "^2.3.
|
|
61
|
-
"@0xsequence/checkout": "^5.3.
|
|
62
|
-
"@0xsequence/connect": "^5.3.
|
|
63
|
-
"@0xsequence/design-system": "^2.1.
|
|
64
|
-
"@0xsequence/indexer": "^2.3.
|
|
65
|
-
"@0xsequence/metadata": "^2.3.
|
|
66
|
-
"@0xsequence/network": "^2.3.
|
|
58
|
+
"0xsequence": "^2.3.20",
|
|
59
|
+
"@0xsequence/api": "^2.3.20",
|
|
60
|
+
"@0xsequence/checkout": "^5.3.6",
|
|
61
|
+
"@0xsequence/connect": "^5.3.6",
|
|
62
|
+
"@0xsequence/design-system": "^2.1.15",
|
|
63
|
+
"@0xsequence/indexer": "^2.3.20",
|
|
64
|
+
"@0xsequence/metadata": "^2.3.20",
|
|
65
|
+
"@0xsequence/network": "^2.3.20",
|
|
67
66
|
"@google/model-viewer": "^4.1.0",
|
|
68
|
-
"@tanstack/react-query": "^5.
|
|
67
|
+
"@tanstack/react-query": "^5.80.10",
|
|
69
68
|
"react": "^19.1.0",
|
|
70
69
|
"react-dom": "^19.1.0",
|
|
71
|
-
"viem": "^2.
|
|
72
|
-
"wagmi": "^2.15.
|
|
70
|
+
"viem": "^2.31.3",
|
|
71
|
+
"wagmi": "^2.15.6"
|
|
73
72
|
},
|
|
74
73
|
"devDependencies": {
|
|
75
|
-
"@biomejs/biome": "^
|
|
74
|
+
"@biomejs/biome": "^2.0.0",
|
|
76
75
|
"@changesets/cli": "^2.29.4",
|
|
77
|
-
"@eslint/js": "^9.
|
|
76
|
+
"@eslint/js": "^9.29.0",
|
|
78
77
|
"@testing-library/jest-dom": "6.4.7",
|
|
79
78
|
"@testing-library/react": "^16.3.0",
|
|
80
|
-
"@types/react": "^19.1.
|
|
81
|
-
"@types/react-dom": "^19.1.
|
|
79
|
+
"@types/react": "^19.1.8",
|
|
80
|
+
"@types/react-dom": "^19.1.6",
|
|
82
81
|
"@vitest/coverage-v8": "3.0.9",
|
|
83
|
-
"eslint": "^9.
|
|
82
|
+
"eslint": "^9.29.0",
|
|
84
83
|
"eslint-config-biome": "^1.9.4",
|
|
85
84
|
"eslint-plugin-react": "^7.37.5",
|
|
86
85
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
87
|
-
"globals": "^16.
|
|
88
|
-
"happy-dom": "^
|
|
86
|
+
"globals": "^16.2.0",
|
|
87
|
+
"happy-dom": "^18.0.1",
|
|
89
88
|
"jsdom": "^26.1.0",
|
|
90
|
-
"msw": "^2.
|
|
91
|
-
"postcss": "^8.5.
|
|
89
|
+
"msw": "^2.10.2",
|
|
90
|
+
"postcss": "^8.5.6",
|
|
92
91
|
"prool": "^0.0.24",
|
|
93
92
|
"rollup-preserve-directives": "^1.1.3",
|
|
94
|
-
"tailwindcss": "^4.1.
|
|
95
|
-
"tsdown": "^0.12.
|
|
93
|
+
"tailwindcss": "^4.1.10",
|
|
94
|
+
"tsdown": "^0.12.8",
|
|
96
95
|
"typescript": "^5.8.3",
|
|
97
|
-
"typescript-eslint": "^8.
|
|
96
|
+
"typescript-eslint": "^8.34.1",
|
|
98
97
|
"vite-tsconfig-paths": "^5.1.4",
|
|
99
|
-
"vitest": "^3.
|
|
98
|
+
"vitest": "^3.2.4"
|
|
100
99
|
},
|
|
101
100
|
"scripts": {
|
|
102
101
|
"build": "tsdown",
|
|
@@ -113,6 +112,6 @@
|
|
|
113
112
|
"eslint": "eslint .",
|
|
114
113
|
"eslint:fix": "eslint --fix .",
|
|
115
114
|
"changeset": "changeset",
|
|
116
|
-
"version": "changeset version"
|
|
115
|
+
"version": "changeset version && node ../scripts/update-marketplace-version.js"
|
|
117
116
|
}
|
|
118
117
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpResponse, http } from 'msw';
|
|
2
2
|
import { zeroAddress } from 'viem';
|
|
3
3
|
import {
|
|
4
4
|
FilterCondition,
|
|
@@ -71,6 +71,7 @@ export const mockShopCollections = [
|
|
|
71
71
|
name: 'Mock Shop Collection',
|
|
72
72
|
bannerUrl: 'https://example.com/shop-banner.png',
|
|
73
73
|
saleBannerUrl: 'https://example.com/shop-sale-banner.png',
|
|
74
|
+
tokenIds: ['1', '2', '3'],
|
|
74
75
|
createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
|
|
75
76
|
updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
|
|
76
77
|
},
|
|
@@ -83,6 +84,7 @@ export const mockShopCollections = [
|
|
|
83
84
|
name: 'Polygon Shop Collection',
|
|
84
85
|
bannerUrl: 'https://example.com/polygon-shop-banner.png',
|
|
85
86
|
saleBannerUrl: 'https://example.com/polygon-shop-sale-banner.png',
|
|
87
|
+
tokenIds: ['4', '5', '6'],
|
|
86
88
|
createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
|
|
87
89
|
updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
|
|
88
90
|
},
|
|
@@ -116,15 +118,15 @@ export const mockConfig = {
|
|
|
116
118
|
},
|
|
117
119
|
market: {
|
|
118
120
|
enabled: true,
|
|
119
|
-
title: 'Mock Market Page',
|
|
120
121
|
bannerUrl: 'https://example.com/market-banner.png',
|
|
121
122
|
ogImage: 'https://example.com/og-image.png',
|
|
123
|
+
private: false,
|
|
122
124
|
},
|
|
123
125
|
shop: {
|
|
124
126
|
enabled: true,
|
|
125
|
-
title: 'Mock Shop Page',
|
|
126
127
|
bannerUrl: 'https://example.com/shop-banner.png',
|
|
127
128
|
ogImage: 'https://example.com/shop-og-image.png',
|
|
129
|
+
private: false,
|
|
128
130
|
},
|
|
129
131
|
createdAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
|
|
130
132
|
updatedAt: new Date('2025-03-16T13:04:16.098Z').toISOString(),
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ContractType,
|
|
3
|
-
OrderStatus,
|
|
4
|
-
ResourceStatus,
|
|
5
|
-
TransactionStatus,
|
|
6
|
-
TransactionType,
|
|
7
|
-
} from '@0xsequence/indexer';
|
|
8
1
|
import type {
|
|
9
2
|
ContractInfo,
|
|
10
3
|
OrderbookOrder,
|
|
@@ -13,7 +6,14 @@ import type {
|
|
|
13
6
|
TokenSupply,
|
|
14
7
|
TransactionReceipt,
|
|
15
8
|
} from '@0xsequence/indexer';
|
|
16
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
ContractType,
|
|
11
|
+
OrderStatus,
|
|
12
|
+
ResourceStatus,
|
|
13
|
+
TransactionStatus,
|
|
14
|
+
TransactionType,
|
|
15
|
+
} from '@0xsequence/indexer';
|
|
16
|
+
import { HttpResponse, http } from 'msw';
|
|
17
17
|
|
|
18
18
|
import { zeroAddress } from 'viem';
|
|
19
19
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { USDC_ADDRESS } from '@test/const';
|
|
2
|
+
import { HttpResponse, http } from 'msw';
|
|
3
|
+
import { zeroAddress } from 'viem';
|
|
3
4
|
import {
|
|
4
5
|
type Activity,
|
|
5
6
|
ActivityAction,
|
|
@@ -23,9 +24,6 @@ import {
|
|
|
23
24
|
WalletKind,
|
|
24
25
|
} from '../marketplace.gen';
|
|
25
26
|
|
|
26
|
-
import { USDC_ADDRESS } from '@test/const';
|
|
27
|
-
import { zeroAddress } from 'viem';
|
|
28
|
-
|
|
29
27
|
// Mock data
|
|
30
28
|
export const mockCurrencies: Currency[] = [
|
|
31
29
|
{
|
|
@@ -175,7 +173,7 @@ export const disableDebug = () => {
|
|
|
175
173
|
};
|
|
176
174
|
|
|
177
175
|
// Debug logger function
|
|
178
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
176
|
+
// biome-ignore lint/suspicious/noExplicitAny: debug function needs to accept any type of request/response data
|
|
179
177
|
const debugLog = (endpoint: string, request: any, response: any) => {
|
|
180
178
|
if (isDebugEnabled) {
|
|
181
179
|
console.log(`[MSW Debug] ${endpoint}:`, {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//
|
|
6
6
|
// webrpc-gen -schema=builder.main.ridl -target=typescript -client -out=../../webapp/src/rpc/proto/builder.gen.ts
|
|
7
7
|
|
|
8
|
-
import { OrderbookKind } from "./marketplace.gen";
|
|
8
|
+
import type { OrderbookKind } from "./marketplace.gen";
|
|
9
9
|
|
|
10
10
|
export const WebrpcHeader = "Webrpc";
|
|
11
11
|
export const WebrpcHeaderValue =
|
|
@@ -59,10 +59,10 @@ export interface MarketplaceSettings {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export interface MarketplacePage {
|
|
62
|
-
enabled: boolean
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
enabled: boolean
|
|
63
|
+
bannerUrl: string
|
|
64
|
+
ogImage: string
|
|
65
|
+
private: boolean
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export interface MarketplaceSocials {
|
|
@@ -135,7 +135,7 @@ export interface ShopCollection {
|
|
|
135
135
|
saleAddress: string;
|
|
136
136
|
name: string;
|
|
137
137
|
bannerUrl: string;
|
|
138
|
-
|
|
138
|
+
tokenIds: Array<string>;
|
|
139
139
|
createdAt?: string;
|
|
140
140
|
updatedAt?: string;
|
|
141
141
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
QueryClient,
|
|
3
2
|
defaultShouldDehydrateQuery,
|
|
3
|
+
QueryClient,
|
|
4
4
|
} from '@tanstack/react-query';
|
|
5
5
|
import { hashFn } from 'wagmi/query';
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ function makeQueryClient() {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
let browserQueryClient: QueryClient | undefined
|
|
23
|
+
let browserQueryClient: QueryClient | undefined;
|
|
24
24
|
|
|
25
25
|
export function getQueryClient() {
|
|
26
26
|
if (typeof globalThis.document === 'undefined') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './get-query-client';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './laos-api';
|
|
3
3
|
export * from './marketplace.gen';
|
|
4
|
+
export * from './marketplace-api';
|
|
4
5
|
export * from './query-keys';
|
|
5
6
|
export * from './services';
|
|
6
|
-
export * from './laos-api';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// marketplace-api
|
|
2
|
+
// marketplace-api 6b46374337129883386b9668e652237c3b31eda1
|
|
3
3
|
// --
|
|
4
4
|
// Code generated by webrpc-gen@v0.25.4 with typescript generator. DO NOT EDIT.
|
|
5
5
|
//
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export const WebrpcHeader = "Webrpc";
|
|
9
9
|
|
|
10
10
|
export const WebrpcHeaderValue =
|
|
11
|
-
"webrpc@v0.25.4;gen-typescript@v0.17.0;marketplace-api@v0.0.0-
|
|
11
|
+
"webrpc@v0.25.4;gen-typescript@v0.17.0;marketplace-api@v0.0.0-6b46374337129883386b9668e652237c3b31eda1;marketplace-sdk@v0.9.0";
|
|
12
12
|
|
|
13
13
|
// WebRPC description and code-gen version
|
|
14
14
|
export const WebRPCVersion = "v1";
|
|
@@ -17,7 +17,7 @@ export const WebRPCVersion = "v1";
|
|
|
17
17
|
export const WebRPCSchemaVersion = "";
|
|
18
18
|
|
|
19
19
|
// Schema hash generated from your RIDL schema
|
|
20
|
-
export const WebRPCSchemaHash = "
|
|
20
|
+
export const WebRPCSchemaHash = "6b46374337129883386b9668e652237c3b31eda1";
|
|
21
21
|
|
|
22
22
|
type WebrpcGenVersions = {
|
|
23
23
|
webrpcGenVersion: string;
|
|
@@ -585,7 +585,7 @@ export interface PrimarySaleItem {
|
|
|
585
585
|
priceDecimals: number;
|
|
586
586
|
priceAmount: string;
|
|
587
587
|
priceAmountFormatted: string;
|
|
588
|
-
|
|
588
|
+
supply: string;
|
|
589
589
|
createdAt: string;
|
|
590
590
|
updatedAt: string;
|
|
591
591
|
deletedAt?: string;
|
|
@@ -1024,6 +1024,11 @@ export interface Marketplace {
|
|
|
1024
1024
|
headers?: object,
|
|
1025
1025
|
signal?: AbortSignal
|
|
1026
1026
|
): Promise<SupportedMarketplacesReturn>;
|
|
1027
|
+
getPrimarySaleItem(
|
|
1028
|
+
args: GetPrimarySaleItemArgs,
|
|
1029
|
+
headers?: object,
|
|
1030
|
+
signal?: AbortSignal
|
|
1031
|
+
): Promise<GetPrimarySaleItemReturn>;
|
|
1027
1032
|
listPrimarySaleItems(
|
|
1028
1033
|
args: ListPrimarySaleItemsArgs,
|
|
1029
1034
|
headers?: object,
|
|
@@ -1437,6 +1442,15 @@ export interface SupportedMarketplacesArgs {
|
|
|
1437
1442
|
export interface SupportedMarketplacesReturn {
|
|
1438
1443
|
marketplaces: Array<MarketplaceKind>;
|
|
1439
1444
|
}
|
|
1445
|
+
export interface GetPrimarySaleItemArgs {
|
|
1446
|
+
chainId: string;
|
|
1447
|
+
primarySaleContractAddress: string;
|
|
1448
|
+
tokenId: string;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
export interface GetPrimarySaleItemReturn {
|
|
1452
|
+
item: CollectiblePrimarySaleItem;
|
|
1453
|
+
}
|
|
1440
1454
|
export interface ListPrimarySaleItemsArgs {
|
|
1441
1455
|
chainId: string;
|
|
1442
1456
|
primarySaleContractAddress: string;
|
|
@@ -2764,6 +2778,30 @@ export class Marketplace implements Marketplace {
|
|
|
2764
2778
|
);
|
|
2765
2779
|
};
|
|
2766
2780
|
|
|
2781
|
+
getPrimarySaleItem = (
|
|
2782
|
+
args: GetPrimarySaleItemArgs,
|
|
2783
|
+
headers?: object,
|
|
2784
|
+
signal?: AbortSignal
|
|
2785
|
+
): Promise<GetPrimarySaleItemReturn> => {
|
|
2786
|
+
return this.fetch(
|
|
2787
|
+
this.url("GetPrimarySaleItem"),
|
|
2788
|
+
createHTTPRequest(args, headers, signal)
|
|
2789
|
+
).then(
|
|
2790
|
+
(res) => {
|
|
2791
|
+
return buildResponse(res).then((_data) => {
|
|
2792
|
+
return {
|
|
2793
|
+
item: <CollectiblePrimarySaleItem>_data.item,
|
|
2794
|
+
};
|
|
2795
|
+
});
|
|
2796
|
+
},
|
|
2797
|
+
(error) => {
|
|
2798
|
+
throw WebrpcRequestFailedError.new({
|
|
2799
|
+
cause: `fetch(): ${error.message || ""}`,
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
);
|
|
2803
|
+
};
|
|
2804
|
+
|
|
2767
2805
|
listPrimarySaleItems = (
|
|
2768
2806
|
args: ListPrimarySaleItemsArgs,
|
|
2769
2807
|
headers?: object,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// biome-ignore lint/complexity/noStaticOnlyClass:
|
|
1
|
+
// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys
|
|
2
2
|
class CollectableKeys {
|
|
3
3
|
static all = ['collectable'] as const;
|
|
4
4
|
static details = [...CollectableKeys.all, 'details'] as const;
|
|
@@ -35,7 +35,7 @@ class CollectableKeys {
|
|
|
35
35
|
] as const;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
// biome-ignore lint/complexity/noStaticOnlyClass:
|
|
38
|
+
// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys
|
|
39
39
|
class CollectionKeys {
|
|
40
40
|
static all = ['collections'] as const;
|
|
41
41
|
static list = [...CollectionKeys.all, 'list'] as const;
|
|
@@ -46,7 +46,7 @@ class CollectionKeys {
|
|
|
46
46
|
] as const;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// biome-ignore lint/complexity/noStaticOnlyClass:
|
|
49
|
+
// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys
|
|
50
50
|
class BalanceQueries {
|
|
51
51
|
static all = ['balances'] as const;
|
|
52
52
|
static lists = [...BalanceQueries.all, 'tokenBalances'] as const;
|
|
@@ -56,14 +56,14 @@ class BalanceQueries {
|
|
|
56
56
|
] as const;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// biome-ignore lint/complexity/noStaticOnlyClass:
|
|
59
|
+
// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys
|
|
60
60
|
class CheckoutKeys {
|
|
61
61
|
static all = ['checkouts'] as const;
|
|
62
62
|
static options = [...CheckoutKeys.all, 'options'] as const;
|
|
63
63
|
static cartItems = [...CheckoutKeys.all, 'cartItems'] as const;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
// biome-ignore lint/complexity/noStaticOnlyClass:
|
|
66
|
+
// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys
|
|
67
67
|
class CurrencyKeys {
|
|
68
68
|
static all = ['currencies'] as const;
|
|
69
69
|
static lists = [...CurrencyKeys.all, 'list'] as const;
|
|
@@ -71,14 +71,21 @@ class CurrencyKeys {
|
|
|
71
71
|
static conversion = [...CurrencyKeys.all, 'conversion'] as const;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
// biome-ignore lint/complexity/noStaticOnlyClass:
|
|
74
|
+
// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys
|
|
75
75
|
class ConfigKeys {
|
|
76
76
|
static all = ['configs'] as const;
|
|
77
77
|
static marketplace = [...ConfigKeys.all, 'marketplace'] as const;
|
|
78
78
|
}
|
|
79
|
+
|
|
80
|
+
// biome-ignore lint/complexity/noStaticOnlyClass: static class provides better organization and type safety for query keys
|
|
81
|
+
class MetadataKeys {
|
|
82
|
+
static all = ['metadata'] as const;
|
|
83
|
+
static tokenMetadata = [...MetadataKeys.all, 'tokenMetadata'] as const;
|
|
84
|
+
}
|
|
79
85
|
export const collectableKeys = CollectableKeys;
|
|
80
86
|
export const collectionKeys = CollectionKeys;
|
|
81
87
|
export const balanceQueries = BalanceQueries;
|
|
82
88
|
export const checkoutKeys = CheckoutKeys;
|
|
83
89
|
export const currencyKeys = CurrencyKeys;
|
|
84
90
|
export const configKeys = ConfigKeys;
|
|
91
|
+
export const metadataKeys = MetadataKeys;
|
|
@@ -8,10 +8,15 @@ import { BuilderAPI } from './builder-api';
|
|
|
8
8
|
import { SequenceMarketplace } from './marketplace-api';
|
|
9
9
|
|
|
10
10
|
const SERVICES = {
|
|
11
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function
|
|
11
12
|
sequenceApi: 'https://${prefix}api.sequence.app',
|
|
13
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function
|
|
12
14
|
metadata: 'https://${prefix}metadata.sequence.app',
|
|
15
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function
|
|
13
16
|
indexer: 'https://${prefix}${network}-indexer.sequence.app',
|
|
17
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function
|
|
14
18
|
marketplaceApi: 'https://${prefix}marketplace-api.sequence.app',
|
|
19
|
+
// biome-ignore lint/suspicious/noTemplateCurlyInString: template placeholder for stringTemplate function
|
|
15
20
|
builderRpcApi: 'https://${prefix}api.sequence.build',
|
|
16
21
|
};
|
|
17
22
|
|
|
@@ -41,10 +46,6 @@ const indexerURL = (chain: ChainNameOrId, env: Env = 'production') => {
|
|
|
41
46
|
};
|
|
42
47
|
|
|
43
48
|
const marketplaceApiURL = (env: Env = 'production') => {
|
|
44
|
-
// TODO: remove this once we have a production endpoint
|
|
45
|
-
if (env === 'development') {
|
|
46
|
-
return 'https://dev-marketplace-api-v2.sequence-dev.app';
|
|
47
|
-
}
|
|
48
49
|
const prefix = getPrefix(env);
|
|
49
50
|
return stringTemplate(SERVICES.marketplaceApi, { prefix });
|
|
50
51
|
};
|
|
@@ -60,45 +61,41 @@ export const sequenceApiUrl = (env: Env = 'production') => {
|
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
export const getBuilderClient = (config: SdkConfig) => {
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return new BuilderAPI(
|
|
64
|
+
const overrides = config._internal?.overrides?.api?.builder;
|
|
65
|
+
const url =
|
|
66
|
+
overrides?.url || builderRpcApiURL(overrides?.env || 'production');
|
|
67
|
+
const projectAccessKey = overrides?.accessKey || config.projectAccessKey;
|
|
68
|
+
return new BuilderAPI(url, projectAccessKey);
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
export const getMetadataClient = (config: SdkConfig) => {
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return new SequenceMetadata(metadataURL(env), projectAccessKey);
|
|
72
|
+
const overrides = config._internal?.overrides?.api?.metadata;
|
|
73
|
+
const url = overrides?.url || metadataURL(overrides?.env || 'production');
|
|
74
|
+
const projectAccessKey = overrides?.accessKey || config.projectAccessKey;
|
|
75
|
+
return new SequenceMetadata(url, projectAccessKey);
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
export const getIndexerClient = (chain: ChainNameOrId, config: SdkConfig) => {
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return new SequenceIndexer(
|
|
79
|
+
const overrides = config._internal?.overrides?.api?.indexer;
|
|
80
|
+
const url =
|
|
81
|
+
overrides?.url || indexerURL(chain, overrides?.env || 'production');
|
|
82
|
+
const projectAccessKey = overrides?.accessKey || config.projectAccessKey;
|
|
83
|
+
return new SequenceIndexer(url, projectAccessKey);
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
export const getMarketplaceClient = (config: SdkConfig) => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return new SequenceMarketplace(marketplaceApiURL(env), projectAccessKey);
|
|
87
|
+
const overrides = config._internal?.overrides?.api?.marketplace;
|
|
88
|
+
const url =
|
|
89
|
+
overrides?.url || marketplaceApiURL(overrides?.env || 'production');
|
|
90
|
+
const projectAccessKey = overrides?.accessKey || config.projectAccessKey;
|
|
91
|
+
return new SequenceMarketplace(url, projectAccessKey);
|
|
93
92
|
};
|
|
94
93
|
|
|
95
94
|
export const getSequenceApiClient = (config: SdkConfig) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const projectAccessKey =
|
|
99
|
-
|
|
100
|
-
config.projectAccessKey;
|
|
101
|
-
return new SequenceAPIClient(sequenceApiUrl(env), projectAccessKey);
|
|
95
|
+
const overrides = config._internal?.overrides?.api?.sequenceApi;
|
|
96
|
+
const url = overrides?.url || sequenceApiUrl(overrides?.env || 'production');
|
|
97
|
+
const projectAccessKey = overrides?.accessKey || config.projectAccessKey;
|
|
98
|
+
return new SequenceAPIClient(url, projectAccessKey);
|
|
102
99
|
};
|
|
103
100
|
|
|
104
101
|
const getPrefix = (env: ApiConfig['env']) => {
|
|
@@ -1,30 +1,11 @@
|
|
|
1
|
-
import type { Address } from 'viem';
|
|
2
|
-
import { z } from 'zod';
|
|
3
1
|
import type { ContractType, CreateReq } from '../../types';
|
|
4
2
|
import type { MarketplaceKind } from './api';
|
|
5
3
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
10
|
-
.optional();
|
|
11
|
-
|
|
12
|
-
export type QueryArg = z.infer<typeof QueryArgSchema>;
|
|
13
|
-
|
|
14
|
-
export const CollectableIdSchema = z.string().or(z.number());
|
|
15
|
-
|
|
16
|
-
export const AddressSchema = z.string().transform((val, ctx) => {
|
|
17
|
-
const regex = /^0x[a-fA-F0-9]{40}$/;
|
|
18
|
-
|
|
19
|
-
if (!regex.test(val)) {
|
|
20
|
-
ctx.addIssue({
|
|
21
|
-
code: z.ZodIssueCode.custom,
|
|
22
|
-
message: `Invalid Address ${val}`,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
4
|
+
export interface QueryArg {
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
}
|
|
25
7
|
|
|
26
|
-
|
|
27
|
-
});
|
|
8
|
+
export type CollectableId = string | number;
|
|
28
9
|
|
|
29
10
|
export type CollectionType = ContractType.ERC1155 | ContractType.ERC721;
|
|
30
11
|
|
|
@@ -75,3 +56,9 @@ export interface CancelInput {
|
|
|
75
56
|
orderId: string;
|
|
76
57
|
marketplace: MarketplaceKind;
|
|
77
58
|
}
|
|
59
|
+
|
|
60
|
+
export type ValuesOptional<T> = {
|
|
61
|
+
[K in keyof T]: T[K] | undefined;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { TypedData, TypedDataDomain } from 'viem';
|
|
2
|
-
import type { Hex } from 'viem';
|
|
1
|
+
import type { Hex, TypedData, TypedDataDomain } from 'viem';
|
|
3
2
|
import { type PostRequest, type Signature, type Step, StepType } from './api';
|
|
4
3
|
|
|
5
4
|
export interface SignatureStep {
|