Skip to content

Commit

Permalink
Merge branch 'main' into salim/remove-text-for-empty-transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
salimtb authored Dec 18, 2024
2 parents d8eeb19 + c4429bc commit b63c951
Show file tree
Hide file tree
Showing 56 changed files with 306 additions and 326 deletions.
2 changes: 1 addition & 1 deletion app/scripts/controllers/account-tracker-controller.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EventEmitter from 'events';
import { ControllerMessenger } from '@metamask/base-controller';
import { InternalAccount } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import { BlockTracker, Provider } from '@metamask/network-controller';

import { flushPromises } from '../../../test/lib/timer-helpers';
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/account-tracker-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
AccountsControllerSelectedEvmAccountChangeEvent,
} from '@metamask/accounts-controller';
import { KeyringControllerAccountRemovedEvent } from '@metamask/keyring-controller';
import { InternalAccount } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';

import { LOCALHOST_RPC_URL } from '../../../shared/constants/network';
import { SINGLE_CALL_BALANCES_ADDRESSES } from '../constants/contracts';
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/metametrics-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Token,
TokensControllerState,
} from '@metamask/assets-controllers';
import { InternalAccount } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import { Browser } from 'webextension-polyfill';
import { ControllerMessenger } from '@metamask/base-controller';
import { merge } from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/mmi-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import {
OriginalRequest,
SignatureController,
} from '@metamask/signature-controller';
import { InternalAccount } from '@metamask/keyring-api';
import { toHex } from '@metamask/controller-utils';
import { InternalAccount } from '@metamask/keyring-internal-api';
import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils';
// TODO: Remove restricted import
// eslint-disable-next-line import/no-restricted-paths
Expand Down
6 changes: 3 additions & 3 deletions app/scripts/controllers/permissions/specifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const CaveatFactories = Object.freeze({
* PermissionController.
*
* @param {{
* getInternalAccounts: () => Record<string, import('@metamask/keyring-api').InternalAccount>,
* getInternalAccounts: () => Record<string, import('@metamask/keyring-internal-api').InternalAccount>,
* }} options - Options bag.
*/
export const getCaveatSpecifications = ({
Expand Down Expand Up @@ -96,7 +96,7 @@ export const getCaveatSpecifications = ({
*
* @param {{
* getAllAccounts: () => Promise<string[]>,
* getInternalAccounts: () => Record<string, import('@metamask/keyring-api').InternalAccount>,
* getInternalAccounts: () => Record<string, import('@metamask/keyring-internal-api').InternalAccount>,
* }} options - Options bag.
* @param options.getAllAccounts - A function that returns all Ethereum accounts
* in the current MetaMask instance.
Expand Down Expand Up @@ -254,7 +254,7 @@ export const getPermissionSpecifications = ({
* corresponds to a PreferencesController identity.
*
* @param {string[]} accounts - The accounts associated with the caveat.
* @param {() => Record<string, import('@metamask/keyring-api').InternalAccount>} getInternalAccounts -
* @param {() => Record<string, import('@metamask/keyring-internal-api').InternalAccount>} getInternalAccounts -
* Gets all AccountsController InternalAccounts.
*/
function validateCaveatAccounts(accounts, getInternalAccounts) {
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/lib/AccountIdentitiesPetnamesBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
NameType,
NameOrigin,
} from '@metamask/name-controller';
import { InternalAccount } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import {
AccountsControllerChangeEvent,
AccountsControllerListAccountsAction,
Expand Down
8 changes: 2 additions & 6 deletions app/scripts/lib/accounts/BalancesController.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { ControllerMessenger } from '@metamask/base-controller';
import {
Balance,
BtcAccountType,
CaipAssetType,
InternalAccount,
} from '@metamask/keyring-api';
import { Balance, BtcAccountType, CaipAssetType } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import { createMockInternalAccount } from '../../../../test/jest/mocks';
import { MultichainNetworks } from '../../../../shared/constants/multichain/networks';
import {
Expand Down
8 changes: 4 additions & 4 deletions app/scripts/lib/accounts/BalancesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
} from '@metamask/base-controller';
import {
BtcAccountType,
KeyringClient,
SolAccountType,
isEvmAccountType,
type Balance,
type CaipAssetType,
type InternalAccount,
isEvmAccountType,
SolAccountType,
} from '@metamask/keyring-api';
import { type InternalAccount } from '@metamask/keyring-internal-api';
import { KeyringClient } from '@metamask/keyring-snap-client';
import type { HandleSnapRequest } from '@metamask/snaps-controllers';
import type { SnapId } from '@metamask/snaps-sdk';
import { HandlerType } from '@metamask/snaps-utils';
Expand Down
3 changes: 2 additions & 1 deletion app/scripts/lib/snap-keyring/snap-keyring.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ControllerMessenger } from '@metamask/base-controller';
import { EthAccountType, InternalAccount } from '@metamask/keyring-api';
import { EthAccountType } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import { SNAP_MANAGE_ACCOUNTS_CONFIRMATION_TYPES } from '../../../../shared/constants/app';
import {
MetaMetricsEventCategory,
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/lib/transaction/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InternalAccount } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import { TransactionParams } from '@metamask/eth-json-rpc-middleware';
import {
TransactionController,
Expand Down
3 changes: 2 additions & 1 deletion app/scripts/lib/transaction/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EthAccountType, InternalAccount } from '@metamask/keyring-api';
import { EthAccountType } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import {
TransactionController,
TransactionMeta,
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/migrations/105.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { v4 as uuid } from 'uuid';
import { sha256FromString } from 'ethereumjs-util';
import { InternalAccount } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods';
import { migrate } from './105';

Expand Down
3 changes: 2 additions & 1 deletion app/scripts/migrations/105.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EthAccountType, InternalAccount } from '@metamask/keyring-api';
import { EthAccountType } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';
import { sha256FromString } from 'ethereumjs-util';
import { v4 as uuid } from 'uuid';
import { cloneDeep } from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/migrations/119.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cloneDeep, isObject } from 'lodash';
import { hasProperty } from '@metamask/utils';
import { AccountsControllerState } from '@metamask/accounts-controller';
import { InternalAccount } from '@metamask/keyring-api';
import { InternalAccount } from '@metamask/keyring-internal-api';

type VersionedData = {
meta: { version: number };
Expand Down
96 changes: 42 additions & 54 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@
"packages": {
"@ethereumjs/tx": true,
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true,
"@metamask/eth-snap-keyring>@metamask/keyring-internal-snap-client": true,
"@metamask/eth-snap-keyring>@metamask/utils": true,
"@metamask/eth-snap-keyring>uuid": true,
"@metamask/keyring-api": true,
Expand All @@ -1069,6 +1070,11 @@
"browserify>buffer": true
}
},
"@metamask/eth-snap-keyring>@metamask/keyring-internal-snap-client": {
"packages": {
"@metamask/keyring-snap-client": true
}
},
"@metamask/eth-snap-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand Down Expand Up @@ -1434,17 +1440,23 @@
}
},
"@metamask/keyring-api": {
"packages": {
"@metamask/keyring-api>@metamask/keyring-utils": true,
"@metamask/keyring-api>@metamask/utils": true,
"@metamask/keyring-api>bech32": true,
"@metamask/utils>@metamask/superstruct": true
}
},
"@metamask/keyring-api>@metamask/keyring-utils": {
"globals": {
"URL": true
},
"packages": {
"@metamask/keyring-api>@metamask/utils": true,
"@metamask/keyring-api>bech32": true,
"@metamask/keyring-api>uuid": true,
"@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true,
"@metamask/utils>@metamask/superstruct": true
}
},
"@metamask/keyring-api>@metamask/utils": {
"@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
Expand All @@ -1459,9 +1471,19 @@
"semver": true
}
},
"@metamask/keyring-api>uuid": {
"@metamask/keyring-api>@metamask/utils": {
"globals": {
"crypto": true
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/keyring-controller": {
Expand Down Expand Up @@ -1556,30 +1578,6 @@
"semver": true
}
},
"@metamask/keyring-controller>@metamask/keyring-api>@metamask/keyring-utils": {
"globals": {
"URL": true
},
"packages": {
"@metamask/keyring-controller>@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true,
"@metamask/utils>@metamask/superstruct": true
}
},
"@metamask/keyring-controller>@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/keyring-controller>ethereumjs-wallet": {
"packages": {
"@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true,
Expand Down Expand Up @@ -1624,6 +1622,19 @@
"browserify>buffer": true
}
},
"@metamask/keyring-snap-client": {
"packages": {
"@metamask/keyring-api": true,
"@metamask/keyring-api>@metamask/keyring-utils": true,
"@metamask/keyring-snap-client>uuid": true,
"@metamask/utils>@metamask/superstruct": true
}
},
"@metamask/keyring-snap-client>uuid": {
"globals": {
"crypto": true
}
},
"@metamask/logging-controller": {
"packages": {
"@metamask/base-controller": true,
Expand Down Expand Up @@ -2127,39 +2138,16 @@
},
"packages": {
"@metamask/base-controller": true,
"@metamask/keyring-api": true,
"@metamask/keyring-controller": true,
"@metamask/network-controller": true,
"@metamask/profile-sync-controller>@metamask/keyring-api": true,
"@metamask/profile-sync-controller>@noble/ciphers": true,
"@metamask/profile-sync-controller>siwe": true,
"@noble/hashes": true,
"browserify>buffer": true,
"loglevel": true
}
},
"@metamask/profile-sync-controller>@metamask/keyring-api": {
"packages": {
"@metamask/keyring-api>bech32": true,
"@metamask/keyring-controller>@metamask/keyring-api>@metamask/keyring-utils": true,
"@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": true,
"@metamask/utils>@metamask/superstruct": true
}
},
"@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": {
"globals": {
"TextDecoder": true,
"TextEncoder": true
},
"packages": {
"@metamask/utils>@metamask/superstruct": true,
"@metamask/utils>@scure/base": true,
"@metamask/utils>pony-cause": true,
"@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true
}
},
"@metamask/profile-sync-controller>@noble/ciphers": {
"globals": {
"TextDecoder": true,
Expand Down
Loading

0 comments on commit b63c951

Please sign in to comment.