diff --git a/eslint.config.mjs b/eslint.config.mjs index 55ec86f34e2..14b06aeabf1 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -30,6 +30,11 @@ const config = createConfig([ camelcase: 'off', 'id-length': 'off', + // TODO: Re-enable this rule + // Enabling it with error suppression breaks `--fix`, because the autofixer for this rule + // does not work very well. + 'jsdoc/require-jsdoc': 'off', + // TODO: re-enble most of these rules 'id-denylist': 'off', 'import-x/no-unassigned-import': 'off', @@ -123,10 +128,11 @@ const config = createConfig([ // TODO: auto-fix breaks stuff '@typescript-eslint/promise-function-async': 'off', - // TODO: Re-enable this rule - // Enabling it with error suppression breaks `--fix`, because the autofixer for this rule - // does not work very well. + // TODO: Re-enable these rules + // Enabling them with error suppression breaks `--fix`, because the autofixer for these rules + // do not work very well. 'jsdoc/check-tag-names': 'off', + 'jsdoc/require-jsdoc': 'off', // TODO: re-enable most of these rules '@typescript-eslint/naming-convention': 'off', diff --git a/package.json b/package.json index 85166d0acc2..6a9b8549c90 100644 --- a/package.json +++ b/package.json @@ -56,10 +56,10 @@ "@lavamoat/allow-scripts": "^3.0.4", "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/create-release-branch": "^4.1.3", - "@metamask/eslint-config": "^14.1.0", - "@metamask/eslint-config-jest": "^14.1.0", - "@metamask/eslint-config-nodejs": "^14.0.0", - "@metamask/eslint-config-typescript": "^14.1.0", + "@metamask/eslint-config": "^15.0.0", + "@metamask/eslint-config-jest": "^15.0.0", + "@metamask/eslint-config-nodejs": "^15.0.0", + "@metamask/eslint-config-typescript": "^15.0.0", "@metamask/eth-block-tracker": "^15.0.0", "@metamask/eth-json-rpc-provider": "^6.0.0", "@metamask/json-rpc-engine": "^10.2.0", diff --git a/packages/account-tree-controller/src/AccountTreeController.test.ts b/packages/account-tree-controller/src/AccountTreeController.test.ts index d98b819b97d..1c5e0fa15ff 100644 --- a/packages/account-tree-controller/src/AccountTreeController.test.ts +++ b/packages/account-tree-controller/src/AccountTreeController.test.ts @@ -1,4 +1,8 @@ -import type { AccountWalletId, Bip44Account } from '@metamask/account-api'; +import type { + AccountGroupId, + AccountWalletId, + Bip44Account, +} from '@metamask/account-api'; import { AccountGroupType, AccountWalletType, @@ -6,7 +10,6 @@ import { toAccountWalletId, toMultichainAccountGroupId, toMultichainAccountWalletId, - type AccountGroupId, } from '@metamask/account-api'; import type { AccountId } from '@metamask/accounts-controller'; import { deriveStateFromMetadata } from '@metamask/base-controller'; @@ -36,7 +39,7 @@ import type { BackupAndSyncAnalyticsEventPayload } from './backup-and-sync/analy import { BackupAndSyncService } from './backup-and-sync/service'; import { isAccountGroupNameUnique } from './group'; import { getAccountWalletNameFromKeyringType } from './rules/keyring'; -import { type AccountTreeControllerState } from './types'; +import type { AccountTreeControllerState } from './types'; import { getAccountTreeControllerMessenger, getRootMessenger, diff --git a/packages/account-tree-controller/src/AccountTreeController.ts b/packages/account-tree-controller/src/AccountTreeController.ts index 6d8fe80ab98..163f112b91e 100644 --- a/packages/account-tree-controller/src/AccountTreeController.ts +++ b/packages/account-tree-controller/src/AccountTreeController.ts @@ -7,7 +7,7 @@ import type { AccountGroupType, } from '@metamask/account-api'; import type { MultichainAccountWalletStatus } from '@metamask/account-api'; -import { type AccountId } from '@metamask/accounts-controller'; +import type { AccountId } from '@metamask/accounts-controller'; import type { StateMetadata } from '@metamask/base-controller'; import { BaseController } from '@metamask/base-controller'; import type { TraceCallback } from '@metamask/controller-utils'; @@ -40,7 +40,7 @@ import type { AccountTreeControllerMessenger, AccountTreeControllerState, } from './types'; -import { type AccountWalletObject, type AccountWalletObjectOf } from './wallet'; +import type { AccountWalletObject, AccountWalletObjectOf } from './wallet'; export const controllerName = 'AccountTreeController'; diff --git a/packages/account-tree-controller/src/backup-and-sync/analytics/segment.test.ts b/packages/account-tree-controller/src/backup-and-sync/analytics/segment.test.ts index cf39bf57b31..f7051247a63 100644 --- a/packages/account-tree-controller/src/backup-and-sync/analytics/segment.test.ts +++ b/packages/account-tree-controller/src/backup-and-sync/analytics/segment.test.ts @@ -1,9 +1,8 @@ -import { - BackupAndSyncAnalyticsEvent, - formatAnalyticsEvent, - type BackupAndSyncAnalyticsAction, - type BackupAndSyncEmitAnalyticsEventParams, - type BackupAndSyncAnalyticsEventPayload, +import { BackupAndSyncAnalyticsEvent, formatAnalyticsEvent } from './segment'; +import type { + BackupAndSyncAnalyticsAction, + BackupAndSyncEmitAnalyticsEventParams, + BackupAndSyncAnalyticsEventPayload, } from './segment'; describe('BackupAndSyncAnalytics - Segment', () => { diff --git a/packages/account-tree-controller/src/backup-and-sync/syncing/group.ts b/packages/account-tree-controller/src/backup-and-sync/syncing/group.ts index 58afed11bcc..770aa2eea64 100644 --- a/packages/account-tree-controller/src/backup-and-sync/syncing/group.ts +++ b/packages/account-tree-controller/src/backup-and-sync/syncing/group.ts @@ -5,10 +5,10 @@ import type { AccountWalletEntropyObject } from '../../wallet'; import type { BackupAndSyncAnalyticsAction } from '../analytics'; import { BackupAndSyncAnalyticsEvent } from '../analytics'; import type { ProfileId } from '../authentication'; -import { - UserStorageSyncedWalletGroupSchema, - type BackupAndSyncContext, - type UserStorageSyncedWalletGroup, +import { UserStorageSyncedWalletGroupSchema } from '../types'; +import type { + BackupAndSyncContext, + UserStorageSyncedWalletGroup, } from '../types'; import { pushGroupToUserStorage, diff --git a/packages/account-tree-controller/src/backup-and-sync/syncing/wallet.ts b/packages/account-tree-controller/src/backup-and-sync/syncing/wallet.ts index c5392b04ad4..a41be46fe91 100644 --- a/packages/account-tree-controller/src/backup-and-sync/syncing/wallet.ts +++ b/packages/account-tree-controller/src/backup-and-sync/syncing/wallet.ts @@ -3,11 +3,8 @@ import { backupAndSyncLogger } from '../../logger'; import type { AccountWalletEntropyObject } from '../../wallet'; import { BackupAndSyncAnalyticsEvent } from '../analytics'; import type { ProfileId } from '../authentication'; -import { - UserStorageSyncedWalletSchema, - type BackupAndSyncContext, - type UserStorageSyncedWallet, -} from '../types'; +import { UserStorageSyncedWalletSchema } from '../types'; +import type { BackupAndSyncContext, UserStorageSyncedWallet } from '../types'; import { pushWalletToUserStorage } from '../user-storage/network-operations'; /** diff --git a/packages/account-tree-controller/src/backup-and-sync/types.ts b/packages/account-tree-controller/src/backup-and-sync/types.ts index 3dce42f90cd..60e8ce061ca 100644 --- a/packages/account-tree-controller/src/backup-and-sync/types.ts +++ b/packages/account-tree-controller/src/backup-and-sync/types.ts @@ -6,15 +6,14 @@ import type { } from '@metamask/account-api'; import type { TraceCallback } from '@metamask/controller-utils'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import type { Infer } from '@metamask/superstruct'; import { object, string, boolean, number, optional, - type Struct, } from '@metamask/superstruct'; +import type { Infer, Struct } from '@metamask/superstruct'; import type { BackupAndSyncEmitAnalyticsEventParams } from './analytics'; import type { AccountTreeController } from '../AccountTreeController'; diff --git a/packages/account-tree-controller/src/backup-and-sync/utils/controller.test.ts b/packages/account-tree-controller/src/backup-and-sync/utils/controller.test.ts index 76100ee92bc..ad06c79566e 100644 --- a/packages/account-tree-controller/src/backup-and-sync/utils/controller.test.ts +++ b/packages/account-tree-controller/src/backup-and-sync/utils/controller.test.ts @@ -5,9 +5,9 @@ import { getLocalGroupsForEntropyWallet, createStateSnapshot, restoreStateFromSnapshot, - type StateSnapshot, getLocalGroupForEntropyWallet, } from './controller'; +import type { StateSnapshot } from './controller'; import type { AccountTreeController } from '../../AccountTreeController'; import type { AccountWalletEntropyObject, diff --git a/packages/account-tree-controller/src/group.ts b/packages/account-tree-controller/src/group.ts index be62de79faa..7eda76d8d73 100644 --- a/packages/account-tree-controller/src/group.ts +++ b/packages/account-tree-controller/src/group.ts @@ -1,6 +1,6 @@ -import { - type AccountGroupType, - type MultichainAccountGroupId, +import type { + AccountGroupType, + MultichainAccountGroupId, } from '@metamask/account-api'; import type { AccountGroupId } from '@metamask/account-api'; import type { AccountId } from '@metamask/accounts-controller'; @@ -8,10 +8,10 @@ import { AnyAccountType, BtcAccountType, EthAccountType, - type KeyringAccountType, SolAccountType, TrxAccountType, } from '@metamask/keyring-api'; +import type { KeyringAccountType } from '@metamask/keyring-api'; import type { UpdatableField, ExtractFieldValues } from './type-utils'; import type { AccountTreeControllerState } from './types'; diff --git a/packages/account-tree-controller/src/rules/entropy.ts b/packages/account-tree-controller/src/rules/entropy.ts index 44b944bae68..392652213cd 100644 --- a/packages/account-tree-controller/src/rules/entropy.ts +++ b/packages/account-tree-controller/src/rules/entropy.ts @@ -10,7 +10,8 @@ import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { AccountGroupObjectOf } from '../group'; -import { BaseRule, type Rule, type RuleResult } from '../rule'; +import { BaseRule } from '../rule'; +import type { Rule, RuleResult } from '../rule'; import type { AccountWalletObjectOf } from '../wallet'; export class EntropyRule diff --git a/packages/account-tree-controller/src/rules/keyring.ts b/packages/account-tree-controller/src/rules/keyring.ts index 9aa57536565..881e8d86d74 100644 --- a/packages/account-tree-controller/src/rules/keyring.ts +++ b/packages/account-tree-controller/src/rules/keyring.ts @@ -5,7 +5,8 @@ import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { AccountGroupObjectOf } from '../group'; -import { BaseRule, type Rule, type RuleResult } from '../rule'; +import { BaseRule } from '../rule'; +import type { Rule, RuleResult } from '../rule'; import type { AccountWalletObjectOf } from '../wallet'; /** diff --git a/packages/account-tree-controller/src/rules/snap.ts b/packages/account-tree-controller/src/rules/snap.ts index 4a9a272ef46..8787c775d3d 100644 --- a/packages/account-tree-controller/src/rules/snap.ts +++ b/packages/account-tree-controller/src/rules/snap.ts @@ -6,7 +6,8 @@ import type { SnapId } from '@metamask/snaps-sdk'; import { stripSnapPrefix } from '@metamask/snaps-utils'; import { getAccountGroupPrefixFromKeyringType } from './keyring'; -import { BaseRule, type Rule, type RuleResult } from '../rule'; +import { BaseRule } from '../rule'; +import type { Rule, RuleResult } from '../rule'; import type { AccountWalletObjectOf } from '../wallet'; /** diff --git a/packages/account-tree-controller/src/types.ts b/packages/account-tree-controller/src/types.ts index da288a1b565..6b94bfcc8ab 100644 --- a/packages/account-tree-controller/src/types.ts +++ b/packages/account-tree-controller/src/types.ts @@ -9,9 +9,9 @@ import type { AccountsControllerSelectedAccountChangeEvent, AccountsControllerSetSelectedAccountAction, } from '@metamask/accounts-controller'; -import { - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { TraceCallback } from '@metamask/controller-utils'; import type { KeyringControllerGetStateAction } from '@metamask/keyring-controller'; diff --git a/packages/account-tree-controller/src/wallet.ts b/packages/account-tree-controller/src/wallet.ts index fdf965ac86b..fdfc46270f5 100644 --- a/packages/account-tree-controller/src/wallet.ts +++ b/packages/account-tree-controller/src/wallet.ts @@ -1,4 +1,4 @@ -import { type AccountGroupId } from '@metamask/account-api'; +import type { AccountGroupId } from '@metamask/account-api'; import type { AccountWalletType, AccountWalletId, diff --git a/packages/account-tree-controller/tests/mockMessenger.ts b/packages/account-tree-controller/tests/mockMessenger.ts index 10fa770a675..80df082b9c5 100644 --- a/packages/account-tree-controller/tests/mockMessenger.ts +++ b/packages/account-tree-controller/tests/mockMessenger.ts @@ -1,9 +1,8 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import type { AccountTreeControllerMessenger } from '../src/types'; diff --git a/packages/accounts-controller/src/AccountsController.test.ts b/packages/accounts-controller/src/AccountsController.test.ts index d672c9b36b8..34de9f40bd2 100644 --- a/packages/accounts-controller/src/AccountsController.test.ts +++ b/packages/accounts-controller/src/AccountsController.test.ts @@ -15,12 +15,11 @@ import { } from '@metamask/keyring-api'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { NetworkClientId } from '@metamask/network-controller'; import type { SnapControllerState } from '@metamask/snaps-controllers'; diff --git a/packages/accounts-controller/src/AccountsController.ts b/packages/accounts-controller/src/AccountsController.ts index 4526ec9e98b..dd0bd3c6a9e 100644 --- a/packages/accounts-controller/src/AccountsController.ts +++ b/packages/accounts-controller/src/AccountsController.ts @@ -1,13 +1,13 @@ -import { - type ControllerGetStateAction, - type ControllerStateChangeEvent, - BaseController, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; -import { - type SnapKeyringAccountAssetListUpdatedEvent, - type SnapKeyringAccountBalancesUpdatedEvent, - type SnapKeyringAccountTransactionsUpdatedEvent, - SnapKeyring, +import { SnapKeyring } from '@metamask/eth-snap-keyring'; +import type { + SnapKeyringAccountAssetListUpdatedEvent, + SnapKeyringAccountBalancesUpdatedEvent, + SnapKeyringAccountTransactionsUpdatedEvent, } from '@metamask/eth-snap-keyring'; import type { KeyringAccountEntropyOptions } from '@metamask/keyring-api'; import { @@ -17,13 +17,13 @@ import { isEvmAccountType, KeyringAccountEntropyTypeOption, } from '@metamask/keyring-api'; -import type { KeyringObject } from '@metamask/keyring-controller'; -import { - type KeyringControllerState, - type KeyringControllerGetKeyringsByTypeAction, - type KeyringControllerStateChangeEvent, - type KeyringControllerGetStateAction, - KeyringTypes, +import { KeyringTypes } from '@metamask/keyring-controller'; +import type { + KeyringControllerState, + KeyringControllerGetKeyringsByTypeAction, + KeyringControllerStateChangeEvent, + KeyringControllerGetStateAction, + KeyringObject, } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import { isScopeEqualToAny } from '@metamask/keyring-utils'; @@ -34,7 +34,8 @@ import type { SnapStateChange, } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; -import { type CaipChainId, isCaipChainId } from '@metamask/utils'; +import { isCaipChainId } from '@metamask/utils'; +import type { CaipChainId } from '@metamask/utils'; import type { WritableDraft } from 'immer/dist/internal.js'; import { cloneDeep } from 'lodash'; diff --git a/packages/address-book-controller/src/AddressBookController.test.ts b/packages/address-book-controller/src/AddressBookController.test.ts index 7c8f90a9fd5..675196e73f7 100644 --- a/packages/address-book-controller/src/AddressBookController.test.ts +++ b/packages/address-book-controller/src/AddressBookController.test.ts @@ -1,11 +1,10 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { toHex } from '@metamask/controller-utils'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { Hex } from '@metamask/utils'; diff --git a/packages/analytics-controller/src/AnalyticsController.test.ts b/packages/analytics-controller/src/AnalyticsController.test.ts index 131fe84af43..20ad4531da4 100644 --- a/packages/analytics-controller/src/AnalyticsController.test.ts +++ b/packages/analytics-controller/src/AnalyticsController.test.ts @@ -1,17 +1,13 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, -} from '@metamask/messenger'; +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { MockAnyNamespace } from '@metamask/messenger'; import { validate as uuidValidate, version as uuidVersion } from 'uuid'; -import { - AnalyticsController, - type AnalyticsControllerMessenger, - type AnalyticsControllerActions, - type AnalyticsControllerEvents, - type AnalyticsPlatformAdapter, - getDefaultAnalyticsControllerState, +import { AnalyticsController, getDefaultAnalyticsControllerState } from '.'; +import type { + AnalyticsControllerMessenger, + AnalyticsControllerActions, + AnalyticsControllerEvents, + AnalyticsPlatformAdapter, } from '.'; import type { AnalyticsControllerState } from '.'; diff --git a/packages/announcement-controller/src/AnnouncementController.test.ts b/packages/announcement-controller/src/AnnouncementController.test.ts index ea2fa04dcd0..11de2cc2089 100644 --- a/packages/announcement-controller/src/AnnouncementController.test.ts +++ b/packages/announcement-controller/src/AnnouncementController.test.ts @@ -1,9 +1,6 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, -} from '@metamask/messenger'; +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { MockAnyNamespace } from '@metamask/messenger'; import type { AnnouncementControllerState, diff --git a/packages/app-metadata-controller/src/AppMetadataController.test.ts b/packages/app-metadata-controller/src/AppMetadataController.test.ts index da8a8e87235..c2d77ee62a0 100644 --- a/packages/app-metadata-controller/src/AppMetadataController.test.ts +++ b/packages/app-metadata-controller/src/AppMetadataController.test.ts @@ -1,16 +1,15 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, -} from '@metamask/messenger'; +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { MockAnyNamespace } from '@metamask/messenger'; import { AppMetadataController, getDefaultAppMetadataControllerState, - type AppMetadataControllerOptions, - type AppMetadataControllerActions, - type AppMetadataControllerEvents, +} from './AppMetadataController'; +import type { + AppMetadataControllerOptions, + AppMetadataControllerActions, + AppMetadataControllerEvents, } from './AppMetadataController'; describe('AppMetadataController', () => { diff --git a/packages/approval-controller/src/ApprovalController.test.ts b/packages/approval-controller/src/ApprovalController.test.ts index a84b05b218f..639063994c8 100644 --- a/packages/approval-controller/src/ApprovalController.test.ts +++ b/packages/approval-controller/src/ApprovalController.test.ts @@ -1,12 +1,11 @@ /* eslint-disable jest/expect-expect */ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { errorCodes, JsonRpcError } from '@metamask/rpc-errors'; import { nanoid } from 'nanoid'; diff --git a/packages/approval-controller/src/ApprovalController.ts b/packages/approval-controller/src/ApprovalController.ts index 582382cd9b7..ed92ddb451d 100644 --- a/packages/approval-controller/src/ApprovalController.ts +++ b/packages/approval-controller/src/ApprovalController.ts @@ -1,11 +1,9 @@ +import { BaseController } from '@metamask/base-controller'; import type { ControllerGetStateAction, StateMetadata, } from '@metamask/base-controller'; -import { - BaseController, - type ControllerStateChangeEvent, -} from '@metamask/base-controller'; +import type { ControllerStateChangeEvent } from '@metamask/base-controller'; import type { Messenger } from '@metamask/messenger'; import type { JsonRpcError, DataWithOptionalCause } from '@metamask/rpc-errors'; import { rpcErrors } from '@metamask/rpc-errors'; diff --git a/packages/assets-controllers/src/AccountTrackerController.test.ts b/packages/assets-controllers/src/AccountTrackerController.test.ts index 90c718f7e17..5bd141143e0 100644 --- a/packages/assets-controllers/src/AccountTrackerController.test.ts +++ b/packages/assets-controllers/src/AccountTrackerController.test.ts @@ -1,26 +1,24 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { query, toChecksumHexAddress } from '@metamask/controller-utils'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; -import type { NetworkConfiguration } from '@metamask/network-controller'; -import { - type NetworkClientId, - type NetworkClientConfiguration, - getDefaultNetworkControllerState, +import { getDefaultNetworkControllerState } from '@metamask/network-controller'; +import type { + NetworkClientId, + NetworkClientConfiguration, + NetworkConfiguration, } from '@metamask/network-controller'; import { getDefaultPreferencesState } from '@metamask/preferences-controller'; -import { - TransactionStatus, - type TransactionMeta, -} from '@metamask/transaction-controller'; +import { TransactionStatus } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; import BN from 'bn.js'; -import { useFakeTimers, type SinonFakeTimers } from 'sinon'; +import { useFakeTimers } from 'sinon'; +import type { SinonFakeTimers } from 'sinon'; import type { AccountTrackerControllerMessenger } from './AccountTrackerController'; import { AccountTrackerController } from './AccountTrackerController'; diff --git a/packages/assets-controllers/src/AccountTrackerController.ts b/packages/assets-controllers/src/AccountTrackerController.ts index 1f103c899ed..84f42d04230 100644 --- a/packages/assets-controllers/src/AccountTrackerController.ts +++ b/packages/assets-controllers/src/AccountTrackerController.ts @@ -31,19 +31,20 @@ import type { TransactionControllerUnapprovedTransactionAddedEvent, TransactionMeta, } from '@metamask/transaction-controller'; -import { assert, type Hex } from '@metamask/utils'; +import { assert } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { Mutex } from 'async-mutex'; import { cloneDeep, isEqual } from 'lodash'; -import { - STAKING_CONTRACT_ADDRESS_BY_CHAINID, - type AssetsContractController, - type StakedBalance, +import { STAKING_CONTRACT_ADDRESS_BY_CHAINID } from './AssetsContractController'; +import type { + AssetsContractController, + StakedBalance, } from './AssetsContractController'; -import { - AccountsApiBalanceFetcher, - type BalanceFetcher, - type ProcessedBalance, +import { AccountsApiBalanceFetcher } from './multi-chain-accounts-service/api-balance-fetcher'; +import type { + BalanceFetcher, + ProcessedBalance, } from './multi-chain-accounts-service/api-balance-fetcher'; import { RpcBalanceFetcher } from './rpc-service/rpc-balance-fetcher'; diff --git a/packages/assets-controllers/src/AssetsContractController.test.ts b/packages/assets-controllers/src/AssetsContractController.test.ts index 8c7320d8ab3..31e120583a5 100644 --- a/packages/assets-controllers/src/AssetsContractController.test.ts +++ b/packages/assets-controllers/src/AssetsContractController.test.ts @@ -7,12 +7,11 @@ import { NetworkType, } from '@metamask/controller-utils'; import HttpProvider from '@metamask/ethjs-provider-http'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { Provider, diff --git a/packages/assets-controllers/src/AssetsContractController.ts b/packages/assets-controllers/src/AssetsContractController.ts index f6cf557fd67..f453cf870be 100644 --- a/packages/assets-controllers/src/AssetsContractController.ts +++ b/packages/assets-controllers/src/AssetsContractController.ts @@ -14,7 +14,8 @@ import type { Provider, } from '@metamask/network-controller'; import type { PreferencesControllerStateChangeEvent } from '@metamask/preferences-controller'; -import { getKnownPropertyNames, type Hex } from '@metamask/utils'; +import { getKnownPropertyNames } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import type BN from 'bn.js'; import abiSingleCallBalancesContract from 'single-call-balance-checker-abi'; diff --git a/packages/assets-controllers/src/CurrencyRateController.test.ts b/packages/assets-controllers/src/CurrencyRateController.test.ts index 9c23ef702f0..4afc52197f5 100644 --- a/packages/assets-controllers/src/CurrencyRateController.test.ts +++ b/packages/assets-controllers/src/CurrencyRateController.test.ts @@ -4,12 +4,11 @@ import { NetworkType, NetworksTicker, } from '@metamask/controller-utils'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { NetworkConfiguration } from '@metamask/network-controller'; import type { Hex } from '@metamask/utils'; diff --git a/packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.test.ts b/packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.test.ts index 7d7c8d9101a..d3df3f8925f 100644 --- a/packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.test.ts +++ b/packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.test.ts @@ -1,11 +1,10 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { BtcAccountType, EthAccountType } from '@metamask/keyring-api'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import * as calculateDefiMetrics from './calculate-defi-metrics'; diff --git a/packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.ts b/packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.ts index b317414ee4f..960a39a4d25 100644 --- a/packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.ts +++ b/packages/assets-controllers/src/DeFiPositionsController/DeFiPositionsController.ts @@ -18,10 +18,8 @@ import type { Hex } from '@metamask/utils'; import { calculateDeFiPositionMetrics } from './calculate-defi-metrics'; import type { DefiPositionResponse } from './fetch-positions'; import { buildPositionFetcher } from './fetch-positions'; -import { - groupDeFiPositions, - type GroupedDeFiPositions, -} from './group-defi-positions'; +import { groupDeFiPositions } from './group-defi-positions'; +import type { GroupedDeFiPositions } from './group-defi-positions'; const TEN_MINUTES_IN_MS = 600_000; diff --git a/packages/assets-controllers/src/MultichainAssetsController/MultichainAssetsController.test.ts b/packages/assets-controllers/src/MultichainAssetsController/MultichainAssetsController.test.ts index 15d3a24f159..7ead75e7e8d 100644 --- a/packages/assets-controllers/src/MultichainAssetsController/MultichainAssetsController.test.ts +++ b/packages/assets-controllers/src/MultichainAssetsController/MultichainAssetsController.test.ts @@ -12,12 +12,11 @@ import { } from '@metamask/keyring-api'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { PermissionConstraint } from '@metamask/permission-controller'; import type { SubjectPermissions } from '@metamask/permission-controller'; diff --git a/packages/assets-controllers/src/MultichainAssetsController/MultichainAssetsController.ts b/packages/assets-controllers/src/MultichainAssetsController/MultichainAssetsController.ts index a6638ab2a5c..e7e2e30c142 100644 --- a/packages/assets-controllers/src/MultichainAssetsController/MultichainAssetsController.ts +++ b/packages/assets-controllers/src/MultichainAssetsController/MultichainAssetsController.ts @@ -4,11 +4,11 @@ import type { AccountsControllerAccountRemovedEvent, AccountsControllerListMultichainAccountsAction, } from '@metamask/accounts-controller'; -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, - type StateMetadata, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, + StateMetadata, } from '@metamask/base-controller'; import { isEvmAccountType } from '@metamask/keyring-api'; import type { @@ -30,11 +30,8 @@ import type { } from '@metamask/snaps-controllers'; import type { FungibleAssetMetadata, Snap, SnapId } from '@metamask/snaps-sdk'; import { HandlerType } from '@metamask/snaps-utils'; -import { - isCaipAssetType, - parseCaipAssetType, - type CaipChainId, -} from '@metamask/utils'; +import { isCaipAssetType, parseCaipAssetType } from '@metamask/utils'; +import type { CaipChainId } from '@metamask/utils'; import type { Json, JsonRpcRequest } from '@metamask/utils'; import type { MutexInterface } from 'async-mutex'; import { Mutex } from 'async-mutex'; diff --git a/packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.test.ts b/packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.test.ts index f332a0f0d42..b73b1b83e0d 100644 --- a/packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.test.ts +++ b/packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.test.ts @@ -5,19 +5,18 @@ import { SolAccountType } from '@metamask/keyring-api'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import { KeyringClient } from '@metamask/keyring-snap-client'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { OnAssetHistoricalPriceResponse } from '@metamask/snaps-sdk'; import { useFakeTimers } from 'sinon'; import { v4 as uuidv4 } from 'uuid'; import { MultichainAssetsRatesController } from '.'; -import { type MultichainAssetsRatesControllerMessenger } from './MultichainAssetsRatesController'; +import type { MultichainAssetsRatesControllerMessenger } from './MultichainAssetsRatesController'; import { advanceTime } from '../../../../tests/helpers'; type AllMultichainAssetsRateControllerActions = diff --git a/packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.ts b/packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.ts index 345cee4a221..eec4daccb7b 100644 --- a/packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.ts +++ b/packages/assets-controllers/src/MultichainAssetsRatesController/MultichainAssetsRatesController.ts @@ -8,7 +8,8 @@ import type { ControllerGetStateAction, StateMetadata, } from '@metamask/base-controller'; -import { type CaipAssetType, isEvmAccountType } from '@metamask/keyring-api'; +import { isEvmAccountType } from '@metamask/keyring-api'; +import type { CaipAssetType } from '@metamask/keyring-api'; import type { KeyringControllerLockEvent, KeyringControllerUnlockEvent, diff --git a/packages/assets-controllers/src/MultichainBalancesController/MultichainBalancesController.test.ts b/packages/assets-controllers/src/MultichainBalancesController/MultichainBalancesController.test.ts index 9315586c59f..6fa56975632 100644 --- a/packages/assets-controllers/src/MultichainBalancesController/MultichainBalancesController.test.ts +++ b/packages/assets-controllers/src/MultichainBalancesController/MultichainBalancesController.test.ts @@ -13,12 +13,11 @@ import { } from '@metamask/keyring-api'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { v4 as uuidv4 } from 'uuid'; diff --git a/packages/assets-controllers/src/MultichainBalancesController/MultichainBalancesController.ts b/packages/assets-controllers/src/MultichainBalancesController/MultichainBalancesController.ts index 66d0b2be8ef..5e8e4129724 100644 --- a/packages/assets-controllers/src/MultichainBalancesController/MultichainBalancesController.ts +++ b/packages/assets-controllers/src/MultichainBalancesController/MultichainBalancesController.ts @@ -4,11 +4,11 @@ import type { AccountsControllerListMultichainAccountsAction, AccountsControllerAccountBalancesUpdatesEvent, } from '@metamask/accounts-controller'; -import { - BaseController, - type StateMetadata, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + StateMetadata, + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import { isEvmAccountType } from '@metamask/keyring-api'; import type { diff --git a/packages/assets-controllers/src/NftController.test.ts b/packages/assets-controllers/src/NftController.test.ts index 78b78a41f4e..f6fda170b14 100644 --- a/packages/assets-controllers/src/NftController.test.ts +++ b/packages/assets-controllers/src/NftController.test.ts @@ -22,23 +22,20 @@ import { convertHexToDecimal, } from '@metamask/controller-utils'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; -import { - type NetworkClientConfiguration, - type NetworkClientId, +import type { + NetworkClientConfiguration, + NetworkClientId, } from '@metamask/network-controller'; import type { BulkPhishingDetectionScanResponse } from '@metamask/phishing-controller'; import { RecommendedAction } from '@metamask/phishing-controller'; -import { - getDefaultPreferencesState, - type PreferencesState, -} from '@metamask/preferences-controller'; +import { getDefaultPreferencesState } from '@metamask/preferences-controller'; +import type { PreferencesState } from '@metamask/preferences-controller'; import type { Hex } from '@metamask/utils'; import BN from 'bn.js'; import nock from 'nock'; diff --git a/packages/assets-controllers/src/NftController.ts b/packages/assets-controllers/src/NftController.ts index 9f581304d9f..eee983ad246 100644 --- a/packages/assets-controllers/src/NftController.ts +++ b/packages/assets-controllers/src/NftController.ts @@ -5,11 +5,11 @@ import type { AccountsControllerGetSelectedAccountAction, } from '@metamask/accounts-controller'; import type { AddApprovalRequest } from '@metamask/approval-controller'; -import { - BaseController, - type ControllerStateChangeEvent, - type ControllerGetStateAction, - type StateMetadata, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerStateChangeEvent, + ControllerGetStateAction, + StateMetadata, } from '@metamask/base-controller'; import { safelyExecute, @@ -26,7 +26,7 @@ import { convertHexToDecimal, toHex, } from '@metamask/controller-utils'; -import { type InternalAccount } from '@metamask/keyring-internal-api'; +import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { Messenger } from '@metamask/messenger'; import type { NetworkClientId, diff --git a/packages/assets-controllers/src/NftDetectionController.test.ts b/packages/assets-controllers/src/NftDetectionController.test.ts index d485a77361f..0a599435945 100644 --- a/packages/assets-controllers/src/NftDetectionController.test.ts +++ b/packages/assets-controllers/src/NftDetectionController.test.ts @@ -4,12 +4,11 @@ import { ChainId, InfuraNetworkType, } from '@metamask/controller-utils'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { getDefaultNetworkControllerState, @@ -22,10 +21,8 @@ import type { NetworkController, NetworkState, } from '@metamask/network-controller'; -import { - getDefaultPreferencesState, - type PreferencesState, -} from '@metamask/preferences-controller'; +import { getDefaultPreferencesState } from '@metamask/preferences-controller'; +import type { PreferencesState } from '@metamask/preferences-controller'; import nock from 'nock'; import * as sinon from 'sinon'; @@ -34,8 +31,8 @@ import { getDefaultNftControllerState } from './NftController'; import { NftDetectionController, BlockaidResultType, - type NftDetectionControllerMessenger, } from './NftDetectionController'; +import type { NftDetectionControllerMessenger } from './NftDetectionController'; import { FakeBlockTracker } from '../../../tests/fake-block-tracker'; import { FakeProvider } from '../../../tests/fake-provider'; import { advanceTime } from '../../../tests/helpers'; diff --git a/packages/assets-controllers/src/NftDetectionController.ts b/packages/assets-controllers/src/NftDetectionController.ts index cff23beeb25..51073ab897d 100644 --- a/packages/assets-controllers/src/NftDetectionController.ts +++ b/packages/assets-controllers/src/NftDetectionController.ts @@ -1,9 +1,9 @@ import type { AccountsControllerGetSelectedAccountAction } from '@metamask/accounts-controller'; import type { AddApprovalRequest } from '@metamask/approval-controller'; -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import { toChecksumHexAddress, @@ -26,13 +26,14 @@ import type { PreferencesControllerStateChangeEvent, PreferencesState, } from '@metamask/preferences-controller'; -import { createDeferredPromise, type Hex } from '@metamask/utils'; +import { createDeferredPromise } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { Source } from './constants'; -import { - type NftController, - type NftControllerState, - type NftMetadata, +import type { + NftController, + NftControllerState, + NftMetadata, } from './NftController'; import type { NetworkControllerFindNetworkClientIdByChainIdAction } from '../../network-controller/src/NetworkController'; diff --git a/packages/assets-controllers/src/RatesController/RatesController.test.ts b/packages/assets-controllers/src/RatesController/RatesController.test.ts index ecb36af1e6c..4bd60c28af5 100644 --- a/packages/assets-controllers/src/RatesController/RatesController.test.ts +++ b/packages/assets-controllers/src/RatesController/RatesController.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { useFakeTimers } from 'sinon'; diff --git a/packages/assets-controllers/src/RatesController/RatesController.ts b/packages/assets-controllers/src/RatesController/RatesController.ts index c7056cbe37a..b6ee0472cca 100644 --- a/packages/assets-controllers/src/RatesController/RatesController.ts +++ b/packages/assets-controllers/src/RatesController/RatesController.ts @@ -1,4 +1,5 @@ -import { BaseController, type StateMetadata } from '@metamask/base-controller'; +import { BaseController } from '@metamask/base-controller'; +import type { StateMetadata } from '@metamask/base-controller'; import { Mutex } from 'async-mutex'; import type { Draft } from 'immer'; diff --git a/packages/assets-controllers/src/TokenBalancesController.test.ts b/packages/assets-controllers/src/TokenBalancesController.test.ts index 134ed565836..45ad3a0443d 100644 --- a/packages/assets-controllers/src/TokenBalancesController.test.ts +++ b/packages/assets-controllers/src/TokenBalancesController.test.ts @@ -1,12 +1,11 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { toChecksumHexAddress, toHex } from '@metamask/controller-utils'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { NetworkState } from '@metamask/network-controller'; import type { PreferencesState } from '@metamask/preferences-controller'; diff --git a/packages/assets-controllers/src/TokenBalancesController.ts b/packages/assets-controllers/src/TokenBalancesController.ts index 340fc511137..57736c12d9e 100644 --- a/packages/assets-controllers/src/TokenBalancesController.ts +++ b/packages/assets-controllers/src/TokenBalancesController.ts @@ -52,10 +52,10 @@ import type { AccountTrackerUpdateStakedBalancesAction, } from './AccountTrackerController'; import { STAKING_CONTRACT_ADDRESS_BY_CHAINID } from './AssetsContractController'; -import { - AccountsApiBalanceFetcher, - type BalanceFetcher, - type ProcessedBalance, +import { AccountsApiBalanceFetcher } from './multi-chain-accounts-service/api-balance-fetcher'; +import type { + BalanceFetcher, + ProcessedBalance, } from './multi-chain-accounts-service/api-balance-fetcher'; import { RpcBalanceFetcher } from './rpc-service/rpc-balance-fetcher'; import type { TokenDetectionControllerAddDetectedTokensViaWsAction } from './TokenDetectionController'; diff --git a/packages/assets-controllers/src/TokenDetectionController.test.ts b/packages/assets-controllers/src/TokenDetectionController.test.ts index 20ab8bf62d7..0ff6afaa709 100644 --- a/packages/assets-controllers/src/TokenDetectionController.test.ts +++ b/packages/assets-controllers/src/TokenDetectionController.test.ts @@ -6,12 +6,11 @@ import { } from '@metamask/controller-utils'; import type { KeyringControllerState } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { getDefaultNetworkControllerState, @@ -25,10 +24,8 @@ import type { AutoManagedNetworkClient, CustomNetworkClientConfiguration, } from '@metamask/network-controller'; -import { - getDefaultPreferencesState, - type PreferencesState, -} from '@metamask/preferences-controller'; +import { getDefaultPreferencesState } from '@metamask/preferences-controller'; +import type { PreferencesState } from '@metamask/preferences-controller'; import type { Hex } from '@metamask/utils'; import BN from 'bn.js'; import nock from 'nock'; @@ -49,11 +46,11 @@ import { controllerName, mapChainIdWithTokenListMap, } from './TokenDetectionController'; -import { - getDefaultTokenListState, - type TokenListMap, - type TokenListState, - type TokenListToken, +import { getDefaultTokenListState } from './TokenListController'; +import type { + TokenListMap, + TokenListState, + TokenListToken, } from './TokenListController'; import type { Token } from './TokenRatesController'; import type { diff --git a/packages/assets-controllers/src/TokenListController.test.ts b/packages/assets-controllers/src/TokenListController.test.ts index 9d0f5cecae0..3d2efc21c66 100644 --- a/packages/assets-controllers/src/TokenListController.test.ts +++ b/packages/assets-controllers/src/TokenListController.test.ts @@ -6,12 +6,11 @@ import { toHex, InfuraNetworkType, } from '@metamask/controller-utils'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { NetworkState } from '@metamask/network-controller'; import type { Hex } from '@metamask/utils'; diff --git a/packages/assets-controllers/src/TokenRatesController.test.ts b/packages/assets-controllers/src/TokenRatesController.test.ts index ab4b3f42e1d..2ab2ae504f9 100644 --- a/packages/assets-controllers/src/TokenRatesController.test.ts +++ b/packages/assets-controllers/src/TokenRatesController.test.ts @@ -1,11 +1,10 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { ChainId, toChecksumHexAddress } from '@metamask/controller-utils'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { NetworkClientConfiguration, diff --git a/packages/assets-controllers/src/TokenSearchDiscoveryDataController/TokenSearchDiscoveryDataController.test.ts b/packages/assets-controllers/src/TokenSearchDiscoveryDataController/TokenSearchDiscoveryDataController.test.ts index d1a2882d1f1..f72c8be26a4 100644 --- a/packages/assets-controllers/src/TokenSearchDiscoveryDataController/TokenSearchDiscoveryDataController.test.ts +++ b/packages/assets-controllers/src/TokenSearchDiscoveryDataController/TokenSearchDiscoveryDataController.test.ts @@ -1,13 +1,12 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { ChainId } from '@metamask/controller-utils'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; -import { type Hex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import assert from 'assert'; import { useFakeTimers } from 'sinon'; @@ -16,8 +15,10 @@ import { TokenSearchDiscoveryDataController, controllerName, MAX_TOKEN_DISPLAY_DATA_LENGTH, - type TokenSearchDiscoveryDataControllerMessenger, - type TokenSearchDiscoveryDataControllerState, +} from './TokenSearchDiscoveryDataController'; +import type { + TokenSearchDiscoveryDataControllerMessenger, + TokenSearchDiscoveryDataControllerState, } from './TokenSearchDiscoveryDataController'; import type { NotFoundTokenDisplayData, FoundTokenDisplayData } from './types'; import { advanceTime } from '../../../../tests/helpers'; diff --git a/packages/assets-controllers/src/TokenSearchDiscoveryDataController/TokenSearchDiscoveryDataController.ts b/packages/assets-controllers/src/TokenSearchDiscoveryDataController/TokenSearchDiscoveryDataController.ts index 6036f2650b9..b62ac16f47a 100644 --- a/packages/assets-controllers/src/TokenSearchDiscoveryDataController/TokenSearchDiscoveryDataController.ts +++ b/packages/assets-controllers/src/TokenSearchDiscoveryDataController/TokenSearchDiscoveryDataController.ts @@ -1,8 +1,8 @@ -import { - BaseController, - type StateMetadata, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + StateMetadata, + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { Messenger } from '@metamask/messenger'; import type { Hex } from '@metamask/utils'; diff --git a/packages/assets-controllers/src/TokensController.test.ts b/packages/assets-controllers/src/TokensController.test.ts index 538719c8382..5b94989f1a1 100644 --- a/packages/assets-controllers/src/TokensController.test.ts +++ b/packages/assets-controllers/src/TokensController.test.ts @@ -1,8 +1,8 @@ import { Contract } from '@ethersproject/contracts'; -import type { ApprovalControllerMessenger } from '@metamask/approval-controller'; -import { - ApprovalController, - type ApprovalControllerState, +import { ApprovalController } from '@metamask/approval-controller'; +import type { + ApprovalControllerMessenger, + ApprovalControllerState, } from '@metamask/approval-controller'; import { deriveStateFromMetadata } from '@metamask/base-controller'; import contractMaps from '@metamask/contract-metadata'; @@ -14,12 +14,11 @@ import { InfuraNetworkType, } from '@metamask/controller-utils'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import type { NetworkClientConfiguration, diff --git a/packages/assets-controllers/src/TokensController.ts b/packages/assets-controllers/src/TokensController.ts index cafd25dc26b..147fdf5cb57 100644 --- a/packages/assets-controllers/src/TokensController.ts +++ b/packages/assets-controllers/src/TokensController.ts @@ -38,7 +38,8 @@ import type { Provider, } from '@metamask/network-controller'; import { rpcErrors } from '@metamask/rpc-errors'; -import { isStrictHexString, type Hex } from '@metamask/utils'; +import { isStrictHexString } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { Mutex } from 'async-mutex'; import type { Patch } from 'immer'; import { cloneDeep } from 'lodash'; diff --git a/packages/assets-controllers/src/assetsUtil.test.ts b/packages/assets-controllers/src/assetsUtil.test.ts index fc6e5d7c42c..c2c71646314 100644 --- a/packages/assets-controllers/src/assetsUtil.test.ts +++ b/packages/assets-controllers/src/assetsUtil.test.ts @@ -5,15 +5,14 @@ import { toHex, toChecksumHexAddress, } from '@metamask/controller-utils'; -import { add0x, type Hex } from '@metamask/utils'; +import { add0x } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import * as assetsUtil from './assetsUtil'; import { TOKEN_PRICES_BATCH_SIZE } from './assetsUtil'; import type { Nft, NftMetadata } from './NftController'; -import { - getNativeTokenAddress, - type AbstractTokenPricesService, -} from './token-prices-service'; +import { getNativeTokenAddress } from './token-prices-service'; +import type { AbstractTokenPricesService } from './token-prices-service'; const DEFAULT_IPFS_URL_FORMAT = 'ipfs://'; const ALTERNATIVE_IPFS_URL_FORMAT = 'ipfs://ipfs/'; diff --git a/packages/assets-controllers/src/assetsUtil.ts b/packages/assets-controllers/src/assetsUtil.ts index 8cfa5dd2b0f..90ac8282ee9 100644 --- a/packages/assets-controllers/src/assetsUtil.ts +++ b/packages/assets-controllers/src/assetsUtil.ts @@ -14,10 +14,8 @@ import BN from 'bn.js'; import { CID } from 'multiformats/cid'; import type { Nft, NftMetadata } from './NftController'; -import { - getNativeTokenAddress, - type AbstractTokenPricesService, -} from './token-prices-service'; +import { getNativeTokenAddress } from './token-prices-service'; +import type { AbstractTokenPricesService } from './token-prices-service'; import type { EvmAssetWithMarketData } from './token-prices-service/abstract-token-prices-service'; import type { ContractExchangeRates } from './TokenRatesController'; diff --git a/packages/assets-controllers/src/balances.ts b/packages/assets-controllers/src/balances.ts index 70fa26f38c1..b261586b66e 100644 --- a/packages/assets-controllers/src/balances.ts +++ b/packages/assets-controllers/src/balances.ts @@ -1,7 +1,5 @@ -import { - parseAccountGroupId, - type AccountGroupId, -} from '@metamask/account-api'; +import { parseAccountGroupId } from '@metamask/account-api'; +import type { AccountGroupId } from '@metamask/account-api'; import type { AccountTreeControllerState } from '@metamask/account-tree-controller'; import type { AccountsControllerState } from '@metamask/accounts-controller'; import { isEvmAccountType } from '@metamask/keyring-api'; diff --git a/packages/assets-controllers/src/multi-chain-accounts-service/api-balance-fetcher.test.ts b/packages/assets-controllers/src/multi-chain-accounts-service/api-balance-fetcher.test.ts index 3daee25b6c8..46ce0da79c1 100644 --- a/packages/assets-controllers/src/multi-chain-accounts-service/api-balance-fetcher.test.ts +++ b/packages/assets-controllers/src/multi-chain-accounts-service/api-balance-fetcher.test.ts @@ -1,11 +1,8 @@ import type { InternalAccount } from '@metamask/keyring-internal-api'; import BN from 'bn.js'; -import { - AccountsApiBalanceFetcher, - type ChainIdHex, - type ChecksumAddress, -} from './api-balance-fetcher'; +import { AccountsApiBalanceFetcher } from './api-balance-fetcher'; +import type { ChainIdHex, ChecksumAddress } from './api-balance-fetcher'; import type { GetBalancesResponse } from './types'; import { SUPPORTED_NETWORKS_ACCOUNTS_API_V4 } from '../constants'; diff --git a/packages/assets-controllers/src/multicall.test.ts b/packages/assets-controllers/src/multicall.test.ts index 92f6199c9c9..d9795f8e591 100644 --- a/packages/assets-controllers/src/multicall.test.ts +++ b/packages/assets-controllers/src/multicall.test.ts @@ -10,8 +10,8 @@ import { aggregate3, getTokenBalancesForMultipleAddresses, getStakedBalancesForAddresses, - type Aggregate3Call, } from './multicall'; +import type { Aggregate3Call } from './multicall'; const provider = new Web3Provider(jest.fn()); diff --git a/packages/assets-controllers/src/rpc-service/rpc-balance-fetcher.test.ts b/packages/assets-controllers/src/rpc-service/rpc-balance-fetcher.test.ts index 717541724c9..db0f93f3e9c 100644 --- a/packages/assets-controllers/src/rpc-service/rpc-balance-fetcher.test.ts +++ b/packages/assets-controllers/src/rpc-service/rpc-balance-fetcher.test.ts @@ -3,11 +3,8 @@ import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { NetworkClient } from '@metamask/network-controller'; import BN from 'bn.js'; -import { - RpcBalanceFetcher, - type ChainIdHex, - type ChecksumAddress, -} from './rpc-balance-fetcher'; +import { RpcBalanceFetcher } from './rpc-balance-fetcher'; +import type { ChainIdHex, ChecksumAddress } from './rpc-balance-fetcher'; import type { TokensControllerState } from '../TokensController'; const MOCK_ADDRESS_1 = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; diff --git a/packages/assets-controllers/src/selectors/stringify-balance.ts b/packages/assets-controllers/src/selectors/stringify-balance.ts index fe743529724..acfcce77490 100644 --- a/packages/assets-controllers/src/selectors/stringify-balance.ts +++ b/packages/assets-controllers/src/selectors/stringify-balance.ts @@ -1,7 +1,8 @@ // From https://github.com/MetaMask/eth-token-tracker/blob/main/lib/util.js // Ensures backwards compatibility with display formatting. -import { bigIntToHex, type Hex } from '@metamask/utils'; +import { bigIntToHex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; /** * @param balance - The balance to stringify as a decimal string diff --git a/packages/assets-controllers/src/selectors/token-selectors.ts b/packages/assets-controllers/src/selectors/token-selectors.ts index 741d1174e3f..d807603d004 100644 --- a/packages/assets-controllers/src/selectors/token-selectors.ts +++ b/packages/assets-controllers/src/selectors/token-selectors.ts @@ -5,7 +5,8 @@ import { convertHexToDecimal } from '@metamask/controller-utils'; import { TrxScope } from '@metamask/keyring-api'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { NetworkState } from '@metamask/network-controller'; -import { hexToBigInt, parseCaipAssetType, type Hex } from '@metamask/utils'; +import { hexToBigInt, parseCaipAssetType } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { createSelector, weakMapMemoize } from 'reselect'; import { diff --git a/packages/assets-controllers/src/token-prices-service/codefi-v2.test.ts b/packages/assets-controllers/src/token-prices-service/codefi-v2.test.ts index 44da38b1b62..dc8c867d7c0 100644 --- a/packages/assets-controllers/src/token-prices-service/codefi-v2.test.ts +++ b/packages/assets-controllers/src/token-prices-service/codefi-v2.test.ts @@ -1,4 +1,5 @@ -import { type Hex, KnownCaipNamespace } from '@metamask/utils'; +import { KnownCaipNamespace } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import nock from 'nock'; import { useFakeTimers } from 'sinon'; diff --git a/packages/base-controller/src/BaseController.test.ts b/packages/base-controller/src/BaseController.test.ts index 954d3277030..70d394cf628 100644 --- a/packages/base-controller/src/BaseController.test.ts +++ b/packages/base-controller/src/BaseController.test.ts @@ -1,9 +1,6 @@ /* eslint-disable jest/no-export */ -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MockAnyNamespace, -} from '@metamask/messenger'; +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { MockAnyNamespace } from '@metamask/messenger'; import type { Json } from '@metamask/utils'; import type { Draft, Patch } from 'immer'; import * as sinon from 'sinon'; diff --git a/packages/bridge-controller/src/bridge-controller.sse.test.ts b/packages/bridge-controller/src/bridge-controller.sse.test.ts index e88ce50128a..37912d87b07 100644 --- a/packages/bridge-controller/src/bridge-controller.sse.test.ts +++ b/packages/bridge-controller/src/bridge-controller.sse.test.ts @@ -10,12 +10,8 @@ import { DEFAULT_BRIDGE_CONTROLLER_STATE, ETH_USDT_ADDRESS, } from './constants/bridge'; -import type { QuoteResponse, TxData } from './types'; -import { - ChainId, - RequestStatus, - type BridgeControllerMessenger, -} from './types'; +import { ChainId, RequestStatus } from './types'; +import type { BridgeControllerMessenger, QuoteResponse, TxData } from './types'; import * as balanceUtils from './utils/balance'; import { formatChainIdToDec } from './utils/caip-formatters'; import * as featureFlagUtils from './utils/feature-flags'; diff --git a/packages/bridge-controller/src/bridge-controller.test.ts b/packages/bridge-controller/src/bridge-controller.test.ts index 4ab31aa7085..545c045de33 100644 --- a/packages/bridge-controller/src/bridge-controller.test.ts +++ b/packages/bridge-controller/src/bridge-controller.test.ts @@ -17,14 +17,11 @@ import { } from './constants/bridge'; import { SWAPS_API_V2_BASE_URL } from './constants/swaps'; import * as selectors from './selectors'; -import { - ChainId, - RequestStatus, - SortOrder, - StatusTypes, - type BridgeControllerMessenger, - type QuoteResponse, - type GenericQuoteRequest, +import { ChainId, RequestStatus, SortOrder, StatusTypes } from './types'; +import type { + BridgeControllerMessenger, + QuoteResponse, + GenericQuoteRequest, } from './types'; import * as balanceUtils from './utils/balance'; import { getNativeAssetForChainId, isSolanaChainId } from './utils/bridge'; diff --git a/packages/bridge-controller/src/bridge-controller.ts b/packages/bridge-controller/src/bridge-controller.ts index fac182c36c1..56c620b2e95 100644 --- a/packages/bridge-controller/src/bridge-controller.ts +++ b/packages/bridge-controller/src/bridge-controller.ts @@ -21,16 +21,16 @@ import { CHAIN_IDS } from './constants/chains'; import { SWAPS_CONTRACT_ADDRESSES } from './constants/swaps'; import { TraceName } from './constants/traces'; import { selectIsAssetExchangeRateInState } from './selectors'; -import type { QuoteRequest } from './types'; -import { - type L1GasFees, - type GenericQuoteRequest, - type NonEvmFees, - type QuoteResponse, - type BridgeControllerState, - type BridgeControllerMessenger, - type FetchFunction, - RequestStatus, +import { RequestStatus } from './types'; +import type { + L1GasFees, + GenericQuoteRequest, + NonEvmFees, + QuoteRequest, + QuoteResponse, + BridgeControllerState, + BridgeControllerMessenger, + FetchFunction, } from './types'; import { getAssetIdsForToken, toExchangeRates } from './utils/assets'; import { hasSufficientBalance } from './utils/balance'; @@ -74,7 +74,7 @@ import type { RequestMetadata, RequiredEventContextFromClient, } from './utils/metrics/types'; -import { type CrossChainSwapsEventProperties } from './utils/metrics/types'; +import type { CrossChainSwapsEventProperties } from './utils/metrics/types'; import { isValidQuoteRequest, sortQuotes } from './utils/quote'; import { appendFeesToQuotes } from './utils/quote-fees'; import { getMinimumBalanceForRentExemptionInLamports } from './utils/snaps'; diff --git a/packages/bridge-controller/src/utils/bridge.ts b/packages/bridge-controller/src/utils/bridge.ts index c44cea1318d..c9b5be725f8 100644 --- a/packages/bridge-controller/src/utils/bridge.ts +++ b/packages/bridge-controller/src/utils/bridge.ts @@ -2,8 +2,8 @@ import { AddressZero } from '@ethersproject/constants'; import { Contract } from '@ethersproject/contracts'; import { BtcScope, SolScope, TrxScope } from '@metamask/keyring-api'; import { abiERC20 } from '@metamask/metamask-eth-abis'; -import type { CaipAssetType, CaipChainId } from '@metamask/utils'; -import { isCaipChainId, isStrictHexString, type Hex } from '@metamask/utils'; +import { isCaipChainId, isStrictHexString } from '@metamask/utils'; +import type { CaipAssetType, CaipChainId, Hex } from '@metamask/utils'; import { formatChainIdToCaip, @@ -20,8 +20,8 @@ import { SWAPS_CONTRACT_ADDRESSES } from '../constants/swaps'; import { SWAPS_CHAINID_DEFAULT_TOKEN_MAP, SYMBOL_TO_SLIP44_MAP, - type SupportedSwapsNativeCurrencySymbols, } from '../constants/tokens'; +import type { SupportedSwapsNativeCurrencySymbols } from '../constants/tokens'; import type { BridgeAsset, BridgeControllerState, diff --git a/packages/bridge-controller/src/utils/caip-formatters.ts b/packages/bridge-controller/src/utils/caip-formatters.ts index 306b0eafbe2..498366c7e75 100644 --- a/packages/bridge-controller/src/utils/caip-formatters.ts +++ b/packages/bridge-controller/src/utils/caip-formatters.ts @@ -3,10 +3,7 @@ import { AddressZero } from '@ethersproject/constants'; import { convertHexToDecimal } from '@metamask/controller-utils'; import { BtcScope, SolScope, TrxScope } from '@metamask/keyring-api'; import { toEvmCaipChainId } from '@metamask/multichain-network-controller'; -import type { CaipAssetType } from '@metamask/utils'; import { - type Hex, - type CaipChainId, isCaipChainId, isStrictHexString, parseCaipChainId, @@ -15,6 +12,7 @@ import { isCaipAssetType, CaipAssetTypeStruct, } from '@metamask/utils'; +import type { CaipAssetType, CaipChainId, Hex } from '@metamask/utils'; import { getNativeAssetForChainId, diff --git a/packages/bridge-controller/src/utils/metrics/properties.ts b/packages/bridge-controller/src/utils/metrics/properties.ts index 65fcc37dc19..d25b700ffac 100644 --- a/packages/bridge-controller/src/utils/metrics/properties.ts +++ b/packages/bridge-controller/src/utils/metrics/properties.ts @@ -8,11 +8,13 @@ import type { RequestParams, } from './types'; import { DEFAULT_BRIDGE_CONTROLLER_STATE } from '../../constants/bridge'; -import type { QuoteMetadata, QuoteResponse, TxData } from '../../types'; -import { - ChainId, - type GenericQuoteRequest, - type QuoteRequest, +import { ChainId } from '../../types'; +import type { + GenericQuoteRequest, + QuoteMetadata, + QuoteRequest, + QuoteResponse, + TxData, } from '../../types'; import { getNativeAssetForChainId, isCrossChain } from '../bridge'; import { diff --git a/packages/bridge-controller/src/utils/swaps.test.ts b/packages/bridge-controller/src/utils/swaps.test.ts index a8abcb07aa4..7d64e320a08 100644 --- a/packages/bridge-controller/src/utils/swaps.test.ts +++ b/packages/bridge-controller/src/utils/swaps.test.ts @@ -5,8 +5,8 @@ import { fetchTokens, getSwapsContractAddress, isValidSwapsContractAddress, - type SwapsToken, } from './swaps'; +import type { SwapsToken } from './swaps'; import { CHAIN_IDS } from '../constants/chains'; import { ALLOWED_CONTRACT_ADDRESSES, diff --git a/packages/bridge-controller/src/utils/trade-utils.test.ts b/packages/bridge-controller/src/utils/trade-utils.test.ts index 0dbfeaddcbe..7cc11fc6ce7 100644 --- a/packages/bridge-controller/src/utils/trade-utils.test.ts +++ b/packages/bridge-controller/src/utils/trade-utils.test.ts @@ -3,8 +3,8 @@ import { isEvmTxData, isBitcoinTrade, isTronTrade, - type Trade, } from './trade-utils'; +import type { Trade } from './trade-utils'; import type { BitcoinTradeData, TronTradeData, TxData } from '../types'; describe('Trade utils', () => { diff --git a/packages/bridge-status-controller/src/bridge-status-controller.test.ts b/packages/bridge-status-controller/src/bridge-status-controller.test.ts index 3c3e0d8cfda..f282298a110 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.test.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.test.ts @@ -2,26 +2,26 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import type { BridgeControllerMessenger, + QuoteResponse, + QuoteMetadata, TxData, TronTradeData, } from '@metamask/bridge-controller'; import { - type QuoteResponse, - type QuoteMetadata, + ActionTypes, + ChainId, + FeeType, StatusTypes, BridgeController, getNativeAssetForChainId, FeatureId, getQuotesReceivedProperties, } from '@metamask/bridge-controller'; -import { ChainId } from '@metamask/bridge-controller'; -import { ActionTypes, FeeType } from '@metamask/bridge-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { TransactionType, @@ -40,14 +40,14 @@ import { DEFAULT_BRIDGE_STATUS_CONTROLLER_STATE, MAX_ATTEMPTS, } from './constants'; -import type { StatusResponse } from './types'; -import { - type BridgeId, - type StartPollingForBridgeTxStatusArgsSerialized, - type BridgeHistoryItem, - type BridgeStatusControllerState, - type BridgeStatusControllerMessenger, - BridgeClientId, +import { BridgeClientId } from './types'; +import type { + BridgeId, + StartPollingForBridgeTxStatusArgsSerialized, + BridgeHistoryItem, + BridgeStatusControllerState, + BridgeStatusControllerMessenger, + StatusResponse, } from './types'; import * as bridgeStatusUtils from './utils/bridge-status'; import * as transactionUtils from './utils/transaction'; diff --git a/packages/bridge-status-controller/src/bridge-status-controller.ts b/packages/bridge-status-controller/src/bridge-status-controller.ts index 6b971d9c754..08e6a0ac45f 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.ts @@ -1,12 +1,11 @@ import type { AccountsControllerState } from '@metamask/accounts-controller'; import type { StateMetadata } from '@metamask/base-controller'; -import { - type QuoteMetadata, - type RequiredEventContextFromClient, - type TxData, - type QuoteResponse, - type Trade, - isEvmTxData, +import type { + QuoteMetadata, + RequiredEventContextFromClient, + TxData, + QuoteResponse, + Trade, } from '@metamask/bridge-controller'; import { formatChainIdToHex, @@ -15,6 +14,7 @@ import { UnifiedSwapBridgeEventName, formatChainIdToCaip, isCrossChain, + isEvmTxData, isHardwareWallet, MetricsActionType, isBitcoinTrade, @@ -24,16 +24,17 @@ import { import type { TraceCallback } from '@metamask/controller-utils'; import { toHex } from '@metamask/controller-utils'; import { StaticIntervalPollingController } from '@metamask/polling-controller'; -import type { - TransactionController, - TransactionParams, -} from '@metamask/transaction-controller'; import { TransactionStatus, TransactionType, - type TransactionMeta, } from '@metamask/transaction-controller'; -import { numberToHex, type Hex } from '@metamask/utils'; +import type { + TransactionController, + TransactionMeta, + TransactionParams, +} from '@metamask/transaction-controller'; +import { numberToHex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { BRIDGE_PROD_API_BASE_URL, @@ -50,7 +51,7 @@ import type { SolanaTransactionMeta, BridgeHistoryItem, } from './types'; -import { type BridgeStatusControllerMessenger } from './types'; +import type { BridgeStatusControllerMessenger } from './types'; import { BridgeClientId } from './types'; import { fetchBridgeTxStatus, diff --git a/packages/bridge-status-controller/src/utils/bridge-status.ts b/packages/bridge-status-controller/src/utils/bridge-status.ts index 3d0f05d9991..fa5d0890a8b 100644 --- a/packages/bridge-status-controller/src/utils/bridge-status.ts +++ b/packages/bridge-status-controller/src/utils/bridge-status.ts @@ -1,4 +1,4 @@ -import { type Quote } from '@metamask/bridge-controller'; +import type { Quote } from '@metamask/bridge-controller'; import { StructError } from '@metamask/superstruct'; import { validateBridgeStatusResponse } from './validators'; diff --git a/packages/bridge-status-controller/src/utils/metrics.ts b/packages/bridge-status-controller/src/utils/metrics.ts index 23b1bae2247..34dc3e90ec8 100644 --- a/packages/bridge-status-controller/src/utils/metrics.ts +++ b/packages/bridge-status-controller/src/utils/metrics.ts @@ -1,19 +1,10 @@ import type { AccountsControllerState } from '@metamask/accounts-controller'; -import type { - QuoteResponse, - QuoteMetadata, - QuoteFetchData, -} from '@metamask/bridge-controller'; import { - type TxStatusData, StatusTypes, formatChainIdToHex, isEthUsdt, - type RequestParams, formatChainIdToCaip, - type TradeData, formatProviderLabel, - type RequestMetadata, isCustomSlippage, getSwapType, isHardwareWallet, @@ -21,11 +12,20 @@ import { MetricsActionType, MetricsSwapType, } from '@metamask/bridge-controller'; +import type { + QuoteFetchData, + QuoteMetadata, + QuoteResponse, + TxStatusData, + RequestParams, + TradeData, + RequestMetadata, +} from '@metamask/bridge-controller'; import { TransactionStatus, TransactionType, - type TransactionMeta, } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; import type { CaipAssetType } from '@metamask/utils'; import { BigNumber } from 'bignumber.js'; diff --git a/packages/bridge-status-controller/src/utils/swap-received-amount.ts b/packages/bridge-status-controller/src/utils/swap-received-amount.ts index 742955ee0a0..b5ee34fc6a5 100644 --- a/packages/bridge-status-controller/src/utils/swap-received-amount.ts +++ b/packages/bridge-status-controller/src/utils/swap-received-amount.ts @@ -1,6 +1,6 @@ import type { TokenAmountValues } from '@metamask/bridge-controller'; import { isNativeAddress } from '@metamask/bridge-controller'; -import { type TransactionMeta } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; import { BigNumber } from 'bignumber.js'; import type { BridgeHistoryItem } from '../types'; diff --git a/packages/bridge-status-controller/src/utils/transaction.test.ts b/packages/bridge-status-controller/src/utils/transaction.test.ts index e25a471374e..eb6e075e1ea 100644 --- a/packages/bridge-status-controller/src/utils/transaction.test.ts +++ b/packages/bridge-status-controller/src/utils/transaction.test.ts @@ -3,9 +3,11 @@ import { FeeType, formatChainIdToCaip, formatChainIdToHex, - type QuoteMetadata, - type QuoteResponse, - type TxData, +} from '@metamask/bridge-controller'; +import type { + QuoteMetadata, + QuoteResponse, + TxData, } from '@metamask/bridge-controller'; import { TransactionStatus, diff --git a/packages/bridge-status-controller/src/utils/transaction.ts b/packages/bridge-status-controller/src/utils/transaction.ts index 268318cc41a..63248853447 100644 --- a/packages/bridge-status-controller/src/utils/transaction.ts +++ b/packages/bridge-status-controller/src/utils/transaction.ts @@ -1,27 +1,27 @@ import type { AccountsControllerState } from '@metamask/accounts-controller'; -import type { TxData } from '@metamask/bridge-controller'; import { ChainId, + extractTradeData, + isTronTrade, formatChainIdToCaip, formatChainIdToHex, isCrossChain, - type QuoteMetadata, - type QuoteResponse, } from '@metamask/bridge-controller'; -import { - extractTradeData, - isTronTrade, - type Trade, +import type { + QuoteMetadata, + QuoteResponse, + Trade, + TxData, } from '@metamask/bridge-controller'; import { toHex } from '@metamask/controller-utils'; -import type { - BatchTransactionParams, - TransactionController, -} from '@metamask/transaction-controller'; import { TransactionStatus, TransactionType, - type TransactionMeta, +} from '@metamask/transaction-controller'; +import type { + BatchTransactionParams, + TransactionController, + TransactionMeta, } from '@metamask/transaction-controller'; import { createProjectLogger } from '@metamask/utils'; import { v4 as uuid } from 'uuid'; diff --git a/packages/chain-agnostic-permission/src/caip25Permission.test.ts b/packages/chain-agnostic-permission/src/caip25Permission.test.ts index 67bb525064e..9cb20bc676d 100644 --- a/packages/chain-agnostic-permission/src/caip25Permission.test.ts +++ b/packages/chain-agnostic-permission/src/caip25Permission.test.ts @@ -1,10 +1,12 @@ import { CaveatMutatorOperation, PermissionType, - type SubjectPermissions, - type ExtractPermission, - type PermissionSpecificationConstraint, - type CaveatSpecificationConstraint, +} from '@metamask/permission-controller'; +import type { + SubjectPermissions, + ExtractPermission, + PermissionSpecificationConstraint, + CaveatSpecificationConstraint, } from '@metamask/permission-controller'; import { pick } from 'lodash'; diff --git a/packages/chain-agnostic-permission/src/caip25Permission.ts b/packages/chain-agnostic-permission/src/caip25Permission.ts index f625b6435c7..d8e986e7971 100644 --- a/packages/chain-agnostic-permission/src/caip25Permission.ts +++ b/packages/chain-agnostic-permission/src/caip25Permission.ts @@ -11,14 +11,18 @@ import { CaveatMutatorOperation, PermissionType, } from '@metamask/permission-controller'; -import type { CaipAccountId, CaipChainId, Json } from '@metamask/utils'; import { hasProperty, KnownCaipNamespace, parseCaipAccountId, isObject, - type Hex, - type NonEmptyArray, +} from '@metamask/utils'; +import type { + CaipAccountId, + CaipChainId, + Json, + Hex, + NonEmptyArray, } from '@metamask/utils'; import { cloneDeep, isEqual, pick } from 'lodash'; @@ -38,11 +42,11 @@ import { isSupportedSessionProperty, } from './scope/supported'; import { mergeInternalScopes } from './scope/transform'; -import { - parseScopeString, - type ExternalScopeString, - type InternalScopeObject, - type InternalScopesObject, +import { parseScopeString } from './scope/types'; +import type { + ExternalScopeString, + InternalScopeObject, + InternalScopesObject, } from './scope/types'; /** diff --git a/packages/chain-agnostic-permission/src/operators/caip-permission-operator-accounts.ts b/packages/chain-agnostic-permission/src/operators/caip-permission-operator-accounts.ts index 5330a757145..71278aca353 100644 --- a/packages/chain-agnostic-permission/src/operators/caip-permission-operator-accounts.ts +++ b/packages/chain-agnostic-permission/src/operators/caip-permission-operator-accounts.ts @@ -2,14 +2,16 @@ import { isEqualCaseInsensitive } from '@metamask/controller-utils'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import { assertIsStrictHexString, - type CaipAccountAddress, - type CaipAccountId, - type CaipNamespace, - type CaipReference, - type Hex, KnownCaipNamespace, parseCaipAccountId, } from '@metamask/utils'; +import type { + CaipAccountAddress, + CaipAccountId, + CaipNamespace, + CaipReference, + Hex, +} from '@metamask/utils'; import type { Caip25CaveatValue } from '../caip25Permission'; import { KnownWalletScopeString } from '../scope/constants'; diff --git a/packages/chain-agnostic-permission/src/operators/caip-permission-operator-permittedChains.ts b/packages/chain-agnostic-permission/src/operators/caip-permission-operator-permittedChains.ts index ae19b0568f6..c8feac45825 100644 --- a/packages/chain-agnostic-permission/src/operators/caip-permission-operator-permittedChains.ts +++ b/packages/chain-agnostic-permission/src/operators/caip-permission-operator-permittedChains.ts @@ -2,7 +2,8 @@ import { toHex } from '@metamask/controller-utils'; import type { Hex, CaipChainId, CaipNamespace } from '@metamask/utils'; import { hexToBigInt, KnownCaipNamespace } from '@metamask/utils'; -import { Caip25CaveatType, type Caip25CaveatValue } from '../caip25Permission'; +import { Caip25CaveatType } from '../caip25Permission'; +import type { Caip25CaveatValue } from '../caip25Permission'; import { getUniqueArrayItems } from '../scope/transform'; import type { InternalScopesObject, InternalScopeString } from '../scope/types'; import { isWalletScope, parseScopeString } from '../scope/types'; diff --git a/packages/chain-agnostic-permission/src/operators/caip-permission-operator-session-scopes.ts b/packages/chain-agnostic-permission/src/operators/caip-permission-operator-session-scopes.ts index 0da325cb537..16fb6983cf1 100644 --- a/packages/chain-agnostic-permission/src/operators/caip-permission-operator-session-scopes.ts +++ b/packages/chain-agnostic-permission/src/operators/caip-permission-operator-session-scopes.ts @@ -1,9 +1,5 @@ -import { - type CaipAccountId, - type CaipChainId, - isCaipChainId, - KnownCaipNamespace, -} from '@metamask/utils'; +import { isCaipChainId, KnownCaipNamespace } from '@metamask/utils'; +import type { CaipAccountId, CaipChainId } from '@metamask/utils'; import type { Caip25CaveatValue } from '../caip25Permission'; import { diff --git a/packages/chain-agnostic-permission/src/scope/assert.ts b/packages/chain-agnostic-permission/src/scope/assert.ts index 38508aaa8cd..01eda87eb93 100644 --- a/packages/chain-agnostic-permission/src/scope/assert.ts +++ b/packages/chain-agnostic-permission/src/scope/assert.ts @@ -1,13 +1,12 @@ import { - type CaipChainId, hasProperty, isCaipAccountId, isCaipChainId, isCaipNamespace, isCaipReference, KnownCaipNamespace, - type Hex, } from '@metamask/utils'; +import type { CaipChainId, Hex } from '@metamask/utils'; import { Caip25Errors } from './errors'; import { diff --git a/packages/claims-controller/src/ClaimsService.ts b/packages/claims-controller/src/ClaimsService.ts index c643a7ee704..f73d6d1c5e5 100644 --- a/packages/claims-controller/src/ClaimsService.ts +++ b/packages/claims-controller/src/ClaimsService.ts @@ -5,9 +5,9 @@ import type { Hex } from '@metamask/utils'; import { CLAIMS_API_URL_MAP, ClaimsServiceErrorMessages, - type Env, SERVICE_NAME, } from './constants'; +import type { Env } from './constants'; import type { Claim, ClaimsConfigurationsResponse, diff --git a/packages/claims-controller/tests/mocks/messenger.ts b/packages/claims-controller/tests/mocks/messenger.ts index 3acf3595700..4ccae3ac5a5 100644 --- a/packages/claims-controller/tests/mocks/messenger.ts +++ b/packages/claims-controller/tests/mocks/messenger.ts @@ -1,9 +1,8 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { diff --git a/packages/composable-controller/src/ComposableController.test.ts b/packages/composable-controller/src/ComposableController.test.ts index ef86c1f40d4..adc79ae8381 100644 --- a/packages/composable-controller/src/ComposableController.test.ts +++ b/packages/composable-controller/src/ComposableController.test.ts @@ -1,17 +1,18 @@ import { BaseController, - type ControllerStateChangeEvent, - type ControllerGetStateAction, - type StateConstraint, deriveStateFromMetadata, } from '@metamask/base-controller'; +import type { + ControllerStateChangeEvent, + ControllerGetStateAction, + StateConstraint, +} from '@metamask/base-controller'; import { JsonRpcEngine } from '@metamask/json-rpc-engine'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { Patch } from 'immer'; import * as sinon from 'sinon'; diff --git a/packages/controller-utils/src/util.ts b/packages/controller-utils/src/util.ts index 65164aa1756..5a6a9be9097 100644 --- a/packages/controller-utils/src/util.ts +++ b/packages/controller-utils/src/util.ts @@ -297,8 +297,6 @@ function toChecksumHexAddressUnmemoized(address: string): string; */ function toChecksumHexAddressUnmemoized(address: T): T; -// Tools only see JSDocs for overloads and ignore them for the implementation. -// eslint-disable-next-line jsdoc/require-jsdoc function toChecksumHexAddressUnmemoized(address: unknown) { if (typeof address !== 'string') { // Mimic behavior of `addHexPrefix` from `ethereumjs-util` (which this @@ -344,8 +342,6 @@ export const toChecksumHexAddress: { (address: T): T; } = memoize(toChecksumHexAddressUnmemoized); -// JSDoc is only used for memoized version of this function that is exported -// eslint-disable-next-line jsdoc/require-jsdoc function isValidHexAddressUnmemoized( possibleAddress: string, { allowNonPrefixed = true } = {}, diff --git a/packages/core-backend/src/AccountActivityService.test.ts b/packages/core-backend/src/AccountActivityService.test.ts index 2472e133ab1..d8d25cdee10 100644 --- a/packages/core-backend/src/AccountActivityService.test.ts +++ b/packages/core-backend/src/AccountActivityService.test.ts @@ -1,17 +1,16 @@ import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { Hex } from '@metamask/utils'; -import { - AccountActivityService, - type AccountActivityServiceMessenger, - type SubscriptionOptions, +import { AccountActivityService } from './AccountActivityService'; +import type { + AccountActivityServiceMessenger, + SubscriptionOptions, } from './AccountActivityService'; import type { ServerNotificationMessage } from './BackendWebSocketService'; import { WebSocketState } from './BackendWebSocketService'; diff --git a/packages/core-backend/src/BackendWebSocketService.test.ts b/packages/core-backend/src/BackendWebSocketService.test.ts index 94332d05f88..5b1440548bc 100644 --- a/packages/core-backend/src/BackendWebSocketService.test.ts +++ b/packages/core-backend/src/BackendWebSocketService.test.ts @@ -1,17 +1,18 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { BackendWebSocketService, getCloseReason, WebSocketState, - type BackendWebSocketServiceOptions, - type BackendWebSocketServiceMessenger, +} from './BackendWebSocketService'; +import type { + BackendWebSocketServiceOptions, + BackendWebSocketServiceMessenger, } from './BackendWebSocketService'; import { flushPromises } from '../../../tests/helpers'; diff --git a/packages/delegation-controller/src/DelegationController.test.ts b/packages/delegation-controller/src/DelegationController.test.ts index c578c43c612..c3b808da425 100644 --- a/packages/delegation-controller/src/DelegationController.test.ts +++ b/packages/delegation-controller/src/DelegationController.test.ts @@ -1,11 +1,10 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { SignTypedDataVersion } from '@metamask/keyring-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { hexToNumber } from '@metamask/utils'; diff --git a/packages/earn-controller/src/EarnController.test.ts b/packages/earn-controller/src/EarnController.test.ts index d8d46ced428..3fab40a7b0a 100644 --- a/packages/earn-controller/src/EarnController.test.ts +++ b/packages/earn-controller/src/EarnController.test.ts @@ -1,30 +1,33 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { toHex } from '@metamask/controller-utils'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { getDefaultNetworkControllerState } from '@metamask/network-controller'; import { EarnSdk, EarnApiService, - type PooledStakingApiService, - type LendingApiService, - type LendingMarket, EarnEnvironments, ChainId, } from '@metamask/stake-sdk'; +import type { + PooledStakingApiService, + LendingApiService, + LendingMarket, +} from '@metamask/stake-sdk'; import { EarnController, - type EarnControllerState, - type EarnControllerMessenger, DEFAULT_POOLED_STAKING_CHAIN_STATE, } from './EarnController'; +import type { + EarnControllerState, + EarnControllerMessenger, +} from './EarnController'; import type { TransactionMeta } from '../../transaction-controller/src'; import { TransactionStatus, diff --git a/packages/earn-controller/src/EarnController.ts b/packages/earn-controller/src/EarnController.ts index 193d60d07ef..d0efc502c0d 100644 --- a/packages/earn-controller/src/EarnController.ts +++ b/packages/earn-controller/src/EarnController.ts @@ -22,24 +22,26 @@ import { EarnSdk, EarnApiService, isSupportedLendingChain, - type LendingMarket, - type PooledStake, - type EarnSdkConfig, - type VaultData, - type VaultDailyApy, - type VaultApyAverages, - type LendingPosition, - type GasLimitParams, - type HistoricLendingMarketApys, EarnEnvironments, ChainId, isSupportedPooledStakingChain, } from '@metamask/stake-sdk'; -import { - type TransactionController, - TransactionType, - type TransactionControllerTransactionConfirmedEvent, - type TransactionMeta, +import type { + LendingMarket, + PooledStake, + EarnSdkConfig, + VaultData, + VaultDailyApy, + VaultApyAverages, + LendingPosition, + GasLimitParams, + HistoricLendingMarketApys, +} from '@metamask/stake-sdk'; +import { TransactionType } from '@metamask/transaction-controller'; +import type { + TransactionController, + TransactionControllerTransactionConfirmedEvent, + TransactionMeta, } from '@metamask/transaction-controller'; import type { diff --git a/packages/eip-5792-middleware/src/hooks/getCallsStatus.test.ts b/packages/eip-5792-middleware/src/hooks/getCallsStatus.test.ts index d2727fb0f69..0626016e078 100644 --- a/packages/eip-5792-middleware/src/hooks/getCallsStatus.test.ts +++ b/packages/eip-5792-middleware/src/hooks/getCallsStatus.test.ts @@ -1,9 +1,5 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MockAnyNamespace, -} from '@metamask/messenger'; +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { MessengerActions, MockAnyNamespace } from '@metamask/messenger'; import { TransactionStatus } from '@metamask/transaction-controller'; import type { TransactionControllerGetStateAction, diff --git a/packages/eip-5792-middleware/src/hooks/getCapabilities.test.ts b/packages/eip-5792-middleware/src/hooks/getCapabilities.test.ts index f0ca1cceba4..bc1c765f2df 100644 --- a/packages/eip-5792-middleware/src/hooks/getCapabilities.test.ts +++ b/packages/eip-5792-middleware/src/hooks/getCapabilities.test.ts @@ -3,12 +3,8 @@ import type { AccountsControllerState, } from '@metamask/accounts-controller'; import { KeyringTypes } from '@metamask/keyring-controller'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MockAnyNamespace, - type MessengerActions, -} from '@metamask/messenger'; +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { MockAnyNamespace, MessengerActions } from '@metamask/messenger'; import type { PreferencesControllerGetStateAction, PreferencesState, diff --git a/packages/eip-5792-middleware/src/hooks/processSendCalls.test.ts b/packages/eip-5792-middleware/src/hooks/processSendCalls.test.ts index 54fc85de5bb..009b81962d0 100644 --- a/packages/eip-5792-middleware/src/hooks/processSendCalls.test.ts +++ b/packages/eip-5792-middleware/src/hooks/processSendCalls.test.ts @@ -5,12 +5,8 @@ import type { } from '@metamask/accounts-controller'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - type MessengerActions, - type MockAnyNamespace, - Messenger, - MOCK_ANY_NAMESPACE, -} from '@metamask/messenger'; +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { MessengerActions, MockAnyNamespace } from '@metamask/messenger'; import type { AutoManagedNetworkClient, CustomNetworkClientConfiguration, diff --git a/packages/eip-5792-middleware/src/methods/wallet_getCallsStatus.ts b/packages/eip-5792-middleware/src/methods/wallet_getCallsStatus.ts index b6137fc8e5a..3023ec9b44b 100644 --- a/packages/eip-5792-middleware/src/methods/wallet_getCallsStatus.ts +++ b/packages/eip-5792-middleware/src/methods/wallet_getCallsStatus.ts @@ -1,7 +1,8 @@ import { rpcErrors } from '@metamask/rpc-errors'; import type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils'; -import { type GetCallsStatusHook, GetCallsStatusStruct } from '../types'; +import { GetCallsStatusStruct } from '../types'; +import type { GetCallsStatusHook } from '../types'; import { validateParams } from '../utils'; /** diff --git a/packages/eip-5792-middleware/src/methods/wallet_getCapabilities.ts b/packages/eip-5792-middleware/src/methods/wallet_getCapabilities.ts index 3be4441b117..e42ce6bd9af 100644 --- a/packages/eip-5792-middleware/src/methods/wallet_getCapabilities.ts +++ b/packages/eip-5792-middleware/src/methods/wallet_getCapabilities.ts @@ -1,7 +1,8 @@ import { rpcErrors } from '@metamask/rpc-errors'; import type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils'; -import { type GetCapabilitiesHook, GetCapabilitiesStruct } from '../types'; +import { GetCapabilitiesStruct } from '../types'; +import type { GetCapabilitiesHook } from '../types'; import { validateAndNormalizeKeyholder, validateParams } from '../utils'; /** diff --git a/packages/eip-5792-middleware/src/methods/wallet_sendCalls.ts b/packages/eip-5792-middleware/src/methods/wallet_sendCalls.ts index bea8aee8406..b51d20380c8 100644 --- a/packages/eip-5792-middleware/src/methods/wallet_sendCalls.ts +++ b/packages/eip-5792-middleware/src/methods/wallet_sendCalls.ts @@ -1,11 +1,8 @@ import { rpcErrors } from '@metamask/rpc-errors'; import type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils'; -import { - type ProcessSendCallsHook, - type SendCallsPayload, - SendCallsStruct, -} from '../types'; +import { SendCallsStruct } from '../types'; +import type { ProcessSendCallsHook, SendCallsPayload } from '../types'; import { validateAndNormalizeKeyholder, validateParams } from '../utils'; /** diff --git a/packages/eip-7702-internal-rpc-middleware/src/wallet_getAccountUpgradeStatus.ts b/packages/eip-7702-internal-rpc-middleware/src/wallet_getAccountUpgradeStatus.ts index ed6958dd41d..1438260638e 100644 --- a/packages/eip-7702-internal-rpc-middleware/src/wallet_getAccountUpgradeStatus.ts +++ b/packages/eip-7702-internal-rpc-middleware/src/wallet_getAccountUpgradeStatus.ts @@ -1,9 +1,9 @@ import { JsonRpcError, rpcErrors } from '@metamask/rpc-errors'; -import { - type JsonRpcRequest, - type PendingJsonRpcResponse, - type Hex, - getErrorMessage, +import { getErrorMessage } from '@metamask/utils'; +import type { + JsonRpcRequest, + PendingJsonRpcResponse, + Hex, } from '@metamask/utils'; import { DELEGATION_INDICATOR_PREFIX } from './constants'; diff --git a/packages/eip1193-permission-middleware/src/wallet-getPermissions.ts b/packages/eip1193-permission-middleware/src/wallet-getPermissions.ts index e6fc15be93f..705899e16ab 100644 --- a/packages/eip1193-permission-middleware/src/wallet-getPermissions.ts +++ b/packages/eip1193-permission-middleware/src/wallet-getPermissions.ts @@ -8,11 +8,11 @@ import type { AsyncJsonRpcEngineNextCallback, JsonRpcEngineEndCallback, } from '@metamask/json-rpc-engine'; -import { - type CaveatSpecificationConstraint, - MethodNames, - type PermissionController, - type PermissionSpecificationConstraint, +import { MethodNames } from '@metamask/permission-controller'; +import type { + CaveatSpecificationConstraint, + PermissionController, + PermissionSpecificationConstraint, } from '@metamask/permission-controller'; import type { Json, diff --git a/packages/eip1193-permission-middleware/src/wallet-requestPermissions.test.ts b/packages/eip1193-permission-middleware/src/wallet-requestPermissions.test.ts index abb0e0078e9..c14728e930d 100644 --- a/packages/eip1193-permission-middleware/src/wallet-requestPermissions.test.ts +++ b/packages/eip1193-permission-middleware/src/wallet-requestPermissions.test.ts @@ -2,10 +2,8 @@ import { Caip25CaveatType, Caip25EndowmentPermissionName, } from '@metamask/chain-agnostic-permission'; -import { - invalidParams, - type RequestedPermissions, -} from '@metamask/permission-controller'; +import { invalidParams } from '@metamask/permission-controller'; +import type { RequestedPermissions } from '@metamask/permission-controller'; import type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils'; import { CaveatTypes, EndowmentTypes, RestrictedMethods } from './types'; diff --git a/packages/eip1193-permission-middleware/src/wallet-requestPermissions.ts b/packages/eip1193-permission-middleware/src/wallet-requestPermissions.ts index 06fd2b983de..6b882e3dc07 100644 --- a/packages/eip1193-permission-middleware/src/wallet-requestPermissions.ts +++ b/packages/eip1193-permission-middleware/src/wallet-requestPermissions.ts @@ -9,15 +9,14 @@ import type { AsyncJsonRpcEngineNextCallback, JsonRpcEngineEndCallback, } from '@metamask/json-rpc-engine'; -import { - type Caveat, - type CaveatSpecificationConstraint, - invalidParams, - MethodNames, - type PermissionController, - type PermissionSpecificationConstraint, - type RequestedPermissions, - type ValidPermission, +import { invalidParams, MethodNames } from '@metamask/permission-controller'; +import type { + Caveat, + CaveatSpecificationConstraint, + PermissionController, + PermissionSpecificationConstraint, + RequestedPermissions, + ValidPermission, } from '@metamask/permission-controller'; import type { Json, diff --git a/packages/eip1193-permission-middleware/src/wallet-revokePermissions.ts b/packages/eip1193-permission-middleware/src/wallet-revokePermissions.ts index af9b2ccf2b7..828679498bb 100644 --- a/packages/eip1193-permission-middleware/src/wallet-revokePermissions.ts +++ b/packages/eip1193-permission-middleware/src/wallet-revokePermissions.ts @@ -4,11 +4,11 @@ import type { JsonRpcEngineEndCallback, } from '@metamask/json-rpc-engine'; import { invalidParams, MethodNames } from '@metamask/permission-controller'; -import { - isNonEmptyArray, - type Json, - type JsonRpcRequest, - type PendingJsonRpcResponse, +import { isNonEmptyArray } from '@metamask/utils'; +import type { + Json, + JsonRpcRequest, + PendingJsonRpcResponse, } from '@metamask/utils'; import { EndowmentTypes, RestrictedMethods } from './types'; diff --git a/packages/ens-controller/src/EnsController.test.ts b/packages/ens-controller/src/EnsController.test.ts index 1a28a326733..66d7464a3c7 100644 --- a/packages/ens-controller/src/EnsController.test.ts +++ b/packages/ens-controller/src/EnsController.test.ts @@ -5,17 +5,16 @@ import { toHex, InfuraNetworkType, } from '@metamask/controller-utils'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; -import { - type NetworkController, - type NetworkState, - getDefaultNetworkControllerState, +import { getDefaultNetworkControllerState } from '@metamask/network-controller'; +import type { + NetworkController, + NetworkState, } from '@metamask/network-controller'; import { EnsController, DEFAULT_ENS_NETWORK_MAP } from './EnsController'; diff --git a/packages/ens-controller/src/EnsController.ts b/packages/ens-controller/src/EnsController.ts index 0f9a1da71c8..16b59dadec7 100644 --- a/packages/ens-controller/src/EnsController.ts +++ b/packages/ens-controller/src/EnsController.ts @@ -1,9 +1,9 @@ import { Web3Provider } from '@ethersproject/providers'; -import { - BaseController, - type StateMetadata, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + StateMetadata, + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { ChainId } from '@metamask/controller-utils'; import { diff --git a/packages/error-reporting-service/src/error-reporting-service.test.ts b/packages/error-reporting-service/src/error-reporting-service.test.ts index 47ddaeb2faf..d120bc85ee7 100644 --- a/packages/error-reporting-service/src/error-reporting-service.test.ts +++ b/packages/error-reporting-service/src/error-reporting-service.test.ts @@ -1,8 +1,5 @@ -import { - Messenger, - type MessengerActions, - type MessengerEvents, -} from '@metamask/messenger'; +import { Messenger } from '@metamask/messenger'; +import type { MessengerActions, MessengerEvents } from '@metamask/messenger'; import { captureException as sentryCaptureException } from '@sentry/core'; import type { ErrorReportingServiceMessenger } from './error-reporting-service'; diff --git a/packages/eth-block-tracker/src/PollingBlockTracker.ts b/packages/eth-block-tracker/src/PollingBlockTracker.ts index 1ba5a9f8275..e204bca5979 100644 --- a/packages/eth-block-tracker/src/PollingBlockTracker.ts +++ b/packages/eth-block-tracker/src/PollingBlockTracker.ts @@ -4,12 +4,8 @@ import type { MiddlewareContext, } from '@metamask/json-rpc-engine/v2'; import SafeEventEmitter from '@metamask/safe-event-emitter'; -import { - createDeferredPromise, - type DeferredPromise, - getErrorMessage, - type JsonRpcRequest, -} from '@metamask/utils'; +import { createDeferredPromise, getErrorMessage } from '@metamask/utils'; +import type { DeferredPromise, JsonRpcRequest } from '@metamask/utils'; import getCreateRandomId from 'json-rpc-random-id'; import type { BlockTracker } from './BlockTracker'; diff --git a/packages/eth-block-tracker/tests/withBlockTracker.ts b/packages/eth-block-tracker/tests/withBlockTracker.ts index ca866459f57..17d937892ec 100644 --- a/packages/eth-block-tracker/tests/withBlockTracker.ts +++ b/packages/eth-block-tracker/tests/withBlockTracker.ts @@ -154,7 +154,6 @@ export async function withPollingBlockTracker( callback: WithPollingBlockTrackerCallback, ): Promise; -/* eslint-disable-next-line jsdoc/require-jsdoc */ export async function withPollingBlockTracker( ...args: | [WithPollingBlockTrackerOptions, WithPollingBlockTrackerCallback] diff --git a/packages/eth-json-rpc-middleware/src/inflight-cache.ts b/packages/eth-json-rpc-middleware/src/inflight-cache.ts index 0786d9b1224..0934356cbda 100644 --- a/packages/eth-json-rpc-middleware/src/inflight-cache.ts +++ b/packages/eth-json-rpc-middleware/src/inflight-cache.ts @@ -2,11 +2,8 @@ import type { JsonRpcMiddleware, MiddlewareContext, } from '@metamask/json-rpc-engine/v2'; -import { - type Json, - type JsonRpcRequest, - createDeferredPromise, -} from '@metamask/utils'; +import { createDeferredPromise } from '@metamask/utils'; +import type { Json, JsonRpcRequest } from '@metamask/utils'; import { projectLogger, createModuleLogger } from './logging-utils'; import { cacheIdentifierForRequest } from './utils/cache'; diff --git a/packages/eth-json-rpc-middleware/src/methods/wallet-request-execution-permissions.ts b/packages/eth-json-rpc-middleware/src/methods/wallet-request-execution-permissions.ts index 3ef8acfec99..20bef04a1a4 100644 --- a/packages/eth-json-rpc-middleware/src/methods/wallet-request-execution-permissions.ts +++ b/packages/eth-json-rpc-middleware/src/methods/wallet-request-execution-permissions.ts @@ -12,13 +12,8 @@ import { union, unknown, } from '@metamask/superstruct'; -import { - HexChecksumAddressStruct, - type Hex, - type Json, - type JsonRpcRequest, - StrictHexStruct, -} from '@metamask/utils'; +import { HexChecksumAddressStruct, StrictHexStruct } from '@metamask/utils'; +import type { Hex, Json, JsonRpcRequest } from '@metamask/utils'; import { validateParams } from '../utils/validation'; import type { WalletMiddlewareContext } from '../wallet'; diff --git a/packages/eth-json-rpc-middleware/src/methods/wallet-revoke-execution-permission.ts b/packages/eth-json-rpc-middleware/src/methods/wallet-revoke-execution-permission.ts index 5cf054646a5..314901545db 100644 --- a/packages/eth-json-rpc-middleware/src/methods/wallet-revoke-execution-permission.ts +++ b/packages/eth-json-rpc-middleware/src/methods/wallet-revoke-execution-permission.ts @@ -2,8 +2,8 @@ import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine/v2'; import { rpcErrors } from '@metamask/rpc-errors'; import type { Infer } from '@metamask/superstruct'; import { object } from '@metamask/superstruct'; -import type { Json } from '@metamask/utils'; -import { type JsonRpcRequest, StrictHexStruct } from '@metamask/utils'; +import { StrictHexStruct } from '@metamask/utils'; +import type { Json, JsonRpcRequest } from '@metamask/utils'; import { validateParams } from '../utils/validation'; import type { WalletMiddlewareContext } from '../wallet'; diff --git a/packages/eth-json-rpc-middleware/src/providerAsMiddleware.ts b/packages/eth-json-rpc-middleware/src/providerAsMiddleware.ts index 2ce4ade7e31..b2559f6bd0b 100644 --- a/packages/eth-json-rpc-middleware/src/providerAsMiddleware.ts +++ b/packages/eth-json-rpc-middleware/src/providerAsMiddleware.ts @@ -1,8 +1,6 @@ import type { InternalProvider } from '@metamask/eth-json-rpc-provider'; -import { - createAsyncMiddleware, - type JsonRpcMiddleware as LegacyJsonRpcMiddleware, -} from '@metamask/json-rpc-engine'; +import { createAsyncMiddleware } from '@metamask/json-rpc-engine'; +import type { JsonRpcMiddleware as LegacyJsonRpcMiddleware } from '@metamask/json-rpc-engine'; import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine/v2'; import type { Json, JsonRpcParams, JsonRpcRequest } from '@metamask/utils'; diff --git a/packages/eth-json-rpc-middleware/src/wallet.ts b/packages/eth-json-rpc-middleware/src/wallet.ts index 264e90ec5d0..2e1afdcf75c 100644 --- a/packages/eth-json-rpc-middleware/src/wallet.ts +++ b/packages/eth-json-rpc-middleware/src/wallet.ts @@ -10,14 +10,10 @@ import { rpcErrors } from '@metamask/rpc-errors'; import { isValidHexAddress } from '@metamask/utils'; import type { JsonRpcRequest, Json, Hex } from '@metamask/utils'; -import { - createWalletRequestExecutionPermissionsHandler, - type ProcessRequestExecutionPermissionsHook, -} from './methods/wallet-request-execution-permissions'; -import { - type ProcessRevokeExecutionPermissionHook, - createWalletRevokeExecutionPermissionHandler, -} from './methods/wallet-revoke-execution-permission'; +import { createWalletRequestExecutionPermissionsHandler } from './methods/wallet-request-execution-permissions'; +import type { ProcessRequestExecutionPermissionsHook } from './methods/wallet-request-execution-permissions'; +import { createWalletRevokeExecutionPermissionHandler } from './methods/wallet-revoke-execution-permission'; +import type { ProcessRevokeExecutionPermissionHook } from './methods/wallet-revoke-execution-permission'; import { stripArrayTypeIfPresent } from './utils/common'; import { normalizeTypedMessage, parseTypedMessage } from './utils/normalize'; import { diff --git a/packages/eth-json-rpc-provider/src/internal-provider.test.ts b/packages/eth-json-rpc-provider/src/internal-provider.test.ts index 4a9ea84ea0b..248685653f6 100644 --- a/packages/eth-json-rpc-provider/src/internal-provider.test.ts +++ b/packages/eth-json-rpc-provider/src/internal-provider.test.ts @@ -8,7 +8,7 @@ import type { } from '@metamask/json-rpc-engine/v2'; import { JsonRpcEngineV2 } from '@metamask/json-rpc-engine/v2'; import { providerErrors, rpcErrors } from '@metamask/rpc-errors'; -import { type JsonRpcRequest, type Json } from '@metamask/utils'; +import type { JsonRpcRequest, Json } from '@metamask/utils'; import { BrowserProvider } from 'ethers'; import { promisify } from 'util'; diff --git a/packages/eth-json-rpc-provider/src/internal-provider.ts b/packages/eth-json-rpc-provider/src/internal-provider.ts index fe8daee042c..fd38838472c 100644 --- a/packages/eth-json-rpc-provider/src/internal-provider.ts +++ b/packages/eth-json-rpc-provider/src/internal-provider.ts @@ -1,17 +1,18 @@ -import { asV2Middleware, type JsonRpcEngine } from '@metamask/json-rpc-engine'; -import { - type HandleOptions, - type ContextConstraint, - type MiddlewareContext, - JsonRpcEngineV2, +import { asV2Middleware } from '@metamask/json-rpc-engine'; +import type { JsonRpcEngine } from '@metamask/json-rpc-engine'; +import { JsonRpcEngineV2 } from '@metamask/json-rpc-engine/v2'; +import type { + HandleOptions, + ContextConstraint, + MiddlewareContext, } from '@metamask/json-rpc-engine/v2'; -import type { JsonRpcSuccess } from '@metamask/utils'; -import { - type Json, - type JsonRpcId, - type JsonRpcParams, - type JsonRpcRequest, - type JsonRpcVersion2, +import type { + Json, + JsonRpcId, + JsonRpcParams, + JsonRpcSuccess, + JsonRpcRequest, + JsonRpcVersion2, } from '@metamask/utils'; import { nanoid } from 'nanoid'; diff --git a/packages/eth-json-rpc-provider/src/provider-from-middleware.ts b/packages/eth-json-rpc-provider/src/provider-from-middleware.ts index 123e2772f29..f3ce178e58f 100644 --- a/packages/eth-json-rpc-provider/src/provider-from-middleware.ts +++ b/packages/eth-json-rpc-provider/src/provider-from-middleware.ts @@ -1,13 +1,11 @@ import { asV2Middleware } from '@metamask/json-rpc-engine'; import type { JsonRpcMiddleware as LegacyJsonRpcMiddleware } from '@metamask/json-rpc-engine'; +import { JsonRpcEngineV2 } from '@metamask/json-rpc-engine/v2'; import type { + ContextConstraint, JsonRpcMiddleware, ResultConstraint, } from '@metamask/json-rpc-engine/v2'; -import { - JsonRpcEngineV2, - type ContextConstraint, -} from '@metamask/json-rpc-engine/v2'; import type { Json, JsonRpcParams, JsonRpcRequest } from '@metamask/utils'; import { InternalProvider } from './internal-provider'; diff --git a/packages/foundryup/src/download.ts b/packages/foundryup/src/download.ts index 569397d2283..3958694702d 100644 --- a/packages/foundryup/src/download.ts +++ b/packages/foundryup/src/download.ts @@ -1,4 +1,5 @@ -import { request as httpRequest, type IncomingMessage } from 'node:http'; +import { request as httpRequest } from 'node:http'; +import type { IncomingMessage } from 'node:http'; import { request as httpsRequest } from 'node:https'; import { Stream } from 'node:stream'; import { pipeline } from 'node:stream/promises'; diff --git a/packages/foundryup/src/extract.ts b/packages/foundryup/src/extract.ts index e8e085d258c..3cb213d9d97 100644 --- a/packages/foundryup/src/extract.ts +++ b/packages/foundryup/src/extract.ts @@ -8,10 +8,12 @@ import { Agent as HttpsAgent } from 'node:https'; import { join, basename, extname, relative } from 'node:path'; import { pipeline } from 'node:stream/promises'; import { extract as extractTar } from 'tar'; -import { Open, type Source, type Entry } from 'unzipper'; +import { Open } from 'unzipper'; +import type { Source, Entry } from 'unzipper'; import { startDownload } from './download'; -import { Extension, type Binary } from './types'; +import { Extension } from './types'; +import type { Binary } from './types'; import { say } from './utils'; /** diff --git a/packages/foundryup/src/options.ts b/packages/foundryup/src/options.ts index f198c7a5489..a0666b89edc 100644 --- a/packages/foundryup/src/options.ts +++ b/packages/foundryup/src/options.ts @@ -2,15 +2,13 @@ import { platform } from 'node:os'; import { argv, stdout } from 'node:process'; import yargs from 'yargs/yargs'; -import { - type Checksums, - type ParsedOptions, - type ArchitecturesTuple, - type BinariesTuple, - type PlatformsTuple, - Architecture, - Binary, - Platform, +import { Architecture, Binary, Platform } from './types'; +import type { + Checksums, + ParsedOptions, + ArchitecturesTuple, + BinariesTuple, + PlatformsTuple, } from './types'; import { normalizeSystemArchitecture } from './utils'; diff --git a/packages/foundryup/src/utils.ts b/packages/foundryup/src/utils.ts index fd50af554e8..1b9c33092c6 100644 --- a/packages/foundryup/src/utils.ts +++ b/packages/foundryup/src/utils.ts @@ -1,12 +1,12 @@ import { execFileSync, execSync } from 'node:child_process'; import { arch } from 'node:os'; -import { - type Checksums, - type PlatformArchChecksums, - Architecture, - type Binary, - type Platform, +import { Architecture } from './types'; +import type { + Checksums, + PlatformArchChecksums, + Binary, + Platform, } from './types'; /** diff --git a/packages/gas-fee-controller/src/GasFeeController.test.ts b/packages/gas-fee-controller/src/GasFeeController.test.ts index aa69131f30b..2ee0746a983 100644 --- a/packages/gas-fee-controller/src/GasFeeController.test.ts +++ b/packages/gas-fee-controller/src/GasFeeController.test.ts @@ -5,12 +5,11 @@ import { toHex, } from '@metamask/controller-utils'; import EthQuery from '@metamask/eth-query'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { NetworkController, NetworkStatus } from '@metamask/network-controller'; import type { diff --git a/packages/gator-permissions-controller/src/GatorPermissionsController.test.ts b/packages/gator-permissions-controller/src/GatorPermissionsController.test.ts index 4a877129f93..ce6743274ff 100644 --- a/packages/gator-permissions-controller/src/GatorPermissionsController.test.ts +++ b/packages/gator-permissions-controller/src/GatorPermissionsController.test.ts @@ -9,17 +9,17 @@ import { CHAIN_ID, DELEGATOR_CONTRACTS, } from '@metamask/delegation-deployments'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { HandleSnapRequest, HasSnap } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; import type { TransactionMeta } from '@metamask/transaction-controller'; -import { hexToBigInt, numberToHex, type Hex } from '@metamask/utils'; +import { hexToBigInt, numberToHex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { DELEGATION_FRAMEWORK_VERSION } from './constants'; import { GatorPermissionsFetchError } from './errors'; diff --git a/packages/gator-permissions-controller/src/GatorPermissionsController.ts b/packages/gator-permissions-controller/src/GatorPermissionsController.ts index 906c6a7e26b..4b691626721 100644 --- a/packages/gator-permissions-controller/src/GatorPermissionsController.ts +++ b/packages/gator-permissions-controller/src/GatorPermissionsController.ts @@ -34,15 +34,15 @@ import { PermissionDecodingError, } from './errors'; import { controllerLog } from './logger'; +import { GatorPermissionsSnapRpcMethod } from './types'; import type { StoredGatorPermissionSanitized } from './types'; -import { - GatorPermissionsSnapRpcMethod, - type GatorPermissionsMap, - type PermissionTypesWithCustom, - type StoredGatorPermission, - type DelegationDetails, - type RevocationParams, - type PendingRevocationParams, +import type { + GatorPermissionsMap, + PermissionTypesWithCustom, + StoredGatorPermission, + DelegationDetails, + RevocationParams, + PendingRevocationParams, } from './types'; import { deserializeGatorPermissionsMap, diff --git a/packages/gator-permissions-controller/src/decodePermission/decodePermission.test.ts b/packages/gator-permissions-controller/src/decodePermission/decodePermission.test.ts index 122eae38adc..c5a0ab7c8e9 100644 --- a/packages/gator-permissions-controller/src/decodePermission/decodePermission.test.ts +++ b/packages/gator-permissions-controller/src/decodePermission/decodePermission.test.ts @@ -5,8 +5,8 @@ import { createERC20TokenPeriodTransferTerms, createTimestampTerms, ROOT_AUTHORITY, - type Hex, } from '@metamask/delegation-core'; +import type { Hex } from '@metamask/delegation-core'; import { CHAIN_ID, DELEGATOR_CONTRACTS, diff --git a/packages/gator-permissions-controller/src/decodePermission/utils.test.ts b/packages/gator-permissions-controller/src/decodePermission/utils.test.ts index 075438fb96e..5c791d477f5 100644 --- a/packages/gator-permissions-controller/src/decodePermission/utils.test.ts +++ b/packages/gator-permissions-controller/src/decodePermission/utils.test.ts @@ -1,5 +1,6 @@ import type { Caveat } from '@metamask/delegation-core'; -import { getChecksumAddress, type Hex } from '@metamask/utils'; +import { getChecksumAddress } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import type { DeployedContractsByName } from './types'; import { diff --git a/packages/gator-permissions-controller/src/decodePermission/utils.ts b/packages/gator-permissions-controller/src/decodePermission/utils.ts index 3acc83bd9d4..098aa9a0619 100644 --- a/packages/gator-permissions-controller/src/decodePermission/utils.ts +++ b/packages/gator-permissions-controller/src/decodePermission/utils.ts @@ -1,5 +1,6 @@ import type { Caveat } from '@metamask/delegation-core'; -import { getChecksumAddress, type Hex } from '@metamask/utils'; +import { getChecksumAddress } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import type { DeployedContractsByName, PermissionType } from './types'; diff --git a/packages/gator-permissions-controller/src/test/mock.test.ts b/packages/gator-permissions-controller/src/test/mock.test.ts index 1c5be6eff29..35e87cf0e84 100644 --- a/packages/gator-permissions-controller/src/test/mock.test.ts +++ b/packages/gator-permissions-controller/src/test/mock.test.ts @@ -1,7 +1,5 @@ -import { - mockGatorPermissionsStorageEntriesFactory, - type MockGatorPermissionsStorageEntriesConfig, -} from './mocks'; +import { mockGatorPermissionsStorageEntriesFactory } from './mocks'; +import type { MockGatorPermissionsStorageEntriesConfig } from './mocks'; describe('mockGatorPermissionsStorageEntriesFactory', () => { it('should create mock storage entries for all permission types', () => { diff --git a/packages/json-rpc-engine/src/asV2Middleware.ts b/packages/json-rpc-engine/src/asV2Middleware.ts index e66cd9b02ca..a4e128ef1b2 100644 --- a/packages/json-rpc-engine/src/asV2Middleware.ts +++ b/packages/json-rpc-engine/src/asV2Middleware.ts @@ -1,10 +1,11 @@ import { serializeError } from '@metamask/rpc-errors'; -import type { JsonRpcFailure, JsonRpcResponse } from '@metamask/utils'; -import { - hasProperty, - type Json, - type JsonRpcParams, - type JsonRpcRequest, +import { hasProperty } from '@metamask/utils'; +import type { + Json, + JsonRpcFailure, + JsonRpcParams, + JsonRpcRequest, + JsonRpcResponse, } from '@metamask/utils'; import type { @@ -12,7 +13,7 @@ import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback, } from './JsonRpcEngine'; -import { type JsonRpcMiddleware as LegacyMiddleware } from './JsonRpcEngine'; +import type { JsonRpcMiddleware as LegacyMiddleware } from './JsonRpcEngine'; import { mergeMiddleware } from './mergeMiddleware'; import type { ContextConstraint, MiddlewareContext } from './v2'; import { diff --git a/packages/json-rpc-engine/src/v2/JsonRpcEngineV2.test.ts b/packages/json-rpc-engine/src/v2/JsonRpcEngineV2.test.ts index 496109dcc7b..da267a04f21 100644 --- a/packages/json-rpc-engine/src/v2/JsonRpcEngineV2.test.ts +++ b/packages/json-rpc-engine/src/v2/JsonRpcEngineV2.test.ts @@ -6,14 +6,8 @@ import type { JsonRpcMiddleware, ResultConstraint } from './JsonRpcEngineV2'; import { JsonRpcEngineV2 } from './JsonRpcEngineV2'; import type { EmptyContext } from './MiddlewareContext'; import { MiddlewareContext } from './MiddlewareContext'; -import { - isRequest, - JsonRpcEngineError, - stringify, - type JsonRpcCall, - type JsonRpcNotification, - type JsonRpcRequest, -} from './utils'; +import { isRequest, JsonRpcEngineError, stringify } from './utils'; +import type { JsonRpcCall, JsonRpcNotification, JsonRpcRequest } from './utils'; import { makeNotification, makeNotificationMiddleware, diff --git a/packages/json-rpc-engine/src/v2/JsonRpcEngineV2.ts b/packages/json-rpc-engine/src/v2/JsonRpcEngineV2.ts index 43eabd5c51b..0ce10fa123e 100644 --- a/packages/json-rpc-engine/src/v2/JsonRpcEngineV2.ts +++ b/packages/json-rpc-engine/src/v2/JsonRpcEngineV2.ts @@ -1,9 +1,9 @@ -import { - type Json, - type JsonRpcRequest, - type JsonRpcNotification, - type NonEmptyArray, - hasProperty, +import { hasProperty } from '@metamask/utils'; +import type { + Json, + JsonRpcRequest, + JsonRpcNotification, + NonEmptyArray, } from '@metamask/utils'; import deepFreeze from 'deep-freeze-strict'; diff --git a/packages/json-rpc-engine/src/v2/MiddlewareContext.ts b/packages/json-rpc-engine/src/v2/MiddlewareContext.ts index 75d64203868..66314d9c3af 100644 --- a/packages/json-rpc-engine/src/v2/MiddlewareContext.ts +++ b/packages/json-rpc-engine/src/v2/MiddlewareContext.ts @@ -1,4 +1,5 @@ -import { isInstance, type UnionToIntersection } from './utils'; +import { isInstance } from './utils'; +import type { UnionToIntersection } from './utils'; const MiddlewareContextSymbol = Symbol.for('json-rpc-engine#MiddlewareContext'); diff --git a/packages/json-rpc-engine/src/v2/compatibility-utils.ts b/packages/json-rpc-engine/src/v2/compatibility-utils.ts index cdd65cb0de4..69d32e40ffa 100644 --- a/packages/json-rpc-engine/src/v2/compatibility-utils.ts +++ b/packages/json-rpc-engine/src/v2/compatibility-utils.ts @@ -5,7 +5,8 @@ import { hasProperty, isObject } from '@metamask/utils'; import { klona } from 'klona'; import { MiddlewareContext } from './MiddlewareContext'; -import { stringify, type JsonRpcRequest } from './utils'; +import { stringify } from './utils'; +import type { JsonRpcRequest } from './utils'; // Legacy engine compatibility utils diff --git a/packages/json-rpc-engine/src/v2/utils.ts b/packages/json-rpc-engine/src/v2/utils.ts index b324034d4ad..8894554d213 100644 --- a/packages/json-rpc-engine/src/v2/utils.ts +++ b/packages/json-rpc-engine/src/v2/utils.ts @@ -1,9 +1,8 @@ -import { - hasProperty, - isObject, - type JsonRpcNotification, - type JsonRpcParams, - type JsonRpcRequest, +import { hasProperty, isObject } from '@metamask/utils'; +import type { + JsonRpcNotification, + JsonRpcParams, + JsonRpcRequest, } from '@metamask/utils'; export type { diff --git a/packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts b/packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts index 38f502f819e..6dfed55897e 100644 --- a/packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts +++ b/packages/json-rpc-middleware-stream/src/createStreamMiddleware.ts @@ -4,12 +4,12 @@ import type { JsonRpcMiddleware, } from '@metamask/json-rpc-engine'; import SafeEventEmitter from '@metamask/safe-event-emitter'; -import { - hasProperty, - type JsonRpcNotification, - type JsonRpcParams, - type JsonRpcRequest, - type PendingJsonRpcResponse, +import { hasProperty } from '@metamask/utils'; +import type { + JsonRpcNotification, + JsonRpcParams, + JsonRpcRequest, + PendingJsonRpcResponse, } from '@metamask/utils'; import { Duplex } from 'readable-stream'; diff --git a/packages/keyring-controller/src/KeyringController.test.ts b/packages/keyring-controller/src/KeyringController.test.ts index cfd586554aa..220f315d899 100644 --- a/packages/keyring-controller/src/KeyringController.test.ts +++ b/packages/keyring-controller/src/KeyringController.test.ts @@ -14,15 +14,15 @@ import { import SimpleKeyring from '@metamask/eth-simple-keyring'; import type { EthKeyring } from '@metamask/keyring-internal-api'; import type { KeyringClass } from '@metamask/keyring-utils'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { wordlist } from '@metamask/scure-bip39/dist/wordlists/english'; -import { bytesToHex, isValidHexAddress, type Hex } from '@metamask/utils'; +import { bytesToHex, isValidHexAddress } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import sinon from 'sinon'; import { KeyringControllerError } from './constants'; diff --git a/packages/keyring-controller/tests/mocks/mockEncryptor.ts b/packages/keyring-controller/tests/mocks/mockEncryptor.ts index 02d167bc081..4072b5b0650 100644 --- a/packages/keyring-controller/tests/mocks/mockEncryptor.ts +++ b/packages/keyring-controller/tests/mocks/mockEncryptor.ts @@ -1,5 +1,4 @@ // Omitting jsdoc because mock is only internal and simple enough. -/* eslint-disable jsdoc/require-jsdoc */ import type { DetailedDecryptResult, diff --git a/packages/keyring-controller/tests/mocks/mockTransaction.ts b/packages/keyring-controller/tests/mocks/mockTransaction.ts index e03869bbd2f..70e5dd1d434 100644 --- a/packages/keyring-controller/tests/mocks/mockTransaction.ts +++ b/packages/keyring-controller/tests/mocks/mockTransaction.ts @@ -1,4 +1,5 @@ -import { TransactionFactory, type TypedTxData } from '@ethereumjs/tx'; +import { TransactionFactory } from '@ethereumjs/tx'; +import type { TypedTxData } from '@ethereumjs/tx'; /** * Build a mock transaction, optionally overriding diff --git a/packages/logging-controller/src/LoggingController.test.ts b/packages/logging-controller/src/LoggingController.test.ts index 0a65f2b57da..43e3db71f1d 100644 --- a/packages/logging-controller/src/LoggingController.test.ts +++ b/packages/logging-controller/src/LoggingController.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import * as uuid from 'uuid'; diff --git a/packages/message-manager/src/AbstractMessageManager.test.ts b/packages/message-manager/src/AbstractMessageManager.test.ts index 36d178bcb65..3801f27d306 100644 --- a/packages/message-manager/src/AbstractMessageManager.test.ts +++ b/packages/message-manager/src/AbstractMessageManager.test.ts @@ -1,18 +1,18 @@ -import { - deriveStateFromMetadata, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { deriveStateFromMetadata } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import { ApprovalType } from '@metamask/controller-utils'; import type { Messenger } from '@metamask/messenger'; -import { - AbstractMessageManager, - type AbstractMessage, - type AbstractMessageParams, - type MessageManagerState, - type MessageRequest, - type SecurityProviderRequest, +import { AbstractMessageManager } from './AbstractMessageManager'; +import type { + AbstractMessage, + AbstractMessageParams, + MessageManagerState, + MessageRequest, + SecurityProviderRequest, } from './AbstractMessageManager'; type ConcreteMessage = AbstractMessage & { diff --git a/packages/message-manager/src/AbstractMessageManager.ts b/packages/message-manager/src/AbstractMessageManager.ts index 0c84f45b2ad..eda638e379e 100644 --- a/packages/message-manager/src/AbstractMessageManager.ts +++ b/packages/message-manager/src/AbstractMessageManager.ts @@ -1,7 +1,7 @@ -import { - BaseController, - type ControllerStateChangeEvent, - type ControllerGetStateAction, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerStateChangeEvent, + ControllerGetStateAction, } from '@metamask/base-controller'; import type { ApprovalType } from '@metamask/controller-utils'; import type { diff --git a/packages/messenger/src/Messenger.test.ts b/packages/messenger/src/Messenger.test.ts index 5e59910340c..632616f69a6 100644 --- a/packages/messenger/src/Messenger.test.ts +++ b/packages/messenger/src/Messenger.test.ts @@ -1,11 +1,8 @@ import type { Patch } from 'immer'; import sinon from 'sinon'; -import { - type MockAnyNamespace, - Messenger, - MOCK_ANY_NAMESPACE, -} from './Messenger'; +import { Messenger, MOCK_ANY_NAMESPACE } from './Messenger'; +import type { MockAnyNamespace } from './Messenger'; describe('Messenger', () => { afterEach(() => { diff --git a/packages/multichain-account-service/src/MultichainAccountGroup.test.ts b/packages/multichain-account-service/src/MultichainAccountGroup.test.ts index 7777b72e7d3..a41e791b809 100644 --- a/packages/multichain-account-service/src/MultichainAccountGroup.test.ts +++ b/packages/multichain-account-service/src/MultichainAccountGroup.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable jsdoc/require-jsdoc */ import type { Bip44Account } from '@metamask/account-api'; import { AccountGroupType, @@ -10,7 +9,6 @@ import type { InternalAccount } from '@metamask/keyring-internal-api'; import { MultichainAccountGroup } from './MultichainAccountGroup'; import { MultichainAccountWallet } from './MultichainAccountWallet'; -import type { MockAccountProvider } from './tests'; import { MOCK_SNAP_ACCOUNT_2, MOCK_WALLET_1_BTC_P2TR_ACCOUNT, @@ -21,8 +19,8 @@ import { setupNamedAccountProvider, getMultichainAccountServiceMessenger, getRootMessenger, - type RootMessenger, } from './tests'; +import type { MockAccountProvider, RootMessenger } from './tests'; import type { MultichainAccountServiceMessenger } from './types'; function setup({ diff --git a/packages/multichain-account-service/src/MultichainAccountGroup.ts b/packages/multichain-account-service/src/MultichainAccountGroup.ts index bc3163a1f67..7440c366935 100644 --- a/packages/multichain-account-service/src/MultichainAccountGroup.ts +++ b/packages/multichain-account-service/src/MultichainAccountGroup.ts @@ -1,12 +1,12 @@ import { AccountGroupType, select, selectOne } from '@metamask/account-api'; -import { - toMultichainAccountGroupId, - type MultichainAccountGroupId, - type MultichainAccountGroup as MultichainAccountGroupDefinition, +import { toMultichainAccountGroupId } from '@metamask/account-api'; +import type { + MultichainAccountGroupId, + MultichainAccountGroup as MultichainAccountGroupDefinition, } from '@metamask/account-api'; import type { Bip44Account } from '@metamask/account-api'; import type { AccountSelector } from '@metamask/account-api'; -import { type KeyringAccount } from '@metamask/keyring-api'; +import type { KeyringAccount } from '@metamask/keyring-api'; import type { Logger } from './logger'; import { diff --git a/packages/multichain-account-service/src/MultichainAccountService.test.ts b/packages/multichain-account-service/src/MultichainAccountService.test.ts index 9894408b3ca..e8aa118be69 100644 --- a/packages/multichain-account-service/src/MultichainAccountService.test.ts +++ b/packages/multichain-account-service/src/MultichainAccountService.test.ts @@ -1,10 +1,9 @@ -/* eslint-disable jsdoc/require-jsdoc */ - import { isBip44Account } from '@metamask/account-api'; import { mnemonicPhraseToBytes } from '@metamask/key-tree'; import type { KeyringAccount } from '@metamask/keyring-api'; import { EthAccountType, SolAccountType } from '@metamask/keyring-api'; -import { KeyringTypes, type KeyringObject } from '@metamask/keyring-controller'; +import { KeyringTypes } from '@metamask/keyring-controller'; +import type { KeyringObject } from '@metamask/keyring-controller'; import type { MultichainAccountServiceOptions } from './MultichainAccountService'; import { MultichainAccountService } from './MultichainAccountService'; @@ -18,7 +17,6 @@ import { SOL_ACCOUNT_PROVIDER_NAME, SolAccountProvider, } from './providers/SolAccountProvider'; -import type { MockAccountProvider } from './tests'; import { MOCK_HARDWARE_ACCOUNT_1, MOCK_HD_ACCOUNT_1, @@ -37,8 +35,8 @@ import { makeMockAccountProvider, mockAsInternalAccount, setupNamedAccountProvider, - type RootMessenger, } from './tests'; +import type { MockAccountProvider, RootMessenger } from './tests'; import type { MultichainAccountServiceMessenger } from './types'; // Mock providers. diff --git a/packages/multichain-account-service/src/MultichainAccountService.ts b/packages/multichain-account-service/src/MultichainAccountService.ts index d779736c75a..cc8a9d7f23a 100644 --- a/packages/multichain-account-service/src/MultichainAccountService.ts +++ b/packages/multichain-account-service/src/MultichainAccountService.ts @@ -25,10 +25,8 @@ import { isAccountProviderWrapper, } from './providers/AccountProviderWrapper'; import { EvmAccountProvider } from './providers/EvmAccountProvider'; -import { - SolAccountProvider, - type SolAccountProviderConfig, -} from './providers/SolAccountProvider'; +import { SolAccountProvider } from './providers/SolAccountProvider'; +import type { SolAccountProviderConfig } from './providers/SolAccountProvider'; import type { MultichainAccountServiceConfig, MultichainAccountServiceMessenger, diff --git a/packages/multichain-account-service/src/MultichainAccountWallet.test.ts b/packages/multichain-account-service/src/MultichainAccountWallet.test.ts index 38db8426ae3..5de15bb1cb3 100644 --- a/packages/multichain-account-service/src/MultichainAccountWallet.test.ts +++ b/packages/multichain-account-service/src/MultichainAccountWallet.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable jsdoc/require-jsdoc */ import type { Bip44Account } from '@metamask/account-api'; import { AccountWalletType, @@ -7,15 +6,11 @@ import { toMultichainAccountGroupId, toMultichainAccountWalletId, } from '@metamask/account-api'; -import { - EthAccountType, - SolAccountType, - type EntropySourceId, -} from '@metamask/keyring-api'; +import { EthAccountType, SolAccountType } from '@metamask/keyring-api'; +import type { EntropySourceId } from '@metamask/keyring-api'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import { MultichainAccountWallet } from './MultichainAccountWallet'; -import type { MockAccountProvider } from './tests'; import { MOCK_HD_ACCOUNT_1, MOCK_HD_KEYRING_1, @@ -30,8 +25,8 @@ import { setupNamedAccountProvider, getMultichainAccountServiceMessenger, getRootMessenger, - type RootMessenger, } from './tests'; +import type { MockAccountProvider, RootMessenger } from './tests'; import type { MultichainAccountServiceMessenger } from './types'; function setup({ diff --git a/packages/multichain-account-service/src/MultichainAccountWallet.ts b/packages/multichain-account-service/src/MultichainAccountWallet.ts index 045138d51a9..af5a4dffb58 100644 --- a/packages/multichain-account-service/src/MultichainAccountWallet.ts +++ b/packages/multichain-account-service/src/MultichainAccountWallet.ts @@ -24,7 +24,8 @@ import { WARNING_PREFIX, } from './logger'; import { MultichainAccountGroup } from './MultichainAccountGroup'; -import { EvmAccountProvider, type Bip44AccountProvider } from './providers'; +import { EvmAccountProvider } from './providers'; +import type { Bip44AccountProvider } from './providers'; import type { MultichainAccountServiceMessenger } from './types'; import { createSentryError, toRejectedErrorMessage } from './utils'; diff --git a/packages/multichain-account-service/src/providers/BaseBip44AccountProvider.ts b/packages/multichain-account-service/src/providers/BaseBip44AccountProvider.ts index 67eddd59709..91244e54a1f 100644 --- a/packages/multichain-account-service/src/providers/BaseBip44AccountProvider.ts +++ b/packages/multichain-account-service/src/providers/BaseBip44AccountProvider.ts @@ -1,12 +1,9 @@ -import { - isBip44Account, - type AccountProvider, - type Bip44Account, -} from '@metamask/account-api'; +import { isBip44Account } from '@metamask/account-api'; +import type { AccountProvider, Bip44Account } from '@metamask/account-api'; import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api'; -import { - type KeyringMetadata, - type KeyringSelector, +import type { + KeyringMetadata, + KeyringSelector, } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; diff --git a/packages/multichain-account-service/src/providers/BtcAccountProvider.test.ts b/packages/multichain-account-service/src/providers/BtcAccountProvider.test.ts index d61b7362146..6cd384c242d 100644 --- a/packages/multichain-account-service/src/providers/BtcAccountProvider.test.ts +++ b/packages/multichain-account-service/src/providers/BtcAccountProvider.test.ts @@ -22,8 +22,8 @@ import { MOCK_HD_ACCOUNT_1, MOCK_HD_KEYRING_1, MockAccountBuilder, - type RootMessenger, } from '../tests'; +import type { RootMessenger } from '../tests'; class MockBtcKeyring { readonly type = 'MockBtcKeyring'; diff --git a/packages/multichain-account-service/src/providers/BtcAccountProvider.ts b/packages/multichain-account-service/src/providers/BtcAccountProvider.ts index 1065737e64d..b4700fa5ec2 100644 --- a/packages/multichain-account-service/src/providers/BtcAccountProvider.ts +++ b/packages/multichain-account-service/src/providers/BtcAccountProvider.ts @@ -1,14 +1,13 @@ -import { assertIsBip44Account, type Bip44Account } from '@metamask/account-api'; +import { assertIsBip44Account } from '@metamask/account-api'; +import type { Bip44Account } from '@metamask/account-api'; import type { TraceCallback } from '@metamask/controller-utils'; import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api'; import { BtcAccountType, BtcScope } from '@metamask/keyring-api'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { SnapId } from '@metamask/snaps-sdk'; -import { - SnapAccountProvider, - type SnapAccountProviderConfig, -} from './SnapAccountProvider'; +import { SnapAccountProvider } from './SnapAccountProvider'; +import type { SnapAccountProviderConfig } from './SnapAccountProvider'; import { withRetry, withTimeout } from './utils'; import { traceFallback } from '../analytics'; import { TraceName } from '../constants/traces'; diff --git a/packages/multichain-account-service/src/providers/EvmAccountProvider.test.ts b/packages/multichain-account-service/src/providers/EvmAccountProvider.test.ts index ca7922c89f4..576180d2a31 100644 --- a/packages/multichain-account-service/src/providers/EvmAccountProvider.test.ts +++ b/packages/multichain-account-service/src/providers/EvmAccountProvider.test.ts @@ -1,6 +1,5 @@ -/* eslint-disable jsdoc/require-jsdoc */ import { publicToAddress } from '@ethereumjs/util'; -import { type KeyringMetadata } from '@metamask/keyring-controller'; +import type { KeyringMetadata } from '@metamask/keyring-controller'; import type { EthKeyring, InternalAccount, @@ -25,8 +24,8 @@ import { MOCK_HD_ACCOUNT_2, MOCK_HD_KEYRING_1, MockAccountBuilder, - type RootMessenger, } from '../tests'; +import type { RootMessenger } from '../tests'; jest.mock('@ethereumjs/util', () => ({ publicToAddress: jest.fn(), diff --git a/packages/multichain-account-service/src/providers/EvmAccountProvider.ts b/packages/multichain-account-service/src/providers/EvmAccountProvider.ts index 7837ed0d387..313629174ec 100644 --- a/packages/multichain-account-service/src/providers/EvmAccountProvider.ts +++ b/packages/multichain-account-service/src/providers/EvmAccountProvider.ts @@ -10,7 +10,8 @@ import type { InternalAccount, } from '@metamask/keyring-internal-api'; import type { Provider } from '@metamask/network-controller'; -import { add0x, assert, bytesToHex, type Hex } from '@metamask/utils'; +import { add0x, assert, bytesToHex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { assertAreBip44Accounts, diff --git a/packages/multichain-account-service/src/providers/SnapAccountProvider.test.ts b/packages/multichain-account-service/src/providers/SnapAccountProvider.test.ts index c47beeaee8c..9ed396b872e 100644 --- a/packages/multichain-account-service/src/providers/SnapAccountProvider.test.ts +++ b/packages/multichain-account-service/src/providers/SnapAccountProvider.test.ts @@ -1,4 +1,5 @@ -import { isBip44Account, type Bip44Account } from '@metamask/account-api'; +import { isBip44Account } from '@metamask/account-api'; +import type { Bip44Account } from '@metamask/account-api'; import type { TraceCallback, TraceRequest } from '@metamask/controller-utils'; import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api'; import type { InternalAccount } from '@metamask/keyring-internal-api'; diff --git a/packages/multichain-account-service/src/providers/SnapAccountProvider.ts b/packages/multichain-account-service/src/providers/SnapAccountProvider.ts index 28b0ac97fd3..3e1efc548d0 100644 --- a/packages/multichain-account-service/src/providers/SnapAccountProvider.ts +++ b/packages/multichain-account-service/src/providers/SnapAccountProvider.ts @@ -1,4 +1,4 @@ -import { type Bip44Account } from '@metamask/account-api'; +import type { Bip44Account } from '@metamask/account-api'; import type { TraceCallback, TraceRequest } from '@metamask/controller-utils'; import type { SnapKeyring } from '@metamask/eth-snap-keyring'; import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api'; diff --git a/packages/multichain-account-service/src/providers/SolAccountProvider.test.ts b/packages/multichain-account-service/src/providers/SolAccountProvider.test.ts index 68645fa31d9..5afd072d5e7 100644 --- a/packages/multichain-account-service/src/providers/SolAccountProvider.test.ts +++ b/packages/multichain-account-service/src/providers/SolAccountProvider.test.ts @@ -20,8 +20,8 @@ import { MOCK_SOL_ACCOUNT_1, MOCK_SOL_DISCOVERED_ACCOUNT_1, MockAccountBuilder, - type RootMessenger, } from '../tests'; +import type { RootMessenger } from '../tests'; class MockSolanaKeyring { readonly type = 'MockSolanaKeyring'; diff --git a/packages/multichain-account-service/src/providers/SolAccountProvider.ts b/packages/multichain-account-service/src/providers/SolAccountProvider.ts index 98cf2db6d5a..a6ef998bdb4 100644 --- a/packages/multichain-account-service/src/providers/SolAccountProvider.ts +++ b/packages/multichain-account-service/src/providers/SolAccountProvider.ts @@ -1,4 +1,5 @@ -import { assertIsBip44Account, type Bip44Account } from '@metamask/account-api'; +import { assertIsBip44Account } from '@metamask/account-api'; +import type { Bip44Account } from '@metamask/account-api'; import type { TraceCallback } from '@metamask/controller-utils'; import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api'; import { SolScope } from '@metamask/keyring-api'; @@ -10,10 +11,8 @@ import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { SnapId } from '@metamask/snaps-sdk'; -import { - SnapAccountProvider, - type SnapAccountProviderConfig, -} from './SnapAccountProvider'; +import { SnapAccountProvider } from './SnapAccountProvider'; +import type { SnapAccountProviderConfig } from './SnapAccountProvider'; import { withRetry, withTimeout } from './utils'; import { traceFallback } from '../analytics'; import { TraceName } from '../constants/traces'; diff --git a/packages/multichain-account-service/src/providers/TrxAccountProvider.test.ts b/packages/multichain-account-service/src/providers/TrxAccountProvider.test.ts index d060fd4328e..26f4fd104ec 100644 --- a/packages/multichain-account-service/src/providers/TrxAccountProvider.test.ts +++ b/packages/multichain-account-service/src/providers/TrxAccountProvider.test.ts @@ -20,8 +20,8 @@ import { MOCK_TRX_ACCOUNT_1, MOCK_TRX_DISCOVERED_ACCOUNT_1, MockAccountBuilder, - type RootMessenger, } from '../tests'; +import type { RootMessenger } from '../tests'; class MockTronKeyring { readonly type = 'MockTronKeyring'; diff --git a/packages/multichain-account-service/src/providers/TrxAccountProvider.ts b/packages/multichain-account-service/src/providers/TrxAccountProvider.ts index f436e47ce84..256f24720b9 100644 --- a/packages/multichain-account-service/src/providers/TrxAccountProvider.ts +++ b/packages/multichain-account-service/src/providers/TrxAccountProvider.ts @@ -1,4 +1,5 @@ -import { assertIsBip44Account, type Bip44Account } from '@metamask/account-api'; +import { assertIsBip44Account } from '@metamask/account-api'; +import type { Bip44Account } from '@metamask/account-api'; import type { TraceCallback } from '@metamask/controller-utils'; import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api'; import { TrxAccountType, TrxScope } from '@metamask/keyring-api'; @@ -6,10 +7,8 @@ import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { SnapId } from '@metamask/snaps-sdk'; -import { - SnapAccountProvider, - type SnapAccountProviderConfig, -} from './SnapAccountProvider'; +import { SnapAccountProvider } from './SnapAccountProvider'; +import type { SnapAccountProviderConfig } from './SnapAccountProvider'; import { withRetry, withTimeout } from './utils'; import { traceFallback } from '../analytics'; import { TraceName } from '../constants/traces'; diff --git a/packages/multichain-account-service/src/tests/accounts.ts b/packages/multichain-account-service/src/tests/accounts.ts index 3518196f8f1..c7d6238b263 100644 --- a/packages/multichain-account-service/src/tests/accounts.ts +++ b/packages/multichain-account-service/src/tests/accounts.ts @@ -1,4 +1,3 @@ -/* eslint-disable jsdoc/require-jsdoc */ import type { Bip44Account } from '@metamask/account-api'; import { isBip44Account } from '@metamask/account-api'; import type { diff --git a/packages/multichain-account-service/src/tests/messenger.ts b/packages/multichain-account-service/src/tests/messenger.ts index a6150212283..0999919de6a 100644 --- a/packages/multichain-account-service/src/tests/messenger.ts +++ b/packages/multichain-account-service/src/tests/messenger.ts @@ -1,9 +1,8 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { MultichainAccountServiceMessenger } from '../types'; diff --git a/packages/multichain-account-service/src/tests/providers.ts b/packages/multichain-account-service/src/tests/providers.ts index 6c204ad8759..05e1840645c 100644 --- a/packages/multichain-account-service/src/tests/providers.ts +++ b/packages/multichain-account-service/src/tests/providers.ts @@ -1,5 +1,3 @@ -/* eslint-disable jsdoc/require-jsdoc */ - import type { Bip44Account } from '@metamask/account-api'; import { isBip44Account } from '@metamask/account-api'; import type { KeyringAccount } from '@metamask/keyring-api'; diff --git a/packages/multichain-api-middleware/src/handlers/wallet-createSession.test.ts b/packages/multichain-api-middleware/src/handlers/wallet-createSession.test.ts index fa1c705843a..c187fe96681 100644 --- a/packages/multichain-api-middleware/src/handlers/wallet-createSession.test.ts +++ b/packages/multichain-api-middleware/src/handlers/wallet-createSession.test.ts @@ -1,8 +1,10 @@ +import type { + Caip25Authorization, + NormalizedScopesObject, +} from '@metamask/chain-agnostic-permission'; import { Caip25CaveatType, Caip25EndowmentPermissionName, - type Caip25Authorization, - type NormalizedScopesObject, KnownSessionProperties, } from '@metamask/chain-agnostic-permission'; import * as ChainAgnosticPermission from '@metamask/chain-agnostic-permission'; diff --git a/packages/multichain-api-middleware/src/handlers/wallet-createSession.ts b/packages/multichain-api-middleware/src/handlers/wallet-createSession.ts index bad56056336..cf71fd81390 100644 --- a/packages/multichain-api-middleware/src/handlers/wallet-createSession.ts +++ b/packages/multichain-api-middleware/src/handlers/wallet-createSession.ts @@ -3,40 +3,42 @@ import { Caip25EndowmentPermissionName, bucketScopes, validateAndNormalizeScopes, - type Caip25Authorization, getInternalScopesObject, getSessionScopes, - type NormalizedScopesObject, getSupportedScopeObjects, - type Caip25CaveatValue, isKnownSessionPropertyValue, getCaipAccountIdsFromScopesObjects, getAllScopesFromScopesObjects, setNonSCACaipAccountIdsInCaip25CaveatValue, isNamespaceInScopesObject, } from '@metamask/chain-agnostic-permission'; +import type { + Caip25Authorization, + NormalizedScopesObject, + Caip25CaveatValue, +} from '@metamask/chain-agnostic-permission'; import { isEqualCaseInsensitive } from '@metamask/controller-utils'; import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback, } from '@metamask/json-rpc-engine'; import type { NetworkController } from '@metamask/network-controller'; -import { - invalidParams, - type RequestedPermissions, -} from '@metamask/permission-controller'; +import { invalidParams } from '@metamask/permission-controller'; +import type { RequestedPermissions } from '@metamask/permission-controller'; import { JsonRpcError, rpcErrors } from '@metamask/rpc-errors'; import { - type CaipAccountId, - type CaipChainId, - type Hex, isPlainObject, - type Json, - type JsonRpcRequest, - type JsonRpcSuccess, KnownCaipNamespace, parseCaipAccountId, } from '@metamask/utils'; +import type { + CaipAccountId, + CaipChainId, + Hex, + Json, + JsonRpcRequest, + JsonRpcSuccess, +} from '@metamask/utils'; import type { GrantedPermissions } from './types'; diff --git a/packages/multichain-api-middleware/src/handlers/wallet-revokeSession.ts b/packages/multichain-api-middleware/src/handlers/wallet-revokeSession.ts index 8911a95e3bd..d18cf807919 100644 --- a/packages/multichain-api-middleware/src/handlers/wallet-revokeSession.ts +++ b/packages/multichain-api-middleware/src/handlers/wallet-revokeSession.ts @@ -14,11 +14,8 @@ import { UnrecognizedSubjectError, } from '@metamask/permission-controller'; import { rpcErrors } from '@metamask/rpc-errors'; -import { - type JsonRpcSuccess, - type JsonRpcRequest, - isObject, -} from '@metamask/utils'; +import { isObject } from '@metamask/utils'; +import type { JsonRpcSuccess, JsonRpcRequest } from '@metamask/utils'; import type { WalletRevokeSessionHooks } from './types'; diff --git a/packages/multichain-network-controller/src/MultichainNetworkController/MultichainNetworkController.test.ts b/packages/multichain-network-controller/src/MultichainNetworkController/MultichainNetworkController.test.ts index eb96dcd6f66..73a0dc72c25 100644 --- a/packages/multichain-network-controller/src/MultichainNetworkController/MultichainNetworkController.test.ts +++ b/packages/multichain-network-controller/src/MultichainNetworkController/MultichainNetworkController.test.ts @@ -1,23 +1,24 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { InfuraNetworkType } from '@metamask/controller-utils'; -import type { AnyAccountType } from '@metamask/keyring-api'; import { BtcScope, SolScope, EthAccountType, BtcAccountType, SolAccountType, - type KeyringAccountType, - type CaipChainId, EthScope, TrxAccountType, } from '@metamask/keyring-api'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import type { + AnyAccountType, + KeyringAccountType, + CaipChainId, +} from '@metamask/keyring-api'; +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { NetworkControllerGetStateAction, @@ -26,11 +27,12 @@ import type { NetworkControllerRemoveNetworkAction, NetworkControllerFindNetworkClientIdByChainIdAction, } from '@metamask/network-controller'; -import { KnownCaipNamespace, type CaipAccountId } from '@metamask/utils'; +import { KnownCaipNamespace } from '@metamask/utils'; +import type { CaipAccountId } from '@metamask/utils'; import { MultichainNetworkController } from './MultichainNetworkController'; import { createMockInternalAccount } from '../../tests/utils'; -import { type ActiveNetworksResponse } from '../api/accounts-api'; +import type { ActiveNetworksResponse } from '../api/accounts-api'; import { getDefaultMultichainNetworkControllerState } from '../constants'; import type { AbstractMultichainNetworkService } from '../MultichainNetworkService/AbstractMultichainNetworkService'; import type { MultichainNetworkControllerMessenger } from '../types'; diff --git a/packages/multichain-network-controller/src/MultichainNetworkController/MultichainNetworkController.ts b/packages/multichain-network-controller/src/MultichainNetworkController/MultichainNetworkController.ts index e3c065ecda2..a9429ae3a81 100644 --- a/packages/multichain-network-controller/src/MultichainNetworkController/MultichainNetworkController.ts +++ b/packages/multichain-network-controller/src/MultichainNetworkController/MultichainNetworkController.ts @@ -2,24 +2,25 @@ import { BaseController } from '@metamask/base-controller'; import { isEvmAccountType } from '@metamask/keyring-api'; import type { InternalAccount } from '@metamask/keyring-internal-api'; import type { NetworkClientId } from '@metamask/network-controller'; -import { type CaipChainId, isCaipChainId } from '@metamask/utils'; +import { isCaipChainId } from '@metamask/utils'; +import type { CaipChainId } from '@metamask/utils'; import { - type ActiveNetworksByAddress, toAllowedCaipAccountIds, toActiveNetworksByAddress, } from '../api/accounts-api'; +import type { ActiveNetworksByAddress } from '../api/accounts-api'; import { AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS, MULTICHAIN_NETWORK_CONTROLLER_METADATA, getDefaultMultichainNetworkControllerState, } from '../constants'; import type { AbstractMultichainNetworkService } from '../MultichainNetworkService/AbstractMultichainNetworkService'; -import { - MULTICHAIN_NETWORK_CONTROLLER_NAME, - type MultichainNetworkControllerState, - type MultichainNetworkControllerMessenger, - type SupportedCaipChainId, +import { MULTICHAIN_NETWORK_CONTROLLER_NAME } from '../types'; +import type { + MultichainNetworkControllerState, + MultichainNetworkControllerMessenger, + SupportedCaipChainId, } from '../types'; import { checkIfSupportedCaipChainId, diff --git a/packages/multichain-network-controller/src/MultichainNetworkService/MultichainNetworkService.test.ts b/packages/multichain-network-controller/src/MultichainNetworkService/MultichainNetworkService.test.ts index 9167a58768f..54d70a3cf02 100644 --- a/packages/multichain-network-controller/src/MultichainNetworkService/MultichainNetworkService.test.ts +++ b/packages/multichain-network-controller/src/MultichainNetworkService/MultichainNetworkService.test.ts @@ -1,13 +1,14 @@ -import { KnownCaipNamespace, type CaipAccountId } from '@metamask/utils'; +import { KnownCaipNamespace } from '@metamask/utils'; +import type { CaipAccountId } from '@metamask/utils'; import { chunk } from 'lodash'; import { MultichainNetworkService } from './MultichainNetworkService'; import { - type ActiveNetworksResponse, MULTICHAIN_ACCOUNTS_CLIENT_HEADER, MULTICHAIN_ACCOUNTS_CLIENT_ID, MULTICHAIN_ACCOUNTS_BASE_URL, } from '../api/accounts-api'; +import type { ActiveNetworksResponse } from '../api/accounts-api'; describe('MultichainNetworkService', () => { beforeEach(() => { diff --git a/packages/multichain-network-controller/src/MultichainNetworkService/MultichainNetworkService.ts b/packages/multichain-network-controller/src/MultichainNetworkService/MultichainNetworkService.ts index 806a583187c..0feccc9c404 100644 --- a/packages/multichain-network-controller/src/MultichainNetworkService/MultichainNetworkService.ts +++ b/packages/multichain-network-controller/src/MultichainNetworkService/MultichainNetworkService.ts @@ -3,12 +3,12 @@ import type { CaipAccountId } from '@metamask/utils'; import { chunk } from 'lodash'; import { - type ActiveNetworksResponse, ActiveNetworksResponseStruct, buildActiveNetworksUrl, MULTICHAIN_ACCOUNTS_CLIENT_HEADER, MULTICHAIN_ACCOUNTS_CLIENT_ID, } from '../api/accounts-api'; +import type { ActiveNetworksResponse } from '../api/accounts-api'; /** * Service responsible for fetching network activity data from the API. diff --git a/packages/multichain-network-controller/src/api/accounts-api.test.ts b/packages/multichain-network-controller/src/api/accounts-api.test.ts index a14111b3d10..7dd66745a40 100644 --- a/packages/multichain-network-controller/src/api/accounts-api.test.ts +++ b/packages/multichain-network-controller/src/api/accounts-api.test.ts @@ -9,20 +9,20 @@ import { TrxAccountType, } from '@metamask/keyring-api'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - type CaipAccountId, - type CaipChainId, - type CaipReference, - KnownCaipNamespace, +import { KnownCaipNamespace } from '@metamask/utils'; +import type { + CaipAccountId, + CaipChainId, + CaipReference, } from '@metamask/utils'; import { - type ActiveNetworksResponse, toAllowedCaipAccountIds, toActiveNetworksByAddress, buildActiveNetworksUrl, MULTICHAIN_ACCOUNTS_BASE_URL, } from './accounts-api'; +import type { ActiveNetworksResponse } from './accounts-api'; const MOCK_ADDRESSES = { evm: '0x1234567890123456789012345678901234567890', diff --git a/packages/multichain-network-controller/src/api/accounts-api.ts b/packages/multichain-network-controller/src/api/accounts-api.ts index cb3c0b41ca0..c5f869ef999 100644 --- a/packages/multichain-network-controller/src/api/accounts-api.ts +++ b/packages/multichain-network-controller/src/api/accounts-api.ts @@ -1,6 +1,7 @@ import { BtcScope, SolScope, EthScope, TrxScope } from '@metamask/keyring-api'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { type Infer, array, object } from '@metamask/superstruct'; +import { array, object } from '@metamask/superstruct'; +import type { Infer } from '@metamask/superstruct'; import { CaipAccountIdStruct, parseCaipAccountId } from '@metamask/utils'; import type { CaipAccountAddress, diff --git a/packages/multichain-network-controller/src/constants.ts b/packages/multichain-network-controller/src/constants.ts index a2790ce1c98..262e79aa6d9 100644 --- a/packages/multichain-network-controller/src/constants.ts +++ b/packages/multichain-network-controller/src/constants.ts @@ -1,10 +1,6 @@ -import { type StateMetadata } from '@metamask/base-controller'; -import { - type CaipChainId, - BtcScope, - SolScope, - TrxScope, -} from '@metamask/keyring-api'; +import type { StateMetadata } from '@metamask/base-controller'; +import { BtcScope, SolScope, TrxScope } from '@metamask/keyring-api'; +import type { CaipChainId } from '@metamask/keyring-api'; import { NetworkStatus } from '@metamask/network-controller'; import type { diff --git a/packages/multichain-network-controller/src/types.ts b/packages/multichain-network-controller/src/types.ts index 75f600b4058..11759f883d1 100644 --- a/packages/multichain-network-controller/src/types.ts +++ b/packages/multichain-network-controller/src/types.ts @@ -1,7 +1,7 @@ import type { AccountsControllerListMultichainAccountsAction } from '@metamask/accounts-controller'; -import { - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { BtcScope, diff --git a/packages/multichain-network-controller/src/utils.test.ts b/packages/multichain-network-controller/src/utils.test.ts index 67330747fc9..c865fcf6105 100644 --- a/packages/multichain-network-controller/src/utils.test.ts +++ b/packages/multichain-network-controller/src/utils.test.ts @@ -1,10 +1,6 @@ -import { - type CaipChainId, - BtcScope, - SolScope, - EthScope, -} from '@metamask/keyring-api'; -import { type NetworkConfiguration } from '@metamask/network-controller'; +import { BtcScope, SolScope, EthScope } from '@metamask/keyring-api'; +import type { CaipChainId } from '@metamask/keyring-api'; +import type { NetworkConfiguration } from '@metamask/network-controller'; import { KnownCaipNamespace } from '@metamask/utils'; import { diff --git a/packages/multichain-network-controller/src/utils.ts b/packages/multichain-network-controller/src/utils.ts index 5364fe9b8f2..5b75506ffbd 100644 --- a/packages/multichain-network-controller/src/utils.ts +++ b/packages/multichain-network-controller/src/utils.ts @@ -1,13 +1,12 @@ import type { NetworkConfiguration } from '@metamask/network-controller'; import { - type Hex, - type CaipChainId, KnownCaipNamespace, toCaipChainId, parseCaipChainId, hexToNumber, add0x, } from '@metamask/utils'; +import type { Hex, CaipChainId } from '@metamask/utils'; import { AVAILABLE_MULTICHAIN_NETWORK_CONFIGURATIONS } from './constants'; import type { diff --git a/packages/multichain-network-controller/tests/utils.ts b/packages/multichain-network-controller/tests/utils.ts index aa0ec3adccd..d87ed46f1e9 100644 --- a/packages/multichain-network-controller/tests/utils.ts +++ b/packages/multichain-network-controller/tests/utils.ts @@ -8,8 +8,8 @@ import { BtcMethod, EthMethod, SolMethod, - type KeyringAccountType, } from '@metamask/keyring-api'; +import type { KeyringAccountType } from '@metamask/keyring-api'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; diff --git a/packages/multichain-transactions-controller/src/MultichainTransactionsController.test.ts b/packages/multichain-transactions-controller/src/MultichainTransactionsController.test.ts index d2dbbb470e4..2fc19e46a87 100644 --- a/packages/multichain-transactions-controller/src/MultichainTransactionsController.test.ts +++ b/packages/multichain-transactions-controller/src/MultichainTransactionsController.test.ts @@ -15,12 +15,11 @@ import { } from '@metamask/keyring-api'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { CaipChainId } from '@metamask/utils'; import { v4 as uuidv4 } from 'uuid'; @@ -29,8 +28,10 @@ import { MultichainNetwork } from './constants'; import { MultichainTransactionsController, getDefaultMultichainTransactionsControllerState, - type MultichainTransactionsControllerState, - type MultichainTransactionsControllerMessenger, +} from './MultichainTransactionsController'; +import type { + MultichainTransactionsControllerState, + MultichainTransactionsControllerMessenger, } from './MultichainTransactionsController'; const mockBtcAccount = { diff --git a/packages/multichain-transactions-controller/src/MultichainTransactionsController.ts b/packages/multichain-transactions-controller/src/MultichainTransactionsController.ts index cc6834063ae..7846d5c52a8 100644 --- a/packages/multichain-transactions-controller/src/MultichainTransactionsController.ts +++ b/packages/multichain-transactions-controller/src/MultichainTransactionsController.ts @@ -4,16 +4,15 @@ import type { AccountsControllerListMultichainAccountsAction, AccountsControllerAccountTransactionsUpdatedEvent, } from '@metamask/accounts-controller'; -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; -import { - isEvmAccountType, - type Transaction, - type AccountTransactionsUpdatedEventPayload, - TransactionStatus, +import { isEvmAccountType, TransactionStatus } from '@metamask/keyring-api'; +import type { + Transaction, + AccountTransactionsUpdatedEventPayload, } from '@metamask/keyring-api'; import type { KeyringControllerGetStateAction } from '@metamask/keyring-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; @@ -22,11 +21,7 @@ import type { Messenger } from '@metamask/messenger'; import type { HandleSnapRequest } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; import { HandlerType } from '@metamask/snaps-utils'; -import { - type CaipChainId, - type Json, - type JsonRpcRequest, -} from '@metamask/utils'; +import type { CaipChainId, Json, JsonRpcRequest } from '@metamask/utils'; import type { Draft } from 'immer'; const controllerName = 'MultichainTransactionsController'; diff --git a/packages/network-controller/src/NetworkController.ts b/packages/network-controller/src/NetworkController.ts index 9b2ab8d9e95..13acb49a41d 100644 --- a/packages/network-controller/src/NetworkController.ts +++ b/packages/network-controller/src/NetworkController.ts @@ -1063,7 +1063,6 @@ type NoopNetworkClientOperation = { rpcEndpoint: RpcEndpoint; }; -/* eslint-disable jsdoc/check-indentation */ /** * Instructs `addNetwork`, `updateNetwork`, and `removeNetwork` how to * update the network client registry. @@ -1081,7 +1080,6 @@ type NoopNetworkClientOperation = { * - a network client that should be unchanged for an RPC endpoint that was * also unchanged. */ -/* eslint-enable jsdoc/check-indentation */ type NetworkClientOperation = | AddNetworkClientOperation | RemoveNetworkClientOperation diff --git a/packages/network-controller/src/rpc-service/rpc-service.ts b/packages/network-controller/src/rpc-service/rpc-service.ts index b170989fc2e..b1e85158950 100644 --- a/packages/network-controller/src/rpc-service/rpc-service.ts +++ b/packages/network-controller/src/rpc-service/rpc-service.ts @@ -9,14 +9,12 @@ import { handleWhen, } from '@metamask/controller-utils'; import { JsonRpcError, rpcErrors } from '@metamask/rpc-errors'; -import type { JsonRpcRequest } from '@metamask/utils'; -import { - Duration, - getErrorMessage, - hasProperty, - type Json, - type JsonRpcParams, - type JsonRpcResponse, +import { Duration, getErrorMessage, hasProperty } from '@metamask/utils'; +import type { + Json, + JsonRpcParams, + JsonRpcRequest, + JsonRpcResponse, } from '@metamask/utils'; import deepmerge from 'deepmerge'; import type { Logger } from 'loglevel'; diff --git a/packages/network-controller/tests/helpers.ts b/packages/network-controller/tests/helpers.ts index cb54c44bf37..6dfe4d92b5d 100644 --- a/packages/network-controller/tests/helpers.ts +++ b/packages/network-controller/tests/helpers.ts @@ -7,12 +7,11 @@ import { } from '@metamask/controller-utils'; import type { ErrorReportingServiceCaptureExceptionAction } from '@metamask/error-reporting-service'; import type { InternalProvider } from '@metamask/eth-json-rpc-provider'; -import { - Messenger, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, - MOCK_ANY_NAMESPACE, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import type { Hex } from '@metamask/utils'; import { v4 as uuidV4 } from 'uuid'; @@ -21,14 +20,14 @@ import { FakeBlockTracker } from '../../../tests/fake-block-tracker'; import { FakeProvider } from '../../../tests/fake-provider'; import type { FakeProviderStub } from '../../../tests/fake-provider'; import { buildTestObject } from '../../../tests/helpers'; -import { - NetworkController, - type BuiltInNetworkClientId, - type CustomNetworkClientId, - type NetworkClient, - type NetworkClientConfiguration, - type NetworkClientId, - type NetworkConfiguration, +import { NetworkController } from '../src'; +import type { + BuiltInNetworkClientId, + CustomNetworkClientId, + NetworkClient, + NetworkClientConfiguration, + NetworkClientId, + NetworkConfiguration, } from '../src'; import type { AutoManagedNetworkClient } from '../src/create-auto-managed-network-client'; import type { @@ -218,7 +217,7 @@ export function buildMockGetNetworkClientById( function getNetworkClientById( networkClientId: CustomNetworkClientId, ): AutoManagedNetworkClient; - // eslint-disable-next-line jsdoc/require-jsdoc + function getNetworkClientById(networkClientId: string): NetworkClient { const mockNetworkClientConfiguration = mergedMockNetworkClientConfigurationsByNetworkClientId[networkClientId]; @@ -271,7 +270,7 @@ export function buildMockFindNetworkClientIdByChainId( }; function findNetworkClientIdByChainId(chainId: Hex): NetworkClientId; - // eslint-disable-next-line jsdoc/require-jsdoc + function findNetworkClientIdByChainId(chainId: Hex): NetworkClientId { const networkClientConfigForChainId = mergedMockNetworkClientConfigurationsByNetworkClientId[chainId]; diff --git a/packages/network-enablement-controller/src/NetworkEnablementController.test.ts b/packages/network-enablement-controller/src/NetworkEnablementController.test.ts index 477eab8131a..53e1adad218 100644 --- a/packages/network-enablement-controller/src/NetworkEnablementController.test.ts +++ b/packages/network-enablement-controller/src/NetworkEnablementController.test.ts @@ -1,24 +1,17 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { BuiltInNetworkName, ChainId } from '@metamask/controller-utils'; import { BtcScope, SolScope, TrxScope } from '@metamask/keyring-api'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { RpcEndpointType } from '@metamask/network-controller'; -import { - TransactionStatus, - type TransactionMeta, -} from '@metamask/transaction-controller'; -import { - type CaipChainId, - type CaipNamespace, - type Hex, - KnownCaipNamespace, -} from '@metamask/utils'; +import { TransactionStatus } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; +import { KnownCaipNamespace } from '@metamask/utils'; +import type { CaipChainId, CaipNamespace, Hex } from '@metamask/utils'; import { useFakeTimers } from 'sinon'; import { POPULAR_NETWORKS } from './constants'; diff --git a/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.test.ts b/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.test.ts index 6190ebbbc3a..da073519f1b 100644 --- a/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.test.ts +++ b/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.test.ts @@ -1,16 +1,15 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import * as ControllerUtils from '@metamask/controller-utils'; -import { - KeyringTypes, - type KeyringControllerGetStateAction, - type KeyringControllerState, +import { KeyringTypes } from '@metamask/keyring-controller'; +import type { + KeyringControllerGetStateAction, + KeyringControllerState, } from '@metamask/keyring-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { AuthenticationController } from '@metamask/profile-sync-controller'; import log from 'loglevel'; diff --git a/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.ts b/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.ts index 7247aaa9851..d63cb04c6a9 100644 --- a/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.ts +++ b/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.ts @@ -8,13 +8,13 @@ import { isValidHexAddress, toChecksumHexAddress, } from '@metamask/controller-utils'; -import { - type KeyringControllerStateChangeEvent, - type KeyringControllerGetStateAction, - type KeyringControllerLockEvent, - type KeyringControllerUnlockEvent, - KeyringTypes, - type KeyringControllerState, +import { KeyringTypes } from '@metamask/keyring-controller'; +import type { + KeyringControllerStateChangeEvent, + KeyringControllerGetStateAction, + KeyringControllerLockEvent, + KeyringControllerUnlockEvent, + KeyringControllerState, } from '@metamask/keyring-controller'; import type { Messenger } from '@metamask/messenger'; import type { AuthenticationController } from '@metamask/profile-sync-controller'; diff --git a/packages/notification-services-controller/src/NotificationServicesController/mocks/mock-snap-notification.ts b/packages/notification-services-controller/src/NotificationServicesController/mocks/mock-snap-notification.ts index 3dc58210010..d6d694179f2 100644 --- a/packages/notification-services-controller/src/NotificationServicesController/mocks/mock-snap-notification.ts +++ b/packages/notification-services-controller/src/NotificationServicesController/mocks/mock-snap-notification.ts @@ -1,5 +1,5 @@ import { TRIGGER_TYPES } from '../constants'; -import { type RawSnapNotification } from '../types/snaps'; +import type { RawSnapNotification } from '../types/snaps'; /** * Mocking Utility - create a mock raw snap notification diff --git a/packages/notification-services-controller/src/NotificationServicesController/processors/process-snap-notifications.ts b/packages/notification-services-controller/src/NotificationServicesController/processors/process-snap-notifications.ts index c27aecf0f54..17227edaa67 100644 --- a/packages/notification-services-controller/src/NotificationServicesController/processors/process-snap-notifications.ts +++ b/packages/notification-services-controller/src/NotificationServicesController/processors/process-snap-notifications.ts @@ -1,6 +1,6 @@ import { v4 as uuid } from 'uuid'; -import { type INotification } from '../types'; +import type { INotification } from '../types'; import type { RawSnapNotification } from '../types/snaps'; /** diff --git a/packages/notification-services-controller/src/NotificationServicesController/ui/constants.ts b/packages/notification-services-controller/src/NotificationServicesController/ui/constants.ts index 67d4a19d59e..f49448bd36b 100644 --- a/packages/notification-services-controller/src/NotificationServicesController/ui/constants.ts +++ b/packages/notification-services-controller/src/NotificationServicesController/ui/constants.ts @@ -1,7 +1,5 @@ -import { - NOTIFICATION_CHAINS_ID, - type NOTIFICATION_CHAINS_IDS, -} from '../constants/notification-schema'; +import { NOTIFICATION_CHAINS_ID } from '../constants/notification-schema'; +import type { NOTIFICATION_CHAINS_IDS } from '../constants/notification-schema'; export const NOTIFICATION_NETWORK_CURRENCY_NAME = { [NOTIFICATION_CHAINS_ID.ETHEREUM]: 'Ethereum', diff --git a/packages/notification-services-controller/src/NotificationServicesPushController/__fixtures__/mockMessenger.ts b/packages/notification-services-controller/src/NotificationServicesPushController/__fixtures__/mockMessenger.ts index 6b3185207f2..283eff5eee6 100644 --- a/packages/notification-services-controller/src/NotificationServicesPushController/__fixtures__/mockMessenger.ts +++ b/packages/notification-services-controller/src/NotificationServicesPushController/__fixtures__/mockMessenger.ts @@ -1,9 +1,8 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { NotificationServicesPushControllerMessenger } from '..'; diff --git a/packages/permission-controller/src/PermissionController.test.ts b/packages/permission-controller/src/PermissionController.test.ts index 845f0b8e00c..a3a4bc1b7e9 100644 --- a/packages/permission-controller/src/PermissionController.test.ts +++ b/packages/permission-controller/src/PermissionController.test.ts @@ -1,12 +1,11 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { isPlainObject } from '@metamask/controller-utils'; import { JsonRpcEngine } from '@metamask/json-rpc-engine'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { Json, JsonRpcRequest } from '@metamask/utils'; import { diff --git a/packages/permission-controller/src/PermissionController.ts b/packages/permission-controller/src/PermissionController.ts index 971aec9f6f8..0ff3f902eaf 100644 --- a/packages/permission-controller/src/PermissionController.ts +++ b/packages/permission-controller/src/PermissionController.ts @@ -25,7 +25,8 @@ import { JsonRpcError } from '@metamask/rpc-errors'; import { hasProperty } from '@metamask/utils'; import type { Json, Mutable } from '@metamask/utils'; import deepFreeze from 'deep-freeze-strict'; -import { castDraft, produce as immerProduce, type Draft } from 'immer'; +import { castDraft, produce as immerProduce } from 'immer'; +import type { Draft } from 'immer'; import { nanoid } from 'nanoid'; import type { diff --git a/packages/permission-controller/src/SubjectMetadataController.test.ts b/packages/permission-controller/src/SubjectMetadataController.test.ts index dc286f0df29..7cf2b53da9d 100644 --- a/packages/permission-controller/src/SubjectMetadataController.test.ts +++ b/packages/permission-controller/src/SubjectMetadataController.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { Json } from '@metamask/utils'; diff --git a/packages/permission-controller/src/rpc-methods/revokePermissions.ts b/packages/permission-controller/src/rpc-methods/revokePermissions.ts index 9823b072c63..34b9b6352ef 100644 --- a/packages/permission-controller/src/rpc-methods/revokePermissions.ts +++ b/packages/permission-controller/src/rpc-methods/revokePermissions.ts @@ -1,10 +1,10 @@ import type { JsonRpcEngineEndCallback } from '@metamask/json-rpc-engine'; -import { - isNonEmptyArray, - type Json, - type JsonRpcRequest, - type NonEmptyArray, - type PendingJsonRpcResponse, +import { isNonEmptyArray } from '@metamask/utils'; +import type { + Json, + JsonRpcRequest, + NonEmptyArray, + PendingJsonRpcResponse, } from '@metamask/utils'; import { invalidParams } from '../errors'; diff --git a/packages/permission-log-controller/src/PermissionLogController.ts b/packages/permission-log-controller/src/PermissionLogController.ts index 846a7073fbe..255a49d817b 100644 --- a/packages/permission-log-controller/src/PermissionLogController.ts +++ b/packages/permission-log-controller/src/PermissionLogController.ts @@ -1,16 +1,16 @@ -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine'; import type { Messenger } from '@metamask/messenger'; -import { - type Json, - type JsonRpcRequest, - type JsonRpcParams, - type PendingJsonRpcResponse, - hasProperty, +import { hasProperty } from '@metamask/utils'; +import type { + Json, + JsonRpcRequest, + JsonRpcParams, + PendingJsonRpcResponse, } from '@metamask/utils'; import { diff --git a/packages/permission-log-controller/tests/PermissionLogController.test.ts b/packages/permission-log-controller/tests/PermissionLogController.test.ts index 57869e6af5c..ce271262618 100644 --- a/packages/permission-log-controller/tests/PermissionLogController.test.ts +++ b/packages/permission-log-controller/tests/PermissionLogController.test.ts @@ -3,27 +3,23 @@ import type { JsonRpcEngineReturnHandler, JsonRpcEngineNextCallback, } from '@metamask/json-rpc-engine'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; -import { - type PendingJsonRpcResponse, - type JsonRpcRequest, - PendingJsonRpcResponseStruct, -} from '@metamask/utils'; +import { PendingJsonRpcResponseStruct } from '@metamask/utils'; +import type { PendingJsonRpcResponse, JsonRpcRequest } from '@metamask/utils'; import { nanoid } from 'nanoid'; import { constants, getters, noop } from './helpers'; import { LOG_LIMIT, LOG_METHOD_TYPES } from '../src/enums'; -import { - PermissionLogController, - type Permission, - type PermissionLogControllerState, - type PermissionLogControllerMessenger, +import { PermissionLogController } from '../src/PermissionLogController'; +import type { + Permission, + PermissionLogControllerState, + PermissionLogControllerMessenger, } from '../src/PermissionLogController'; const { PERMS, RPC_REQUESTS } = getters; diff --git a/packages/permission-log-controller/tests/helpers.ts b/packages/permission-log-controller/tests/helpers.ts index eab0c88831e..1f01bfedf4b 100644 --- a/packages/permission-log-controller/tests/helpers.ts +++ b/packages/permission-log-controller/tests/helpers.ts @@ -1,4 +1,5 @@ -import { type Json, JsonRpcRequestStruct } from '@metamask/utils'; +import { JsonRpcRequestStruct } from '@metamask/utils'; +import type { Json } from '@metamask/utils'; import deepFreeze from 'deep-freeze-strict'; import { CAVEAT_TYPES } from '../src/enums'; diff --git a/packages/phishing-controller/src/BulkTokenScan.test.ts b/packages/phishing-controller/src/BulkTokenScan.test.ts index 1773fd75de4..9755d0218ce 100644 --- a/packages/phishing-controller/src/BulkTokenScan.test.ts +++ b/packages/phishing-controller/src/BulkTokenScan.test.ts @@ -1,26 +1,24 @@ import { safelyExecuteWithTimeout } from '@metamask/controller-utils'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import nock, { cleanAll } from 'nock'; import sinon from 'sinon'; -import type { PhishingControllerMessenger } from './PhishingController'; import { PhishingController, - type PhishingControllerOptions, SECURITY_ALERTS_BASE_URL, TOKEN_BULK_SCANNING_ENDPOINT, } from './PhishingController'; -import { - type BulkTokenScanRequest, - type TokenScanApiResponse, - TokenScanResultType, -} from './types'; +import type { + PhishingControllerMessenger, + PhishingControllerOptions, +} from './PhishingController'; +import { TokenScanResultType } from './types'; +import type { BulkTokenScanRequest, TokenScanApiResponse } from './types'; jest.mock('@metamask/controller-utils', () => ({ ...jest.requireActual('@metamask/controller-utils'), diff --git a/packages/phishing-controller/src/PathTrie.test.ts b/packages/phishing-controller/src/PathTrie.test.ts index 2b0af547803..3169a7f1cfa 100644 --- a/packages/phishing-controller/src/PathTrie.test.ts +++ b/packages/phishing-controller/src/PathTrie.test.ts @@ -4,9 +4,9 @@ import { deleteFromTrie, insertToTrie, isTerminal, - type PathTrie, matchedPathPrefix, } from './PathTrie'; +import type { PathTrie } from './PathTrie'; const emptyPathTrie: PathTrie = {}; diff --git a/packages/phishing-controller/src/PhishingController.test.ts b/packages/phishing-controller/src/PhishingController.test.ts index 51bc1c823c8..42a286794f7 100644 --- a/packages/phishing-controller/src/PhishingController.test.ts +++ b/packages/phishing-controller/src/PhishingController.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { strict as assert } from 'assert'; import nock, { cleanAll, isDone, pendingMocks } from 'nock'; @@ -16,17 +15,19 @@ import { METAMASK_STALELIST_FILE, PhishingController, PHISHING_CONFIG_BASE_URL, - type PhishingControllerOptions, CLIENT_SIDE_DETECION_BASE_URL, C2_DOMAIN_BLOCKLIST_ENDPOINT, PHISHING_DETECTION_BASE_URL, PHISHING_DETECTION_SCAN_ENDPOINT, PHISHING_DETECTION_BULK_SCAN_ENDPOINT, - type BulkPhishingDetectionScanResponse, - type PhishingControllerMessenger, SECURITY_ALERTS_BASE_URL, ADDRESS_SCAN_ENDPOINT, } from './PhishingController'; +import type { + PhishingControllerOptions, + BulkPhishingDetectionScanResponse, + PhishingControllerMessenger, +} from './PhishingController'; import { createMockStateChangePayload, createMockTransaction, diff --git a/packages/phishing-controller/src/PhishingController.ts b/packages/phishing-controller/src/PhishingController.ts index 61c27586e7d..24175c5a2f7 100644 --- a/packages/phishing-controller/src/PhishingController.ts +++ b/packages/phishing-controller/src/PhishingController.ts @@ -1,14 +1,14 @@ -import { - BaseController, - type StateMetadata, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + StateMetadata, + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import { safelyExecute, safelyExecuteWithTimeout, } from '@metamask/controller-utils'; -import { type Messenger } from '@metamask/messenger'; +import type { Messenger } from '@metamask/messenger'; import type { TransactionControllerStateChangeEvent, TransactionMeta, @@ -16,27 +16,26 @@ import type { import type { Patch } from 'immer'; import { toASCII } from 'punycode/punycode.js'; -import { CacheManager, type CacheEntry } from './CacheManager'; -import { - type PathTrie, - convertListToTrie, - insertToTrie, - matchedPathPrefix, -} from './PathTrie'; +import { CacheManager } from './CacheManager'; +import type { CacheEntry } from './CacheManager'; +import { convertListToTrie, insertToTrie, matchedPathPrefix } from './PathTrie'; +import type { PathTrie } from './PathTrie'; import { PhishingDetector } from './PhishingDetector'; import { PhishingDetectorResultType, - type PhishingDetectorResult, - type PhishingDetectionScanResult, RecommendedAction, - type TokenScanCacheData, - type BulkTokenScanResponse, - type BulkTokenScanRequest, - type TokenScanApiResponse, - type AddressScanCacheData, - type AddressScanResult, AddressScanResultType, } from './types'; +import type { + PhishingDetectorResult, + PhishingDetectionScanResult, + TokenScanCacheData, + BulkTokenScanResponse, + BulkTokenScanRequest, + TokenScanApiResponse, + AddressScanCacheData, + AddressScanResult, +} from './types'; import { applyDiffs, fetchTimeNow, diff --git a/packages/phishing-controller/src/PhishingDetector.test.ts b/packages/phishing-controller/src/PhishingDetector.test.ts index 372f367e6f4..51edd5ed482 100644 --- a/packages/phishing-controller/src/PhishingDetector.test.ts +++ b/packages/phishing-controller/src/PhishingDetector.test.ts @@ -1,7 +1,5 @@ -import { - PhishingDetector, - type PhishingDetectorOptions, -} from './PhishingDetector'; +import { PhishingDetector } from './PhishingDetector'; +import type { PhishingDetectorOptions } from './PhishingDetector'; import { formatHostnameToUrl } from './tests/utils'; import { PhishingDetectorResultType } from './types'; import { sha256Hash } from './utils'; diff --git a/packages/phishing-controller/src/PhishingDetector.ts b/packages/phishing-controller/src/PhishingDetector.ts index b28ea3503f2..5b3d6584919 100644 --- a/packages/phishing-controller/src/PhishingDetector.ts +++ b/packages/phishing-controller/src/PhishingDetector.ts @@ -1,10 +1,9 @@ import { distance } from 'fastest-levenshtein'; -import { matchedPathPrefix, type PathTrie } from './PathTrie'; -import { - PhishingDetectorResultType, - type PhishingDetectorResult, -} from './types'; +import { matchedPathPrefix } from './PathTrie'; +import type { PathTrie } from './PathTrie'; +import { PhishingDetectorResultType } from './types'; +import type { PhishingDetectorResult } from './types'; import { domainPartsToDomain, domainPartsToFuzzyForm, diff --git a/packages/phishing-controller/src/utils.test.ts b/packages/phishing-controller/src/utils.test.ts index a4e411cbf77..e722714f2f0 100644 --- a/packages/phishing-controller/src/utils.test.ts +++ b/packages/phishing-controller/src/utils.test.ts @@ -1,11 +1,8 @@ import * as sinon from 'sinon'; -import { - ListKeys, - ListNames, - type PhishingListState, -} from './PhishingController'; -import { type TokenScanResultType } from './types'; +import { ListKeys, ListNames } from './PhishingController'; +import type { PhishingListState } from './PhishingController'; +import type { TokenScanResultType } from './types'; import { applyDiffs, buildCacheKey, diff --git a/packages/phishing-controller/src/utils.ts b/packages/phishing-controller/src/utils.ts index 2f1408ec99f..819999ba3c6 100644 --- a/packages/phishing-controller/src/utils.ts +++ b/packages/phishing-controller/src/utils.ts @@ -8,11 +8,8 @@ import type { PhishingDetectorList, PhishingDetectorConfiguration, } from './PhishingDetector'; -import { - DEFAULT_CHAIN_ID_TO_NAME, - type TokenScanCacheData, - type TokenScanResult, -} from './types'; +import { DEFAULT_CHAIN_ID_TO_NAME } from './types'; +import type { TokenScanCacheData, TokenScanResult } from './types'; const DEFAULT_TOLERANCE = 3; diff --git a/packages/polling-controller/src/BlockTrackerPollingController.test.ts b/packages/polling-controller/src/BlockTrackerPollingController.test.ts index 88321e80b97..927fb92d27e 100644 --- a/packages/polling-controller/src/BlockTrackerPollingController.test.ts +++ b/packages/polling-controller/src/BlockTrackerPollingController.test.ts @@ -1,8 +1,5 @@ -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MockAnyNamespace, -} from '@metamask/messenger'; +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { MockAnyNamespace } from '@metamask/messenger'; import type { NetworkClient } from '@metamask/network-controller'; import EventEmitter from 'events'; import { useFakeTimers } from 'sinon'; diff --git a/packages/polling-controller/src/StaticIntervalPollingController.test.ts b/packages/polling-controller/src/StaticIntervalPollingController.test.ts index 380465867e8..dead8c95764 100644 --- a/packages/polling-controller/src/StaticIntervalPollingController.test.ts +++ b/packages/polling-controller/src/StaticIntervalPollingController.test.ts @@ -1,8 +1,5 @@ -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MockAnyNamespace, -} from '@metamask/messenger'; +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { MockAnyNamespace } from '@metamask/messenger'; import { createDeferredPromise } from '@metamask/utils'; import { useFakeTimers } from 'sinon'; diff --git a/packages/preferences-controller/src/PreferencesController.test.ts b/packages/preferences-controller/src/PreferencesController.test.ts index 69be355062f..510f33309e4 100644 --- a/packages/preferences-controller/src/PreferencesController.test.ts +++ b/packages/preferences-controller/src/PreferencesController.test.ts @@ -1,11 +1,10 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import { getDefaultKeyringState } from '@metamask/keyring-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { cloneDeep } from 'lodash'; diff --git a/packages/preferences-controller/src/PreferencesController.ts b/packages/preferences-controller/src/PreferencesController.ts index c2698ea15cd..a78e6cf38a9 100644 --- a/packages/preferences-controller/src/PreferencesController.ts +++ b/packages/preferences-controller/src/PreferencesController.ts @@ -1,7 +1,7 @@ -import { - BaseController, - type ControllerStateChangeEvent, - type ControllerGetStateAction, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerStateChangeEvent, + ControllerGetStateAction, } from '@metamask/base-controller'; import { toChecksumHexAddress } from '@metamask/controller-utils'; import type { diff --git a/packages/profile-metrics-controller/src/ProfileMetricsController.test.ts b/packages/profile-metrics-controller/src/ProfileMetricsController.test.ts index 29379175868..0d3b9174e36 100644 --- a/packages/profile-metrics-controller/src/ProfileMetricsController.test.ts +++ b/packages/profile-metrics-controller/src/ProfileMetricsController.test.ts @@ -1,17 +1,14 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; import type { InternalAccount } from '@metamask/keyring-internal-api'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; -import { - ProfileMetricsController, - type ProfileMetricsControllerMessenger, -} from './ProfileMetricsController'; +import { ProfileMetricsController } from './ProfileMetricsController'; +import type { ProfileMetricsControllerMessenger } from './ProfileMetricsController'; import type { ProfileMetricsSubmitMetricsRequest, AccountWithScopes, diff --git a/packages/profile-metrics-controller/src/ProfileMetricsService.test.ts b/packages/profile-metrics-controller/src/ProfileMetricsService.test.ts index af28f5c0d02..2b50fe91bba 100644 --- a/packages/profile-metrics-controller/src/ProfileMetricsService.test.ts +++ b/packages/profile-metrics-controller/src/ProfileMetricsService.test.ts @@ -1,18 +1,18 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import { SDK } from '@metamask/profile-sync-controller'; import nock from 'nock'; -import { type SinonFakeTimers, useFakeTimers } from 'sinon'; +import { useFakeTimers } from 'sinon'; +import type { SinonFakeTimers } from 'sinon'; -import { - ProfileMetricsService, - type ProfileMetricsSubmitMetricsRequest, - type ProfileMetricsServiceMessenger, +import { ProfileMetricsService } from '.'; +import type { + ProfileMetricsSubmitMetricsRequest, + ProfileMetricsServiceMessenger, } from '.'; import { getAuthUrl } from './ProfileMetricsService'; import { HttpError } from '../../controller-utils/src/util'; diff --git a/packages/profile-metrics-controller/src/ProfileMetricsService.ts b/packages/profile-metrics-controller/src/ProfileMetricsService.ts index 8c79839e1c0..0067f553329 100644 --- a/packages/profile-metrics-controller/src/ProfileMetricsService.ts +++ b/packages/profile-metrics-controller/src/ProfileMetricsService.ts @@ -4,12 +4,10 @@ import type { } from '@metamask/controller-utils'; import { createServicePolicy, HttpError } from '@metamask/controller-utils'; import type { Messenger } from '@metamask/messenger'; -import { - type AuthenticationController, - SDK, -} from '@metamask/profile-sync-controller'; +import { SDK } from '@metamask/profile-sync-controller'; +import type { AuthenticationController } from '@metamask/profile-sync-controller'; -import { type ProfileMetricsServiceMethodActions } from '.'; +import type { ProfileMetricsServiceMethodActions } from '.'; // === GENERAL === @@ -169,7 +167,6 @@ export class ProfileMetricsService { return this.#policy.onBreak(listener); } - /* eslint-disable jsdoc/check-indentation */ /** * Registers a handler that will be called under one of two circumstances: * @@ -187,7 +184,6 @@ export class ProfileMetricsService { * @returns An object that can be used to unregister the handler. See * {@link CockatielEvent}. */ - /* eslint-enable jsdoc/check-indentation */ onDegraded(listener: Parameters[0]) { return this.#policy.onDegraded(listener); } diff --git a/packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts b/packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts index 2e4547f2ac5..d92b0701e8f 100644 --- a/packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts +++ b/packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import AuthenticationController from './AuthenticationController'; diff --git a/packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts b/packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts index 4d64f7b4d1f..37aefcc5d47 100644 --- a/packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts +++ b/packages/profile-sync-controller/src/controllers/authentication/AuthenticationController.ts @@ -1,8 +1,8 @@ -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, - type StateMetadata, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, + StateMetadata, } from '@metamask/base-controller'; import type { KeyringControllerGetStateAction, diff --git a/packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.ts b/packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.ts index 4f6491d65f0..563101108e0 100644 --- a/packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.ts +++ b/packages/profile-sync-controller/src/controllers/user-storage/UserStorageController.ts @@ -6,22 +6,22 @@ import type { AddressBookControllerSetAction, AddressBookControllerDeleteAction, } from '@metamask/address-book-controller'; -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, - type StateMetadata, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, + StateMetadata, } from '@metamask/base-controller'; import type { TraceCallback, TraceContext, TraceRequest, } from '@metamask/controller-utils'; -import { - KeyringTypes, - type KeyringControllerGetStateAction, - type KeyringControllerLockEvent, - type KeyringControllerUnlockEvent, +import { KeyringTypes } from '@metamask/keyring-controller'; +import type { + KeyringControllerGetStateAction, + KeyringControllerLockEvent, + KeyringControllerUnlockEvent, } from '@metamask/keyring-controller'; import type { Messenger } from '@metamask/messenger'; import type { HandleSnapRequest } from '@metamask/snaps-controllers'; diff --git a/packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockMessenger.ts b/packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockMessenger.ts index 1856d732b20..2ec6930e250 100644 --- a/packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockMessenger.ts +++ b/packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockMessenger.ts @@ -1,10 +1,9 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, - type NotNamespacedBy, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, + NotNamespacedBy, } from '@metamask/messenger'; import type { diff --git a/packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockServices.ts b/packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockServices.ts index fdd0571ad96..dddac59d2b6 100644 --- a/packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockServices.ts +++ b/packages/profile-sync-controller/src/controllers/user-storage/__fixtures__/mockServices.ts @@ -1,9 +1,9 @@ import nock from 'nock'; -import { - USER_STORAGE_FEATURE_NAMES, - type UserStorageGenericPathWithFeatureAndKey, - type UserStorageGenericPathWithFeatureOnly, +import { USER_STORAGE_FEATURE_NAMES } from '../../../shared/storage-schema'; +import type { + UserStorageGenericPathWithFeatureAndKey, + UserStorageGenericPathWithFeatureOnly, } from '../../../shared/storage-schema'; import { getMockUserStorageGetResponse, diff --git a/packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/controller-integration.ts b/packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/controller-integration.ts index cbc0ebd850e..45b7c1f0748 100644 --- a/packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/controller-integration.ts +++ b/packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/controller-integration.ts @@ -3,10 +3,10 @@ import type { AddressBookEntry } from '@metamask/address-book-controller'; import { canPerformContactSyncing } from './sync-utils'; import type { ContactSyncingOptions } from './types'; import type { UserStorageContactEntry } from './types'; +import type { SyncAddressBookEntry } from './utils'; import { mapAddressBookEntryToUserStorageEntry, mapUserStorageEntryToAddressBookEntry, - type SyncAddressBookEntry, } from './utils'; import { isContactBridgedFromAccounts } from './utils'; import { USER_STORAGE_FEATURE_NAMES } from '../../../shared/storage-schema'; diff --git a/packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/utils.test.ts b/packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/utils.test.ts index ae955f3af4d..c0f2572337e 100644 --- a/packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/utils.test.ts +++ b/packages/profile-sync-controller/src/controllers/user-storage/contact-syncing/utils.test.ts @@ -5,8 +5,8 @@ import type { UserStorageContactEntry } from './types'; import { mapAddressBookEntryToUserStorageEntry, mapUserStorageEntryToAddressBookEntry, - type SyncAddressBookEntry, } from './utils'; +import type { SyncAddressBookEntry } from './utils'; describe('user-storage/contact-syncing/utils', () => { // Use checksum address format for consistent testing diff --git a/packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.test.ts b/packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.test.ts index 8fe8b97e4c0..550e20c84e9 100644 --- a/packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.test.ts +++ b/packages/profile-sync-controller/src/sdk/authentication-jwt-bearer/flow-srp.test.ts @@ -1,10 +1,6 @@ import { SRPJwtBearerAuth } from './flow-srp'; -import { - AuthType, - type AuthConfig, - type LoginResponse, - type UserProfile, -} from './types'; +import { AuthType } from './types'; +import type { AuthConfig, LoginResponse, UserProfile } from './types'; import * as timeUtils from './utils/time'; import { Env, Platform } from '../../shared/env'; import { RateLimitedError } from '../errors'; diff --git a/packages/profile-sync-controller/src/sdk/user-storage.test.ts b/packages/profile-sync-controller/src/sdk/user-storage.test.ts index 82775648704..7d73410674f 100644 --- a/packages/profile-sync-controller/src/sdk/user-storage.test.ts +++ b/packages/profile-sync-controller/src/sdk/user-storage.test.ts @@ -10,7 +10,7 @@ import { handleMockUserStorageDelete, handleMockUserStorageBatchDelete, } from './__fixtures__/userstorage'; -import { type IBaseAuth } from './authentication-jwt-bearer/types'; +import type { IBaseAuth } from './authentication-jwt-bearer/types'; import { NotFoundError, UserStorageError } from './errors'; import { MOCK_NOTIFICATIONS_DATA, diff --git a/packages/profile-sync-controller/src/sdk/utils/messaging-signing-snap-requests.test.ts b/packages/profile-sync-controller/src/sdk/utils/messaging-signing-snap-requests.test.ts index 3a7c188d2fd..48e34a81280 100644 --- a/packages/profile-sync-controller/src/sdk/utils/messaging-signing-snap-requests.test.ts +++ b/packages/profile-sync-controller/src/sdk/utils/messaging-signing-snap-requests.test.ts @@ -6,10 +6,8 @@ import { getSnaps, isSnapConnected, } from './messaging-signing-snap-requests'; -import { - arrangeMockProvider, - type MockVariable, -} from '../__fixtures__/test-utils'; +import { arrangeMockProvider } from '../__fixtures__/test-utils'; +import type { MockVariable } from '../__fixtures__/test-utils'; /** * Most of these utilities are wrappers around making wallet requests, diff --git a/packages/rate-limit-controller/src/RateLimitController.test.ts b/packages/rate-limit-controller/src/RateLimitController.test.ts index efa82a9c3a6..ec5f8139981 100644 --- a/packages/rate-limit-controller/src/RateLimitController.test.ts +++ b/packages/rate-limit-controller/src/RateLimitController.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { RateLimitMessenger } from './RateLimitController'; diff --git a/packages/rate-limit-controller/src/RateLimitController.ts b/packages/rate-limit-controller/src/RateLimitController.ts index f41a650ce7c..94800c8f007 100644 --- a/packages/rate-limit-controller/src/RateLimitController.ts +++ b/packages/rate-limit-controller/src/RateLimitController.ts @@ -1,7 +1,7 @@ -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { Messenger, ActionConstraint } from '@metamask/messenger'; import { rpcErrors } from '@metamask/rpc-errors'; diff --git a/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.test.ts b/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.test.ts index 14df889b2a9..c1cfc84c119 100644 --- a/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.test.ts +++ b/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { AbstractClientConfigApiService } from './client-config-api-service/abstract-client-config-api-service'; diff --git a/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts b/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts index 052c41aee82..09fa8c1c682 100644 --- a/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts +++ b/packages/remote-feature-flag-controller/src/remote-feature-flag-controller.ts @@ -1,14 +1,11 @@ -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { Messenger } from '@metamask/messenger'; -import { - isValidSemVerVersion, - type Json, - type SemVerVersion, -} from '@metamask/utils'; +import { isValidSemVerVersion } from '@metamask/utils'; +import type { Json, SemVerVersion } from '@metamask/utils'; import type { AbstractClientConfigApiService } from './client-config-api-service/abstract-client-config-api-service'; import type { diff --git a/packages/sample-controllers/src/sample-gas-prices-controller.test.ts b/packages/sample-controllers/src/sample-gas-prices-controller.test.ts index 03c1ae19840..9dca9f7a5d4 100644 --- a/packages/sample-controllers/src/sample-gas-prices-controller.test.ts +++ b/packages/sample-controllers/src/sample-gas-prices-controller.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import { SampleGasPricesController } from '@metamask/sample-controllers'; import type { SampleGasPricesControllerMessenger } from '@metamask/sample-controllers'; diff --git a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts index 1796ea2bd6e..42d71884c83 100644 --- a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts +++ b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.test.ts @@ -1,10 +1,9 @@ import { HttpError } from '@metamask/controller-utils'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import nock from 'nock'; import { useFakeTimers } from 'sinon'; diff --git a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts index 15611143ec8..817a3704f3b 100644 --- a/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts +++ b/packages/sample-controllers/src/sample-gas-prices-service/sample-gas-prices-service.ts @@ -8,7 +8,8 @@ import { HttpError, } from '@metamask/controller-utils'; import type { Messenger } from '@metamask/messenger'; -import { hasProperty, isPlainObject, type Hex } from '@metamask/utils'; +import { hasProperty, isPlainObject } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import type { SampleGasPricesServiceMethodActions } from './sample-gas-prices-service-method-action-types'; @@ -195,7 +196,6 @@ export class SampleGasPricesService { return this.#policy.onBreak(listener); } - /* eslint-disable jsdoc/check-indentation */ /** * Registers a handler that will be called under one of two circumstances: * @@ -213,7 +213,6 @@ export class SampleGasPricesService { * @returns An object that can be used to unregister the handler. See * {@link CockatielEvent}. */ - /* eslint-enable jsdoc/check-indentation */ onDegraded(listener: Parameters[0]) { return this.#policy.onDegraded(listener); } diff --git a/packages/sample-controllers/src/sample-petnames-controller.test.ts b/packages/sample-controllers/src/sample-petnames-controller.test.ts index 45bfd0d1d60..96e45b803da 100644 --- a/packages/sample-controllers/src/sample-petnames-controller.test.ts +++ b/packages/sample-controllers/src/sample-petnames-controller.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import type { SamplePetnamesControllerMessenger } from './sample-petnames-controller'; diff --git a/packages/seedless-onboarding-controller/src/SeedlessOnboardingController.test.ts b/packages/seedless-onboarding-controller/src/SeedlessOnboardingController.test.ts index 94161a8ff06..7362186ddd4 100644 --- a/packages/seedless-onboarding-controller/src/SeedlessOnboardingController.test.ts +++ b/packages/seedless-onboarding-controller/src/SeedlessOnboardingController.test.ts @@ -15,15 +15,14 @@ import { generateSalt as generateSaltBrowserPassworder, keyFromPassword as keyFromPasswordBrowserPassworder, } from '@metamask/browser-passworder'; -import { - TOPRFError, - type FetchAuthPubKeyResult, - type SEC1EncodedPublicKey, - type ChangeEncryptionKeyResult, - type KeyPair, - type RecoverEncryptionKeyResult, - type ToprfSecureBackup, - TOPRFErrorCode, +import { TOPRFError, TOPRFErrorCode } from '@metamask/toprf-secure-backup'; +import type { + FetchAuthPubKeyResult, + SEC1EncodedPublicKey, + ChangeEncryptionKeyResult, + KeyPair, + RecoverEncryptionKeyResult, + ToprfSecureBackup, } from '@metamask/toprf-secure-backup'; import { base64ToBytes, diff --git a/packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts b/packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts index 7fe1a5c7be6..bc0424c7517 100644 --- a/packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts +++ b/packages/seedless-onboarding-controller/src/SeedlessOnboardingController.ts @@ -1,5 +1,6 @@ import { keccak256AndHexify } from '@metamask/auth-network-utils'; -import { BaseController, type StateMetadata } from '@metamask/base-controller'; +import { BaseController } from '@metamask/base-controller'; +import type { StateMetadata } from '@metamask/base-controller'; import type * as encryptionUtils from '@metamask/browser-passworder'; import type { KeyPair, diff --git a/packages/seedless-onboarding-controller/src/errors.ts b/packages/seedless-onboarding-controller/src/errors.ts index 14284b5888a..7f5c0224de8 100644 --- a/packages/seedless-onboarding-controller/src/errors.ts +++ b/packages/seedless-onboarding-controller/src/errors.ts @@ -1,8 +1,5 @@ -import { - type RateLimitErrorData, - TOPRFError, - TOPRFErrorCode, -} from '@metamask/toprf-secure-backup'; +import { TOPRFError, TOPRFErrorCode } from '@metamask/toprf-secure-backup'; +import type { RateLimitErrorData } from '@metamask/toprf-secure-backup'; import { SeedlessOnboardingControllerErrorMessage } from './constants'; import type { RecoveryErrorData } from './types'; diff --git a/packages/seedless-onboarding-controller/tests/__fixtures__/mockMessenger.ts b/packages/seedless-onboarding-controller/tests/__fixtures__/mockMessenger.ts index 07e62860135..c10a9dcf8e3 100644 --- a/packages/seedless-onboarding-controller/tests/__fixtures__/mockMessenger.ts +++ b/packages/seedless-onboarding-controller/tests/__fixtures__/mockMessenger.ts @@ -2,16 +2,15 @@ import type { KeyringControllerLockEvent, KeyringControllerUnlockEvent, } from '@metamask/keyring-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import { controllerName } from '../../src/constants'; -import { type SeedlessOnboardingControllerMessenger } from '../../src/types'; +import type { SeedlessOnboardingControllerMessenger } from '../../src/types'; export type AllSeedlessOnboardingControllerActions = MessengerActions; diff --git a/packages/selected-network-controller/src/SelectedNetworkController.ts b/packages/selected-network-controller/src/SelectedNetworkController.ts index 0826df76929..a4d032bbeee 100644 --- a/packages/selected-network-controller/src/SelectedNetworkController.ts +++ b/packages/selected-network-controller/src/SelectedNetworkController.ts @@ -1,7 +1,7 @@ -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { Messenger } from '@metamask/messenger'; import type { diff --git a/packages/selected-network-controller/tests/SelectedNetworkController.test.ts b/packages/selected-network-controller/tests/SelectedNetworkController.test.ts index 5c97f46b815..ee89faeae9a 100644 --- a/packages/selected-network-controller/tests/SelectedNetworkController.test.ts +++ b/packages/selected-network-controller/tests/SelectedNetworkController.test.ts @@ -1,18 +1,19 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { - type ProviderProxy, - type BlockTrackerProxy, - type NetworkState, getDefaultNetworkControllerState, RpcEndpointType, } from '@metamask/network-controller'; +import type { + ProviderProxy, + BlockTrackerProxy, + NetworkState, +} from '@metamask/network-controller'; import { createEventEmitterProxy, createSwappableProxy, diff --git a/packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts b/packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts index 34893ed56da..c57deb36fce 100644 --- a/packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts +++ b/packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts @@ -1,10 +1,9 @@ import { JsonRpcEngine } from '@metamask/json-rpc-engine'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import type { JsonRpcResponse } from '@metamask/utils'; diff --git a/packages/shield-controller/src/ShieldController.test.ts b/packages/shield-controller/src/ShieldController.test.ts index 91e1904c60f..e4032962a09 100644 --- a/packages/shield-controller/src/ShieldController.test.ts +++ b/packages/shield-controller/src/ShieldController.test.ts @@ -1,14 +1,10 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; +import { SignatureRequestStatus } from '@metamask/signature-controller'; import type { SignatureRequest } from '@metamask/signature-controller'; -import { - SignatureRequestStatus, - type SignatureControllerState, -} from '@metamask/signature-controller'; +import type { SignatureControllerState } from '@metamask/signature-controller'; +import { TransactionStatus } from '@metamask/transaction-controller'; import type { TransactionMeta } from '@metamask/transaction-controller'; -import { - TransactionStatus, - type TransactionControllerState, -} from '@metamask/transaction-controller'; +import type { TransactionControllerState } from '@metamask/transaction-controller'; import { ShieldController } from './ShieldController'; import type { NormalizeSignatureRequestFn } from './types'; diff --git a/packages/shield-controller/src/ShieldController.ts b/packages/shield-controller/src/ShieldController.ts index 296df877717..7bc6b60f296 100644 --- a/packages/shield-controller/src/ShieldController.ts +++ b/packages/shield-controller/src/ShieldController.ts @@ -1,18 +1,18 @@ -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { Messenger } from '@metamask/messenger'; -import { - SignatureRequestStatus, - type SignatureRequest, - type SignatureStateChange, +import { SignatureRequestStatus } from '@metamask/signature-controller'; +import type { + SignatureRequest, + SignatureStateChange, } from '@metamask/signature-controller'; -import { - TransactionStatus, - type TransactionControllerStateChangeEvent, - type TransactionMeta, +import { TransactionStatus } from '@metamask/transaction-controller'; +import type { + TransactionControllerStateChangeEvent, + TransactionMeta, } from '@metamask/transaction-controller'; import { cloneDeep, isEqual } from 'lodash'; diff --git a/packages/shield-controller/src/backend.ts b/packages/shield-controller/src/backend.ts index 83a52fcf05b..033cff93def 100644 --- a/packages/shield-controller/src/backend.ts +++ b/packages/shield-controller/src/backend.ts @@ -6,8 +6,8 @@ import { import { EthMethod, SignatureRequestType, - type SignatureRequest, } from '@metamask/signature-controller'; +import type { SignatureRequest } from '@metamask/signature-controller'; import type { TransactionMeta } from '@metamask/transaction-controller'; import type { AuthorizationList } from '@metamask/transaction-controller'; import type { Json } from '@metamask/utils'; diff --git a/packages/shield-controller/src/polling-with-policy.ts b/packages/shield-controller/src/polling-with-policy.ts index 05dc4cc2582..1c21f184dda 100644 --- a/packages/shield-controller/src/polling-with-policy.ts +++ b/packages/shield-controller/src/polling-with-policy.ts @@ -1,8 +1,7 @@ -import { - createServicePolicy, - HttpError, - type CreateServicePolicyOptions, - type ServicePolicy, +import { createServicePolicy, HttpError } from '@metamask/controller-utils'; +import type { + CreateServicePolicyOptions, + ServicePolicy, } from '@metamask/controller-utils'; import { handleWhen } from 'cockatiel'; diff --git a/packages/shield-controller/tests/mocks/messenger.ts b/packages/shield-controller/tests/mocks/messenger.ts index b427b22a8fb..19e37e52d15 100644 --- a/packages/shield-controller/tests/mocks/messenger.ts +++ b/packages/shield-controller/tests/mocks/messenger.ts @@ -1,12 +1,11 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; -import { type ShieldControllerMessenger } from '../../src'; +import type { ShieldControllerMessenger } from '../../src'; import { controllerName } from '../../src/constants'; type AllShieldControllerActions = MessengerActions; diff --git a/packages/shield-controller/tests/utils.ts b/packages/shield-controller/tests/utils.ts index 5243d32804c..9d06727b616 100644 --- a/packages/shield-controller/tests/utils.ts +++ b/packages/shield-controller/tests/utils.ts @@ -1,18 +1,19 @@ import { SignatureRequestStatus, SignatureRequestType, - type SignatureRequest, } from '@metamask/signature-controller'; +import type { SignatureRequest } from '@metamask/signature-controller'; import { TransactionStatus, TransactionType, - type TransactionMeta, } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; import type { SignTypedDataVersion } from 'src/constants'; import { v1 as random } from 'uuid'; import type { createMockMessenger } from './mocks/messenger'; -import { coverageStatuses, type CoverageStatus } from '../src/types'; +import { coverageStatuses } from '../src/types'; +import type { CoverageStatus } from '../src/types'; /** * Generate a mock transaction meta. diff --git a/packages/signature-controller/src/SignatureController.ts b/packages/signature-controller/src/SignatureController.ts index e761b818d57..9dc134e34a0 100644 --- a/packages/signature-controller/src/SignatureController.ts +++ b/packages/signature-controller/src/SignatureController.ts @@ -4,10 +4,10 @@ import type { AcceptResultCallbacks, AddResult, } from '@metamask/approval-controller'; -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { TraceCallback, TraceContext } from '@metamask/controller-utils'; import { @@ -29,8 +29,8 @@ import { SigningMethod, LogType, SigningStage, - type AddLog, } from '@metamask/logging-controller'; +import type { AddLog } from '@metamask/logging-controller'; import type { Messenger } from '@metamask/messenger'; import type { NetworkControllerGetNetworkClientByIdAction } from '@metamask/network-controller'; import type { Hex, Json } from '@metamask/utils'; diff --git a/packages/signature-controller/src/utils/decoding-api.test.ts b/packages/signature-controller/src/utils/decoding-api.test.ts index f3ae0d5e8f1..9c898b4f9af 100644 --- a/packages/signature-controller/src/utils/decoding-api.test.ts +++ b/packages/signature-controller/src/utils/decoding-api.test.ts @@ -1,5 +1,6 @@ import { decodeSignature } from './decoding-api'; -import { EthMethod, type OriginalRequest } from '../types'; +import { EthMethod } from '../types'; +import type { OriginalRequest } from '../types'; const PERMIT_REQUEST_MOCK = { method: EthMethod.SignTypedDataV4, diff --git a/packages/signature-controller/src/utils/decoding-api.ts b/packages/signature-controller/src/utils/decoding-api.ts index 014fbbf3b4e..f886c23a606 100644 --- a/packages/signature-controller/src/utils/decoding-api.ts +++ b/packages/signature-controller/src/utils/decoding-api.ts @@ -1,5 +1,6 @@ import { normalizeParam } from './normalize'; -import { EthMethod, type OriginalRequest } from '../types'; +import { EthMethod } from '../types'; +import type { OriginalRequest } from '../types'; export const DECODING_API_ERRORS = { UNSUPPORTED_SIGNATURE: 'UNSUPPORTED_SIGNATURE', diff --git a/packages/signature-controller/src/utils/normalize.ts b/packages/signature-controller/src/utils/normalize.ts index 4ae9443138d..4c06c439acb 100644 --- a/packages/signature-controller/src/utils/normalize.ts +++ b/packages/signature-controller/src/utils/normalize.ts @@ -1,5 +1,6 @@ import { SignTypedDataVersion } from '@metamask/keyring-controller'; -import { add0x, bytesToHex, type Json, remove0x } from '@metamask/utils'; +import { add0x, bytesToHex, remove0x } from '@metamask/utils'; +import type { Json } from '@metamask/utils'; import type { MessageParamsPersonal, MessageParamsTyped } from '../types'; diff --git a/packages/signature-controller/src/utils/validation.ts b/packages/signature-controller/src/utils/validation.ts index 549e33af2eb..d846dd2d093 100644 --- a/packages/signature-controller/src/utils/validation.ts +++ b/packages/signature-controller/src/utils/validation.ts @@ -7,7 +7,7 @@ import { import type { DecodedPermission } from '@metamask/gator-permissions-controller'; import { SignTypedDataVersion } from '@metamask/keyring-controller'; import type { Json } from '@metamask/utils'; -import { type Hex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { validate } from 'jsonschema'; import { isDelegationRequest } from './delegations'; diff --git a/packages/storage-service/src/StorageService.test.ts b/packages/storage-service/src/StorageService.test.ts index e25ae87f3d4..2efa05b147b 100644 --- a/packages/storage-service/src/StorageService.test.ts +++ b/packages/storage-service/src/StorageService.test.ts @@ -1,9 +1,8 @@ -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import { StorageService } from './StorageService'; diff --git a/packages/subscription-controller/src/SubscriptionController.test.ts b/packages/subscription-controller/src/SubscriptionController.test.ts index 5d91e105731..a665d21a962 100644 --- a/packages/subscription-controller/src/SubscriptionController.test.ts +++ b/packages/subscription-controller/src/SubscriptionController.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { TransactionStatus, @@ -21,10 +20,12 @@ import { SubscriptionServiceError } from './errors'; import { getDefaultSubscriptionControllerState, SubscriptionController, - type AllowedEvents, - type SubscriptionControllerMessenger, - type SubscriptionControllerOptions, - type SubscriptionControllerState, +} from './SubscriptionController'; +import type { + AllowedEvents, + SubscriptionControllerMessenger, + SubscriptionControllerOptions, + SubscriptionControllerState, } from './SubscriptionController'; import type { Subscription, diff --git a/packages/subscription-controller/src/SubscriptionController.ts b/packages/subscription-controller/src/SubscriptionController.ts index 74dc3cd009a..94102ae11e8 100644 --- a/packages/subscription-controller/src/SubscriptionController.ts +++ b/packages/subscription-controller/src/SubscriptionController.ts @@ -1,14 +1,14 @@ -import { - type StateMetadata, - type ControllerStateChangeEvent, - type ControllerGetStateAction, +import type { + StateMetadata, + ControllerStateChangeEvent, + ControllerGetStateAction, } from '@metamask/base-controller'; import type { Messenger } from '@metamask/messenger'; import { StaticIntervalPollingController } from '@metamask/polling-controller'; import type { AuthenticationController } from '@metamask/profile-sync-controller'; import type { TransactionMeta } from '@metamask/transaction-controller'; import { TransactionType } from '@metamask/transaction-controller'; -import { type Hex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { BigNumber } from 'bignumber.js'; import { @@ -17,6 +17,7 @@ import { DEFAULT_POLLING_INTERVAL, SubscriptionControllerErrorMessage, } from './constants'; +import { PAYMENT_TYPES, PRODUCT_TYPES, SUBSCRIPTION_STATUSES } from './types'; import type { AssignCohortRequest, BillingPortalResponse, @@ -36,15 +37,12 @@ import type { SubscriptionStatus, LinkRewardsRequest, } from './types'; -import { - PAYMENT_TYPES, - PRODUCT_TYPES, - SUBSCRIPTION_STATUSES, - type ISubscriptionService, - type PricingResponse, - type ProductType, - type StartSubscriptionRequest, - type Subscription, +import type { + ISubscriptionService, + PricingResponse, + ProductType, + StartSubscriptionRequest, + Subscription, } from './types'; export type SubscriptionControllerState = { diff --git a/packages/subscription-controller/src/SubscriptionService.ts b/packages/subscription-controller/src/SubscriptionService.ts index 5f3e392f090..20522efe734 100644 --- a/packages/subscription-controller/src/SubscriptionService.ts +++ b/packages/subscription-controller/src/SubscriptionService.ts @@ -1,10 +1,7 @@ import { handleFetch } from '@metamask/controller-utils'; -import { - getEnvUrls, - SubscriptionControllerErrorMessage, - type Env, -} from './constants'; +import { getEnvUrls, SubscriptionControllerErrorMessage } from './constants'; +import type { Env } from './constants'; import { SubscriptionServiceError } from './errors'; import type { AssignCohortRequest, diff --git a/packages/token-search-discovery-controller/src/token-search-discovery-controller.test.ts b/packages/token-search-discovery-controller/src/token-search-discovery-controller.test.ts index 7efc2bca220..5622a609720 100644 --- a/packages/token-search-discovery-controller/src/token-search-discovery-controller.test.ts +++ b/packages/token-search-discovery-controller/src/token-search-discovery-controller.test.ts @@ -1,10 +1,9 @@ import { deriveStateFromMetadata } from '@metamask/base-controller'; -import { - Messenger, - MOCK_ANY_NAMESPACE, - type MessengerActions, - type MessengerEvents, - type MockAnyNamespace, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MessengerActions, + MessengerEvents, + MockAnyNamespace, } from '@metamask/messenger'; import { AbstractTokenDiscoveryApiService } from './token-discovery-api-service/abstract-token-discovery-api-service'; diff --git a/packages/token-search-discovery-controller/src/token-search-discovery-controller.ts b/packages/token-search-discovery-controller/src/token-search-discovery-controller.ts index 872c4705879..9a4dc79cbe9 100644 --- a/packages/token-search-discovery-controller/src/token-search-discovery-controller.ts +++ b/packages/token-search-discovery-controller/src/token-search-discovery-controller.ts @@ -1,8 +1,8 @@ -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, - type StateMetadata, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, + StateMetadata, } from '@metamask/base-controller'; import type { Messenger } from '@metamask/messenger'; diff --git a/packages/transaction-controller/src/TransactionController.test.ts b/packages/transaction-controller/src/TransactionController.test.ts index 1d0bec05a34..2e2d2a5e991 100644 --- a/packages/transaction-controller/src/TransactionController.test.ts +++ b/packages/transaction-controller/src/TransactionController.test.ts @@ -15,12 +15,11 @@ import { import type { InternalProvider } from '@metamask/eth-json-rpc-provider'; import EthQuery from '@metamask/eth-query'; import HttpProvider from '@metamask/ethjs-provider-http'; -import { - Messenger, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, - MOCK_ANY_NAMESPACE, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import type { BlockTracker, diff --git a/packages/transaction-controller/src/TransactionControllerIntegration.test.ts b/packages/transaction-controller/src/TransactionControllerIntegration.test.ts index bf2dc2fa408..efc26963003 100644 --- a/packages/transaction-controller/src/TransactionControllerIntegration.test.ts +++ b/packages/transaction-controller/src/TransactionControllerIntegration.test.ts @@ -12,12 +12,11 @@ import { InfuraNetworkType, NetworkType, } from '@metamask/controller-utils'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import { NetworkController, diff --git a/packages/transaction-controller/src/api/simulation-api.ts b/packages/transaction-controller/src/api/simulation-api.ts index 0d67d86d4a0..7415f769a9f 100644 --- a/packages/transaction-controller/src/api/simulation-api.ts +++ b/packages/transaction-controller/src/api/simulation-api.ts @@ -1,5 +1,6 @@ import { convertHexToDecimal } from '@metamask/controller-utils'; -import { createModuleLogger, type Hex } from '@metamask/utils'; +import { createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { cloneDeep } from 'lodash'; import { diff --git a/packages/transaction-controller/src/gas-flows/LineaGasFeeFlow.ts b/packages/transaction-controller/src/gas-flows/LineaGasFeeFlow.ts index bd9208d5699..56765a8ba79 100644 --- a/packages/transaction-controller/src/gas-flows/LineaGasFeeFlow.ts +++ b/packages/transaction-controller/src/gas-flows/LineaGasFeeFlow.ts @@ -1,6 +1,7 @@ import { ChainId, hexToBN, query, toHex } from '@metamask/controller-utils'; import type EthQuery from '@metamask/eth-query'; -import { createModuleLogger, type Hex } from '@metamask/utils'; +import { createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import type BN from 'bn.js'; import { DefaultGasFeeFlow } from './DefaultGasFeeFlow'; diff --git a/packages/transaction-controller/src/gas-flows/OptimismLayer1GasFeeFlow.test.ts b/packages/transaction-controller/src/gas-flows/OptimismLayer1GasFeeFlow.test.ts index bccda7b9375..37efefe4157 100644 --- a/packages/transaction-controller/src/gas-flows/OptimismLayer1GasFeeFlow.test.ts +++ b/packages/transaction-controller/src/gas-flows/OptimismLayer1GasFeeFlow.test.ts @@ -1,5 +1,6 @@ import * as ControllerUtils from '@metamask/controller-utils'; -import { hexToNumber, type Hex } from '@metamask/utils'; +import { hexToNumber } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { OptimismLayer1GasFeeFlow } from './OptimismLayer1GasFeeFlow'; import { CHAIN_IDS } from '../constants'; diff --git a/packages/transaction-controller/src/gas-flows/OptimismLayer1GasFeeFlow.ts b/packages/transaction-controller/src/gas-flows/OptimismLayer1GasFeeFlow.ts index 0ac807cbf08..60fa7852f9e 100644 --- a/packages/transaction-controller/src/gas-flows/OptimismLayer1GasFeeFlow.ts +++ b/packages/transaction-controller/src/gas-flows/OptimismLayer1GasFeeFlow.ts @@ -1,5 +1,6 @@ import { handleFetch } from '@metamask/controller-utils'; -import { type Hex, hexToNumber } from '@metamask/utils'; +import { hexToNumber } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { OracleLayer1GasFeeFlow } from './OracleLayer1GasFeeFlow'; import { CHAIN_IDS } from '../constants'; diff --git a/packages/transaction-controller/src/gas-flows/OracleLayer1GasFeeFlow.test.ts b/packages/transaction-controller/src/gas-flows/OracleLayer1GasFeeFlow.test.ts index 561fcc62e2d..1e02740e1d7 100644 --- a/packages/transaction-controller/src/gas-flows/OracleLayer1GasFeeFlow.test.ts +++ b/packages/transaction-controller/src/gas-flows/OracleLayer1GasFeeFlow.test.ts @@ -2,17 +2,15 @@ import type { TypedTransaction } from '@ethereumjs/tx'; import { TransactionFactory } from '@ethereumjs/tx'; import { Contract } from '@ethersproject/contracts'; import type { Provider } from '@metamask/network-controller'; -import { add0x, type Hex } from '@metamask/utils'; +import { add0x } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import BN from 'bn.js'; import { OracleLayer1GasFeeFlow } from './OracleLayer1GasFeeFlow'; import { CHAIN_IDS } from '../constants'; import type { TransactionControllerMessenger } from '../TransactionController'; -import { - type Layer1GasFeeFlowRequest, - type TransactionMeta, - TransactionStatus, -} from '../types'; +import { TransactionStatus } from '../types'; +import type { Layer1GasFeeFlowRequest, TransactionMeta } from '../types'; import { bnFromHex, padHexToEvenLength } from '../utils/utils'; jest.mock('@ethersproject/contracts', () => ({ diff --git a/packages/transaction-controller/src/gas-flows/OracleLayer1GasFeeFlow.ts b/packages/transaction-controller/src/gas-flows/OracleLayer1GasFeeFlow.ts index 5c7c8637173..5c8ce1589b4 100644 --- a/packages/transaction-controller/src/gas-flows/OracleLayer1GasFeeFlow.ts +++ b/packages/transaction-controller/src/gas-flows/OracleLayer1GasFeeFlow.ts @@ -1,5 +1,6 @@ import { Contract } from '@ethersproject/contracts'; -import { Web3Provider, type ExternalProvider } from '@ethersproject/providers'; +import { Web3Provider } from '@ethersproject/providers'; +import type { ExternalProvider } from '@ethersproject/providers'; import type { Hex } from '@metamask/utils'; import { add0x, createModuleLogger } from '@metamask/utils'; import BN from 'bn.js'; diff --git a/packages/transaction-controller/src/gas-flows/RandomisedEstimationsGasFeeFlow.ts b/packages/transaction-controller/src/gas-flows/RandomisedEstimationsGasFeeFlow.ts index 19c889fa5a2..5b6fa1bf9e0 100644 --- a/packages/transaction-controller/src/gas-flows/RandomisedEstimationsGasFeeFlow.ts +++ b/packages/transaction-controller/src/gas-flows/RandomisedEstimationsGasFeeFlow.ts @@ -1,6 +1,7 @@ import type { GasFeeEstimates as FeeMarketGasPriceEstimate } from '@metamask/gas-fee-controller'; import { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller'; -import { add0x, createModuleLogger, type Hex } from '@metamask/utils'; +import { add0x, createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { DefaultGasFeeFlow } from './DefaultGasFeeFlow'; import { projectLogger } from '../logger'; diff --git a/packages/transaction-controller/src/gas-flows/ScrollLayer1GasFeeFlow.ts b/packages/transaction-controller/src/gas-flows/ScrollLayer1GasFeeFlow.ts index d6e65dada22..352d2c7473e 100644 --- a/packages/transaction-controller/src/gas-flows/ScrollLayer1GasFeeFlow.ts +++ b/packages/transaction-controller/src/gas-flows/ScrollLayer1GasFeeFlow.ts @@ -1,4 +1,4 @@ -import { type Hex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { OracleLayer1GasFeeFlow } from './OracleLayer1GasFeeFlow'; import { CHAIN_IDS } from '../constants'; diff --git a/packages/transaction-controller/src/gas-flows/TestGasFeeFlow.test.ts b/packages/transaction-controller/src/gas-flows/TestGasFeeFlow.test.ts index 44a5f77c75d..68cceadf0a4 100644 --- a/packages/transaction-controller/src/gas-flows/TestGasFeeFlow.test.ts +++ b/packages/transaction-controller/src/gas-flows/TestGasFeeFlow.test.ts @@ -1,5 +1,6 @@ import { TestGasFeeFlow } from './TestGasFeeFlow'; -import { GasFeeEstimateType, type GasFeeFlowRequest } from '../types'; +import { GasFeeEstimateType } from '../types'; +import type { GasFeeFlowRequest } from '../types'; describe('TestGasFeeFlow', () => { describe('matchesTransaction', () => { diff --git a/packages/transaction-controller/src/gas-flows/TestGasFeeFlow.ts b/packages/transaction-controller/src/gas-flows/TestGasFeeFlow.ts index 1c5d63dce8a..95bfb1212de 100644 --- a/packages/transaction-controller/src/gas-flows/TestGasFeeFlow.ts +++ b/packages/transaction-controller/src/gas-flows/TestGasFeeFlow.ts @@ -1,11 +1,11 @@ import { toHex } from '@metamask/controller-utils'; import type { Hex } from '@metamask/utils'; -import { - GasFeeEstimateType, - type GasFeeFlow, - type GasFeeFlowRequest, - type GasFeeFlowResponse, +import { GasFeeEstimateType } from '../types'; +import type { + GasFeeFlow, + GasFeeFlowRequest, + GasFeeFlowResponse, } from '../types'; const INCREMENT = 1e15; // 0.001 ETH diff --git a/packages/transaction-controller/src/helpers/AccountsApiRemoteTransactionSource.test.ts b/packages/transaction-controller/src/helpers/AccountsApiRemoteTransactionSource.test.ts index e433c7e3def..cf075ccc51f 100644 --- a/packages/transaction-controller/src/helpers/AccountsApiRemoteTransactionSource.test.ts +++ b/packages/transaction-controller/src/helpers/AccountsApiRemoteTransactionSource.test.ts @@ -8,7 +8,8 @@ import type { TransactionResponse, } from '../api/accounts-api'; import { getAccountTransactions } from '../api/accounts-api'; -import { TransactionType, type RemoteTransactionSourceRequest } from '../types'; +import { TransactionType } from '../types'; +import type { RemoteTransactionSourceRequest } from '../types'; jest.mock('../api/accounts-api'); jest.mock('../utils/transaction-type'); diff --git a/packages/transaction-controller/src/helpers/GasFeePoller.test.ts b/packages/transaction-controller/src/helpers/GasFeePoller.test.ts index dbc859c0cdd..ab07904c73c 100644 --- a/packages/transaction-controller/src/helpers/GasFeePoller.test.ts +++ b/packages/transaction-controller/src/helpers/GasFeePoller.test.ts @@ -10,21 +10,19 @@ import { import { flushPromises } from '../../../../tests/helpers'; import { DefaultGasFeeFlow } from '../gas-flows/DefaultGasFeeFlow'; import type { TransactionControllerMessenger } from '../TransactionController'; -import type { - GasFeeFlowResponse, - Layer1GasFeeFlow, - TransactionBatchMeta, -} from '../types'; import { GasFeeEstimateLevel, GasFeeEstimateType, TransactionEnvelopeType, TransactionStatus, UserFeeLevel, - type GasFeeFlow, - type GasFeeEstimates, - type TransactionMeta, } from '../types'; +import type { + GasFeeFlowResponse, + Layer1GasFeeFlow, + TransactionBatchMeta, +} from '../types'; +import type { GasFeeFlow, GasFeeEstimates, TransactionMeta } from '../types'; import { getTransactionLayer1GasFee } from '../utils/layer1-gas-fee-flow'; jest.mock('../utils/feature-flags'); diff --git a/packages/transaction-controller/src/helpers/IncomingTransactionHelper.test.ts b/packages/transaction-controller/src/helpers/IncomingTransactionHelper.test.ts index 10f911952a7..b7c8761fcec 100644 --- a/packages/transaction-controller/src/helpers/IncomingTransactionHelper.test.ts +++ b/packages/transaction-controller/src/helpers/IncomingTransactionHelper.test.ts @@ -3,12 +3,8 @@ import type { Hex } from '@metamask/utils'; import { IncomingTransactionHelper } from './IncomingTransactionHelper'; import type { TransactionControllerMessenger } from '..'; import { flushPromises } from '../../../../tests/helpers'; -import { - TransactionStatus, - TransactionType, - type RemoteTransactionSource, - type TransactionMeta, -} from '../types'; +import { TransactionStatus, TransactionType } from '../types'; +import type { RemoteTransactionSource, TransactionMeta } from '../types'; import { getIncomingTransactionsPollingInterval } from '../utils/feature-flags'; jest.useFakeTimers(); diff --git a/packages/transaction-controller/src/helpers/ResimulateHelper.test.ts b/packages/transaction-controller/src/helpers/ResimulateHelper.test.ts index 9c372dd4264..b753bb48a22 100644 --- a/packages/transaction-controller/src/helpers/ResimulateHelper.test.ts +++ b/packages/transaction-controller/src/helpers/ResimulateHelper.test.ts @@ -3,7 +3,6 @@ import type { NetworkClientId } from '@metamask/network-controller'; import { BN } from 'bn.js'; import { - type ResimulateHelperOptions, ResimulateHelper, BLOCK_TIME_ADDITIONAL_SECONDS, BLOCKAID_RESULT_TYPE_MALICIOUS, @@ -13,6 +12,7 @@ import { VALUE_COMPARISON_PERCENT_THRESHOLD, RESIMULATE_INTERVAL_MS, } from './ResimulateHelper'; +import type { ResimulateHelperOptions } from './ResimulateHelper'; import { CHAIN_IDS } from '../constants'; import type { TransactionMeta, diff --git a/packages/transaction-controller/src/helpers/TransactionPoller.ts b/packages/transaction-controller/src/helpers/TransactionPoller.ts index a6f65f9b784..8c01b82b965 100644 --- a/packages/transaction-controller/src/helpers/TransactionPoller.ts +++ b/packages/transaction-controller/src/helpers/TransactionPoller.ts @@ -1,5 +1,6 @@ import type { BlockTracker } from '@metamask/network-controller'; -import { createModuleLogger, type Hex } from '@metamask/utils'; +import { createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { isEqual } from 'lodash'; import { projectLogger } from '../logger'; diff --git a/packages/transaction-controller/src/hooks/ExtraTransactionsPublishHook.ts b/packages/transaction-controller/src/hooks/ExtraTransactionsPublishHook.ts index aa78dc62fef..f58e904fe30 100644 --- a/packages/transaction-controller/src/hooks/ExtraTransactionsPublishHook.ts +++ b/packages/transaction-controller/src/hooks/ExtraTransactionsPublishHook.ts @@ -1,8 +1,5 @@ -import { - createDeferredPromise, - createModuleLogger, - type Hex, -} from '@metamask/utils'; +import { createDeferredPromise, createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import type { TransactionController } from '..'; import { projectLogger } from '../logger'; diff --git a/packages/transaction-controller/src/hooks/SequentialPublishBatchHook.ts b/packages/transaction-controller/src/hooks/SequentialPublishBatchHook.ts index bfdbb27d4d5..3e34ec6293b 100644 --- a/packages/transaction-controller/src/hooks/SequentialPublishBatchHook.ts +++ b/packages/transaction-controller/src/hooks/SequentialPublishBatchHook.ts @@ -5,11 +5,11 @@ import type { Hex } from '@metamask/utils'; import type { PendingTransactionTracker } from '../helpers/PendingTransactionTracker'; import { projectLogger } from '../logger'; -import { - type PublishBatchHook, - type PublishBatchHookRequest, - type PublishBatchHookResult, - type TransactionMeta, +import type { + PublishBatchHook, + PublishBatchHookRequest, + PublishBatchHookResult, + TransactionMeta, } from '../types'; const log = createModuleLogger(projectLogger, 'sequential-publish-batch-hook'); diff --git a/packages/transaction-controller/src/utils/balance-changes.test.ts b/packages/transaction-controller/src/utils/balance-changes.test.ts index ed507af2796..8ff10fcfd0c 100644 --- a/packages/transaction-controller/src/utils/balance-changes.test.ts +++ b/packages/transaction-controller/src/utils/balance-changes.test.ts @@ -2,18 +2,16 @@ import type { LogDescription } from '@ethersproject/abi'; import { Interface } from '@ethersproject/abi'; import { query } from '@metamask/controller-utils'; import type EthQuery from '@metamask/eth-query'; -import { type Hex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import type { GetBalanceChangesRequest } from './balance-changes'; import { getBalanceChanges, SupportedToken } from './balance-changes'; +import { simulateTransactions } from '../api/simulation-api'; import type { SimulationResponseLog, SimulationResponseTransaction, } from '../api/simulation-api'; -import { - simulateTransactions, - type SimulationResponse, -} from '../api/simulation-api'; +import type { SimulationResponse } from '../api/simulation-api'; import { SimulationInvalidResponseError, SimulationRevertedError, diff --git a/packages/transaction-controller/src/utils/balance-changes.ts b/packages/transaction-controller/src/utils/balance-changes.ts index a49404535a9..1b1d9fc238a 100644 --- a/packages/transaction-controller/src/utils/balance-changes.ts +++ b/packages/transaction-controller/src/utils/balance-changes.ts @@ -3,7 +3,8 @@ import { Interface } from '@ethersproject/abi'; import { hexToBN, toHex } from '@metamask/controller-utils'; import type EthQuery from '@metamask/eth-query'; import { abiERC20, abiERC721, abiERC1155 } from '@metamask/metamask-eth-abis'; -import { createModuleLogger, type Hex } from '@metamask/utils'; +import { createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import BN from 'bn.js'; import { getNativeBalance } from './balance'; diff --git a/packages/transaction-controller/src/utils/batch.test.ts b/packages/transaction-controller/src/utils/batch.test.ts index 48125f04141..24b7a96353c 100644 --- a/packages/transaction-controller/src/utils/batch.test.ts +++ b/packages/transaction-controller/src/utils/batch.test.ts @@ -1,4 +1,5 @@ -import { ORIGIN_METAMASK, type AddResult } from '@metamask/approval-controller'; +import { ORIGIN_METAMASK } from '@metamask/approval-controller'; +import type { AddResult } from '@metamask/approval-controller'; import { ApprovalType } from '@metamask/controller-utils'; import { rpcErrors, errorCodes } from '@metamask/rpc-errors'; import { cloneDeep } from 'lodash'; @@ -20,17 +21,19 @@ import { } from './feature-flags'; import { simulateGasBatch } from './gas'; import { validateBatchRequest } from './validation'; -import type { TransactionControllerState } from '..'; import { TransactionEnvelopeType, - type TransactionControllerMessenger, - type TransactionMeta, determineTransactionType, TransactionType, GasFeeEstimateLevel, GasFeeEstimateType, TransactionStatus, } from '..'; +import type { + TransactionControllerMessenger, + TransactionControllerState, + TransactionMeta, +} from '..'; import { flushPromises } from '../../../../tests/helpers'; import { DefaultGasFeeFlow } from '../gas-flows/DefaultGasFeeFlow'; import { SequentialPublishBatchHook } from '../hooks/SequentialPublishBatchHook'; diff --git a/packages/transaction-controller/src/utils/batch.ts b/packages/transaction-controller/src/utils/batch.ts index 047f2da6d6d..a1066eb5116 100644 --- a/packages/transaction-controller/src/utils/batch.ts +++ b/packages/transaction-controller/src/utils/batch.ts @@ -31,15 +31,18 @@ import { } from './feature-flags'; import { simulateGasBatch } from './gas'; import { validateBatchRequest } from './validation'; -import type { GetSimulationConfig, TransactionControllerState } from '..'; import { determineTransactionType, GasFeeEstimateLevel, TransactionStatus, - type BatchTransactionParams, - type TransactionController, - type TransactionControllerMessenger, - type TransactionMeta, +} from '..'; +import type { + BatchTransactionParams, + GetSimulationConfig, + TransactionController, + TransactionControllerMessenger, + TransactionControllerState, + TransactionMeta, } from '..'; import { DefaultGasFeeFlow } from '../gas-flows/DefaultGasFeeFlow'; import { updateTransactionGasEstimates } from '../helpers/GasFeePoller'; @@ -47,6 +50,7 @@ import type { PendingTransactionTracker } from '../helpers/PendingTransactionTra import { CollectPublishHook } from '../hooks/CollectPublishHook'; import { SequentialPublishBatchHook } from '../hooks/SequentialPublishBatchHook'; import { projectLogger } from '../logger'; +import { TransactionEnvelopeType, TransactionType } from '../types'; import type { NestedTransactionMetadata, SecurityAlertResponse, @@ -60,12 +64,7 @@ import type { IsAtomicBatchSupportedResultEntry, TransactionBatchMeta, } from '../types'; -import { - TransactionEnvelopeType, - type TransactionBatchResult, - type TransactionParams, - TransactionType, -} from '../types'; +import type { TransactionBatchResult, TransactionParams } from '../types'; type UpdateStateCallback = ( callback: ( diff --git a/packages/transaction-controller/src/utils/eip7702.test.ts b/packages/transaction-controller/src/utils/eip7702.test.ts index 069b31f3ebc..6b769d4b159 100644 --- a/packages/transaction-controller/src/utils/eip7702.test.ts +++ b/packages/transaction-controller/src/utils/eip7702.test.ts @@ -1,11 +1,10 @@ import { query } from '@metamask/controller-utils'; import type EthQuery from '@metamask/eth-query'; -import { - Messenger, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, - MOCK_ANY_NAMESPACE, +import { Messenger, MOCK_ANY_NAMESPACE } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import type { Hex } from '@metamask/utils'; import { remove0x } from '@metamask/utils'; @@ -24,8 +23,9 @@ import { } from './feature-flags'; import type { KeyringControllerSignEip7702AuthorizationAction } from '../../../keyring-controller/src'; import type { TransactionControllerMessenger } from '../TransactionController'; +import { TransactionStatus } from '../types'; import type { AuthorizationList } from '../types'; -import { TransactionStatus, type TransactionMeta } from '../types'; +import type { TransactionMeta } from '../types'; jest.mock('../utils/feature-flags'); diff --git a/packages/transaction-controller/src/utils/eip7702.ts b/packages/transaction-controller/src/utils/eip7702.ts index f6249b760bd..bc316826ff5 100644 --- a/packages/transaction-controller/src/utils/eip7702.ts +++ b/packages/transaction-controller/src/utils/eip7702.ts @@ -2,7 +2,8 @@ import { defaultAbiCoder } from '@ethersproject/abi'; import { Contract } from '@ethersproject/contracts'; import { query, toHex } from '@metamask/controller-utils'; import type EthQuery from '@metamask/eth-query'; -import { createModuleLogger, type Hex, add0x } from '@metamask/utils'; +import { createModuleLogger, add0x } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { getEIP7702ContractAddresses, diff --git a/packages/transaction-controller/src/utils/feature-flags.test.ts b/packages/transaction-controller/src/utils/feature-flags.test.ts index 1a28aa80b93..f3e4834ee49 100644 --- a/packages/transaction-controller/src/utils/feature-flags.test.ts +++ b/packages/transaction-controller/src/utils/feature-flags.test.ts @@ -1,9 +1,8 @@ -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import type { RemoteFeatureFlagControllerGetStateAction } from '@metamask/remote-feature-flag-controller'; import type { Hex } from '@metamask/utils'; diff --git a/packages/transaction-controller/src/utils/feature-flags.ts b/packages/transaction-controller/src/utils/feature-flags.ts index f529441c0b4..7e80e5f16b7 100644 --- a/packages/transaction-controller/src/utils/feature-flags.ts +++ b/packages/transaction-controller/src/utils/feature-flags.ts @@ -1,4 +1,5 @@ -import { createModuleLogger, type Hex } from '@metamask/utils'; +import { createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { isValidSignature } from './signature'; import { padHexToEvenLength } from './utils'; diff --git a/packages/transaction-controller/src/utils/first-time-interaction.ts b/packages/transaction-controller/src/utils/first-time-interaction.ts index 31453ed1db1..670b2d046fe 100644 --- a/packages/transaction-controller/src/utils/first-time-interaction.ts +++ b/packages/transaction-controller/src/utils/first-time-interaction.ts @@ -4,12 +4,11 @@ import { hexToNumber } from '@metamask/utils'; import { decodeTransactionData } from './transaction-type'; import { validateParamTo } from './validation'; -import { - getAccountAddressRelationship, - type GetAccountAddressRelationshipRequest, -} from '../api/accounts-api'; +import { getAccountAddressRelationship } from '../api/accounts-api'; +import type { GetAccountAddressRelationshipRequest } from '../api/accounts-api'; import { projectLogger as log } from '../logger'; -import { TransactionType, type TransactionMeta } from '../types'; +import { TransactionType } from '../types'; +import type { TransactionMeta } from '../types'; type UpdateFirstTimeInteractionRequest = { existingTransactions: TransactionMeta[]; diff --git a/packages/transaction-controller/src/utils/gas-fee-tokens.ts b/packages/transaction-controller/src/utils/gas-fee-tokens.ts index 7f41b301f7e..030c3fae5ce 100644 --- a/packages/transaction-controller/src/utils/gas-fee-tokens.ts +++ b/packages/transaction-controller/src/utils/gas-fee-tokens.ts @@ -12,11 +12,11 @@ import type { TransactionControllerMessenger, TransactionMeta, } from '..'; +import { simulateTransactions } from '../api/simulation-api'; import type { SimulationRequestTransaction } from '../api/simulation-api'; -import { - simulateTransactions, - type SimulationResponse, - type SimulationResponseTransaction, +import type { + SimulationResponse, + SimulationResponseTransaction, } from '../api/simulation-api'; import { projectLogger } from '../logger'; import type { GetSimulationConfig } from '../types'; diff --git a/packages/transaction-controller/src/utils/gas-flow.ts b/packages/transaction-controller/src/utils/gas-flow.ts index a641c74dc12..94e21e5e579 100644 --- a/packages/transaction-controller/src/utils/gas-flow.ts +++ b/packages/transaction-controller/src/utils/gas-flow.ts @@ -5,20 +5,19 @@ import type { GasFeeEstimates, LegacyGasPriceEstimate, } from '@metamask/gas-fee-controller'; -import { type GasFeeState } from '@metamask/gas-fee-controller'; +import type { GasFeeState } from '@metamask/gas-fee-controller'; import type { TransactionControllerMessenger } from '../TransactionController'; +import { GasFeeEstimateLevel, GasFeeEstimateType } from '../types'; import type { FeeMarketGasFeeEstimates, GasPriceGasFeeEstimates, LegacyGasFeeEstimates, } from '../types'; -import { - type GasFeeFlow, - type TransactionMeta, - type FeeMarketGasFeeEstimateForLevel, - GasFeeEstimateLevel, - GasFeeEstimateType, +import type { + GasFeeFlow, + TransactionMeta, + FeeMarketGasFeeEstimateForLevel, } from '../types'; type MergeGasFeeEstimatesRequest = { diff --git a/packages/transaction-controller/src/utils/gas.test.ts b/packages/transaction-controller/src/utils/gas.test.ts index 32c12598a2d..8e00b78d346 100644 --- a/packages/transaction-controller/src/utils/gas.test.ts +++ b/packages/transaction-controller/src/utils/gas.test.ts @@ -1,6 +1,7 @@ import { query } from '@metamask/controller-utils'; import type EthQuery from '@metamask/eth-query'; -import { remove0x, type Hex } from '@metamask/utils'; +import { remove0x } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { cloneDeep } from 'lodash'; import { DELEGATION_PREFIX } from './eip7702'; @@ -23,7 +24,8 @@ import type { } from '../api/simulation-api'; import { simulateTransactions } from '../api/simulation-api'; import type { TransactionControllerMessenger } from '../TransactionController'; -import { TransactionEnvelopeType, type TransactionMeta } from '../types'; +import { TransactionEnvelopeType } from '../types'; +import type { TransactionMeta } from '../types'; import type { AuthorizationList, TransactionBatchSingleRequest, diff --git a/packages/transaction-controller/src/utils/gas.ts b/packages/transaction-controller/src/utils/gas.ts index af7e346516e..7ce0078bbd5 100644 --- a/packages/transaction-controller/src/utils/gas.ts +++ b/packages/transaction-controller/src/utils/gas.ts @@ -15,14 +15,12 @@ import { getGasEstimateBuffer, getGasEstimateFallback } from './feature-flags'; import { simulateTransactions } from '../api/simulation-api'; import { projectLogger } from '../logger'; import type { TransactionControllerMessenger } from '../TransactionController'; +import { TransactionEnvelopeType } from '../types'; import type { GetSimulationConfig, TransactionBatchSingleRequest, -} from '../types'; -import { - TransactionEnvelopeType, - type TransactionMeta, - type TransactionParams, + TransactionMeta, + TransactionParams, } from '../types'; export type UpdateGasRequest = { diff --git a/packages/transaction-controller/src/utils/history.test.ts b/packages/transaction-controller/src/utils/history.test.ts index 96bee3f6315..02e96e91fd8 100644 --- a/packages/transaction-controller/src/utils/history.test.ts +++ b/packages/transaction-controller/src/utils/history.test.ts @@ -6,11 +6,11 @@ import { MAX_TRANSACTION_HISTORY_LENGTH, updateTransactionHistory, } from './history'; -import { - type TransactionHistory, - TransactionStatus, - type TransactionMeta, - type TransactionHistoryEntry, +import { TransactionStatus } from '../types'; +import type { + TransactionHistory, + TransactionMeta, + TransactionHistoryEntry, } from '../types'; describe('History', () => { diff --git a/packages/transaction-controller/src/utils/layer1-gas-fee-flow.test.ts b/packages/transaction-controller/src/utils/layer1-gas-fee-flow.test.ts index 4006c5ddaf0..f95ba2be458 100644 --- a/packages/transaction-controller/src/utils/layer1-gas-fee-flow.test.ts +++ b/packages/transaction-controller/src/utils/layer1-gas-fee-flow.test.ts @@ -3,11 +3,8 @@ import type { Hex } from '@metamask/utils'; import { updateTransactionLayer1GasFee } from './layer1-gas-fee-flow'; import type { TransactionControllerMessenger } from '../TransactionController'; -import { - TransactionStatus, - type Layer1GasFeeFlow, - type TransactionMeta, -} from '../types'; +import { TransactionStatus } from '../types'; +import type { Layer1GasFeeFlow, TransactionMeta } from '../types'; jest.mock('@metamask/controller-utils', () => ({ ...jest.requireActual('@metamask/controller-utils'), diff --git a/packages/transaction-controller/src/utils/layer1-gas-fee-flow.ts b/packages/transaction-controller/src/utils/layer1-gas-fee-flow.ts index 8919b1e7237..4f9336394c9 100644 --- a/packages/transaction-controller/src/utils/layer1-gas-fee-flow.ts +++ b/packages/transaction-controller/src/utils/layer1-gas-fee-flow.ts @@ -1,5 +1,6 @@ import type { Provider } from '@metamask/network-controller'; -import { createModuleLogger, type Hex } from '@metamask/utils'; +import { createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { projectLogger } from '../logger'; import type { TransactionControllerMessenger } from '../TransactionController'; diff --git a/packages/transaction-controller/src/utils/prepare.test.ts b/packages/transaction-controller/src/utils/prepare.test.ts index c9ef425d43f..fe38c6c04c1 100644 --- a/packages/transaction-controller/src/utils/prepare.test.ts +++ b/packages/transaction-controller/src/utils/prepare.test.ts @@ -5,8 +5,8 @@ import { } from '@ethereumjs/tx'; import { prepareTransaction, serializeTransaction } from './prepare'; -import type { Authorization } from '../types'; -import { TransactionEnvelopeType, type TransactionParams } from '../types'; +import { TransactionEnvelopeType } from '../types'; +import type { Authorization, TransactionParams } from '../types'; const CHAIN_ID_MOCK = '0x123'; diff --git a/packages/transaction-controller/src/utils/retry.ts b/packages/transaction-controller/src/utils/retry.ts index e19245ef2f6..9ab1e28aed3 100644 --- a/packages/transaction-controller/src/utils/retry.ts +++ b/packages/transaction-controller/src/utils/retry.ts @@ -2,8 +2,11 @@ import { convertHexToDecimal } from '@metamask/controller-utils'; import type { Hex } from '@metamask/utils'; import { add0x } from '@metamask/utils'; -import type { FeeMarketEIP1559Values, GasPriceValue } from '../types'; -import { type TransactionParams } from '../types'; +import type { + FeeMarketEIP1559Values, + GasPriceValue, + TransactionParams, +} from '../types'; /** * Returns new transaction parameters with increased gas fees. diff --git a/packages/transaction-controller/src/utils/swaps.test.ts b/packages/transaction-controller/src/utils/swaps.test.ts index 147d9e9174a..44b96d27921 100644 --- a/packages/transaction-controller/src/utils/swaps.test.ts +++ b/packages/transaction-controller/src/utils/swaps.test.ts @@ -1,10 +1,9 @@ import { query } from '@metamask/controller-utils'; -import { - MOCK_ANY_NAMESPACE, - Messenger, - type MockAnyNamespace, - type MessengerActions, - type MessengerEvents, +import { MOCK_ANY_NAMESPACE, Messenger } from '@metamask/messenger'; +import type { + MockAnyNamespace, + MessengerActions, + MessengerEvents, } from '@metamask/messenger'; import { diff --git a/packages/transaction-controller/src/utils/transaction-type.test.ts b/packages/transaction-controller/src/utils/transaction-type.test.ts index 01e1376e4b6..5a4524278a7 100644 --- a/packages/transaction-controller/src/utils/transaction-type.test.ts +++ b/packages/transaction-controller/src/utils/transaction-type.test.ts @@ -1,4 +1,5 @@ -import { Interface, type TransactionDescription } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { TransactionDescription } from '@ethersproject/abi'; import EthQuery from '@metamask/eth-query'; import { abiERC721, diff --git a/packages/transaction-controller/src/utils/transaction-type.ts b/packages/transaction-controller/src/utils/transaction-type.ts index 806d6afd9db..6144921381c 100644 --- a/packages/transaction-controller/src/utils/transaction-type.ts +++ b/packages/transaction-controller/src/utils/transaction-type.ts @@ -1,4 +1,5 @@ -import { Interface, type TransactionDescription } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { TransactionDescription } from '@ethersproject/abi'; import { query } from '@metamask/controller-utils'; import type EthQuery from '@metamask/eth-query'; import { diff --git a/packages/transaction-controller/src/utils/validation.ts b/packages/transaction-controller/src/utils/validation.ts index 444e33c493c..22228023db4 100644 --- a/packages/transaction-controller/src/utils/validation.ts +++ b/packages/transaction-controller/src/utils/validation.ts @@ -6,11 +6,11 @@ import type { Hex } from '@metamask/utils'; import { isStrictHexString, remove0x } from '@metamask/utils'; import { isEIP1559Transaction } from './utils'; -import type { Authorization, TransactionBatchRequest } from '../types'; -import { - TransactionEnvelopeType, - TransactionType, - type TransactionParams, +import { TransactionEnvelopeType, TransactionType } from '../types'; +import type { + Authorization, + TransactionBatchRequest, + TransactionParams, } from '../types'; export enum ErrorCode { diff --git a/packages/transaction-pay-controller/src/actions/update-payment-token.ts b/packages/transaction-pay-controller/src/actions/update-payment-token.ts index 80947911662..1355be22dce 100644 --- a/packages/transaction-pay-controller/src/actions/update-payment-token.ts +++ b/packages/transaction-pay-controller/src/actions/update-payment-token.ts @@ -1,4 +1,5 @@ -import { createModuleLogger, type Hex } from '@metamask/utils'; +import { createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { BigNumber } from 'bignumber.js'; import type { TransactionPayControllerMessenger } from '..'; diff --git a/packages/transaction-pay-controller/src/strategy/bridge/bridge-quotes.test.ts b/packages/transaction-pay-controller/src/strategy/bridge/bridge-quotes.test.ts index 873c7916c1b..779b84c1188 100644 --- a/packages/transaction-pay-controller/src/strategy/bridge/bridge-quotes.test.ts +++ b/packages/transaction-pay-controller/src/strategy/bridge/bridge-quotes.test.ts @@ -1,4 +1,5 @@ -import { FeatureId, type QuoteResponse } from '@metamask/bridge-controller'; +import { FeatureId } from '@metamask/bridge-controller'; +import type { QuoteResponse } from '@metamask/bridge-controller'; import type { TxData } from '@metamask/bridge-controller'; import { TransactionType } from '@metamask/transaction-controller'; import type { TransactionMeta } from '@metamask/transaction-controller'; @@ -16,7 +17,7 @@ import type { PayStrategyGetQuotesRequest, TransactionPayQuote, } from '../../types'; -import { type QuoteRequest } from '../../types'; +import type { QuoteRequest } from '../../types'; import { calculateGasCost, calculateTransactionGasCost } from '../../utils/gas'; import { getTokenFiatRate } from '../../utils/token'; diff --git a/packages/transaction-pay-controller/src/strategy/bridge/bridge-quotes.ts b/packages/transaction-pay-controller/src/strategy/bridge/bridge-quotes.ts index 3e6ee786581..93153a84f1f 100644 --- a/packages/transaction-pay-controller/src/strategy/bridge/bridge-quotes.ts +++ b/packages/transaction-pay-controller/src/strategy/bridge/bridge-quotes.ts @@ -1,7 +1,5 @@ -import { - FeatureId, - type GenericQuoteRequest, -} from '@metamask/bridge-controller'; +import { FeatureId } from '@metamask/bridge-controller'; +import type { GenericQuoteRequest } from '@metamask/bridge-controller'; import type { TxData } from '@metamask/bridge-controller'; import type { QuoteResponse } from '@metamask/bridge-controller'; import { toChecksumHexAddress, toHex } from '@metamask/controller-utils'; diff --git a/packages/transaction-pay-controller/src/strategy/relay/relay-submit.test.ts b/packages/transaction-pay-controller/src/strategy/relay/relay-submit.test.ts index c99d733982e..b9fb77220c3 100644 --- a/packages/transaction-pay-controller/src/strategy/relay/relay-submit.test.ts +++ b/packages/transaction-pay-controller/src/strategy/relay/relay-submit.test.ts @@ -3,10 +3,8 @@ import { successfulFetch, toHex, } from '@metamask/controller-utils'; -import { - TransactionType, - type TransactionMeta, -} from '@metamask/transaction-controller'; +import { TransactionType } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; import type { Hex } from '@metamask/utils'; import { cloneDeep } from 'lodash'; diff --git a/packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts b/packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts index b549bc79272..dd58badeb0c 100644 --- a/packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts +++ b/packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts @@ -3,10 +3,8 @@ import { successfulFetch, toHex, } from '@metamask/controller-utils'; -import { - TransactionType, - type TransactionParams, -} from '@metamask/transaction-controller'; +import { TransactionType } from '@metamask/transaction-controller'; +import type { TransactionParams } from '@metamask/transaction-controller'; import type { AuthorizationList, TransactionMeta, diff --git a/packages/transaction-pay-controller/src/tests/messenger-mock.ts b/packages/transaction-pay-controller/src/tests/messenger-mock.ts index 120ace8cec9..0edbc02a32d 100644 --- a/packages/transaction-pay-controller/src/tests/messenger-mock.ts +++ b/packages/transaction-pay-controller/src/tests/messenger-mock.ts @@ -26,7 +26,7 @@ import type { TransactionPayControllerGetDelegationTransactionAction, TransactionPayControllerGetStrategyAction, } from '../types'; -import { type TransactionPayControllerGetStateAction } from '../types'; +import type { TransactionPayControllerGetStateAction } from '../types'; type AllActions = MessengerActions; type AllEvents = MessengerEvents; diff --git a/packages/transaction-pay-controller/src/utils/quotes.test.ts b/packages/transaction-pay-controller/src/utils/quotes.test.ts index 9de6050952a..25ab8993e47 100644 --- a/packages/transaction-pay-controller/src/utils/quotes.test.ts +++ b/packages/transaction-pay-controller/src/utils/quotes.test.ts @@ -1,7 +1,5 @@ -import { - TransactionStatus, - type TransactionMeta, -} from '@metamask/transaction-controller'; +import { TransactionStatus } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; import type { BatchTransaction } from '@metamask/transaction-controller'; import type { Hex, Json } from '@metamask/utils'; import { cloneDeep } from 'lodash'; diff --git a/packages/transaction-pay-controller/src/utils/quotes.ts b/packages/transaction-pay-controller/src/utils/quotes.ts index f396ba94b6d..e27f9208c05 100644 --- a/packages/transaction-pay-controller/src/utils/quotes.ts +++ b/packages/transaction-pay-controller/src/utils/quotes.ts @@ -1,7 +1,5 @@ -import { - TransactionStatus, - type BatchTransaction, -} from '@metamask/transaction-controller'; +import { TransactionStatus } from '@metamask/transaction-controller'; +import type { BatchTransaction } from '@metamask/transaction-controller'; import type { TransactionMeta } from '@metamask/transaction-controller'; import type { Hex, Json } from '@metamask/utils'; import { createModuleLogger } from '@metamask/utils'; diff --git a/packages/transaction-pay-controller/src/utils/required-tokens.ts b/packages/transaction-pay-controller/src/utils/required-tokens.ts index 8f70fe74f02..aba7bcfb14f 100644 --- a/packages/transaction-pay-controller/src/utils/required-tokens.ts +++ b/packages/transaction-pay-controller/src/utils/required-tokens.ts @@ -2,7 +2,8 @@ import { Interface } from '@ethersproject/abi'; import { toHex } from '@metamask/controller-utils'; import { abiERC20 } from '@metamask/metamask-eth-abis'; import type { TransactionMeta } from '@metamask/transaction-controller'; -import { add0x, type Hex } from '@metamask/utils'; +import { add0x } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { BigNumber } from 'bignumber.js'; import { diff --git a/packages/transaction-pay-controller/src/utils/source-amounts.test.ts b/packages/transaction-pay-controller/src/utils/source-amounts.test.ts index 184e51cb2d1..f8af32058c3 100644 --- a/packages/transaction-pay-controller/src/utils/source-amounts.test.ts +++ b/packages/transaction-pay-controller/src/utils/source-amounts.test.ts @@ -1,7 +1,8 @@ import { updateSourceAmounts } from './source-amounts'; import { getTokenFiatRate } from './token'; import { getTransaction } from './transaction'; -import { TransactionPayStrategy, type TransactionPaymentToken } from '..'; +import { TransactionPayStrategy } from '..'; +import type { TransactionPaymentToken } from '..'; import { ARBITRUM_USDC_ADDRESS, CHAIN_ID_ARBITRUM } from '../constants'; import { getMessengerMock } from '../tests/messenger-mock'; import type { TransactionData, TransactionPayRequiredToken } from '../types'; diff --git a/packages/transaction-pay-controller/src/utils/totals.test.ts b/packages/transaction-pay-controller/src/utils/totals.test.ts index 8b7fc898c70..98c5891acde 100644 --- a/packages/transaction-pay-controller/src/utils/totals.test.ts +++ b/packages/transaction-pay-controller/src/utils/totals.test.ts @@ -2,10 +2,8 @@ import type { TransactionMeta } from '@metamask/transaction-controller'; import { calculateTransactionGasCost } from './gas'; import { calculateTotals } from './totals'; -import { - TransactionPayStrategy, - type TransactionPayControllerMessenger, -} from '..'; +import { TransactionPayStrategy } from '..'; +import type { TransactionPayControllerMessenger } from '..'; import type { QuoteRequest, TransactionPayQuote, diff --git a/packages/transaction-pay-controller/src/utils/transaction.test.ts b/packages/transaction-pay-controller/src/utils/transaction.test.ts index 156eebd6c9e..bd6f7ddb6ee 100644 --- a/packages/transaction-pay-controller/src/utils/transaction.test.ts +++ b/packages/transaction-pay-controller/src/utils/transaction.test.ts @@ -1,8 +1,8 @@ import { TransactionStatus, - type TransactionMeta, TransactionType, } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; import type { TransactionControllerState } from '@metamask/transaction-controller'; import type { Hex } from '@metamask/utils'; import { noop } from 'lodash'; diff --git a/packages/transaction-pay-controller/src/utils/transaction.ts b/packages/transaction-pay-controller/src/utils/transaction.ts index df21fc1fb0c..6ccf4609fb4 100644 --- a/packages/transaction-pay-controller/src/utils/transaction.ts +++ b/packages/transaction-pay-controller/src/utils/transaction.ts @@ -1,7 +1,5 @@ -import { - TransactionStatus, - type TransactionMeta, -} from '@metamask/transaction-controller'; +import { TransactionStatus } from '@metamask/transaction-controller'; +import type { TransactionMeta } from '@metamask/transaction-controller'; import type { Hex } from '@metamask/utils'; import { createModuleLogger } from '@metamask/utils'; import { cloneDeep } from 'lodash'; diff --git a/packages/user-operation-controller/src/UserOperationController.test.ts b/packages/user-operation-controller/src/UserOperationController.test.ts index 6f3c0e9e900..e176190e91d 100644 --- a/packages/user-operation-controller/src/UserOperationController.test.ts +++ b/packages/user-operation-controller/src/UserOperationController.test.ts @@ -4,21 +4,21 @@ import { errorCodes } from '@metamask/rpc-errors'; import { determineTransactionType, TransactionType, - type TransactionParams, } from '@metamask/transaction-controller'; +import type { TransactionParams } from '@metamask/transaction-controller'; import { EventEmitter } from 'stream'; import { ADDRESS_ZERO, EMPTY_BYTES, VALUE_ZERO } from './constants'; import * as BundlerHelper from './helpers/Bundler'; import * as PendingUserOperationTrackerHelper from './helpers/PendingUserOperationTracker'; import { SnapSmartContractAccount } from './helpers/SnapSmartContractAccount'; +import { UserOperationStatus } from './types'; import type { UserOperationMetadata } from './types'; -import { - UserOperationStatus, - type PrepareUserOperationResponse, - type SignUserOperationResponse, - type SmartContractAccount, - type UpdateUserOperationResponse, +import type { + PrepareUserOperationResponse, + SignUserOperationResponse, + SmartContractAccount, + UpdateUserOperationResponse, } from './types'; import type { AddUserOperationOptions, diff --git a/packages/user-operation-controller/src/UserOperationController.ts b/packages/user-operation-controller/src/UserOperationController.ts index af6c00fbd09..94701a0a984 100644 --- a/packages/user-operation-controller/src/UserOperationController.ts +++ b/packages/user-operation-controller/src/UserOperationController.ts @@ -3,10 +3,10 @@ import type { AddApprovalRequest, AddResult, } from '@metamask/approval-controller'; -import { - BaseController, - type ControllerGetStateAction, - type ControllerStateChangeEvent, +import { BaseController } from '@metamask/base-controller'; +import type { + ControllerGetStateAction, + ControllerStateChangeEvent, } from '@metamask/base-controller'; import { ApprovalType } from '@metamask/controller-utils'; import EthQuery from '@metamask/eth-query'; @@ -22,11 +22,11 @@ import type { Provider, } from '@metamask/network-controller'; import { errorCodes } from '@metamask/rpc-errors'; -import { - determineTransactionType, - type TransactionMeta, - type TransactionParams, - type TransactionType, +import { determineTransactionType } from '@metamask/transaction-controller'; +import type { + TransactionMeta, + TransactionParams, + TransactionType, } from '@metamask/transaction-controller'; import { add0x } from '@metamask/utils'; // This package purposefully relies on Node's EventEmitter module. diff --git a/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts b/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts index 379c616bd59..3141c2dd76d 100644 --- a/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts +++ b/packages/user-operation-controller/src/helpers/PendingUserOperationTracker.ts @@ -6,7 +6,8 @@ import type { Provider, } from '@metamask/network-controller'; import { BlockTrackerPollingControllerOnly } from '@metamask/polling-controller'; -import { createModuleLogger, type Hex } from '@metamask/utils'; +import { createModuleLogger } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; // This package purposefully relies on Node's EventEmitter module. // eslint-disable-next-line import-x/no-nodejs-modules import EventEmitter from 'events'; diff --git a/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts b/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts index e958ed1e33b..916e98959b0 100644 --- a/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts +++ b/packages/user-operation-controller/src/helpers/SnapSmartContractAccount.test.ts @@ -9,7 +9,7 @@ import type { UpdateUserOperationRequest, UpdateUserOperationResponse, } from '../types'; -import { type PrepareUserOperationRequest } from '../types'; +import type { PrepareUserOperationRequest } from '../types'; import type { UserOperationControllerMessenger } from '../UserOperationController'; import { toEip155ChainId } from '../utils/chain-id'; diff --git a/packages/user-operation-controller/src/utils/gas-fees.test.ts b/packages/user-operation-controller/src/utils/gas-fees.test.ts index 25cb1b1a0d2..794c98870e7 100644 --- a/packages/user-operation-controller/src/utils/gas-fees.test.ts +++ b/packages/user-operation-controller/src/utils/gas-fees.test.ts @@ -1,10 +1,8 @@ import { ORIGIN_METAMASK, query } from '@metamask/controller-utils'; import type { GasFeeState } from '@metamask/gas-fee-controller'; import { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller'; -import { - UserFeeLevel, - type TransactionParams, -} from '@metamask/transaction-controller'; +import { UserFeeLevel } from '@metamask/transaction-controller'; +import type { TransactionParams } from '@metamask/transaction-controller'; import { cloneDeep } from 'lodash'; import type { UpdateGasFeesRequest } from './gas-fees'; diff --git a/packages/user-operation-controller/src/utils/gas-fees.ts b/packages/user-operation-controller/src/utils/gas-fees.ts index 424b73e13ab..45ebaaaa274 100644 --- a/packages/user-operation-controller/src/utils/gas-fees.ts +++ b/packages/user-operation-controller/src/utils/gas-fees.ts @@ -5,10 +5,8 @@ import { toHex, } from '@metamask/controller-utils'; import EthQuery from '@metamask/eth-query'; -import { - GAS_ESTIMATE_TYPES, - type GasFeeState, -} from '@metamask/gas-fee-controller'; +import { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller'; +import type { GasFeeState } from '@metamask/gas-fee-controller'; import type { Provider } from '@metamask/network-controller'; import type { TransactionParams } from '@metamask/transaction-controller'; import { UserFeeLevel } from '@metamask/transaction-controller'; diff --git a/packages/user-operation-controller/src/utils/transaction.test.ts b/packages/user-operation-controller/src/utils/transaction.test.ts index 50b7e6b146d..24ca1e9c3aa 100644 --- a/packages/user-operation-controller/src/utils/transaction.test.ts +++ b/packages/user-operation-controller/src/utils/transaction.test.ts @@ -6,8 +6,9 @@ import { UserFeeLevel, } from '../../../transaction-controller/src'; import { EMPTY_BYTES, VALUE_ZERO } from '../constants'; +import { UserOperationStatus } from '../types'; import type { UserOperation } from '../types'; -import { UserOperationStatus, type UserOperationMetadata } from '../types'; +import type { UserOperationMetadata } from '../types'; const USER_OPERATION_METADATA_MOCK: UserOperationMetadata = { id: 'testUserOperationId', diff --git a/tests/fake-provider.ts b/tests/fake-provider.ts index 3c1eecd0a5f..64116d4cbad 100644 --- a/tests/fake-provider.ts +++ b/tests/fake-provider.ts @@ -1,9 +1,9 @@ import { InternalProvider } from '@metamask/eth-json-rpc-provider'; -import { - JsonRpcEngineV2, - type JsonRpcMiddleware, - type MiddlewareContext, - type ResultConstraint, +import { JsonRpcEngineV2 } from '@metamask/json-rpc-engine/v2'; +import type { + JsonRpcMiddleware, + MiddlewareContext, + ResultConstraint, } from '@metamask/json-rpc-engine/v2'; import type { Provider } from '@metamask/network-controller'; import type { diff --git a/yarn.lock b/yarn.lock index 1dc2cf8942b..cd9c3d0e0f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3039,10 +3039,10 @@ __metadata: "@lavamoat/allow-scripts": "npm:^3.0.4" "@lavamoat/preinstall-always-fail": "npm:^2.1.0" "@metamask/create-release-branch": "npm:^4.1.3" - "@metamask/eslint-config": "npm:^14.1.0" - "@metamask/eslint-config-jest": "npm:^14.1.0" - "@metamask/eslint-config-nodejs": "npm:^14.0.0" - "@metamask/eslint-config-typescript": "npm:^14.1.0" + "@metamask/eslint-config": "npm:^15.0.0" + "@metamask/eslint-config-jest": "npm:^15.0.0" + "@metamask/eslint-config-nodejs": "npm:^15.0.0" + "@metamask/eslint-config-typescript": "npm:^15.0.0" "@metamask/eth-block-tracker": "npm:^15.0.0" "@metamask/eth-json-rpc-provider": "npm:^6.0.0" "@metamask/json-rpc-engine": "npm:^10.2.0" @@ -3287,54 +3287,54 @@ __metadata: languageName: unknown linkType: soft -"@metamask/eslint-config-jest@npm:^14.1.0": - version: 14.1.0 - resolution: "@metamask/eslint-config-jest@npm:14.1.0" +"@metamask/eslint-config-jest@npm:^15.0.0": + version: 15.0.0 + resolution: "@metamask/eslint-config-jest@npm:15.0.0" dependencies: "@eslint/js": "npm:^9.11.0" globals: "npm:^15.9.0" peerDependencies: - "@metamask/eslint-config": ^14.1.0 + "@metamask/eslint-config": ^15.0.0 eslint: ^9.11.0 eslint-plugin-jest: ^28.8.3 - checksum: 10/2c5bd99fb4470206b47360566f1681c93ed2254080297e2fa34392eb5ae64470138e2f67171a09bb6051e6a4a69eaf430f68b82ef8886604b368cc4129c80462 + checksum: 10/4728c6b80bed48b9e369ed538de2a1f099a74825f08e7a1c0c5df53901905ce6d54fb7c77da4454ed640af7fd873845ab0f084a4f370fe26ccb4455e683e6bba languageName: node linkType: hard -"@metamask/eslint-config-nodejs@npm:^14.0.0": - version: 14.0.0 - resolution: "@metamask/eslint-config-nodejs@npm:14.0.0" +"@metamask/eslint-config-nodejs@npm:^15.0.0": + version: 15.0.0 + resolution: "@metamask/eslint-config-nodejs@npm:15.0.0" dependencies: "@eslint/js": "npm:^9.11.0" globals: "npm:^15.9.0" peerDependencies: - "@metamask/eslint-config": ^14.0.0 + "@metamask/eslint-config": ^15.0.0 eslint: ^9.11.0 eslint-plugin-n: ^17.10.3 - checksum: 10/62a69e0a258b6b0ef8cbb844a3420115ff213648f55e1b3863dd29fa5892de8013f8157317e8279f68b7e82c69c97edc15c0040ad49469756393a711d91b0fff + checksum: 10/541a2df5a21e3e73abd8b5b175fd2c3604bfa8694d7e8e7e48891f01d38396267f1cf92cb88cb181ddd7931dee3c7bf39de59d2cb1f30971a245551d575674a1 languageName: node linkType: hard -"@metamask/eslint-config-typescript@npm:^14.1.0": - version: 14.1.0 - resolution: "@metamask/eslint-config-typescript@npm:14.1.0" +"@metamask/eslint-config-typescript@npm:^15.0.0": + version: 15.0.0 + resolution: "@metamask/eslint-config-typescript@npm:15.0.0" dependencies: "@eslint/js": "npm:^9.11.0" peerDependencies: - "@metamask/eslint-config": ^14.1.0 + "@metamask/eslint-config": ^15.0.0 eslint: ^9.11.0 eslint-import-resolver-typescript: ^3.6.3 eslint-plugin-import-x: ^4.3.0 eslint-plugin-jsdoc: ^50.2.4 - typescript: ">=4.8.4 <5.9.0" - typescript-eslint: ^8.24 - checksum: 10/697b61648969f5f53179b8cf83ffb1aa1dbe5ce9ad4f7f4ed0bc4e436c510f1d28543e764467fd880ccb2579b5810e78eee63f972daa55f1b599844b53ea13ca + typescript: ">=4.8.4 <6" + typescript-eslint: ^8.39.0 + checksum: 10/5ff44e8970a67f87da92a65b8478d22374713ca94feb671ba462b87441ae8b47e427857b363b79b50e6078856c0f482c3965de7f2ee38fe0b40f8f4e27891540 languageName: node linkType: hard -"@metamask/eslint-config@npm:^14.1.0": - version: 14.1.0 - resolution: "@metamask/eslint-config@npm:14.1.0" +"@metamask/eslint-config@npm:^15.0.0": + version: 15.0.0 + resolution: "@metamask/eslint-config@npm:15.0.0" dependencies: "@eslint/js": "npm:^9.11.0" globals: "npm:^15.9.0" @@ -3346,7 +3346,7 @@ __metadata: eslint-plugin-prettier: ^5.2.1 eslint-plugin-promise: ^7.1.0 prettier: ^3.3.3 - checksum: 10/c6313391ea09130ae7254356069c8c28621d8dac668278291cba4436e95d4d5b8a43e11d7ce98ade96b2e4c7706171eba9c966ce7ba439fe888576bb32930b06 + checksum: 10/93eb41bd61f3f4a0cf930a3d83e8893455f4f03339e91b21ef5a2835d24532db7c2916138a3e1b64777b5fb95cbe4ac90107697ac6f962c11ea7a99955cc75e4 languageName: node linkType: hard