⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1139,11 +1139,6 @@
"count": 7
}
},
"packages/multichain-account-service/src/tests/providers.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 1
}
},
"packages/multichain-account-service/src/utils.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 1
Expand Down
4 changes: 2 additions & 2 deletions packages/account-tree-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"@metamask/account-api": "^0.12.0",
"@metamask/account-api": "^1.0.0",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-api": "^21.0.0",
"@metamask/keyring-api": "^21.5.0",
"@metamask/providers": "^22.1.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.5.2",
Expand Down
3 changes: 3 additions & 0 deletions packages/accounts-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Bump `@metamask/eth-snap-keyring` from `^18.0.0` to `^19.0.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/keyring-api` from `^21.0.0` to `^21.5.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/keyring-internal-api` from `^9.0.0` to `^10.0.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/keyring-controller` from `^25.0.0` to `^25.1.0` ([#7713](https://github.com/MetaMask/core/pull/7713))

### Removed
Expand Down
6 changes: 3 additions & 3 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"dependencies": {
"@ethereumjs/util": "^9.1.0",
"@metamask/base-controller": "^9.0.0",
"@metamask/eth-snap-keyring": "^18.0.0",
"@metamask/keyring-api": "^21.0.0",
"@metamask/eth-snap-keyring": "^19.0.0",
"@metamask/keyring-api": "^21.5.0",
"@metamask/keyring-controller": "^25.1.0",
"@metamask/keyring-internal-api": "^9.0.0",
"@metamask/keyring-internal-api": "^10.0.0",
"@metamask/keyring-utils": "^3.1.0",
"@metamask/messenger": "^0.3.0",
"@metamask/network-controller": "^29.0.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/assets-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Bump `@metamask/keyring-api` from `^21.0.0` to `^21.5.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/keyring-internal-api` from `^9.0.0` to `^10.0.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/keyring-snap-client` from `^8.0.0` to `^8.2.0` ([#7857](https://github.com/MetaMask/core/pull/7857))

## [1.0.0]

### Added
Expand Down
6 changes: 3 additions & 3 deletions packages/assets-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"@metamask/base-controller": "^9.0.0",
"@metamask/controller-utils": "^11.18.0",
"@metamask/core-backend": "^5.1.0",
"@metamask/keyring-api": "^21.0.0",
"@metamask/keyring-api": "^21.5.0",
"@metamask/keyring-controller": "^25.1.0",
"@metamask/keyring-internal-api": "^9.0.0",
"@metamask/keyring-snap-client": "^8.0.0",
"@metamask/keyring-internal-api": "^10.0.0",
"@metamask/keyring-snap-client": "^8.2.0",
"@metamask/messenger": "^0.3.0",
"@metamask/network-controller": "^29.0.0",
"@metamask/network-enablement-controller": "^4.1.0",
Expand Down
1 change: 1 addition & 0 deletions packages/assets-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Bump `@metamask/keyring-api` from `^21.0.0` to `^21.5.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/account-tree-controller` from `^4.0.0` to `^4.1.0` ([#7869](https://github.com/MetaMask/core/pull/7869))
- Bump `@metamask/multichain-account-service` from `^5.1.0` to `^6.0.0` ([#7869](https://github.com/MetaMask/core/pull/7869))
- Bump `@metamask/transaction-controller` from `^62.15.0` to `^62.16.0` ([#7872](https://github.com/MetaMask/core/pull/7872))
Expand Down
8 changes: 4 additions & 4 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@metamask/controller-utils": "^11.18.0",
"@metamask/core-backend": "5.0.0",
"@metamask/eth-query": "^4.0.0",
"@metamask/keyring-api": "^21.0.0",
"@metamask/keyring-api": "^21.5.0",
"@metamask/keyring-controller": "^25.1.0",
"@metamask/messenger": "^0.3.0",
"@metamask/metamask-eth-abis": "^3.1.1",
Expand Down Expand Up @@ -96,11 +96,11 @@
},
"devDependencies": {
"@babel/runtime": "^7.23.9",
"@metamask/account-api": "^0.12.0",
"@metamask/account-api": "^1.0.0",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/ethjs-provider-http": "^0.3.0",
"@metamask/keyring-internal-api": "^9.0.0",
"@metamask/keyring-snap-client": "^8.0.0",
"@metamask/keyring-internal-api": "^10.0.0",
"@metamask/keyring-snap-client": "^8.2.0",
"@metamask/providers": "^22.1.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.5.2",
Expand Down
1 change: 1 addition & 0 deletions packages/bridge-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Bump `@metamask/keyring-api` from `^21.0.0` to `^21.5.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/transaction-controller` from `^62.15.0` to `^62.16.0` ([#7872](https://github.com/MetaMask/core/pull/7872))

## [66.0.0]
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@metamask/base-controller": "^9.0.0",
"@metamask/controller-utils": "^11.18.0",
"@metamask/gas-fee-controller": "^26.0.2",
"@metamask/keyring-api": "^21.0.0",
"@metamask/keyring-api": "^21.5.0",
"@metamask/messenger": "^0.3.0",
"@metamask/metamask-eth-abis": "^3.1.1",
"@metamask/multichain-network-controller": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/chain-agnostic-permission/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-internal-api": "^9.0.0",
"@metamask/keyring-internal-api": "^10.0.0",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.5.2",
"deepmerge": "^4.2.2",
Expand Down
1 change: 1 addition & 0 deletions packages/earn-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Bump `@metamask/keyring-api` from `^21.0.0` to `^21.5.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/account-tree-controller` from `^4.0.0` to `^4.1.0` ([#7869](https://github.com/MetaMask/core/pull/7869))

## [11.1.0]
Expand Down
2 changes: 1 addition & 1 deletion packages/earn-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@metamask/account-tree-controller": "^4.1.0",
"@metamask/base-controller": "^9.0.0",
"@metamask/controller-utils": "^11.18.0",
"@metamask/keyring-api": "^21.0.0",
"@metamask/keyring-api": "^21.5.0",
"@metamask/messenger": "^0.3.0",
"@metamask/network-controller": "^29.0.0",
"@metamask/stake-sdk": "^3.2.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/keyring-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Bump `@metamask/keyring-api` from `^21.0.0` to `^21.5.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/keyring-internal-api` from `^9.0.0` to `^10.0.0` ([#7857](https://github.com/MetaMask/core/pull/7857))

## [25.1.0]

### Added
Expand Down
4 changes: 2 additions & 2 deletions packages/keyring-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"@metamask/eth-hd-keyring": "^13.0.0",
"@metamask/eth-sig-util": "^8.2.0",
"@metamask/eth-simple-keyring": "^11.0.0",
"@metamask/keyring-api": "^21.0.0",
"@metamask/keyring-internal-api": "^9.0.0",
"@metamask/keyring-api": "^21.5.0",
"@metamask/keyring-internal-api": "^10.0.0",
"@metamask/messenger": "^0.3.0",
"@metamask/utils": "^11.9.0",
"async-mutex": "^0.5.0",
Expand Down
12 changes: 12 additions & 0 deletions packages/multichain-account-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- **BREAKING:** Bump peer dependency `@metamask/account-api` from `^0.12.0` to `^1.0.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- **BREAKING:** Bump `@metamask/eth-snap-keyring` from `^18.0.0` to `^19.0.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Required to invoke `createAccounts` on any account management Snaps.
- **BREAKING:** Use new `AccountProvider.createAccounts` method with `CreateAccountOptions` ([#7857](https://github.com/MetaMask/core/pull/7857))
- All account providers now accept `CreateAccountOptions` with `type` field.
- Added `capabilities` property to all account providers defining supported account creation types.
- Bump `@metamask/keyring-api` from `^21.0.0` to `^21.5.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/keyring-internal-api` from `^9.0.0` to `^10.0.0` ([#7857](https://github.com/MetaMask/core/pull/7857))
- Bump `@metamask/keyring-snap-client` from `^8.0.0` to `^8.2.0` ([#7857](https://github.com/MetaMask/core/pull/7857))

## [6.0.0]

### Changed
Expand Down
12 changes: 6 additions & 6 deletions packages/multichain-account-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
"@ethereumjs/util": "^9.1.0",
"@metamask/accounts-controller": "^35.0.2",
"@metamask/base-controller": "^9.0.0",
"@metamask/eth-snap-keyring": "^18.0.0",
"@metamask/eth-snap-keyring": "^19.0.0",
"@metamask/key-tree": "^10.1.1",
"@metamask/keyring-api": "^21.0.0",
"@metamask/keyring-api": "^21.5.0",
"@metamask/keyring-controller": "^25.1.0",
"@metamask/keyring-internal-api": "^9.0.0",
"@metamask/keyring-snap-client": "^8.0.0",
"@metamask/keyring-internal-api": "^10.0.0",
"@metamask/keyring-snap-client": "^8.2.0",
"@metamask/keyring-utils": "^3.1.0",
"@metamask/messenger": "^0.3.0",
"@metamask/snaps-controllers": "^17.2.0",
Expand All @@ -68,7 +68,7 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"@metamask/account-api": "^0.12.0",
"@metamask/account-api": "^1.0.0",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/eth-hd-keyring": "^13.0.0",
"@metamask/providers": "^22.1.0",
Expand All @@ -85,7 +85,7 @@
"webextension-polyfill": "^0.12.0"
},
"peerDependencies": {
"@metamask/account-api": "^0.12.0",
"@metamask/account-api": "^1.0.0",
"@metamask/providers": "^22.0.0",
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
toMultichainAccountGroupId,
toMultichainAccountWalletId,
} from '@metamask/account-api';
import { EthScope, SolScope } from '@metamask/keyring-api';
import { AccountCreationType, EthScope, SolScope } from '@metamask/keyring-api';
import type { InternalAccount } from '@metamask/keyring-internal-api';

import type { GroupState } from './MultichainAccountGroup';
Expand Down Expand Up @@ -195,10 +195,12 @@ describe('MultichainAccount', () => {
await group.alignAccounts();

expect(providers[0].createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: wallet.entropySource,
groupIndex,
});
expect(providers[1].createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: wallet.entropySource,
groupIndex,
});
Expand All @@ -225,6 +227,7 @@ describe('MultichainAccount', () => {
await group.alignAccounts();

expect(providers[1].createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: wallet.entropySource,
groupIndex,
});
Expand Down Expand Up @@ -252,10 +255,12 @@ describe('MultichainAccount', () => {
await group.alignAccounts();

expect(providers[1].createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: wallet.entropySource,
groupIndex,
});
expect(providers[2].createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: wallet.entropySource,
groupIndex,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
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 type {
CreateAccountOptions,
KeyringAccount,
} from '@metamask/keyring-api';
import {
AccountCreationType,
EthAccountType,
SolAccountType,
} from '@metamask/keyring-api';
import type { KeyringObject } from '@metamask/keyring-controller';
import type { EthKeyring } from '@metamask/keyring-internal-api';

Expand Down Expand Up @@ -599,10 +606,12 @@ describe('MultichainAccountService', () => {
await service.alignWallets();

expect(mocks.EvmAccountProvider.createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: MOCK_HD_KEYRING_2.metadata.id,
groupIndex: 0,
});
expect(mocks.SolAccountProvider.createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: MOCK_HD_KEYRING_1.metadata.id,
groupIndex: 0,
});
Expand All @@ -626,6 +635,7 @@ describe('MultichainAccountService', () => {
await service.alignWallet(MOCK_HD_KEYRING_1.metadata.id);

expect(mocks.SolAccountProvider.createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: MOCK_HD_KEYRING_1.metadata.id,
groupIndex: 0,
});
Expand Down Expand Up @@ -760,6 +770,7 @@ describe('MultichainAccountService', () => {
);

expect(mocks.SolAccountProvider.createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: MOCK_HD_KEYRING_1.metadata.id,
groupIndex: 0,
});
Expand All @@ -781,10 +792,12 @@ describe('MultichainAccountService', () => {
await messenger.call('MultichainAccountService:alignWallets');

expect(mocks.EvmAccountProvider.createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: MOCK_HD_KEYRING_2.metadata.id,
groupIndex: 0,
});
expect(mocks.SolAccountProvider.createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: MOCK_HD_KEYRING_1.metadata.id,
groupIndex: 0,
});
Expand Down Expand Up @@ -949,7 +962,7 @@ describe('MultichainAccountService', () => {
});
});

describe('AccountProviderWrapper disabled behavior', () => {
describe('AccountProviderWrapper', () => {
let wrapper: AccountProviderWrapper;
let solProvider: SolAccountProvider;

Expand Down Expand Up @@ -977,6 +990,10 @@ describe('MultichainAccountService', () => {
);
});

it('forwards capabilities from adapted provider', async () => {
expect(wrapper.capabilities).toStrictEqual(solProvider.capabilities);
});

it('forwards resyncAccounts() if provider is enabled', async () => {
const spy = jest.spyOn(solProvider, 'resyncAccounts');

Expand Down Expand Up @@ -1016,7 +1033,8 @@ describe('MultichainAccountService', () => {
});

it('returns empty array when createAccounts() is disabled', async () => {
const options = {
const options: CreateAccountOptions = {
type: AccountCreationType.Bip44DeriveIndex,
entropySource: MOCK_HD_ACCOUNT_1.options.entropy.id,
groupIndex: 0,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
EthAccountType,
SolAccountType,
KeyringAccountEntropyTypeOption,
AccountCreationType,
} from '@metamask/keyring-api';
import type { InternalAccount } from '@metamask/keyring-internal-api';

Expand Down Expand Up @@ -415,6 +416,7 @@ describe('MultichainAccountWallet', () => {

// Sol provider is missing group 1; should be called to create it.
expect(providers[1].createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: wallet.entropySource,
groupIndex: 1,
});
Expand Down Expand Up @@ -457,11 +459,13 @@ describe('MultichainAccountWallet', () => {

// Sol provider is missing group 0; should be called to create it.
expect(providers[1].createAccounts).toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: wallet.entropySource,
groupIndex: 0,
});

expect(providers[1].createAccounts).not.toHaveBeenCalledWith({
type: AccountCreationType.Bip44DeriveIndex,
entropySource: wallet.entropySource,
groupIndex: 1,
});
Expand Down
Loading
Loading