@0xsequence/marketplace-sdk 1.2.1 → 2.0.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/.storybook/preview.tsx +4 -7
- package/CHANGELOG.md +171 -0
- package/compile-tailwind.js +1 -1
- package/dist/BellIcon.js +6 -3
- package/dist/BellIcon.js.map +1 -1
- package/dist/Card.js +831 -0
- package/dist/Card.js.map +1 -0
- package/dist/ShopCard.d.ts +83 -0
- package/dist/_internal.js +57 -1
- package/dist/_internal.js.map +1 -1
- package/dist/abi.js +24 -1
- package/dist/abi.js.map +1 -1
- package/dist/alertMessage.js +29 -0
- package/dist/alertMessage.js.map +1 -0
- package/dist/api.js +95 -108
- package/dist/api.js.map +1 -1
- package/dist/builder-api.js +17 -4
- package/dist/builder-api.js.map +1 -1
- package/dist/calendar.js +51 -0
- package/dist/calendar.js.map +1 -0
- package/dist/checkout.js +52 -0
- package/dist/checkout.js.map +1 -0
- package/dist/collectible.js +620 -0
- package/dist/collectible.js.map +1 -0
- package/dist/collection.js +396 -0
- package/dist/collection.js.map +1 -0
- package/dist/{marketplaceConfig.js → config.js} +25 -31
- package/dist/config.js.map +1 -0
- package/dist/consts.d.ts +7 -0
- package/dist/consts.js +8 -0
- package/dist/consts.js.map +1 -0
- package/dist/contracts.js +22 -2
- package/dist/contracts.js.map +1 -1
- package/dist/create-config.d.ts +12037 -1801
- package/dist/create-config.js +9 -7
- package/dist/create-config.js.map +1 -1
- package/dist/currency.js +186 -0
- package/dist/currency.js.map +1 -0
- package/dist/currencyImage.js +28 -0
- package/dist/currencyImage.js.map +1 -0
- package/dist/dist.js +2771 -0
- package/dist/dist.js.map +1 -0
- package/dist/expirationDateSelect.js +245 -0
- package/dist/expirationDateSelect.js.map +1 -0
- package/dist/filter-state.d.ts +153 -0
- package/dist/filters.d.ts +14 -45
- package/dist/hooks.js +26 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hooks2.js +24 -0
- package/dist/hooks2.js.map +1 -0
- package/dist/index.d.ts +12 -8
- package/dist/index.js +6 -9
- package/dist/index10.d.ts +39 -261
- package/dist/index11.d.ts +461 -220
- package/dist/index12.d.ts +511 -85
- package/dist/index13.d.ts +17 -493
- package/dist/index14.d.ts +15 -66
- package/dist/index15.d.ts +25 -1
- package/dist/index16.d.ts +5 -47
- package/dist/index17.d.ts +840 -108
- package/dist/index18.d.ts +552 -1
- package/dist/index19.d.ts +317 -147
- package/dist/index2.d.ts +2172 -5
- package/dist/index21.d.ts +306 -93
- package/dist/index22.d.ts +230 -1
- package/dist/index23.d.ts +323 -797
- package/dist/index24.d.ts +22 -445
- package/dist/index25.d.ts +1 -357
- package/dist/index26.d.ts +20 -151
- package/dist/index27.d.ts +18 -794
- package/dist/index28.d.ts +109 -58
- package/dist/index29.d.ts +1 -24
- package/dist/index3.d.ts +2212 -51
- package/dist/index30.d.ts +1 -0
- package/dist/index31.d.ts +48 -0
- package/dist/index32.d.ts +1 -0
- package/dist/index33.d.ts +56 -0
- package/dist/index34.d.ts +99 -0
- package/dist/index35.d.ts +171 -0
- package/dist/index36.d.ts +131 -0
- package/dist/index37.d.ts +135 -0
- package/dist/index38.d.ts +85 -0
- package/dist/index39.d.ts +91 -0
- package/dist/index4.d.ts +2678 -61
- package/dist/index40.d.ts +46 -0
- package/dist/index5.d.ts +535 -2267
- package/dist/index6.d.ts +2025 -1287
- package/dist/index7.d.ts +1798 -116
- package/dist/index8.d.ts +115 -12
- package/dist/index9.d.ts +42 -56
- package/dist/inventory.d.ts +46 -0
- package/dist/inventory.js +56 -33
- package/dist/inventory.js.map +1 -1
- package/dist/marketplace-logos.js +1 -1
- package/dist/marketplace-logos.js.map +1 -1
- package/dist/marketplace2.js +70 -0
- package/dist/marketplace2.js.map +1 -0
- package/dist/metadata.d.ts +733 -0
- package/dist/network.js +1 -1
- package/dist/networkconfigToWagmiChain.js.map +1 -1
- package/dist/primary-sale-checkout-options.d.ts +29 -0
- package/dist/quantityInput.js +93 -0
- package/dist/quantityInput.js.map +1 -0
- package/dist/ranges.d.ts +125 -0
- package/dist/react/_internal/api/index.d.ts +5 -2
- package/dist/react/_internal/api/index.js +4 -7
- package/dist/react/_internal/databeat/index.d.ts +4 -1
- package/dist/react/_internal/databeat/index.js +4 -37
- package/dist/react/_internal/index.d.ts +5 -2
- package/dist/react/_internal/index.js +5 -10
- package/dist/react/_internal/wagmi/index.d.ts +4 -1
- package/dist/react/_internal/wagmi/index.js +1 -4
- package/dist/react/hooks/_deprecated/index.d.ts +47 -0
- package/dist/react/hooks/_deprecated/index.js +4 -0
- package/dist/react/hooks/checkout/index.d.ts +7 -0
- package/dist/react/hooks/checkout/index.js +7 -0
- package/dist/react/hooks/collectible/index.d.ts +7 -0
- package/dist/react/hooks/collectible/index.js +7 -0
- package/dist/react/hooks/collection/index.d.ts +11 -0
- package/dist/react/hooks/collection/index.js +7 -0
- package/dist/react/hooks/config/index.d.ts +5 -4
- package/dist/react/hooks/config/index.js +4 -37
- package/dist/react/hooks/contracts/index.d.ts +4 -7
- package/dist/react/hooks/contracts/index.js +3 -16
- package/dist/react/hooks/currency/index.d.ts +47 -0
- package/dist/react/hooks/currency/index.js +7 -0
- package/dist/react/hooks/index.d.ts +41 -31
- package/dist/react/hooks/index.js +14 -38
- package/dist/react/hooks/inventory/index.d.ts +7 -0
- package/dist/react/hooks/inventory/index.js +4 -0
- package/dist/react/hooks/token/index.d.ts +7 -0
- package/dist/react/hooks/token/index.js +7 -0
- package/dist/react/hooks/transactions/index.d.ts +5 -2
- package/dist/react/hooks/transactions/index.js +5 -38
- package/dist/react/hooks/ui/card-data/index.d.ts +8 -0
- package/dist/react/hooks/ui/card-data/index.js +4 -0
- package/dist/react/hooks/ui/index.d.ts +9 -3
- package/dist/react/hooks/ui/index.js +8 -38
- package/dist/react/hooks/ui/url-state/index.d.ts +7 -0
- package/dist/react/hooks/ui/url-state/index.js +4 -0
- package/dist/react/hooks/utils/index.d.ts +3 -34
- package/dist/react/hooks/utils/index.js +5 -38
- package/dist/react/index.d.ts +45 -35
- package/dist/react/index.js +19 -37
- package/dist/react/providers/index.d.ts +6 -0
- package/dist/react/providers/index.js +6 -0
- package/dist/react/queries/checkout/index.d.ts +7 -0
- package/dist/react/queries/checkout/index.js +4 -0
- package/dist/react/queries/collectible/index.d.ts +7 -0
- package/dist/react/queries/collectible/index.js +5 -0
- package/dist/react/queries/collection/index.d.ts +11 -0
- package/dist/react/queries/collection/index.js +4 -0
- package/dist/react/queries/currency/index.d.ts +6 -0
- package/dist/react/queries/currency/index.js +4 -0
- package/dist/react/queries/index.d.ts +20 -21
- package/dist/react/queries/index.js +11 -30
- package/dist/react/queries/inventory/index.d.ts +6 -2
- package/dist/react/queries/inventory/index.js +3 -21
- package/dist/react/queries/marketplace/index.d.ts +7 -0
- package/dist/react/queries/marketplace/index.js +5 -0
- package/dist/react/queries/token/index.d.ts +7 -0
- package/dist/react/queries/token/index.js +4 -0
- package/dist/react/ssr/index.d.ts +12 -24
- package/dist/react/ssr/index.js +13 -33
- package/dist/react/ui/components/marketplace-collectible-card/ActionButton/index.d.ts +6 -0
- package/dist/react/ui/components/marketplace-collectible-card/ActionButton/index.js +6 -0
- package/dist/react/ui/components/marketplace-collectible-card/Card/index.d.ts +10 -0
- package/dist/react/ui/components/marketplace-collectible-card/Card/index.js +6 -0
- package/dist/react/ui/components/marketplace-collectible-card/index.d.ts +44 -4
- package/dist/react/ui/components/marketplace-collectible-card/index.js +6 -38
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.d.ts +5 -2
- package/dist/react/ui/components/marketplace-collectible-card/utils/index.js +3 -12
- package/dist/react/ui/components/marketplace-logos/index.d.ts +23 -22
- package/dist/react/ui/hooks/index.d.ts +47 -0
- package/dist/react/ui/hooks/index.js +15 -0
- package/dist/react/ui/icons/index.d.ts +3 -1
- package/dist/react/ui/icons/index.js +3 -14
- package/dist/react/ui/index.d.ts +47 -5
- package/dist/react/ui/index.js +6 -38
- package/dist/react/ui/modals/BuyModal/index.d.ts +47 -0
- package/dist/react/ui/modals/BuyModal/index.js +4 -0
- package/dist/react/ui/modals/CreateListingModal/index.d.ts +4 -0
- package/dist/react/ui/modals/CreateListingModal/index.js +6 -0
- package/dist/react/ui/modals/CreateListingModal/internal/hooks/index.d.ts +190 -0
- package/dist/react/ui/modals/CreateListingModal/internal/hooks/index.js +4 -0
- package/dist/react/ui/modals/MakeOfferModal/index.d.ts +4 -0
- package/dist/react/ui/modals/MakeOfferModal/index.js +4 -0
- package/dist/react/ui/modals/MakeOfferModal/internal/hooks/index.d.ts +188 -0
- package/dist/react/ui/modals/MakeOfferModal/internal/hooks/index.js +3 -0
- package/dist/react/ui/modals/SellModal/index.d.ts +6 -0
- package/dist/react/ui/modals/SellModal/index.js +6 -0
- package/dist/react/ui/modals/TransferModal/index.d.ts +47 -0
- package/dist/react/ui/modals/TransferModal/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/alertMessage/index.d.ts +14 -0
- package/dist/react/ui/modals/_internal/components/alertMessage/index.js +3 -0
- package/dist/react/ui/modals/_internal/components/baseModal/index.d.ts +144 -0
- package/dist/react/ui/modals/_internal/components/baseModal/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/calendar/index.d.ts +73 -0
- package/dist/react/ui/modals/_internal/components/calendar/index.js +5 -0
- package/dist/react/ui/modals/_internal/components/calendarDropdown/index.d.ts +21 -0
- package/dist/react/ui/modals/_internal/components/calendarDropdown/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/currencyImage/index.d.ts +15 -0
- package/dist/react/ui/modals/_internal/components/currencyImage/index.js +5 -0
- package/dist/react/ui/modals/_internal/components/currencyOptionsSelect/index.d.ts +30 -0
- package/dist/react/ui/modals/_internal/components/currencyOptionsSelect/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/expirationDateSelect/index.d.ts +2 -0
- package/dist/react/ui/modals/_internal/components/expirationDateSelect/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/floorPriceText/index.d.ts +24 -0
- package/dist/react/ui/modals/_internal/components/floorPriceText/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/priceInput/index.d.ts +45 -0
- package/dist/react/ui/modals/_internal/components/priceInput/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/quantityInput/index.d.ts +24 -0
- package/dist/react/ui/modals/_internal/components/quantityInput/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/selectWaasFeeOptions/index.d.ts +18 -0
- package/dist/react/ui/modals/_internal/components/selectWaasFeeOptions/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/switchChainErrorModal/index.d.ts +14 -0
- package/dist/react/ui/modals/_internal/components/switchChainErrorModal/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/timeAgo/index.d.ts +12 -0
- package/dist/react/ui/modals/_internal/components/timeAgo/index.js +5 -0
- package/dist/react/ui/modals/_internal/components/tokenPreview/index.d.ts +19 -0
- package/dist/react/ui/modals/_internal/components/tokenPreview/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/transaction-footer/index.d.ts +26 -0
- package/dist/react/ui/modals/_internal/components/transaction-footer/index.js +4 -0
- package/dist/react/ui/modals/_internal/components/transactionDetails/index.d.ts +28 -0
- package/dist/react/ui/modals/_internal/components/transactionDetails/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/transactionHeader/index.d.ts +16 -0
- package/dist/react/ui/modals/_internal/components/transactionHeader/index.js +3 -0
- package/dist/react/ui/modals/_internal/components/transactionPreview/index.d.ts +36 -0
- package/dist/react/ui/modals/_internal/components/transactionPreview/index.js +6 -0
- package/dist/react/ui/modals/_internal/components/transactionStatusModal/index.d.ts +27 -0
- package/dist/react/ui/modals/_internal/components/transactionStatusModal/index.js +6 -0
- package/dist/react/utils/index.d.ts +6 -19
- package/dist/react/utils/index.js +3 -8
- package/dist/react.js +12634 -9807
- package/dist/react.js.map +1 -1
- package/dist/src.js +0 -8
- package/dist/ssr.js +26 -0
- package/dist/ssr.js.map +1 -0
- package/dist/steps.d.ts +85 -0
- package/dist/styles/index.css +2040 -375
- package/dist/switchChainErrorModal.js +97 -0
- package/dist/switchChainErrorModal.js.map +1 -0
- package/dist/timeAgo.js +29 -0
- package/dist/timeAgo.js.map +1 -0
- package/dist/token-balances.d.ts +359 -0
- package/dist/token-balances.js +62 -0
- package/dist/token-balances.js.map +1 -0
- package/dist/token2.js +247 -0
- package/dist/token2.js.map +1 -0
- package/dist/transaction-footer.js +45 -0
- package/dist/transaction-footer.js.map +1 -0
- package/dist/transaction.js +1 -7
- package/dist/transaction.js.map +1 -1
- package/dist/transactionHeader.js +32 -0
- package/dist/transactionHeader.js.map +1 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/index.js +3 -4
- package/dist/types.d.ts +26 -16
- package/dist/types.js +29 -1
- package/dist/types.js.map +1 -1
- package/dist/url-state.js +170 -0
- package/dist/url-state.js.map +1 -0
- package/dist/utils/abi/index.d.ts +6 -5
- package/dist/utils/abi/index.js +2 -2
- package/dist/utils/abi/marketplace/index.d.ts +1 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1 -1
- package/dist/utils/abi/token/index.d.ts +1 -1
- package/dist/utils/index.d.ts +9 -7
- package/dist/utils/index.js +4 -8
- package/dist/utils.js +8 -8
- package/dist/utils.js.map +1 -1
- package/dist/utils2.js +64 -106
- package/dist/utils2.js.map +1 -1
- package/dist/waas-types.d.ts +19 -0
- package/dist/xstate-store.cjs.d.ts +18 -0
- package/eslint/sequence-types.js +1069 -0
- package/eslint.config.mjs +337 -9
- package/image.d.ts +5 -0
- package/package.json +49 -47
- package/postcss.config.mjs +1 -1
- package/preserve-directives.ts +235 -0
- package/public/mockServiceWorker.js +0 -1
- package/src/react/_internal/api/builder-api.ts +26 -4
- package/src/react/_internal/api/index.ts +1 -2
- package/src/react/_internal/api/marketplace-api.ts +57 -25
- package/src/react/_internal/api/services.ts +56 -4
- package/src/react/_internal/api-mocks.ts +8 -0
- package/src/react/_internal/databeat/index.ts +4 -0
- package/src/react/_internal/databeat/types.ts +24 -28
- package/src/react/_internal/index.ts +70 -0
- package/src/react/_internal/query-builder.ts +203 -0
- package/src/react/_internal/types.ts +88 -18
- package/src/react/_internal/utils.ts +34 -52
- package/src/react/_internal/wagmi/__tests__/create-config.test.ts +11 -5
- package/src/react/_internal/wagmi/create-config.ts +2 -2
- package/src/react/_internal/wagmi/get-connectors.ts +10 -6
- package/src/react/hooks/_deprecated/index.ts +61 -0
- package/src/react/hooks/checkout/index.ts +1 -0
- package/src/react/hooks/{utils/useCheckoutOptionsSalesContract.test.tsx → checkout/primary-sale-checkout-options.test.tsx} +23 -23
- package/src/react/hooks/{utils/useCheckoutOptionsSalesContract.tsx → checkout/primary-sale-checkout-options.tsx} +35 -32
- package/src/react/hooks/{data/collectibles/useBalanceOfCollectible.test.tsx → collectible/balance.test.tsx} +37 -29
- package/src/react/hooks/{data/collectibles/useBalanceOfCollectible.tsx → collectible/balance.tsx} +11 -11
- package/src/react/hooks/{data/primary-sales/useErc721SalesData.tsx → collectible/erc721-sale-details.tsx} +6 -6
- package/src/react/hooks/collectible/index.ts +16 -0
- package/src/react/hooks/{data/collectibles/useCountOfCollectables.test.tsx → collectible/market-count.test.tsx} +21 -16
- package/src/react/hooks/{data/collectibles/useCountOfCollectables.tsx → collectible/market-count.tsx} +13 -8
- package/src/react/hooks/{data/orders/useHighestOffer.test.tsx → collectible/market-highest-offer.test.tsx} +35 -24
- package/src/react/hooks/{data/orders/useHighestOffer.tsx → collectible/market-highest-offer.tsx} +12 -10
- package/src/react/hooks/{data/collectibles/useListCollectiblesPaginated.test.tsx → collectible/market-list-paginated.test.tsx} +18 -18
- package/src/react/hooks/{data/collectibles/useListCollectiblesPaginated.tsx → collectible/market-list-paginated.tsx} +12 -10
- package/src/react/hooks/{data/collectibles/useListCollectibles.test.tsx → collectible/market-list.test.tsx} +51 -39
- package/src/react/hooks/{data/collectibles/useListCollectibles.tsx → collectible/market-list.tsx} +11 -10
- package/src/react/hooks/{data/orders/useCountListingsForCollectible.test.tsx → collectible/market-listings-count.test.tsx} +13 -10
- package/src/react/hooks/{data/orders/useCountListingsForCollectible.tsx → collectible/market-listings-count.tsx} +11 -11
- package/src/react/hooks/{data/orders/useListListingsForCollectible.test.tsx → collectible/market-listings.test.tsx} +19 -19
- package/src/react/hooks/{data/orders/useListListingsForCollectible.tsx → collectible/market-listings.tsx} +17 -19
- package/src/react/hooks/{data/orders/useLowestListing.test.tsx → collectible/market-lowest-listing.test.tsx} +35 -24
- package/src/react/hooks/{data/orders/useLowestListing.tsx → collectible/market-lowest-listing.tsx} +12 -10
- package/src/react/hooks/{data/orders/useCountOffersForCollectible.test.tsx → collectible/market-offers-count.test.tsx} +13 -10
- package/src/react/hooks/{data/orders/useCountOffersForCollectible.tsx → collectible/market-offers-count.tsx} +11 -11
- package/src/react/hooks/{data/orders/useListOffersForCollectible.test.tsx → collectible/market-offers.test.tsx} +17 -17
- package/src/react/hooks/{data/orders/useListOffersForCollectible.tsx → collectible/market-offers.tsx} +16 -17
- package/src/react/hooks/{data/collectibles/useCollectible.test.tsx → collectible/metadata.test.tsx} +25 -23
- package/src/react/hooks/{data/collectibles/useCollectible.tsx → collectible/metadata.tsx} +17 -14
- package/src/react/hooks/collectible/primary-sale-item.test.tsx +503 -0
- package/src/react/hooks/{data/primary-sales/usePrimarySaleItem.tsx → collectible/primary-sale-item.tsx} +6 -8
- package/src/react/hooks/collectible/primary-sale-items-count.test.tsx +154 -0
- package/src/react/hooks/collectible/primary-sale-items-count.tsx +22 -0
- package/src/react/hooks/collectible/primary-sale-items.test.tsx +259 -0
- package/src/react/hooks/{data/primary-sales/useListPrimarySaleItems.tsx → collectible/primary-sale-items.tsx} +9 -9
- package/src/react/hooks/{data/collectibles/useTokenBalances.test.tsx → collectible/token-balances.test.tsx} +52 -28
- package/src/react/hooks/{data/collectibles/useTokenBalances.tsx → collectible/token-balances.tsx} +10 -10
- package/src/react/hooks/{data/collections/__snapshots__/useListCollections.test.tsx.snap → collection/__snapshots__/list.test.tsx.snap} +20 -20
- package/src/react/hooks/{data/collections/useCollectionBalanceDetails.test.tsx → collection/balance-details.test.tsx} +13 -8
- package/src/react/hooks/{data/collections/useCollectionBalanceDetails.tsx → collection/balance-details.tsx} +3 -3
- package/src/react/hooks/collection/index.ts +11 -0
- package/src/react/hooks/{data/collections/useListCollections.test.tsx → collection/list.test.tsx} +15 -14
- package/src/react/hooks/{data/collections/useListCollections.tsx → collection/list.tsx} +7 -7
- package/src/react/hooks/collection/market-detail-polling.test.tsx +146 -0
- package/src/react/hooks/{data/collections/useCollectionDetailsPolling.tsx → collection/market-detail-polling.tsx} +13 -12
- package/src/react/hooks/collection/market-filtered-count.test.tsx +121 -0
- package/src/react/hooks/{data/orders/useGetCountOfFilteredOrders.tsx → collection/market-filtered-count.tsx} +6 -6
- package/src/react/hooks/{data/orders/useFloorOrder.test.tsx → collection/market-floor.test.tsx} +19 -15
- package/src/react/hooks/{data/orders/useFloorOrder.tsx → collection/market-floor.tsx} +13 -9
- package/src/react/hooks/collection/market-items-count.test.tsx +121 -0
- package/src/react/hooks/{data/orders/useCountItemsOrdersForCollection.tsx → collection/market-items-count.tsx} +9 -9
- package/src/react/hooks/collection/market-items-paginated.test.tsx +142 -0
- package/src/react/hooks/{data/orders/useListItemsOrdersForCollectionPaginated.tsx → collection/market-items-paginated.tsx} +11 -9
- package/src/react/hooks/collection/market-items.test.tsx +184 -0
- package/src/react/hooks/{data/orders/useListItemsOrdersForCollection.tsx → collection/market-items.tsx} +16 -14
- package/src/react/hooks/{data/collections/useCollection.test.tsx → collection/metadata.test.tsx} +18 -13
- package/src/react/hooks/{data/collections/useCollection.tsx → collection/metadata.tsx} +16 -7
- package/src/react/hooks/collection/useCollectionActiveListingsCurrencies.test.tsx +150 -0
- package/src/react/hooks/{data/collections → collection}/useCollectionActiveListingsCurrencies.tsx +3 -3
- package/src/react/hooks/collection/useCollectionActiveOffersCurrencies.test.tsx +150 -0
- package/src/react/hooks/{data/collections → collection}/useCollectionActiveOffersCurrencies.tsx +3 -3
- package/src/react/hooks/config/__snapshots__/useMarketplaceConfig.test.tsx.snap +12 -11
- package/src/react/hooks/config/useConnectorMetadata.tsx +1 -1
- package/src/react/hooks/config/useMarketplaceConfig.test.tsx +3 -1
- package/src/react/hooks/config/useMarketplaceConfig.tsx +1 -1
- package/src/react/hooks/contracts/index.ts +1 -0
- package/src/react/hooks/contracts/useERC721Owner.test.tsx +82 -0
- package/src/react/hooks/contracts/useERC721Owner.tsx +47 -0
- package/src/react/hooks/contracts/useSalesContractABI.ts +2 -2
- package/src/react/hooks/{utils/useComparePrices.test.tsx → currency/compare-prices.test.tsx} +17 -11
- package/src/react/hooks/{utils/useComparePrices.tsx → currency/compare-prices.tsx} +8 -6
- package/src/react/hooks/{utils/useConvertPriceToUSD.test.tsx → currency/convert-to-usd.test.tsx} +17 -16
- package/src/react/hooks/{utils/useConvertPriceToUSD.tsx → currency/convert-to-usd.tsx} +6 -6
- package/src/react/hooks/{data/market/useCurrency.test.tsx → currency/currency.test.tsx} +18 -14
- package/src/react/hooks/{data/market/useCurrency.tsx → currency/currency.tsx} +3 -3
- package/src/react/hooks/currency/index.ts +4 -0
- package/src/react/hooks/{data/market/useMarketCurrencies.test.tsx → currency/list.test.tsx} +49 -74
- package/src/react/hooks/{data/market/useMarketCurrencies.tsx → currency/list.tsx} +7 -7
- package/src/react/hooks/data/orders/useOrders.test.tsx +143 -0
- package/src/react/hooks/data/orders/useOrders.tsx +73 -0
- package/src/react/hooks/data/tokens/useCurrencyBalance.tsx +1 -1
- package/src/react/hooks/index.ts +9 -12
- package/src/react/hooks/inventory/index.ts +1 -0
- package/src/react/hooks/{data/inventory/useInventory.test.tsx → inventory/inventory.test.tsx} +12 -14
- package/src/react/hooks/inventory/inventory.tsx +17 -0
- package/src/react/hooks/{data/tokens/useListBalances.test.tsx → token/balances.test.tsx} +22 -11
- package/src/react/hooks/token/balances.tsx +59 -0
- package/src/react/hooks/{data/tokens/useCurrencyBalance.test.tsx → token/currency-balance.test.tsx} +6 -6
- package/src/react/hooks/token/currency-balance.tsx +151 -0
- package/src/react/hooks/token/index.ts +5 -0
- package/src/react/hooks/{data/tokens/useSearchTokenMetadata.test.tsx → token/metadata-search.test.tsx} +38 -30
- package/src/react/hooks/{data/tokens/useSearchTokenMetadata.tsx → token/metadata-search.tsx} +27 -24
- package/src/react/hooks/{data/tokens/useListTokenMetadata.test.tsx → token/metadata.test.tsx} +27 -24
- package/src/react/hooks/{data/tokens/useListTokenMetadata.tsx → token/metadata.tsx} +7 -7
- package/src/react/hooks/{data/tokens/useGetTokenRanges.test.tsx → token/ranges.test.tsx} +15 -14
- package/src/react/hooks/{data/tokens/useGetTokenRanges.tsx → token/ranges.tsx} +12 -13
- package/src/react/hooks/transactions/index.ts +5 -0
- package/src/react/hooks/transactions/useBuyTransaction.tsx +95 -0
- package/src/react/hooks/transactions/useCancelOrder.test.tsx +15 -35
- package/src/react/hooks/transactions/useCancelOrder.tsx +3 -9
- package/src/react/hooks/transactions/useCancelTransactionSteps.tsx +3 -9
- package/src/react/hooks/transactions/useGenerateCancelTransaction.test.tsx +23 -12
- package/src/react/hooks/transactions/useGenerateCancelTransaction.tsx +16 -11
- package/src/react/hooks/transactions/useGenerateListingTransaction.test.tsx +17 -57
- package/src/react/hooks/transactions/useGenerateListingTransaction.tsx +17 -12
- package/src/react/hooks/transactions/useGenerateOfferTransaction.test.tsx +14 -15
- package/src/react/hooks/transactions/useGenerateOfferTransaction.tsx +11 -11
- package/src/react/hooks/transactions/useGenerateSellTransaction.test.tsx +28 -38
- package/src/react/hooks/transactions/useGenerateSellTransaction.tsx +16 -15
- package/src/react/hooks/transactions/useMarketTransactionSteps.test.tsx +105 -0
- package/src/react/hooks/transactions/useMarketTransactionSteps.tsx +89 -0
- package/src/react/hooks/transactions/useOrderSteps.tsx +23 -36
- package/src/react/hooks/transactions/usePrimarySaleTransactionSteps.ts +196 -0
- package/src/react/hooks/transactions/useProcessStep.test.tsx +63 -59
- package/src/react/hooks/transactions/useProcessStep.ts +52 -54
- package/src/react/hooks/transactions/useTransactionExecution.test.tsx +99 -0
- package/src/react/hooks/transactions/useTransactionExecution.ts +31 -0
- package/src/react/hooks/transactions/useTransactionType.ts +20 -0
- package/src/react/hooks/transactions/useTransferTokens.test.tsx +16 -16
- package/src/react/hooks/transactions/useTransferTokens.tsx +17 -5
- package/src/react/hooks/ui/card-data/index.ts +4 -0
- package/src/react/hooks/ui/card-data/market-card-data-paged.test.tsx +375 -0
- package/src/react/hooks/ui/card-data/market-card-data-paged.tsx +265 -0
- package/src/react/hooks/{data/market/useListMarketCardData.test.tsx → ui/card-data/market-card-data.test.tsx} +30 -28
- package/src/react/hooks/{data/market/useListMarketCardData.tsx → ui/card-data/market-card-data.tsx} +44 -31
- package/src/react/hooks/{data/primary-sales/useList1155ShopCardData.tsx → ui/card-data/primary-sale-1155-card-data.tsx} +24 -31
- package/src/react/hooks/{data/primary-sales/useList721ShopCardData.tsx → ui/card-data/primary-sale-721-card-data.tsx} +70 -37
- package/src/react/hooks/ui/index.ts +3 -1
- package/src/react/hooks/ui/url-state/filter-state.test.tsx +569 -0
- package/src/react/hooks/ui/{useFilterState.tsx → url-state/filter-state.tsx} +34 -20
- package/src/react/hooks/ui/url-state/index.ts +1 -0
- package/src/react/hooks/ui/useCollectibleCardOfferState.test.tsx +75 -0
- package/src/react/hooks/ui/useCollectibleCardOfferState.ts +47 -0
- package/src/react/hooks/ui/useFilters.test.tsx +4 -1
- package/src/react/hooks/ui/useFilters.tsx +2 -2
- package/src/react/hooks/util/optimisticCancelUpdates.test.ts +489 -0
- package/src/react/hooks/util/optimisticCancelUpdates.ts +21 -22
- package/src/react/hooks/utils/index.ts +0 -4
- package/src/react/hooks/utils/useAutoSelectFeeOption.test.tsx +8 -5
- package/src/react/hooks/utils/useAutoSelectFeeOption.tsx +33 -17
- package/src/react/hooks/utils/useRoyalty.test.tsx +1 -1
- package/src/react/hooks/utils/useRoyalty.tsx +99 -34
- package/src/react/hooks/utils/useWaasFeeOptions.tsx +234 -0
- package/src/react/hooks/utils/waasFeeOptionsStore.ts +141 -0
- package/src/react/index.ts +3 -0
- package/src/react/providers/index.tsx +3 -3
- package/src/react/providers/modal-provider.tsx +6 -17
- package/src/react/providers/provider.test.tsx +1 -1
- package/src/react/providers/shadow-root.tsx +1 -1
- package/src/react/providers/theme-provider.tsx +1 -1
- package/src/react/queries/checkout/index.ts +1 -0
- package/src/react/queries/checkout/primary-sale-checkout-options.ts +118 -0
- package/src/react/queries/collectible/balance.ts +113 -0
- package/src/react/queries/collectible/index.ts +15 -0
- package/src/react/queries/collectible/market-count.ts +91 -0
- package/src/react/queries/collectible/market-highest-offer.ts +74 -0
- package/src/react/queries/collectible/market-list-paginated.ts +110 -0
- package/src/react/queries/collectible/market-list.ts +116 -0
- package/src/react/queries/collectible/market-listings-count.ts +70 -0
- package/src/react/queries/collectible/market-listings.ts +71 -0
- package/src/react/queries/collectible/market-lowest-listing.ts +74 -0
- package/src/react/queries/collectible/market-offers-count.ts +70 -0
- package/src/react/queries/collectible/market-offers.ts +90 -0
- package/src/react/queries/collectible/metadata.ts +84 -0
- package/src/react/queries/collectible/primary-sale-item.ts +79 -0
- package/src/react/queries/collectible/primary-sale-items-count.ts +67 -0
- package/src/react/queries/collectible/primary-sale-items.ts +96 -0
- package/src/react/queries/collectible/queryKeys.ts +12 -0
- package/src/react/queries/collectible/token-balances.ts +83 -0
- package/src/react/queries/collection/activeListingsCurrencies.ts +74 -0
- package/src/react/queries/collection/activeOffersCurrencies.ts +74 -0
- package/src/react/queries/collection/balance-details.ts +103 -0
- package/src/react/queries/collection/index.ts +9 -0
- package/src/react/queries/collection/list.ts +195 -0
- package/src/react/queries/collection/market-detail.ts +60 -0
- package/src/react/queries/collection/market-filtered-count.ts +67 -0
- package/src/react/queries/collection/market-floor.ts +58 -0
- package/src/react/queries/collection/market-items-count.ts +69 -0
- package/src/react/queries/collection/market-items-paginated.ts +84 -0
- package/src/react/queries/collection/market-items.ts +72 -0
- package/src/react/queries/collection/metadata.ts +60 -0
- package/src/react/queries/collection/queryKeys.ts +12 -0
- package/src/react/queries/currency/compare-prices.ts +122 -0
- package/src/react/queries/currency/convert-to-usd.ts +99 -0
- package/src/react/queries/currency/currency.ts +82 -0
- package/src/react/queries/currency/index.ts +4 -0
- package/src/react/queries/currency/list.ts +100 -0
- package/src/react/queries/index.ts +6 -7
- package/src/react/queries/inventory/inventory.ts +139 -91
- package/src/react/queries/marketplace/config.ts +85 -0
- package/src/react/queries/{market → marketplace}/filters.ts +48 -61
- package/src/react/queries/marketplace/index.ts +2 -0
- package/src/react/queries/marketplace/queryKeys.ts +12 -0
- package/src/react/queries/orders.ts +48 -0
- package/src/react/queries/token/balances.ts +107 -0
- package/src/react/queries/token/index.ts +5 -0
- package/src/react/queries/token/metadata-search.ts +95 -0
- package/src/react/queries/token/metadata.ts +80 -0
- package/src/react/queries/token/queryKeys.ts +12 -0
- package/src/react/queries/token/ranges.ts +74 -0
- package/src/react/queries/token/supplies.ts +86 -0
- package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +11 -10
- package/src/react/ssr/create-ssr-client.ts +1 -1
- package/src/react/ssr/index.ts +5 -0
- package/src/react/types/query.ts +8 -7
- package/src/react/ui/components/_internals/ErrorDisplay.tsx +87 -0
- package/src/react/ui/components/_internals/ErrorLogBox.tsx +8 -1
- package/src/react/ui/components/_internals/custom-select/CustomSelect.tsx +13 -14
- package/src/react/ui/components/_internals/pill/__tests__/Pill.test.tsx +9 -5
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/ActionButton.stories.tsx +24 -29
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/ActionButton.tsx +20 -14
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/__tests__/ActionButtonBody.test.tsx +7 -5
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/__tests__/NonOwnerActions.test.tsx +11 -6
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/__tests__/OwnerActions.test.tsx +8 -6
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/__tests__/useActionButtonLogic.test.tsx +6 -4
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/components/ActionButtonBody.tsx +14 -9
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/components/NonOwnerActions.tsx +26 -35
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/components/OwnerActions.tsx +21 -13
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/hooks/useActionButtonLogic.ts +3 -3
- package/src/react/ui/components/marketplace-collectible-card/ActionButton/index.ts +1 -0
- package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/store.ts +4 -4
- package/src/react/ui/components/marketplace-collectible-card/Card/card-badge.tsx +37 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-content.tsx +27 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-footer.tsx +38 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-media.tsx +69 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-price.tsx +44 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-sale-details.tsx +37 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-skeleton.tsx +39 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card-title.tsx +109 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/card.tsx +51 -0
- package/src/react/ui/components/marketplace-collectible-card/Card/index.ts +30 -0
- package/src/react/ui/components/marketplace-collectible-card/CollectibleCardSkeleton.tsx +1 -1
- package/src/react/ui/components/marketplace-collectible-card/_internals/PriceDisplay.tsx +87 -0
- package/src/react/ui/components/marketplace-collectible-card/constants.ts +20 -0
- package/src/react/ui/components/marketplace-collectible-card/index.ts +6 -0
- package/src/react/ui/components/marketplace-collectible-card/types.ts +31 -16
- package/src/react/ui/components/marketplace-collectible-card/utils/determineCardAction.ts +63 -0
- package/src/react/ui/components/marketplace-collectible-card/utils/formatPrice.ts +71 -2
- package/src/react/ui/components/marketplace-collectible-card/utils/index.ts +3 -0
- package/src/react/ui/components/marketplace-collectible-card/utils/renderSkeleton.tsx +44 -0
- package/src/react/ui/components/marketplace-collectible-card/utils/shopCardState.ts +83 -0
- package/src/react/ui/components/marketplace-collectible-card/utils/supplyStatus.ts +5 -5
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCard.tsx +63 -78
- package/src/react/ui/components/marketplace-collectible-card/variants/MarketCardPresentation.tsx +170 -0
- package/src/react/ui/components/marketplace-collectible-card/variants/NonTradableInventoryCard.tsx +56 -38
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCard.tsx +55 -65
- package/src/react/ui/components/marketplace-collectible-card/variants/ShopCardPresentation.tsx +144 -0
- package/src/react/ui/components/marketplace-logos/marketplace-logos.tsx +1 -5
- package/src/react/ui/components/media/Media.tsx +1 -1
- package/src/react/ui/components/media/MediaSkeleton.tsx +1 -1
- package/src/react/ui/hooks/index.ts +2 -0
- package/src/react/ui/icons/BellIcon.tsx +7 -3
- package/src/react/ui/icons/iconVariants.ts +11 -0
- package/src/react/ui/icons/index.ts +0 -3
- package/src/react/ui/index.ts +37 -8
- package/src/react/ui/modals/BuyModal/components/BuyModalContent.tsx +161 -0
- package/src/react/ui/modals/BuyModal/components/CollectibleMetadataSummary.tsx +141 -0
- package/src/react/ui/modals/BuyModal/components/CryptoPaymentModal.tsx +177 -0
- package/src/react/ui/modals/BuyModal/components/CryptoPaymentModalSkeleton.tsx +48 -0
- package/src/react/ui/modals/BuyModal/components/Modal.tsx +2 -2
- package/src/react/ui/modals/BuyModal/components/TrailsCss.ts +216 -0
- package/src/react/ui/modals/BuyModal/components/{ERC1155QuantityModal.tsx → sequence-checkout/ERC1155QuantityModal.tsx} +71 -82
- package/src/react/ui/modals/BuyModal/components/sequence-checkout/SequenceCheckoutNew.tsx +161 -0
- package/src/react/ui/modals/BuyModal/{hooks → components/sequence-checkout}/usePaymentModalParams.ts +73 -112
- package/src/react/ui/modals/BuyModal/components/types.ts +6 -5
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC1155SalePaymentParams.test.tsx +2 -14
- package/src/react/ui/modals/BuyModal/hooks/useBuyModalData.ts +151 -0
- package/src/react/ui/modals/BuyModal/hooks/useERC1155SalePaymentParams.ts +15 -28
- package/src/react/ui/modals/BuyModal/hooks/useExecuteBundledTransactions.ts +167 -0
- package/src/react/ui/modals/BuyModal/hooks/useHasSufficientBalance.ts +30 -0
- package/src/react/ui/modals/BuyModal/hooks/useMarketPlatformFee.ts +2 -2
- package/src/react/ui/modals/BuyModal/index.tsx +6 -3
- package/src/react/ui/modals/BuyModal/internal/__tests__/determineCheckoutMode.test.ts +119 -0
- package/src/react/ui/modals/BuyModal/internal/buyModalContext.ts +146 -0
- package/src/react/ui/modals/BuyModal/internal/cryptoPaymentModalContext.tsx +399 -0
- package/src/react/ui/modals/BuyModal/internal/determineCheckoutMode.ts +49 -0
- package/src/react/ui/modals/BuyModal/store.ts +25 -94
- package/src/react/ui/modals/CreateListingModal/Modal.tsx +141 -308
- package/src/react/ui/modals/CreateListingModal/__tests__/Modal.test.tsx +35 -61
- package/src/react/ui/modals/CreateListingModal/index.tsx +16 -9
- package/src/react/ui/modals/CreateListingModal/internal/context.ts +416 -0
- package/src/react/ui/modals/CreateListingModal/internal/helpers/validation.ts +79 -0
- package/src/react/ui/modals/CreateListingModal/internal/hooks/index.ts +1 -0
- package/src/react/ui/modals/CreateListingModal/internal/hooks/use-collectible-approval.ts +49 -0
- package/src/react/ui/modals/CreateListingModal/internal/listing-mutations.ts +267 -0
- package/src/react/ui/modals/CreateListingModal/internal/store.ts +150 -0
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +130 -348
- package/src/react/ui/modals/MakeOfferModal/__stories__/MakeOfferModal.mock-data.ts +494 -0
- package/src/react/ui/modals/MakeOfferModal/__stories__/MakeOfferModal.stories.tsx +699 -0
- package/src/react/ui/modals/MakeOfferModal/__tests__/Modal.test.tsx +28 -155
- package/src/react/ui/modals/MakeOfferModal/index.tsx +17 -11
- package/src/react/ui/modals/MakeOfferModal/internal/context.ts +453 -0
- package/src/react/ui/modals/MakeOfferModal/internal/helpers/validation.ts +99 -0
- package/src/react/ui/modals/MakeOfferModal/internal/hooks/index.ts +1 -0
- package/src/react/ui/modals/MakeOfferModal/internal/hooks/use-erc20-allowance.ts +43 -0
- package/src/react/ui/modals/MakeOfferModal/internal/offer-mutations.ts +231 -0
- package/src/react/ui/modals/MakeOfferModal/internal/store.ts +150 -0
- package/src/react/ui/modals/SellModal/Modal.tsx +74 -213
- package/src/react/ui/modals/SellModal/index.tsx +5 -11
- package/src/react/ui/modals/SellModal/internal/context.ts +284 -0
- package/src/react/ui/modals/SellModal/internal/sell-mutations.ts +163 -0
- package/src/react/ui/modals/SellModal/internal/store.ts +76 -0
- package/src/react/ui/modals/SellModal/internal/use-generate-sell-transaction.ts +93 -0
- package/src/react/ui/modals/TransferModal/__tests__/store.test.ts +51 -345
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/TokenQuantityInput.tsx +36 -34
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/WalletAddressInput.tsx +19 -28
- package/src/react/ui/modals/TransferModal/index.tsx +98 -119
- package/src/react/ui/modals/TransferModal/internal/context.ts +404 -0
- package/src/react/ui/modals/TransferModal/internal/store.ts +118 -0
- package/src/react/ui/modals/_internal/components/alertMessage/index.tsx +2 -3
- package/src/react/ui/modals/_internal/components/baseModal/ActionModal.tsx +338 -0
- package/src/react/ui/modals/_internal/components/baseModal/BaseModal.tsx +51 -0
- package/src/react/ui/modals/_internal/components/baseModal/ErrorBoundary.tsx +83 -0
- package/src/react/ui/modals/_internal/components/baseModal/ErrorModal.tsx +51 -0
- package/src/react/ui/modals/_internal/components/baseModal/LoadingModal.tsx +35 -0
- package/src/react/ui/modals/_internal/components/baseModal/SmartErrorHandler.tsx +31 -0
- package/src/react/ui/modals/_internal/components/baseModal/__tests__/ErrorBoundary.test.tsx +390 -0
- package/src/react/ui/modals/_internal/components/baseModal/errors/ModalInitializationError.tsx +91 -0
- package/src/react/ui/modals/_internal/components/baseModal/errors/errorActionType.ts +5 -0
- package/src/react/ui/modals/_internal/components/baseModal/index.ts +13 -0
- package/src/react/ui/modals/_internal/components/calendarDropdown/TimeSelector.tsx +1 -1
- package/src/react/ui/modals/_internal/components/calendarDropdown/index.tsx +14 -9
- package/src/react/ui/modals/_internal/components/consts.ts +19 -5
- package/src/react/ui/modals/_internal/components/currencyImage/index.tsx +5 -7
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +6 -14
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +17 -24
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/floorPriceText/__tests__/FloorPriceText.test.tsx +61 -40
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +23 -19
- package/src/react/ui/modals/_internal/components/priceInput/__tests__/PriceInput.test.tsx +3 -3
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +66 -66
- package/src/react/ui/modals/_internal/components/quantityInput/__tests__/index.test.tsx +22 -137
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +84 -131
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +14 -31
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/_components/ActionButtons.tsx +37 -25
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +13 -6
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/store.ts +9 -26
- package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +27 -29
- package/src/react/ui/modals/_internal/components/switchChainErrorModal/store.ts +2 -2
- package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +10 -9
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +11 -7
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +8 -7
- package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/TransactionStatusModal.test.tsx +3 -5
- package/src/react/ui/modals/_internal/components/transactionStatusModal/__tests__/utils.test.ts +3 -3
- package/src/react/ui/modals/_internal/components/transactionStatusModal/hooks/useTransactionStatus.ts +4 -15
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +14 -15
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +8 -11
- package/src/react/ui/modals/_internal/components/waasFeeOptionsSelect/WaasFeeOptionsSelect.tsx +65 -10
- package/src/react/ui/modals/_internal/constants/opensea-currencies.ts +484 -0
- package/src/react/ui/modals/_internal/helpers/currency.ts +56 -0
- package/src/react/ui/modals/_internal/helpers/dnum-utils.ts +40 -0
- package/src/react/ui/modals/_internal/helpers/flow-state.ts +269 -0
- package/src/react/ui/modals/_internal/helpers/step-guards.ts +131 -0
- package/src/react/ui/modals/_internal/types/steps.ts +145 -0
- package/src/react/ui/modals/_internal/types.ts +2 -9
- package/src/react/utils/index.ts +2 -0
- package/src/react/utils/normalize-attributes.test.ts +94 -0
- package/src/react/utils/normalize-attributes.ts +89 -0
- package/src/react/utils/normalize-properties.test.ts +77 -0
- package/src/react/utils/normalize-properties.ts +60 -0
- package/src/react/utils/normalizePriceFilters.ts +25 -0
- package/src/react/utils/waitForTransactionReceipt.ts +2 -2
- package/src/styles/index.css +2 -0
- package/src/styles/styles.ts +2036 -374
- package/src/types/api-types.ts +6 -14
- package/src/types/buyModalErrors.ts +24 -30
- package/src/types/index.ts +4 -2
- package/src/types/sdk-config.ts +14 -1
- package/src/types/transactions.ts +10 -0
- package/src/types/types.ts +93 -14
- package/src/utils/__tests__/getMarketplaceDetails.test.ts +1 -1
- package/src/utils/_internal/error/base.ts +1 -1
- package/src/utils/_internal/error/transaction.ts +4 -5
- package/src/utils/abi/helpers.ts +38 -0
- package/src/utils/abi/index.ts +1 -0
- package/src/utils/decode/erc20.ts +2 -2
- package/src/utils/errors.ts +527 -0
- package/src/utils/getConduitAddressForOrderbook.ts +38 -0
- package/src/utils/getErrorMessage.ts +37 -0
- package/src/utils/getMarketplaceDetails.ts +1 -1
- package/src/utils/getSequenceMarketRequestId.ts +3 -7
- package/src/utils/getWagmiErrorMessage.ts +241 -0
- package/src/utils/getWebRPCErrorMessage.ts +63 -0
- package/src/utils/networkconfigToWagmiChain.ts +2 -1
- package/src/utils/price.ts +12 -10
- package/test/const.ts +3 -3
- package/test/globalSetup.ts +4 -5
- package/test/handlers.ts +2 -2
- package/test/server-setup.ts +8 -8
- package/test/setup.ts +11 -0
- package/test/test-utils.tsx +23 -6
- package/tsconfig.json +8 -1
- package/tsdown.config.ts +12 -3
- package/dist/CartIcon.js +0 -102
- package/dist/CartIcon.js.map +0 -1
- package/dist/CollectibleCard.d.ts +0 -8
- package/dist/builder.gen.js +0 -300
- package/dist/builder.gen.js.map +0 -1
- package/dist/collectibles.js +0 -319
- package/dist/collectibles.js.map +0 -1
- package/dist/collections.js +0 -320
- package/dist/collections.js.map +0 -1
- package/dist/components.js +0 -117
- package/dist/components.js.map +0 -1
- package/dist/listCollectiblesPaginated.d.ts +0 -322
- package/dist/listCollections.d.ts +0 -821
- package/dist/lowestListing.d.ts +0 -465
- package/dist/market.js +0 -207
- package/dist/market.js.map +0 -1
- package/dist/marketCurrencies.d.ts +0 -163
- package/dist/marketCurrencies.js +0 -56
- package/dist/marketCurrencies.js.map +0 -1
- package/dist/marketplace.gen.js +0 -1144
- package/dist/marketplace.gen.js.map +0 -1
- package/dist/marketplaceConfig.js.map +0 -1
- package/dist/orders.js +0 -462
- package/dist/orders.js.map +0 -1
- package/dist/primary-sales.js +0 -152
- package/dist/primary-sales.js.map +0 -1
- package/dist/query.d.ts +0 -31
- package/dist/react/hooks/data/collectibles/index.d.ts +0 -5
- package/dist/react/hooks/data/collectibles/index.js +0 -39
- package/dist/react/hooks/data/collections/index.d.ts +0 -11
- package/dist/react/hooks/data/collections/index.js +0 -39
- package/dist/react/hooks/data/index.d.ts +0 -37
- package/dist/react/hooks/data/index.js +0 -39
- package/dist/react/hooks/data/inventory/index.d.ts +0 -37
- package/dist/react/hooks/data/inventory/index.js +0 -39
- package/dist/react/hooks/data/market/index.d.ts +0 -6
- package/dist/react/hooks/data/market/index.js +0 -39
- package/dist/react/hooks/data/orders/index.d.ts +0 -5
- package/dist/react/hooks/data/orders/index.js +0 -39
- package/dist/react/hooks/data/primary-sales/index.d.ts +0 -37
- package/dist/react/hooks/data/primary-sales/index.js +0 -39
- package/dist/react/hooks/data/tokens/index.d.ts +0 -5
- package/dist/react/hooks/data/tokens/index.js +0 -39
- package/dist/react/queries/collectibles/index.d.ts +0 -5
- package/dist/react/queries/collectibles/index.js +0 -22
- package/dist/react/queries/collections/index.d.ts +0 -11
- package/dist/react/queries/collections/index.js +0 -20
- package/dist/react/queries/market/index.d.ts +0 -6
- package/dist/react/queries/market/index.js +0 -22
- package/dist/react/queries/orders/index.d.ts +0 -5
- package/dist/react/queries/orders/index.js +0 -13
- package/dist/react/queries/primary-sales/index.d.ts +0 -4
- package/dist/react/queries/primary-sales/index.js +0 -13
- package/dist/react/queries/tokens/index.d.ts +0 -5
- package/dist/react/queries/tokens/index.js +0 -13
- package/dist/react/queries/utils/index.d.ts +0 -4
- package/dist/react/queries/utils/index.js +0 -22
- package/dist/react/ssr/index.js.map +0 -1
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.d.ts +0 -3
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/components/index.js +0 -22
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.d.ts +0 -51
- package/dist/react/ui/components/marketplace-collectible-card/components/footer/index.js +0 -39
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +0 -40
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +0 -39
- package/dist/src.js.map +0 -1
- package/dist/tokenBalances.js +0 -56
- package/dist/tokenBalances.js.map +0 -1
- package/dist/tokenSupplies.d.ts +0 -261
- package/dist/tokens.js +0 -219
- package/dist/tokens.js.map +0 -1
- package/dist/utils3.js +0 -43
- package/dist/utils3.js.map +0 -1
- package/dist/waitForTransactionReceipt.js +0 -25
- package/dist/waitForTransactionReceipt.js.map +0 -1
- package/src/react/_internal/api/__mocks__/builder.msw.ts +0 -239
- package/src/react/_internal/api/__mocks__/indexer.msw.ts +0 -216
- package/src/react/_internal/api/__mocks__/marketplace.msw.ts +0 -402
- package/src/react/_internal/api/__mocks__/metadata.msw.ts +0 -195
- package/src/react/_internal/api/builder.gen.ts +0 -773
- package/src/react/_internal/api/marketplace.gen.ts +0 -2718
- package/src/react/_internal/api/query-keys.ts +0 -124
- package/src/react/hooks/data/collectibles/index.ts +0 -6
- package/src/react/hooks/data/collectibles/useListCollectibleActivities.test.tsx +0 -192
- package/src/react/hooks/data/collectibles/useListCollectibleActivities.tsx +0 -98
- package/src/react/hooks/data/collections/index.ts +0 -8
- package/src/react/hooks/data/collections/useCollectionActiveListingsCurrencies.test.tsx +0 -112
- package/src/react/hooks/data/collections/useCollectionActiveOffersCurrencies.test.tsx +0 -110
- package/src/react/hooks/data/collections/useCollectionDetails.test.tsx +0 -83
- package/src/react/hooks/data/collections/useCollectionDetails.ts +0 -69
- package/src/react/hooks/data/collections/useCollectionDetailsPolling.test.tsx +0 -137
- package/src/react/hooks/data/collections/useListCollectionActivities.test.tsx +0 -227
- package/src/react/hooks/data/collections/useListCollectionActivities.tsx +0 -93
- package/src/react/hooks/data/index.ts +0 -6
- package/src/react/hooks/data/inventory/index.ts +0 -1
- package/src/react/hooks/data/inventory/useInventory.tsx +0 -12
- package/src/react/hooks/data/market/index.ts +0 -3
- package/src/react/hooks/data/orders/index.ts +0 -11
- package/src/react/hooks/data/primary-sales/index.ts +0 -7
- package/src/react/hooks/data/primary-sales/useCountOfPrimarySaleItems.tsx +0 -13
- package/src/react/hooks/data/primary-sales/useGetCountOfPrimarySaleItems.tsx +0 -48
- package/src/react/hooks/data/tokens/index.ts +0 -5
- package/src/react/hooks/data/tokens/useListBalances.tsx +0 -29
- package/src/react/hooks/data/tokens/useTokenSupplies.ts +0 -69
- package/src/react/hooks/utils/useCheckoutOptions.test.tsx +0 -162
- package/src/react/hooks/utils/useCheckoutOptions.tsx +0 -98
- package/src/react/queries/collectibles/balanceOfCollectible.ts +0 -90
- package/src/react/queries/collectibles/collectible.ts +0 -81
- package/src/react/queries/collectibles/countOfCollectables.ts +0 -109
- package/src/react/queries/collectibles/index.ts +0 -7
- package/src/react/queries/collectibles/listCollectibleActivities.ts +0 -121
- package/src/react/queries/collectibles/listCollectibles.ts +0 -115
- package/src/react/queries/collectibles/listCollectiblesPaginated.ts +0 -104
- package/src/react/queries/collectibles/tokenBalances.ts +0 -89
- package/src/react/queries/collections/activeListingsCurrencies.ts +0 -84
- package/src/react/queries/collections/activeOffersCurrencies.ts +0 -84
- package/src/react/queries/collections/collection.ts +0 -69
- package/src/react/queries/collections/collectionBalanceDetails.ts +0 -107
- package/src/react/queries/collections/collectionDetails.ts +0 -79
- package/src/react/queries/collections/index.ts +0 -7
- package/src/react/queries/collections/listCollectionActivities.ts +0 -117
- package/src/react/queries/collections/listCollections.ts +0 -175
- package/src/react/queries/market/checkoutOptions.ts +0 -107
- package/src/react/queries/market/checkoutOptionsSalesContract.ts +0 -108
- package/src/react/queries/market/currency.ts +0 -92
- package/src/react/queries/market/index.ts +0 -6
- package/src/react/queries/market/marketCurrencies.ts +0 -120
- package/src/react/queries/market/marketplaceConfig.ts +0 -117
- package/src/react/queries/orders/countItemsOrdersForCollection.ts +0 -86
- package/src/react/queries/orders/countListingsForCollectible.ts +0 -90
- package/src/react/queries/orders/countOffersForCollectible.ts +0 -90
- package/src/react/queries/orders/floorOrder.ts +0 -74
- package/src/react/queries/orders/getCountOfFilteredOrders.ts +0 -88
- package/src/react/queries/orders/highestOffer.ts +0 -78
- package/src/react/queries/orders/index.ts +0 -11
- package/src/react/queries/orders/listItemsOrdersForCollection.ts +0 -90
- package/src/react/queries/orders/listItemsOrdersForCollectionPaginated.ts +0 -90
- package/src/react/queries/orders/listListingsForCollectible.ts +0 -97
- package/src/react/queries/orders/listOffersForCollectible.ts +0 -116
- package/src/react/queries/orders/lowestListing.ts +0 -81
- package/src/react/queries/primary-sales/countOfPrimarySaleItems.ts +0 -62
- package/src/react/queries/primary-sales/index.ts +0 -4
- package/src/react/queries/primary-sales/primarySaleItem.ts +0 -80
- package/src/react/queries/primary-sales/primarySaleItems.ts +0 -94
- package/src/react/queries/primary-sales/primarySaleItemsCount.ts +0 -79
- package/src/react/queries/tokens/getTokenRanges.ts +0 -75
- package/src/react/queries/tokens/index.ts +0 -5
- package/src/react/queries/tokens/listBalances.ts +0 -71
- package/src/react/queries/tokens/listTokenMetadata.ts +0 -81
- package/src/react/queries/tokens/searchTokenMetadata.ts +0 -101
- package/src/react/queries/tokens/tokenSupplies.ts +0 -84
- package/src/react/queries/utils/comparePrices.ts +0 -132
- package/src/react/queries/utils/convertPriceToUSD.ts +0 -105
- package/src/react/queries/utils/index.ts +0 -2
- package/src/react/ui/components/marketplace-collectible-card/components/ActionButtonWrapper.tsx +0 -79
- package/src/react/ui/components/marketplace-collectible-card/components/BaseCard.tsx +0 -68
- package/src/react/ui/components/marketplace-collectible-card/components/footer/Footer.tsx +0 -165
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/FooterName.tsx +0 -103
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/PriceDisplay.tsx +0 -80
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/SaleDetailsPill.tsx +0 -29
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/TokenTypeBalancePill.tsx +0 -30
- package/src/react/ui/components/marketplace-collectible-card/components/footer/components/index.ts +0 -4
- package/src/react/ui/components/marketplace-collectible-card/components/footer/index.ts +0 -2
- package/src/react/ui/icons/CalendarIcon.tsx +0 -37
- package/src/react/ui/icons/CartIcon.tsx +0 -52
- package/src/react/ui/icons/InfoIcon.tsx +0 -44
- package/src/react/ui/modals/BuyModal/__tests__/BuyModalRouter.test.tsx +0 -557
- package/src/react/ui/modals/BuyModal/__tests__/ERC1155ShopModal.test.tsx +0 -409
- package/src/react/ui/modals/BuyModal/__tests__/ERC721ShopModal.test.tsx +0 -272
- package/src/react/ui/modals/BuyModal/__tests__/Modal.test.tsx.bak +0 -112
- package/src/react/ui/modals/BuyModal/__tests__/Modal1155.test.tsx +0 -251
- package/src/react/ui/modals/BuyModal/__tests__/store.test.ts +0 -105
- package/src/react/ui/modals/BuyModal/components/BuyModalRouter.tsx +0 -157
- package/src/react/ui/modals/BuyModal/components/ERC1155BuyModal.tsx +0 -198
- package/src/react/ui/modals/BuyModal/components/ERC1155ShopModal.tsx +0 -108
- package/src/react/ui/modals/BuyModal/components/ERC721BuyModal.tsx +0 -116
- package/src/react/ui/modals/BuyModal/components/ERC721ShopModal.tsx +0 -86
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useCheckoutOptions.test.tsx +0 -115
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useERC721SalePaymentParams.test.tsx +0 -283
- package/src/react/ui/modals/BuyModal/hooks/__tests__/useMarketPlatformFee.test.tsx +0 -145
- package/src/react/ui/modals/BuyModal/hooks/useCheckoutOptions.ts +0 -86
- package/src/react/ui/modals/BuyModal/hooks/useERC721SalePaymentParams.ts +0 -216
- package/src/react/ui/modals/BuyModal/hooks/useLoadData.ts +0 -120
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +0 -98
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +0 -87
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +0 -246
- package/src/react/ui/modals/CreateListingModal/store.ts +0 -99
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +0 -90
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +0 -71
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +0 -241
- package/src/react/ui/modals/MakeOfferModal/store.ts +0 -94
- package/src/react/ui/modals/SellModal/__tests__/Modal.test.tsx +0 -85
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +0 -79
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +0 -77
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +0 -242
- package/src/react/ui/modals/SellModal/store.ts +0 -62
- package/src/react/ui/modals/SellModal/utils.ts +0 -38
- package/src/react/ui/modals/SuccessfulPurchaseModal/__tests__/Modal.test.tsx +0 -157
- package/src/react/ui/modals/SuccessfulPurchaseModal/index.tsx +0 -154
- package/src/react/ui/modals/SuccessfulPurchaseModal/store.ts +0 -71
- package/src/react/ui/modals/TransferModal/__tests__/__snapshots__/store.test.ts.snap +0 -17
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/__tests__/useHandleTransfer.test.tsx +0 -412
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/TransferButton.tsx +0 -66
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +0 -137
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx +0 -97
- package/src/react/ui/modals/TransferModal/_views/followWalletInstructions/index.tsx +0 -31
- package/src/react/ui/modals/TransferModal/messages.ts +0 -14
- package/src/react/ui/modals/TransferModal/store.ts +0 -122
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.test.tsx +0 -281
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +0 -113
- package/src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx +0 -35
- package/src/react/ui/modals/_internal/components/actionModal/LoadingModal.tsx +0 -32
- package/src/react/ui/modals/_internal/components/actionModal/index.ts +0 -1
- package/src/types/custom.d.ts +0 -1
- package/src/types/messages.ts +0 -43
- package/src/types/new-marketplace-types.ts +0 -95
- /package/src/react/ui/components/{_internals/action-button → marketplace-collectible-card/ActionButton}/types.ts +0 -0
- /package/src/react/ui/modals/_internal/hooks/{useSelectWaasFeeOptions.ts → useSelectWaasFeeOptions.tsx} +0 -0
|
@@ -0,0 +1,1069 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Custom ESLint plugin to enforce Sequence SDK type conventions.
|
|
3
|
+
*
|
|
4
|
+
* Ensures consistent use of branded types (Address, TokenId, Amount, ChainId)
|
|
5
|
+
* instead of raw primitives (string, number) for blockchain-related values.
|
|
6
|
+
*
|
|
7
|
+
* Supports auto-fix for type annotations (run with --fix).
|
|
8
|
+
*
|
|
9
|
+
* @author Sequence SDK Team
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// ============================================================
|
|
13
|
+
// HELPER FUNCTIONS
|
|
14
|
+
// ============================================================
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get the type annotation text from a node
|
|
18
|
+
* @param {import('eslint').Rule.RuleContext} context
|
|
19
|
+
* @param {import('@typescript-eslint/types').TSESTree.TypeNode} typeAnnotation
|
|
20
|
+
* @returns {string}
|
|
21
|
+
*/
|
|
22
|
+
function getTypeText(context, typeAnnotation) {
|
|
23
|
+
if (!typeAnnotation) return '';
|
|
24
|
+
return context.sourceCode.getText(typeAnnotation);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Replace 'string' with a new type in a type annotation string.
|
|
29
|
+
* Handles union types: 'string | undefined' → 'bigint | undefined'
|
|
30
|
+
* @param {string} typeText - Original type annotation text
|
|
31
|
+
* @param {string} newType - Type to replace 'string' with
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
34
|
+
function replaceStringType(typeText, newType) {
|
|
35
|
+
// Split by | and replace 'string' parts
|
|
36
|
+
const parts = typeText.split(/\s*\|\s*/);
|
|
37
|
+
const newParts = parts.map((part) => (part === 'string' ? newType : part));
|
|
38
|
+
return newParts.join(' | ');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Check if type annotation matches any of the allowed types
|
|
43
|
+
* @param {string} typeText - The type annotation text
|
|
44
|
+
* @param {string[]} allowedTypes - List of allowed type names
|
|
45
|
+
* @returns {boolean}
|
|
46
|
+
*/
|
|
47
|
+
function isAllowedType(typeText, allowedTypes) {
|
|
48
|
+
// Handle union types: "Address | undefined", "TokenId | null"
|
|
49
|
+
const parts = typeText.split(/\s*\|\s*/);
|
|
50
|
+
const nonNullableParts = parts.filter(
|
|
51
|
+
(p) => p !== 'undefined' && p !== 'null',
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
// If there's only nullable parts (e.g., just "undefined"), skip
|
|
55
|
+
if (nonNullableParts.length === 0) return true;
|
|
56
|
+
|
|
57
|
+
// Check if any non-nullable part matches allowed types
|
|
58
|
+
return nonNullableParts.some((part) =>
|
|
59
|
+
allowedTypes.some((allowed) => {
|
|
60
|
+
// Exact match
|
|
61
|
+
if (part === allowed) return true;
|
|
62
|
+
// Handle generic types like Array<Address>
|
|
63
|
+
if (part.includes(`<${allowed}>`)) return true;
|
|
64
|
+
if (part.includes(`${allowed}[]`)) return true;
|
|
65
|
+
// Handle qualified names like Indexer.Address
|
|
66
|
+
if (part.endsWith(`.${allowed}`)) return true;
|
|
67
|
+
return false;
|
|
68
|
+
}),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Check if type annotation is explicitly 'string'
|
|
74
|
+
* @param {string} typeText - The type annotation text
|
|
75
|
+
* @returns {boolean}
|
|
76
|
+
*/
|
|
77
|
+
function isStringType(typeText) {
|
|
78
|
+
const parts = typeText.split(/\s*\|\s*/);
|
|
79
|
+
return parts.some((p) => p === 'string');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Check if type annotation is explicitly 'number'
|
|
84
|
+
* @param {string} typeText - The type annotation text
|
|
85
|
+
* @returns {boolean}
|
|
86
|
+
*/
|
|
87
|
+
function _isNumberType(typeText) {
|
|
88
|
+
const parts = typeText.split(/\s*\|\s*/);
|
|
89
|
+
return parts.some((p) => p === 'number');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Check if a node is a parameter, variable, or property with type annotation
|
|
94
|
+
* @param {import('@typescript-eslint/types').TSESTree.Node} node
|
|
95
|
+
* @returns {{ name: string, typeAnnotation: any } | null}
|
|
96
|
+
*/
|
|
97
|
+
function getTypedIdentifier(node) {
|
|
98
|
+
// Function parameter: function foo(address: string)
|
|
99
|
+
if (node.type === 'Identifier' && node.typeAnnotation?.typeAnnotation) {
|
|
100
|
+
return {
|
|
101
|
+
name: node.name,
|
|
102
|
+
typeAnnotation: node.typeAnnotation.typeAnnotation,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Variable declarator: const address: string = ...
|
|
107
|
+
if (
|
|
108
|
+
node.type === 'VariableDeclarator' &&
|
|
109
|
+
node.id?.type === 'Identifier' &&
|
|
110
|
+
node.id.typeAnnotation?.typeAnnotation
|
|
111
|
+
) {
|
|
112
|
+
return {
|
|
113
|
+
name: node.id.name,
|
|
114
|
+
typeAnnotation: node.id.typeAnnotation.typeAnnotation,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Property signature: interface X { address: string }
|
|
119
|
+
if (
|
|
120
|
+
node.type === 'TSPropertySignature' &&
|
|
121
|
+
node.key?.type === 'Identifier' &&
|
|
122
|
+
node.typeAnnotation?.typeAnnotation
|
|
123
|
+
) {
|
|
124
|
+
return {
|
|
125
|
+
name: node.key.name,
|
|
126
|
+
typeAnnotation: node.typeAnnotation.typeAnnotation,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Property definition in type literal: { address: string }
|
|
131
|
+
if (
|
|
132
|
+
node.type === 'PropertyDefinition' &&
|
|
133
|
+
node.key?.type === 'Identifier' &&
|
|
134
|
+
node.typeAnnotation?.typeAnnotation
|
|
135
|
+
) {
|
|
136
|
+
return {
|
|
137
|
+
name: node.key.name,
|
|
138
|
+
typeAnnotation: node.typeAnnotation.typeAnnotation,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Create a rule that enforces specific types for identifiers matching a pattern
|
|
147
|
+
* @param {Object} options
|
|
148
|
+
* @param {RegExp} options.pattern - Pattern to match identifier names
|
|
149
|
+
* @param {string[]} options.allowedTypes - Allowed type names
|
|
150
|
+
* @param {string} options.forbiddenType - The primitive type to forbid (e.g., 'string')
|
|
151
|
+
* @param {(typeText: string) => boolean} options.isForbiddenType - Function to check if type is forbidden
|
|
152
|
+
* @param {string} options.expectedType - Human-readable expected type for error message
|
|
153
|
+
* @param {string} options.description - Rule description
|
|
154
|
+
* @param {string} [options.fixToType] - Type to auto-fix to (if not set, no auto-fix)
|
|
155
|
+
* @param {boolean} [options.fixRequiresImport] - Whether the fix requires adding an import
|
|
156
|
+
* @param {string} [options.fixImportSource] - Module to import from (if fixRequiresImport)
|
|
157
|
+
* @returns {import('eslint').Rule.RuleModule}
|
|
158
|
+
*/
|
|
159
|
+
function createTypeEnforcementRule({
|
|
160
|
+
pattern,
|
|
161
|
+
allowedTypes,
|
|
162
|
+
forbiddenType,
|
|
163
|
+
isForbiddenType,
|
|
164
|
+
expectedType,
|
|
165
|
+
description,
|
|
166
|
+
fixToType,
|
|
167
|
+
fixRequiresImport = false,
|
|
168
|
+
fixImportSource = '@0xsequence/api-client',
|
|
169
|
+
}) {
|
|
170
|
+
return {
|
|
171
|
+
meta: {
|
|
172
|
+
type: 'problem',
|
|
173
|
+
docs: {
|
|
174
|
+
description,
|
|
175
|
+
recommended: true,
|
|
176
|
+
},
|
|
177
|
+
fixable: fixToType ? 'code' : undefined,
|
|
178
|
+
messages: {
|
|
179
|
+
wrongType: `'{{name}}' should use '{{expectedType}}' instead of '{{actualType}}'. Import from @0xsequence/api-client.`,
|
|
180
|
+
},
|
|
181
|
+
schema: [],
|
|
182
|
+
},
|
|
183
|
+
create(context) {
|
|
184
|
+
function checkNode(node) {
|
|
185
|
+
const typed = getTypedIdentifier(node);
|
|
186
|
+
if (!typed) return;
|
|
187
|
+
|
|
188
|
+
const { name, typeAnnotation } = typed;
|
|
189
|
+
|
|
190
|
+
if (!pattern.test(name)) return;
|
|
191
|
+
|
|
192
|
+
const typeText = getTypeText(context, typeAnnotation);
|
|
193
|
+
|
|
194
|
+
if (!typeText) return;
|
|
195
|
+
|
|
196
|
+
if (isAllowedType(typeText, allowedTypes)) return;
|
|
197
|
+
|
|
198
|
+
if (isForbiddenType(typeText)) {
|
|
199
|
+
const reportOptions = {
|
|
200
|
+
node: typeAnnotation,
|
|
201
|
+
messageId: 'wrongType',
|
|
202
|
+
data: {
|
|
203
|
+
name,
|
|
204
|
+
expectedType,
|
|
205
|
+
actualType: forbiddenType,
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
if (fixToType) {
|
|
210
|
+
reportOptions.fix = (fixer) => {
|
|
211
|
+
const fixes = [];
|
|
212
|
+
const newTypeText = replaceStringType(typeText, fixToType);
|
|
213
|
+
fixes.push(fixer.replaceText(typeAnnotation, newTypeText));
|
|
214
|
+
|
|
215
|
+
if (fixRequiresImport) {
|
|
216
|
+
const importFix = addImportIfMissing(
|
|
217
|
+
context,
|
|
218
|
+
fixer,
|
|
219
|
+
fixToType,
|
|
220
|
+
fixImportSource,
|
|
221
|
+
);
|
|
222
|
+
if (importFix) fixes.push(importFix);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return fixes;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
context.report(reportOptions);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return {
|
|
234
|
+
'FunctionDeclaration > Identifier[typeAnnotation]': checkNode,
|
|
235
|
+
'FunctionExpression > Identifier[typeAnnotation]': checkNode,
|
|
236
|
+
'ArrowFunctionExpression > Identifier[typeAnnotation]': checkNode,
|
|
237
|
+
'TSMethodSignature > Identifier[typeAnnotation]': checkNode,
|
|
238
|
+
VariableDeclarator: checkNode,
|
|
239
|
+
TSPropertySignature: checkNode,
|
|
240
|
+
PropertyDefinition: checkNode,
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Add an import statement if the type is not already imported
|
|
248
|
+
* @param {import('eslint').Rule.RuleContext} context
|
|
249
|
+
* @param {import('eslint').Rule.RuleFixer} fixer
|
|
250
|
+
* @param {string} typeName - The type to import
|
|
251
|
+
* @param {string} source - The module to import from
|
|
252
|
+
* @returns {import('eslint').Rule.Fix | null}
|
|
253
|
+
*/
|
|
254
|
+
function addImportIfMissing(context, fixer, typeName, source) {
|
|
255
|
+
const sourceCode = context.sourceCode;
|
|
256
|
+
const ast = sourceCode.ast;
|
|
257
|
+
|
|
258
|
+
for (const node of ast.body) {
|
|
259
|
+
if (node.type !== 'ImportDeclaration') continue;
|
|
260
|
+
if (node.source.value !== source) continue;
|
|
261
|
+
|
|
262
|
+
const hasType = node.specifiers.some(
|
|
263
|
+
(spec) =>
|
|
264
|
+
spec.type === 'ImportSpecifier' && spec.imported.name === typeName,
|
|
265
|
+
);
|
|
266
|
+
if (hasType) return null;
|
|
267
|
+
|
|
268
|
+
const lastSpecifier = node.specifiers[node.specifiers.length - 1];
|
|
269
|
+
if (lastSpecifier && lastSpecifier.type === 'ImportSpecifier') {
|
|
270
|
+
return fixer.insertTextAfter(lastSpecifier, `, ${typeName}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const firstImport = ast.body.find((n) => n.type === 'ImportDeclaration');
|
|
275
|
+
const importStatement = `import { ${typeName} } from '${source}';\n`;
|
|
276
|
+
|
|
277
|
+
if (firstImport) {
|
|
278
|
+
return fixer.insertTextBefore(firstImport, importStatement);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return fixer.insertTextBeforeRange([0, 0], importStatement);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// ============================================================
|
|
285
|
+
// RULES
|
|
286
|
+
// ============================================================
|
|
287
|
+
|
|
288
|
+
const enforceAddressType = createTypeEnforcementRule({
|
|
289
|
+
pattern:
|
|
290
|
+
/^(.*[aA]ddress|owner|recipient|sender|operator|spender|account|wallet)$/,
|
|
291
|
+
allowedTypes: ['Address', '`0x${string}`', 'Hex'],
|
|
292
|
+
forbiddenType: 'string',
|
|
293
|
+
isForbiddenType: isStringType,
|
|
294
|
+
expectedType: 'Address',
|
|
295
|
+
description: 'Enforce Address type for address-like parameters and variables',
|
|
296
|
+
fixToType: 'Address',
|
|
297
|
+
fixRequiresImport: true,
|
|
298
|
+
fixImportSource: '@0xsequence/api-client',
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
const enforceTokenIdType = createTypeEnforcementRule({
|
|
302
|
+
pattern: /^token[Ii][Dd]$/,
|
|
303
|
+
allowedTypes: ['bigint', 'TokenId'],
|
|
304
|
+
forbiddenType: 'string',
|
|
305
|
+
isForbiddenType: isStringType,
|
|
306
|
+
expectedType: 'bigint | TokenId',
|
|
307
|
+
description: 'Enforce bigint/TokenId type for token ID parameters',
|
|
308
|
+
fixToType: 'bigint',
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
const enforceAmountType = createTypeEnforcementRule({
|
|
312
|
+
pattern:
|
|
313
|
+
/^(amount|balance|price|quantity|total|subtotal|fee|cost|pricePerToken|currencyValue|tokenValue|weiValue|rawValue)$/i,
|
|
314
|
+
allowedTypes: ['bigint', 'Amount', 'number'],
|
|
315
|
+
forbiddenType: 'string',
|
|
316
|
+
isForbiddenType: isStringType,
|
|
317
|
+
expectedType: 'bigint | Amount',
|
|
318
|
+
description: 'Enforce bigint/Amount type for amount-like parameters',
|
|
319
|
+
fixToType: 'bigint',
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
const enforceChainIdType = createTypeEnforcementRule({
|
|
323
|
+
pattern: /^chain[Ii][Dd]$/,
|
|
324
|
+
allowedTypes: ['number', 'ChainId'],
|
|
325
|
+
forbiddenType: 'string',
|
|
326
|
+
isForbiddenType: isStringType,
|
|
327
|
+
expectedType: 'number | ChainId',
|
|
328
|
+
description: 'Enforce number/ChainId type for chain ID parameters',
|
|
329
|
+
fixToType: 'number',
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Rule: no-string-bigint-fields
|
|
334
|
+
*
|
|
335
|
+
* Detects when common blockchain fields that should be bigint are typed as string.
|
|
336
|
+
* This is a broader check that catches fields not covered by specific rules.
|
|
337
|
+
*/
|
|
338
|
+
const noStringBigintFields = {
|
|
339
|
+
meta: {
|
|
340
|
+
type: 'suggestion',
|
|
341
|
+
docs: {
|
|
342
|
+
description:
|
|
343
|
+
'Suggest using bigint for fields that typically represent large numbers',
|
|
344
|
+
recommended: false,
|
|
345
|
+
},
|
|
346
|
+
messages: {
|
|
347
|
+
suggestBigint: `'{{name}}' might need to be 'bigint' instead of 'string'. Large numeric blockchain values should use bigint for precision.`,
|
|
348
|
+
},
|
|
349
|
+
schema: [],
|
|
350
|
+
},
|
|
351
|
+
create(context) {
|
|
352
|
+
// Fields that commonly represent large numbers in blockchain contexts
|
|
353
|
+
const bigintFieldPatterns = [
|
|
354
|
+
/^(token[Ii][Dd]|tokenID)$/,
|
|
355
|
+
/^(block[Nn]umber|blockNum)$/,
|
|
356
|
+
/^(nonce)$/,
|
|
357
|
+
/^(gas|gasLimit|gasPrice|gasUsed|maxFeePerGas|maxPriorityFeePerGas)$/,
|
|
358
|
+
/^(wei|gwei|ether)$/i,
|
|
359
|
+
/^.*[Aa]mount$/,
|
|
360
|
+
/^.*[Bb]alance$/,
|
|
361
|
+
/^.*[Ss]upply$/,
|
|
362
|
+
/^.*[Qq]uantity$/,
|
|
363
|
+
];
|
|
364
|
+
|
|
365
|
+
function checkNode(node) {
|
|
366
|
+
const typed = getTypedIdentifier(node);
|
|
367
|
+
if (!typed) return;
|
|
368
|
+
|
|
369
|
+
const { name, typeAnnotation } = typed;
|
|
370
|
+
const typeText = getTypeText(context, typeAnnotation);
|
|
371
|
+
|
|
372
|
+
if (!typeText) return;
|
|
373
|
+
if (!isStringType(typeText)) return;
|
|
374
|
+
|
|
375
|
+
// Check if field matches any bigint pattern
|
|
376
|
+
const matchesPattern = bigintFieldPatterns.some((pattern) =>
|
|
377
|
+
pattern.test(name),
|
|
378
|
+
);
|
|
379
|
+
if (!matchesPattern) return;
|
|
380
|
+
|
|
381
|
+
// Skip if already handled by more specific rules
|
|
382
|
+
if (/^token[Ii][Dd]$/.test(name)) return; // handled by enforce-token-id-type
|
|
383
|
+
if (/^chain[Ii][Dd]$/.test(name)) return; // handled by enforce-chain-id-type
|
|
384
|
+
if (
|
|
385
|
+
/^(amount|balance|price|value|quantity|total|subtotal|fee|cost)$/i.test(
|
|
386
|
+
name,
|
|
387
|
+
)
|
|
388
|
+
)
|
|
389
|
+
return;
|
|
390
|
+
|
|
391
|
+
context.report({
|
|
392
|
+
node: typeAnnotation,
|
|
393
|
+
messageId: 'suggestBigint',
|
|
394
|
+
data: { name },
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return {
|
|
399
|
+
VariableDeclarator: checkNode,
|
|
400
|
+
TSPropertySignature: checkNode,
|
|
401
|
+
PropertyDefinition: checkNode,
|
|
402
|
+
};
|
|
403
|
+
},
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
const noManualQueryParams = {
|
|
407
|
+
meta: {
|
|
408
|
+
type: 'suggestion',
|
|
409
|
+
docs: {
|
|
410
|
+
description:
|
|
411
|
+
'Discourage manual interface/type definitions for query params. Use API request types from @0xsequence/api-client instead.',
|
|
412
|
+
recommended: true,
|
|
413
|
+
},
|
|
414
|
+
messages: {
|
|
415
|
+
noManualParams: `Avoid defining '{{name}}' manually. Derive from API request types (e.g., Pick<GetTokenMetadataArgs, ...>) or use them directly.`,
|
|
416
|
+
},
|
|
417
|
+
schema: [],
|
|
418
|
+
},
|
|
419
|
+
create(context) {
|
|
420
|
+
const filename = context.filename || context.getFilename();
|
|
421
|
+
const isQueryFile = /\/queries\//.test(filename);
|
|
422
|
+
if (!isQueryFile) return {};
|
|
423
|
+
|
|
424
|
+
const apiTypePatterns = [
|
|
425
|
+
/Request\b/,
|
|
426
|
+
/Response\b/,
|
|
427
|
+
/Args\b/,
|
|
428
|
+
/Input\b/,
|
|
429
|
+
/Return\b/,
|
|
430
|
+
/\bGet\w+/,
|
|
431
|
+
/\bList\w+/,
|
|
432
|
+
/\bCreate\w+/,
|
|
433
|
+
/\bUpdate\w+/,
|
|
434
|
+
/\bDelete\w+/,
|
|
435
|
+
];
|
|
436
|
+
|
|
437
|
+
const sdkSpecificFields = new Set([
|
|
438
|
+
'marketplaceConfig',
|
|
439
|
+
'includeNonTradable',
|
|
440
|
+
'compareToPriceAmountRaw',
|
|
441
|
+
'compareToPriceCurrencyAddress',
|
|
442
|
+
'priceAmountRaw',
|
|
443
|
+
'priceCurrencyAddress',
|
|
444
|
+
'amountRaw',
|
|
445
|
+
]);
|
|
446
|
+
|
|
447
|
+
function getFieldNames(node) {
|
|
448
|
+
const fields = [];
|
|
449
|
+
if (node.type === 'TSTypeLiteral') {
|
|
450
|
+
for (const member of node.members || []) {
|
|
451
|
+
if (member.type === 'TSPropertySignature' && member.key?.name) {
|
|
452
|
+
fields.push(member.key.name);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return fields;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function containsSdkSpecificFields(typeAnnotation) {
|
|
460
|
+
const fields = getFieldNames(typeAnnotation);
|
|
461
|
+
return fields.some((f) => sdkSpecificFields.has(f));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function extendsApiType(node) {
|
|
465
|
+
if (!node.extends || node.extends.length === 0) return false;
|
|
466
|
+
|
|
467
|
+
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
468
|
+
const nodeText = sourceCode.getText(node);
|
|
469
|
+
const extendsMatch = nodeText.match(/extends\s+(.+?)\s*\{/s);
|
|
470
|
+
if (!extendsMatch) return false;
|
|
471
|
+
|
|
472
|
+
const extendsClause = extendsMatch[1];
|
|
473
|
+
return apiTypePatterns.some((p) => p.test(extendsClause));
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function derivesFromApiType(typeAnnotation) {
|
|
477
|
+
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
478
|
+
const typeText = sourceCode.getText(typeAnnotation);
|
|
479
|
+
|
|
480
|
+
if (/^(Pick|Omit|Extract|Exclude|Partial|Required)</.test(typeText)) {
|
|
481
|
+
return apiTypePatterns.some((p) => p.test(typeText));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
if (typeAnnotation.type === 'TSIntersectionType') {
|
|
485
|
+
return typeAnnotation.types.some((t) => {
|
|
486
|
+
const tText = sourceCode.getText(t);
|
|
487
|
+
return apiTypePatterns.some((p) => p.test(tText));
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
return false;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
function getInterfaceFields(node) {
|
|
495
|
+
const fields = [];
|
|
496
|
+
if (node.body?.body) {
|
|
497
|
+
for (const member of node.body.body) {
|
|
498
|
+
if (member.type === 'TSPropertySignature' && member.key?.name) {
|
|
499
|
+
fields.push(member.key.name);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
return fields;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return {
|
|
507
|
+
TSInterfaceDeclaration(node) {
|
|
508
|
+
const name = node.id?.name || '';
|
|
509
|
+
if (!/^Fetch\w+Params$/.test(name)) return;
|
|
510
|
+
|
|
511
|
+
if (extendsApiType(node)) return;
|
|
512
|
+
|
|
513
|
+
const fields = getInterfaceFields(node);
|
|
514
|
+
if (fields.some((f) => sdkSpecificFields.has(f))) return;
|
|
515
|
+
|
|
516
|
+
context.report({
|
|
517
|
+
node: node.id,
|
|
518
|
+
messageId: 'noManualParams',
|
|
519
|
+
data: { name },
|
|
520
|
+
});
|
|
521
|
+
},
|
|
522
|
+
TSTypeAliasDeclaration(node) {
|
|
523
|
+
const name = node.id?.name || '';
|
|
524
|
+
if (!/^Fetch\w+Params$/.test(name)) return;
|
|
525
|
+
|
|
526
|
+
const typeAnnotation = node.typeAnnotation;
|
|
527
|
+
if (!typeAnnotation) return;
|
|
528
|
+
|
|
529
|
+
if (derivesFromApiType(typeAnnotation)) return;
|
|
530
|
+
|
|
531
|
+
if (containsSdkSpecificFields(typeAnnotation)) return;
|
|
532
|
+
|
|
533
|
+
const isObjectLiteral = typeAnnotation.type === 'TSTypeLiteral';
|
|
534
|
+
if (isObjectLiteral) {
|
|
535
|
+
context.report({
|
|
536
|
+
node: node.id,
|
|
537
|
+
messageId: 'noManualParams',
|
|
538
|
+
data: { name },
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
};
|
|
543
|
+
},
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
const noNamespaceTypeImports = {
|
|
547
|
+
meta: {
|
|
548
|
+
type: 'suggestion',
|
|
549
|
+
docs: {
|
|
550
|
+
description:
|
|
551
|
+
'Prefer direct type imports over namespace imports (Indexer.*, Marketplace.*) for normalized types.',
|
|
552
|
+
recommended: true,
|
|
553
|
+
},
|
|
554
|
+
messages: {
|
|
555
|
+
noNamespaceImport: `Use direct import for '{{type}}' instead of '{{namespace}}.{{type}}'. Import from @0xsequence/api-client.`,
|
|
556
|
+
},
|
|
557
|
+
schema: [],
|
|
558
|
+
},
|
|
559
|
+
create(context) {
|
|
560
|
+
const normalizedTypes = new Set([
|
|
561
|
+
'GetTokenBalancesRequest',
|
|
562
|
+
'GetTokenBalancesResponse',
|
|
563
|
+
'GetTokenSuppliesRequest',
|
|
564
|
+
'GetTokenSuppliesResponse',
|
|
565
|
+
'GetTokenIDRangesRequest',
|
|
566
|
+
'GetTokenIDRangesResponse',
|
|
567
|
+
'Page',
|
|
568
|
+
]);
|
|
569
|
+
|
|
570
|
+
return {
|
|
571
|
+
TSQualifiedName(node) {
|
|
572
|
+
if (node.left?.type !== 'Identifier') return;
|
|
573
|
+
|
|
574
|
+
const namespace = node.left.name;
|
|
575
|
+
const typeName = node.right?.name;
|
|
576
|
+
|
|
577
|
+
if (!['Indexer', 'Marketplace', 'Metadata'].includes(namespace)) return;
|
|
578
|
+
if (!normalizedTypes.has(typeName)) return;
|
|
579
|
+
|
|
580
|
+
context.report({
|
|
581
|
+
node,
|
|
582
|
+
messageId: 'noNamespaceImport',
|
|
583
|
+
data: { namespace, type: typeName },
|
|
584
|
+
});
|
|
585
|
+
},
|
|
586
|
+
};
|
|
587
|
+
},
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
const noDomainFieldDefinition = {
|
|
591
|
+
meta: {
|
|
592
|
+
type: 'problem',
|
|
593
|
+
docs: {
|
|
594
|
+
description:
|
|
595
|
+
'Prevent manual definition of domain fields in SDK types. These should come from @0xsequence/api-client.',
|
|
596
|
+
recommended: true,
|
|
597
|
+
},
|
|
598
|
+
messages: {
|
|
599
|
+
noDomainField: `Don't define '{{field}}' manually in SDK. Import the type from @0xsequence/api-client and use Pick/Omit/Extend.`,
|
|
600
|
+
},
|
|
601
|
+
schema: [],
|
|
602
|
+
},
|
|
603
|
+
create(context) {
|
|
604
|
+
const filename = context.filename || context.getFilename();
|
|
605
|
+
const isQueryFile = /\/queries\//.test(filename);
|
|
606
|
+
if (!isQueryFile) return {};
|
|
607
|
+
|
|
608
|
+
const domainFields = new Set([
|
|
609
|
+
'chainId',
|
|
610
|
+
'collectionAddress',
|
|
611
|
+
'contractAddress',
|
|
612
|
+
'tokenId',
|
|
613
|
+
'accountAddress',
|
|
614
|
+
'userAddress',
|
|
615
|
+
'walletAddress',
|
|
616
|
+
'ownerAddress',
|
|
617
|
+
'balance',
|
|
618
|
+
'amount',
|
|
619
|
+
'quantity',
|
|
620
|
+
'price',
|
|
621
|
+
'pricePerToken',
|
|
622
|
+
'currencyAddress',
|
|
623
|
+
'orderId',
|
|
624
|
+
'listingId',
|
|
625
|
+
'offerId',
|
|
626
|
+
'side',
|
|
627
|
+
'filter',
|
|
628
|
+
'page',
|
|
629
|
+
'pageSize',
|
|
630
|
+
'includeMetadata',
|
|
631
|
+
'metadataOptions',
|
|
632
|
+
'primarySaleContractAddress',
|
|
633
|
+
]);
|
|
634
|
+
|
|
635
|
+
const sdkAllowedFields = new Set(['config', 'query', 'enabled']);
|
|
636
|
+
|
|
637
|
+
return {
|
|
638
|
+
TSPropertySignature(node) {
|
|
639
|
+
const parent = node.parent;
|
|
640
|
+
if (parent?.type !== 'TSTypeLiteral') return;
|
|
641
|
+
|
|
642
|
+
const grandparent = parent.parent;
|
|
643
|
+
if (grandparent?.type !== 'TSTypeAliasDeclaration') return;
|
|
644
|
+
|
|
645
|
+
const typeName = grandparent.id?.name || '';
|
|
646
|
+
if (!/^(Fetch\w+Params|\w+QueryOptions)$/.test(typeName)) return;
|
|
647
|
+
|
|
648
|
+
const fieldName = node.key?.name;
|
|
649
|
+
if (!fieldName) return;
|
|
650
|
+
|
|
651
|
+
if (sdkAllowedFields.has(fieldName)) return;
|
|
652
|
+
|
|
653
|
+
if (domainFields.has(fieldName)) {
|
|
654
|
+
context.report({
|
|
655
|
+
node: node.key,
|
|
656
|
+
messageId: 'noDomainField',
|
|
657
|
+
data: { field: fieldName },
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
|
|
662
|
+
TSInterfaceBody(node) {
|
|
663
|
+
const parent = node.parent;
|
|
664
|
+
if (parent?.type !== 'TSInterfaceDeclaration') return;
|
|
665
|
+
|
|
666
|
+
const typeName = parent.id?.name || '';
|
|
667
|
+
if (!/^(Fetch\w+Params|\w+QueryOptions)$/.test(typeName)) return;
|
|
668
|
+
|
|
669
|
+
if (parent.extends && parent.extends.length > 0) return;
|
|
670
|
+
|
|
671
|
+
for (const member of node.body) {
|
|
672
|
+
if (member.type !== 'TSPropertySignature') continue;
|
|
673
|
+
|
|
674
|
+
const fieldName = member.key?.name;
|
|
675
|
+
if (!fieldName) continue;
|
|
676
|
+
|
|
677
|
+
if (sdkAllowedFields.has(fieldName)) continue;
|
|
678
|
+
|
|
679
|
+
if (domainFields.has(fieldName)) {
|
|
680
|
+
context.report({
|
|
681
|
+
node: member.key,
|
|
682
|
+
messageId: 'noDomainField',
|
|
683
|
+
data: { field: fieldName },
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
};
|
|
689
|
+
},
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
const requireApiTypeSource = {
|
|
693
|
+
meta: {
|
|
694
|
+
type: 'suggestion',
|
|
695
|
+
docs: {
|
|
696
|
+
description:
|
|
697
|
+
'Require SDK query types to derive from @0xsequence/api-client types.',
|
|
698
|
+
recommended: true,
|
|
699
|
+
},
|
|
700
|
+
messages: {
|
|
701
|
+
requireApiType: `'{{name}}' should derive from a type in @0xsequence/api-client. Use: type {{name}} = ApiType & { config: SdkConfig }`,
|
|
702
|
+
missingApiImport: `Query file defines '{{name}}' but has no type imports from @0xsequence/api-client. Import request types from the API client.`,
|
|
703
|
+
},
|
|
704
|
+
schema: [],
|
|
705
|
+
},
|
|
706
|
+
create(context) {
|
|
707
|
+
const filename = context.filename || context.getFilename();
|
|
708
|
+
const isQueryFile = /\/queries\//.test(filename);
|
|
709
|
+
if (!isQueryFile) return {};
|
|
710
|
+
|
|
711
|
+
let hasApiClientImport = false;
|
|
712
|
+
const definedFetchTypes = [];
|
|
713
|
+
|
|
714
|
+
return {
|
|
715
|
+
ImportDeclaration(node) {
|
|
716
|
+
if (node.source.value === '@0xsequence/api-client') {
|
|
717
|
+
const hasTypeImport = node.specifiers.some(
|
|
718
|
+
(spec) =>
|
|
719
|
+
spec.type === 'ImportSpecifier' &&
|
|
720
|
+
/^(Get|List|Create|Update|Delete|Check)/.test(
|
|
721
|
+
spec.imported?.name || '',
|
|
722
|
+
),
|
|
723
|
+
);
|
|
724
|
+
if (hasTypeImport) {
|
|
725
|
+
hasApiClientImport = true;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
|
|
730
|
+
TSTypeAliasDeclaration(node) {
|
|
731
|
+
const name = node.id?.name || '';
|
|
732
|
+
if (!/^Fetch\w+Params$/.test(name)) return;
|
|
733
|
+
|
|
734
|
+
const typeAnnotation = node.typeAnnotation;
|
|
735
|
+
if (!typeAnnotation) return;
|
|
736
|
+
|
|
737
|
+
if (typeAnnotation.type === 'TSTypeLiteral') {
|
|
738
|
+
definedFetchTypes.push({ node, name });
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
|
|
742
|
+
TSInterfaceDeclaration(node) {
|
|
743
|
+
const name = node.id?.name || '';
|
|
744
|
+
if (!/^Fetch\w+Params$/.test(name)) return;
|
|
745
|
+
|
|
746
|
+
if (!node.extends || node.extends.length === 0) {
|
|
747
|
+
definedFetchTypes.push({ node, name });
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
|
|
751
|
+
'Program:exit'() {
|
|
752
|
+
if (definedFetchTypes.length > 0 && !hasApiClientImport) {
|
|
753
|
+
for (const { node, name } of definedFetchTypes) {
|
|
754
|
+
context.report({
|
|
755
|
+
node: node.id || node,
|
|
756
|
+
messageId: 'missingApiImport',
|
|
757
|
+
data: { name },
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
};
|
|
763
|
+
},
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
const noPickForRequestTypes = {
|
|
767
|
+
meta: {
|
|
768
|
+
type: 'problem',
|
|
769
|
+
docs: {
|
|
770
|
+
description:
|
|
771
|
+
'Ban Pick<> for request/input types. Use Omit<> instead for future-safety.',
|
|
772
|
+
recommended: true,
|
|
773
|
+
},
|
|
774
|
+
messages: {
|
|
775
|
+
noPickForRequest: `Don't use 'Pick<>' for '{{typeName}}'. Pick is not future-safe for request types - if the API adds required fields, they won't be included. Use 'Omit<>' instead to exclude unwanted fields while automatically including new ones.`,
|
|
776
|
+
},
|
|
777
|
+
schema: [],
|
|
778
|
+
},
|
|
779
|
+
create(context) {
|
|
780
|
+
const requestTypePattern =
|
|
781
|
+
/^(Fetch\w+Params|\w+Params|\w+Request|\w+Args|\w+Input)$/;
|
|
782
|
+
const responseTypePattern = /^(\w+Response|\w+Result|\w+Output|\w+Return)$/;
|
|
783
|
+
const utilityTypePattern = /^(With\w+|Optional\w+|Required\w+|Partial\w+)$/;
|
|
784
|
+
|
|
785
|
+
return {
|
|
786
|
+
TSTypeAliasDeclaration(node) {
|
|
787
|
+
const typeName = node.id?.name || '';
|
|
788
|
+
|
|
789
|
+
if (responseTypePattern.test(typeName)) return;
|
|
790
|
+
if (utilityTypePattern.test(typeName)) return;
|
|
791
|
+
if (!requestTypePattern.test(typeName)) return;
|
|
792
|
+
|
|
793
|
+
const typeAnnotation = node.typeAnnotation;
|
|
794
|
+
if (!typeAnnotation) return;
|
|
795
|
+
|
|
796
|
+
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
797
|
+
const typeText = sourceCode.getText(typeAnnotation);
|
|
798
|
+
|
|
799
|
+
if (/^Pick\s*</.test(typeText)) {
|
|
800
|
+
context.report({
|
|
801
|
+
node: typeAnnotation,
|
|
802
|
+
messageId: 'noPickForRequest',
|
|
803
|
+
data: { typeName },
|
|
804
|
+
});
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
if (typeAnnotation.type === 'TSIntersectionType') {
|
|
809
|
+
for (const typeNode of typeAnnotation.types) {
|
|
810
|
+
const partText = sourceCode.getText(typeNode);
|
|
811
|
+
if (/^Pick\s*</.test(partText)) {
|
|
812
|
+
context.report({
|
|
813
|
+
node: typeNode,
|
|
814
|
+
messageId: 'noPickForRequest',
|
|
815
|
+
data: { typeName },
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
};
|
|
822
|
+
},
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
const noPartialApiTypes = {
|
|
826
|
+
meta: {
|
|
827
|
+
type: 'problem',
|
|
828
|
+
docs: {
|
|
829
|
+
description:
|
|
830
|
+
'Ban blanket Partial<APIType> in query files. Use API types directly or Omit<> for explicit field removal.',
|
|
831
|
+
recommended: true,
|
|
832
|
+
},
|
|
833
|
+
messages: {
|
|
834
|
+
noPartialApi: `Don't wrap '{{innerType}}' in Partial<>. This destroys type information about required vs optional fields. Use the API type directly (SdkQueryParams handles optionality) or use Omit<> to explicitly remove context-provided fields.`,
|
|
835
|
+
},
|
|
836
|
+
schema: [],
|
|
837
|
+
},
|
|
838
|
+
create(context) {
|
|
839
|
+
const filename = context.filename || context.getFilename();
|
|
840
|
+
const isQueryFile = /\/queries\//.test(filename);
|
|
841
|
+
if (!isQueryFile) return {};
|
|
842
|
+
|
|
843
|
+
const apiTypePatterns = [
|
|
844
|
+
/Request$/,
|
|
845
|
+
/Args$/,
|
|
846
|
+
/Input$/,
|
|
847
|
+
/^Get\w+/,
|
|
848
|
+
/^List\w+/,
|
|
849
|
+
/^Create\w+/,
|
|
850
|
+
/^Update\w+/,
|
|
851
|
+
/^Delete\w+/,
|
|
852
|
+
/^Check\w+/,
|
|
853
|
+
];
|
|
854
|
+
|
|
855
|
+
function isApiType(typeName) {
|
|
856
|
+
return apiTypePatterns.some((p) => p.test(typeName));
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
function checkPartialUsage(_node, typeAnnotation) {
|
|
860
|
+
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
861
|
+
const typeText = sourceCode.getText(typeAnnotation);
|
|
862
|
+
|
|
863
|
+
const partialMatch = typeText.match(/^Partial\s*<\s*([^<>]+)\s*>$/);
|
|
864
|
+
if (!partialMatch) return;
|
|
865
|
+
|
|
866
|
+
const innerType = partialMatch[1].trim();
|
|
867
|
+
|
|
868
|
+
if (innerType.startsWith('Pick<')) return;
|
|
869
|
+
|
|
870
|
+
if (isApiType(innerType)) {
|
|
871
|
+
context.report({
|
|
872
|
+
node: typeAnnotation,
|
|
873
|
+
messageId: 'noPartialApi',
|
|
874
|
+
data: { innerType },
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
return {
|
|
880
|
+
TSTypeAliasDeclaration(node) {
|
|
881
|
+
const typeName = node.id?.name || '';
|
|
882
|
+
if (!/^Fetch\w+Params$/.test(typeName)) return;
|
|
883
|
+
|
|
884
|
+
const typeAnnotation = node.typeAnnotation;
|
|
885
|
+
if (!typeAnnotation) return;
|
|
886
|
+
|
|
887
|
+
if (typeAnnotation.type === 'TSTypeReference') {
|
|
888
|
+
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
889
|
+
const typeText = sourceCode.getText(typeAnnotation);
|
|
890
|
+
if (typeText.startsWith('Partial<')) {
|
|
891
|
+
checkPartialUsage(node, typeAnnotation);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
if (typeAnnotation.type === 'TSIntersectionType') {
|
|
896
|
+
for (const typeNode of typeAnnotation.types) {
|
|
897
|
+
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
898
|
+
const partText = sourceCode.getText(typeNode);
|
|
899
|
+
if (partText.startsWith('Partial<')) {
|
|
900
|
+
checkPartialUsage(node, typeNode);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
};
|
|
906
|
+
},
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
const sdkTypesMustExtend = {
|
|
910
|
+
meta: {
|
|
911
|
+
type: 'problem',
|
|
912
|
+
docs: {
|
|
913
|
+
description:
|
|
914
|
+
'SDK Fetch*Params types must extend or derive from API client types, not define fields manually.',
|
|
915
|
+
recommended: true,
|
|
916
|
+
},
|
|
917
|
+
messages: {
|
|
918
|
+
mustExtend: `'{{name}}' must derive from @0xsequence/api-client types. Pattern: type {{name}} = SomeApiRequest & { config: SdkConfig }`,
|
|
919
|
+
},
|
|
920
|
+
schema: [],
|
|
921
|
+
},
|
|
922
|
+
create(context) {
|
|
923
|
+
const filename = context.filename || context.getFilename();
|
|
924
|
+
const isQueryFile = /\/queries\//.test(filename);
|
|
925
|
+
if (!isQueryFile) return {};
|
|
926
|
+
|
|
927
|
+
const apiTypePatterns = [
|
|
928
|
+
/Request\b/,
|
|
929
|
+
/Response\b/,
|
|
930
|
+
/Args\b/,
|
|
931
|
+
/Input\b/,
|
|
932
|
+
/Return\b/,
|
|
933
|
+
];
|
|
934
|
+
|
|
935
|
+
function isApiDerived(typeAnnotation) {
|
|
936
|
+
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
937
|
+
const typeText = sourceCode.getText(typeAnnotation);
|
|
938
|
+
|
|
939
|
+
return apiTypePatterns.some((p) => p.test(typeText));
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
return {
|
|
943
|
+
TSTypeAliasDeclaration(node) {
|
|
944
|
+
const name = node.id?.name || '';
|
|
945
|
+
if (!/^Fetch\w+Params$/.test(name)) return;
|
|
946
|
+
|
|
947
|
+
const typeAnnotation = node.typeAnnotation;
|
|
948
|
+
if (!typeAnnotation) return;
|
|
949
|
+
|
|
950
|
+
if (typeAnnotation.type === 'TSTypeLiteral') {
|
|
951
|
+
context.report({
|
|
952
|
+
node: node.id,
|
|
953
|
+
messageId: 'mustExtend',
|
|
954
|
+
data: { name },
|
|
955
|
+
});
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
if (!isApiDerived(typeAnnotation)) {
|
|
960
|
+
context.report({
|
|
961
|
+
node: node.id,
|
|
962
|
+
messageId: 'mustExtend',
|
|
963
|
+
data: { name },
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
},
|
|
967
|
+
|
|
968
|
+
TSInterfaceDeclaration(node) {
|
|
969
|
+
const name = node.id?.name || '';
|
|
970
|
+
if (!/^Fetch\w+Params$/.test(name)) return;
|
|
971
|
+
|
|
972
|
+
if (!node.extends || node.extends.length === 0) {
|
|
973
|
+
context.report({
|
|
974
|
+
node: node.id,
|
|
975
|
+
messageId: 'mustExtend',
|
|
976
|
+
data: { name },
|
|
977
|
+
});
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
const sourceCode = context.sourceCode || context.getSourceCode();
|
|
982
|
+
const nodeText = sourceCode.getText(node);
|
|
983
|
+
const extendsMatch = nodeText.match(/extends\s+(.+?)\s*\{/s);
|
|
984
|
+
|
|
985
|
+
if (!extendsMatch) {
|
|
986
|
+
context.report({
|
|
987
|
+
node: node.id,
|
|
988
|
+
messageId: 'mustExtend',
|
|
989
|
+
data: { name },
|
|
990
|
+
});
|
|
991
|
+
return;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
const extendsClause = extendsMatch[1];
|
|
995
|
+
if (!apiTypePatterns.some((p) => p.test(extendsClause))) {
|
|
996
|
+
context.report({
|
|
997
|
+
node: node.id,
|
|
998
|
+
messageId: 'mustExtend',
|
|
999
|
+
data: { name },
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
};
|
|
1004
|
+
},
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
// ============================================================
|
|
1008
|
+
// PLUGIN EXPORT
|
|
1009
|
+
// ============================================================
|
|
1010
|
+
|
|
1011
|
+
/** @type {import('eslint').ESLint.Plugin} */
|
|
1012
|
+
const plugin = {
|
|
1013
|
+
meta: {
|
|
1014
|
+
name: '@sequence/eslint-plugin-types',
|
|
1015
|
+
version: '1.0.0',
|
|
1016
|
+
},
|
|
1017
|
+
rules: {
|
|
1018
|
+
'enforce-address-type': enforceAddressType,
|
|
1019
|
+
'enforce-token-id-type': enforceTokenIdType,
|
|
1020
|
+
'enforce-amount-type': enforceAmountType,
|
|
1021
|
+
'enforce-chain-id-type': enforceChainIdType,
|
|
1022
|
+
'no-string-bigint-fields': noStringBigintFields,
|
|
1023
|
+
'no-manual-query-params': noManualQueryParams,
|
|
1024
|
+
'no-namespace-type-imports': noNamespaceTypeImports,
|
|
1025
|
+
'no-domain-field-definition': noDomainFieldDefinition,
|
|
1026
|
+
'require-api-type-source': requireApiTypeSource,
|
|
1027
|
+
'sdk-types-must-extend': sdkTypesMustExtend,
|
|
1028
|
+
'no-pick-for-request-types': noPickForRequestTypes,
|
|
1029
|
+
'no-partial-api-types': noPartialApiTypes,
|
|
1030
|
+
},
|
|
1031
|
+
configs: {
|
|
1032
|
+
recommended: {
|
|
1033
|
+
plugins: ['@sequence/types'],
|
|
1034
|
+
rules: {
|
|
1035
|
+
'@sequence/types/enforce-address-type': 'warn',
|
|
1036
|
+
'@sequence/types/enforce-token-id-type': 'warn',
|
|
1037
|
+
'@sequence/types/enforce-amount-type': 'warn',
|
|
1038
|
+
'@sequence/types/enforce-chain-id-type': 'warn',
|
|
1039
|
+
'@sequence/types/no-string-bigint-fields': 'warn',
|
|
1040
|
+
'@sequence/types/no-manual-query-params': 'warn',
|
|
1041
|
+
'@sequence/types/no-namespace-type-imports': 'warn',
|
|
1042
|
+
'@sequence/types/no-domain-field-definition': 'off',
|
|
1043
|
+
'@sequence/types/require-api-type-source': 'off',
|
|
1044
|
+
'@sequence/types/sdk-types-must-extend': 'off',
|
|
1045
|
+
'@sequence/types/no-pick-for-request-types': 'warn',
|
|
1046
|
+
'@sequence/types/no-partial-api-types': 'warn',
|
|
1047
|
+
},
|
|
1048
|
+
},
|
|
1049
|
+
strict: {
|
|
1050
|
+
plugins: ['@sequence/types'],
|
|
1051
|
+
rules: {
|
|
1052
|
+
'@sequence/types/enforce-address-type': 'error',
|
|
1053
|
+
'@sequence/types/enforce-token-id-type': 'error',
|
|
1054
|
+
'@sequence/types/enforce-amount-type': 'error',
|
|
1055
|
+
'@sequence/types/enforce-chain-id-type': 'error',
|
|
1056
|
+
'@sequence/types/no-string-bigint-fields': 'warn',
|
|
1057
|
+
'@sequence/types/no-manual-query-params': 'error',
|
|
1058
|
+
'@sequence/types/no-namespace-type-imports': 'error',
|
|
1059
|
+
'@sequence/types/no-domain-field-definition': 'error',
|
|
1060
|
+
'@sequence/types/require-api-type-source': 'error',
|
|
1061
|
+
'@sequence/types/sdk-types-must-extend': 'error',
|
|
1062
|
+
'@sequence/types/no-pick-for-request-types': 'error',
|
|
1063
|
+
'@sequence/types/no-partial-api-types': 'error',
|
|
1064
|
+
},
|
|
1065
|
+
},
|
|
1066
|
+
},
|
|
1067
|
+
};
|
|
1068
|
+
|
|
1069
|
+
export default plugin;
|