From dab4aa9181cba563d31e4ae07224e755a88ab86d Mon Sep 17 00:00:00 2001 From: Tudor Morar Date: Tue, 26 Nov 2024 09:23:31 +0200 Subject: [PATCH 1/2] Lint project --- eslint.config.mjs | 25 +- package.json | 2 + src/__mocks__/utils/mockWindowHistory.ts | 2 - src/__mocks__/utils/mockWindowLocation.ts | 2 - src/apiCalls/account/getAccountFromApi.ts | 2 +- .../configuration/getNetworkConfigFromApi.ts | 2 +- .../configuration/getServerConfiguration.ts | 2 +- .../transactions/getTransactionByHash.ts | 2 +- .../transactions/getTransactionsByHashes.ts | 2 +- src/apiCalls/utils/getScamAddressData.ts | 4 +- src/core/methods/initApp/initApp.ts | 12 +- src/core/methods/initApp/initApp.types.ts | 4 +- .../initializeWebsocketConnection.ts | 23 +- .../initApp/websocket/registerWebsocket.ts | 4 +- .../sendTransactions/sendTransactions.ts | 2 +- .../checkTransactionStatus/checkBatch.ts | 28 +- .../checkTransactionStatus.ts | 2 +- .../trackTransactions/trackTransactions.ts | 9 +- .../login/helpers/extractAccountFromToken.ts | 6 +- .../helpers/login/helpers/getLoginService.ts | 6 +- .../DappProvider/helpers/login/login.ts | 10 +- .../helpers/getGuardedTransactions.ts | 2 +- .../signTransactions/signTransactions.ts | 2 +- src/core/providers/accountProvider.ts | 2 +- src/core/providers/helpers/emptyProvider.ts | 14 +- .../LedgerModalComponent.ts | 4 +- .../helpers/getAuthTokenText.ts | 5 +- .../tests/getLedgerVersionOptions.test.ts | 2 +- .../helpers/ledger/createLedgerProvider.ts | 19 +- .../helpers/ledger/getLedgerProvider.ts | 3 +- src/core/providers/helpers/utils.ts | 4 +- .../helpers/decodeNativeAuthToken.ts | 2 +- .../nativeAuth/helpers/getLatestBlockHash.ts | 2 +- src/storage/local.ts | 2 +- src/store/actions/account/accountActions.ts | 6 +- src/store/actions/config/configActions.ts | 2 +- .../actions/loginInfo/loginInfoActions.ts | 4 +- .../actions/network/initializeNetwork.ts | 4 +- src/store/actions/network/networkActions.ts | 3 +- .../actions/sharedActions/sharedActions.ts | 4 +- src/store/middleware/logoutMiddleware.ts | 6 +- src/store/slices/loginInfo/loginInfo.types.ts | 2 +- src/store/slices/network/networkSlice.ts | 2 +- src/store/storage/inMemoryStorage.ts | 44 +- src/store/storage/index.ts | 4 +- src/store/storage/storageCallback.ts | 2 +- src/store/store.ts | 25 +- src/store/store.types.ts | 2 +- src/types/index.ts | 2 +- src/types/transactions.types.ts | 2 +- src/utils/decoders/base64Utils.ts | 2 +- src/utils/decoders/decodePart.ts | 1 + src/utils/decoders/isAscii.ts | 1 + src/utils/decoders/isUtf8.ts | 4 +- src/utils/decoders/tests/isUtf8.test.ts | 4 +- src/utils/retryMultipleTimes.ts | 5 +- src/utils/validation/isContract.ts | 2 +- src/utils/validation/stringIsFloat.ts | 1 - .../validation/tests/stringIsFloat.test.ts | 2 +- src/utils/window/matchPath.ts | 47 ++- yarn.lock | 387 ++++++++++-------- 61 files changed, 429 insertions(+), 355 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index ae9d9c8..b3bd4b6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,15 +3,17 @@ import pluginJs from '@eslint/js'; import tseslint from 'typescript-eslint'; import importPlugin from 'eslint-plugin-import'; import prettierPlugin from 'eslint-plugin-prettier'; +import jestPlugin from 'eslint-plugin-jest'; /** @type {import('eslint').Linter.Config[]} */ export default [ { - files: ['**/*.{js,mjs,cjs,ts,tsx}'], + files: ['**/*.{js,mjs,cjs,ts,tsx}', '**/*.{test,spec}.{js,ts,tsx}'], languageOptions: { globals: { ...globals.browser, - ...globals.node + ...globals.node, + ...globals.jest }, parser: tseslint.parser, parserOptions: { @@ -26,6 +28,7 @@ export default [ plugins: { import: importPlugin, prettier: prettierPlugin, + jest: jestPlugin, '@typescript-eslint': tseslint.plugin }, settings: { @@ -43,6 +46,7 @@ export default [ } }, rules: { + ...jestPlugin.configs.recommended.rules, ...pluginJs.configs.recommended.rules, ...tseslint.configs.recommended.rules, 'import/order': [ @@ -74,21 +78,20 @@ export default [ '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-unused-vars': [ 'error', - { argsIgnorePattern: '^_' } + { + argsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_' + } ], '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/explicit-function-return-type': 'off', 'linebreak-style': ['error', 'unix'], quotes: ['error', 'single'], semi: ['error', 'always'], - 'no-unused-vars': [ - 'error', - { - varsIgnorePattern: '^_', - argsIgnorePattern: '^_', - destructuredArrayIgnorePattern: '^_' - } - ], + 'no-unused-vars': ['off'], + 'no-prototype-builtins': 'off', + 'jest/no-mocks-import': 'off', + 'no-async-promise-executor': 'off', 'object-curly-newline': 'off', 'arrow-body-style': 'off', 'implicit-arrow-linebreak': 'off', diff --git a/package.json b/package.json index 1c080ac..4628ced 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "build-esbuild": "rimraf out && node esbuild.js", "build": "yarn build-esbuild && yarn compile", "test": "jest", + "lint": "eslint --fix src", "compile-next": "rimraf out && tsc --p tsconfig.next.json && tsc-alias --project tsconfig.next.json" }, "publishConfig": { @@ -81,6 +82,7 @@ "eslint-config-standard": "17.1.0", "eslint-import-resolver-typescript": "3.6.3", "eslint-plugin-import": "2.31.0", + "eslint-plugin-jest": "^28.9.0", "eslint-plugin-node": "11.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-promise": "7.1.0", diff --git a/src/__mocks__/utils/mockWindowHistory.ts b/src/__mocks__/utils/mockWindowHistory.ts index 71b0e74..b1baa73 100644 --- a/src/__mocks__/utils/mockWindowHistory.ts +++ b/src/__mocks__/utils/mockWindowHistory.ts @@ -5,11 +5,9 @@ export const mockWindowHistory = () => { const history = window.history; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore delete window.history; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore window.history = Object.defineProperties( {}, diff --git a/src/__mocks__/utils/mockWindowLocation.ts b/src/__mocks__/utils/mockWindowLocation.ts index 765ea51..5fbc666 100644 --- a/src/__mocks__/utils/mockWindowLocation.ts +++ b/src/__mocks__/utils/mockWindowLocation.ts @@ -5,11 +5,9 @@ export const mockWindowLocation = () => { const location = window.location; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore delete window.location; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore window.location = Object.defineProperties( {}, diff --git a/src/apiCalls/account/getAccountFromApi.ts b/src/apiCalls/account/getAccountFromApi.ts index 001403f..79a1dbb 100644 --- a/src/apiCalls/account/getAccountFromApi.ts +++ b/src/apiCalls/account/getAccountFromApi.ts @@ -20,7 +20,7 @@ export const getAccountFromApi = async (address?: string) => { try { const { data } = await accountFetcher(address); return data as AccountType; - } catch (err) { + } catch (_err) { console.error('error fetching configuration for ', address); } diff --git a/src/apiCalls/configuration/getNetworkConfigFromApi.ts b/src/apiCalls/configuration/getNetworkConfigFromApi.ts index 85b831f..627a6b6 100644 --- a/src/apiCalls/configuration/getNetworkConfigFromApi.ts +++ b/src/apiCalls/configuration/getNetworkConfigFromApi.ts @@ -27,7 +27,7 @@ export async function getNetworkConfigFromApi() { if (data != null) { return data?.data?.config; } - } catch (err) { + } catch (_err) { console.error('error fetching configuration for ', configUrl); } return null; diff --git a/src/apiCalls/configuration/getServerConfiguration.ts b/src/apiCalls/configuration/getServerConfiguration.ts index a1cfc6a..862c6f6 100644 --- a/src/apiCalls/configuration/getServerConfiguration.ts +++ b/src/apiCalls/configuration/getServerConfiguration.ts @@ -8,7 +8,7 @@ export async function getServerConfiguration(apiAddress: string) { try { const { data } = await axios.get(configUrl); return data; - } catch (err) { + } catch (_err) { console.error('error fetching configuration for ', configUrl); } return null; diff --git a/src/apiCalls/transactions/getTransactionByHash.ts b/src/apiCalls/transactions/getTransactionByHash.ts index 6d8d591..98a514c 100644 --- a/src/apiCalls/transactions/getTransactionByHash.ts +++ b/src/apiCalls/transactions/getTransactionByHash.ts @@ -1,7 +1,7 @@ import axios from 'axios'; import { TRANSACTIONS_ENDPOINT } from 'apiCalls/endpoints'; -import { getState } from 'store/store'; import { networkSelector } from 'store/selectors'; +import { getState } from 'store/store'; import { ServerTransactionType } from 'types/serverTransactions.types'; export const getTransactionByHash = (hash: string) => { diff --git a/src/apiCalls/transactions/getTransactionsByHashes.ts b/src/apiCalls/transactions/getTransactionsByHashes.ts index 4df726f..ed5856e 100644 --- a/src/apiCalls/transactions/getTransactionsByHashes.ts +++ b/src/apiCalls/transactions/getTransactionsByHashes.ts @@ -1,8 +1,8 @@ import axios from 'axios'; import { TRANSACTIONS_ENDPOINT } from 'apiCalls/endpoints'; -import { getState } from 'store/store'; import { networkSelector } from 'store/selectors'; +import { getState } from 'store/store'; import { GetTransactionsByHashesReturnType, PendingTransactionsType diff --git a/src/apiCalls/utils/getScamAddressData.ts b/src/apiCalls/utils/getScamAddressData.ts index 8e1779b..ceef614 100644 --- a/src/apiCalls/utils/getScamAddressData.ts +++ b/src/apiCalls/utils/getScamAddressData.ts @@ -1,8 +1,8 @@ import axios from 'axios'; -import { ScamInfoType } from 'types/account.types'; -import { ACCOUNTS_ENDPOINT } from '../endpoints'; import { networkSelector } from 'store/selectors'; import { getState } from 'store/store'; +import { ScamInfoType } from 'types/account.types'; +import { ACCOUNTS_ENDPOINT } from '../endpoints'; export async function getScamAddressData(addressToVerify: string) { const { apiAddress, apiTimeout } = networkSelector(getState()); diff --git a/src/core/methods/initApp/initApp.ts b/src/core/methods/initApp/initApp.ts index 9c9bc39..c83d67e 100644 --- a/src/core/methods/initApp/initApp.ts +++ b/src/core/methods/initApp/initApp.ts @@ -1,12 +1,12 @@ -import { initStore } from 'store/store'; -import { defaultStorageCallback } from 'store/storage'; -import { setNativeAuthConfig } from 'store/actions/config/configActions'; -import { initializeNetwork } from 'store/actions'; -import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; +import { restoreProvider } from 'core/providers/helpers/restoreProvider'; import { getDefaultNativeAuthConfig } from 'services/nativeAuth/methods/getDefaultNativeAuthConfig'; +import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; +import { initializeNetwork } from 'store/actions'; +import { setNativeAuthConfig } from 'store/actions/config/configActions'; +import { defaultStorageCallback } from 'store/storage'; +import { initStore } from 'store/store'; import { InitAppType } from './initApp.types'; import { getIsLoggedIn } from '../account/getIsLoggedIn'; -import { restoreProvider } from 'core/providers/helpers/restoreProvider'; import { registerWebsocketListener } from './websocket/registerWebsocket'; import { trackTransactions } from '../trackTransactions/trackTransactions'; diff --git a/src/core/methods/initApp/initApp.types.ts b/src/core/methods/initApp/initApp.types.ts index f4121e7..d53d8e3 100644 --- a/src/core/methods/initApp/initApp.types.ts +++ b/src/core/methods/initApp/initApp.types.ts @@ -1,7 +1,7 @@ +import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; import { StorageCallback } from 'store/storage'; -import { CustomNetworkType } from 'types/network.types'; import { EnvironmentsEnum } from 'types/enums.types'; -import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; +import { CustomNetworkType } from 'types/network.types'; type BaseDappConfigType = { /** diff --git a/src/core/methods/initApp/websocket/initializeWebsocketConnection.ts b/src/core/methods/initApp/websocket/initializeWebsocketConnection.ts index ddb2684..ddc931b 100644 --- a/src/core/methods/initApp/websocket/initializeWebsocketConnection.ts +++ b/src/core/methods/initApp/websocket/initializeWebsocketConnection.ts @@ -1,18 +1,18 @@ import { io } from 'socket.io-client'; -import { retryMultipleTimes } from 'utils/retryMultipleTimes'; -import { - BatchTransactionsWSResponseType, - websocketConnection, - WebsocketConnectionStatusEnum -} from './websocket.constants'; import { getWebsocketUrl } from 'apiCalls/websocket'; -import { getStore } from 'store/store'; import { getAccount } from 'core/methods/account/getAccount'; -import { networkSelector } from 'store/selectors'; import { setWebsocketBatchEvent, setWebsocketEvent } from 'store/actions/account/accountActions'; +import { networkSelector } from 'store/selectors'; +import { getStore } from 'store/store'; +import { retryMultipleTimes } from 'utils/retryMultipleTimes'; +import { + BatchTransactionsWSResponseType, + websocketConnection, + WebsocketConnectionStatusEnum +} from './websocket.constants'; const TIMEOUT = 3000; const RECONNECTION_ATTEMPTS = 3; @@ -22,12 +22,15 @@ const BATCH_UPDATED_EVENT = 'batchUpdated'; const CONNECT = 'connect'; const DISCONNECT = 'disconnect'; +// eslint-disable-next-line no-undef +type TimeoutType = NodeJS.Timeout | null; + export async function initializeWebsocketConnection() { const { address } = getAccount(); const { apiAddress } = networkSelector(getStore().getState()); - let messageTimeout: NodeJS.Timeout | null = null; - let batchTimeout: NodeJS.Timeout | null = null; + let messageTimeout: TimeoutType = null; + let batchTimeout: TimeoutType = null; const handleMessageReceived = (message: string) => { if (messageTimeout) { diff --git a/src/core/methods/initApp/websocket/registerWebsocket.ts b/src/core/methods/initApp/websocket/registerWebsocket.ts index baa2123..13a65cd 100644 --- a/src/core/methods/initApp/websocket/registerWebsocket.ts +++ b/src/core/methods/initApp/websocket/registerWebsocket.ts @@ -1,6 +1,6 @@ -import { initializeWebsocketConnection } from './initializeWebsocketConnection'; -import { getStore } from 'store/store'; import { getAccount } from 'core/methods/account/getAccount'; +import { getStore } from 'store/store'; +import { initializeWebsocketConnection } from './initializeWebsocketConnection'; let localAddress = ''; let closeConnectionRef: () => void; diff --git a/src/core/methods/sendTransactions/sendTransactions.ts b/src/core/methods/sendTransactions/sendTransactions.ts index 1ab4d31..d1a5bc3 100644 --- a/src/core/methods/sendTransactions/sendTransactions.ts +++ b/src/core/methods/sendTransactions/sendTransactions.ts @@ -1,7 +1,7 @@ import { Transaction } from '@multiversx/sdk-core/out'; import { AxiosError } from 'axios'; -import { sendSignedTransactions } from './helpers/sendSignedTransactions'; import { createTransactionsSession } from 'store/actions/transactions/transactionsActions'; +import { sendSignedTransactions } from './helpers/sendSignedTransactions'; export async function sendTransactions( transactions: Transaction[] = [] diff --git a/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts b/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts index cfb0727..e789db8 100644 --- a/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts +++ b/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkBatch.ts @@ -1,29 +1,23 @@ +import { getTransactionsByHashes } from 'apiCalls/transactions/getTransactionsByHashes'; +import { + updateSignedTransactionStatus, + updateTransactionsSession +} from 'store/actions/transactions/transactionsActions'; +import { getIsTransactionFailed } from 'store/actions/transactions/transactionStateByStatus'; import { TransactionBatchStatusesEnum, TransactionServerStatusesEnum } from 'types/enums.types'; +import { ServerTransactionType } from 'types/serverTransactions.types'; +import { + GetTransactionsByHashesReturnType, + SignedTransactionType +} from 'types/transactions.types'; import { refreshAccount } from 'utils/account'; import { getPendingTransactions } from './getPendingTransactions'; import { manageFailedTransactions } from './manageFailedTransactions'; import { TransactionsTrackerType } from '../../trackTransactions.types'; -import { - GetTransactionsByHashesReturnType, - SignedTransactionType -} from 'types/transactions.types'; -import { - BatchTransactionStatus, - ServerTransactionType -} from 'types/serverTransactions.types'; -import { - updateSignedTransactionStatus, - updateTransactionsSession -} from 'store/actions/transactions/transactionsActions'; -import { - getIsTransactionFailed, - getIsTransactionSuccessful -} from 'store/actions/transactions/transactionStateByStatus'; -import { getTransactionsByHashes } from 'apiCalls/transactions/getTransactionsByHashes'; export interface TransactionStatusTrackerPropsType extends TransactionsTrackerType { diff --git a/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.ts b/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.ts index 7fe219d..bf9877c 100644 --- a/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.ts +++ b/src/core/methods/trackTransactions/helpers/checkTransactionStatus/checkTransactionStatus.ts @@ -1,7 +1,7 @@ import { refreshAccount } from 'utils/account'; import { checkBatch } from './checkBatch'; -import { getPendingStoreTransactions } from '../getPendingStoreTransactions'; import { TransactionsTrackerType } from '../../trackTransactions.types'; +import { getPendingStoreTransactions } from '../getPendingStoreTransactions'; export async function checkTransactionStatus( props: TransactionsTrackerType & { diff --git a/src/core/methods/trackTransactions/trackTransactions.ts b/src/core/methods/trackTransactions/trackTransactions.ts index 895d527..62b9f8a 100644 --- a/src/core/methods/trackTransactions/trackTransactions.ts +++ b/src/core/methods/trackTransactions/trackTransactions.ts @@ -1,13 +1,13 @@ import { getTransactionsByHashes as defaultGetTxByHash } from 'apiCalls/transactions/getTransactionsByHashes'; -import { TransactionsTrackerType } from './trackTransactions.types'; -import { getPollingInterval } from './helpers/getPollingInterval'; +import { websocketEventSelector } from 'store/selectors/accountSelectors'; +import { getStore } from 'store/store'; import { checkTransactionStatus } from './helpers/checkTransactionStatus'; +import { getPollingInterval } from './helpers/getPollingInterval'; +import { TransactionsTrackerType } from './trackTransactions.types'; import { websocketConnection, WebsocketConnectionStatusEnum } from '../initApp/websocket/websocket.constants'; -import { getStore } from 'store/store'; -import { websocketEventSelector } from 'store/selectors/accountSelectors'; /** * Tracks transactions using websocket or polling @@ -17,6 +17,7 @@ import { websocketEventSelector } from 'store/selectors/accountSelectors'; export async function trackTransactions(props?: TransactionsTrackerType) { const store = getStore(); const pollingInterval = getPollingInterval(); + // eslint-disable-next-line no-undef let pollingIntervalTimer: NodeJS.Timeout | null = null; let timestamp = websocketEventSelector(store.getState())?.timestamp; diff --git a/src/core/providers/DappProvider/helpers/login/helpers/extractAccountFromToken.ts b/src/core/providers/DappProvider/helpers/login/helpers/extractAccountFromToken.ts index 4a7c495..e9802fa 100644 --- a/src/core/providers/DappProvider/helpers/login/helpers/extractAccountFromToken.ts +++ b/src/core/providers/DappProvider/helpers/login/helpers/extractAccountFromToken.ts @@ -1,10 +1,10 @@ -import { setAccount } from 'store/actions/account'; -import { setLoginToken } from 'store/actions/loginInfo/loginInfoActions'; +import { getLatestNonce } from 'core/methods/account/getLatestNonce'; import { IProvider } from 'core/providers/types/providerFactory.types'; import { loginAction } from 'store/actions'; +import { setAccount } from 'store/actions/account'; +import { setLoginToken } from 'store/actions/loginInfo/loginInfoActions'; import { AccountType } from 'types/account.types'; import { getAccountFromToken } from './getAccountFromToken'; -import { getLatestNonce } from 'core/methods/account/getLatestNonce'; interface IExtractAccountFromTokenProps { loginToken: string; diff --git a/src/core/providers/DappProvider/helpers/login/helpers/getLoginService.ts b/src/core/providers/DappProvider/helpers/login/helpers/getLoginService.ts index 9484555..5bed9e3 100644 --- a/src/core/providers/DappProvider/helpers/login/helpers/getLoginService.ts +++ b/src/core/providers/DappProvider/helpers/login/helpers/getLoginService.ts @@ -1,12 +1,12 @@ import { Address, Message } from '@multiversx/sdk-core'; +import { getAccount } from 'core/methods/account/getAccount'; import { nativeAuth } from 'services/nativeAuth'; import { buildNativeAuthConfig } from 'services/nativeAuth/methods'; +import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; +import { setTokenLogin } from 'store/actions/loginInfo/loginInfoActions'; import { networkSelector, tokenLoginSelector } from 'store/selectors'; import { getState } from 'store/store'; import { OnProviderLoginType } from 'types/login.types'; -import { setTokenLogin } from 'store/actions/loginInfo/loginInfoActions'; -import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; -import { getAccount } from 'core/methods/account/getAccount'; const getApiAddress = ( apiAddress: string, diff --git a/src/core/providers/DappProvider/helpers/login/login.ts b/src/core/providers/DappProvider/helpers/login/login.ts index 5621e47..d03b0f5 100644 --- a/src/core/providers/DappProvider/helpers/login/login.ts +++ b/src/core/providers/DappProvider/helpers/login/login.ts @@ -1,13 +1,13 @@ +import { registerWebsocketListener } from 'core/methods/initApp/websocket/registerWebsocket'; +import { IProvider } from 'core/providers/types/providerFactory.types'; import { nativeAuth } from 'services/nativeAuth'; +import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; +import { logoutAction } from 'store/actions'; import { setAddress } from 'store/actions/account'; import { setTokenLogin } from 'store/actions/loginInfo/loginInfoActions'; -import { IProvider } from 'core/providers/types/providerFactory.types'; import { nativeAuthConfigSelector } from 'store/selectors'; import { getState } from 'store/store'; -import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; -import { logoutAction } from 'store/actions'; import { extractAccountFromToken } from './helpers/extractAccountFromToken'; -import { registerWebsocketListener } from 'core/methods/initApp/websocket/registerWebsocket'; async function loginWithoutNativeToken(provider: IProvider) { await provider.login(); @@ -36,7 +36,7 @@ async function loginWithNativeToken( noCache: true }); - const { address, signature, ...loginResult } = await provider.login?.({ + const { address, signature, ...loginResult } = await provider.login({ token: loginToken }); diff --git a/src/core/providers/DappProvider/helpers/signTransactions/helpers/getGuardedTransactions.ts b/src/core/providers/DappProvider/helpers/signTransactions/helpers/getGuardedTransactions.ts index ef37601..dd93993 100644 --- a/src/core/providers/DappProvider/helpers/signTransactions/helpers/getGuardedTransactions.ts +++ b/src/core/providers/DappProvider/helpers/signTransactions/helpers/getGuardedTransactions.ts @@ -1,7 +1,7 @@ import { Transaction } from '@multiversx/sdk-core'; -import { getAreAllTransactionsSignedByGuardian } from './getAreAllTransactionsSignedByGuardian'; import { getAccount } from 'core/methods/account/getAccount'; import { createCrossWindowProvider } from 'core/providers/helpers/crossWindow/createCrossWindowProvider'; +import { getAreAllTransactionsSignedByGuardian } from './getAreAllTransactionsSignedByGuardian'; export async function getGuardedTransactions({ transactions diff --git a/src/core/providers/DappProvider/helpers/signTransactions/signTransactions.ts b/src/core/providers/DappProvider/helpers/signTransactions/signTransactions.ts index 9fcef10..4b2df57 100644 --- a/src/core/providers/DappProvider/helpers/signTransactions/signTransactions.ts +++ b/src/core/providers/DappProvider/helpers/signTransactions/signTransactions.ts @@ -4,9 +4,9 @@ import { TransactionOptions, TransactionVersion } from '@multiversx/sdk-core/out'; -import { getGuardedTransactions } from './helpers/getGuardedTransactions'; import { getAccount } from 'core/methods/account/getAccount'; import { IProvider } from 'core/providers/types/providerFactory.types'; +import { getGuardedTransactions } from './helpers/getGuardedTransactions'; export type SignTransactionsOptionsType = { skipGuardian?: boolean; diff --git a/src/core/providers/accountProvider.ts b/src/core/providers/accountProvider.ts index 9c15487..669d697 100644 --- a/src/core/providers/accountProvider.ts +++ b/src/core/providers/accountProvider.ts @@ -1,6 +1,6 @@ +import { IProvider } from 'core/providers/types/providerFactory.types'; import { DappProvider } from './DappProvider'; import { emptyProvider } from './helpers/emptyProvider'; -import { IProvider } from 'core/providers/types/providerFactory.types'; export type ProvidersType = IProvider; diff --git a/src/core/providers/helpers/emptyProvider.ts b/src/core/providers/helpers/emptyProvider.ts index 0ff44e8..524fd15 100644 --- a/src/core/providers/helpers/emptyProvider.ts +++ b/src/core/providers/helpers/emptyProvider.ts @@ -1,13 +1,13 @@ import { Message, Transaction } from '@multiversx/sdk-core'; -import { EngineTypes } from 'utils/walletconnect/__sdkWalletconnectProvider'; -import { - IProvider, - ProviderTypeEnum -} from 'core/providers/types/providerFactory.types'; import { IDAppProviderAccount, IDAppProviderOptions } from '@multiversx/sdk-dapp-utils/out'; +import { + IProvider, + ProviderTypeEnum +} from 'core/providers/types/providerFactory.types'; +import { EngineTypes } from 'utils/walletconnect/__sdkWalletconnectProvider'; export const DAPP_INIT_ROUTE = '/dapp/init'; @@ -33,7 +33,7 @@ export class EmptyProvider implements IProvider { } getAccount(): IDAppProviderAccount | null { - throw new Error(notInitializedError(`unable to get account`)); + throw new Error(notInitializedError('unable to get account')); } setAccount(account: IDAppProviderAccount): void { throw new Error( @@ -115,7 +115,7 @@ export class EmptyProvider implements IProvider { } getTokenLoginSignature(): string | undefined { - throw new Error(notInitializedError(`getSignature`)); + throw new Error(notInitializedError('getSignature')); } getType(): ProviderTypeEnum { diff --git a/src/core/providers/helpers/ledger/components/LedgerModalComponent/LedgerModalComponent.ts b/src/core/providers/helpers/ledger/components/LedgerModalComponent/LedgerModalComponent.ts index 2b12a2a..6953a10 100644 --- a/src/core/providers/helpers/ledger/components/LedgerModalComponent/LedgerModalComponent.ts +++ b/src/core/providers/helpers/ledger/components/LedgerModalComponent/LedgerModalComponent.ts @@ -2,9 +2,9 @@ import { LitElement, html } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import { ledgerStyles } from './ldegerModalComponent.styles'; import { ILedgerAccount } from '../../ledger.types'; -import { renderInModal } from './components/renderInModal'; -import { renderAccounts } from './components/renderAccounts'; import { EventBus } from '../EventBus'; +import { renderAccounts } from './components/renderAccounts'; +import { renderInModal } from './components/renderInModal'; export interface IConnectScreenData { customContentMarkup?: string; diff --git a/src/core/providers/helpers/ledger/components/LedgerModalComponent/helpers/getAuthTokenText.ts b/src/core/providers/helpers/ledger/components/LedgerModalComponent/helpers/getAuthTokenText.ts index e86fe26..1756d47 100644 --- a/src/core/providers/helpers/ledger/components/LedgerModalComponent/helpers/getAuthTokenText.ts +++ b/src/core/providers/helpers/ledger/components/LedgerModalComponent/helpers/getAuthTokenText.ts @@ -1,9 +1,8 @@ import { decodeLoginToken } from 'services/nativeAuth/helpers/decodeLoginToken'; -import { secondsToTimeString } from './secondsToTimeString'; import getLedgerVersionOptions from './getLedgerVersionOptions'; +import { secondsToTimeString } from './secondsToTimeString'; - -// TODO: rename to something more specific? +// TODO: rename to something more specific? export const getAuthTokenText = ({ loginToken, version diff --git a/src/core/providers/helpers/ledger/components/LedgerModalComponent/helpers/tests/getLedgerVersionOptions.test.ts b/src/core/providers/helpers/ledger/components/LedgerModalComponent/helpers/tests/getLedgerVersionOptions.test.ts index a04da7e..9c5310d 100644 --- a/src/core/providers/helpers/ledger/components/LedgerModalComponent/helpers/tests/getLedgerVersionOptions.test.ts +++ b/src/core/providers/helpers/ledger/components/LedgerModalComponent/helpers/tests/getLedgerVersionOptions.test.ts @@ -51,7 +51,7 @@ describe('ledgerOptions tests', () => { ledgerWithUsernames: false }); }); - test('ledger with tokens', () => { + test('ledger with latest tokens', () => { expect(ledgerVersionOptions('1.0.22')).toStrictEqual({ ledgerWithHashSign: true, ledgerWithMultiAccount: true, diff --git a/src/core/providers/helpers/ledger/createLedgerProvider.ts b/src/core/providers/helpers/ledger/createLedgerProvider.ts index 0b3e292..ee4aa27 100644 --- a/src/core/providers/helpers/ledger/createLedgerProvider.ts +++ b/src/core/providers/helpers/ledger/createLedgerProvider.ts @@ -1,24 +1,24 @@ +import BigNumber from 'bignumber.js'; +import { getIsLoggedIn } from 'core/methods/account/getIsLoggedIn'; import { IProvider, ProviderTypeEnum } from 'core/providers/types/providerFactory.types'; -import { getLedgerProvider } from './getLedgerProvider'; -import { setLedgerLogin } from 'store/actions/loginInfo/loginInfoActions'; import { setLedgerAccount } from 'store/actions/account/accountActions'; -import { initiateLedgerLogin } from './components/initiateLedgerLogin'; -import { EventBus } from './components/EventBus'; -import { ILedgerAccount } from './ledger.types'; +import { setLedgerLogin } from 'store/actions/loginInfo/loginInfoActions'; import { fetchAccount } from 'utils/account/fetchAccount'; +import { EventBus } from './components/EventBus'; +import { initiateLedgerLogin } from './components/initiateLedgerLogin'; import { getAuthTokenText } from './components/LedgerModalComponent/helpers/getAuthTokenText'; -import BigNumber from 'bignumber.js'; import { IAccountScreenData, IConfirmScreenData, IConnectScreenData, ILedgerModalData } from './components/LedgerModalComponent/LedgerModalComponent'; -import { getIsLoggedIn } from 'core/methods/account/getIsLoggedIn'; import { getLedgerErrorCodes } from './getLedgerErrorCodes'; +import { getLedgerProvider } from './getLedgerProvider'; +import { ILedgerAccount } from './ledger.types'; const failInitializeErrorText = 'Check if the MultiversX App is open on Ledger'; const addressesPerPage = 10; @@ -228,8 +228,11 @@ export async function createLedgerProvider(): Promise { addressIndex: number; }>(async (resolve, reject) => { const closeComponent = () => { + // eslint-disable-next-line @typescript-eslint/no-use-before-define eventBus.unsubscribe('CLOSE', onCancel); + // eslint-disable-next-line @typescript-eslint/no-use-before-define eventBus.unsubscribe('PAGE_CHANGED', onPageChanged); + // eslint-disable-next-line @typescript-eslint/no-use-before-define eventBus.unsubscribe('ACCESS_WALLET', onAccessWallet); data = { ...initialData, @@ -241,7 +244,9 @@ export async function createLedgerProvider(): Promise { const onCancel = async () => { await updateAccounts(); eventBus.unsubscribe('CLOSE', onCancel); + // eslint-disable-next-line @typescript-eslint/no-use-before-define eventBus.unsubscribe('PAGE_CHANGED', onPageChanged); + // eslint-disable-next-line @typescript-eslint/no-use-before-define eventBus.unsubscribe('ACCESS_WALLET', onAccessWallet); reject('User cancelled login'); }; diff --git a/src/core/providers/helpers/ledger/getLedgerProvider.ts b/src/core/providers/helpers/ledger/getLedgerProvider.ts index 4342a33..0620a2c 100644 --- a/src/core/providers/helpers/ledger/getLedgerProvider.ts +++ b/src/core/providers/helpers/ledger/getLedgerProvider.ts @@ -2,9 +2,8 @@ import { HWProvider } from '@multiversx/sdk-hw-provider'; import { getIsLoggedIn } from 'core/methods/account/getIsLoggedIn'; import { ledgerLoginSelector } from 'store/selectors/loginInfoSelectors'; import { getState } from 'store/store'; -import { getAccountProvider } from '../../accountProvider'; -import { logout } from 'core/providers/DappProvider/helpers/logout/logout'; import { getLedgerConfiguration } from './getLedgerConfiguration'; +import { getAccountProvider } from '../../accountProvider'; export async function getLedgerProvider() { const isLoggedIn = getIsLoggedIn(); diff --git a/src/core/providers/helpers/utils.ts b/src/core/providers/helpers/utils.ts index 439583a..09da6dc 100644 --- a/src/core/providers/helpers/utils.ts +++ b/src/core/providers/helpers/utils.ts @@ -3,10 +3,10 @@ import { HWProvider } from '@multiversx/sdk-hw-provider'; import { MetamaskProvider } from '@multiversx/sdk-metamask-provider/out/metamaskProvider'; import { OperaProvider } from '@multiversx/sdk-opera-provider'; import { WalletProvider } from '@multiversx/sdk-web-wallet-provider'; +import { ProviderTypeEnum } from 'core/providers/types/providerFactory.types'; +import { CrossWindowProvider } from 'lib/sdkWebWalletCrossWindowProvider'; import { WalletConnectV2Provider } from 'utils/walletconnect/__sdkWalletconnectProvider'; import { EmptyProvider } from './emptyProvider'; -import { CrossWindowProvider } from 'lib/sdkWebWalletCrossWindowProvider'; -import { ProviderTypeEnum } from 'core/providers/types/providerFactory.types'; export function getProviderType( provider?: TProvider | null diff --git a/src/services/nativeAuth/helpers/decodeNativeAuthToken.ts b/src/services/nativeAuth/helpers/decodeNativeAuthToken.ts index 35c1881..8ae1819 100644 --- a/src/services/nativeAuth/helpers/decodeNativeAuthToken.ts +++ b/src/services/nativeAuth/helpers/decodeNativeAuthToken.ts @@ -57,7 +57,7 @@ export const decodeNativeAuthToken = ( } return result; - } catch (err) { + } catch (_err) { return null; } }; diff --git a/src/services/nativeAuth/helpers/getLatestBlockHash.ts b/src/services/nativeAuth/helpers/getLatestBlockHash.ts index 72e3375..2f748f2 100644 --- a/src/services/nativeAuth/helpers/getLatestBlockHash.ts +++ b/src/services/nativeAuth/helpers/getLatestBlockHash.ts @@ -92,7 +92,7 @@ export async function getLatestBlockHash( requestPromise.current = null; return response; - } catch (err) { + } catch (_error) { requestPromise.current = null; return null as any; } diff --git a/src/storage/local.ts b/src/storage/local.ts index ac027e5..a0d906d 100644 --- a/src/storage/local.ts +++ b/src/storage/local.ts @@ -6,7 +6,7 @@ export const localStorageKeys = { } as const; type LocalValueType = keyof typeof localStorageKeys; -type LocalKeyType = typeof localStorageKeys[LocalValueType]; +type LocalKeyType = (typeof localStorageKeys)[LocalValueType]; type ExpiresType = number | false; diff --git a/src/store/actions/account/accountActions.ts b/src/store/actions/account/accountActions.ts index 279ff4e..858ea4d 100644 --- a/src/store/actions/account/accountActions.ts +++ b/src/store/actions/account/accountActions.ts @@ -1,10 +1,10 @@ -import { getStore } from 'store/store'; -import { AccountType } from 'types/account.types'; -import { emptyAccount } from 'store/slices/account/emptyAccount'; import { BatchTransactionsWSResponseType, LedgerAccountType } from 'store/slices/account/account.types'; +import { emptyAccount } from 'store/slices/account/emptyAccount'; +import { getStore } from 'store/store'; +import { AccountType } from 'types/account.types'; export const setAddress = (address: string) => getStore().setState(({ account: state }) => { diff --git a/src/store/actions/config/configActions.ts b/src/store/actions/config/configActions.ts index ef3c122..08b1bd0 100644 --- a/src/store/actions/config/configActions.ts +++ b/src/store/actions/config/configActions.ts @@ -1,5 +1,5 @@ -import { getStore } from 'store/store'; import { NativeAuthConfigType } from 'services/nativeAuth/nativeAuth.types'; +import { getStore } from 'store/store'; export const setNativeAuthConfig = (config: NativeAuthConfigType) => getStore().setState(({ config: state }) => { diff --git a/src/store/actions/loginInfo/loginInfoActions.ts b/src/store/actions/loginInfo/loginInfoActions.ts index 68d6d6b..e9ae8ff 100644 --- a/src/store/actions/loginInfo/loginInfoActions.ts +++ b/src/store/actions/loginInfo/loginInfoActions.ts @@ -1,11 +1,11 @@ -import { TokenLoginType } from 'types/login.types'; +import { ProviderTypeEnum } from 'core/providers/types/providerFactory.types'; import { LedgerLoginType, LoginInfoType, WalletConnectLoginType } from 'store/slices/loginInfo/loginInfo.types'; import { getStore } from 'store/store'; -import { ProviderTypeEnum } from 'core/providers/types/providerFactory.types'; +import { TokenLoginType } from 'types/login.types'; export const setProviderType = (providerType: ProviderTypeEnum) => getStore().setState(({ loginInfo: state }) => { diff --git a/src/store/actions/network/initializeNetwork.ts b/src/store/actions/network/initializeNetwork.ts index fc7e032..5188b08 100644 --- a/src/store/actions/network/initializeNetwork.ts +++ b/src/store/actions/network/initializeNetwork.ts @@ -1,9 +1,9 @@ import { getServerConfiguration } from 'apiCalls/configuration/getServerConfiguration'; +import { fallbackNetworkConfigurations } from 'constants/network.constants'; +import { emptyNetwork } from 'store/slices/network/emptyNetwork'; import { EnvironmentsEnum } from 'types/enums.types'; import { CustomNetworkType, NetworkType } from 'types/network.types'; import { initializeNetworkConfig } from './networkActions'; -import { fallbackNetworkConfigurations } from 'constants/network.constants'; -import { emptyNetwork } from 'store/slices/network/emptyNetwork'; export type InitializeNetworkPropsType = { customNetworkConfig?: CustomNetworkType; diff --git a/src/store/actions/network/networkActions.ts b/src/store/actions/network/networkActions.ts index 10a5f90..1413578 100644 --- a/src/store/actions/network/networkActions.ts +++ b/src/store/actions/network/networkActions.ts @@ -9,11 +9,10 @@ export const initializeNetworkConfig = (newNetwork: NetworkType) => Math.random() * newNetwork.walletConnectV2RelayAddresses.length ) ]; - const { walletConnectV2RelayAddresses, ...rest } = newNetwork; state.network = { ...state.network, - ...rest, + ...newNetwork, walletConnectV2RelayAddress }; }); diff --git a/src/store/actions/sharedActions/sharedActions.ts b/src/store/actions/sharedActions/sharedActions.ts index fc7ba06..530925f 100644 --- a/src/store/actions/sharedActions/sharedActions.ts +++ b/src/store/actions/sharedActions/sharedActions.ts @@ -1,7 +1,7 @@ import { Address } from '@multiversx/sdk-core/out'; -import { getStore } from '../../store'; -import { resetStore } from 'store/middleware/logoutMiddleware'; import { ProviderTypeEnum } from 'core/providers/types/providerFactory.types'; +import { resetStore } from 'store/middleware/logoutMiddleware'; +import { getStore } from '../../store'; export const logoutAction = () => getStore().setState(resetStore); export interface LoginActionPayloadType { diff --git a/src/store/middleware/logoutMiddleware.ts b/src/store/middleware/logoutMiddleware.ts index b4fe50a..eed1ef8 100644 --- a/src/store/middleware/logoutMiddleware.ts +++ b/src/store/middleware/logoutMiddleware.ts @@ -1,9 +1,9 @@ -import { storage } from 'storage'; import { WritableDraft } from 'immer'; -import { initialState as initialAccountState } from 'store/slices/account/accountSlice'; -import { initialState as initialLoginInfoState } from 'store/slices/loginInfo/loginInfoSlice'; +import { storage } from 'storage'; import { localStorageKeys } from 'storage/local'; import { isLoggedInSelector } from 'store/selectors'; +import { initialState as initialAccountState } from 'store/slices/account/accountSlice'; +import { initialState as initialLoginInfoState } from 'store/slices/loginInfo/loginInfoSlice'; import { StoreType } from '../store.types'; export const resetStore = (store: WritableDraft) => { diff --git a/src/store/slices/loginInfo/loginInfo.types.ts b/src/store/slices/loginInfo/loginInfo.types.ts index 2ff1f3c..118b475 100644 --- a/src/store/slices/loginInfo/loginInfo.types.ts +++ b/src/store/slices/loginInfo/loginInfo.types.ts @@ -1,5 +1,5 @@ -import { TokenLoginType } from 'types/login.types'; import { ProviderTypeEnum } from 'core/providers/types/providerFactory.types'; +import { TokenLoginType } from 'types/login.types'; export interface WalletConnectLoginType { loginType: string; diff --git a/src/store/slices/network/networkSlice.ts b/src/store/slices/network/networkSlice.ts index f0163c8..fc0f215 100644 --- a/src/store/slices/network/networkSlice.ts +++ b/src/store/slices/network/networkSlice.ts @@ -1,7 +1,7 @@ import { StateCreator } from 'zustand/vanilla'; -import { NetworkSliceType } from './networkSlice.types'; import { StoreType, MutatorsIn } from 'store/store.types'; import { emptyNetwork } from './emptyNetwork'; +import { NetworkSliceType } from './networkSlice.types'; const initialState: NetworkSliceType = { network: emptyNetwork diff --git a/src/store/storage/inMemoryStorage.ts b/src/store/storage/inMemoryStorage.ts index 00ebdd1..b8d228b 100644 --- a/src/store/storage/inMemoryStorage.ts +++ b/src/store/storage/inMemoryStorage.ts @@ -1,32 +1,32 @@ interface InMemoryStorageType { - [key: string]: string; + [key: string]: string; } export class InMemoryStorage { - private storage: InMemoryStorageType = {}; + private storage: InMemoryStorageType = {}; - setItem(key: string, value: string) { - this.storage[key] = value; - } + setItem(key: string, value: string) { + this.storage[key] = value; + } - getItem(key: string): string | null { - return this.storage.hasOwnProperty(key) ? this.storage[key] : null; - } + getItem(key: string): string | null { + return this.storage.hasOwnProperty(key) ? this.storage[key] : null; + } - removeItem(key: string) { - delete this.storage[key]; - } + removeItem(key: string) { + delete this.storage[key]; + } - clear() { - this.storage = {} as Storage; - } + clear() { + this.storage = {} as Storage; + } - get length() { - return Object.keys(this.storage).length; - } + get length() { + return Object.keys(this.storage).length; + } - key(index: number): string | null { - const keys = Object.keys(this.storage); - return keys[index] || null; - } -} \ No newline at end of file + key(index: number): string | null { + const keys = Object.keys(this.storage); + return keys[index] || null; + } +} diff --git a/src/store/storage/index.ts b/src/store/storage/index.ts index 763326c..2bcf8e8 100644 --- a/src/store/storage/index.ts +++ b/src/store/storage/index.ts @@ -1,2 +1,2 @@ -export * from "./storageCallback"; -export * from "./inMemoryStorage"; \ No newline at end of file +export * from './storageCallback'; +export * from './inMemoryStorage'; diff --git a/src/store/storage/storageCallback.ts b/src/store/storage/storageCallback.ts index e06fa77..bae107f 100644 --- a/src/store/storage/storageCallback.ts +++ b/src/store/storage/storageCallback.ts @@ -2,4 +2,4 @@ import { StateStorage } from 'zustand/middleware'; export type StorageCallback = () => StateStorage; -export const defaultStorageCallback: StorageCallback = () => localStorage; \ No newline at end of file +export const defaultStorageCallback: StorageCallback = () => localStorage; diff --git a/src/store/store.ts b/src/store/store.ts index b002724..9ddab8e 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -1,21 +1,20 @@ -import { createStore } from 'zustand/vanilla'; import { createJSONStorage, devtools, persist } from 'zustand/middleware'; import { immer } from 'zustand/middleware/immer'; -import { - InMemoryStorage, - defaultStorageCallback, - StorageCallback -} from './storage'; +import { createStore } from 'zustand/vanilla'; +import { applyMiddlewares } from './middleware'; import { networkSlice, accountSlice, loginInfoSlice, transactionsSlice } from './slices'; -import { createBoundedUseStore } from './createBoundedStore'; -import { StoreType } from './store.types'; -import { applyMiddlewares } from './middleware'; import { configSlice } from './slices'; +import { + InMemoryStorage, + defaultStorageCallback, + StorageCallback +} from './storage'; +import { StoreType } from './store.types'; export type MutatorsIn = [ ['zustand/devtools', never], @@ -55,6 +54,10 @@ export type StoreApi = ReturnType; let store: StoreApi; +export const setDAppStore = (_store: StoreApi) => { + store = _store; +}; + export const getStore = () => { if (!store) { setDAppStore(createDAppStore(() => new InMemoryStorage())); @@ -62,10 +65,6 @@ export const getStore = () => { return store; }; -export const setDAppStore = (_store: StoreApi) => { - store = _store; -}; - /** * Initialize store with the preferred storage by passing a callback. * Default storage is localStorage. diff --git a/src/store/store.types.ts b/src/store/store.types.ts index 3e41282..e679a97 100644 --- a/src/store/store.types.ts +++ b/src/store/store.types.ts @@ -1,7 +1,7 @@ import { AccountSliceType } from './slices/account/account.types'; +import { ConfigSliceType } from './slices/config/config.types'; import { LoginInfoSliceType } from './slices/loginInfo/loginInfo.types'; import { NetworkSliceType } from './slices/network/networkSlice.types'; -import { ConfigSliceType } from './slices/config/config.types'; import { TransactionsSliceType } from './slices/transactions/transacitionsSlice.types'; export type StoreType = { diff --git a/src/types/index.ts b/src/types/index.ts index 9d0a1f8..23ce8a9 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,3 +1,3 @@ export * from './enums.types'; export * from './network.types'; -export * from './misc.types'; \ No newline at end of file +export * from './misc.types'; diff --git a/src/types/transactions.types.ts b/src/types/transactions.types.ts index 32e9139..e2ae663 100644 --- a/src/types/transactions.types.ts +++ b/src/types/transactions.types.ts @@ -1,8 +1,8 @@ +import { IPlainTransactionObject } from '@multiversx/sdk-core/out'; import { TransactionBatchStatusesEnum, TransactionServerStatusesEnum } from 'types/enums.types'; -import { IPlainTransactionObject } from '@multiversx/sdk-core/out'; export interface SignedTransactionType extends IPlainTransactionObject { hash: string; diff --git a/src/utils/decoders/base64Utils.ts b/src/utils/decoders/base64Utils.ts index d2ec165..af97e3d 100644 --- a/src/utils/decoders/base64Utils.ts +++ b/src/utils/decoders/base64Utils.ts @@ -35,7 +35,7 @@ export function isStringBase64(str: string) { // it is a regular base64 string return true; } - } catch (e) { + } catch (_e) { return false; } diff --git a/src/utils/decoders/decodePart.ts b/src/utils/decoders/decodePart.ts index cb77935..ff5e173 100644 --- a/src/utils/decoders/decodePart.ts +++ b/src/utils/decoders/decodePart.ts @@ -9,6 +9,7 @@ export function decodePart(part: string) { if (isUtf8(hexPart) && hexPart.length > 1) { decodedPart = hexPart; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty } catch (error) {} return decodedPart; diff --git a/src/utils/decoders/isAscii.ts b/src/utils/decoders/isAscii.ts index bc00a95..cc4c183 100644 --- a/src/utils/decoders/isAscii.ts +++ b/src/utils/decoders/isAscii.ts @@ -1 +1,2 @@ +// eslint-disable-next-line no-control-regex export const isAscii = (str: string) => !/[^\x00-\x7F]/gm.test(str); diff --git a/src/utils/decoders/isUtf8.ts b/src/utils/decoders/isUtf8.ts index 3c34598..9d08a13 100644 --- a/src/utils/decoders/isUtf8.ts +++ b/src/utils/decoders/isUtf8.ts @@ -1,6 +1,8 @@ export function isUtf8(str: string) { for (let i = 0; i < str.length; i++) { - if (str.charCodeAt(i) > 127) return false; + if (str.charCodeAt(i) > 127) { + return false; + } } return true; } diff --git a/src/utils/decoders/tests/isUtf8.test.ts b/src/utils/decoders/tests/isUtf8.test.ts index 1035d60..1cafc1e 100644 --- a/src/utils/decoders/tests/isUtf8.test.ts +++ b/src/utils/decoders/tests/isUtf8.test.ts @@ -6,7 +6,7 @@ describe('isUtf8', () => { expect(result).toStrictEqual(true); }); - it('should return valid UTF-8', async () => { + it('should also return valid UTF-8', async () => { const result = isUtf8('ZEdWemRDQjBjbUZ1YzJGamRHbHZiaUR3bjVtQQ=='); expect(result).toStrictEqual(true); }); @@ -16,7 +16,7 @@ describe('isUtf8', () => { expect(result).toStrictEqual(false); }); - it('should return invalid UTF-8', async () => { + it('should return also invalid UTF-8', async () => { const result = isUtf8('��-'); expect(result).toStrictEqual(false); }); diff --git a/src/utils/retryMultipleTimes.ts b/src/utils/retryMultipleTimes.ts index 8d1578d..943cd5c 100644 --- a/src/utils/retryMultipleTimes.ts +++ b/src/utils/retryMultipleTimes.ts @@ -6,13 +6,14 @@ interface Options { } const executeAsyncCall = async ( - cb: (...args: any[]) => any, + cb: (..._args: any[]) => any, options: Options, args: any[], retries = 0 ): Promise => { try { return await cb(...args); + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { if (retries < options.retries) { if (options?.delay != null) { @@ -28,7 +29,7 @@ const executeAsyncCall = async ( export const retryMultipleTimes = ( - cb: (...args: any[]) => any, + cb: (..._args: any[]) => any, options: Options = { retries: 5, delay: 500 } ) => async (...args: any[]) => { diff --git a/src/utils/validation/isContract.ts b/src/utils/validation/isContract.ts index a3a5b06..087acbf 100644 --- a/src/utils/validation/isContract.ts +++ b/src/utils/validation/isContract.ts @@ -1,7 +1,7 @@ import { Address, TransactionPayload } from '@multiversx/sdk-core'; import { ESDTTransferTypesEnum, TypesOfSmartContractCallsEnum } from 'types'; -import { addressIsValid } from './addressIsValid'; import { isStringBase64 } from 'utils/decoders/base64Utils'; +import { addressIsValid } from './addressIsValid'; export function isContract( receiver: string, diff --git a/src/utils/validation/stringIsFloat.ts b/src/utils/validation/stringIsFloat.ts index f95e875..c752883 100755 --- a/src/utils/validation/stringIsFloat.ts +++ b/src/utils/validation/stringIsFloat.ts @@ -12,7 +12,6 @@ export const stringIsFloat = (amount: string) => { return false; } - // eslint-disable-next-line let [wholes, decimals] = amount.split('.'); if (decimals) { while (decimals.charAt(decimals.length - 1) === ZERO) { diff --git a/src/utils/validation/tests/stringIsFloat.test.ts b/src/utils/validation/tests/stringIsFloat.test.ts index 7b6f511..415a326 100644 --- a/src/utils/validation/tests/stringIsFloat.test.ts +++ b/src/utils/validation/tests/stringIsFloat.test.ts @@ -51,7 +51,7 @@ describe('stringIsFloat tests', () => { it('denies NaN', () => { expect(stringIsFloat(NaN as any)).toBe(false); }); - it('denies caret separation', () => { + it('also denies caret separation', () => { expect(stringIsFloat(Infinity as any)).toBe(false); }); }); diff --git a/src/utils/window/matchPath.ts b/src/utils/window/matchPath.ts index 33641c0..65cae02 100644 --- a/src/utils/window/matchPath.ts +++ b/src/utils/window/matchPath.ts @@ -3,8 +3,9 @@ function warning(cond: any, message: string): void { if (!cond) { - // eslint-disable-next-line no-console - if (typeof console !== 'undefined') console.warn(message); + if (typeof console !== 'undefined') { + console.warn(message); + } try { // Welcome to debugging React Router! @@ -13,8 +14,8 @@ function warning(cond: any, message: string): void { // find the source for a warning that appears in the console by // enabling "pause on exceptions" in your JavaScript debugger. throw new Error(message); - // eslint-disable-next-line no-empty - } catch (e) {} + // eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars + } catch (error) {} } } @@ -22,7 +23,7 @@ type ParamParseFailed = { failed: true }; type ParamParseSegment = // Check here if there exists a forward slash in the string. - // eslint-disable-next-line prettier/prettier + Segment extends `${infer LeftSegment}/${infer RightSegment}` ? // If there is a forward slash, then attempt to parse each side of the // forward slash. @@ -37,25 +38,25 @@ type ParamParseSegment = ? LeftResult | RightResult : LeftResult : // If the left side is not successfully parsed as a param, then check - // if only the right side can be successfully parse as a param. If it - // can, then the result is just right, else it's a failure. - RightResult extends string - ? RightResult - : ParamParseFailed + // if only the right side can be successfully parse as a param. If it + // can, then the result is just right, else it's a failure. + RightResult extends string + ? RightResult + : ParamParseFailed : ParamParseFailed : // If the left side didn't parse into a param, then just check the right - // side. - ParamParseSegment extends infer RightResult - ? RightResult extends string - ? RightResult + // side. + ParamParseSegment extends infer RightResult + ? RightResult extends string + ? RightResult + : ParamParseFailed : ParamParseFailed - : ParamParseFailed : // If there's no forward slash, then check if this segment starts with a - // colon. If it does, then this is a dynamic segment, so the result is - // just the remainder of the string. Otherwise, it's a failure. - Segment extends `:${infer Remaining}` - ? Remaining - : ParamParseFailed; + // colon. If it does, then this is a dynamic segment, so the result is + // just the remainder of the string. Otherwise, it's a failure. + Segment extends `:${infer Remaining}` + ? Remaining + : ParamParseFailed; // Attempt to parse the given string segment. If it fails, then just return the // plain string type as a default fallback. Otherwise return the union of the @@ -69,7 +70,7 @@ type ParamParseKey = * The parameters that were parsed from the URL path. */ type Params = { - readonly [key in Key]: string | undefined; + readonly [_key in Key]: string | undefined; }; /** @@ -143,7 +144,9 @@ export function matchPath< ); const match = pathname.match(matcher); - if (!match) return null; + if (!match) { + return null; + } const matchedPathname = match[0]; let pathnameBase = matchedPathname.replace(/(.)\/+$/, '$1'); diff --git a/yarn.lock b/yarn.lock index 8f0191f..fb431b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -291,120 +291,120 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@esbuild/aix-ppc64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" - integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== - -"@esbuild/android-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" - integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== - -"@esbuild/android-arm@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" - integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== - -"@esbuild/android-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" - integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== - -"@esbuild/darwin-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" - integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== - -"@esbuild/darwin-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" - integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== - -"@esbuild/freebsd-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" - integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== - -"@esbuild/freebsd-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" - integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== - -"@esbuild/linux-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" - integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== - -"@esbuild/linux-arm@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" - integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== - -"@esbuild/linux-ia32@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" - integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== - -"@esbuild/linux-loong64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" - integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== - -"@esbuild/linux-mips64el@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" - integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== - -"@esbuild/linux-ppc64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" - integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== - -"@esbuild/linux-riscv64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" - integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== - -"@esbuild/linux-s390x@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" - integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== - -"@esbuild/linux-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" - integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== - -"@esbuild/netbsd-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" - integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== - -"@esbuild/openbsd-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" - integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== - -"@esbuild/sunos-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" - integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== - -"@esbuild/win32-arm64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" - integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== - -"@esbuild/win32-ia32@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" - integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== - -"@esbuild/win32-x64@0.21.5": - version "0.21.5" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" - integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== +"@esbuild/aix-ppc64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.1.tgz#044268dc9ca4dc67f8d4aad8f51cfb894bfd7114" + integrity sha512-O7yppwipkXvnEPjzkSXJRk2g4bS8sUx9p9oXHq9MU/U7lxUzZVsnFZMDTmeeX9bfQxrFcvOacl/ENgOh0WP9pA== + +"@esbuild/android-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.1.tgz#76aacd934449e541f05b66d5ec8cbff96ec2ae81" + integrity sha512-jXhccq6es+onw7x8MxoFnm820mz7sGa9J14kLADclmiEUH4fyj+FjR6t0M93RgtlI/awHWhtF0Wgfhqgf9gDZA== + +"@esbuild/android-arm@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.1.tgz#8247c5aef933a212bca261290f6e43a9dca07cc5" + integrity sha512-hh3jKWikdnTtHCglDAeVO3Oyh8MaH8xZUaWMiCCvJ9/c3NtPqZq+CACOlGTxhddypXhl+8B45SeceYBfB/e8Ow== + +"@esbuild/android-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.1.tgz#80cbfa35412299edefbc4ab78064f0b66e448008" + integrity sha512-NPObtlBh4jQHE01gJeucqEhdoD/4ya2owSIS8lZYS58aR0x7oZo9lB2lVFxgTANSa5MGCBeoQtr+yA9oKCGPvA== + +"@esbuild/darwin-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.1.tgz#154167fb9e54017dac4b343f8e5e25c9d9324036" + integrity sha512-BLT7TDzqsVlQRmJfO/FirzKlzmDpBWwmCUlyggfzUwg1cAxVxeA4O6b1XkMInlxISdfPAOunV9zXjvh5x99Heg== + +"@esbuild/darwin-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.1.tgz#db971502c9fa204906b89e489810c902bf6d9afb" + integrity sha512-D3h3wBQmeS/vp93O4B+SWsXB8HvRDwMyhTNhBd8yMbh5wN/2pPWRW5o/hM3EKgk9bdKd9594lMGoTCTiglQGRQ== + +"@esbuild/freebsd-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.1.tgz#f0f3bc20c23af999bd696099a324dceb66d77761" + integrity sha512-/uVdqqpNKXIxT6TyS/oSK4XE4xWOqp6fh4B5tgAwozkyWdylcX+W4YF2v6SKsL4wCQ5h1bnaSNjWPXG/2hp8AQ== + +"@esbuild/freebsd-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.1.tgz#d36af9085edb34244b41e5a57640e6b4452cbec2" + integrity sha512-paAkKN1n1jJitw+dAoR27TdCzxRl1FOEITx3h201R6NoXUojpMzgMLdkXVgCvaCSCqwYkeGLoe9UVNRDKSvQgw== + +"@esbuild/linux-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.1.tgz#9d2ad42eea33b2a9571f13e7ecc39ee9d3ff0c6d" + integrity sha512-G65d08YoH00TL7Xg4LaL3gLV21bpoAhQ+r31NUu013YB7KK0fyXIt05VbsJtpqh/6wWxoLJZOvQHYnodRrnbUQ== + +"@esbuild/linux-arm@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.1.tgz#d6f7c5873479dd97148bef3e3a7f09d486642883" + integrity sha512-tRHnxWJnvNnDpNVnsyDhr1DIQZUfCXlHSCDohbXFqmg9W4kKR7g8LmA3kzcwbuxbRMKeit8ladnCabU5f2traA== + +"@esbuild/linux-ia32@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.1.tgz#8f2aef34a31c8d16dbce0b8679021f4881f38efe" + integrity sha512-tt/54LqNNAqCz++QhxoqB9+XqdsaZOtFD/srEhHYwBd3ZUOepmR1Eeot8bS+Q7BiEvy9vvKbtpHf+r6q8hF5UA== + +"@esbuild/linux-loong64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.1.tgz#44461ea2388efbafa6cf12b2bc1407a5388da066" + integrity sha512-MhNalK6r0nZD0q8VzUBPwheHzXPr9wronqmZrewLfP7ui9Fv1tdPmg6e7A8lmg0ziQCziSDHxh3cyRt4YMhGnQ== + +"@esbuild/linux-mips64el@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.1.tgz#754d533a4fef4b0790d82bfe1e82d6876f18370e" + integrity sha512-YCKVY7Zen5rwZV+nZczOhFmHaeIxR4Zn3jcmNH53LbgF6IKRwmrMywqDrg4SiSNApEefkAbPSIzN39FC8VsxPg== + +"@esbuild/linux-ppc64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.1.tgz#2aafcfe2826c7d5d2e3c41eb8934e6368a7cada5" + integrity sha512-bw7bcQ+270IOzDV4mcsKAnDtAFqKO0jVv3IgRSd8iM0ac3L8amvCrujRVt1ajBTJcpDaFhIX+lCNRKteoDSLig== + +"@esbuild/linux-riscv64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.1.tgz#481ceaf5939d14fb25da62a385b5e6c2096a3370" + integrity sha512-ARmDRNkcOGOm1AqUBSwRVDfDeD9hGYRfkudP2QdoonBz1ucWVnfBPfy7H4JPI14eYtZruRSczJxyu7SRYDVOcg== + +"@esbuild/linux-s390x@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.1.tgz#e25b97005e4c82540d1bc7af88e333fb55142570" + integrity sha512-o73TcUNMuoTZlhwFdsgr8SfQtmMV58sbgq6gQq9G1xUiYnHMTmJbwq65RzMx89l0iya69lR4bxBgtWiiOyDQZA== + +"@esbuild/linux-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.1.tgz#a05a61d0a0cbb03baa6db12cd8164c1e5265ffb2" + integrity sha512-da4/1mBJwwgJkbj4fMH7SOXq2zapgTo0LKXX1VUZ0Dxr+e8N0WbS80nSZ5+zf3lvpf8qxrkZdqkOqFfm57gXwA== + +"@esbuild/netbsd-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.1.tgz#e298f854e8999563f2e4668bd542678c46be4b53" + integrity sha512-CPWs0HTFe5woTJN5eKPvgraUoRHrCtzlYIAv9wBC+FAyagBSaf+UdZrjwYyTGnwPGkThV4OCI7XibZOnPvONVw== + +"@esbuild/openbsd-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.1.tgz#640d34de1e3c6bc3ff64e0379aae00ede3608f14" + integrity sha512-xxhTm5QtzNLc24R0hEkcH+zCx/o49AsdFZ0Cy5zSd/5tOj4X2g3/2AJB625NoadUuc4A8B3TenLJoYdWYOYCew== + +"@esbuild/sunos-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.1.tgz#f53cb1cdcbf05b3320e147ddb85ec2b1cf2b6cfc" + integrity sha512-CWibXszpWys1pYmbr9UiKAkX6x+Sxw8HWtw1dRESK1dLW5fFJ6rMDVw0o8MbadusvVQx1a8xuOxnHXT941Hp1A== + +"@esbuild/win32-arm64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.1.tgz#df4f44f9b4fec9598c0ec2c34fec9c568c8ab85d" + integrity sha512-jb5B4k+xkytGbGUS4T+Z89cQJ9DJ4lozGRSV+hhfmCPpfJ3880O31Q1srPCimm+V6UCbnigqD10EgDNgjvjerQ== + +"@esbuild/win32-ia32@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.1.tgz#a57edbd9905db9f957327ae0facfbf406a80a4e4" + integrity sha512-PgyFvjJhXqHn1uxPhyN1wZ6dIomKjiLUQh1LjFvjiV1JmnkZ/oMPrfeEAZg5R/1ftz4LZWZr02kefNIQ5SKREQ== + +"@esbuild/win32-x64@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.1.tgz#eb86553d90e86a8c174b96650fdb4c60f2de16a7" + integrity sha512-W9NttRZQR5ehAiqHGDnvfDaGmQOm6Fi4vSlce8mjM75x//XKuVAByohlEX6N17yZnVXxQFuh4fDRunP8ca6bfA== "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" @@ -452,7 +452,7 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.15.0", "@eslint/js@^9.15.0": +"@eslint/js@9.15.0": version "9.15.0" resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.15.0.tgz#df0e24fe869143b59731942128c19938fdbadfb5" integrity sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg== @@ -1801,7 +1801,7 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@8.15.0", "@typescript-eslint/eslint-plugin@^8.15.0": +"@typescript-eslint/eslint-plugin@8.15.0": version "8.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.15.0.tgz#c95c6521e70c8b095a684d884d96c0c1c63747d2" integrity sha512-+zkm9AR1Ds9uLWN3fkoeXgFppaQ+uEVtfOV62dDmsy9QCNqlRHWNEck4yarvRNrvRcHQLGfqBNui3cimoz8XAg== @@ -1816,7 +1816,7 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@8.15.0", "@typescript-eslint/parser@^8.15.0": +"@typescript-eslint/parser@8.15.0": version "8.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.15.0.tgz#92610da2b3af702cfbc02a46e2a2daa6260a9045" integrity sha512-7n59qFpghG4uazrF9qtGKBZXn7Oz4sOMm8dwNWDQY96Xlm2oX67eipqcblDj+oY1lLCbf1oltMZFpUso66Kl1A== @@ -1835,6 +1835,14 @@ "@typescript-eslint/types" "8.15.0" "@typescript-eslint/visitor-keys" "8.15.0" +"@typescript-eslint/scope-manager@8.16.0": + version "8.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz#ebc9a3b399a69a6052f3d88174456dd399ef5905" + integrity sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg== + dependencies: + "@typescript-eslint/types" "8.16.0" + "@typescript-eslint/visitor-keys" "8.16.0" + "@typescript-eslint/type-utils@8.15.0": version "8.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.15.0.tgz#a6da0f93aef879a68cc66c73fe42256cb7426c72" @@ -1850,6 +1858,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.15.0.tgz#4958edf3d83e97f77005f794452e595aaf6430fc" integrity sha512-n3Gt8Y/KyJNe0S3yDCD2RVKrHBC4gTUcLTebVBXacPy091E6tNspFLKRXlk3hwT4G55nfr1n2AdFqi/XMxzmPQ== +"@typescript-eslint/types@8.16.0": + version "8.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.16.0.tgz#49c92ae1b57942458ab83d9ec7ccab3005e64737" + integrity sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ== + "@typescript-eslint/typescript-estree@8.15.0": version "8.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.15.0.tgz#915c94e387892b114a2a2cc0df2d7f19412c8ba7" @@ -1864,6 +1877,20 @@ semver "^7.6.0" ts-api-utils "^1.3.0" +"@typescript-eslint/typescript-estree@8.16.0": + version "8.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz#9d741e56e5b13469b5190e763432ce5551a9300c" + integrity sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw== + dependencies: + "@typescript-eslint/types" "8.16.0" + "@typescript-eslint/visitor-keys" "8.16.0" + debug "^4.3.4" + fast-glob "^3.3.2" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + "@typescript-eslint/utils@8.15.0": version "8.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.15.0.tgz#ac04679ad19252776b38b81954b8e5a65567cef6" @@ -1874,6 +1901,16 @@ "@typescript-eslint/types" "8.15.0" "@typescript-eslint/typescript-estree" "8.15.0" +"@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0": + version "8.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.16.0.tgz#c71264c437157feaa97842809836254a6fc833c3" + integrity sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "8.16.0" + "@typescript-eslint/types" "8.16.0" + "@typescript-eslint/typescript-estree" "8.16.0" + "@typescript-eslint/visitor-keys@8.15.0": version "8.15.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.15.0.tgz#9ea5a85eb25401d2aa74ec8a478af4e97899ea12" @@ -1882,6 +1919,14 @@ "@typescript-eslint/types" "8.15.0" eslint-visitor-keys "^4.2.0" +"@typescript-eslint/visitor-keys@8.16.0": + version "8.16.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz#d5086afc060b01ff7a4ecab8d49d13d5a7b07705" + integrity sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ== + dependencies: + "@typescript-eslint/types" "8.16.0" + eslint-visitor-keys "^4.2.0" + "@walletconnect/core@2.12.2": version "2.12.2" resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.12.2.tgz#12bd568b90daed876e58ebcc098c12843a3321e6" @@ -2328,7 +2373,7 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -axios-mock-adapter@^1.22.0: +axios-mock-adapter@1.22.0: version "1.22.0" resolved "https://registry.yarnpkg.com/axios-mock-adapter/-/axios-mock-adapter-1.22.0.tgz#0f3e6be0fc9b55baab06f2d49c0b71157e7c053d" integrity sha512-dmI0KbkyAhntUR05YY96qg2H6gg0XMl2+qTW0xmYg6Up+BFBAJYRLROMXRdDEL06/Wqwa0TJThAYvFtSFdRCZw== @@ -3355,34 +3400,34 @@ esbuild-node-externals@1.14.0: find-up "^5.0.0" tslib "^2.4.1" -esbuild@^0.21.1: - version "0.21.5" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" - integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== +esbuild@0.21.1: + version "0.21.1" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.1.tgz#3d6f199f6ec849158278c6632f438463bab88c38" + integrity sha512-GPqx+FX7mdqulCeQ4TsGZQ3djBJkx5k7zBGtqt9ycVlWNg8llJ4RO9n2vciu8BN2zAEs6lPbPl0asZsAh7oWzg== optionalDependencies: - "@esbuild/aix-ppc64" "0.21.5" - "@esbuild/android-arm" "0.21.5" - "@esbuild/android-arm64" "0.21.5" - "@esbuild/android-x64" "0.21.5" - "@esbuild/darwin-arm64" "0.21.5" - "@esbuild/darwin-x64" "0.21.5" - "@esbuild/freebsd-arm64" "0.21.5" - "@esbuild/freebsd-x64" "0.21.5" - "@esbuild/linux-arm" "0.21.5" - "@esbuild/linux-arm64" "0.21.5" - "@esbuild/linux-ia32" "0.21.5" - "@esbuild/linux-loong64" "0.21.5" - "@esbuild/linux-mips64el" "0.21.5" - "@esbuild/linux-ppc64" "0.21.5" - "@esbuild/linux-riscv64" "0.21.5" - "@esbuild/linux-s390x" "0.21.5" - "@esbuild/linux-x64" "0.21.5" - "@esbuild/netbsd-x64" "0.21.5" - "@esbuild/openbsd-x64" "0.21.5" - "@esbuild/sunos-x64" "0.21.5" - "@esbuild/win32-arm64" "0.21.5" - "@esbuild/win32-ia32" "0.21.5" - "@esbuild/win32-x64" "0.21.5" + "@esbuild/aix-ppc64" "0.21.1" + "@esbuild/android-arm" "0.21.1" + "@esbuild/android-arm64" "0.21.1" + "@esbuild/android-x64" "0.21.1" + "@esbuild/darwin-arm64" "0.21.1" + "@esbuild/darwin-x64" "0.21.1" + "@esbuild/freebsd-arm64" "0.21.1" + "@esbuild/freebsd-x64" "0.21.1" + "@esbuild/linux-arm" "0.21.1" + "@esbuild/linux-arm64" "0.21.1" + "@esbuild/linux-ia32" "0.21.1" + "@esbuild/linux-loong64" "0.21.1" + "@esbuild/linux-mips64el" "0.21.1" + "@esbuild/linux-ppc64" "0.21.1" + "@esbuild/linux-riscv64" "0.21.1" + "@esbuild/linux-s390x" "0.21.1" + "@esbuild/linux-x64" "0.21.1" + "@esbuild/netbsd-x64" "0.21.1" + "@esbuild/openbsd-x64" "0.21.1" + "@esbuild/sunos-x64" "0.21.1" + "@esbuild/win32-arm64" "0.21.1" + "@esbuild/win32-ia32" "0.21.1" + "@esbuild/win32-x64" "0.21.1" escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" @@ -3488,6 +3533,13 @@ eslint-plugin-import@2.31.0: string.prototype.trimend "^1.0.8" tsconfig-paths "^3.15.0" +eslint-plugin-jest@^28.9.0: + version "28.9.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.9.0.tgz#19168dfaed124339cd2252c4c4d1ac3688aeb243" + integrity sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ== + dependencies: + "@typescript-eslint/utils" "^6.0.0 || ^7.0.0 || ^8.0.0" + eslint-plugin-node@11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" @@ -3548,7 +3600,7 @@ eslint-visitor-keys@^4.2.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45" integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== -eslint@^9.15.0: +eslint@9.15.0: version "9.15.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.15.0.tgz#77c684a4e980e82135ebff8ee8f0a9106ce6b8a6" integrity sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw== @@ -3966,7 +4018,18 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" -glob@^10.3.14, glob@^10.3.7: +glob@10.3.14: + version "10.3.14" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.14.tgz#36501f871d373fe197fc5794588d0aa71e69ff68" + integrity sha512-4fkAqu93xe9Mk7le9v0y3VrPDqLKHarNi2s4Pv7f2yOvfhWfhc7hRPHC/JyqMqb8B/Dt/eGS4n7ykwf3fOsl8g== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.6" + minimatch "^9.0.1" + minipass "^7.0.4" + path-scurry "^1.11.0" + +glob@^10.3.7: version "10.4.5" resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== @@ -4000,11 +4063,6 @@ globals@^14.0.0: resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== -globals@^15.12.0: - version "15.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-15.12.0.tgz#1811872883ad8f41055b61457a130221297de5b5" - integrity sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ== - globalthis@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" @@ -4623,6 +4681,15 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jackspeak@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jackspeak@^3.1.2: version "3.4.3" resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" @@ -5385,7 +5452,7 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^9.0.4: +minimatch@^9.0.1, minimatch@^9.0.4: version "9.0.5" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== @@ -5397,7 +5464,7 @@ minimist@^1.2.0, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.4, minipass@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== @@ -5823,7 +5890,7 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-scurry@^1.11.1: +path-scurry@^1.11.0, path-scurry@^1.11.1: version "1.11.1" resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== @@ -6918,7 +6985,7 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" -typescript-eslint@^8.15.0: +typescript-eslint@8.15.0: version "8.15.0" resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.15.0.tgz#c8a2a0d183c3eb48ae176aa078c1b9daa584cf9d" integrity sha512-wY4FRGl0ZI+ZU4Jo/yjdBu0lVTSML58pu6PgGtJmCufvzfV565pUF6iACQt092uFOd49iLOTX/sEVmHtbSrS+w== @@ -6927,10 +6994,10 @@ typescript-eslint@^8.15.0: "@typescript-eslint/parser" "8.15.0" "@typescript-eslint/utils" "8.15.0" -typescript@^5.4.5: - version "5.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" - integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== +typescript@5.4.5: + version "5.4.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" + integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== ufo@^1.5.4: version "1.5.4" From 291445ec364bf6107a8db82582261d4e5933da3f Mon Sep 17 00:00:00 2001 From: Tudor Morar Date: Tue, 26 Nov 2024 09:26:21 +0200 Subject: [PATCH 2/2] Update --- package.json | 2 +- src/utils/decoders/decodePart.ts | 5 +++-- yarn.lock | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4628ced..03053a1 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "eslint-config-standard": "17.1.0", "eslint-import-resolver-typescript": "3.6.3", "eslint-plugin-import": "2.31.0", - "eslint-plugin-jest": "^28.9.0", + "eslint-plugin-jest": "28.9.0", "eslint-plugin-node": "11.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-promise": "7.1.0", diff --git a/src/utils/decoders/decodePart.ts b/src/utils/decoders/decodePart.ts index ff5e173..bf9c589 100644 --- a/src/utils/decoders/decodePart.ts +++ b/src/utils/decoders/decodePart.ts @@ -9,8 +9,9 @@ export function decodePart(part: string) { if (isUtf8(hexPart) && hexPart.length > 1) { decodedPart = hexPart; } - // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty - } catch (error) {} + } catch (_error) { + /* empty */ + } return decodedPart; } diff --git a/yarn.lock b/yarn.lock index fb431b8..adb6324 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3533,7 +3533,7 @@ eslint-plugin-import@2.31.0: string.prototype.trimend "^1.0.8" tsconfig-paths "^3.15.0" -eslint-plugin-jest@^28.9.0: +eslint-plugin-jest@28.9.0: version "28.9.0" resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.9.0.tgz#19168dfaed124339cd2252c4c4d1ac3688aeb243" integrity sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ==