From 61c20ae24b83d871a6a5e3819e09748df3026061 Mon Sep 17 00:00:00 2001 From: Michael Absolon Date: Sun, 6 Oct 2024 15:03:28 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20Add=20consistent=20type=20imports=20ES?= =?UTF-8?q?lint=20rule=20=E2=9C=8F=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/lightspell-site/package.json | 4 +- apps/lightspell-site/src/App.tsx | 2 +- .../src/components/AppShell/Header.tsx | 2 +- .../src/components/NotFound/Illustration.tsx | 2 +- .../components/NotFound/NotFound.module.css | 4 +- .../src/components/NotFound/NotFound.tsx | 8 ++-- .../src/components/ScrollToTop.tsx | 4 +- apps/lightspell-site/src/main.tsx | 2 +- .../src/routes/NotFoundPage.tsx | 2 +- apps/playground/package.json | 3 +- apps/playground/src/App.tsx | 2 +- .../src/components/AccountsModal.tsx | 4 +- .../src/components/CurrencySelection.tsx | 9 ++-- apps/playground/src/components/ErrorAlert.tsx | 2 +- .../src/components/EthAccountsModal.tsx | 2 +- .../playground/src/components/OutputAlert.tsx | 2 +- .../src/components/RouterTransferForm.tsx | 37 +++++++------- .../src/components/TransferForm.tsx | 12 ++--- .../src/components/TransferInfo.tsx | 7 +-- .../src/components/TransferInfoForm.tsx | 8 ++-- .../src/components/TransferStepper.tsx | 9 ++-- .../playground/src/components/XcmTransfer.tsx | 22 ++++----- .../src/components/analyser/AnalyserForm.tsx | 2 +- .../src/components/asset-claim/AssetClaim.tsx | 15 +++--- .../components/asset-claim/AssetClaimForm.tsx | 4 +- .../src/components/assets/AssetsForm.tsx | 7 +-- .../src/components/assets/AssetsQueries.tsx | 7 +-- .../eth-bridge/EthBridgeTransfer.tsx | 18 +++---- .../eth-bridge/EthBridgeTransferForm.tsx | 11 ++--- .../src/components/pallets/PalletsForm.tsx | 7 +-- .../src/components/pallets/PalletsQueries.tsx | 5 +- .../src/hooks/useCurrencyOptions.ts | 15 +++--- .../src/hooks/useRouterCurrencyOptions.ts | 19 ++++---- apps/playground/src/main.tsx | 2 +- apps/playground/src/providers/ThemeContext.ts | 2 +- .../src/providers/WalletProvider.tsx | 5 +- .../src/routes/RouterTransferPage.tsx | 48 ++++++++++--------- .../src/routes/XcmAnalyserSandbox.tsx | 3 +- apps/playground/src/theme/themeConfig.ts | 3 +- apps/playground/src/types.ts | 2 +- apps/playground/src/utils.ts | 10 ++-- apps/playground/src/utils/replaceBigInt.ts | 2 +- apps/playground/src/utils/submitUsingApi.ts | 17 +++---- apps/playground/src/vite-env.d.ts | 2 +- apps/site/package.json | 4 +- apps/site/src/App.tsx | 7 +-- apps/site/src/components/AppShell/Header.tsx | 2 +- .../components/ArticleCard/ArticleCard.tsx | 2 +- apps/site/src/components/AudioPlayer.tsx | 3 +- .../CodeHighlightDark/CodeHighlightDark.tsx | 5 +- apps/site/src/components/Hero/Hero.tsx | 4 +- .../src/components/NotFound/Illustration.tsx | 2 +- .../components/NotFound/NotFound.module.css | 4 +- apps/site/src/components/ScrollToTop.tsx | 4 +- apps/site/src/components/StickyBar.tsx | 2 +- apps/site/src/main.tsx | 2 +- apps/site/src/routes/NotFoundPage.tsx | 2 +- apps/visualizator-be/package.json | 1 - .../src/channels/channels.service.test.ts | 5 +- .../src/messages/messages.module.test.ts | 3 +- .../src/messages/messages.service.test.ts | 5 +- apps/visualizator-fe/package.json | 1 - .../AccountsAmountPlot.container.tsx | 4 +- .../AccountsAmountPlot/AccountsAmountPlot.tsx | 7 +-- .../AmountTransferedPlot.container.tsx | 2 +- .../AmountTransferedPlot.tsx | 5 +- .../CustomChartTooltip/CustomChartTooltip.tsx | 6 +-- .../AssetsTransferedPlot.container.tsx | 2 +- .../AssetsTransferedPlot.tsx | 5 +- .../CustomChartTooltip/CustomChartTooltip.tsx | 4 +- .../utils/aggregateDataByParachain.ts | 5 +- .../utils/generateSeries.ts | 4 +- .../src/components/Canvas3D.tsx | 2 +- .../ChannelInfo/ChannelAlert.container.tsx | 5 +- .../components/ChannelInfo/ChannelAlert.tsx | 5 +- .../src/components/CollapseButton.tsx | 2 +- .../src/components/DateRangePicker.tsx | 2 +- .../src/components/DownloadButtons.tsx | 2 +- .../EcosystemSelect/EcosystemSelect.tsx | 2 +- .../src/components/ErrorAlert.tsx | 2 +- .../src/components/LineBetween.tsx | 17 +++---- .../LoadingScreen/LoadingScreen.tsx | 5 +- .../src/components/Options/OptionsModal.tsx | 2 +- .../src/components/Parachain/Parachain.tsx | 16 ++----- .../src/components/Parachain/utils.ts | 2 +- .../src/components/ParachainSelector.tsx | 7 +-- .../ParachainsGraph.container.tsx | 4 +- .../ParachainsGraph/ParachainsGraph.tsx | 10 ++-- .../src/components/ParachainsGraph/utils.ts | 2 +- .../src/components/Relaychain/Relaychain.tsx | 8 ++-- .../src/components/SendXcm/SendXcm.tsx | 12 +++-- .../src/components/SendXcm/SendXcmForm.tsx | 5 +- .../src/components/SendXcm/utils.ts | 6 +-- .../src/components/SliderInput.tsx | 5 +- .../CustomChartTooltip/CustomChartTooltip.tsx | 4 +- .../SuccessMessagesPlot.container.tsx | 2 +- .../SuccessMessagesPlot.tsx | 5 +- .../components/TabNavigator/TabNavigator.tsx | 2 +- .../SelectedParachainContext.tsx | 6 ++- .../src/context/WalletContext.ts | 2 +- .../src/providers/WalletProvider.tsx | 5 +- apps/visualizator-fe/src/types/types.ts | 2 +- apps/visualizator-fe/src/utils/adjustUVs.ts | 2 +- apps/visualizator-fe/src/utils/idbUtils.ts | 3 +- apps/visualizator-fe/src/utils/utils.ts | 2 +- apps/xcm-api/package.json | 1 - .../src/analytics/analytics.service.test.ts | 5 +- apps/xcm-api/src/app.controller.test.ts | 3 +- .../asset-claim.controller.test.ts | 10 ++-- .../asset-claim/asset-claim.service.test.ts | 7 +-- .../src/assets/assets.controller.test.ts | 6 ++- .../xcm-api/src/assets/assets.service.test.ts | 16 ++----- apps/xcm-api/src/auth/utils/utils.test.ts | 2 +- apps/xcm-api/src/auth/utils/utils.ts | 2 +- apps/xcm-api/src/config/sentry.config.test.ts | 4 +- apps/xcm-api/src/config/sentry.config.ts | 4 +- .../src/config/throttler.config.test.ts | 11 +++-- apps/xcm-api/src/config/throttler.config.ts | 6 +-- .../xcm-api/src/config/typeorm.config.test.ts | 4 +- apps/xcm-api/src/config/typeorm.config.ts | 4 +- apps/xcm-api/src/main.test.ts | 3 +- apps/xcm-api/src/main.ts | 2 +- .../src/pallets/pallets.controller.test.ts | 5 +- .../src/pallets/pallets.service.test.ts | 22 +++------ apps/xcm-api/src/router/dto/RouterDto.ts | 2 +- .../src/router/router.controller.test.ts | 5 +- .../xcm-api/src/router/router.service.test.ts | 16 +++---- .../transfer-info/dto/transfer-info.dto.ts | 2 +- .../transfer-info.controller.test.ts | 7 +-- .../transfer-info.service.test.ts | 7 +-- apps/xcm-api/src/users/users.service.test.ts | 4 +- apps/xcm-api/src/utils.ts | 8 +--- .../x-transfer-eth/dto/x-transfer-eth.dto.ts | 2 +- .../x-transfer-eth.controller.test.ts | 7 +-- .../x-transfer-eth.service.test.ts | 8 ++-- .../src/x-transfer/dto/XTransferDto.ts | 3 +- .../x-transfer/x-transfer.controller.test.ts | 7 +-- .../src/x-transfer/x-transfer.service.test.ts | 12 ++--- .../xcm-analyser.controller.test.ts | 5 +- .../xcm-analyser/xcm-analyser.service.test.ts | 3 +- apps/xcm-api/src/zod-validation-pipe.ts | 6 ++- eslint.config.js | 8 ++++ package.json | 1 + packages/sdk/package.json | 1 - packages/sdk/scripts/assets/fetchAssets.ts | 4 +- .../scripts/assets/fillInDecimalsBifrost.ts | 2 +- packages/sdk/scripts/assets/nodeToQueryMap.ts | 2 +- packages/sdk/scripts/eds/fetchEds.ts | 4 +- packages/sdk/scripts/pallets/fetchPallets.ts | 4 +- .../builders/BatchTransactionManager.test.ts | 5 +- .../builders/BatchTransactionManager.ts | 7 ++- .../sdk/src/builder/builders/Builder.test.ts | 3 +- packages/sdk/src/builder/builders/Builder.ts | 2 +- .../sdk/src/builder/builders/IBatchBuilder.ts | 2 +- .../src/builder/builders/ParaToParaBuilder.ts | 11 ++--- .../builder/builders/ParaToRelayBuilder.ts | 2 +- .../builder/builders/RelayToParaBuilder.ts | 2 +- .../builders/evm-builder/EvmBuilder.test.ts | 6 +-- .../builders/evm-builder/EvmBuilder.ts | 6 +-- packages/sdk/src/nodes/ParachainNode.test.ts | 6 +-- packages/sdk/src/nodes/ParachainNode.ts | 3 +- .../PolkadotXCMTransferImpl.test.ts | 8 ++-- .../polkadotXcm/PolkadotXCMTransferImpl.ts | 8 +--- .../sdk/src/nodes/supported/Acala.test.ts | 5 +- .../sdk/src/nodes/supported/Altair.test.ts | 5 +- .../sdk/src/nodes/supported/Amplitude.test.ts | 5 +- .../nodes/supported/AssetHubKusama.test.ts | 2 +- .../nodes/supported/AssetHubPolkadot.test.ts | 6 +-- .../src/nodes/supported/AssetHubPolkadot.ts | 4 +- .../sdk/src/nodes/supported/Astar.test.ts | 5 +- .../sdk/src/nodes/supported/Bajun.test.ts | 5 +- .../sdk/src/nodes/supported/Basilisk.test.ts | 5 +- .../src/nodes/supported/BifrostKusama.test.ts | 5 +- .../nodes/supported/BifrostPolkadot.test.ts | 5 +- .../nodes/supported/BridgeHubKusama.test.ts | 5 +- .../nodes/supported/BridgeHubPolkadot.test.ts | 5 +- .../sdk/src/nodes/supported/Calamari.test.ts | 5 +- .../src/nodes/supported/Centrifuge.test.ts | 5 +- .../src/nodes/supported/Collectives.test.ts | 5 +- .../nodes/supported/ComposableFinance.test.ts | 5 +- .../nodes/supported/CoretimeKusama.test.ts | 5 +- .../nodes/supported/CoretimePolkadot.test.ts | 8 +--- .../sdk/src/nodes/supported/Crust.test.ts | 5 +- .../src/nodes/supported/CrustShadow.test.ts | 5 +- .../sdk/src/nodes/supported/Curio.test.ts | 5 +- packages/sdk/src/nodes/supported/Curio.ts | 8 +--- .../sdk/src/nodes/supported/Darwinia.test.ts | 9 ++-- .../sdk/src/nodes/supported/Encointer.test.ts | 5 +- .../sdk/src/nodes/supported/Hydration.test.ts | 5 +- .../sdk/src/nodes/supported/Imbue.test.ts | 5 +- .../src/nodes/supported/Integritee.test.ts | 5 +- .../sdk/src/nodes/supported/Interlay.test.ts | 5 +- .../src/nodes/supported/InvArchTinker.test.ts | 5 +- .../sdk/src/nodes/supported/Khala.test.ts | 5 +- .../src/nodes/supported/KiltSpiritnet.test.ts | 5 +- .../sdk/src/nodes/supported/Kintsugi.test.ts | 5 +- .../sdk/src/nodes/supported/Litentry.test.ts | 5 +- .../sdk/src/nodes/supported/Manta.test.ts | 5 +- .../sdk/src/nodes/supported/Moonbeam.test.ts | 5 +- .../sdk/src/nodes/supported/Moonriver.test.ts | 5 +- .../sdk/src/nodes/supported/Mythos.test.ts | 5 +- .../sdk/src/nodes/supported/NeuroWeb.test.ts | 5 +- .../sdk/src/nodes/supported/Nodle.test.ts | 5 +- .../sdk/src/nodes/supported/Parallel.test.ts | 5 +- packages/sdk/src/nodes/supported/Peaq.test.ts | 5 +- .../sdk/src/nodes/supported/Pendulum.test.ts | 5 +- .../sdk/src/nodes/supported/Phala.test.ts | 5 +- .../sdk/src/nodes/supported/Picasso.test.ts | 5 +- .../sdk/src/nodes/supported/Pioneer.test.ts | 5 +- .../sdk/src/nodes/supported/Polkadex.test.ts | 5 +- .../sdk/src/nodes/supported/Quartz.test.ts | 5 +- .../src/nodes/supported/Robonomics.test.ts | 2 +- .../sdk/src/nodes/supported/Subsocial.test.ts | 2 +- packages/sdk/src/nodes/supported/Subsocial.ts | 3 +- .../sdk/src/nodes/supported/Turing.test.ts | 5 +- .../sdk/src/nodes/supported/Unique.test.ts | 5 +- .../sdk/src/nodes/supported/Zeitgeist.test.ts | 5 +- .../nodes/xTokens/XTokensTransferImpl.test.ts | 5 +- .../xTokens/getCurrencySelection.test.ts | 5 +- .../src/nodes/xTokens/getCurrencySelection.ts | 2 +- .../xTokens/getModifiedCurrencySelection.ts | 3 +- .../src/nodes/xTokens/getParameters.test.ts | 3 +- .../xTransfer/XTransferTransferImpl.test.ts | 7 ++- .../xTransfer/determineDestWeight.test.ts | 2 +- .../nodes/xTransfer/getDestination.test.ts | 2 +- packages/sdk/src/pallets/assets/assets.ts | 5 +- .../assets/balance/getAssetBalance.test.ts | 2 +- .../pallets/assets/balance/getAssetBalance.ts | 2 +- .../balance/getAssetHubMultiLocation.ts | 2 +- .../assets/balance/getBalanceForeign.test.ts | 2 +- .../assets/balance/getBalanceForeign.ts | 2 +- .../getBalanceForeignPolkadotXcm.test.ts | 2 +- .../balance/getBalanceForeignPolkadotXcm.ts | 8 ++-- .../balance/getBalanceForeignXTokens.test.ts | 6 +-- .../balance/getBalanceForeignXTokens.ts | 10 ++-- .../assets/balance/getBalanceNative.test.ts | 2 +- .../assets/balance/getBalanceNative.ts | 4 +- packages/sdk/src/pallets/assets/eds.test.ts | 2 +- .../assets/getAssetBySymbolOrId.test.ts | 2 +- .../assets/getExistentialDeposit.test.ts | 2 +- .../src/pallets/assets/getOriginFeeDetails.ts | 4 +- .../transfer-info/getTransferInfo.test.ts | 2 +- .../assets/transfer-info/getTransferInfo.ts | 4 +- packages/sdk/src/pallets/pallets.ts | 3 +- .../xcmPallet/calculateTransactionFee.test.ts | 2 +- .../xcmPallet/calculateTransactionFee.ts | 4 +- .../buildEthTransferOptions.test.ts | 7 +-- .../ethTransfer/buildEthTransferOptions.ts | 2 +- .../ethTransfer/checkPlanFailure.test.ts | 2 +- .../xcmPallet/ethTransfer/checkPlanFailure.ts | 2 +- .../ethTransfer/createContext.test.ts | 2 +- .../xcmPallet/ethTransfer/createContext.ts | 5 +- .../xcmPallet/ethTransfer/ethTransfer.test.ts | 9 ++-- .../xcmPallet/ethTransfer/ethTransfer.ts | 4 +- .../xcmPallet/ethTransfer/findEthAsset.ts | 2 +- .../xcmPallet/findParachainJunction.test.ts | 3 +- .../xcmPallet/findParachainJunction.ts | 2 +- .../keepAlive/checkKeepAlive.test.ts | 2 +- .../xcmPallet/keepAlive/checkKeepAlive.ts | 6 +-- .../xcmPallet/keepAlive/createTx.test.ts | 4 +- .../pallets/xcmPallet/keepAlive/createTx.ts | 4 +- .../src/pallets/xcmPallet/transfer.test.ts | 9 +--- .../sdk/src/pallets/xcmPallet/transfer.ts | 4 +- packages/sdk/src/pallets/xcmPallet/utils.ts | 3 +- packages/sdk/src/types/TAssets.ts | 3 +- packages/sdk/src/types/TBuilder.ts | 2 +- packages/sdk/src/types/TCurrency.ts | 6 +-- packages/sdk/src/types/TExistentialDeposit.ts | 2 +- packages/sdk/src/types/TTransfer.ts | 8 ++-- packages/sdk/src/types/TTransferInfo.ts | 2 +- .../utils/callPolkadotJsTxFunction.test.ts | 4 +- .../sdk/src/utils/callPolkadotJsTxFunction.ts | 4 +- .../utils/createApiInstanceForNode.test.ts | 4 +- .../sdk/src/utils/createApiInstanceForNode.ts | 4 +- .../sdk/src/utils/createX1Payload.test.ts | 3 +- packages/sdk/src/utils/createX1Payload.ts | 3 +- .../utils/determineRelayChainSymbol.test.ts | 2 +- .../src/utils/determineRelayChainSymbol.ts | 2 +- .../generateAddressMultiLocationV4.test.ts | 5 +- .../utils/generateAddressMultiLocationV4.ts | 5 +- .../src/utils/generateAddressPayload.test.ts | 5 +- .../sdk/src/utils/generateAddressPayload.ts | 5 +- .../sdk/src/utils/getAllNodeProviders.test.ts | 4 +- packages/sdk/src/utils/getAllNodeProviders.ts | 2 +- packages/sdk/src/utils/getFees.test.ts | 2 +- packages/sdk/src/utils/getFees.ts | 2 +- packages/sdk/src/utils/getNode.ts | 2 +- .../sdk/src/utils/getNodeEndpointOption.ts | 2 +- .../sdk/src/utils/getNodeProvider.test.ts | 2 +- packages/sdk/src/utils/getNodeProvider.ts | 2 +- packages/sdk/src/utils/index.ts | 6 +-- packages/sdk/src/utils/verifyMultiLocation.ts | 2 +- .../sdk/src/utils/verifyMultilocation.test.ts | 2 +- packages/xcm-analyser/scripts/example.ts | 2 +- packages/xcm-router/package.json | 1 - packages/xcm-router/src/RouterBuilder.ts | 3 +- packages/xcm-router/src/assets/assets.test.ts | 5 +- packages/xcm-router/src/assets/assets.ts | 8 +--- .../dexNodes/Hydration/HydrationDex.test.ts | 3 +- .../src/dexNodes/Hydration/utils.test.ts | 4 +- .../src/dexNodes/Hydration/utils.ts | 3 +- .../xcm-router/src/dexNodes/Interlay/utils.ts | 3 +- .../transfer/buildTransferExtrinsics.test.ts | 8 ++-- .../src/transfer/selectBestExchange.test.ts | 3 +- packages/xcm-router/src/transfer/swap.test.ts | 2 +- .../src/transfer/transfer.integration.test.ts | 3 +- .../xcm-router/src/transfer/transfer.test.ts | 9 ++-- .../src/transfer/transferFromEthereum.test.ts | 7 +-- .../src/transfer/transferFromEthereum.ts | 6 ++- .../src/transfer/transferToEthereum.test.ts | 9 ++-- .../src/transfer/transferToEthereum.ts | 3 +- packages/xcm-router/src/transfer/utils.ts | 10 ++-- packages/xcm-router/src/types.ts | 2 +- packages/xcm-router/src/utils/utils.ts | 8 +--- pnpm-lock.yaml | 21 ++------ 315 files changed, 817 insertions(+), 778 deletions(-) diff --git a/apps/lightspell-site/package.json b/apps/lightspell-site/package.json index 870bbbea..9089d730 100644 --- a/apps/lightspell-site/package.json +++ b/apps/lightspell-site/package.json @@ -8,7 +8,9 @@ "build": "tsc && vite build", "preview": "vite preview", "lint:check": "eslint .", - "lint": "eslint --fix ." + "lint": "eslint --fix .", + "format:check": "prettier --check src", + "format:write": "prettier --write src" }, "dependencies": { "@mantine/core": "^7.13.1", diff --git a/apps/lightspell-site/src/App.tsx b/apps/lightspell-site/src/App.tsx index fcd32b96..74937f43 100644 --- a/apps/lightspell-site/src/App.tsx +++ b/apps/lightspell-site/src/App.tsx @@ -3,7 +3,7 @@ import "./App.css"; import { MantineProvider, createTheme, - MantineColorsTuple, + type MantineColorsTuple, } from "@mantine/core"; import { BrowserRouter } from "react-router-dom"; import ScrollToAnchor from "./components/ScrollToAnchor"; diff --git a/apps/lightspell-site/src/components/AppShell/Header.tsx b/apps/lightspell-site/src/components/AppShell/Header.tsx index 44db3332..8a800d6d 100644 --- a/apps/lightspell-site/src/components/AppShell/Header.tsx +++ b/apps/lightspell-site/src/components/AppShell/Header.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { Container, Group, Burger, Image, Button, Anchor } from "@mantine/core"; import classes from "./Header.module.css"; import { Link } from "react-router-dom"; diff --git a/apps/lightspell-site/src/components/NotFound/Illustration.tsx b/apps/lightspell-site/src/components/NotFound/Illustration.tsx index 03511d8c..e95ccfb6 100644 --- a/apps/lightspell-site/src/components/NotFound/Illustration.tsx +++ b/apps/lightspell-site/src/components/NotFound/Illustration.tsx @@ -1,4 +1,4 @@ -const Illustration = (props: React.ComponentPropsWithoutRef<'svg'>) => { +const Illustration = (props: React.ComponentPropsWithoutRef<"svg">) => { return ( ( diff --git a/apps/lightspell-site/src/components/ScrollToTop.tsx b/apps/lightspell-site/src/components/ScrollToTop.tsx index c3b7007d..f5c481fb 100644 --- a/apps/lightspell-site/src/components/ScrollToTop.tsx +++ b/apps/lightspell-site/src/components/ScrollToTop.tsx @@ -1,5 +1,5 @@ -import { useEffect } from 'react'; -import { useLocation } from 'react-router-dom'; +import { useEffect } from "react"; +import { useLocation } from "react-router-dom"; const ScrollToTop = () => { const { pathname } = useLocation(); diff --git a/apps/lightspell-site/src/main.tsx b/apps/lightspell-site/src/main.tsx index f46c379c..38549296 100644 --- a/apps/lightspell-site/src/main.tsx +++ b/apps/lightspell-site/src/main.tsx @@ -5,5 +5,5 @@ import App from "./App"; ReactDOM.createRoot(document.getElementById("root")!).render( - + , ); diff --git a/apps/lightspell-site/src/routes/NotFoundPage.tsx b/apps/lightspell-site/src/routes/NotFoundPage.tsx index b0327f78..281e62fc 100644 --- a/apps/lightspell-site/src/routes/NotFoundPage.tsx +++ b/apps/lightspell-site/src/routes/NotFoundPage.tsx @@ -1,4 +1,4 @@ -import NotFound from '../components/NotFound/NotFound'; +import NotFound from "../components/NotFound/NotFound"; const NotFoundPage = () => ; diff --git a/apps/playground/package.json b/apps/playground/package.json index eca00601..31e0f484 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -9,6 +9,8 @@ "preview": "vite preview", "lint:check": "eslint .", "lint": "eslint --fix .", + "format:check": "prettier --check src", + "format:write": "prettier --write src", "test:e2e": "playwright test", "install-polkadot-ext": "cd e2e/extensions/polkadot-ext && yarn && yarn build:chrome", "init-polkadot-ext": "git clone https://github.com/polkadot-js/extension e2e/extensions/polkadot-ext && pnpm install-polkadot-ext", @@ -40,7 +42,6 @@ "devDependencies": { "@metamask/providers": "^17.2.0", "@playwright/test": "^1.47.2", - "@types/node": "^22.7.4", "@types/react": "^18.3.10", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.2", diff --git a/apps/playground/src/App.tsx b/apps/playground/src/App.tsx index e20fbcc1..16af1968 100644 --- a/apps/playground/src/App.tsx +++ b/apps/playground/src/App.tsx @@ -10,7 +10,7 @@ import { import "@mantine/core/styles.css"; import { useDisclosure } from "@mantine/hooks"; import { web3Accounts, web3Enable } from "@polkadot/extension-dapp"; -import { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; +import type { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; import { IconAnalyze, IconBoxSeam, IconRoute } from "@tabler/icons-react"; import { useState } from "react"; import { diff --git a/apps/playground/src/components/AccountsModal.tsx b/apps/playground/src/components/AccountsModal.tsx index c159f547..6549838c 100644 --- a/apps/playground/src/components/AccountsModal.tsx +++ b/apps/playground/src/components/AccountsModal.tsx @@ -1,6 +1,6 @@ import { Modal, Stack, Button } from "@mantine/core"; -import { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; -import { FC } from "react"; +import type { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; +import type { FC } from "react"; type Props = { isOpen: boolean; diff --git a/apps/playground/src/components/CurrencySelection.tsx b/apps/playground/src/components/CurrencySelection.tsx index 01d1810c..712eeaa7 100644 --- a/apps/playground/src/components/CurrencySelection.tsx +++ b/apps/playground/src/components/CurrencySelection.tsx @@ -1,16 +1,17 @@ -import { FC, useEffect } from "react"; +import type { FC } from "react"; +import { useEffect } from "react"; +import type { ComboboxItem } from "@mantine/core"; import { Select, Stack, TextInput, Checkbox, - ComboboxItem, Group, SegmentedControl, JsonInput, } from "@mantine/core"; -import { UseFormReturnType } from "@mantine/form"; -import { FormValues } from "./TransferForm"; +import type { UseFormReturnType } from "@mantine/form"; +import type { FormValues } from "./TransferForm"; import { isRelayChain } from "@paraspell/sdk"; type Props = { diff --git a/apps/playground/src/components/ErrorAlert.tsx b/apps/playground/src/components/ErrorAlert.tsx index 46a41ee7..0f661178 100644 --- a/apps/playground/src/components/ErrorAlert.tsx +++ b/apps/playground/src/components/ErrorAlert.tsx @@ -1,4 +1,4 @@ -import { FC, ReactNode } from "react"; +import type { FC, ReactNode } from "react"; import { Alert } from "@mantine/core"; import { IconAlertCircle } from "@tabler/icons-react"; diff --git a/apps/playground/src/components/EthAccountsModal.tsx b/apps/playground/src/components/EthAccountsModal.tsx index 89dd201c..b5456147 100644 --- a/apps/playground/src/components/EthAccountsModal.tsx +++ b/apps/playground/src/components/EthAccountsModal.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { Modal, Stack, Button } from "@mantine/core"; type Props = { diff --git a/apps/playground/src/components/OutputAlert.tsx b/apps/playground/src/components/OutputAlert.tsx index 5932fcd8..6b8eb6f7 100644 --- a/apps/playground/src/components/OutputAlert.tsx +++ b/apps/playground/src/components/OutputAlert.tsx @@ -1,6 +1,6 @@ import { Text, Alert } from "@mantine/core"; import { IconJson, IconLink } from "@tabler/icons-react"; -import { FC, ReactNode } from "react"; +import type { FC, ReactNode } from "react"; const jsonIcon = ; const linkIcon = ; diff --git a/apps/playground/src/components/RouterTransferForm.tsx b/apps/playground/src/components/RouterTransferForm.tsx index 2938b6c4..70aec919 100644 --- a/apps/playground/src/components/RouterTransferForm.tsx +++ b/apps/playground/src/components/RouterTransferForm.tsx @@ -1,12 +1,9 @@ import { useForm } from "@mantine/form"; -import { - EXCHANGE_NODES, - TAutoSelect, - TExchangeNode, - TransactionType, -} from "@paraspell/xcm-router"; +import type { TAutoSelect, TExchangeNode } from "@paraspell/xcm-router"; +import { EXCHANGE_NODES, TransactionType } from "@paraspell/xcm-router"; import { isValidWalletAddress } from "../utils"; -import { FC, useEffect, useState } from "react"; +import type { FC } from "react"; +import { useEffect, useState } from "react"; import { Text, Button, @@ -19,17 +16,15 @@ import { Center, rem, } from "@mantine/core"; -import { - NODES_WITH_RELAY_CHAINS, - TAsset, - TNodeWithRelayChains, -} from "@paraspell/sdk"; -import { Signer } from "@polkadot/api/types"; +import type { TAsset, TNodeWithRelayChains } from "@paraspell/sdk"; +import { NODES_WITH_RELAY_CHAINS } from "@paraspell/sdk"; +import type { Signer } from "@polkadot/api/types"; import { web3Accounts, web3FromAddress } from "@polkadot/extension-dapp"; import AccountsModal from "./AccountsModal"; import { useDisclosure } from "@mantine/hooks"; -import { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; -import { BrowserProvider, ethers } from "ethers"; +import type { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; +import type { BrowserProvider } from "ethers"; +import { ethers } from "ethers"; import { IconInfoCircle } from "@tabler/icons-react"; import EthAccountsModal from "./EthAccountsModal"; import useRouterCurrencyOptions from "../hooks/useRouterCurrencyOptions"; @@ -92,7 +87,7 @@ const RouterTransferForm: FC = ({ useState(); const [selectedEthAccount, setSelectedEthAccount] = useState( - null + null, ); const onAccountSelect = (account: InjectedAccountWithMeta) => () => { @@ -179,7 +174,7 @@ const RouterTransferForm: FC = ({ try { const allAccounts = await web3Accounts(); setAssetHubAccounts( - allAccounts.filter((account) => !ethers.isAddress(account.address)) + allAccounts.filter((account) => !ethers.isAddress(account.address)), ); openAssetHubModal(); } catch (error) { @@ -194,7 +189,7 @@ const RouterTransferForm: FC = ({ try { const allAccounts = await web3Accounts(); setAccounts( - allAccounts.filter((account) => ethers.isAddress(account.address)) + allAccounts.filter((account) => ethers.isAddress(account.address)), ); openModal(); } catch (error) { @@ -215,7 +210,7 @@ const RouterTransferForm: FC = ({ try { const accounts = (await newProvider.send( "eth_requestAccounts", - [] + [], )) as string[]; console.log("Accounts:", accounts); setEthAccounts(accounts); @@ -256,7 +251,7 @@ const RouterTransferForm: FC = ({ } = useRouterCurrencyOptions( form.values.from, form.values.exchange, - form.values.to + form.values.to, ); const onSubmitInternal = (values: FormValues) => { @@ -330,7 +325,7 @@ const RouterTransferForm: FC = ({ if (isFromNotParaToPara) { form.setFieldValue( "currencyFromOptionId", - Object.keys(currencyFromMap)[0] + Object.keys(currencyFromMap)[0], ); } }, [isFromNotParaToPara, currencyFromMap]); diff --git a/apps/playground/src/components/TransferForm.tsx b/apps/playground/src/components/TransferForm.tsx index f737756c..77620e73 100644 --- a/apps/playground/src/components/TransferForm.tsx +++ b/apps/playground/src/components/TransferForm.tsx @@ -1,12 +1,10 @@ import { useForm } from "@mantine/form"; import { isValidWalletAddress } from "../utils"; -import { FC, useEffect } from "react"; +import type { FC } from "react"; +import { useEffect } from "react"; import { Button, Checkbox, Select, Stack, TextInput } from "@mantine/core"; -import { - NODES_WITH_RELAY_CHAINS, - TAsset, - TNodeWithRelayChains, -} from "@paraspell/sdk"; +import type { TAsset, TNodeWithRelayChains } from "@paraspell/sdk"; +import { NODES_WITH_RELAY_CHAINS } from "@paraspell/sdk"; import useCurrencyOptions from "../hooks/useCurrencyOptions"; import CurrencySelection from "./CurrencySelection"; @@ -66,7 +64,7 @@ const TransferForm: FC = ({ onSubmit, loading }) => { const { currencyOptions, currencyMap, isNotParaToPara } = useCurrencyOptions( form.values.from, - form.values.to + form.values.to, ); const onSubmitInternal = (values: FormValues) => { diff --git a/apps/playground/src/components/TransferInfo.tsx b/apps/playground/src/components/TransferInfo.tsx index a74aaec7..cb5451fe 100644 --- a/apps/playground/src/components/TransferInfo.tsx +++ b/apps/playground/src/components/TransferInfo.tsx @@ -3,7 +3,8 @@ import ErrorAlert from "./ErrorAlert"; import { useDisclosure, useScrollIntoView } from "@mantine/hooks"; import { useState, useEffect } from "react"; import { useWallet } from "../hooks/useWallet"; -import TransferInfoForm, { FormValues } from "./TransferInfoForm"; +import type { FormValues } from "./TransferInfoForm"; +import TransferInfoForm from "./TransferInfoForm"; import OutputAlert from "./OutputAlert"; import { getTransferInfo } from "@paraspell/sdk"; import { fetchFromApi } from "../utils/submitUsingApi"; @@ -54,7 +55,7 @@ const TransferInfo = () => { }, `/transfer-info`, "POST", - true + true, ); } else { return await getTransferInfo( @@ -63,7 +64,7 @@ const TransferInfo = () => { originAddress, formValues.destinationAddress, currency, - formValues.amount + formValues.amount, ); } }; diff --git a/apps/playground/src/components/TransferInfoForm.tsx b/apps/playground/src/components/TransferInfoForm.tsx index 881a4867..220fb899 100644 --- a/apps/playground/src/components/TransferInfoForm.tsx +++ b/apps/playground/src/components/TransferInfoForm.tsx @@ -1,6 +1,6 @@ import { useForm } from "@mantine/form"; import { isValidWalletAddress } from "../utils"; -import { FC } from "react"; +import type { FC } from "react"; import { Button, Checkbox, @@ -10,10 +10,8 @@ import { Stack, TextInput, } from "@mantine/core"; -import { - NODES_WITH_RELAY_CHAINS, - TNodeDotKsmWithRelayChains, -} from "@paraspell/sdk"; +import type { TNodeDotKsmWithRelayChains } from "@paraspell/sdk"; +import { NODES_WITH_RELAY_CHAINS } from "@paraspell/sdk"; export type FormValues = { from: TNodeDotKsmWithRelayChains; diff --git a/apps/playground/src/components/TransferStepper.tsx b/apps/playground/src/components/TransferStepper.tsx index c019c44a..7459a890 100644 --- a/apps/playground/src/components/TransferStepper.tsx +++ b/apps/playground/src/components/TransferStepper.tsx @@ -1,6 +1,7 @@ -import { Stepper, Title } from '@mantine/core'; -import { TTxProgressInfo, TransactionStatus, TransactionType } from '@paraspell/xcm-router'; -import { FC } from 'react'; +import { Stepper, Title } from "@mantine/core"; +import type { TTxProgressInfo } from "@paraspell/xcm-router"; +import { TransactionStatus, TransactionType } from "@paraspell/xcm-router"; +import type { FC } from "react"; const getActiveStep = (progressInfo?: TTxProgressInfo) => { if (!progressInfo) { @@ -60,7 +61,7 @@ const TransferStepper: FC = ({ progressInfo }) => { } > - + Your transaction was successful! diff --git a/apps/playground/src/components/XcmTransfer.tsx b/apps/playground/src/components/XcmTransfer.tsx index 4ee046a8..9607b510 100644 --- a/apps/playground/src/components/XcmTransfer.tsx +++ b/apps/playground/src/components/XcmTransfer.tsx @@ -1,17 +1,13 @@ import { Stack, Title, Box } from "@mantine/core"; import ErrorAlert from "./ErrorAlert"; -import TransferForm, { FormValuesTransformed } from "./TransferForm"; +import type { FormValuesTransformed } from "./TransferForm"; +import TransferForm from "./TransferForm"; import { useDisclosure, useScrollIntoView } from "@mantine/hooks"; -import { - Builder, - TCurrencyInput, - TMultiLocation, - TNode, - createApiInstanceForNode, -} from "@paraspell/sdk"; -import { ApiPromise } from "@polkadot/api"; +import type { TCurrencyInput, TMultiLocation, TNode } from "@paraspell/sdk"; +import { Builder, createApiInstanceForNode } from "@paraspell/sdk"; +import type { ApiPromise } from "@polkadot/api"; import { web3FromAddress } from "@polkadot/extension-dapp"; -import { Signer } from "@polkadot/api/types"; +import type { Signer } from "@polkadot/api/types"; import { useState, useEffect } from "react"; import { submitTransaction } from "../utils"; import { submitTxUsingApi } from "../utils/submitUsingApi"; @@ -90,7 +86,7 @@ const XcmTransfer = () => { const submitUsingSdk = async ( formValues: FormValuesTransformed, injectorAddress: string, - signer: Signer + signer: Signer, ) => { const api = await createApiInstanceForNode(formValues.from); const tx = await createTransferTx(formValues, api); @@ -128,13 +124,13 @@ const XcmTransfer = () => { selectedAccount.address, injector.signer, "POST", - true + true, ); } else { await submitUsingSdk( formValues, selectedAccount.address, - injector.signer + injector.signer, ); } alert("Transaction was successful!"); diff --git a/apps/playground/src/components/analyser/AnalyserForm.tsx b/apps/playground/src/components/analyser/AnalyserForm.tsx index c53c8373..832510e4 100644 --- a/apps/playground/src/components/analyser/AnalyserForm.tsx +++ b/apps/playground/src/components/analyser/AnalyserForm.tsx @@ -1,6 +1,6 @@ import { Button, JsonInput, Stack } from "@mantine/core"; import { useForm } from "@mantine/form"; -import { FC } from "react"; +import type { FC } from "react"; export type FormValues = { input: string; diff --git a/apps/playground/src/components/asset-claim/AssetClaim.tsx b/apps/playground/src/components/asset-claim/AssetClaim.tsx index 9f509147..bcd4cad4 100644 --- a/apps/playground/src/components/asset-claim/AssetClaim.tsx +++ b/apps/playground/src/components/asset-claim/AssetClaim.tsx @@ -1,14 +1,15 @@ import { Stack, Title, Box } from "@mantine/core"; import { useDisclosure, useScrollIntoView } from "@mantine/hooks"; import { Builder, createApiInstanceForNode } from "@paraspell/sdk"; -import { ApiPromise } from "@polkadot/api"; -import { Signer } from "@polkadot/api/types"; +import type { ApiPromise } from "@polkadot/api"; +import type { Signer } from "@polkadot/api/types"; import { web3FromAddress } from "@polkadot/extension-dapp"; import { useState, useEffect } from "react"; import { useWallet } from "../../hooks/useWallet"; import { submitTransaction } from "../../utils"; import ErrorAlert from "../ErrorAlert"; -import AssetClaimForm, { FormValues } from "./AssetClaimForm"; +import type { FormValues } from "./AssetClaimForm"; +import AssetClaimForm from "./AssetClaimForm"; import { submitTxUsingApi } from "../../utils/submitUsingApi"; const AssetClaim = () => { @@ -33,7 +34,7 @@ const AssetClaim = () => { const createTransferTx = ( { from, amount, address }: FormValues, - api: ApiPromise + api: ApiPromise, ) => { return Builder(api) .claimFrom(from) @@ -57,7 +58,7 @@ const AssetClaim = () => { const submitUsingSdk = async ( formValues: FormValues, injectorAddress: string, - signer: Signer + signer: Signer, ) => { const api = await createApiInstanceForNode(formValues.from); const tx = await createTransferTx(formValues, api); @@ -99,13 +100,13 @@ const AssetClaim = () => { selectedAccount.address, injector.signer, "POST", - true + true, ); } else { await submitUsingSdk( formValues, selectedAccount.address, - injector.signer + injector.signer, ); } diff --git a/apps/playground/src/components/asset-claim/AssetClaimForm.tsx b/apps/playground/src/components/asset-claim/AssetClaimForm.tsx index cd638890..249863e4 100644 --- a/apps/playground/src/components/asset-claim/AssetClaimForm.tsx +++ b/apps/playground/src/components/asset-claim/AssetClaimForm.tsx @@ -1,7 +1,7 @@ import { Stack, Select, TextInput, Button, Checkbox } from "@mantine/core"; import { useForm } from "@mantine/form"; -import { TNodeWithRelayChains } from "@paraspell/sdk"; -import { FC } from "react"; +import type { TNodeWithRelayChains } from "@paraspell/sdk"; +import type { FC } from "react"; import { isValidWalletAddress } from "../../utils"; const SUPPORTED_NODES: TNodeWithRelayChains[] = [ diff --git a/apps/playground/src/components/assets/AssetsForm.tsx b/apps/playground/src/components/assets/AssetsForm.tsx index eaa32cfe..83742517 100644 --- a/apps/playground/src/components/assets/AssetsForm.tsx +++ b/apps/playground/src/components/assets/AssetsForm.tsx @@ -1,5 +1,5 @@ import { useForm } from "@mantine/form"; -import { FC } from "react"; +import type { FC } from "react"; import { Button, Checkbox, @@ -9,8 +9,9 @@ import { Stack, TextInput, } from "@mantine/core"; -import { NODE_NAMES, TNodePolkadotKusama } from "@paraspell/sdk"; -import { TAssetsQuery } from "../../types"; +import type { TNodePolkadotKusama } from "@paraspell/sdk"; +import { NODE_NAMES } from "@paraspell/sdk"; +import type { TAssetsQuery } from "../../types"; import { ASSET_QUERIES } from "../../consts"; export type FormValues = { diff --git a/apps/playground/src/components/assets/AssetsQueries.tsx b/apps/playground/src/components/assets/AssetsQueries.tsx index c58680e3..a0b35d2e 100644 --- a/apps/playground/src/components/assets/AssetsQueries.tsx +++ b/apps/playground/src/components/assets/AssetsQueries.tsx @@ -3,7 +3,8 @@ import ErrorAlert from "../ErrorAlert"; import { useDisclosure, useScrollIntoView } from "@mantine/hooks"; import { useState, useEffect } from "react"; import { fetchFromApi } from "../../utils/submitUsingApi"; -import AssetsForm, { FormValues } from "./AssetsForm"; +import type { FormValues } from "./AssetsForm"; +import AssetsForm from "./AssetsForm"; import { getAllAssetsSymbols, getAssetDecimals, @@ -74,7 +75,7 @@ const AssetsQueries = () => { return getBalanceForeign( address, node, - currencyType === "id" ? { id: currency } : { symbol: currency } + currencyType === "id" ? { id: currency } : { symbol: currency }, ); } }; @@ -107,7 +108,7 @@ const AssetsQueries = () => { if (useApi) { return await fetchFromApi( formValues, - `/assets/${getEndpoint(formValues)}` + `/assets/${getEndpoint(formValues)}`, ); } else { return await submitUsingSdk(formValues); diff --git a/apps/playground/src/components/eth-bridge/EthBridgeTransfer.tsx b/apps/playground/src/components/eth-bridge/EthBridgeTransfer.tsx index 4436821b..8bf350b0 100644 --- a/apps/playground/src/components/eth-bridge/EthBridgeTransfer.tsx +++ b/apps/playground/src/components/eth-bridge/EthBridgeTransfer.tsx @@ -1,16 +1,18 @@ import { Stack, Title, Box, Button } from "@mantine/core"; import { useDisclosure, useScrollIntoView } from "@mantine/hooks"; import { useState, useEffect } from "react"; -import { BrowserProvider, ethers, LogDescription } from "ethers"; +import type { BrowserProvider, LogDescription } from "ethers"; +import { ethers } from "ethers"; import ErrorAlert from "../ErrorAlert"; -import EthBridgeTransferForm, { +import type { FormValues, FormValuesTransformed, } from "./EthBridgeTransferForm"; +import EthBridgeTransferForm from "./EthBridgeTransferForm"; import { EvmBuilder } from "@paraspell/sdk"; import { fetchFromApi } from "../../utils/submitUsingApi"; import { IGateway__factory } from "@snowbridge/contract-types"; -import { MultiAddressStruct } from "@snowbridge/contract-types/dist/IGateway"; +import type { MultiAddressStruct } from "@snowbridge/contract-types/dist/IGateway"; import { u8aToHex } from "@polkadot/util"; import { decodeAddress } from "@polkadot/keyring"; @@ -48,7 +50,7 @@ const EthBridgeTransfer = () => { if (window.ethereum) { window.ethereum.on( "accountsChanged", - handleAccountsChanged as (...args: unknown[]) => void + handleAccountsChanged as (...args: unknown[]) => void, ); } @@ -56,7 +58,7 @@ const EthBridgeTransfer = () => { if (window.ethereum) { window.ethereum.removeListener( "accountsChanged", - handleAccountsChanged + handleAccountsChanged, ); } }; @@ -135,7 +137,7 @@ const EthBridgeTransfer = () => { }, "/x-transfer-eth", "POST", - true + true, )) as ApiResponse; const GATEWAY_CONTRACT = "0xEDa338E4dC46038493b885327842fD3E301CaB39"; @@ -147,7 +149,7 @@ const EthBridgeTransfer = () => { const address: MultiAddressStruct = { data: abi.encode( ["bytes32"], - [u8aToHex(decodeAddress(formValues.address))] + [u8aToHex(decodeAddress(formValues.address))], ), kind: 1, }; @@ -160,7 +162,7 @@ const EthBridgeTransfer = () => { apiResponse.amount, { value: apiResponse.fee, - } + }, ); const receipt = await response.wait(1); diff --git a/apps/playground/src/components/eth-bridge/EthBridgeTransferForm.tsx b/apps/playground/src/components/eth-bridge/EthBridgeTransferForm.tsx index ed398d36..5ac55cba 100644 --- a/apps/playground/src/components/eth-bridge/EthBridgeTransferForm.tsx +++ b/apps/playground/src/components/eth-bridge/EthBridgeTransferForm.tsx @@ -1,11 +1,8 @@ import { useForm } from "@mantine/form"; -import { FC } from "react"; +import type { FC } from "react"; import { Button, Checkbox, Select, Stack, TextInput } from "@mantine/core"; -import { - NODES_WITH_RELAY_CHAINS, - TAsset, - TNodePolkadotKusama, -} from "@paraspell/sdk"; +import type { TAsset, TNodePolkadotKusama } from "@paraspell/sdk"; +import { NODES_WITH_RELAY_CHAINS } from "@paraspell/sdk"; import { isValidPolkadotAddress } from "../../utils"; import useCurrencyOptions from "../../hooks/useCurrencyOptions"; @@ -44,7 +41,7 @@ const EthBridgeTransferForm: FC = ({ onSubmit, loading }) => { const { currencyOptions, currencyMap } = useCurrencyOptions( "Ethereum", - form.values.to + form.values.to, ); const onSubmitInternal = (values: FormValues) => { diff --git a/apps/playground/src/components/pallets/PalletsForm.tsx b/apps/playground/src/components/pallets/PalletsForm.tsx index b7fd8c48..24d3ef2e 100644 --- a/apps/playground/src/components/pallets/PalletsForm.tsx +++ b/apps/playground/src/components/pallets/PalletsForm.tsx @@ -1,8 +1,9 @@ import { useForm } from "@mantine/form"; -import { FC } from "react"; +import type { FC } from "react"; import { Button, Checkbox, Select, Stack } from "@mantine/core"; -import { NODE_NAMES, TNodePolkadotKusama } from "@paraspell/sdk"; -import { TPalletsQuery } from "../../types"; +import type { TNodePolkadotKusama } from "@paraspell/sdk"; +import { NODE_NAMES } from "@paraspell/sdk"; +import type { TPalletsQuery } from "../../types"; import { PALLETS_QUERIES } from "../../consts"; export type FormValues = { diff --git a/apps/playground/src/components/pallets/PalletsQueries.tsx b/apps/playground/src/components/pallets/PalletsQueries.tsx index 2bc9cb03..2f578a6a 100644 --- a/apps/playground/src/components/pallets/PalletsQueries.tsx +++ b/apps/playground/src/components/pallets/PalletsQueries.tsx @@ -4,7 +4,8 @@ import { useDisclosure, useScrollIntoView } from "@mantine/hooks"; import { useState, useEffect } from "react"; import { fetchFromApi } from "../../utils/submitUsingApi"; import { getDefaultPallet, getSupportedPallets } from "@paraspell/sdk"; -import PalletsForm, { FormValues } from "./PalletsForm"; +import type { FormValues } from "./PalletsForm"; +import PalletsForm from "./PalletsForm"; import OutputAlert from "../OutputAlert"; const PalletsQueries = () => { @@ -53,7 +54,7 @@ const PalletsQueries = () => { if (useApi) { return await fetchFromApi( formValues, - `/pallets/${getEndpoint(formValues)}` + `/pallets/${getEndpoint(formValues)}`, ); } else { return submitUsingSdk(formValues); diff --git a/apps/playground/src/hooks/useCurrencyOptions.ts b/apps/playground/src/hooks/useCurrencyOptions.ts index e13db714..3009e942 100644 --- a/apps/playground/src/hooks/useCurrencyOptions.ts +++ b/apps/playground/src/hooks/useCurrencyOptions.ts @@ -1,13 +1,10 @@ -import { - getSupportedAssets, - TAsset, - TNodeWithRelayChains, -} from "@paraspell/sdk"; +import type { TAsset, TNodeWithRelayChains } from "@paraspell/sdk"; +import { getSupportedAssets } from "@paraspell/sdk"; import { useMemo } from "react"; const useCurrencyOptions = ( from: TNodeWithRelayChains, - to: TNodeWithRelayChains + to: TNodeWithRelayChains, ) => { const isNotParaToPara = from === "Polkadot" || @@ -17,7 +14,7 @@ const useCurrencyOptions = ( const supportedAssets = useMemo( () => getSupportedAssets(from, to), - [from, to] + [from, to], ); const currencyMap = useMemo( @@ -27,7 +24,7 @@ const useCurrencyOptions = ( map[key] = asset; return map; }, {}), - [supportedAssets] + [supportedAssets], ); const currencyOptions = useMemo( @@ -36,7 +33,7 @@ const useCurrencyOptions = ( value: key, label: `${currencyMap[key].symbol} - ${currencyMap[key].assetId ?? "Native"}`, })), - [currencyMap] + [currencyMap], ); return { currencyOptions, isNotParaToPara, currencyMap }; diff --git a/apps/playground/src/hooks/useRouterCurrencyOptions.ts b/apps/playground/src/hooks/useRouterCurrencyOptions.ts index 8aac919a..93c9bd82 100644 --- a/apps/playground/src/hooks/useRouterCurrencyOptions.ts +++ b/apps/playground/src/hooks/useRouterCurrencyOptions.ts @@ -1,25 +1,24 @@ -import { TAsset, TNodeWithRelayChains } from "@paraspell/sdk"; +import type { TAsset, TNodeWithRelayChains } from "@paraspell/sdk"; import { useMemo } from "react"; +import type { TAutoSelect, TExchangeNode } from "@paraspell/xcm-router"; import { getSupportedAssetsFrom, getSupportedAssetsTo, - TAutoSelect, - TExchangeNode, } from "@paraspell/xcm-router"; const useRouterCurrencyOptions = ( from: TNodeWithRelayChains, exchangeNode: TExchangeNode | TAutoSelect, - to: TNodeWithRelayChains + to: TNodeWithRelayChains, ) => { const supportedAssetsFrom = useMemo( () => getSupportedAssetsFrom(from, exchangeNode), - [from, exchangeNode] + [from, exchangeNode], ); const supportedAssetsTo = useMemo( () => getSupportedAssetsTo(from, exchangeNode, to), - [exchangeNode, to] + [exchangeNode, to], ); const currencyFromMap = useMemo( @@ -29,7 +28,7 @@ const useRouterCurrencyOptions = ( map[key] = asset; return map; }, {}), - [supportedAssetsFrom] + [supportedAssetsFrom], ); const currencyToMap = useMemo( @@ -39,7 +38,7 @@ const useRouterCurrencyOptions = ( map[key] = asset; return map; }, {}), - [supportedAssetsTo] + [supportedAssetsTo], ); const currencyFromOptions = useMemo( @@ -48,7 +47,7 @@ const useRouterCurrencyOptions = ( value: key, label: `${currencyFromMap[key].symbol} - ${currencyFromMap[key].assetId ?? "Native"}`, })), - [currencyFromMap] + [currencyFromMap], ); const currencyToOptions = useMemo( @@ -57,7 +56,7 @@ const useRouterCurrencyOptions = ( value: key, label: `${currencyToMap[key].symbol} - ${currencyToMap[key].assetId ?? "Native"}`, })), - [currencyToMap] + [currencyToMap], ); const isFromNotParaToPara = from === "Polkadot" || from === "Kusama"; diff --git a/apps/playground/src/main.tsx b/apps/playground/src/main.tsx index 328c62f5..baa24754 100644 --- a/apps/playground/src/main.tsx +++ b/apps/playground/src/main.tsx @@ -8,5 +8,5 @@ ReactDOM.createRoot(document.getElementById("root")!).render( - + , ); diff --git a/apps/playground/src/providers/ThemeContext.ts b/apps/playground/src/providers/ThemeContext.ts index 9f260b02..33b86ca3 100644 --- a/apps/playground/src/providers/ThemeContext.ts +++ b/apps/playground/src/providers/ThemeContext.ts @@ -1,4 +1,4 @@ -import { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; +import type { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; import { createContext } from "react"; interface WalletState { diff --git a/apps/playground/src/providers/WalletProvider.tsx b/apps/playground/src/providers/WalletProvider.tsx index 5d63bb67..3c801eb5 100644 --- a/apps/playground/src/providers/WalletProvider.tsx +++ b/apps/playground/src/providers/WalletProvider.tsx @@ -1,6 +1,7 @@ import { web3Enable } from "@polkadot/extension-dapp"; -import { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; -import { PropsWithChildren, useEffect, useState } from "react"; +import type { InjectedAccountWithMeta } from "@polkadot/extension-inject/types"; +import type { PropsWithChildren } from "react"; +import { useEffect, useState } from "react"; import { ThemeContext } from "./ThemeContext"; const STORAGE_KEY = "walletState"; diff --git a/apps/playground/src/routes/RouterTransferPage.tsx b/apps/playground/src/routes/RouterTransferPage.tsx index 74c7465e..07793f45 100644 --- a/apps/playground/src/routes/RouterTransferPage.tsx +++ b/apps/playground/src/routes/RouterTransferPage.tsx @@ -7,36 +7,38 @@ import { Group, Center, } from "@mantine/core"; -import { - TransactionType, +import type { TTxProgressInfo, TExchangeNode, - TransactionStatus, - RouterBuilder, TExtrinsicInfo, TEthOptionsInfo, } from "@paraspell/xcm-router"; +import { + TransactionType, + TransactionStatus, + RouterBuilder, +} from "@paraspell/xcm-router"; import { web3FromAddress } from "@polkadot/extension-dapp"; import { useDisclosure, useScrollIntoView } from "@mantine/hooks"; import { useEffect, useState } from "react"; -import RouterTransferForm, { - FormValuesTransformed, -} from "../components/RouterTransferForm"; +import type { FormValuesTransformed } from "../components/RouterTransferForm"; +import RouterTransferForm from "../components/RouterTransferForm"; import TransferStepper from "../components/TransferStepper"; import Confetti from "react-confetti"; -import { Signer } from "@polkadot/api/types"; +import type { Signer } from "@polkadot/api/types"; import axios, { AxiosError } from "axios"; import { buildTx, submitTransaction } from "../utils"; import ErrorAlert from "../components/ErrorAlert"; import { useWallet } from "../hooks/useWallet"; import { API_URL } from "../consts"; -import { BrowserProvider, ethers, LogDescription } from "ethers"; +import type { BrowserProvider, LogDescription } from "ethers"; +import { ethers } from "ethers"; import { IGateway__factory } from "@snowbridge/contract-types"; -import { MultiAddressStruct } from "@snowbridge/contract-types/dist/IGateway"; +import type { MultiAddressStruct } from "@snowbridge/contract-types/dist/IGateway"; import { u8aToHex } from "@polkadot/util"; import { decodeAddress } from "@polkadot/keyring"; import { ApiPromise, WsProvider } from "@polkadot/api"; -import { TSerializedApiCall } from "@paraspell/sdk"; +import type { TSerializedApiCall } from "@paraspell/sdk"; const RouterTransferPage = () => { const { selectedAccount } = useWallet(); @@ -90,7 +92,7 @@ const RouterTransferPage = () => { formValues: FormValuesTransformed, exchange: TExchangeNode | undefined, injectorAddress: string, - signer: Signer + signer: Signer, ) => { const { from, @@ -118,12 +120,12 @@ const RouterTransferPage = () => { .currencyFrom( currencyFrom.assetId ? { id: currencyFrom.assetId } - : { symbol: currencyFrom.symbol ?? "" } + : { symbol: currencyFrom.symbol ?? "" }, ) .currencyTo( currencyTo.assetId ? { id: currencyTo.assetId } - : { symbol: currencyTo.symbol ?? "" } + : { symbol: currencyTo.symbol ?? "" }, ) .amount(amount) .injectorAddress(injectorAddress) @@ -143,7 +145,7 @@ const RouterTransferPage = () => { formValues: FormValuesTransformed, exchange: TExchangeNode | undefined, injectorAddress: string, - signer: Signer + signer: Signer, ) => { const { currencyFrom, currencyTo, transactionType } = formValues; try { @@ -163,7 +165,7 @@ const RouterTransferPage = () => { }, { timeout: 120000, - } + }, ); const txs = (await response.data) as Array< @@ -187,14 +189,14 @@ const RouterTransferPage = () => { api, buildTx(api, txInfo.tx as unknown as TSerializedApiCall), formValues.evmSigner ?? signer, - formValues.evmInjectorAddress ?? injectorAddress + formValues.evmInjectorAddress ?? injectorAddress, ); } else { await submitTransaction( api, buildTx(api, txInfo.tx as unknown as TSerializedApiCall), signer, - injectorAddress + injectorAddress, ); } } else { @@ -210,7 +212,7 @@ const RouterTransferPage = () => { const contract = IGateway__factory.connect( GATEWAY_CONTRACT, - tempSigner + tempSigner, ); const abi = ethers.AbiCoder.defaultAbiCoder(); @@ -218,7 +220,7 @@ const RouterTransferPage = () => { const address: MultiAddressStruct = { data: abi.encode( ["bytes32"], - [u8aToHex(decodeAddress(formValues.assetHubAddress))] + [u8aToHex(decodeAddress(formValues.assetHubAddress))], ), kind: 1, }; @@ -235,7 +237,7 @@ const RouterTransferPage = () => { apiResponse.amount, { value: apiResponse.fee, - } + }, ); const receipt = await response.wait(1); @@ -326,14 +328,14 @@ const RouterTransferPage = () => { formValues, exchange, selectedAccount.address, - injector.signer + injector.signer, ); } else { await submitUsingRouterModule( formValues, exchange, selectedAccount.address, - injector.signer + injector.signer, ); } setRunConfetti(true); diff --git a/apps/playground/src/routes/XcmAnalyserSandbox.tsx b/apps/playground/src/routes/XcmAnalyserSandbox.tsx index 6db4b51d..ed468587 100644 --- a/apps/playground/src/routes/XcmAnalyserSandbox.tsx +++ b/apps/playground/src/routes/XcmAnalyserSandbox.tsx @@ -3,7 +3,8 @@ import { useDisclosure, useScrollIntoView } from "@mantine/hooks"; import { useEffect, useState } from "react"; import ErrorAlert from "../components/ErrorAlert"; import OutputAlert from "../components/OutputAlert"; -import AnalyserForm, { FormValues } from "../components/analyser/AnalyserForm"; +import type { FormValues } from "../components/analyser/AnalyserForm"; +import AnalyserForm from "../components/analyser/AnalyserForm"; import { convertMultilocationToUrlJson } from "@paraspell/xcm-analyser"; const XcmAnalyserSandbox = () => { diff --git a/apps/playground/src/theme/themeConfig.ts b/apps/playground/src/theme/themeConfig.ts index dbd506d5..81181d4f 100644 --- a/apps/playground/src/theme/themeConfig.ts +++ b/apps/playground/src/theme/themeConfig.ts @@ -1,4 +1,5 @@ -import { createTheme, MantineColorsTuple } from "@mantine/core"; +import type { MantineColorsTuple } from "@mantine/core"; +import { createTheme } from "@mantine/core"; const themePalette: MantineColorsTuple = [ "#ffe9f6", diff --git a/apps/playground/src/types.ts b/apps/playground/src/types.ts index 014ac6a5..062049df 100644 --- a/apps/playground/src/types.ts +++ b/apps/playground/src/types.ts @@ -1,4 +1,4 @@ -import { ASSET_QUERIES, PALLETS_QUERIES } from "./consts"; +import type { ASSET_QUERIES, PALLETS_QUERIES } from "./consts"; export type TAssetsQuery = (typeof ASSET_QUERIES)[number]; diff --git a/apps/playground/src/utils.ts b/apps/playground/src/utils.ts index 5aaa2bc5..a87f49f6 100644 --- a/apps/playground/src/utils.ts +++ b/apps/playground/src/utils.ts @@ -1,6 +1,6 @@ -import { Extrinsic, TSerializedApiCall } from "@paraspell/sdk"; -import { ApiPromise } from "@polkadot/api"; -import { Signer } from "@polkadot/api/types"; +import type { Extrinsic, TSerializedApiCall } from "@paraspell/sdk"; +import type { ApiPromise } from "@polkadot/api"; +import type { Signer } from "@polkadot/api/types"; import { encodeAddress, decodeAddress } from "@polkadot/keyring"; import { isHex, hexToU8a } from "@polkadot/util"; import { isAddress } from "web3-validator"; @@ -23,7 +23,7 @@ export const submitTransaction = async ( api: ApiPromise, tx: Extrinsic, signer: Signer, - injectorAddress: string + injectorAddress: string, ): Promise => { await tx.signAsync(injectorAddress, { signer }); return await new Promise((resolve, reject) => { @@ -50,7 +50,7 @@ export const submitTransaction = async ( export const buildTx = ( api: ApiPromise, - { module, section, parameters }: TSerializedApiCall + { module, section, parameters }: TSerializedApiCall, ) => { return api.tx[module][section](...parameters); }; diff --git a/apps/playground/src/utils/replaceBigInt.ts b/apps/playground/src/utils/replaceBigInt.ts index 1de40dc3..70115bd8 100644 --- a/apps/playground/src/utils/replaceBigInt.ts +++ b/apps/playground/src/utils/replaceBigInt.ts @@ -1,2 +1,2 @@ export const replaceBigInt = (_key: string, value: unknown) => - typeof value === 'bigint' ? value.toString() : value; + typeof value === "bigint" ? value.toString() : value; diff --git a/apps/playground/src/utils/submitUsingApi.ts b/apps/playground/src/utils/submitUsingApi.ts index 0a4b7559..dc1c8196 100644 --- a/apps/playground/src/utils/submitUsingApi.ts +++ b/apps/playground/src/utils/submitUsingApi.ts @@ -1,18 +1,15 @@ -import { Signer } from "@polkadot/api/types"; +import type { Signer } from "@polkadot/api/types"; import { API_URL } from "../consts"; import axios, { AxiosError } from "axios"; -import { - TNodeWithRelayChains, - TSerializedApiCall, - createApiInstanceForNode, -} from "@paraspell/sdk"; +import type { TNodeWithRelayChains, TSerializedApiCall } from "@paraspell/sdk"; +import { createApiInstanceForNode } from "@paraspell/sdk"; import { buildTx, submitTransaction } from "../utils"; export const fetchFromApi = async ( params: T, endpoint: string, method = "GET", - useBody: boolean = false + useBody: boolean = false, ): Promise => { try { const response = await axios(`${API_URL}${endpoint}`, { @@ -52,19 +49,19 @@ export const submitTxUsingApi = async ( injectorAddress: string, signer: Signer, method: string = "GET", - useBody = false + useBody = false, ) => { const serializedTx = await fetchFromApi( { ...params, injectorAddress }, endpoint, method, - useBody + useBody, ); const api = await createApiInstanceForNode(fromNode); await submitTransaction( api, buildTx(api, serializedTx as TSerializedApiCall), signer, - injectorAddress + injectorAddress, ); }; diff --git a/apps/playground/src/vite-env.d.ts b/apps/playground/src/vite-env.d.ts index 03be78e0..f00fa463 100644 --- a/apps/playground/src/vite-env.d.ts +++ b/apps/playground/src/vite-env.d.ts @@ -1,6 +1,6 @@ /// -import { MetaMaskInpageProvider } from "@metamask/providers"; +import type { MetaMaskInpageProvider } from "@metamask/providers"; declare global { interface Window { diff --git a/apps/site/package.json b/apps/site/package.json index 79fb21ac..eeb17202 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -8,7 +8,9 @@ "build": "tsc && vite build", "preview": "vite preview", "lint:check": "eslint .", - "lint": "eslint --fix ." + "lint": "eslint --fix .", + "format:check": "prettier --check src", + "format:write": "prettier --write src" }, "dependencies": { "@mantine/code-highlight": "^7.13.1", diff --git a/apps/site/src/App.tsx b/apps/site/src/App.tsx index 13df0b21..9ff23817 100644 --- a/apps/site/src/App.tsx +++ b/apps/site/src/App.tsx @@ -1,11 +1,8 @@ import "@mantine/core/styles.css"; import "@mantine/code-highlight/styles.css"; import "./App.css"; -import { - MantineProvider, - createTheme, - MantineColorsTuple, -} from "@mantine/core"; +import type { MantineColorsTuple } from "@mantine/core"; +import { MantineProvider, createTheme } from "@mantine/core"; import { BrowserRouter } from "react-router-dom"; import ScrollToAnchor from "./components/ScrollToAnchor"; import AppShell from "./components/AppShell/AppShell"; diff --git a/apps/site/src/components/AppShell/Header.tsx b/apps/site/src/components/AppShell/Header.tsx index f009d090..36d188cd 100644 --- a/apps/site/src/components/AppShell/Header.tsx +++ b/apps/site/src/components/AppShell/Header.tsx @@ -1,4 +1,4 @@ -import { FC } from "react"; +import type { FC } from "react"; import { Container, Group, diff --git a/apps/site/src/components/ArticleCard/ArticleCard.tsx b/apps/site/src/components/ArticleCard/ArticleCard.tsx index 3c3eb40c..8cf87d15 100644 --- a/apps/site/src/components/ArticleCard/ArticleCard.tsx +++ b/apps/site/src/components/ArticleCard/ArticleCard.tsx @@ -1,6 +1,6 @@ import { Card, Image, Avatar, Text, Group, Flex } from "@mantine/core"; import classes from "./ArticleCard.module.css"; -import { FC } from "react"; +import type { FC } from "react"; type Props = { title: string; diff --git a/apps/site/src/components/AudioPlayer.tsx b/apps/site/src/components/AudioPlayer.tsx index 30486cf2..1023aeaf 100644 --- a/apps/site/src/components/AudioPlayer.tsx +++ b/apps/site/src/components/AudioPlayer.tsx @@ -1,4 +1,5 @@ -import { useRef, useState, useEffect, FC } from "react"; +import type { FC } from "react"; +import { useRef, useState, useEffect } from "react"; import { ActionIcon, Slider, Group, Text } from "@mantine/core"; import { IconPlayerPlay, IconPlayerPause } from "@tabler/icons-react"; diff --git a/apps/site/src/components/CodeHighlightDark/CodeHighlightDark.tsx b/apps/site/src/components/CodeHighlightDark/CodeHighlightDark.tsx index 4331e999..7f8ceebf 100644 --- a/apps/site/src/components/CodeHighlightDark/CodeHighlightDark.tsx +++ b/apps/site/src/components/CodeHighlightDark/CodeHighlightDark.tsx @@ -1,5 +1,6 @@ -import { CodeHighlight, CodeHighlightProps } from "@mantine/code-highlight"; -import { FC } from "react"; +import type { CodeHighlightProps } from "@mantine/code-highlight"; +import { CodeHighlight } from "@mantine/code-highlight"; +import type { FC } from "react"; const CodeHighlightDark: FC = (props) => { const { style } = props; diff --git a/apps/site/src/components/Hero/Hero.tsx b/apps/site/src/components/Hero/Hero.tsx index 93b2b7c2..7e8f1ec2 100644 --- a/apps/site/src/components/Hero/Hero.tsx +++ b/apps/site/src/components/Hero/Hero.tsx @@ -53,12 +53,12 @@ export const Hero = () => { // Schedule next sparkle const nextInterval = Math.random() * (5000 - 2000) + 2000; // Random between 2s and 5s - timeoutId = setTimeout(triggerSparkle, nextInterval); + timeoutId = window.setTimeout(triggerSparkle, nextInterval); } }; // Start the sparkle sequence - timeoutId = setTimeout(triggerSparkle, 1000); // Initial delay of 1s + timeoutId = window.setTimeout(triggerSparkle, 1000); // Initial delay of 1s return () => clearTimeout(timeoutId); }, [logoDimensions]); diff --git a/apps/site/src/components/NotFound/Illustration.tsx b/apps/site/src/components/NotFound/Illustration.tsx index 03511d8c..e95ccfb6 100644 --- a/apps/site/src/components/NotFound/Illustration.tsx +++ b/apps/site/src/components/NotFound/Illustration.tsx @@ -1,4 +1,4 @@ -const Illustration = (props: React.ComponentPropsWithoutRef<'svg'>) => { +const Illustration = (props: React.ComponentPropsWithoutRef<"svg">) => { return ( { const { pathname } = useLocation(); diff --git a/apps/site/src/components/StickyBar.tsx b/apps/site/src/components/StickyBar.tsx index bf1993b4..6f3605d9 100644 --- a/apps/site/src/components/StickyBar.tsx +++ b/apps/site/src/components/StickyBar.tsx @@ -1,6 +1,6 @@ import { ActionIcon, Flex, Group, Text, Tooltip } from "@mantine/core"; import AudioPlayer from "./AudioPlayer"; -import { FC } from "react"; +import type { FC } from "react"; import { IconInfoCircle, IconX } from "@tabler/icons-react"; const complianceStatement = ` diff --git a/apps/site/src/main.tsx b/apps/site/src/main.tsx index f46c379c..38549296 100644 --- a/apps/site/src/main.tsx +++ b/apps/site/src/main.tsx @@ -5,5 +5,5 @@ import App from "./App"; ReactDOM.createRoot(document.getElementById("root")!).render( - + , ); diff --git a/apps/site/src/routes/NotFoundPage.tsx b/apps/site/src/routes/NotFoundPage.tsx index b0327f78..281e62fc 100644 --- a/apps/site/src/routes/NotFoundPage.tsx +++ b/apps/site/src/routes/NotFoundPage.tsx @@ -1,4 +1,4 @@ -import NotFound from '../components/NotFound/NotFound'; +import NotFound from "../components/NotFound/NotFound"; const NotFoundPage = () => ; diff --git a/apps/visualizator-be/package.json b/apps/visualizator-be/package.json index 9b0c468d..8f610b1e 100644 --- a/apps/visualizator-be/package.json +++ b/apps/visualizator-be/package.json @@ -46,7 +46,6 @@ "@types/express": "^5.0.0", "@types/jest": "^29.5.13", "@types/jsdom": "^21.1.7", - "@types/node": "^22.7.4", "@types/supertest": "^6.0.2", "jest": "^29.7.0", "prettier": "^3.3.3", diff --git a/apps/visualizator-be/src/channels/channels.service.test.ts b/apps/visualizator-be/src/channels/channels.service.test.ts index 274cf7be..f5d7187d 100644 --- a/apps/visualizator-be/src/channels/channels.service.test.ts +++ b/apps/visualizator-be/src/channels/channels.service.test.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { Repository } from 'typeorm'; +import type { Repository } from 'typeorm'; import { Channel } from './channel.entity'; import { ChannelService } from './channels.service'; diff --git a/apps/visualizator-be/src/messages/messages.module.test.ts b/apps/visualizator-be/src/messages/messages.module.test.ts index 13186906..9d9a029a 100644 --- a/apps/visualizator-be/src/messages/messages.module.test.ts +++ b/apps/visualizator-be/src/messages/messages.module.test.ts @@ -1,4 +1,5 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; import { MessageService } from './messages.service'; import { MessageResolver } from './messages.resolver'; diff --git a/apps/visualizator-be/src/messages/messages.service.test.ts b/apps/visualizator-be/src/messages/messages.service.test.ts index 7dfb36a2..6526931e 100644 --- a/apps/visualizator-be/src/messages/messages.service.test.ts +++ b/apps/visualizator-be/src/messages/messages.service.test.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; -import { Repository } from 'typeorm'; +import type { Repository } from 'typeorm'; import { Message } from './message.entity'; import { MessageService } from './messages.service'; import { CountOption } from './count-option'; diff --git a/apps/visualizator-fe/package.json b/apps/visualizator-fe/package.json index 6aef8ab0..2c4c2277 100644 --- a/apps/visualizator-fe/package.json +++ b/apps/visualizator-fe/package.json @@ -52,7 +52,6 @@ }, "devDependencies": { "@types/d3-ease": "^3.0.2", - "@types/node": "^22.7.4", "@types/react": "^18.3.10", "@types/react-dom": "^18.3.0", "@types/three": "^0.169.0", diff --git a/apps/visualizator-fe/src/components/AccountsAmountPlot/AccountsAmountPlot.container.tsx b/apps/visualizator-fe/src/components/AccountsAmountPlot/AccountsAmountPlot.container.tsx index 6f464ebb..f211b294 100644 --- a/apps/visualizator-fe/src/components/AccountsAmountPlot/AccountsAmountPlot.container.tsx +++ b/apps/visualizator-fe/src/components/AccountsAmountPlot/AccountsAmountPlot.container.tsx @@ -8,9 +8,9 @@ import { useTranslation } from 'react-i18next'; import { Ecosystem } from '../../types/types'; import { Center, Flex, Group, Loader, Stack } from '@mantine/core'; import SliderInput from '../SliderInput'; -import { HighchartsReactRefObject } from 'highcharts-react-official'; +import type { HighchartsReactRefObject } from 'highcharts-react-official'; import DownloadButtons from '../DownloadButtons'; -import { AccountCountsQuery } from '../../gql/graphql'; +import type { AccountCountsQuery } from '../../gql/graphql'; import convertToCsv from '../../utils/convertToCsv'; import { downloadZip } from '../../utils/downloadZip'; import downloadSvg from '../../utils/downloadSvg'; diff --git a/apps/visualizator-fe/src/components/AccountsAmountPlot/AccountsAmountPlot.tsx b/apps/visualizator-fe/src/components/AccountsAmountPlot/AccountsAmountPlot.tsx index f90cb2bd..d487447a 100644 --- a/apps/visualizator-fe/src/components/AccountsAmountPlot/AccountsAmountPlot.tsx +++ b/apps/visualizator-fe/src/components/AccountsAmountPlot/AccountsAmountPlot.tsx @@ -1,10 +1,11 @@ import { forwardRef } from 'react'; -import { AccountCountsQuery } from '../../gql/graphql'; +import type { AccountCountsQuery } from '../../gql/graphql'; import Highcharts from 'highcharts'; -import HighchartsReact, { HighchartsReactRefObject } from 'highcharts-react-official'; +import type { HighchartsReactRefObject } from 'highcharts-react-official'; +import HighchartsReact from 'highcharts-react-official'; import HC_more from 'highcharts/highcharts-more'; import { useTranslation } from 'react-i18next'; -import { ChartDataItem, CustomPoint } from '../../types/types'; +import type { ChartDataItem, CustomPoint } from '../../types/types'; import { encodeAddress } from '@polkadot/keyring'; HC_more(Highcharts); diff --git a/apps/visualizator-fe/src/components/AmountTransferedPlot/AmountTransferedPlot.container.tsx b/apps/visualizator-fe/src/components/AmountTransferedPlot/AmountTransferedPlot.container.tsx index ea360b03..43a7854a 100644 --- a/apps/visualizator-fe/src/components/AmountTransferedPlot/AmountTransferedPlot.container.tsx +++ b/apps/visualizator-fe/src/components/AmountTransferedPlot/AmountTransferedPlot.container.tsx @@ -10,7 +10,7 @@ import { Center, Checkbox, Group, Loader, Stack, Title, Tooltip } from '@mantine import { IconInfoCircle } from '@tabler/icons-react'; import DownloadButtons from '../DownloadButtons'; import downloadSvg from '../../utils/downloadSvg'; -import { MessageCountsByDayQuery } from '../../gql/graphql'; +import type { MessageCountsByDayQuery } from '../../gql/graphql'; import convertToCsv from '../../utils/convertToCsv'; import { downloadZip } from '../../utils/downloadZip'; diff --git a/apps/visualizator-fe/src/components/AmountTransferedPlot/AmountTransferedPlot.tsx b/apps/visualizator-fe/src/components/AmountTransferedPlot/AmountTransferedPlot.tsx index 2f088539..a6caf54e 100644 --- a/apps/visualizator-fe/src/components/AmountTransferedPlot/AmountTransferedPlot.tsx +++ b/apps/visualizator-fe/src/components/AmountTransferedPlot/AmountTransferedPlot.tsx @@ -1,6 +1,7 @@ -import { forwardRef, ReactNode, useState } from 'react'; +import type { ReactNode } from 'react'; +import { forwardRef, useState } from 'react'; import { LineChart } from '@mantine/charts'; -import { MessageCountsByDayQuery } from '../../gql/graphql'; +import type { MessageCountsByDayQuery } from '../../gql/graphql'; import { getParachainById, getParachainColor } from '../../utils/utils'; import { useTranslation } from 'react-i18next'; import { Ecosystem } from '../../types/types'; diff --git a/apps/visualizator-fe/src/components/AmountTransferedPlot/CustomChartTooltip/CustomChartTooltip.tsx b/apps/visualizator-fe/src/components/AmountTransferedPlot/CustomChartTooltip/CustomChartTooltip.tsx index 43a743dc..98d707a0 100644 --- a/apps/visualizator-fe/src/components/AmountTransferedPlot/CustomChartTooltip/CustomChartTooltip.tsx +++ b/apps/visualizator-fe/src/components/AmountTransferedPlot/CustomChartTooltip/CustomChartTooltip.tsx @@ -4,13 +4,13 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-explicit-any */ +import type { Factory } from '@mantine/core'; import { ActionIcon, Anchor, Box, ColorSwatch, factory, - Factory, getThemeColor, Group, useMantineTheme, @@ -18,13 +18,13 @@ import { useStyles } from '@mantine/core'; import classes from './CustomChartTooltip.module.css'; -import { ChartSeries, ChartTooltipProps } from '@mantine/charts'; +import type { ChartSeries, ChartTooltipProps } from '@mantine/charts'; import { useTranslation } from 'react-i18next'; import { getParachainId } from '../../../utils/utils'; import { Ecosystem } from '../../../types/types'; import dayjs from 'dayjs'; import { IconX } from '@tabler/icons-react'; -import { MouseEvent } from 'react'; +import type { MouseEvent } from 'react'; type ChartSeriesLabels = Record; diff --git a/apps/visualizator-fe/src/components/AssetsTransferedPlot/AssetsTransferedPlot.container.tsx b/apps/visualizator-fe/src/components/AssetsTransferedPlot/AssetsTransferedPlot.container.tsx index 37e04a3f..f0752de8 100644 --- a/apps/visualizator-fe/src/components/AssetsTransferedPlot/AssetsTransferedPlot.container.tsx +++ b/apps/visualizator-fe/src/components/AssetsTransferedPlot/AssetsTransferedPlot.container.tsx @@ -9,7 +9,7 @@ import { Ecosystem } from '../../types/types'; import { Center, Group, Loader, Stack, Title } from '@mantine/core'; import downloadSvg from '../../utils/downloadSvg'; import DownloadButtons from '../DownloadButtons'; -import { AssetCountsBySymbolQuery } from '../../gql/graphql'; +import type { AssetCountsBySymbolQuery } from '../../gql/graphql'; import convertToCsv from '../../utils/convertToCsv'; import { downloadZip } from '../../utils/downloadZip'; diff --git a/apps/visualizator-fe/src/components/AssetsTransferedPlot/AssetsTransferedPlot.tsx b/apps/visualizator-fe/src/components/AssetsTransferedPlot/AssetsTransferedPlot.tsx index c144e068..e02e5583 100644 --- a/apps/visualizator-fe/src/components/AssetsTransferedPlot/AssetsTransferedPlot.tsx +++ b/apps/visualizator-fe/src/components/AssetsTransferedPlot/AssetsTransferedPlot.tsx @@ -1,6 +1,7 @@ -import { forwardRef, ReactNode, useMemo } from 'react'; +import type { ReactNode } from 'react'; +import { forwardRef, useMemo } from 'react'; import { aggregateDataByParachain } from './utils/aggregateDataByParachain'; -import { TAssetCounts } from '../../types/types'; +import type { TAssetCounts } from '../../types/types'; import { useTranslation } from 'react-i18next'; import { generateSeries } from './utils/generateSeries'; import { BarChart } from '@mantine/charts'; diff --git a/apps/visualizator-fe/src/components/AssetsTransferedPlot/CustomChartTooltip/CustomChartTooltip.tsx b/apps/visualizator-fe/src/components/AssetsTransferedPlot/CustomChartTooltip/CustomChartTooltip.tsx index dfc1e499..3a18f1fe 100644 --- a/apps/visualizator-fe/src/components/AssetsTransferedPlot/CustomChartTooltip/CustomChartTooltip.tsx +++ b/apps/visualizator-fe/src/components/AssetsTransferedPlot/CustomChartTooltip/CustomChartTooltip.tsx @@ -4,12 +4,12 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-explicit-any */ +import type { Factory } from '@mantine/core'; import { Anchor, Box, ColorSwatch, factory, - Factory, getThemeColor, Image, useMantineTheme, @@ -17,7 +17,7 @@ import { useStyles } from '@mantine/core'; import classes from './CustomChartTooltip.module.css'; -import { ChartSeries, ChartTooltipProps } from '@mantine/charts'; +import type { ChartSeries, ChartTooltipProps } from '@mantine/charts'; import { getParachainId } from '../../../utils/utils'; import { Ecosystem } from '../../../types/types'; import dayjs from 'dayjs'; diff --git a/apps/visualizator-fe/src/components/AssetsTransferedPlot/utils/aggregateDataByParachain.ts b/apps/visualizator-fe/src/components/AssetsTransferedPlot/utils/aggregateDataByParachain.ts index b0c78a31..0c7f7c02 100644 --- a/apps/visualizator-fe/src/components/AssetsTransferedPlot/utils/aggregateDataByParachain.ts +++ b/apps/visualizator-fe/src/components/AssetsTransferedPlot/utils/aggregateDataByParachain.ts @@ -1,5 +1,6 @@ -import { TFunction } from 'i18next'; -import { TAssetCounts, TAggregatedData, Ecosystem } from '../../../types/types'; +import type { TFunction } from 'i18next'; +import type { TAssetCounts, TAggregatedData } from '../../../types/types'; +import { Ecosystem } from '../../../types/types'; import { getParachainById } from '../../../utils/utils'; export const aggregateDataByParachain = (counts: TAssetCounts, t: TFunction): TAggregatedData[] => { diff --git a/apps/visualizator-fe/src/components/AssetsTransferedPlot/utils/generateSeries.ts b/apps/visualizator-fe/src/components/AssetsTransferedPlot/utils/generateSeries.ts index f4b60ade..0c5f9b8c 100644 --- a/apps/visualizator-fe/src/components/AssetsTransferedPlot/utils/generateSeries.ts +++ b/apps/visualizator-fe/src/components/AssetsTransferedPlot/utils/generateSeries.ts @@ -1,5 +1,5 @@ -import { BarChartSeries } from '@mantine/charts'; -import { TAssetCounts } from '../../../types/types'; +import type { BarChartSeries } from '@mantine/charts'; +import type { TAssetCounts } from '../../../types/types'; import { colorPallete } from '../color-pallete'; export const generateSeries = (counts: TAssetCounts): BarChartSeries[] => { diff --git a/apps/visualizator-fe/src/components/Canvas3D.tsx b/apps/visualizator-fe/src/components/Canvas3D.tsx index 4753973a..6fd840d1 100644 --- a/apps/visualizator-fe/src/components/Canvas3D.tsx +++ b/apps/visualizator-fe/src/components/Canvas3D.tsx @@ -1,5 +1,5 @@ import { Canvas } from '@react-three/fiber'; -import { FC, ReactNode } from 'react'; +import type { FC, ReactNode } from 'react'; import { PCFSoftShadowMap } from 'three'; type Props = { diff --git a/apps/visualizator-fe/src/components/ChannelInfo/ChannelAlert.container.tsx b/apps/visualizator-fe/src/components/ChannelInfo/ChannelAlert.container.tsx index 2e9ec444..ccba3752 100644 --- a/apps/visualizator-fe/src/components/ChannelInfo/ChannelAlert.container.tsx +++ b/apps/visualizator-fe/src/components/ChannelInfo/ChannelAlert.container.tsx @@ -1,10 +1,11 @@ import { channelQueryDocument } from '../../api/channels'; import ChannelAlert from './ChannelAlert'; import { useSelectedParachain } from '../../context/SelectedParachain/useSelectedParachain'; -import { FC, useEffect } from 'react'; +import type { FC } from 'react'; +import { useEffect } from 'react'; import { useQuery } from '@apollo/client'; import { useTranslation } from 'react-i18next'; -import { ChannelsQuery } from '../../gql/graphql'; +import type { ChannelsQuery } from '../../gql/graphql'; type Props = { selectedChannel: ChannelsQuery['channels'][number]; diff --git a/apps/visualizator-fe/src/components/ChannelInfo/ChannelAlert.tsx b/apps/visualizator-fe/src/components/ChannelInfo/ChannelAlert.tsx index 3731504e..96a1207a 100644 --- a/apps/visualizator-fe/src/components/ChannelInfo/ChannelAlert.tsx +++ b/apps/visualizator-fe/src/components/ChannelInfo/ChannelAlert.tsx @@ -11,8 +11,9 @@ import { Stack, Text } from '@mantine/core'; -import { ChannelQuery } from '../../gql/graphql'; -import { FC, useState } from 'react'; +import type { ChannelQuery } from '../../gql/graphql'; +import type { FC } from 'react'; +import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { IconArrowLeft, IconArrowRight } from '@tabler/icons-react'; import { getParachainById } from '../../utils/utils'; diff --git a/apps/visualizator-fe/src/components/CollapseButton.tsx b/apps/visualizator-fe/src/components/CollapseButton.tsx index 4ad94690..7952541a 100644 --- a/apps/visualizator-fe/src/components/CollapseButton.tsx +++ b/apps/visualizator-fe/src/components/CollapseButton.tsx @@ -1,6 +1,6 @@ import { ActionIcon } from '@mantine/core'; import { IconChevronLeft, IconChevronRight } from '@tabler/icons-react'; -import { FC } from 'react'; +import type { FC } from 'react'; type Props = { onClick: () => void; diff --git a/apps/visualizator-fe/src/components/DateRangePicker.tsx b/apps/visualizator-fe/src/components/DateRangePicker.tsx index 40224707..036ef729 100644 --- a/apps/visualizator-fe/src/components/DateRangePicker.tsx +++ b/apps/visualizator-fe/src/components/DateRangePicker.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { DatePickerInput } from '@mantine/dates'; import { rem } from '@mantine/core'; import { IconCalendar } from '@tabler/icons-react'; diff --git a/apps/visualizator-fe/src/components/DownloadButtons.tsx b/apps/visualizator-fe/src/components/DownloadButtons.tsx index f7764359..86a07f6c 100644 --- a/apps/visualizator-fe/src/components/DownloadButtons.tsx +++ b/apps/visualizator-fe/src/components/DownloadButtons.tsx @@ -1,6 +1,6 @@ import { Group, ActionIcon, Tooltip } from '@mantine/core'; import { IconDownload, IconPhotoDown } from '@tabler/icons-react'; -import { FC } from 'react'; +import type { FC } from 'react'; import { useTranslation } from 'react-i18next'; type Props = { diff --git a/apps/visualizator-fe/src/components/EcosystemSelect/EcosystemSelect.tsx b/apps/visualizator-fe/src/components/EcosystemSelect/EcosystemSelect.tsx index 1598729e..94f0470c 100644 --- a/apps/visualizator-fe/src/components/EcosystemSelect/EcosystemSelect.tsx +++ b/apps/visualizator-fe/src/components/EcosystemSelect/EcosystemSelect.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { Box, Combobox, Group, Input, InputBase, useCombobox } from '@mantine/core'; import { Ecosystem } from '../../types/types'; import PolkadotLogo from '../../logos/icons/polkadot.svg?react'; diff --git a/apps/visualizator-fe/src/components/ErrorAlert.tsx b/apps/visualizator-fe/src/components/ErrorAlert.tsx index 8d610b5b..30e5eca4 100644 --- a/apps/visualizator-fe/src/components/ErrorAlert.tsx +++ b/apps/visualizator-fe/src/components/ErrorAlert.tsx @@ -1,4 +1,4 @@ -import { FC, ReactNode } from 'react'; +import type { FC, ReactNode } from 'react'; import { Alert } from '@mantine/core'; import { IconAlertCircle } from '@tabler/icons-react'; import { useTranslation } from 'react-i18next'; diff --git a/apps/visualizator-fe/src/components/LineBetween.tsx b/apps/visualizator-fe/src/components/LineBetween.tsx index f32fa010..8c9d0224 100644 --- a/apps/visualizator-fe/src/components/LineBetween.tsx +++ b/apps/visualizator-fe/src/components/LineBetween.tsx @@ -1,15 +1,10 @@ -import { FC, useRef } from 'react'; -import { - DoubleSide, - LineCurve3, - Mesh, - MeshStandardMaterial, - Object3D, - TubeGeometry, - InstancedMesh -} from 'three'; +import type { FC } from 'react'; +import { useRef } from 'react'; +import type { Mesh, MeshStandardMaterial, InstancedMesh } from 'three'; +import { DoubleSide, LineCurve3, Object3D, TubeGeometry } from 'three'; import { useSelectedParachain } from '../context/SelectedParachain/useSelectedParachain'; -import { ThreeEvent, useFrame } from '@react-three/fiber'; +import type { ThreeEvent } from '@react-three/fiber'; +import { useFrame } from '@react-three/fiber'; type Props = { startObject: Object3D | null; diff --git a/apps/visualizator-fe/src/components/LoadingScreen/LoadingScreen.tsx b/apps/visualizator-fe/src/components/LoadingScreen/LoadingScreen.tsx index 8215efc0..20bba034 100644 --- a/apps/visualizator-fe/src/components/LoadingScreen/LoadingScreen.tsx +++ b/apps/visualizator-fe/src/components/LoadingScreen/LoadingScreen.tsx @@ -1,8 +1,9 @@ import { LoadingOverlay } from '@mantine/core'; import StarsBackground from '../StarsBackground/StarsBackground'; import LogoLoader from '../LogoLoader/LogoLoader'; -import { FC, useEffect, useState } from 'react'; -import { +import type { FC } from 'react'; +import { useEffect, useState } from 'react'; +import type { NetworkStatus, UseApolloNetworkStatusOptions } from 'react-apollo-network-status/dist/src/useApolloNetworkStatus'; diff --git a/apps/visualizator-fe/src/components/Options/OptionsModal.tsx b/apps/visualizator-fe/src/components/Options/OptionsModal.tsx index e279f353..a740475d 100644 --- a/apps/visualizator-fe/src/components/Options/OptionsModal.tsx +++ b/apps/visualizator-fe/src/components/Options/OptionsModal.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { Modal, Title } from '@mantine/core'; import Options from './Options'; import { useTranslation } from 'react-i18next'; diff --git a/apps/visualizator-fe/src/components/Parachain/Parachain.tsx b/apps/visualizator-fe/src/components/Parachain/Parachain.tsx index 5eb87912..3d2e45af 100644 --- a/apps/visualizator-fe/src/components/Parachain/Parachain.tsx +++ b/apps/visualizator-fe/src/components/Parachain/Parachain.tsx @@ -1,21 +1,15 @@ import { useRef, useEffect, useState, forwardRef, useImperativeHandle } from 'react'; import { Text } from '@react-three/drei'; -import { ThreeEvent, useFrame, useLoader } from '@react-three/fiber'; -import { - Color, - Group, - Mesh, - MeshStandardMaterial, - SphereGeometry, - TextureLoader, - Vector3 -} from 'three'; +import type { ThreeEvent } from '@react-three/fiber'; +import { useFrame, useLoader } from '@react-three/fiber'; +import type { Group, Mesh, MeshStandardMaterial, SphereGeometry, Vector3 } from 'three'; +import { Color, TextureLoader } from 'three'; import { getParachainPosition } from '../ParachainsGraph/utils'; import { getLogoScaleFactor, getNodeLogo } from './utils'; import { getParachainColor } from '../../utils/utils'; import { lightenColor } from '../../utils/lightenColor'; import { adjustUVs } from '../../utils/adjustUVs'; -import { Ecosystem } from '../../types/types'; +import type { Ecosystem } from '../../types/types'; import { FONT_URL } from '../../consts/consts'; import { useSelectedParachain } from '../../context/SelectedParachain/useSelectedParachain'; import { easePoly } from 'd3-ease'; diff --git a/apps/visualizator-fe/src/components/Parachain/utils.ts b/apps/visualizator-fe/src/components/Parachain/utils.ts index 6718c60e..90ce44b7 100644 --- a/apps/visualizator-fe/src/components/Parachain/utils.ts +++ b/apps/visualizator-fe/src/components/Parachain/utils.ts @@ -39,7 +39,7 @@ import ipciPng from '../../logos/ipci.png'; import crabPng from '../../logos/crab.png'; import pioneerPng from '../../logos/pioneer.png'; import { getParachainLogo } from '../../utils/utils'; -import { Ecosystem } from '../../types/types'; +import type { Ecosystem } from '../../types/types'; export const getNodeLogo = (node: string, ecosystem: Ecosystem) => { if (node === 'Collectives') return collectivesPng; diff --git a/apps/visualizator-fe/src/components/ParachainSelector.tsx b/apps/visualizator-fe/src/components/ParachainSelector.tsx index 68c4bf7e..bf2e5c85 100644 --- a/apps/visualizator-fe/src/components/ParachainSelector.tsx +++ b/apps/visualizator-fe/src/components/ParachainSelector.tsx @@ -1,6 +1,7 @@ -import { FC } from 'react'; -import { MultiSelect, MultiSelectProps } from '@mantine/core'; -import { SelectedParachain } from '../context/SelectedParachain/SelectedParachainContext'; +import type { FC } from 'react'; +import type { MultiSelectProps } from '@mantine/core'; +import { MultiSelect } from '@mantine/core'; +import type { SelectedParachain } from '../context/SelectedParachain/SelectedParachainContext'; import { useTranslation } from 'react-i18next'; import { getNodesByEcosystem } from '../utils/utils'; import { Ecosystem } from '../types/types'; diff --git a/apps/visualizator-fe/src/components/ParachainsGraph/ParachainsGraph.container.tsx b/apps/visualizator-fe/src/components/ParachainsGraph/ParachainsGraph.container.tsx index 5c9ecf47..479137fb 100644 --- a/apps/visualizator-fe/src/components/ParachainsGraph/ParachainsGraph.container.tsx +++ b/apps/visualizator-fe/src/components/ParachainsGraph/ParachainsGraph.container.tsx @@ -1,9 +1,9 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { allChannelsQueryDocument } from '../../api/channels'; import { totalMessageCountsQueryDocument } from '../../api/messages'; import { useSelectedParachain } from '../../context/SelectedParachain/useSelectedParachain'; import { CountOption } from '../../gql/graphql'; -import { Ecosystem } from '../../types/types'; +import type { Ecosystem } from '../../types/types'; import ParachainsGraph from './ParachainsGraph'; import { useQuery } from '@apollo/client'; diff --git a/apps/visualizator-fe/src/components/ParachainsGraph/ParachainsGraph.tsx b/apps/visualizator-fe/src/components/ParachainsGraph/ParachainsGraph.tsx index 5b48c6fa..75c0ad79 100644 --- a/apps/visualizator-fe/src/components/ParachainsGraph/ParachainsGraph.tsx +++ b/apps/visualizator-fe/src/components/ParachainsGraph/ParachainsGraph.tsx @@ -1,13 +1,15 @@ -import { FC, useMemo, useRef } from 'react'; -import { ChannelsQuery, CountOption, TotalMessageCountsQuery } from '../../gql/graphql'; +import type { FC } from 'react'; +import { useMemo, useRef } from 'react'; +import type { ChannelsQuery, TotalMessageCountsQuery } from '../../gql/graphql'; +import { CountOption } from '../../gql/graphql'; import Relaychain from '../Relaychain/Relaychain'; import Parachain from '../Parachain/Parachain'; import LineBetween from '../LineBetween'; -import { Group, Object3D } from 'three'; +import type { Group, Object3D } from 'three'; import { useSelectedParachain } from '../../context/SelectedParachain/useSelectedParachain'; import { getNodesByEcosystem, getParachainById, getParachainId } from '../../utils/utils'; import { Ecosystem } from '../../types/types'; -import { ThreeEvent } from '@react-three/fiber'; +import type { ThreeEvent } from '@react-three/fiber'; const calculateLineWidth = (messageCount: number): number => { const baseLineWidth = 0.035; diff --git a/apps/visualizator-fe/src/components/ParachainsGraph/utils.ts b/apps/visualizator-fe/src/components/ParachainsGraph/utils.ts index 58daabdd..9f90fe1a 100644 --- a/apps/visualizator-fe/src/components/ParachainsGraph/utils.ts +++ b/apps/visualizator-fe/src/components/ParachainsGraph/utils.ts @@ -1,5 +1,5 @@ import { Vector3 } from 'three'; -import { Ecosystem } from '../../types/types'; +import type { Ecosystem } from '../../types/types'; import { getNodesByEcosystem } from '../../utils/utils'; export const getParachainPosition = (index: number, ecosystem: Ecosystem) => { diff --git a/apps/visualizator-fe/src/components/Relaychain/Relaychain.tsx b/apps/visualizator-fe/src/components/Relaychain/Relaychain.tsx index cb53adc3..9e47601a 100644 --- a/apps/visualizator-fe/src/components/Relaychain/Relaychain.tsx +++ b/apps/visualizator-fe/src/components/Relaychain/Relaychain.tsx @@ -1,8 +1,10 @@ -import { ThreeEvent, useFrame, useLoader } from '@react-three/fiber'; +import type { ThreeEvent } from '@react-three/fiber'; +import { useFrame, useLoader } from '@react-three/fiber'; import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react'; -import { Color, TextureLoader, SphereGeometry, Mesh, Group } from 'three'; +import type { SphereGeometry, Mesh, Group } from 'three'; +import { Color, TextureLoader } from 'three'; import { adjustUVs } from '../../utils/adjustUVs'; -import { Ecosystem } from '../../types/types'; +import type { Ecosystem } from '../../types/types'; import { getRelaychainLogo } from './utils/getRelaychainLogo'; const SCALE_FACTOR = 2.25; diff --git a/apps/visualizator-fe/src/components/SendXcm/SendXcm.tsx b/apps/visualizator-fe/src/components/SendXcm/SendXcm.tsx index 1a240c8c..888108d6 100644 --- a/apps/visualizator-fe/src/components/SendXcm/SendXcm.tsx +++ b/apps/visualizator-fe/src/components/SendXcm/SendXcm.tsx @@ -1,14 +1,16 @@ import { useState } from 'react'; import { Stack, Title, Box, Group, Button, Modal } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; -import { Builder, TNode, createApiInstanceForNode } from '@paraspell/sdk'; -import { ApiPromise } from '@polkadot/api'; +import type { TNode } from '@paraspell/sdk'; +import { Builder, createApiInstanceForNode } from '@paraspell/sdk'; +import type { ApiPromise } from '@polkadot/api'; import { web3Accounts, web3Enable, web3FromAddress } from '@polkadot/extension-dapp'; -import { Signer } from '@polkadot/api/types'; +import type { Signer } from '@polkadot/api/types'; import { submitTransaction } from './utils'; -import TransferForm, { FormValues } from './SendXcmForm'; +import type { FormValues } from './SendXcmForm'; +import TransferForm from './SendXcmForm'; import ErrorAlert from '../ErrorAlert'; -import { InjectedAccountWithMeta } from '@polkadot/extension-inject/types'; +import type { InjectedAccountWithMeta } from '@polkadot/extension-inject/types'; import { useWallet } from '../../hooks/useWallet'; import { useTranslation } from 'react-i18next'; import { NAME } from '../../consts/consts'; diff --git a/apps/visualizator-fe/src/components/SendXcm/SendXcmForm.tsx b/apps/visualizator-fe/src/components/SendXcm/SendXcmForm.tsx index fcf2d695..59f3efeb 100644 --- a/apps/visualizator-fe/src/components/SendXcm/SendXcmForm.tsx +++ b/apps/visualizator-fe/src/components/SendXcm/SendXcmForm.tsx @@ -1,8 +1,9 @@ -import { FC } from 'react'; +import type { FC } from 'react'; import { useForm } from '@mantine/form'; import { isValidWalletAddress } from './utils'; import { Button, Select, Stack, TextInput } from '@mantine/core'; -import { isRelayChain, NODES_WITH_RELAY_CHAINS, TNodeWithRelayChains } from '@paraspell/sdk'; +import type { TNodeWithRelayChains } from '@paraspell/sdk'; +import { isRelayChain, NODES_WITH_RELAY_CHAINS } from '@paraspell/sdk'; import { useTranslation } from 'react-i18next'; export type FormValues = { diff --git a/apps/visualizator-fe/src/components/SendXcm/utils.ts b/apps/visualizator-fe/src/components/SendXcm/utils.ts index eb9774e3..0379540f 100644 --- a/apps/visualizator-fe/src/components/SendXcm/utils.ts +++ b/apps/visualizator-fe/src/components/SendXcm/utils.ts @@ -1,6 +1,6 @@ -import { ApiPromise } from '@polkadot/api'; -import { Extrinsic } from '@paraspell/sdk'; -import { Signer } from '@polkadot/api/types'; +import type { ApiPromise } from '@polkadot/api'; +import type { Extrinsic } from '@paraspell/sdk'; +import type { Signer } from '@polkadot/api/types'; import { encodeAddress, decodeAddress } from '@polkadot/keyring'; import { isHex, hexToU8a } from '@polkadot/util'; import { isAddress } from 'web3-validator'; diff --git a/apps/visualizator-fe/src/components/SliderInput.tsx b/apps/visualizator-fe/src/components/SliderInput.tsx index 08d2de0c..0fcec8c9 100644 --- a/apps/visualizator-fe/src/components/SliderInput.tsx +++ b/apps/visualizator-fe/src/components/SliderInput.tsx @@ -1,5 +1,6 @@ -import { Slider, Stack, StackProps, Text } from '@mantine/core'; -import { FC } from 'react'; +import type { StackProps } from '@mantine/core'; +import { Slider, Stack, Text } from '@mantine/core'; +import type { FC } from 'react'; import { useTranslation } from 'react-i18next'; type Props = StackProps & { diff --git a/apps/visualizator-fe/src/components/SuccessMessagesPlot/CustomChartTooltip/CustomChartTooltip.tsx b/apps/visualizator-fe/src/components/SuccessMessagesPlot/CustomChartTooltip/CustomChartTooltip.tsx index 30be12ef..7dc8b638 100644 --- a/apps/visualizator-fe/src/components/SuccessMessagesPlot/CustomChartTooltip/CustomChartTooltip.tsx +++ b/apps/visualizator-fe/src/components/SuccessMessagesPlot/CustomChartTooltip/CustomChartTooltip.tsx @@ -4,19 +4,19 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-explicit-any */ +import type { Factory } from '@mantine/core'; import { Anchor, Box, ColorSwatch, factory, - Factory, getThemeColor, useMantineTheme, useProps, useStyles } from '@mantine/core'; import classes from './CustomChartTooltip.module.css'; -import { ChartSeries, ChartTooltipProps } from '@mantine/charts'; +import type { ChartSeries, ChartTooltipProps } from '@mantine/charts'; import { useTranslation } from 'react-i18next'; import { getParachainId } from '../../../utils/utils'; import { Ecosystem } from '../../../types/types'; diff --git a/apps/visualizator-fe/src/components/SuccessMessagesPlot/SuccessMessagesPlot.container.tsx b/apps/visualizator-fe/src/components/SuccessMessagesPlot/SuccessMessagesPlot.container.tsx index d00a6903..3c2da35f 100644 --- a/apps/visualizator-fe/src/components/SuccessMessagesPlot/SuccessMessagesPlot.container.tsx +++ b/apps/visualizator-fe/src/components/SuccessMessagesPlot/SuccessMessagesPlot.container.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { Ecosystem } from '../../types/types'; import { Center, Group, Loader, Stack, Title } from '@mantine/core'; import DownloadButtons from '../DownloadButtons'; -import { MessageCountsQuery } from '../../gql/graphql'; +import type { MessageCountsQuery } from '../../gql/graphql'; import convertToCsv from '../../utils/convertToCsv'; import { downloadZip } from '../../utils/downloadZip'; import { useRef } from 'react'; diff --git a/apps/visualizator-fe/src/components/SuccessMessagesPlot/SuccessMessagesPlot.tsx b/apps/visualizator-fe/src/components/SuccessMessagesPlot/SuccessMessagesPlot.tsx index f8368b5b..96add0ac 100644 --- a/apps/visualizator-fe/src/components/SuccessMessagesPlot/SuccessMessagesPlot.tsx +++ b/apps/visualizator-fe/src/components/SuccessMessagesPlot/SuccessMessagesPlot.tsx @@ -1,5 +1,6 @@ -import { forwardRef, ReactNode } from 'react'; -import { MessageCountsQuery } from '../../gql/graphql'; +import type { ReactNode } from 'react'; +import { forwardRef } from 'react'; +import type { MessageCountsQuery } from '../../gql/graphql'; import { BarChart } from '@mantine/charts'; import { getParachainById } from '../../utils/utils'; import { useTranslation } from 'react-i18next'; diff --git a/apps/visualizator-fe/src/components/TabNavigator/TabNavigator.tsx b/apps/visualizator-fe/src/components/TabNavigator/TabNavigator.tsx index 5ce414b1..53e42faf 100644 --- a/apps/visualizator-fe/src/components/TabNavigator/TabNavigator.tsx +++ b/apps/visualizator-fe/src/components/TabNavigator/TabNavigator.tsx @@ -6,7 +6,7 @@ import Scene2dAssetsChart from '../../pages/Scene2dAssetsChart'; import Scene2dAmountsByDay from '../../pages/Scene2dAmountsByDay'; import Scene2dBubblePlot from '../../pages/Scene2dBubblePlot'; import { useTranslation } from 'react-i18next'; -import { FC } from 'react'; +import type { FC } from 'react'; type Props = { defaultValue?: PageRoute; diff --git a/apps/visualizator-fe/src/context/SelectedParachain/SelectedParachainContext.tsx b/apps/visualizator-fe/src/context/SelectedParachain/SelectedParachainContext.tsx index 910155b2..77a1db35 100644 --- a/apps/visualizator-fe/src/context/SelectedParachain/SelectedParachainContext.tsx +++ b/apps/visualizator-fe/src/context/SelectedParachain/SelectedParachainContext.tsx @@ -1,5 +1,7 @@ -import { createContext, useState, ReactNode, Dispatch, SetStateAction } from 'react'; -import { ChannelsQuery, CountOption } from '../../gql/graphql'; +import type { ReactNode, Dispatch, SetStateAction } from 'react'; +import { createContext, useState } from 'react'; +import type { ChannelsQuery } from '../../gql/graphql'; +import { CountOption } from '../../gql/graphql'; import { Ecosystem } from '../../types/types'; export type SelectedParachain = string; diff --git a/apps/visualizator-fe/src/context/WalletContext.ts b/apps/visualizator-fe/src/context/WalletContext.ts index 7c506c86..2c66c8f7 100644 --- a/apps/visualizator-fe/src/context/WalletContext.ts +++ b/apps/visualizator-fe/src/context/WalletContext.ts @@ -1,4 +1,4 @@ -import { InjectedAccountWithMeta } from '@polkadot/extension-inject/types'; +import type { InjectedAccountWithMeta } from '@polkadot/extension-inject/types'; import { createContext } from 'react'; interface WalletState { diff --git a/apps/visualizator-fe/src/providers/WalletProvider.tsx b/apps/visualizator-fe/src/providers/WalletProvider.tsx index 8148591e..92ace60d 100644 --- a/apps/visualizator-fe/src/providers/WalletProvider.tsx +++ b/apps/visualizator-fe/src/providers/WalletProvider.tsx @@ -1,6 +1,7 @@ import { web3Enable } from '@polkadot/extension-dapp'; -import { InjectedAccountWithMeta } from '@polkadot/extension-inject/types'; -import { PropsWithChildren, useEffect, useState } from 'react'; +import type { InjectedAccountWithMeta } from '@polkadot/extension-inject/types'; +import type { PropsWithChildren } from 'react'; +import { useEffect, useState } from 'react'; import { WalletContext } from '../context/WalletContext'; import { NAME } from '../consts/consts'; diff --git a/apps/visualizator-fe/src/types/types.ts b/apps/visualizator-fe/src/types/types.ts index cf625a69..93a960d9 100644 --- a/apps/visualizator-fe/src/types/types.ts +++ b/apps/visualizator-fe/src/types/types.ts @@ -1,4 +1,4 @@ -import { AssetCountsBySymbolQuery } from '../gql/graphql'; +import type { AssetCountsBySymbolQuery } from '../gql/graphql'; export type ChartDataItem = { name: string; diff --git a/apps/visualizator-fe/src/utils/adjustUVs.ts b/apps/visualizator-fe/src/utils/adjustUVs.ts index e4a13d59..13394898 100644 --- a/apps/visualizator-fe/src/utils/adjustUVs.ts +++ b/apps/visualizator-fe/src/utils/adjustUVs.ts @@ -1,4 +1,4 @@ -import { SphereGeometry } from 'three'; +import type { SphereGeometry } from 'three'; export const adjustUVs = (geometry: SphereGeometry, scaleFactor: number) => { const uvs = geometry.attributes.uv; diff --git a/apps/visualizator-fe/src/utils/idbUtils.ts b/apps/visualizator-fe/src/utils/idbUtils.ts index da496b7b..fd337d44 100644 --- a/apps/visualizator-fe/src/utils/idbUtils.ts +++ b/apps/visualizator-fe/src/utils/idbUtils.ts @@ -1,4 +1,5 @@ -import { openDB, DBSchema, IDBPDatabase } from 'idb'; +import type { DBSchema, IDBPDatabase } from 'idb'; +import { openDB } from 'idb'; interface SkyboxDB extends DBSchema { images: { diff --git a/apps/visualizator-fe/src/utils/utils.ts b/apps/visualizator-fe/src/utils/utils.ts index aefd279a..7830b7ca 100644 --- a/apps/visualizator-fe/src/utils/utils.ts +++ b/apps/visualizator-fe/src/utils/utils.ts @@ -1,4 +1,4 @@ -import { SelectedParachain } from '../context/SelectedParachain/SelectedParachainContext'; +import type { SelectedParachain } from '../context/SelectedParachain/SelectedParachainContext'; import { prodRelayKusama, prodRelayPolkadot, diff --git a/apps/xcm-api/package.json b/apps/xcm-api/package.json index d500fb9f..ec1fa8f2 100644 --- a/apps/xcm-api/package.json +++ b/apps/xcm-api/package.json @@ -64,7 +64,6 @@ "@nestjs/testing": "^10.4.4", "@swc/core": "^1.7.26", "@types/express": "^5.0.0", - "@types/node": "^22.7.4", "@types/nodemailer": "^6.4.16", "@types/supertest": "^6.0.2", "@types/ua-parser-js": "^0.7.39", diff --git a/apps/xcm-api/src/analytics/analytics.service.test.ts b/apps/xcm-api/src/analytics/analytics.service.test.ts index 5fc758c1..0341487b 100644 --- a/apps/xcm-api/src/analytics/analytics.service.test.ts +++ b/apps/xcm-api/src/analytics/analytics.service.test.ts @@ -1,9 +1,10 @@ import { describe, beforeEach, it, expect, vi } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AnalyticsService } from './analytics.service.js'; import { ConfigService } from '@nestjs/config'; import { EventName } from './EventName.js'; -import { RequestWithUser } from '../types/types.js'; +import type { RequestWithUser } from '../types/types.js'; import * as Mixpanel from 'mixpanel'; vi.mock('mixpanel', () => ({ diff --git a/apps/xcm-api/src/app.controller.test.ts b/apps/xcm-api/src/app.controller.test.ts index afc1fefc..18fcb409 100644 --- a/apps/xcm-api/src/app.controller.test.ts +++ b/apps/xcm-api/src/app.controller.test.ts @@ -1,5 +1,6 @@ import { describe, beforeEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AppController } from './app.controller.js'; describe('AppController', () => { diff --git a/apps/xcm-api/src/asset-claim/asset-claim.controller.test.ts b/apps/xcm-api/src/asset-claim/asset-claim.controller.test.ts index ba6029ca..8ee03387 100644 --- a/apps/xcm-api/src/asset-claim/asset-claim.controller.test.ts +++ b/apps/xcm-api/src/asset-claim/asset-claim.controller.test.ts @@ -1,11 +1,11 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { AssetClaimController } from './asset-claim.controller.js'; -import { AssetClaimService } from './asset-claim.service.js'; -import { AnalyticsService } from '../analytics/analytics.service.js'; +import type { AssetClaimService } from './asset-claim.service.js'; +import type { AnalyticsService } from '../analytics/analytics.service.js'; import { EventName } from '../analytics/EventName.js'; -import { AssetClaimDto } from './dto/asset-claim.dto.js'; -import { RequestWithUser } from '../types/types.js'; -import { TTransferReturn } from '@paraspell/sdk'; +import type { AssetClaimDto } from './dto/asset-claim.dto.js'; +import type { RequestWithUser } from '../types/types.js'; +import type { TTransferReturn } from '@paraspell/sdk'; describe('AssetClaimController', () => { let controller: AssetClaimController; diff --git a/apps/xcm-api/src/asset-claim/asset-claim.service.test.ts b/apps/xcm-api/src/asset-claim/asset-claim.service.test.ts index 8c4bf4de..1e284707 100644 --- a/apps/xcm-api/src/asset-claim/asset-claim.service.test.ts +++ b/apps/xcm-api/src/asset-claim/asset-claim.service.test.ts @@ -1,14 +1,15 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { AssetClaimService } from './asset-claim.service.js'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import * as sdk from '@paraspell/sdk'; import * as utils from '../utils.js'; import { BadRequestException, InternalServerErrorException, } from '@nestjs/common'; -import { ApiPromise } from '@polkadot/api'; -import { AssetClaimDto } from './dto/asset-claim.dto.js'; +import type { ApiPromise } from '@polkadot/api'; +import type { AssetClaimDto } from './dto/asset-claim.dto.js'; vi.mock('@paraspell/sdk', async () => { const actual = diff --git a/apps/xcm-api/src/assets/assets.controller.test.ts b/apps/xcm-api/src/assets/assets.controller.test.ts index ee4464fa..aac39033 100644 --- a/apps/xcm-api/src/assets/assets.controller.test.ts +++ b/apps/xcm-api/src/assets/assets.controller.test.ts @@ -1,8 +1,10 @@ import { vi, describe, beforeEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AssetsController } from './assets.controller.js'; import { AssetsService } from './assets.service.js'; -import { NODE_NAMES, TNode, TNodeAssets } from '@paraspell/sdk'; +import type { TNode, TNodeAssets } from '@paraspell/sdk'; +import { NODE_NAMES } from '@paraspell/sdk'; import { AnalyticsService } from '../analytics/analytics.service.js'; import { mockRequestObject } from '../testUtils.js'; diff --git a/apps/xcm-api/src/assets/assets.service.test.ts b/apps/xcm-api/src/assets/assets.service.test.ts index f546f2bc..9eee9e5d 100644 --- a/apps/xcm-api/src/assets/assets.service.test.ts +++ b/apps/xcm-api/src/assets/assets.service.test.ts @@ -1,16 +1,10 @@ -import { - MockInstance, - vi, - describe, - beforeEach, - it, - expect, - afterEach, -} from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { MockInstance } from 'vitest'; +import { vi, describe, beforeEach, it, expect, afterEach } from 'vitest'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AssetsService } from './assets.service.js'; import * as paraspellSdk from '@paraspell/sdk'; -import { TNode } from '@paraspell/sdk'; +import type { TNode } from '@paraspell/sdk'; import * as utils from '../utils.js'; import { BadRequestException, NotFoundException } from '@nestjs/common'; diff --git a/apps/xcm-api/src/auth/utils/utils.test.ts b/apps/xcm-api/src/auth/utils/utils.test.ts index c9356790..1f0da650 100644 --- a/apps/xcm-api/src/auth/utils/utils.test.ts +++ b/apps/xcm-api/src/auth/utils/utils.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, vi } from 'vitest'; -import { ConfigService } from '@nestjs/config'; +import type { ConfigService } from '@nestjs/config'; import * as nodemailer from 'nodemailer'; import { google } from 'googleapis'; import { sendEmail } from './utils.js'; diff --git a/apps/xcm-api/src/auth/utils/utils.ts b/apps/xcm-api/src/auth/utils/utils.ts index 8bb4c798..5540ec4a 100644 --- a/apps/xcm-api/src/auth/utils/utils.ts +++ b/apps/xcm-api/src/auth/utils/utils.ts @@ -1,6 +1,6 @@ import * as nodemailer from 'nodemailer'; import { google } from 'googleapis'; -import { ConfigService } from '@nestjs/config'; +import type { ConfigService } from '@nestjs/config'; const OAuth2 = google.auth.OAuth2; export const sendEmail = async ( diff --git a/apps/xcm-api/src/config/sentry.config.test.ts b/apps/xcm-api/src/config/sentry.config.test.ts index b83e5b27..51435cc0 100644 --- a/apps/xcm-api/src/config/sentry.config.test.ts +++ b/apps/xcm-api/src/config/sentry.config.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi } from 'vitest'; -import { ConfigService } from '@nestjs/config'; -import { SentryModuleOptions } from '@ntegral/nestjs-sentry'; +import type { ConfigService } from '@nestjs/config'; +import type { SentryModuleOptions } from '@ntegral/nestjs-sentry'; import { sentryConfig } from './sentry.config.js'; describe('sentryConfig', () => { diff --git a/apps/xcm-api/src/config/sentry.config.ts b/apps/xcm-api/src/config/sentry.config.ts index 11ec43f0..eea4e2db 100644 --- a/apps/xcm-api/src/config/sentry.config.ts +++ b/apps/xcm-api/src/config/sentry.config.ts @@ -1,5 +1,5 @@ -import { SentryModuleOptions } from '@ntegral/nestjs-sentry'; -import { ConfigService } from '@nestjs/config'; +import type { SentryModuleOptions } from '@ntegral/nestjs-sentry'; +import type { ConfigService } from '@nestjs/config'; export const sentryConfig = (config: ConfigService): SentryModuleOptions => ({ dsn: config.get('SENTRY_DSN'), diff --git a/apps/xcm-api/src/config/throttler.config.test.ts b/apps/xcm-api/src/config/throttler.config.test.ts index 00716e24..b3f99c21 100644 --- a/apps/xcm-api/src/config/throttler.config.test.ts +++ b/apps/xcm-api/src/config/throttler.config.test.ts @@ -1,8 +1,11 @@ import { describe, it, expect, vi } from 'vitest'; -import { ThrottlerModuleOptions, ThrottlerOptions } from '@nestjs/throttler'; -import { ConfigService } from '@nestjs/config'; -import { ExecutionContext } from '@nestjs/common'; -import { RequestWithUser } from '../types/types.js'; +import type { + ThrottlerModuleOptions, + ThrottlerOptions, +} from '@nestjs/throttler'; +import type { ConfigService } from '@nestjs/config'; +import type { ExecutionContext } from '@nestjs/common'; +import type { RequestWithUser } from '../types/types.js'; import { throttlerConfig } from './throttler.config.js'; describe('throttlerConfig', () => { diff --git a/apps/xcm-api/src/config/throttler.config.ts b/apps/xcm-api/src/config/throttler.config.ts index 98aa7565..12b23d3e 100644 --- a/apps/xcm-api/src/config/throttler.config.ts +++ b/apps/xcm-api/src/config/throttler.config.ts @@ -1,6 +1,6 @@ -import { ThrottlerModuleOptions } from '@nestjs/throttler'; -import { ConfigService } from '@nestjs/config'; -import { RequestWithUser } from '../types/types.js'; +import type { ThrottlerModuleOptions } from '@nestjs/throttler'; +import type { ConfigService } from '@nestjs/config'; +import type { RequestWithUser } from '../types/types.js'; export const throttlerConfig = ( config: ConfigService, diff --git a/apps/xcm-api/src/config/typeorm.config.test.ts b/apps/xcm-api/src/config/typeorm.config.test.ts index 6e95cbe4..7a13ba37 100644 --- a/apps/xcm-api/src/config/typeorm.config.test.ts +++ b/apps/xcm-api/src/config/typeorm.config.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi } from 'vitest'; -import { ConfigService } from '@nestjs/config'; -import { TypeOrmModuleOptions } from '@nestjs/typeorm'; +import type { ConfigService } from '@nestjs/config'; +import type { TypeOrmModuleOptions } from '@nestjs/typeorm'; import { typeOrmConfig } from './typeorm.config.js'; import { User } from '../users/user.entity.js'; diff --git a/apps/xcm-api/src/config/typeorm.config.ts b/apps/xcm-api/src/config/typeorm.config.ts index 58cbf184..ff0ecb79 100644 --- a/apps/xcm-api/src/config/typeorm.config.ts +++ b/apps/xcm-api/src/config/typeorm.config.ts @@ -1,5 +1,5 @@ -import { TypeOrmModuleOptions } from '@nestjs/typeorm'; -import { ConfigService } from '@nestjs/config'; +import type { TypeOrmModuleOptions } from '@nestjs/typeorm'; +import type { ConfigService } from '@nestjs/config'; import { User } from '../users/user.entity.js'; export const typeOrmConfig = (config: ConfigService): TypeOrmModuleOptions => ({ diff --git a/apps/xcm-api/src/main.test.ts b/apps/xcm-api/src/main.test.ts index 64128ac5..164886bd 100644 --- a/apps/xcm-api/src/main.test.ts +++ b/apps/xcm-api/src/main.test.ts @@ -1,4 +1,5 @@ -import { describe, it, vi, expect, beforeAll, Mock } from 'vitest'; +import type { Mock } from 'vitest'; +import { describe, it, vi, expect, beforeAll } from 'vitest'; import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module.js'; import { ValidationPipe } from '@nestjs/common'; diff --git a/apps/xcm-api/src/main.ts b/apps/xcm-api/src/main.ts index 5f062591..dccd4a1c 100644 --- a/apps/xcm-api/src/main.ts +++ b/apps/xcm-api/src/main.ts @@ -1,7 +1,7 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module.js'; import { ValidationPipe } from '@nestjs/common'; -import { ExpressAdapter } from '@nestjs/platform-express'; +import type { ExpressAdapter } from '@nestjs/platform-express'; import { replaceBigInt } from './utils/replaceBigInt.js'; export const bootstrap = async () => { diff --git a/apps/xcm-api/src/pallets/pallets.controller.test.ts b/apps/xcm-api/src/pallets/pallets.controller.test.ts index 863ec29f..9957a41e 100644 --- a/apps/xcm-api/src/pallets/pallets.controller.test.ts +++ b/apps/xcm-api/src/pallets/pallets.controller.test.ts @@ -1,8 +1,9 @@ import { vi, describe, beforeEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PalletsController } from './pallets.controller.js'; import { PalletsService } from './pallets.service.js'; -import { TNode, TPallet } from '@paraspell/sdk'; +import type { TNode, TPallet } from '@paraspell/sdk'; import { mockRequestObject } from '../testUtils.js'; import { AnalyticsService } from '../analytics/analytics.service.js'; diff --git a/apps/xcm-api/src/pallets/pallets.service.test.ts b/apps/xcm-api/src/pallets/pallets.service.test.ts index 5b4809f5..23fe38b7 100644 --- a/apps/xcm-api/src/pallets/pallets.service.test.ts +++ b/apps/xcm-api/src/pallets/pallets.service.test.ts @@ -1,21 +1,11 @@ -import { - MockInstance, - vi, - describe, - beforeEach, - afterEach, - it, - expect, -} from 'vitest'; +import type { MockInstance } from 'vitest'; +import { vi, describe, beforeEach, afterEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PalletsService } from './pallets.service.js'; -import { - TNode, - TPallet, - getDefaultPallet, - getSupportedPallets, -} from '@paraspell/sdk'; +import type { TNode, TPallet } from '@paraspell/sdk'; +import { getDefaultPallet, getSupportedPallets } from '@paraspell/sdk'; import * as utils from '../utils.js'; const mockPallets: TPallet[] = ['OrmlXTokens', 'RelayerXcm']; diff --git a/apps/xcm-api/src/router/dto/RouterDto.ts b/apps/xcm-api/src/router/dto/RouterDto.ts index 7822da73..8f0c73e8 100644 --- a/apps/xcm-api/src/router/dto/RouterDto.ts +++ b/apps/xcm-api/src/router/dto/RouterDto.ts @@ -1,6 +1,6 @@ import { z } from 'zod'; import { CurrencyCoreSchema } from '../../x-transfer/dto/XTransferDto.js'; -import { TCurrencyCore } from '@paraspell/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; import { TransactionType } from '@paraspell/xcm-router'; import { validateAmount } from '../../utils/validateAmount.js'; diff --git a/apps/xcm-api/src/router/router.controller.test.ts b/apps/xcm-api/src/router/router.controller.test.ts index 9fb64ecb..6f7bb846 100644 --- a/apps/xcm-api/src/router/router.controller.test.ts +++ b/apps/xcm-api/src/router/router.controller.test.ts @@ -1,8 +1,9 @@ import { vi, describe, beforeEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { RouterController } from './router.controller.js'; import { RouterService } from './router.service.js'; -import { PatchedRouterDto } from './dto/RouterDto.js'; +import type { PatchedRouterDto } from './dto/RouterDto.js'; import { AnalyticsService } from '../analytics/analytics.service.js'; // Integration tests to ensure controller and service are working together diff --git a/apps/xcm-api/src/router/router.service.test.ts b/apps/xcm-api/src/router/router.service.test.ts index 666d372c..322c076b 100644 --- a/apps/xcm-api/src/router/router.service.test.ts +++ b/apps/xcm-api/src/router/router.service.test.ts @@ -1,19 +1,17 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { RouterService } from './router.service.js'; import * as utils from '../utils.js'; import * as spellRouter from '@paraspell/xcm-router'; -import { PatchedRouterDto } from './dto/RouterDto.js'; +import type { PatchedRouterDto } from './dto/RouterDto.js'; import { BadRequestException, InternalServerErrorException, } from '@nestjs/common'; -import { vi, describe, beforeEach, it, expect, MockInstance } from 'vitest'; -import { - Extrinsic, - InvalidCurrencyError, - TNode, - TSerializedApiCall, -} from '@paraspell/sdk'; +import type { MockInstance } from 'vitest'; +import { vi, describe, beforeEach, it, expect } from 'vitest'; +import type { Extrinsic, TNode, TSerializedApiCall } from '@paraspell/sdk'; +import { InvalidCurrencyError } from '@paraspell/sdk'; vi.mock('@paraspell/xcm-router', async () => { const actual = await vi.importActual('@paraspell/xcm-router'); diff --git a/apps/xcm-api/src/transfer-info/dto/transfer-info.dto.ts b/apps/xcm-api/src/transfer-info/dto/transfer-info.dto.ts index e9d342e3..0ce6675c 100644 --- a/apps/xcm-api/src/transfer-info/dto/transfer-info.dto.ts +++ b/apps/xcm-api/src/transfer-info/dto/transfer-info.dto.ts @@ -1,4 +1,4 @@ -import { TCurrencyCore } from '@paraspell/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; import { CurrencyCoreSchema } from '../../x-transfer/dto/XTransferDto.js'; import { z } from 'zod'; import { validateAmount } from '../../utils/validateAmount.js'; diff --git a/apps/xcm-api/src/transfer-info/transfer-info.controller.test.ts b/apps/xcm-api/src/transfer-info/transfer-info.controller.test.ts index 576a2915..3ec5d2b7 100644 --- a/apps/xcm-api/src/transfer-info/transfer-info.controller.test.ts +++ b/apps/xcm-api/src/transfer-info/transfer-info.controller.test.ts @@ -1,11 +1,12 @@ import { vi, describe, beforeEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { mockRequestObject } from '../testUtils.js'; import { AnalyticsService } from '../analytics/analytics.service.js'; import { TransferInfoController } from './transfer-info.controller.js'; import { TransferInfoService } from './transfer-info.service.js'; -import { PatchedTransferInfoDto } from './dto/transfer-info.dto.js'; -import { TTransferInfo } from '@paraspell/sdk'; +import type { PatchedTransferInfoDto } from './dto/transfer-info.dto.js'; +import type { TTransferInfo } from '@paraspell/sdk'; describe('TransferInfoController', () => { let controller: TransferInfoController; diff --git a/apps/xcm-api/src/transfer-info/transfer-info.service.test.ts b/apps/xcm-api/src/transfer-info/transfer-info.service.test.ts index dc72cbaa..81f15f81 100644 --- a/apps/xcm-api/src/transfer-info/transfer-info.service.test.ts +++ b/apps/xcm-api/src/transfer-info/transfer-info.service.test.ts @@ -3,11 +3,8 @@ import { BadRequestException, InternalServerErrorException, } from '@nestjs/common'; -import { - getTransferInfo, - InvalidCurrencyError, - TTransferInfo, -} from '@paraspell/sdk'; +import type { TTransferInfo } from '@paraspell/sdk'; +import { getTransferInfo, InvalidCurrencyError } from '@paraspell/sdk'; import { TransferInfoService } from './transfer-info.service.js'; import { isValidWalletAddress } from '../utils.js'; diff --git a/apps/xcm-api/src/users/users.service.test.ts b/apps/xcm-api/src/users/users.service.test.ts index c919976d..7ab6f8ef 100644 --- a/apps/xcm-api/src/users/users.service.test.ts +++ b/apps/xcm-api/src/users/users.service.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect, beforeEach, vi } from 'vitest'; import { UsersService } from './users.service.js'; -import { Repository } from 'typeorm'; -import { User } from './user.entity.js'; +import type { Repository } from 'typeorm'; +import type { User } from './user.entity.js'; describe('UsersService', () => { let service: UsersService; diff --git a/apps/xcm-api/src/utils.ts b/apps/xcm-api/src/utils.ts index 90331010..542c310c 100644 --- a/apps/xcm-api/src/utils.ts +++ b/apps/xcm-api/src/utils.ts @@ -1,10 +1,6 @@ import { BadRequestException } from '@nestjs/common'; -import { - Extrinsic, - NODE_NAMES, - TNode, - TSerializedApiCall, -} from '@paraspell/sdk'; +import type { Extrinsic, TNode, TSerializedApiCall } from '@paraspell/sdk'; +import { NODE_NAMES } from '@paraspell/sdk'; import { decodeAddress, encodeAddress } from '@polkadot/keyring'; import { hexToU8a, isHex } from '@polkadot/util'; import { isAddress } from 'web3-validator'; diff --git a/apps/xcm-api/src/x-transfer-eth/dto/x-transfer-eth.dto.ts b/apps/xcm-api/src/x-transfer-eth/dto/x-transfer-eth.dto.ts index 3ad9caf4..fcc4abb8 100644 --- a/apps/xcm-api/src/x-transfer-eth/dto/x-transfer-eth.dto.ts +++ b/apps/xcm-api/src/x-transfer-eth/dto/x-transfer-eth.dto.ts @@ -1,4 +1,4 @@ -import { TCurrencyCore } from '@paraspell/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; import { CurrencyCoreSchema } from '../../x-transfer/dto/XTransferDto.js'; import { z } from 'zod'; import { validateAmount } from '../../utils/validateAmount.js'; diff --git a/apps/xcm-api/src/x-transfer-eth/x-transfer-eth.controller.test.ts b/apps/xcm-api/src/x-transfer-eth/x-transfer-eth.controller.test.ts index a6e8f7bb..b3638f88 100644 --- a/apps/xcm-api/src/x-transfer-eth/x-transfer-eth.controller.test.ts +++ b/apps/xcm-api/src/x-transfer-eth/x-transfer-eth.controller.test.ts @@ -1,11 +1,12 @@ import { vi, describe, beforeEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { mockRequestObject } from '../testUtils.js'; import { AnalyticsService } from '../analytics/analytics.service.js'; -import { TSerializedEthTransfer } from '@paraspell/sdk'; +import type { TSerializedEthTransfer } from '@paraspell/sdk'; import { XTransferEthController } from './x-transfer-eth.controller.js'; import { XTransferEthService } from './x-transfer-eth.service.js'; -import { PatchedXTransferEthDto } from './dto/x-transfer-eth.dto.js'; +import type { PatchedXTransferEthDto } from './dto/x-transfer-eth.dto.js'; describe('XTransferEthController', () => { let controller: XTransferEthController; diff --git a/apps/xcm-api/src/x-transfer-eth/x-transfer-eth.service.test.ts b/apps/xcm-api/src/x-transfer-eth/x-transfer-eth.service.test.ts index 4086d778..7c80dc8d 100644 --- a/apps/xcm-api/src/x-transfer-eth/x-transfer-eth.service.test.ts +++ b/apps/xcm-api/src/x-transfer-eth/x-transfer-eth.service.test.ts @@ -3,12 +3,10 @@ import { BadRequestException, InternalServerErrorException, } from '@nestjs/common'; -import { - buildEthTransferOptions, - TSerializedEthTransfer, -} from '@paraspell/sdk'; +import type { TSerializedEthTransfer } from '@paraspell/sdk'; +import { buildEthTransferOptions } from '@paraspell/sdk'; import { isValidPolkadotAddress } from '../utils.js'; -import { PatchedXTransferEthDto } from './dto/x-transfer-eth.dto.js'; +import type { PatchedXTransferEthDto } from './dto/x-transfer-eth.dto.js'; import { XTransferEthService } from './x-transfer-eth.service.js'; vi.mock('@paraspell/sdk', () => ({ diff --git a/apps/xcm-api/src/x-transfer/dto/XTransferDto.ts b/apps/xcm-api/src/x-transfer/dto/XTransferDto.ts index 22bb4583..93f4266c 100644 --- a/apps/xcm-api/src/x-transfer/dto/XTransferDto.ts +++ b/apps/xcm-api/src/x-transfer/dto/XTransferDto.ts @@ -1,5 +1,6 @@ import { z } from 'zod'; -import { TAddress, TCurrencyInput, Version } from '@paraspell/sdk'; +import type { TAddress, TCurrencyInput } from '@paraspell/sdk'; +import { Version } from '@paraspell/sdk'; import { MultiLocationSchema } from '@paraspell/xcm-analyser'; import { validateAmount } from '../../utils/validateAmount.js'; diff --git a/apps/xcm-api/src/x-transfer/x-transfer.controller.test.ts b/apps/xcm-api/src/x-transfer/x-transfer.controller.test.ts index 87dd24a6..5637e197 100644 --- a/apps/xcm-api/src/x-transfer/x-transfer.controller.test.ts +++ b/apps/xcm-api/src/x-transfer/x-transfer.controller.test.ts @@ -1,11 +1,12 @@ import { vi, describe, beforeEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { XTransferController } from './x-transfer.controller.js'; import { XTransferService } from './x-transfer.service.js'; import { mockRequestObject } from '../testUtils.js'; import { AnalyticsService } from '../analytics/analytics.service.js'; -import { PatchedXTransferDto } from './dto/XTransferDto.js'; -import { Extrinsic } from '@paraspell/sdk'; +import type { PatchedXTransferDto } from './dto/XTransferDto.js'; +import type { Extrinsic } from '@paraspell/sdk'; // Integration tests to ensure controller and service are working together describe('XTransferController', () => { diff --git a/apps/xcm-api/src/x-transfer/x-transfer.service.test.ts b/apps/xcm-api/src/x-transfer/x-transfer.service.test.ts index f0cf5aa9..4d7629dd 100644 --- a/apps/xcm-api/src/x-transfer/x-transfer.service.test.ts +++ b/apps/xcm-api/src/x-transfer/x-transfer.service.test.ts @@ -1,17 +1,15 @@ import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { XTransferService } from './x-transfer.service.js'; -import { PatchedXTransferDto } from './dto/XTransferDto.js'; +import type { PatchedXTransferDto } from './dto/XTransferDto.js'; import { BadRequestException, InternalServerErrorException, } from '@nestjs/common'; import * as paraspellSdk from '@paraspell/sdk'; -import { - InvalidCurrencyError, - TNode, - createApiInstanceForNode, -} from '@paraspell/sdk'; +import type { TNode } from '@paraspell/sdk'; +import { InvalidCurrencyError, createApiInstanceForNode } from '@paraspell/sdk'; const builderMock = { xcmVersion: vi.fn().mockReturnThis(), diff --git a/apps/xcm-api/src/xcm-analyser/xcm-analyser.controller.test.ts b/apps/xcm-api/src/xcm-analyser/xcm-analyser.controller.test.ts index 2a5eb720..a78b6b82 100644 --- a/apps/xcm-api/src/xcm-analyser/xcm-analyser.controller.test.ts +++ b/apps/xcm-api/src/xcm-analyser/xcm-analyser.controller.test.ts @@ -1,10 +1,11 @@ import { vi, describe, beforeEach, it, expect } from 'vitest'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { mockRequestObject } from '../testUtils.js'; import { AnalyticsService } from '../analytics/analytics.service.js'; import { XcmAnalyserController } from './xcm-analyser.controller.js'; import { XcmAnalyserService } from './xcm-analyser.service.js'; -import { XcmAnalyserDto } from './dto/xcm-analyser.dto.js'; +import type { XcmAnalyserDto } from './dto/xcm-analyser.dto.js'; describe('XcmAnalyserController', () => { let controller: XcmAnalyserController; diff --git a/apps/xcm-api/src/xcm-analyser/xcm-analyser.service.test.ts b/apps/xcm-api/src/xcm-analyser/xcm-analyser.service.test.ts index d3ed0cf2..11eb108c 100644 --- a/apps/xcm-api/src/xcm-analyser/xcm-analyser.service.test.ts +++ b/apps/xcm-api/src/xcm-analyser/xcm-analyser.service.test.ts @@ -4,7 +4,8 @@ import { InternalServerErrorException, } from '@nestjs/common'; -import { Test, TestingModule } from '@nestjs/testing'; +import type { TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { XcmAnalyserService } from './xcm-analyser.service.js'; import { convertMultilocationToUrl, diff --git a/apps/xcm-api/src/zod-validation-pipe.ts b/apps/xcm-api/src/zod-validation-pipe.ts index 4378a8f3..87c30f78 100644 --- a/apps/xcm-api/src/zod-validation-pipe.ts +++ b/apps/xcm-api/src/zod-validation-pipe.ts @@ -1,5 +1,7 @@ -import { PipeTransform, BadRequestException } from '@nestjs/common'; -import { ZodError, ZodSchema } from 'zod'; +import type { PipeTransform } from '@nestjs/common'; +import { BadRequestException } from '@nestjs/common'; +import type { ZodSchema } from 'zod'; +import { ZodError } from 'zod'; export class ZodValidationPipe implements PipeTransform { constructor(private schema: ZodSchema) {} diff --git a/eslint.config.js b/eslint.config.js index 46c6bb4f..de7b7d38 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -54,6 +54,14 @@ export default tseslint.config( ignoreRestSiblings: true, }, ], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + prefer: "type-imports", + disallowTypeAnnotations: false, + fixStyle: "separate-type-imports", + }, + ], }, }, { diff --git a/package.json b/package.json index 469f1a59..40817581 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@eslint/js": "^9.11.1", "@types/eslint-config-prettier": "^6.11.3", "@types/eslint__js": "^8.42.3", + "@types/node": "^22.7.4", "eslint": "^9.11.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-react": "^7.37.0", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 2ecadcdf..335d4778 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -51,7 +51,6 @@ "@codecov/rollup-plugin": "^1.2.0", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", - "@types/node": "^22.7.4", "@vitest/coverage-v8": "^2.1.1", "dotenv": "^16.4.5", "prettier": "^3.3.3", diff --git a/packages/sdk/scripts/assets/fetchAssets.ts b/packages/sdk/scripts/assets/fetchAssets.ts index ba54ec38..da81114b 100644 --- a/packages/sdk/scripts/assets/fetchAssets.ts +++ b/packages/sdk/scripts/assets/fetchAssets.ts @@ -4,8 +4,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ -import { ApiPromise } from '@polkadot/api' -import { +import type { ApiPromise } from '@polkadot/api' +import type { TAssetDetails, TAssetJsonMap, TMultiLocation, diff --git a/packages/sdk/scripts/assets/fillInDecimalsBifrost.ts b/packages/sdk/scripts/assets/fillInDecimalsBifrost.ts index 535032df..c6ac1fb3 100644 --- a/packages/sdk/scripts/assets/fillInDecimalsBifrost.ts +++ b/packages/sdk/scripts/assets/fillInDecimalsBifrost.ts @@ -1,5 +1,5 @@ import { NODE_NAMES } from '../../src/maps/consts' -import { TAssetJsonMap } from '../../src/types' +import type { TAssetJsonMap } from '../../src/types' const searchDecimalsBySymbol = (symbol: string, data: TAssetJsonMap) => { for (const node of NODE_NAMES) { diff --git a/packages/sdk/scripts/assets/nodeToQueryMap.ts b/packages/sdk/scripts/assets/nodeToQueryMap.ts index c73e09ca..6d370f74 100644 --- a/packages/sdk/scripts/assets/nodeToQueryMap.ts +++ b/packages/sdk/scripts/assets/nodeToQueryMap.ts @@ -1,4 +1,4 @@ -import { TNodePolkadotKusama } from '../../src/types' +import type { TNodePolkadotKusama } from '../../src/types' export const nodeToQuery: Record = { // Chain state query: .
for assets metadata diff --git a/packages/sdk/scripts/eds/fetchEds.ts b/packages/sdk/scripts/eds/fetchEds.ts index 17a40830..5459243d 100644 --- a/packages/sdk/scripts/eds/fetchEds.ts +++ b/packages/sdk/scripts/eds/fetchEds.ts @@ -1,6 +1,6 @@ -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import { NODES_WITH_RELAY_CHAINS_DOT_KSM } from '../../src/maps/consts' -import { TEdJsonMap } from '../../src/types' +import type { TEdJsonMap } from '../../src/types' import { createApiInstanceForNode } from '../../src/utils' import { fetchTryMultipleProvidersWithTimeout } from '../scriptUtils' diff --git a/packages/sdk/scripts/pallets/fetchPallets.ts b/packages/sdk/scripts/pallets/fetchPallets.ts index 775575a2..922c434d 100644 --- a/packages/sdk/scripts/pallets/fetchPallets.ts +++ b/packages/sdk/scripts/pallets/fetchPallets.ts @@ -1,6 +1,6 @@ -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import { NODE_NAMES_DOT_KSM } from '../../src/maps/consts' -import { TPallet, TPalletMap, TPalletJsonMap } from '../../src/types' +import type { TPallet, TPalletMap, TPalletJsonMap } from '../../src/types' import { fetchTryMultipleProvidersWithTimeout } from '../scriptUtils' const defaultPalletsSortedByPriority: TPallet[] = [ diff --git a/packages/sdk/src/builder/builders/BatchTransactionManager.test.ts b/packages/sdk/src/builder/builders/BatchTransactionManager.test.ts index 5ccea115..6e0b2f01 100644 --- a/packages/sdk/src/builder/builders/BatchTransactionManager.test.ts +++ b/packages/sdk/src/builder/builders/BatchTransactionManager.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, beforeEach, vi } from 'vitest' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import BatchTransactionManager from './BatchTransactionManager' -import { BatchMode, TSendOptions } from '../../types' +import type { TSendOptions } from '../../types' +import { BatchMode } from '../../types' const mockSendTransaction = vi.fn() const batchMock = vi.fn() diff --git a/packages/sdk/src/builder/builders/BatchTransactionManager.ts b/packages/sdk/src/builder/builders/BatchTransactionManager.ts index 9cb19a3d..9b6ae20d 100644 --- a/packages/sdk/src/builder/builders/BatchTransactionManager.ts +++ b/packages/sdk/src/builder/builders/BatchTransactionManager.ts @@ -1,12 +1,11 @@ -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' +import type { TNode, TDestination } from '../../types' import { BatchMode, type TRelayToParaOptions, type TSendOptions, type Extrinsic, - type TBatchOptions, - TNode, - TDestination + type TBatchOptions } from '../../types' import { createApiInstanceForNode, determineRelayChain } from '../../utils' diff --git a/packages/sdk/src/builder/builders/Builder.test.ts b/packages/sdk/src/builder/builders/Builder.test.ts index c4743bbb..b8d110a9 100644 --- a/packages/sdk/src/builder/builders/Builder.test.ts +++ b/packages/sdk/src/builder/builders/Builder.test.ts @@ -2,7 +2,8 @@ import { type ApiPromise } from '@polkadot/api' import { vi, describe, expect, it } from 'vitest' -import { Extrinsic, Version, type TNode } from '../../types' +import type { Extrinsic } from '../../types' +import { Version, type TNode } from '../../types' import * as xcmPallet from '../../pallets/xcmPallet' import { getRelayChainSymbol } from '../../pallets/assets' import { Builder } from './Builder' diff --git a/packages/sdk/src/builder/builders/Builder.ts b/packages/sdk/src/builder/builders/Builder.ts index 75b0bb34..1c7fc387 100644 --- a/packages/sdk/src/builder/builders/Builder.ts +++ b/packages/sdk/src/builder/builders/Builder.ts @@ -21,7 +21,7 @@ import ParaToParaBuilder from './ParaToParaBuilder' import ParaToRelayBuilder from './ParaToRelayBuilder' import AssetClaimBuilder from './AssetClaimBuilder' import BatchTransactionManager from './BatchTransactionManager' -import { IAddToBatchBuilder } from './IBatchBuilder' +import type { IAddToBatchBuilder } from './IBatchBuilder' class ToGeneralBuilder { private readonly api?: ApiPromise diff --git a/packages/sdk/src/builder/builders/IBatchBuilder.ts b/packages/sdk/src/builder/builders/IBatchBuilder.ts index 26e351a8..357dc3e7 100644 --- a/packages/sdk/src/builder/builders/IBatchBuilder.ts +++ b/packages/sdk/src/builder/builders/IBatchBuilder.ts @@ -1,5 +1,5 @@ import type { Extrinsic, TBatchOptions } from '../../types' -import { GeneralBuilder } from './Builder' +import type { GeneralBuilder } from './Builder' export interface IAddToBatchBuilder { addToBatch(): GeneralBuilder diff --git a/packages/sdk/src/builder/builders/ParaToParaBuilder.ts b/packages/sdk/src/builder/builders/ParaToParaBuilder.ts index e12c93ee..20df399a 100644 --- a/packages/sdk/src/builder/builders/ParaToParaBuilder.ts +++ b/packages/sdk/src/builder/builders/ParaToParaBuilder.ts @@ -13,14 +13,9 @@ import type { TCurrency, Version } from '../../types' -import { - AddressBuilder, - GeneralBuilder, - UseKeepAliveFinalBuilder, - type AmountBuilder, - type AmountOrFeeAssetBuilder -} from './Builder' -import BatchTransactionManager from './BatchTransactionManager' +import type { AddressBuilder, UseKeepAliveFinalBuilder } from './Builder' +import { GeneralBuilder, type AmountBuilder, type AmountOrFeeAssetBuilder } from './Builder' +import type BatchTransactionManager from './BatchTransactionManager' class ParaToParaBuilder implements AmountOrFeeAssetBuilder, AmountBuilder, AddressBuilder, UseKeepAliveFinalBuilder diff --git a/packages/sdk/src/builder/builders/ParaToRelayBuilder.ts b/packages/sdk/src/builder/builders/ParaToRelayBuilder.ts index e348ec49..9ea326af 100644 --- a/packages/sdk/src/builder/builders/ParaToRelayBuilder.ts +++ b/packages/sdk/src/builder/builders/ParaToRelayBuilder.ts @@ -14,7 +14,7 @@ import { } from '../../types' import { getRelayChainSymbol } from '../../pallets/assets' import { type UseKeepAliveFinalBuilder, type AddressBuilder, GeneralBuilder } from './Builder' -import BatchTransactionManager from './BatchTransactionManager' +import type BatchTransactionManager from './BatchTransactionManager' class ParaToRelayBuilder implements AddressBuilder, UseKeepAliveFinalBuilder { private readonly api?: ApiPromise diff --git a/packages/sdk/src/builder/builders/RelayToParaBuilder.ts b/packages/sdk/src/builder/builders/RelayToParaBuilder.ts index f85f0c8e..20bd5797 100644 --- a/packages/sdk/src/builder/builders/RelayToParaBuilder.ts +++ b/packages/sdk/src/builder/builders/RelayToParaBuilder.ts @@ -16,7 +16,7 @@ import { type AmountBuilder, GeneralBuilder } from './Builder' -import BatchTransactionManager from './BatchTransactionManager' +import type BatchTransactionManager from './BatchTransactionManager' class RelayToParaBuilder implements AmountBuilder, AddressBuilder, UseKeepAliveFinalBuilder { private readonly api?: ApiPromise diff --git a/packages/sdk/src/builder/builders/evm-builder/EvmBuilder.test.ts b/packages/sdk/src/builder/builders/evm-builder/EvmBuilder.test.ts index 2aff9381..9342e034 100644 --- a/packages/sdk/src/builder/builders/evm-builder/EvmBuilder.test.ts +++ b/packages/sdk/src/builder/builders/evm-builder/EvmBuilder.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect, beforeEach, vi } from 'vitest' -import { AbstractProvider, Signer } from 'ethers' -import { TCurrencyCore, TNodePolkadotKusama } from '../../../types' -import { TEvmBuilderOptions } from '../../../types/TBuilder' +import type { AbstractProvider, Signer } from 'ethers' +import type { TCurrencyCore, TNodePolkadotKusama } from '../../../types' +import type { TEvmBuilderOptions } from '../../../types/TBuilder' import transferEthToPolkadot from '../../../pallets/xcmPallet/ethTransfer/ethTransfer' import { EvmBuilder } from './EvmBuilder' diff --git a/packages/sdk/src/builder/builders/evm-builder/EvmBuilder.ts b/packages/sdk/src/builder/builders/evm-builder/EvmBuilder.ts index 0bda109f..39764d11 100644 --- a/packages/sdk/src/builder/builders/evm-builder/EvmBuilder.ts +++ b/packages/sdk/src/builder/builders/evm-builder/EvmBuilder.ts @@ -1,6 +1,6 @@ -import { AbstractProvider, Signer } from 'ethers' -import { TCurrencyCore, TNodePolkadotKusama } from '../../../types' -import { TEvmBuilderOptions, TOptionalEvmBuilderOptions } from '../../../types/TBuilder' +import type { AbstractProvider, Signer } from 'ethers' +import type { TCurrencyCore, TNodePolkadotKusama } from '../../../types' +import type { TEvmBuilderOptions, TOptionalEvmBuilderOptions } from '../../../types/TBuilder' import transferEthToPolkadot from '../../../pallets/xcmPallet/ethTransfer/ethTransfer' class EvmBuilderClass { diff --git a/packages/sdk/src/nodes/ParachainNode.test.ts b/packages/sdk/src/nodes/ParachainNode.test.ts index f4637ae5..76503541 100644 --- a/packages/sdk/src/nodes/ParachainNode.test.ts +++ b/packages/sdk/src/nodes/ParachainNode.test.ts @@ -1,10 +1,10 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { InvalidCurrencyError } from '../errors' import { isTMultiLocation } from '../pallets/xcmPallet/utils' -import { TMultiLocation, TNode, TSendInternalOptions } from '../types' +import type { TMultiLocation, TNode, TSendInternalOptions } from '../types' import { getNode } from '../utils' -import AssetHubPolkadot from './supported/AssetHubPolkadot' -import { ApiPromise } from '@polkadot/api' +import type AssetHubPolkadot from './supported/AssetHubPolkadot' +import type { ApiPromise } from '@polkadot/api' import { verifyMultiLocation } from '../utils/verifyMultiLocation' vi.mock('../pallets/xcmPallet/utils', async () => { diff --git a/packages/sdk/src/nodes/ParachainNode.ts b/packages/sdk/src/nodes/ParachainNode.ts index 0c5cd3ee..c55340a7 100644 --- a/packages/sdk/src/nodes/ParachainNode.ts +++ b/packages/sdk/src/nodes/ParachainNode.ts @@ -33,7 +33,8 @@ import { createPolkadotXcmHeader, isTMultiLocation } from '../pallets/xcmPallet/utils' -import { TMultiLocationHeader, type TMultiLocation } from '../types/TMultiLocation' +import type { TMultiLocationHeader } from '../types/TMultiLocation' +import { type TMultiLocation } from '../types/TMultiLocation' import { type TMultiAsset } from '../types/TMultiAsset' import { InvalidCurrencyError } from '../errors' diff --git a/packages/sdk/src/nodes/polkadotXcm/PolkadotXCMTransferImpl.test.ts b/packages/sdk/src/nodes/polkadotXcm/PolkadotXCMTransferImpl.test.ts index ad115977..c07b8fd2 100644 --- a/packages/sdk/src/nodes/polkadotXcm/PolkadotXCMTransferImpl.test.ts +++ b/packages/sdk/src/nodes/polkadotXcm/PolkadotXCMTransferImpl.test.ts @@ -1,13 +1,13 @@ import { describe, it, expect, vi } from 'vitest' import PolkadotXCMTransferImpl from './PolkadotXCMTransferImpl' -import { ApiPromise } from '@polkadot/api' -import { +import type { ApiPromise } from '@polkadot/api' +import type { PolkadotXcmSection, PolkadotXCMTransferInput, TCurrencySelectionHeaderArr, - TMultiLocationHeader, - Version + TMultiLocationHeader } from '../../types' +import { Version } from '../../types' const mockApi = { tx: { diff --git a/packages/sdk/src/nodes/polkadotXcm/PolkadotXCMTransferImpl.ts b/packages/sdk/src/nodes/polkadotXcm/PolkadotXCMTransferImpl.ts index 90617af7..8a876ee8 100644 --- a/packages/sdk/src/nodes/polkadotXcm/PolkadotXCMTransferImpl.ts +++ b/packages/sdk/src/nodes/polkadotXcm/PolkadotXCMTransferImpl.ts @@ -1,11 +1,7 @@ // Contains basic structure of polkadotXCM call -import { - PolkadotXcmModule, - PolkadotXcmSection, - TTransferReturn, - type PolkadotXCMTransferInput -} from '../../types' +import type { PolkadotXcmModule, PolkadotXcmSection, TTransferReturn } from '../../types' +import { type PolkadotXCMTransferInput } from '../../types' const DEFAULT_FEE_ASSET = 0 diff --git a/packages/sdk/src/nodes/supported/Acala.test.ts b/packages/sdk/src/nodes/supported/Acala.test.ts index 6d63b83e..0ec7afea 100644 --- a/packages/sdk/src/nodes/supported/Acala.test.ts +++ b/packages/sdk/src/nodes/supported/Acala.test.ts @@ -1,9 +1,10 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' import { getNode } from '../../utils/getNode' import { getAllNodeProviders } from '../../utils/getAllNodeProviders' -import Acala from './Acala' +import type Acala from './Acala' vi.mock('../xTokens', () => ({ default: { diff --git a/packages/sdk/src/nodes/supported/Altair.test.ts b/packages/sdk/src/nodes/supported/Altair.test.ts index 1572632c..4c553418 100644 --- a/packages/sdk/src/nodes/supported/Altair.test.ts +++ b/packages/sdk/src/nodes/supported/Altair.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' import { getNode } from '../../utils/getNode' -import Altair from './Altair' +import type Altair from './Altair' vi.mock('../xTokens', () => ({ default: { diff --git a/packages/sdk/src/nodes/supported/Amplitude.test.ts b/packages/sdk/src/nodes/supported/Amplitude.test.ts index d8a11943..3ef0efa4 100644 --- a/packages/sdk/src/nodes/supported/Amplitude.test.ts +++ b/packages/sdk/src/nodes/supported/Amplitude.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' import { getNode } from '../../utils/getNode' -import Amplitude from './Amplitude' +import type Amplitude from './Amplitude' vi.mock('../xTokens', () => ({ default: { diff --git a/packages/sdk/src/nodes/supported/AssetHubKusama.test.ts b/packages/sdk/src/nodes/supported/AssetHubKusama.test.ts index d4763086..e023c579 100644 --- a/packages/sdk/src/nodes/supported/AssetHubKusama.test.ts +++ b/packages/sdk/src/nodes/supported/AssetHubKusama.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest' import { ScenarioNotSupportedError } from '../../errors' -import { PolkadotXCMTransferInput } from '../../types' +import type { PolkadotXCMTransferInput } from '../../types' import { getNode } from '../../utils' describe('transferPolkadotXCM', () => { diff --git a/packages/sdk/src/nodes/supported/AssetHubPolkadot.test.ts b/packages/sdk/src/nodes/supported/AssetHubPolkadot.test.ts index 63441a8a..89bb74b7 100644 --- a/packages/sdk/src/nodes/supported/AssetHubPolkadot.test.ts +++ b/packages/sdk/src/nodes/supported/AssetHubPolkadot.test.ts @@ -2,9 +2,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { ethers } from 'ethers' import { InvalidCurrencyError, ScenarioNotSupportedError } from '../../errors' import PolkadotXCMTransferImpl from '../polkadotXcm' -import AssetHubPolkadot from './AssetHubPolkadot' -import { ApiPromise } from '@polkadot/api' -import { Extrinsic, PolkadotXCMTransferInput } from '../../types' +import type AssetHubPolkadot from './AssetHubPolkadot' +import type { ApiPromise } from '@polkadot/api' +import type { Extrinsic, PolkadotXCMTransferInput } from '../../types' import { getOtherAssets } from '../../pallets/assets' import { getNode } from '../../utils' diff --git a/packages/sdk/src/nodes/supported/AssetHubPolkadot.ts b/packages/sdk/src/nodes/supported/AssetHubPolkadot.ts index 491c1ac6..ad9142f8 100644 --- a/packages/sdk/src/nodes/supported/AssetHubPolkadot.ts +++ b/packages/sdk/src/nodes/supported/AssetHubPolkadot.ts @@ -9,6 +9,7 @@ import { createCurrencySpec, createPolkadotXcmHeader } from '../../pallets/xcmPallet/utils' +import type { Junctions } from '../../types' import { type IPolkadotXCMTransfer, type PolkadotXCMTransferInput, @@ -19,8 +20,7 @@ import { type TRelayToParaInternalOptions, type TMultiAsset, type TMultiLocation, - type TJunction, - Junctions + type TJunction } from '../../types' import ParachainNode from '../ParachainNode' import PolkadotXCMTransferImpl from '../polkadotXcm' diff --git a/packages/sdk/src/nodes/supported/Astar.test.ts b/packages/sdk/src/nodes/supported/Astar.test.ts index acb07b40..c75d19f2 100644 --- a/packages/sdk/src/nodes/supported/Astar.test.ts +++ b/packages/sdk/src/nodes/supported/Astar.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput, PolkadotXCMTransferInput } from '../../types' +import type { XTokensTransferInput, PolkadotXCMTransferInput } from '../../types' +import { Version } from '../../types' import PolkadotXCMTransferImpl from '../polkadotXcm' import XTokensTransferImpl from '../xTokens' -import Astar from './Astar' +import type Astar from './Astar' import { getNode } from '../../utils' vi.mock('../polkadotXcm', () => ({ diff --git a/packages/sdk/src/nodes/supported/Bajun.test.ts b/packages/sdk/src/nodes/supported/Bajun.test.ts index bf2331c9..248e83c4 100644 --- a/packages/sdk/src/nodes/supported/Bajun.test.ts +++ b/packages/sdk/src/nodes/supported/Bajun.test.ts @@ -4,9 +4,10 @@ import { InvalidCurrencyError, NodeNotSupportedError } from '../../errors' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Bajun from './Bajun' +import type Bajun from './Bajun' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Basilisk.test.ts b/packages/sdk/src/nodes/supported/Basilisk.test.ts index 93f56c7a..904296a2 100644 --- a/packages/sdk/src/nodes/supported/Basilisk.test.ts +++ b/packages/sdk/src/nodes/supported/Basilisk.test.ts @@ -1,9 +1,10 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput, TNodePolkadotKusama } from '../../types' +import type { XTokensTransferInput, TNodePolkadotKusama } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' import { getAllNodeProviders } from '../../utils' import { getNode } from '../../utils/getNode' -import Basilisk from './Basilisk' +import type Basilisk from './Basilisk' vi.mock('../xTokens', () => ({ default: { diff --git a/packages/sdk/src/nodes/supported/BifrostKusama.test.ts b/packages/sdk/src/nodes/supported/BifrostKusama.test.ts index beca5859..2819f1ec 100644 --- a/packages/sdk/src/nodes/supported/BifrostKusama.test.ts +++ b/packages/sdk/src/nodes/supported/BifrostKusama.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import BifrostKusama from './BifrostKusama' +import type BifrostKusama from './BifrostKusama' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/BifrostPolkadot.test.ts b/packages/sdk/src/nodes/supported/BifrostPolkadot.test.ts index 8eb1f768..4b543851 100644 --- a/packages/sdk/src/nodes/supported/BifrostPolkadot.test.ts +++ b/packages/sdk/src/nodes/supported/BifrostPolkadot.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import { BifrostPolkadot } from './BifrostPolkadot' +import type { BifrostPolkadot } from './BifrostPolkadot' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/BridgeHubKusama.test.ts b/packages/sdk/src/nodes/supported/BridgeHubKusama.test.ts index fe2ff05a..be99393c 100644 --- a/packages/sdk/src/nodes/supported/BridgeHubKusama.test.ts +++ b/packages/sdk/src/nodes/supported/BridgeHubKusama.test.ts @@ -1,9 +1,10 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { ScenarioNotSupportedError } from '../../errors' import { constructRelayToParaParameters } from '../../pallets/xcmPallet/utils' -import { PolkadotXCMTransferInput, TRelayToParaInternalOptions, Version } from '../../types' +import type { PolkadotXCMTransferInput, TRelayToParaInternalOptions } from '../../types' +import { Version } from '../../types' import PolkadotXCMTransferImpl from '../polkadotXcm' -import BridgeHubKusama from './BridgeHubKusama' +import type BridgeHubKusama from './BridgeHubKusama' import { getNode } from '../../utils' vi.mock('../polkadotXcm', () => ({ diff --git a/packages/sdk/src/nodes/supported/BridgeHubPolkadot.test.ts b/packages/sdk/src/nodes/supported/BridgeHubPolkadot.test.ts index e13c6a70..58e54057 100644 --- a/packages/sdk/src/nodes/supported/BridgeHubPolkadot.test.ts +++ b/packages/sdk/src/nodes/supported/BridgeHubPolkadot.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { ScenarioNotSupportedError } from '../../errors' import { constructRelayToParaParameters } from '../../pallets/xcmPallet/utils' -import { PolkadotXCMTransferInput, TRelayToParaInternalOptions, Version } from '../../types' -import BridgeHubPolkadot from './BridgeHubPolkadot' +import type { PolkadotXCMTransferInput, TRelayToParaInternalOptions } from '../../types' +import { Version } from '../../types' +import type BridgeHubPolkadot from './BridgeHubPolkadot' import PolkadotXCMTransferImpl from '../polkadotXcm' import { getNode } from '../../utils' diff --git a/packages/sdk/src/nodes/supported/Calamari.test.ts b/packages/sdk/src/nodes/supported/Calamari.test.ts index f2eae78b..f925eada 100644 --- a/packages/sdk/src/nodes/supported/Calamari.test.ts +++ b/packages/sdk/src/nodes/supported/Calamari.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput, TMantaAsset } from '../../types' +import type { XTokensTransferInput, TMantaAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Calamari from './Calamari' +import type Calamari from './Calamari' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Centrifuge.test.ts b/packages/sdk/src/nodes/supported/Centrifuge.test.ts index 0c361545..a905286d 100644 --- a/packages/sdk/src/nodes/supported/Centrifuge.test.ts +++ b/packages/sdk/src/nodes/supported/Centrifuge.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import { Centrifuge } from './Centrifuge' +import type { Centrifuge } from './Centrifuge' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Collectives.test.ts b/packages/sdk/src/nodes/supported/Collectives.test.ts index d6b69da2..3b0b13b7 100644 --- a/packages/sdk/src/nodes/supported/Collectives.test.ts +++ b/packages/sdk/src/nodes/supported/Collectives.test.ts @@ -1,9 +1,10 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { ScenarioNotSupportedError } from '../../errors' import { constructRelayToParaParameters } from '../../pallets/xcmPallet/utils' -import { PolkadotXCMTransferInput, TRelayToParaInternalOptions, Version } from '../../types' +import type { PolkadotXCMTransferInput, TRelayToParaInternalOptions } from '../../types' +import { Version } from '../../types' import PolkadotXCMTransferImpl from '../polkadotXcm' -import Collectives from './Collectives' +import type Collectives from './Collectives' import { getNode } from '../../utils/getNode' vi.mock('../polkadotXcm', () => ({ diff --git a/packages/sdk/src/nodes/supported/ComposableFinance.test.ts b/packages/sdk/src/nodes/supported/ComposableFinance.test.ts index dfda3786..d760808f 100644 --- a/packages/sdk/src/nodes/supported/ComposableFinance.test.ts +++ b/packages/sdk/src/nodes/supported/ComposableFinance.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import ComposableFinance from './ComposableFinance' +import type ComposableFinance from './ComposableFinance' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/CoretimeKusama.test.ts b/packages/sdk/src/nodes/supported/CoretimeKusama.test.ts index d6e96a59..ce477814 100644 --- a/packages/sdk/src/nodes/supported/CoretimeKusama.test.ts +++ b/packages/sdk/src/nodes/supported/CoretimeKusama.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { constructRelayToParaParameters } from '../../pallets/xcmPallet/utils' -import { PolkadotXCMTransferInput, TRelayToParaInternalOptions, Version } from '../../types' +import type { PolkadotXCMTransferInput, TRelayToParaInternalOptions } from '../../types' +import { Version } from '../../types' import PolkadotXCMTransferImpl from '../polkadotXcm' -import CoretimeKusama from './CoretimeKusama' +import type CoretimeKusama from './CoretimeKusama' import { getNode } from '../../utils' vi.mock('../polkadotXcm', () => ({ diff --git a/packages/sdk/src/nodes/supported/CoretimePolkadot.test.ts b/packages/sdk/src/nodes/supported/CoretimePolkadot.test.ts index e71db2a5..38d41427 100644 --- a/packages/sdk/src/nodes/supported/CoretimePolkadot.test.ts +++ b/packages/sdk/src/nodes/supported/CoretimePolkadot.test.ts @@ -1,10 +1,6 @@ import { describe, it, expect, beforeEach, vi } from 'vitest' -import { - Extrinsic, - PolkadotXCMTransferInput, - TRelayToParaInternalOptions, - Version -} from '../../types' +import type { Extrinsic, PolkadotXCMTransferInput, TRelayToParaInternalOptions } from '../../types' +import { Version } from '../../types' import { getNode } from '../../utils' import PolkadotXCMTransferImpl from '../polkadotXcm' import CoretimePolkadot from './CoretimePolkadot' diff --git a/packages/sdk/src/nodes/supported/Crust.test.ts b/packages/sdk/src/nodes/supported/Crust.test.ts index 1debf789..873ba628 100644 --- a/packages/sdk/src/nodes/supported/Crust.test.ts +++ b/packages/sdk/src/nodes/supported/Crust.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { InvalidCurrencyError } from '../../errors/InvalidCurrencyError' -import { Version, XTokensTransferInput, TReserveAsset } from '../../types' +import type { XTokensTransferInput, TReserveAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Crust from './Crust' +import type Crust from './Crust' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/CrustShadow.test.ts b/packages/sdk/src/nodes/supported/CrustShadow.test.ts index 9deebdb6..dc7c58db 100644 --- a/packages/sdk/src/nodes/supported/CrustShadow.test.ts +++ b/packages/sdk/src/nodes/supported/CrustShadow.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { InvalidCurrencyError } from '../../errors/InvalidCurrencyError' -import { Version, XTokensTransferInput, TReserveAsset } from '../../types' +import type { XTokensTransferInput, TReserveAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import CrustShadow from './CrustShadow' +import type CrustShadow from './CrustShadow' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Curio.test.ts b/packages/sdk/src/nodes/supported/Curio.test.ts index effcb303..38d6983f 100644 --- a/packages/sdk/src/nodes/supported/Curio.test.ts +++ b/packages/sdk/src/nodes/supported/Curio.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput, TForeignOrTokenAsset } from '../../types' +import type { XTokensTransferInput, TForeignOrTokenAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Curio from './Curio' +import type Curio from './Curio' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Curio.ts b/packages/sdk/src/nodes/supported/Curio.ts index 74c24e75..9bf083a6 100644 --- a/packages/sdk/src/nodes/supported/Curio.ts +++ b/packages/sdk/src/nodes/supported/Curio.ts @@ -1,11 +1,7 @@ // Contains detailed structure of XCM call construction for Curio Parachain -import { - TForeignOrTokenAsset, - Version, - type IXTokensTransfer, - type XTokensTransferInput -} from '../../types' +import type { TForeignOrTokenAsset } from '../../types' +import { Version, type IXTokensTransfer, type XTokensTransferInput } from '../../types' import ParachainNode from '../ParachainNode' import XTokensTransferImpl from '../xTokens' diff --git a/packages/sdk/src/nodes/supported/Darwinia.test.ts b/packages/sdk/src/nodes/supported/Darwinia.test.ts index a8902cbc..9b73abba 100644 --- a/packages/sdk/src/nodes/supported/Darwinia.test.ts +++ b/packages/sdk/src/nodes/supported/Darwinia.test.ts @@ -1,16 +1,15 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { - Version, +import type { XTokensTransferInput, TScenario, TSelfReserveAsset, TForeignAsset, - TCurrencySelectionHeaderArr, - Parents + TCurrencySelectionHeaderArr } from '../../types' +import { Version, Parents } from '../../types' import { NodeNotSupportedError } from '../../errors' import XTokensTransferImpl from '../xTokens' -import Darwinia from './Darwinia' +import type Darwinia from './Darwinia' import { createCurrencySpec } from '../../pallets/xcmPallet/utils' import { getNode } from '../../utils' import ParachainNode from '../ParachainNode' diff --git a/packages/sdk/src/nodes/supported/Encointer.test.ts b/packages/sdk/src/nodes/supported/Encointer.test.ts index 013280a9..71199a2b 100644 --- a/packages/sdk/src/nodes/supported/Encointer.test.ts +++ b/packages/sdk/src/nodes/supported/Encointer.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { ScenarioNotSupportedError } from '../../errors/ScenarioNotSupportedError' -import { Version, PolkadotXCMTransferInput, TRelayToParaInternalOptions } from '../../types' +import type { PolkadotXCMTransferInput, TRelayToParaInternalOptions } from '../../types' +import { Version } from '../../types' import PolkadotXCMTransferImpl from '../polkadotXcm' -import Encointer from './Encointer' +import type Encointer from './Encointer' import { constructRelayToParaParameters } from '../../pallets/xcmPallet/utils' import { getNode } from '../../utils' diff --git a/packages/sdk/src/nodes/supported/Hydration.test.ts b/packages/sdk/src/nodes/supported/Hydration.test.ts index e65cd80a..38a63287 100644 --- a/packages/sdk/src/nodes/supported/Hydration.test.ts +++ b/packages/sdk/src/nodes/supported/Hydration.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Hydration from './Hydration' +import type Hydration from './Hydration' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Imbue.test.ts b/packages/sdk/src/nodes/supported/Imbue.test.ts index ad5287fe..7e955e04 100644 --- a/packages/sdk/src/nodes/supported/Imbue.test.ts +++ b/packages/sdk/src/nodes/supported/Imbue.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Imbue from './Imbue' +import type Imbue from './Imbue' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Integritee.test.ts b/packages/sdk/src/nodes/supported/Integritee.test.ts index fe7c3a4b..0d5e622e 100644 --- a/packages/sdk/src/nodes/supported/Integritee.test.ts +++ b/packages/sdk/src/nodes/supported/Integritee.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { InvalidCurrencyError, NodeNotSupportedError } from '../../errors' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Integritee from './Integritee' +import type Integritee from './Integritee' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Interlay.test.ts b/packages/sdk/src/nodes/supported/Interlay.test.ts index a84e3240..c0f507ab 100644 --- a/packages/sdk/src/nodes/supported/Interlay.test.ts +++ b/packages/sdk/src/nodes/supported/Interlay.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput, TForeignOrTokenAsset } from '../../types' +import type { XTokensTransferInput, TForeignOrTokenAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Interlay from './Interlay' +import type Interlay from './Interlay' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/InvArchTinker.test.ts b/packages/sdk/src/nodes/supported/InvArchTinker.test.ts index 77a6e1a4..a564a1be 100644 --- a/packages/sdk/src/nodes/supported/InvArchTinker.test.ts +++ b/packages/sdk/src/nodes/supported/InvArchTinker.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import InvArchTinker from './InvArchTinker' +import type InvArchTinker from './InvArchTinker' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Khala.test.ts b/packages/sdk/src/nodes/supported/Khala.test.ts index 8df3e0e6..eb4016b4 100644 --- a/packages/sdk/src/nodes/supported/Khala.test.ts +++ b/packages/sdk/src/nodes/supported/Khala.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { InvalidCurrencyError } from '../../errors' -import { Version, XTransferTransferInput } from '../../types' +import type { XTransferTransferInput } from '../../types' +import { Version } from '../../types' import XTransferTransferImpl from '../xTransfer' -import Khala from './Khala' +import type Khala from './Khala' import { getNode } from '../../utils' vi.mock('../xTransfer', () => ({ diff --git a/packages/sdk/src/nodes/supported/KiltSpiritnet.test.ts b/packages/sdk/src/nodes/supported/KiltSpiritnet.test.ts index fc48fd4d..91a93eb6 100644 --- a/packages/sdk/src/nodes/supported/KiltSpiritnet.test.ts +++ b/packages/sdk/src/nodes/supported/KiltSpiritnet.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { ScenarioNotSupportedError, NodeNotSupportedError } from '../../errors' -import { Version, PolkadotXCMTransferInput } from '../../types' +import type { PolkadotXCMTransferInput } from '../../types' +import { Version } from '../../types' import PolkadotXCMTransferImpl from '../polkadotXcm' -import KiltSpiritnet from './KiltSpiritnet' +import type KiltSpiritnet from './KiltSpiritnet' import { getNode } from '../../utils' vi.mock('../polkadotXcm', () => ({ diff --git a/packages/sdk/src/nodes/supported/Kintsugi.test.ts b/packages/sdk/src/nodes/supported/Kintsugi.test.ts index cf954916..3b5692d2 100644 --- a/packages/sdk/src/nodes/supported/Kintsugi.test.ts +++ b/packages/sdk/src/nodes/supported/Kintsugi.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput, TForeignOrTokenAsset } from '../../types' +import type { XTokensTransferInput, TForeignOrTokenAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Kintsugi from './Kintsugi' +import type Kintsugi from './Kintsugi' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Litentry.test.ts b/packages/sdk/src/nodes/supported/Litentry.test.ts index 9ffe4574..d7140221 100644 --- a/packages/sdk/src/nodes/supported/Litentry.test.ts +++ b/packages/sdk/src/nodes/supported/Litentry.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput, TSelfReserveAsset } from '../../types' +import type { XTokensTransferInput, TSelfReserveAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Litentry from './Litentry' +import type Litentry from './Litentry' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Manta.test.ts b/packages/sdk/src/nodes/supported/Manta.test.ts index 32fb3925..46ac3581 100644 --- a/packages/sdk/src/nodes/supported/Manta.test.ts +++ b/packages/sdk/src/nodes/supported/Manta.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput, TMantaAsset } from '../../types' +import type { XTokensTransferInput, TMantaAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Manta from './Manta' +import type Manta from './Manta' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Moonbeam.test.ts b/packages/sdk/src/nodes/supported/Moonbeam.test.ts index 5e35fd98..834fbb74 100644 --- a/packages/sdk/src/nodes/supported/Moonbeam.test.ts +++ b/packages/sdk/src/nodes/supported/Moonbeam.test.ts @@ -2,9 +2,10 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { constructRelayToParaParameters } from '../../pallets/xcmPallet/utils' import { getNode } from '../../utils' import { getAllNodeProviders } from '../../utils/getAllNodeProviders' -import { Version, XTokensTransferInput, TRelayToParaInternalOptions } from '../../types' +import type { XTokensTransferInput, TRelayToParaInternalOptions } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Moonbeam from './Moonbeam' +import type Moonbeam from './Moonbeam' vi.mock('../xTokens', () => ({ default: { diff --git a/packages/sdk/src/nodes/supported/Moonriver.test.ts b/packages/sdk/src/nodes/supported/Moonriver.test.ts index 9c2fe735..eb7d4ade 100644 --- a/packages/sdk/src/nodes/supported/Moonriver.test.ts +++ b/packages/sdk/src/nodes/supported/Moonriver.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { constructRelayToParaParameters } from '../../pallets/xcmPallet/utils' -import { Version, XTokensTransferInput, TRelayToParaInternalOptions } from '../../types' +import type { XTokensTransferInput, TRelayToParaInternalOptions } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Moonriver from './Moonriver' +import type Moonriver from './Moonriver' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Mythos.test.ts b/packages/sdk/src/nodes/supported/Mythos.test.ts index 85df5663..f9d2c99f 100644 --- a/packages/sdk/src/nodes/supported/Mythos.test.ts +++ b/packages/sdk/src/nodes/supported/Mythos.test.ts @@ -4,9 +4,10 @@ import { NodeNotSupportedError, ScenarioNotSupportedError } from '../../errors' -import { Version, PolkadotXCMTransferInput } from '../../types' +import type { PolkadotXCMTransferInput } from '../../types' +import { Version } from '../../types' import PolkadotXCMTransferImpl from '../polkadotXcm' -import Mythos from './Mythos' +import type Mythos from './Mythos' import { getNode } from '../../utils' vi.mock('../polkadotXcm', () => ({ diff --git a/packages/sdk/src/nodes/supported/NeuroWeb.test.ts b/packages/sdk/src/nodes/supported/NeuroWeb.test.ts index 2cbb845d..317373af 100644 --- a/packages/sdk/src/nodes/supported/NeuroWeb.test.ts +++ b/packages/sdk/src/nodes/supported/NeuroWeb.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, PolkadotXCMTransferInput } from '../../types' +import type { PolkadotXCMTransferInput } from '../../types' +import { Version } from '../../types' import PolkadotXCMTransferImpl from '../polkadotXcm' -import NeuroWeb from './NeuroWeb' +import type NeuroWeb from './NeuroWeb' import { getNode } from '../../utils' vi.mock('../polkadotXcm', () => ({ diff --git a/packages/sdk/src/nodes/supported/Nodle.test.ts b/packages/sdk/src/nodes/supported/Nodle.test.ts index 7cc8af2a..21156b99 100644 --- a/packages/sdk/src/nodes/supported/Nodle.test.ts +++ b/packages/sdk/src/nodes/supported/Nodle.test.ts @@ -4,9 +4,10 @@ import { NodeNotSupportedError, ScenarioNotSupportedError } from '../../errors' -import { Version, XTokensTransferInput, TNodleAsset } from '../../types' +import type { XTokensTransferInput, TNodleAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Nodle from './Nodle' +import type Nodle from './Nodle' import { getNode } from '../../utils/getNode' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Parallel.test.ts b/packages/sdk/src/nodes/supported/Parallel.test.ts index ea5d7fb1..89997232 100644 --- a/packages/sdk/src/nodes/supported/Parallel.test.ts +++ b/packages/sdk/src/nodes/supported/Parallel.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Parallel from './Parallel' +import type Parallel from './Parallel' import { getNode } from '../../utils/getNode' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Peaq.test.ts b/packages/sdk/src/nodes/supported/Peaq.test.ts index 1fbddf3d..b65c64a5 100644 --- a/packages/sdk/src/nodes/supported/Peaq.test.ts +++ b/packages/sdk/src/nodes/supported/Peaq.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { ScenarioNotSupportedError, NodeNotSupportedError } from '../../errors' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Peaq from './Peaq' +import type Peaq from './Peaq' import { getNode } from '../../utils/getNode' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Pendulum.test.ts b/packages/sdk/src/nodes/supported/Pendulum.test.ts index 4ed2040a..5ab76edd 100644 --- a/packages/sdk/src/nodes/supported/Pendulum.test.ts +++ b/packages/sdk/src/nodes/supported/Pendulum.test.ts @@ -4,9 +4,10 @@ import { NodeNotSupportedError, ScenarioNotSupportedError } from '../../errors' -import { Version, XTokensTransferInput, TXcmAsset } from '../../types' +import type { XTokensTransferInput, TXcmAsset } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Pendulum from './Pendulum' +import type Pendulum from './Pendulum' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Phala.test.ts b/packages/sdk/src/nodes/supported/Phala.test.ts index 788fbc67..9a1e74a0 100644 --- a/packages/sdk/src/nodes/supported/Phala.test.ts +++ b/packages/sdk/src/nodes/supported/Phala.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { InvalidCurrencyError } from '../../errors' -import { Version, XTransferTransferInput } from '../../types' +import type { XTransferTransferInput } from '../../types' +import { Version } from '../../types' import XTransferTransferImpl from '../xTransfer' -import Phala from './Phala' +import type Phala from './Phala' import { getNode } from '../../utils' vi.mock('../xTransfer', () => ({ diff --git a/packages/sdk/src/nodes/supported/Picasso.test.ts b/packages/sdk/src/nodes/supported/Picasso.test.ts index e52a1ca0..ab02a602 100644 --- a/packages/sdk/src/nodes/supported/Picasso.test.ts +++ b/packages/sdk/src/nodes/supported/Picasso.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Picasso from './Picasso' +import type Picasso from './Picasso' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Pioneer.test.ts b/packages/sdk/src/nodes/supported/Pioneer.test.ts index 9435f9a1..228e38d4 100644 --- a/packages/sdk/src/nodes/supported/Pioneer.test.ts +++ b/packages/sdk/src/nodes/supported/Pioneer.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Pioneer from './Pioneer' +import type Pioneer from './Pioneer' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Polkadex.test.ts b/packages/sdk/src/nodes/supported/Polkadex.test.ts index 6be65d07..576634a2 100644 --- a/packages/sdk/src/nodes/supported/Polkadex.test.ts +++ b/packages/sdk/src/nodes/supported/Polkadex.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' -import Polkadex from './Polkadex' +import type Polkadex from './Polkadex' import { getNode } from '../../utils' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Quartz.test.ts b/packages/sdk/src/nodes/supported/Quartz.test.ts index 501de83f..6a518fb3 100644 --- a/packages/sdk/src/nodes/supported/Quartz.test.ts +++ b/packages/sdk/src/nodes/supported/Quartz.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import { getNode } from '../../utils' -import Quartz from './Quartz' +import type Quartz from './Quartz' import XTokensTransferImpl from '../xTokens' vi.mock('../xTokens', () => ({ diff --git a/packages/sdk/src/nodes/supported/Robonomics.test.ts b/packages/sdk/src/nodes/supported/Robonomics.test.ts index 003e4501..bf0c2965 100644 --- a/packages/sdk/src/nodes/supported/Robonomics.test.ts +++ b/packages/sdk/src/nodes/supported/Robonomics.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { PolkadotXCMTransferInput } from '../../types' +import type { PolkadotXCMTransferInput } from '../../types' import { getNode } from '../../utils' import Robonomics from './Robonomics' import PolkadotXCMTransferImpl from '../polkadotXcm' diff --git a/packages/sdk/src/nodes/supported/Subsocial.test.ts b/packages/sdk/src/nodes/supported/Subsocial.test.ts index d802829d..0fdd8a04 100644 --- a/packages/sdk/src/nodes/supported/Subsocial.test.ts +++ b/packages/sdk/src/nodes/supported/Subsocial.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { PolkadotXCMTransferInput } from '../../types' +import type { PolkadotXCMTransferInput } from '../../types' import { getNode } from '../../utils' import Subsocial from './Subsocial' import PolkadotXCMTransferImpl from '../polkadotXcm' diff --git a/packages/sdk/src/nodes/supported/Subsocial.ts b/packages/sdk/src/nodes/supported/Subsocial.ts index e8e75478..e2becaa5 100644 --- a/packages/sdk/src/nodes/supported/Subsocial.ts +++ b/packages/sdk/src/nodes/supported/Subsocial.ts @@ -1,7 +1,8 @@ // Contains detailed structure of XCM call construction for Subsocial Parachain import { InvalidCurrencyError, ScenarioNotSupportedError } from '../../errors' -import { IPolkadotXCMTransfer, PolkadotXCMTransferInput, Version } from '../../types' +import type { IPolkadotXCMTransfer, PolkadotXCMTransferInput } from '../../types' +import { Version } from '../../types' import ParachainNode from '../ParachainNode' import PolkadotXCMTransferImpl from '../polkadotXcm' diff --git a/packages/sdk/src/nodes/supported/Turing.test.ts b/packages/sdk/src/nodes/supported/Turing.test.ts index 4019511b..d6183572 100644 --- a/packages/sdk/src/nodes/supported/Turing.test.ts +++ b/packages/sdk/src/nodes/supported/Turing.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' import { getNode } from '../../utils/getNode' -import Turing from './Turing' +import type Turing from './Turing' vi.mock('../xTokens', () => ({ default: { diff --git a/packages/sdk/src/nodes/supported/Unique.test.ts b/packages/sdk/src/nodes/supported/Unique.test.ts index b2f7caf0..49f14b31 100644 --- a/packages/sdk/src/nodes/supported/Unique.test.ts +++ b/packages/sdk/src/nodes/supported/Unique.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' import { getNode } from '../../utils/getNode' -import Unique from './Unique' +import type Unique from './Unique' vi.mock('../xTokens', () => ({ default: { diff --git a/packages/sdk/src/nodes/supported/Zeitgeist.test.ts b/packages/sdk/src/nodes/supported/Zeitgeist.test.ts index e12003af..3de4cc68 100644 --- a/packages/sdk/src/nodes/supported/Zeitgeist.test.ts +++ b/packages/sdk/src/nodes/supported/Zeitgeist.test.ts @@ -1,8 +1,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { Version, XTokensTransferInput } from '../../types' +import type { XTokensTransferInput } from '../../types' +import { Version } from '../../types' import XTokensTransferImpl from '../xTokens' import { getNode } from '../../utils/getNode' -import Zeitgeist from './Zeitgeist' +import type Zeitgeist from './Zeitgeist' vi.mock('../xTokens', () => ({ default: { diff --git a/packages/sdk/src/nodes/xTokens/XTokensTransferImpl.test.ts b/packages/sdk/src/nodes/xTokens/XTokensTransferImpl.test.ts index 4b23a9bd..d6d67c87 100644 --- a/packages/sdk/src/nodes/xTokens/XTokensTransferImpl.test.ts +++ b/packages/sdk/src/nodes/xTokens/XTokensTransferImpl.test.ts @@ -2,8 +2,9 @@ import { describe, it, expect, vi } from 'vitest' import { getCurrencySelection } from './getCurrencySelection' import { getParameters } from './getParameters' import XTokensTransferImpl from './XTokensTransferImpl' -import { Parents, TMultiLocation, XTokensTransferInput } from '../../types' -import { ApiPromise } from '@polkadot/api' +import type { TMultiLocation, XTokensTransferInput } from '../../types' +import { Parents } from '../../types' +import type { ApiPromise } from '@polkadot/api' vi.mock('./getCurrencySelection', () => ({ getCurrencySelection: vi.fn() diff --git a/packages/sdk/src/nodes/xTokens/getCurrencySelection.test.ts b/packages/sdk/src/nodes/xTokens/getCurrencySelection.test.ts index 8e0d5e30..f6c7c961 100644 --- a/packages/sdk/src/nodes/xTokens/getCurrencySelection.test.ts +++ b/packages/sdk/src/nodes/xTokens/getCurrencySelection.test.ts @@ -2,8 +2,9 @@ import { describe, it, expect, vi } from 'vitest' import { getNode } from '../../utils' import { getModifiedCurrencySelection } from './getModifiedCurrencySelection' import { getCurrencySelection } from './getCurrencySelection' -import { Parents, TCurrencySelectionHeader, Version, type XTokensTransferInput } from '../../types' -import ParachainNode from '../ParachainNode' +import type { TCurrencySelectionHeader } from '../../types' +import { Parents, Version, type XTokensTransferInput } from '../../types' +import type ParachainNode from '../ParachainNode' vi.mock('../../utils', () => ({ getNode: vi.fn() diff --git a/packages/sdk/src/nodes/xTokens/getCurrencySelection.ts b/packages/sdk/src/nodes/xTokens/getCurrencySelection.ts index e2024487..f526d615 100644 --- a/packages/sdk/src/nodes/xTokens/getCurrencySelection.ts +++ b/packages/sdk/src/nodes/xTokens/getCurrencySelection.ts @@ -1,4 +1,4 @@ -import { TXTokensCurrencySelection, XTokensTransferInput } from '../../types' +import type { TXTokensCurrencySelection, XTokensTransferInput } from '../../types' import { getNode } from '../../utils' import { getModifiedCurrencySelection } from './getModifiedCurrencySelection' diff --git a/packages/sdk/src/nodes/xTokens/getModifiedCurrencySelection.ts b/packages/sdk/src/nodes/xTokens/getModifiedCurrencySelection.ts index cea28546..8d13c711 100644 --- a/packages/sdk/src/nodes/xTokens/getModifiedCurrencySelection.ts +++ b/packages/sdk/src/nodes/xTokens/getModifiedCurrencySelection.ts @@ -1,4 +1,5 @@ -import { Parents, TCurrencySelectionHeader, Version } from '../../types' +import type { TCurrencySelectionHeader, Version } from '../../types' +import { Parents } from '../../types' export const getModifiedCurrencySelection = ( version: Version, diff --git a/packages/sdk/src/nodes/xTokens/getParameters.test.ts b/packages/sdk/src/nodes/xTokens/getParameters.test.ts index 5ed5a06b..f674588f 100644 --- a/packages/sdk/src/nodes/xTokens/getParameters.test.ts +++ b/packages/sdk/src/nodes/xTokens/getParameters.test.ts @@ -1,6 +1,7 @@ import { describe, it, expect } from 'vitest' import { getParameters } from './getParameters' -import { Parents, TMultiLocationHeader, Version } from '../../types' +import type { TMultiLocationHeader } from '../../types' +import { Parents, Version } from '../../types' const mockMultiLocationHeader: TMultiLocationHeader = { [Version.V4]: { diff --git a/packages/sdk/src/nodes/xTransfer/XTransferTransferImpl.test.ts b/packages/sdk/src/nodes/xTransfer/XTransferTransferImpl.test.ts index 102dccbe..4ebe2ca7 100644 --- a/packages/sdk/src/nodes/xTransfer/XTransferTransferImpl.test.ts +++ b/packages/sdk/src/nodes/xTransfer/XTransferTransferImpl.test.ts @@ -3,14 +3,13 @@ import { createCurrencySpec } from '../../pallets/xcmPallet/utils' import { determineDestWeight } from './determineDestWeight' import { getDestination } from './getDestination' import XTransferTransferImpl from './XTransferTransferImpl' -import { - Parents, +import type { TCurrencySelectionHeaderArr, TMultiLocation, - Version, XTransferTransferInput } from '../../types' -import { ApiPromise } from '@polkadot/api' +import { Parents, Version } from '../../types' +import type { ApiPromise } from '@polkadot/api' const mockApi = { tx: { xTransfer: { transfer: vi.fn() } } diff --git a/packages/sdk/src/nodes/xTransfer/determineDestWeight.test.ts b/packages/sdk/src/nodes/xTransfer/determineDestWeight.test.ts index 6bfb6a28..eeb4599c 100644 --- a/packages/sdk/src/nodes/xTransfer/determineDestWeight.test.ts +++ b/packages/sdk/src/nodes/xTransfer/determineDestWeight.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect } from 'vitest' import { NodeNotSupportedError } from '../../errors' import { determineDestWeight } from './determineDestWeight' -import { TNode } from '../../types' +import type { TNode } from '../../types' describe('determineDestWeight', () => { it('returns correct weight for Astar', () => { diff --git a/packages/sdk/src/nodes/xTransfer/getDestination.test.ts b/packages/sdk/src/nodes/xTransfer/getDestination.test.ts index 4ace518a..9019e2b5 100644 --- a/packages/sdk/src/nodes/xTransfer/getDestination.test.ts +++ b/packages/sdk/src/nodes/xTransfer/getDestination.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, vi } from 'vitest' import { ethers } from 'ethers' import { createAccID } from '../../utils' import { getDestination } from './getDestination' -import { XTransferTransferInput } from '../../types' +import type { XTransferTransferInput } from '../../types' vi.mock('ethers', () => ({ ethers: { diff --git a/packages/sdk/src/pallets/assets/assets.ts b/packages/sdk/src/pallets/assets/assets.ts index a8ed2e43..f6d1252a 100644 --- a/packages/sdk/src/pallets/assets/assets.ts +++ b/packages/sdk/src/pallets/assets/assets.ts @@ -2,15 +2,14 @@ import * as assetsMapJson from '../../maps/assets.json' assert { type: 'json' } import { NODE_NAMES } from '../../maps/consts' +import type { TNodeWithRelayChains, TAsset } from '../../types' import { type TNodeAssets, type TAssetJsonMap, type TNode, type TRelayChainSymbol, type TNativeAssetDetails, - type TAssetDetails, - TNodeWithRelayChains, - TAsset + type TAssetDetails } from '../../types' import { determineRelayChain } from '../../utils' import { getAssetBySymbolOrId } from './getAssetBySymbolOrId' diff --git a/packages/sdk/src/pallets/assets/balance/getAssetBalance.test.ts b/packages/sdk/src/pallets/assets/balance/getAssetBalance.test.ts index c705b149..31ab9219 100644 --- a/packages/sdk/src/pallets/assets/balance/getAssetBalance.test.ts +++ b/packages/sdk/src/pallets/assets/balance/getAssetBalance.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, vi } from 'vitest' import { createApiInstanceForNode } from '../../../utils' import { getNativeAssetSymbol } from '../assets' import { getAssetBalance } from './getAssetBalance' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import { getBalanceNative } from './getBalanceNative' import { getBalanceForeign } from './getBalanceForeign' diff --git a/packages/sdk/src/pallets/assets/balance/getAssetBalance.ts b/packages/sdk/src/pallets/assets/balance/getAssetBalance.ts index 7a1b5dd0..8ad5d3b3 100644 --- a/packages/sdk/src/pallets/assets/balance/getAssetBalance.ts +++ b/packages/sdk/src/pallets/assets/balance/getAssetBalance.ts @@ -1,4 +1,4 @@ -import { TCurrencyCore, TNodeDotKsmWithRelayChains, TNodePolkadotKusama } from '../../../types' +import type { TCurrencyCore, TNodeDotKsmWithRelayChains, TNodePolkadotKusama } from '../../../types' import { createApiInstanceForNode } from '../../../utils' import { getNativeAssetSymbol } from '../assets' import { getBalanceNative } from './getBalanceNative' diff --git a/packages/sdk/src/pallets/assets/balance/getAssetHubMultiLocation.ts b/packages/sdk/src/pallets/assets/balance/getAssetHubMultiLocation.ts index 6c7f582e..60c24501 100644 --- a/packages/sdk/src/pallets/assets/balance/getAssetHubMultiLocation.ts +++ b/packages/sdk/src/pallets/assets/balance/getAssetHubMultiLocation.ts @@ -1,4 +1,4 @@ -import { TMultiLocation } from '../../../types' +import type { TMultiLocation } from '../../../types' import { getOtherAssets } from '../assets' export const getAssetHubMultiLocation = (symbol?: string): TMultiLocation | null => { diff --git a/packages/sdk/src/pallets/assets/balance/getBalanceForeign.test.ts b/packages/sdk/src/pallets/assets/balance/getBalanceForeign.test.ts index b1f11cd0..5b17cccc 100644 --- a/packages/sdk/src/pallets/assets/balance/getBalanceForeign.test.ts +++ b/packages/sdk/src/pallets/assets/balance/getBalanceForeign.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { createApiInstanceForNode } from '../../../utils' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import { getBalanceForeign } from './getBalanceForeign' import { getBalanceForeignXTokens } from './getBalanceForeignXTokens' import { getBalanceForeignPolkadotXcm } from './getBalanceForeignPolkadotXcm' diff --git a/packages/sdk/src/pallets/assets/balance/getBalanceForeign.ts b/packages/sdk/src/pallets/assets/balance/getBalanceForeign.ts index 45ba41ed..d63fd3f0 100644 --- a/packages/sdk/src/pallets/assets/balance/getBalanceForeign.ts +++ b/packages/sdk/src/pallets/assets/balance/getBalanceForeign.ts @@ -1,5 +1,5 @@ import { type ApiPromise } from '@polkadot/api' -import { TCurrencyCore, TNodePolkadotKusama } from '../../../types' +import type { TCurrencyCore, TNodePolkadotKusama } from '../../../types' import { getDefaultPallet } from '../../pallets' import { createApiInstanceForNode } from '../../../utils' import { getAssetBySymbolOrId } from '../getAssetBySymbolOrId' diff --git a/packages/sdk/src/pallets/assets/balance/getBalanceForeignPolkadotXcm.test.ts b/packages/sdk/src/pallets/assets/balance/getBalanceForeignPolkadotXcm.test.ts index e1ed6bb8..391445e7 100644 --- a/packages/sdk/src/pallets/assets/balance/getBalanceForeignPolkadotXcm.test.ts +++ b/packages/sdk/src/pallets/assets/balance/getBalanceForeignPolkadotXcm.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import { getBalanceForeignPolkadotXcm } from './getBalanceForeignPolkadotXcm' import { getAssetHubMultiLocation } from './getAssetHubMultiLocation' import { u32 } from '@polkadot/types' diff --git a/packages/sdk/src/pallets/assets/balance/getBalanceForeignPolkadotXcm.ts b/packages/sdk/src/pallets/assets/balance/getBalanceForeignPolkadotXcm.ts index cc772133..a7906215 100644 --- a/packages/sdk/src/pallets/assets/balance/getBalanceForeignPolkadotXcm.ts +++ b/packages/sdk/src/pallets/assets/balance/getBalanceForeignPolkadotXcm.ts @@ -1,9 +1,9 @@ -import { ApiPromise } from '@polkadot/api' -import { TNodePolkadotKusama } from '../../../types' -import { Codec } from '@polkadot/types/types' +import type { ApiPromise } from '@polkadot/api' +import type { TNodePolkadotKusama } from '../../../types' +import type { Codec } from '@polkadot/types/types' import { getAssetHubMultiLocation } from './getAssetHubMultiLocation' import { u32 } from '@polkadot/types' -import { TBalanceResponse } from '../../../types/TBalance' +import type { TBalanceResponse } from '../../../types/TBalance' export const getBalanceForeignPolkadotXcm = async ( address: string, diff --git a/packages/sdk/src/pallets/assets/balance/getBalanceForeignXTokens.test.ts b/packages/sdk/src/pallets/assets/balance/getBalanceForeignXTokens.test.ts index e9e4ef7d..0b040b93 100644 --- a/packages/sdk/src/pallets/assets/balance/getBalanceForeignXTokens.test.ts +++ b/packages/sdk/src/pallets/assets/balance/getBalanceForeignXTokens.test.ts @@ -1,8 +1,8 @@ import { describe, it, expect, beforeEach, vi } from 'vitest' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import { getBalanceForeignXTokens } from './getBalanceForeignXTokens' -import { Codec } from '@polkadot/types/types' -import { StorageKey } from '@polkadot/types' +import type { Codec } from '@polkadot/types/types' +import type { StorageKey } from '@polkadot/types' describe('getBalanceForeignXTokens', () => { let apiMock: ApiPromise diff --git a/packages/sdk/src/pallets/assets/balance/getBalanceForeignXTokens.ts b/packages/sdk/src/pallets/assets/balance/getBalanceForeignXTokens.ts index 81dfc197..f95ff278 100644 --- a/packages/sdk/src/pallets/assets/balance/getBalanceForeignXTokens.ts +++ b/packages/sdk/src/pallets/assets/balance/getBalanceForeignXTokens.ts @@ -1,8 +1,8 @@ -import { StorageKey } from '@polkadot/types' -import { TCurrencyCore } from '../../../types' -import { AnyTuple, Codec } from '@polkadot/types/types' -import { ApiPromise } from '@polkadot/api' -import { AccountData } from '@polkadot/types/interfaces' +import type { StorageKey } from '@polkadot/types' +import type { TCurrencyCore } from '../../../types' +import type { AnyTuple, Codec } from '@polkadot/types/types' +import type { ApiPromise } from '@polkadot/api' +import type { AccountData } from '@polkadot/types/interfaces' export const getBalanceForeignXTokens = async ( address: string, diff --git a/packages/sdk/src/pallets/assets/balance/getBalanceNative.test.ts b/packages/sdk/src/pallets/assets/balance/getBalanceNative.test.ts index d9813d00..eec5eeba 100644 --- a/packages/sdk/src/pallets/assets/balance/getBalanceNative.test.ts +++ b/packages/sdk/src/pallets/assets/balance/getBalanceNative.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect, beforeEach, vi } from 'vitest' import { getBalanceNative } from './getBalanceNative' import { createApiInstanceForNode } from '../../../utils' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' vi.mock('../../../utils', () => ({ createApiInstanceForNode: vi.fn() diff --git a/packages/sdk/src/pallets/assets/balance/getBalanceNative.ts b/packages/sdk/src/pallets/assets/balance/getBalanceNative.ts index f34d3aa5..41ff44d9 100644 --- a/packages/sdk/src/pallets/assets/balance/getBalanceNative.ts +++ b/packages/sdk/src/pallets/assets/balance/getBalanceNative.ts @@ -2,8 +2,8 @@ import { type ApiPromise } from '@polkadot/api' import { type TNodeWithRelayChains } from '../../../types' import { type BN } from '@polkadot/util' import { createApiInstanceForNode } from '../../../utils' -import { AccountInfo } from '@polkadot/types/interfaces' -import { UInt } from '@polkadot/types' +import type { AccountInfo } from '@polkadot/types/interfaces' +import type { UInt } from '@polkadot/types' export const getBalanceNative = async ( address: string, diff --git a/packages/sdk/src/pallets/assets/eds.test.ts b/packages/sdk/src/pallets/assets/eds.test.ts index 226a556e..1e3df1f2 100644 --- a/packages/sdk/src/pallets/assets/eds.test.ts +++ b/packages/sdk/src/pallets/assets/eds.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, vi } from 'vitest' -import { TNodeDotKsmWithRelayChains } from '../../types' +import type { TNodeDotKsmWithRelayChains } from '../../types' import { getExistentialDeposit } from './eds' vi.mock('../../maps/existential-deposits.json', () => ({ diff --git a/packages/sdk/src/pallets/assets/getAssetBySymbolOrId.test.ts b/packages/sdk/src/pallets/assets/getAssetBySymbolOrId.test.ts index 4e885ba1..94d67bc2 100644 --- a/packages/sdk/src/pallets/assets/getAssetBySymbolOrId.test.ts +++ b/packages/sdk/src/pallets/assets/getAssetBySymbolOrId.test.ts @@ -6,7 +6,7 @@ import { getAssetsObject } from './assets' import { getAssetBySymbolOrId } from './getAssetBySymbolOrId' import { getDefaultPallet } from '../pallets' import { isRelayChain } from '../../utils' -import { TNodePolkadotKusama } from '../../types' +import type { TNodePolkadotKusama } from '../../types' describe('getAssetBySymbolOrId', () => { it('should return assetId and symbol for every foreign asset', () => { diff --git a/packages/sdk/src/pallets/assets/getExistentialDeposit.test.ts b/packages/sdk/src/pallets/assets/getExistentialDeposit.test.ts index 967f3054..22c3448b 100644 --- a/packages/sdk/src/pallets/assets/getExistentialDeposit.test.ts +++ b/packages/sdk/src/pallets/assets/getExistentialDeposit.test.ts @@ -6,7 +6,7 @@ import { } from './getExistentialDeposit' import * as edsMapJson from '../../maps/existential-deposits.json' import { getBalanceNative } from './balance/getBalanceNative' -import { TNodeDotKsmWithRelayChains } from '../../types' +import type { TNodeDotKsmWithRelayChains } from '../../types' vi.mock('./balance/getBalanceNative', () => ({ getBalanceNative: vi.fn() diff --git a/packages/sdk/src/pallets/assets/getOriginFeeDetails.ts b/packages/sdk/src/pallets/assets/getOriginFeeDetails.ts index 8ac85942..5c04942b 100644 --- a/packages/sdk/src/pallets/assets/getOriginFeeDetails.ts +++ b/packages/sdk/src/pallets/assets/getOriginFeeDetails.ts @@ -1,10 +1,10 @@ import { type BN } from '@polkadot/util' +import type { TCurrencyCore } from '../../types' import { type TNodeDotKsmWithRelayChains, type Extrinsic, type TNode, - type TNodeWithRelayChains, - TCurrencyCore + type TNodeWithRelayChains } from '../../types' import { getBalanceNative } from './balance/getBalanceNative' import { getMinNativeTransferableAmount } from './getExistentialDeposit' diff --git a/packages/sdk/src/pallets/assets/transfer-info/getTransferInfo.test.ts b/packages/sdk/src/pallets/assets/transfer-info/getTransferInfo.test.ts index e1a43cf4..9b2a1334 100644 --- a/packages/sdk/src/pallets/assets/transfer-info/getTransferInfo.test.ts +++ b/packages/sdk/src/pallets/assets/transfer-info/getTransferInfo.test.ts @@ -10,7 +10,7 @@ import { getMaxNativeTransferableAmount, getMinNativeTransferableAmount } from '../getExistentialDeposit' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import { getNativeAssetSymbol } from '../assets' vi.mock('../../../utils', () => ({ diff --git a/packages/sdk/src/pallets/assets/transfer-info/getTransferInfo.ts b/packages/sdk/src/pallets/assets/transfer-info/getTransferInfo.ts index 7d46402f..139d3481 100644 --- a/packages/sdk/src/pallets/assets/transfer-info/getTransferInfo.ts +++ b/packages/sdk/src/pallets/assets/transfer-info/getTransferInfo.ts @@ -1,5 +1,5 @@ -import { TCurrencyCore, TNodeDotKsmWithRelayChains } from '../../../types' -import { TTransferInfo } from '../../../types/TTransferInfo' +import type { TCurrencyCore, TNodeDotKsmWithRelayChains } from '../../../types' +import type { TTransferInfo } from '../../../types/TTransferInfo' import { createApiInstanceForNode, determineRelayChainSymbol } from '../../../utils' import { getNativeAssetSymbol } from '../assets' import { getAssetBalance } from '../balance/getAssetBalance' diff --git a/packages/sdk/src/pallets/pallets.ts b/packages/sdk/src/pallets/pallets.ts index 2a7a262f..66da27da 100644 --- a/packages/sdk/src/pallets/pallets.ts +++ b/packages/sdk/src/pallets/pallets.ts @@ -1,7 +1,8 @@ // Script that pulls XCM Pallets for selected Parachain import * as palletsMapJson from '../maps/pallets.json' assert { type: 'json' } -import { TNodePolkadotKusama, type TPallet, type TPalletJsonMap } from '../types' +import type { TNodePolkadotKusama } from '../types' +import { type TPallet, type TPalletJsonMap } from '../types' const palletsMap = palletsMapJson as TPalletJsonMap diff --git a/packages/sdk/src/pallets/xcmPallet/calculateTransactionFee.test.ts b/packages/sdk/src/pallets/xcmPallet/calculateTransactionFee.test.ts index 9231ad09..562634df 100644 --- a/packages/sdk/src/pallets/xcmPallet/calculateTransactionFee.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/calculateTransactionFee.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi } from 'vitest' import { BN } from '@polkadot/util' -import { Extrinsic } from '../../types' +import type { Extrinsic } from '../../types' import { calculateTransactionFee } from './calculateTransactionFee' describe('calculateTransactionFee', () => { diff --git a/packages/sdk/src/pallets/xcmPallet/calculateTransactionFee.ts b/packages/sdk/src/pallets/xcmPallet/calculateTransactionFee.ts index 76a7a6fc..2aa66732 100644 --- a/packages/sdk/src/pallets/xcmPallet/calculateTransactionFee.ts +++ b/packages/sdk/src/pallets/xcmPallet/calculateTransactionFee.ts @@ -1,5 +1,5 @@ -import { BN } from '@polkadot/util' -import { Extrinsic } from '../../types' +import type { BN } from '@polkadot/util' +import type { Extrinsic } from '../../types' export const calculateTransactionFee = async (tx: Extrinsic, address: string): Promise => { const { partialFee } = await tx.paymentInfo(address) diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/buildEthTransferOptions.test.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/buildEthTransferOptions.test.ts index 69d4687f..96c25c63 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/buildEthTransferOptions.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/buildEthTransferOptions.test.ts @@ -3,9 +3,10 @@ import { buildEthTransferOptions } from './buildEthTransferOptions' import { findEthAsset } from './findEthAsset' import { createContext } from './createContext' import { getParaId } from '../../assets' -import { Context, toPolkadot } from '@snowbridge/api' -import { TSerializeEthTransferOptions } from '../../../types' -import { SendValidationResult } from '@snowbridge/api/dist/toPolkadot' +import type { Context } from '@snowbridge/api' +import { toPolkadot } from '@snowbridge/api' +import type { TSerializeEthTransferOptions } from '../../../types' +import type { SendValidationResult } from '@snowbridge/api/dist/toPolkadot' vi.mock('./findEthAsset', () => ({ findEthAsset: vi.fn() diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/buildEthTransferOptions.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/buildEthTransferOptions.ts index 79b6a5a5..847cab80 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/buildEthTransferOptions.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/buildEthTransferOptions.ts @@ -1,5 +1,5 @@ import { environment, toPolkadot } from '@snowbridge/api' -import { TSerializedEthTransfer, TSerializeEthTransferOptions } from '../../../types/TBuilder' +import type { TSerializedEthTransfer, TSerializeEthTransferOptions } from '../../../types/TBuilder' import { getParaId } from '../../assets' import { checkPlanFailure } from './checkPlanFailure' import { findEthAsset } from './findEthAsset' diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/checkPlanFailure.test.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/checkPlanFailure.test.ts index 28dd504e..0fad0862 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/checkPlanFailure.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/checkPlanFailure.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest' import { checkPlanFailure } from './checkPlanFailure' -import { SendValidationResult } from '@snowbridge/api/dist/toPolkadot' +import type { SendValidationResult } from '@snowbridge/api/dist/toPolkadot' describe('checkPlanFailure', () => { it('throws an error with the correct message when plan.failure is true', () => { diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/checkPlanFailure.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/checkPlanFailure.ts index 6ab1768e..d51afcf5 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/checkPlanFailure.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/checkPlanFailure.ts @@ -1,4 +1,4 @@ -import { SendValidationResult } from '@snowbridge/api/dist/toPolkadot' +import type { SendValidationResult } from '@snowbridge/api/dist/toPolkadot' export const checkPlanFailure = (plan: SendValidationResult) => { if (plan.failure) { diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/createContext.test.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/createContext.test.ts index 0a50ce3d..4b0472e8 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/createContext.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/createContext.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, vi } from 'vitest' import { contextFactory } from '@snowbridge/api' import { AbstractProvider } from 'ethers' import { createContext } from './createContext' -import { Config } from '@snowbridge/api/dist/environment' +import type { Config } from '@snowbridge/api/dist/environment' vi.mock('@snowbridge/api', () => ({ contextFactory: vi.fn() diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/createContext.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/createContext.ts index 51a766c2..8aa00c4f 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/createContext.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/createContext.ts @@ -1,5 +1,6 @@ -import { environment, contextFactory } from '@snowbridge/api' -import { AbstractProvider } from 'ethers' +import type { environment } from '@snowbridge/api' +import { contextFactory } from '@snowbridge/api' +import type { AbstractProvider } from 'ethers' export const createContext = async ( executionUrl: string | AbstractProvider, diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/ethTransfer.test.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/ethTransfer.test.ts index 956197c5..96ccab4b 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/ethTransfer.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/ethTransfer.test.ts @@ -2,11 +2,12 @@ import { describe, it, expect, vi } from 'vitest' import { findEthAsset } from './findEthAsset' import { createContext } from './createContext' import { getParaId } from '../../assets' -import { Context, toPolkadot } from '@snowbridge/api' -import { TEvmBuilderOptions } from '../../../types' -import { SendValidationResult } from '@snowbridge/api/dist/toPolkadot' +import type { Context } from '@snowbridge/api' +import { toPolkadot } from '@snowbridge/api' +import type { TEvmBuilderOptions } from '../../../types' +import type { SendValidationResult } from '@snowbridge/api/dist/toPolkadot' import transferEthToPolkadot from './ethTransfer' -import { AbstractProvider, Signer } from 'ethers' +import type { AbstractProvider, Signer } from 'ethers' vi.mock('./findEthAsset', () => ({ findEthAsset: vi.fn() diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/ethTransfer.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/ethTransfer.ts index 92fe7d32..63f88d9d 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/ethTransfer.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/ethTransfer.ts @@ -1,6 +1,6 @@ import { toPolkadot, environment } from '@snowbridge/api' -import { TEvmBuilderOptions } from '../../../types/TBuilder' -import { AbstractProvider } from 'ethers' +import type { TEvmBuilderOptions } from '../../../types/TBuilder' +import type { AbstractProvider } from 'ethers' import { getParaId } from '../../assets' import { findEthAsset } from './findEthAsset' import { createContext } from './createContext' diff --git a/packages/sdk/src/pallets/xcmPallet/ethTransfer/findEthAsset.ts b/packages/sdk/src/pallets/xcmPallet/ethTransfer/findEthAsset.ts index 5745d2e3..8f3b1865 100644 --- a/packages/sdk/src/pallets/xcmPallet/ethTransfer/findEthAsset.ts +++ b/packages/sdk/src/pallets/xcmPallet/ethTransfer/findEthAsset.ts @@ -1,5 +1,5 @@ import { InvalidCurrencyError } from '../../../errors' -import { TCurrencyCore } from '../../../types' +import type { TCurrencyCore } from '../../../types' import { getOtherAssets } from '../../assets' export const findEthAsset = (currency: TCurrencyCore) => { diff --git a/packages/sdk/src/pallets/xcmPallet/findParachainJunction.test.ts b/packages/sdk/src/pallets/xcmPallet/findParachainJunction.test.ts index 12fb76e5..cb3ae5d2 100644 --- a/packages/sdk/src/pallets/xcmPallet/findParachainJunction.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/findParachainJunction.test.ts @@ -1,5 +1,6 @@ import { describe, it, expect } from 'vitest' -import { Parents, TMultiLocation } from '../../types' +import type { TMultiLocation } from '../../types' +import { Parents } from '../../types' import { findParachainJunction } from './findParachainJunction' describe('findParachainJunction', () => { diff --git a/packages/sdk/src/pallets/xcmPallet/findParachainJunction.ts b/packages/sdk/src/pallets/xcmPallet/findParachainJunction.ts index f589c590..37d096d6 100644 --- a/packages/sdk/src/pallets/xcmPallet/findParachainJunction.ts +++ b/packages/sdk/src/pallets/xcmPallet/findParachainJunction.ts @@ -1,4 +1,4 @@ -import { JunctionParachain, TMultiLocation } from '../../types' +import type { JunctionParachain, TMultiLocation } from '../../types' export const findParachainJunction = (multilocation: TMultiLocation): number | null => { const { interior } = multilocation diff --git a/packages/sdk/src/pallets/xcmPallet/keepAlive/checkKeepAlive.test.ts b/packages/sdk/src/pallets/xcmPallet/keepAlive/checkKeepAlive.test.ts index 1a8ce554..1128943e 100644 --- a/packages/sdk/src/pallets/xcmPallet/keepAlive/checkKeepAlive.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/keepAlive/checkKeepAlive.test.ts @@ -5,7 +5,7 @@ import { BN } from '@polkadot/util' import { calculateTransactionFee } from '../calculateTransactionFee' import { KeepAliveError } from '../../../errors/KeepAliveError' import { createTx } from '../keepAlive/createTx' -import { Extrinsic } from '../../../types' +import type { Extrinsic } from '../../../types' import { beforeEach } from 'node:test' import { getExistentialDeposit } from '../../assets/eds' diff --git a/packages/sdk/src/pallets/xcmPallet/keepAlive/checkKeepAlive.ts b/packages/sdk/src/pallets/xcmPallet/keepAlive/checkKeepAlive.ts index 74be5c08..0c679783 100644 --- a/packages/sdk/src/pallets/xcmPallet/keepAlive/checkKeepAlive.ts +++ b/packages/sdk/src/pallets/xcmPallet/keepAlive/checkKeepAlive.ts @@ -1,8 +1,8 @@ -import { UInt } from '@polkadot/types' +import type { UInt } from '@polkadot/types' import { BN } from '@polkadot/util' -import { AccountInfo } from '@polkadot/types/interfaces' +import type { AccountInfo } from '@polkadot/types/interfaces' import { KeepAliveError } from '../../../errors/KeepAliveError' -import { CheckKeepAliveOptions, TNodePolkadotKusama } from '../../../types' +import type { CheckKeepAliveOptions, TNodePolkadotKusama } from '../../../types' import { getAssetsObject } from '../../assets' import { determineRelayChain } from '../../../utils' import { calculateTransactionFee } from '../calculateTransactionFee' diff --git a/packages/sdk/src/pallets/xcmPallet/keepAlive/createTx.test.ts b/packages/sdk/src/pallets/xcmPallet/keepAlive/createTx.test.ts index ba8832c3..3684c251 100644 --- a/packages/sdk/src/pallets/xcmPallet/keepAlive/createTx.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/keepAlive/createTx.test.ts @@ -1,8 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import { Builder } from '../../../builder' import { createTx } from './createTx' -import { Extrinsic, TNode } from '../../../types' +import type { Extrinsic, TNode } from '../../../types' vi.mock('../../../builder', () => ({ Builder: vi.fn().mockImplementation(() => ({ diff --git a/packages/sdk/src/pallets/xcmPallet/keepAlive/createTx.ts b/packages/sdk/src/pallets/xcmPallet/keepAlive/createTx.ts index 0b6062bf..53071765 100644 --- a/packages/sdk/src/pallets/xcmPallet/keepAlive/createTx.ts +++ b/packages/sdk/src/pallets/xcmPallet/keepAlive/createTx.ts @@ -1,5 +1,5 @@ -import { ApiPromise } from '@polkadot/api' -import { Extrinsic, TNode } from '../../../types' +import type { ApiPromise } from '@polkadot/api' +import type { Extrinsic, TNode } from '../../../types' import { Builder } from '../../../builder' export const createTx = async ( diff --git a/packages/sdk/src/pallets/xcmPallet/transfer.test.ts b/packages/sdk/src/pallets/xcmPallet/transfer.test.ts index 09adad09..9d4ec5b6 100644 --- a/packages/sdk/src/pallets/xcmPallet/transfer.test.ts +++ b/packages/sdk/src/pallets/xcmPallet/transfer.test.ts @@ -6,13 +6,8 @@ import { NODE_NAMES, NODE_NAMES_DOT_KSM } from '../../maps/consts' import { getAllAssetsSymbols, getOtherAssets, getRelayChainSymbol } from '../assets' import { InvalidCurrencyError } from '../../errors/InvalidCurrencyError' import { DuplicateAssetError, IncompatibleNodesError } from '../../errors' -import { - type TSendOptions, - type TNode, - type TMultiAsset, - type TMultiLocation, - Extrinsic -} from '../../types' +import type { Extrinsic } from '../../types' +import { type TSendOptions, type TNode, type TMultiAsset, type TMultiLocation } from '../../types' import { send } from './transfer' import ParachainNode from '../../nodes/ParachainNode' import { createApiInstance, getNode } from '../../utils' diff --git a/packages/sdk/src/pallets/xcmPallet/transfer.ts b/packages/sdk/src/pallets/xcmPallet/transfer.ts index ccc145a9..b1d86acd 100644 --- a/packages/sdk/src/pallets/xcmPallet/transfer.ts +++ b/packages/sdk/src/pallets/xcmPallet/transfer.ts @@ -1,5 +1,6 @@ // Contains basic call formatting for different XCM Palletss +import type { TTransferReturn } from '../../types' import { type Extrinsic, type TSerializedApiCall, @@ -7,8 +8,7 @@ import { type TRelayToParaCommonOptions, type TSendOptionsCommon, type TSendOptions, - type TNode, - TTransferReturn + type TNode } from '../../types' import { getNode, diff --git a/packages/sdk/src/pallets/xcmPallet/utils.ts b/packages/sdk/src/pallets/xcmPallet/utils.ts index aef46dd3..34401829 100644 --- a/packages/sdk/src/pallets/xcmPallet/utils.ts +++ b/packages/sdk/src/pallets/xcmPallet/utils.ts @@ -9,7 +9,8 @@ import { type TCurrencySelectionHeaderArr } from '../../types' import { getParaId, getTNode } from '../assets' -import { Junctions, TJunction, type TMultiLocation } from '../../types/TMultiLocation' +import type { Junctions, TJunction } from '../../types/TMultiLocation' +import { type TMultiLocation } from '../../types/TMultiLocation' import { type TMultiAsset } from '../../types/TMultiAsset' import { findParachainJunction } from './findParachainJunction' import { generateAddressPayload } from '../../utils/generateAddressPayload' diff --git a/packages/sdk/src/types/TAssets.ts b/packages/sdk/src/types/TAssets.ts index 6ab3958a..73819185 100644 --- a/packages/sdk/src/types/TAssets.ts +++ b/packages/sdk/src/types/TAssets.ts @@ -1,4 +1,5 @@ -import { TMultiLocation, TNodeWithRelayChains, type TRelayChainSymbol } from '../types' +import type { TMultiLocation, TNodeWithRelayChains } from '../types' +import { type TRelayChainSymbol } from '../types' export type TAsset = TNativeAssetDetails | TAssetDetails diff --git a/packages/sdk/src/types/TBuilder.ts b/packages/sdk/src/types/TBuilder.ts index c316e087..d32bdd4e 100644 --- a/packages/sdk/src/types/TBuilder.ts +++ b/packages/sdk/src/types/TBuilder.ts @@ -1,6 +1,6 @@ import type { Signer } from 'ethers' import type { TNodePolkadotKusama } from './TNode' -import { TCurrencyCore } from './TCurrency' +import type { TCurrencyCore } from './TCurrency' export type TEvmBuilderOptions = { to: TNodePolkadotKusama diff --git a/packages/sdk/src/types/TCurrency.ts b/packages/sdk/src/types/TCurrency.ts index 4fdd5f5b..8e95cd86 100644 --- a/packages/sdk/src/types/TCurrency.ts +++ b/packages/sdk/src/types/TCurrency.ts @@ -1,6 +1,6 @@ -import { TMultiLocation } from './TMultiLocation' -import { TMultiAsset } from './TMultiAsset' -import { Version } from './TTransfer' +import type { TMultiLocation } from './TMultiLocation' +import type { TMultiAsset } from './TMultiAsset' +import type { Version } from './TTransfer' export type TCurrency = string | number | bigint diff --git a/packages/sdk/src/types/TExistentialDeposit.ts b/packages/sdk/src/types/TExistentialDeposit.ts index 064ab840..9b97a3e7 100644 --- a/packages/sdk/src/types/TExistentialDeposit.ts +++ b/packages/sdk/src/types/TExistentialDeposit.ts @@ -1,3 +1,3 @@ -import { TNodeDotKsmWithRelayChains } from './TNode' +import type { TNodeDotKsmWithRelayChains } from './TNode' export type TEdJsonMap = Record diff --git a/packages/sdk/src/types/TTransfer.ts b/packages/sdk/src/types/TTransfer.ts index a82f07ea..9efc88fa 100644 --- a/packages/sdk/src/types/TTransfer.ts +++ b/packages/sdk/src/types/TTransfer.ts @@ -1,9 +1,11 @@ import { type ApiPromise } from '@polkadot/api' -import { TMultiLocationHeader, type TMultiLocation } from './TMultiLocation' -import { TNodePolkadotKusama, type TNode } from './TNode' +import type { TMultiLocationHeader } from './TMultiLocation' +import { type TMultiLocation } from './TMultiLocation' +import type { TNodePolkadotKusama } from './TNode' +import { type TNode } from './TNode' import { type SubmittableExtrinsic } from '@polkadot/api/types' import { type TMultiAsset } from './TMultiAsset' -import { TCurrency, TCurrencyInput, TCurrencySelectionHeaderArr } from './TCurrency' +import type { TCurrency, TCurrencyInput, TCurrencySelectionHeaderArr } from './TCurrency' export type Extrinsic = SubmittableExtrinsic<'promise'> diff --git a/packages/sdk/src/types/TTransferInfo.ts b/packages/sdk/src/types/TTransferInfo.ts index 0d22ccee..577278af 100644 --- a/packages/sdk/src/types/TTransferInfo.ts +++ b/packages/sdk/src/types/TTransferInfo.ts @@ -1,4 +1,4 @@ -import { TNodeWithRelayChains } from './TNode' +import type { TNodeWithRelayChains } from './TNode' export interface TTransferInfo { chain: { origin: TNodeWithRelayChains; destination: TNodeWithRelayChains; ecosystem: string } diff --git a/packages/sdk/src/utils/callPolkadotJsTxFunction.test.ts b/packages/sdk/src/utils/callPolkadotJsTxFunction.test.ts index 209f6c7f..2cdef9dc 100644 --- a/packages/sdk/src/utils/callPolkadotJsTxFunction.test.ts +++ b/packages/sdk/src/utils/callPolkadotJsTxFunction.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi } from 'vitest' -import { ApiPromise } from '@polkadot/api' -import { TSerializedApiCall, Extrinsic } from '../types' +import type { ApiPromise } from '@polkadot/api' +import type { TSerializedApiCall, Extrinsic } from '../types' import { callPolkadotJsTxFunction } from './callPolkadotJsTxFunction' const apiMock = { diff --git a/packages/sdk/src/utils/callPolkadotJsTxFunction.ts b/packages/sdk/src/utils/callPolkadotJsTxFunction.ts index 4108b8fd..fd6f4937 100644 --- a/packages/sdk/src/utils/callPolkadotJsTxFunction.ts +++ b/packages/sdk/src/utils/callPolkadotJsTxFunction.ts @@ -1,5 +1,5 @@ -import { ApiPromise } from '@polkadot/api' -import { Extrinsic, TSerializedApiCall } from '../types' +import type { ApiPromise } from '@polkadot/api' +import type { Extrinsic, TSerializedApiCall } from '../types' export const callPolkadotJsTxFunction = ( api: ApiPromise, diff --git a/packages/sdk/src/utils/createApiInstanceForNode.test.ts b/packages/sdk/src/utils/createApiInstanceForNode.test.ts index 4179ce99..839806b4 100644 --- a/packages/sdk/src/utils/createApiInstanceForNode.test.ts +++ b/packages/sdk/src/utils/createApiInstanceForNode.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi } from 'vitest' -import { ApiPromise } from '@polkadot/api' -import { TNodeWithRelayChains } from '../types' +import type { ApiPromise } from '@polkadot/api' +import type { TNodeWithRelayChains } from '../types' import { createApiInstanceForNode } from './createApiInstanceForNode' import { createApiInstance } from './createApiInstance' import { getNode } from './getNode' diff --git a/packages/sdk/src/utils/createApiInstanceForNode.ts b/packages/sdk/src/utils/createApiInstanceForNode.ts index 4662ec9a..34430933 100644 --- a/packages/sdk/src/utils/createApiInstanceForNode.ts +++ b/packages/sdk/src/utils/createApiInstanceForNode.ts @@ -1,5 +1,5 @@ -import { ApiPromise } from '@polkadot/api' -import { TNodeWithRelayChains } from '../types' +import type { ApiPromise } from '@polkadot/api' +import type { TNodeWithRelayChains } from '../types' import { prodRelayKusama, prodRelayPolkadot } from '@polkadot/apps-config' import { createApiInstance, getNode } from '.' diff --git a/packages/sdk/src/utils/createX1Payload.test.ts b/packages/sdk/src/utils/createX1Payload.test.ts index 837a1fbd..84a3a067 100644 --- a/packages/sdk/src/utils/createX1Payload.test.ts +++ b/packages/sdk/src/utils/createX1Payload.test.ts @@ -1,5 +1,6 @@ import { describe, it, expect } from 'vitest' -import { Version, TJunction } from '../types' +import type { TJunction } from '../types' +import { Version } from '../types' import { createX1Payload } from './createX1Payload' describe('createX1Payload', () => { diff --git a/packages/sdk/src/utils/createX1Payload.ts b/packages/sdk/src/utils/createX1Payload.ts index 62b77fe2..41ecaf4f 100644 --- a/packages/sdk/src/utils/createX1Payload.ts +++ b/packages/sdk/src/utils/createX1Payload.ts @@ -1,4 +1,5 @@ -import { Junctions, TJunction, Version } from '../types' +import type { Junctions, TJunction } from '../types' +import { Version } from '../types' export const createX1Payload = (version: Version, junction: TJunction): Junctions => version === Version.V4 ? { X1: [junction] } : { X1: junction } diff --git a/packages/sdk/src/utils/determineRelayChainSymbol.test.ts b/packages/sdk/src/utils/determineRelayChainSymbol.test.ts index a88da715..04c8c14c 100644 --- a/packages/sdk/src/utils/determineRelayChainSymbol.test.ts +++ b/packages/sdk/src/utils/determineRelayChainSymbol.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, vi } from 'vitest' -import { TNodeWithRelayChains } from '../types' +import type { TNodeWithRelayChains } from '../types' import { determineRelayChainSymbol } from './determineRelayChainSymbol' import { getRelayChainSymbol } from '../pallets/assets' diff --git a/packages/sdk/src/utils/determineRelayChainSymbol.ts b/packages/sdk/src/utils/determineRelayChainSymbol.ts index 60684fc3..f588d496 100644 --- a/packages/sdk/src/utils/determineRelayChainSymbol.ts +++ b/packages/sdk/src/utils/determineRelayChainSymbol.ts @@ -1,5 +1,5 @@ import { getRelayChainSymbol } from '../pallets/assets' -import { TNodeWithRelayChains } from '../types' +import type { TNodeWithRelayChains } from '../types' export const determineRelayChainSymbol = (node: TNodeWithRelayChains): string => { if (node === 'Polkadot') { diff --git a/packages/sdk/src/utils/generateAddressMultiLocationV4.test.ts b/packages/sdk/src/utils/generateAddressMultiLocationV4.test.ts index 517a796a..8a6473ed 100644 --- a/packages/sdk/src/utils/generateAddressMultiLocationV4.test.ts +++ b/packages/sdk/src/utils/generateAddressMultiLocationV4.test.ts @@ -1,6 +1,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { ApiPromise } from '@polkadot/api' -import { Parents, Version, TAddress } from '../types' +import type { ApiPromise } from '@polkadot/api' +import type { TAddress } from '../types' +import { Parents, Version } from '../types' import { createAccID } from '../utils' import { generateAddressMultiLocationV4 } from './generateAddressMultiLocationV4' import * as ethers from 'ethers' diff --git a/packages/sdk/src/utils/generateAddressMultiLocationV4.ts b/packages/sdk/src/utils/generateAddressMultiLocationV4.ts index f2f471c7..c9325c0f 100644 --- a/packages/sdk/src/utils/generateAddressMultiLocationV4.ts +++ b/packages/sdk/src/utils/generateAddressMultiLocationV4.ts @@ -1,5 +1,6 @@ -import { ApiPromise } from '@polkadot/api' -import { Parents, TAddress, TMultiLocationHeader, Version } from '../types' +import type { ApiPromise } from '@polkadot/api' +import type { TAddress, TMultiLocationHeader } from '../types' +import { Parents, Version } from '../types' import { ethers } from 'ethers' import { createAccID } from '../utils' diff --git a/packages/sdk/src/utils/generateAddressPayload.test.ts b/packages/sdk/src/utils/generateAddressPayload.test.ts index bbb5282b..dda1e642 100644 --- a/packages/sdk/src/utils/generateAddressPayload.test.ts +++ b/packages/sdk/src/utils/generateAddressPayload.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' import * as ethers from 'ethers' -import { Parents, Version, TPallet, TScenario } from '../types' +import type { TPallet, TScenario } from '../types' +import { Parents, Version } from '../types' import { createX1Payload } from './createX1Payload' import { createAccID } from '../utils' import { generateAddressPayload } from './generateAddressPayload' diff --git a/packages/sdk/src/utils/generateAddressPayload.ts b/packages/sdk/src/utils/generateAddressPayload.ts index badf633c..72e7281c 100644 --- a/packages/sdk/src/utils/generateAddressPayload.ts +++ b/packages/sdk/src/utils/generateAddressPayload.ts @@ -1,5 +1,6 @@ -import { ApiPromise } from '@polkadot/api' -import { Parents, TAddress, TMultiLocationHeader, TPallet, TScenario, Version } from '../types' +import type { ApiPromise } from '@polkadot/api' +import type { TAddress, TMultiLocationHeader, TPallet, TScenario } from '../types' +import { Parents, Version } from '../types' import { ethers } from 'ethers' import { createX1Payload } from './createX1Payload' import { createAccID } from '../utils' diff --git a/packages/sdk/src/utils/getAllNodeProviders.test.ts b/packages/sdk/src/utils/getAllNodeProviders.test.ts index 808b9f22..df0a639e 100644 --- a/packages/sdk/src/utils/getAllNodeProviders.test.ts +++ b/packages/sdk/src/utils/getAllNodeProviders.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect, vi } from 'vitest' -import { TNodePolkadotKusama } from '../types' +import type { TNodePolkadotKusama } from '../types' import { getNodeEndpointOption } from '../utils' -import { EndpointOption } from '@polkadot/apps-config/endpoints/types' +import type { EndpointOption } from '@polkadot/apps-config/endpoints/types' import { getAllNodeProviders } from './getAllNodeProviders' vi.mock('../utils', () => ({ diff --git a/packages/sdk/src/utils/getAllNodeProviders.ts b/packages/sdk/src/utils/getAllNodeProviders.ts index b5448269..8bcc991e 100644 --- a/packages/sdk/src/utils/getAllNodeProviders.ts +++ b/packages/sdk/src/utils/getAllNodeProviders.ts @@ -1,4 +1,4 @@ -import { TNodePolkadotKusama } from '../types' +import type { TNodePolkadotKusama } from '../types' import { getNodeEndpointOption } from '../utils' export const getAllNodeProviders = (node: TNodePolkadotKusama): string[] => { diff --git a/packages/sdk/src/utils/getFees.test.ts b/packages/sdk/src/utils/getFees.test.ts index 7ccbc4ef..29dd9ec6 100644 --- a/packages/sdk/src/utils/getFees.test.ts +++ b/packages/sdk/src/utils/getFees.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest' -import { TScenario } from '../types' +import type { TScenario } from '../types' import { getFees } from './getFees' describe('getFees', () => { diff --git a/packages/sdk/src/utils/getFees.ts b/packages/sdk/src/utils/getFees.ts index 343bcddf..32d0b491 100644 --- a/packages/sdk/src/utils/getFees.ts +++ b/packages/sdk/src/utils/getFees.ts @@ -1,4 +1,4 @@ -import { TScenario } from '../types' +import type { TScenario } from '../types' export const getFees = (scenario: TScenario): number => { if (scenario === 'ParaToRelay') { diff --git a/packages/sdk/src/utils/getNode.ts b/packages/sdk/src/utils/getNode.ts index 160d0e14..b1851567 100644 --- a/packages/sdk/src/utils/getNode.ts +++ b/packages/sdk/src/utils/getNode.ts @@ -1,4 +1,4 @@ import { nodes } from '../maps/consts' -import { TNode } from '../types' +import type { TNode } from '../types' export const getNode = (node: T): (typeof nodes)[T] => nodes[node] diff --git a/packages/sdk/src/utils/getNodeEndpointOption.ts b/packages/sdk/src/utils/getNodeEndpointOption.ts index a3c848b4..38ac8ec5 100644 --- a/packages/sdk/src/utils/getNodeEndpointOption.ts +++ b/packages/sdk/src/utils/getNodeEndpointOption.ts @@ -1,5 +1,5 @@ import { prodRelayKusama, prodRelayPolkadot } from '@polkadot/apps-config' -import { TNodePolkadotKusama } from '../types' +import type { TNodePolkadotKusama } from '../types' import { getNode } from './getNode' export const getNodeEndpointOption = (node: TNodePolkadotKusama) => { diff --git a/packages/sdk/src/utils/getNodeProvider.test.ts b/packages/sdk/src/utils/getNodeProvider.test.ts index 6dad83e7..a563f99a 100644 --- a/packages/sdk/src/utils/getNodeProvider.test.ts +++ b/packages/sdk/src/utils/getNodeProvider.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, vi } from 'vitest' -import { TNodeWithRelayChains } from '../types' +import type { TNodeWithRelayChains } from '../types' import { getNode, getNodeProvider } from '.' vi.mock('@polkadot/apps-config', () => ({ diff --git a/packages/sdk/src/utils/getNodeProvider.ts b/packages/sdk/src/utils/getNodeProvider.ts index 3134a882..e65915b9 100644 --- a/packages/sdk/src/utils/getNodeProvider.ts +++ b/packages/sdk/src/utils/getNodeProvider.ts @@ -1,5 +1,5 @@ import { prodRelayKusama, prodRelayPolkadot } from '@polkadot/apps-config' -import { TNodeWithRelayChains } from '../types' +import type { TNodeWithRelayChains } from '../types' import { getNode } from '.' export const getNodeProvider = (node: TNodeWithRelayChains): string => { diff --git a/packages/sdk/src/utils/index.ts b/packages/sdk/src/utils/index.ts index 464f2d97..81ca3492 100644 --- a/packages/sdk/src/utils/index.ts +++ b/packages/sdk/src/utils/index.ts @@ -1,8 +1,8 @@ // Contains important call creation utils (Selection of fees,formating of header and more.. ) -import { ApiPromise } from '@polkadot/api' -import { HexString } from '@polkadot/util/types' -import { TNodeDotKsmWithRelayChains, TNodeWithRelayChains } from '../types' +import type { ApiPromise } from '@polkadot/api' +import type { HexString } from '@polkadot/util/types' +import type { TNodeDotKsmWithRelayChains, TNodeWithRelayChains } from '../types' import { getRelayChainSymbol } from '../pallets/assets' export const createAccID = (api: ApiPromise, account: string): HexString => { diff --git a/packages/sdk/src/utils/verifyMultiLocation.ts b/packages/sdk/src/utils/verifyMultiLocation.ts index faa3d2c7..bb253704 100644 --- a/packages/sdk/src/utils/verifyMultiLocation.ts +++ b/packages/sdk/src/utils/verifyMultiLocation.ts @@ -1,5 +1,5 @@ import { getAssetsObject } from '../pallets/assets' -import { TMultiLocation, TNode } from '../types' +import type { TMultiLocation, TNode } from '../types' import { deepEqual } from './deepEqual' export const verifyMultiLocation = (node: TNode, multiLocation: TMultiLocation) => { diff --git a/packages/sdk/src/utils/verifyMultilocation.test.ts b/packages/sdk/src/utils/verifyMultilocation.test.ts index ae968e63..bd0b984a 100644 --- a/packages/sdk/src/utils/verifyMultilocation.test.ts +++ b/packages/sdk/src/utils/verifyMultilocation.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect, vi } from 'vitest' import * as deepEqual from './deepEqual' import { getAssetsObject } from '../pallets/assets' -import { TNode, TMultiLocation, TNodeAssets } from '../types' +import type { TNode, TMultiLocation, TNodeAssets } from '../types' import { verifyMultiLocation } from './verifyMultiLocation' vi.mock('../pallets/assets', () => ({ diff --git a/packages/xcm-analyser/scripts/example.ts b/packages/xcm-analyser/scripts/example.ts index efa68a8f..ca04e23b 100644 --- a/packages/xcm-analyser/scripts/example.ts +++ b/packages/xcm-analyser/scripts/example.ts @@ -1,4 +1,4 @@ -import { MultiLocation } from '../src/types'; +import type { MultiLocation } from '../src/types'; import { convertMultilocationToUrl, convertXCMToUrls } from '../src/converter/convert'; const multilocation: MultiLocation = { diff --git a/packages/xcm-router/package.json b/packages/xcm-router/package.json index bdf2254b..a83febc8 100644 --- a/packages/xcm-router/package.json +++ b/packages/xcm-router/package.json @@ -75,7 +75,6 @@ "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", "@types/lodash-es": "^4.17.12", - "@types/node": "^22.7.4", "@vitest/coverage-v8": "^2.1.1", "dotenv": "^16.4.5", "prettier": "^3.3.3", diff --git a/packages/xcm-router/src/RouterBuilder.ts b/packages/xcm-router/src/RouterBuilder.ts index 4babae7d..af889dcd 100644 --- a/packages/xcm-router/src/RouterBuilder.ts +++ b/packages/xcm-router/src/RouterBuilder.ts @@ -6,7 +6,8 @@ import { TransactionType, type TTransferOptions, } from '.'; -import { TCurrencyCore, type TNodeWithRelayChains } from '@paraspell/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; +import { type TNodeWithRelayChains } from '@paraspell/sdk'; import { type Signer as EthSigner } from 'ethers'; export interface TRouterBuilderOptions { diff --git a/packages/xcm-router/src/assets/assets.test.ts b/packages/xcm-router/src/assets/assets.test.ts index 1f7eff9e..82367cbc 100644 --- a/packages/xcm-router/src/assets/assets.test.ts +++ b/packages/xcm-router/src/assets/assets.test.ts @@ -6,8 +6,9 @@ import { getSupportedAssetsFrom, getSupportedAssetsTo, } from './assets'; -import { getAssets, TAsset, TCurrencyCore, TNodeWithRelayChains } from '@paraspell/sdk'; -import { TAutoSelect, TExchangeNode } from '../types'; +import type { TAsset, TCurrencyCore, TNodeWithRelayChains } from '@paraspell/sdk'; +import { getAssets } from '@paraspell/sdk'; +import type { TAutoSelect, TExchangeNode } from '../types'; vi.mock('@paraspell/sdk', () => ({ getAssets: vi.fn(), diff --git a/packages/xcm-router/src/assets/assets.ts b/packages/xcm-router/src/assets/assets.ts index a73e5649..af4388c1 100644 --- a/packages/xcm-router/src/assets/assets.ts +++ b/packages/xcm-router/src/assets/assets.ts @@ -1,9 +1,5 @@ -import { - getAssets, - TCurrencyCore, - TNodeWithRelayChains, - TAsset as SdkTAsset, -} from '@paraspell/sdk'; +import type { TCurrencyCore, TNodeWithRelayChains, TAsset as SdkTAsset } from '@paraspell/sdk'; +import { getAssets } from '@paraspell/sdk'; import * as assetsMapJson from '../consts/assets.json' assert { type: 'json' }; import type { TAssetsRecord, TAutoSelect, TExchangeNode } from '../types'; diff --git a/packages/xcm-router/src/dexNodes/Hydration/HydrationDex.test.ts b/packages/xcm-router/src/dexNodes/Hydration/HydrationDex.test.ts index 391f6617..5141409b 100644 --- a/packages/xcm-router/src/dexNodes/Hydration/HydrationDex.test.ts +++ b/packages/xcm-router/src/dexNodes/Hydration/HydrationDex.test.ts @@ -4,7 +4,8 @@ import { describe, expect, it } from 'vitest'; import { type TTransferOptionsModified } from '../../types'; import HydrationExchangeNode from './HydrationDex'; import { MOCK_TRANSFER_OPTIONS, performSwap } from '../../utils/utils.test'; -import { type TNodeWithRelayChains, type TNode, TCurrencyCore } from '@paraspell/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; +import { type TNodeWithRelayChains, type TNode } from '@paraspell/sdk'; import { SmallAmountError } from '../../errors/SmallAmountError'; import type ExchangeNode from '../DexNode'; import { findAssetFrom, findAssetTo } from '../../assets/assets'; diff --git a/packages/xcm-router/src/dexNodes/Hydration/utils.test.ts b/packages/xcm-router/src/dexNodes/Hydration/utils.test.ts index 4cea550c..c9a6a70b 100644 --- a/packages/xcm-router/src/dexNodes/Hydration/utils.test.ts +++ b/packages/xcm-router/src/dexNodes/Hydration/utils.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; -import { Asset, TradeRouter } from '@galacticcouncil/sdk'; -import { TCurrencyCore } from '@paraspell/sdk'; +import type { Asset, TradeRouter } from '@galacticcouncil/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; import { getAssetInfo } from './utils'; describe('getAssetInfo', () => { diff --git a/packages/xcm-router/src/dexNodes/Hydration/utils.ts b/packages/xcm-router/src/dexNodes/Hydration/utils.ts index 238b2ba2..5fad9a31 100644 --- a/packages/xcm-router/src/dexNodes/Hydration/utils.ts +++ b/packages/xcm-router/src/dexNodes/Hydration/utils.ts @@ -1,6 +1,7 @@ import { BigNumber, type TradeRouter, bnum, type Asset } from '@galacticcouncil/sdk'; import { type TSwapOptions } from '../../types'; -import { type TNode, type Extrinsic, getAssetDecimals, TCurrencyCore } from '@paraspell/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; +import { type TNode, type Extrinsic, getAssetDecimals } from '@paraspell/sdk'; import { FEE_BUFFER } from '../../consts/consts'; import { calculateTransactionFee } from '../../utils/utils'; import Logger from '../../Logger/Logger'; diff --git a/packages/xcm-router/src/dexNodes/Interlay/utils.ts b/packages/xcm-router/src/dexNodes/Interlay/utils.ts index 4aeffb6d..fc271dbd 100644 --- a/packages/xcm-router/src/dexNodes/Interlay/utils.ts +++ b/packages/xcm-router/src/dexNodes/Interlay/utils.ts @@ -1,5 +1,6 @@ import { type InterBtcApi, type CurrencyExt } from 'inter-exchange'; -import { TCurrencyCore, type TNode, getAssetId } from '@paraspell/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; +import { type TNode, getAssetId } from '@paraspell/sdk'; export const getCurrency = async ( currency: TCurrencyCore, diff --git a/packages/xcm-router/src/transfer/buildTransferExtrinsics.test.ts b/packages/xcm-router/src/transfer/buildTransferExtrinsics.test.ts index ce3faa7b..5b6bb206 100644 --- a/packages/xcm-router/src/transfer/buildTransferExtrinsics.test.ts +++ b/packages/xcm-router/src/transfer/buildTransferExtrinsics.test.ts @@ -7,10 +7,12 @@ import * as dexNodeFactory from '../dexNodes/DexNodeFactory'; import * as selectBestExchange from './selectBestExchange'; import { buildTransferExtrinsics } from './buildTransferExtrinsics'; import { MOCK_TRANSFER_OPTIONS } from '../utils/utils.test'; -import { TBuildTransferExtrinsicsOptions, TransactionType } from '../types'; +import type { TBuildTransferExtrinsicsOptions } from '../types'; +import { TransactionType } from '../types'; import type ExchangeNode from '../dexNodes/DexNode'; -import { buildEthTransferOptions, createApiInstanceForNode, Extrinsic } from '@paraspell/sdk'; -import { ApiPromise } from '@polkadot/api'; +import type { Extrinsic } from '@paraspell/sdk'; +import { buildEthTransferOptions, createApiInstanceForNode } from '@paraspell/sdk'; +import type { ApiPromise } from '@polkadot/api'; import BigNumber from 'bignumber.js'; vi.mock('@paraspell/sdk', async () => { diff --git a/packages/xcm-router/src/transfer/selectBestExchange.test.ts b/packages/xcm-router/src/transfer/selectBestExchange.test.ts index a5858a85..907f4e48 100644 --- a/packages/xcm-router/src/transfer/selectBestExchange.test.ts +++ b/packages/xcm-router/src/transfer/selectBestExchange.test.ts @@ -8,7 +8,8 @@ import { selectBestExchange } from './selectBestExchange'; import { MOCK_TRANSFER_OPTIONS } from '../utils/utils.test'; import { type TTransferOptions } from '../types'; import type ExchangeNode from '../dexNodes/DexNode'; -import { createApiInstanceForNode, Extrinsic } from '@paraspell/sdk'; +import type { Extrinsic } from '@paraspell/sdk'; +import { createApiInstanceForNode } from '@paraspell/sdk'; import BigNumber from 'bignumber.js'; vi.mock('@paraspell/sdk', async () => { diff --git a/packages/xcm-router/src/transfer/swap.test.ts b/packages/xcm-router/src/transfer/swap.test.ts index 896545ea..b03349db 100644 --- a/packages/xcm-router/src/transfer/swap.test.ts +++ b/packages/xcm-router/src/transfer/swap.test.ts @@ -6,7 +6,7 @@ import BigNumber from 'bignumber.js'; import { MOCK_TRANSFER_OPTIONS } from '../utils/utils.test'; import { swap } from './swap'; import { type Extrinsic } from '@paraspell/sdk'; -import { TTransferOptionsModified } from '../types'; +import type { TTransferOptionsModified } from '../types'; describe('swap', () => { let options: TTransferOptionsModified; diff --git a/packages/xcm-router/src/transfer/transfer.integration.test.ts b/packages/xcm-router/src/transfer/transfer.integration.test.ts index fc879bd6..a9c10c9f 100644 --- a/packages/xcm-router/src/transfer/transfer.integration.test.ts +++ b/packages/xcm-router/src/transfer/transfer.integration.test.ts @@ -1,7 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { transfer } from './transfer'; import { MOCK_TRANSFER_OPTIONS } from '../utils/utils.test'; -import { TransactionType, TTransferOptions } from '../types'; +import type { TTransferOptions } from '../types'; +import { TransactionType } from '../types'; import * as submitTransaction from '../utils/submitTransaction'; describe('transfer - integration', () => { diff --git a/packages/xcm-router/src/transfer/transfer.test.ts b/packages/xcm-router/src/transfer/transfer.test.ts index 51338868..17dff5b0 100644 --- a/packages/xcm-router/src/transfer/transfer.test.ts +++ b/packages/xcm-router/src/transfer/transfer.test.ts @@ -11,10 +11,11 @@ import { MOCK_TRANSFER_OPTIONS } from '../utils/utils.test'; import { TransactionType, type TTransferOptions } from '../types'; import * as selectBestExchange from './selectBestExchange'; import type ExchangeNode from '../dexNodes/DexNode'; -import { Signer as EthSigner } from 'ethers'; -import { Signer } from '@polkadot/types/types'; -import { createApiInstanceForNode, Extrinsic } from '@paraspell/sdk'; -import { ApiPromise } from '@polkadot/api'; +import type { Signer as EthSigner } from 'ethers'; +import type { Signer } from '@polkadot/types/types'; +import type { Extrinsic } from '@paraspell/sdk'; +import { createApiInstanceForNode } from '@paraspell/sdk'; +import type { ApiPromise } from '@polkadot/api'; vi.mock('@paraspell/sdk', async () => { const actual = await vi.importActual('@paraspell/sdk'); diff --git a/packages/xcm-router/src/transfer/transferFromEthereum.test.ts b/packages/xcm-router/src/transfer/transferFromEthereum.test.ts index 342031f3..514a7d85 100644 --- a/packages/xcm-router/src/transfer/transferFromEthereum.test.ts +++ b/packages/xcm-router/src/transfer/transferFromEthereum.test.ts @@ -1,10 +1,11 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { transferFromEthereum } from './transferFromEthereum'; import { EvmBuilder } from '@paraspell/sdk'; -import { TransactionType, TransactionStatus, TTransferOptionsModified } from '../types'; +import type { TTransferOptionsModified } from '../types'; +import { TransactionType, TransactionStatus } from '../types'; import { maybeUpdateTransferStatus } from '../utils/utils'; -import { Signer } from '@polkadot/types/types'; -import { Signer as EthersSigner } from 'ethers'; +import type { Signer } from '@polkadot/types/types'; +import type { Signer as EthersSigner } from 'ethers'; vi.mock('@paraspell/sdk', () => ({ EvmBuilder: vi.fn().mockImplementation((_provider) => diff --git a/packages/xcm-router/src/transfer/transferFromEthereum.ts b/packages/xcm-router/src/transfer/transferFromEthereum.ts index 3875c660..73839e33 100644 --- a/packages/xcm-router/src/transfer/transferFromEthereum.ts +++ b/packages/xcm-router/src/transfer/transferFromEthereum.ts @@ -1,7 +1,9 @@ import { EvmBuilder } from '@paraspell/sdk'; -import { TTransferOptionsModified, TransactionType, TransactionStatus } from '../types'; +import type { TTransferOptionsModified } from '../types'; +import { TransactionType, TransactionStatus } from '../types'; import { maybeUpdateTransferStatus } from '../utils/utils'; -import { ethers, Signer } from 'ethers'; +import type { Signer } from 'ethers'; +import { ethers } from 'ethers'; export const transferFromEthereum = async (options: TTransferOptionsModified) => { const { onStatusChange, amount, currencyFrom, ethSigner, assetHubAddress } = options; diff --git a/packages/xcm-router/src/transfer/transferToEthereum.test.ts b/packages/xcm-router/src/transfer/transferToEthereum.test.ts index f068210c..f93eca7b 100644 --- a/packages/xcm-router/src/transfer/transferToEthereum.test.ts +++ b/packages/xcm-router/src/transfer/transferToEthereum.test.ts @@ -1,12 +1,13 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { transferToEthereum } from './transferToEthereum'; import { createApiInstanceForNode } from '@paraspell/sdk'; -import { TransactionType, TransactionStatus, TTransferOptionsModified } from '../types'; +import type { TTransferOptionsModified } from '../types'; +import { TransactionType, TransactionStatus } from '../types'; import { maybeUpdateTransferStatus } from '../utils/utils'; import { submitTransferToDestination } from './utils'; -import { Signer } from '@polkadot/types/types'; -import { Signer as EthersSigner } from 'ethers'; -import { ApiPromise } from '@polkadot/api'; +import type { Signer } from '@polkadot/types/types'; +import type { Signer as EthersSigner } from 'ethers'; +import type { ApiPromise } from '@polkadot/api'; vi.mock('@paraspell/sdk', () => ({ createApiInstanceForNode: vi.fn(), diff --git a/packages/xcm-router/src/transfer/transferToEthereum.ts b/packages/xcm-router/src/transfer/transferToEthereum.ts index e173ffd9..ba2e2165 100644 --- a/packages/xcm-router/src/transfer/transferToEthereum.ts +++ b/packages/xcm-router/src/transfer/transferToEthereum.ts @@ -1,5 +1,6 @@ import { createApiInstanceForNode } from '@paraspell/sdk'; -import { TransactionType, TransactionStatus, TTransferOptionsModified } from '../types'; +import type { TTransferOptionsModified } from '../types'; +import { TransactionType, TransactionStatus } from '../types'; import { maybeUpdateTransferStatus } from '../utils/utils'; import { submitTransferToDestination } from './utils'; diff --git a/packages/xcm-router/src/transfer/utils.ts b/packages/xcm-router/src/transfer/utils.ts index ac89fbbf..7358c070 100644 --- a/packages/xcm-router/src/transfer/utils.ts +++ b/packages/xcm-router/src/transfer/utils.ts @@ -1,10 +1,8 @@ -import { type Extrinsic, Builder, TAsset, TCurrencyCore } from '@paraspell/sdk'; +import type { TAsset, TCurrencyCore } from '@paraspell/sdk'; +import { type Extrinsic, Builder } from '@paraspell/sdk'; import { type ApiPromise } from '@polkadot/api'; -import { - TExchangeNode, - type TCommonTransferOptionsModified, - type TTransferOptionsModified, -} from '../types'; +import type { TExchangeNode } from '../types'; +import { type TCommonTransferOptionsModified, type TTransferOptionsModified } from '../types'; import { validateRelayChainCurrency } from '../utils/utils'; import { submitTransaction } from '../utils/submitTransaction'; import { ethers } from 'ethers'; diff --git a/packages/xcm-router/src/types.ts b/packages/xcm-router/src/types.ts index fa538ca6..8d36a66e 100644 --- a/packages/xcm-router/src/types.ts +++ b/packages/xcm-router/src/types.ts @@ -8,7 +8,7 @@ import type { } from '@paraspell/sdk'; import { type Signer } from '@polkadot/types/types'; import { type EXCHANGE_NODES } from './consts/consts'; -import { Signer as EthSigner } from 'ethers'; +import type { Signer as EthSigner } from 'ethers'; export type TExchangeNode = (typeof EXCHANGE_NODES)[number]; diff --git a/packages/xcm-router/src/utils/utils.ts b/packages/xcm-router/src/utils/utils.ts index e1a991f9..7b1c2499 100644 --- a/packages/xcm-router/src/utils/utils.ts +++ b/packages/xcm-router/src/utils/utils.ts @@ -1,9 +1,5 @@ -import { - type TNodeWithRelayChains, - type Extrinsic, - InvalidCurrencyError, - TCurrencyCore, -} from '@paraspell/sdk'; +import type { TCurrencyCore } from '@paraspell/sdk'; +import { type TNodeWithRelayChains, type Extrinsic, InvalidCurrencyError } from '@paraspell/sdk'; import BigNumber from 'bignumber.js'; import { type TTxProgressInfo } from '../types'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 96b04f4f..3c071715 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,6 +22,9 @@ importers: '@types/eslint__js': specifier: ^8.42.3 version: 8.42.3 + '@types/node': + specifier: ^22.7.4 + version: 22.7.4 eslint: specifier: ^9.11.1 version: 9.11.1(jiti@1.21.3) @@ -168,9 +171,6 @@ importers: '@playwright/test': specifier: ^1.47.2 version: 1.47.2 - '@types/node': - specifier: ^22.7.4 - version: 22.7.4 '@types/react': specifier: ^18.3.10 version: 18.3.10 @@ -338,9 +338,6 @@ importers: '@types/jsdom': specifier: ^21.1.7 version: 21.1.7 - '@types/node': - specifier: ^22.7.4 - version: 22.7.4 '@types/supertest': specifier: ^6.0.2 version: 6.0.2 @@ -480,9 +477,6 @@ importers: '@types/d3-ease': specifier: ^3.0.2 version: 3.0.2 - '@types/node': - specifier: ^22.7.4 - version: 22.7.4 '@types/react': specifier: ^18.3.10 version: 18.3.10 @@ -637,9 +631,6 @@ importers: '@types/express': specifier: ^5.0.0 version: 5.0.0 - '@types/node': - specifier: ^22.7.4 - version: 22.7.4 '@types/nodemailer': specifier: ^6.4.16 version: 6.4.16 @@ -716,9 +707,6 @@ importers: '@rollup/plugin-json': specifier: ^6.1.0 version: 6.1.0(rollup@4.22.5) - '@types/node': - specifier: ^22.7.4 - version: 22.7.4 '@vitest/coverage-v8': specifier: ^2.1.1 version: 2.1.1(vitest@2.1.1(@types/node@22.7.4)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10))(sugarss@4.0.1(postcss@8.4.47))(terser@5.31.0)) @@ -901,9 +889,6 @@ importers: '@types/lodash-es': specifier: ^4.17.12 version: 4.17.12 - '@types/node': - specifier: ^22.7.4 - version: 22.7.4 '@vitest/coverage-v8': specifier: ^2.1.1 version: 2.1.1(vitest@2.1.1(@types/node@22.7.4)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10))(sugarss@4.0.1(postcss@8.4.47))(terser@5.31.0))