Skip to content

Commit

Permalink
Merge branch 'MMPD-1522-add-fetch-trending-token-data' of github.com:…
Browse files Browse the repository at this point in the history
…MetaMask/core into MMPD-1522-add-fetch-trending-token-data
  • Loading branch information
Bigshmow committed Jan 30, 2025
2 parents 40c37e2 + 682f2c7 commit 0972117
Show file tree
Hide file tree
Showing 31 changed files with 576 additions and 225 deletions.
2 changes: 1 addition & 1 deletion eslint-warning-thresholds.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"n/no-unsupported-features/node-builtins": 4,
"n/prefer-global/text-encoder": 4,
"n/prefer-global/text-decoder": 4,
"prettier/prettier": 116,
"prettier/prettier": 114,
"promise/always-return": 3,
"promise/catch-or-return": 2,
"promise/param-names": 8,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/core-monorepo",
"version": "289.0.0",
"version": "290.0.0",
"private": true,
"description": "Monorepo for packages shared between MetaMask clients",
"repository": {
Expand Down
17 changes: 16 additions & 1 deletion packages/accounts-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [22.0.0]

### Added

- Add `AccountsController:account{AssetList,Balances,Transactions}Updated` events ([#5190](https://github.com/MetaMask/core/pull/5190))
- Those events are being sent from Account Snaps (through the Snap keyring) and are being re-published by the `AccountController`.

### Changed

- **BREAKING:** Now requires `SnapKeyring:account{AssetList,Balances,Transactions}Updated` events to be registered on the messenger ([#5190](https://github.com/MetaMask/core/pull/5190))
- Bump `@metamask/keyring-api` from `^14.0.0` to `^16.1.0` ([#5190](https://github.com/MetaMask/core/pull/5190)), ([#5208](https://github.com/MetaMask/core/pull/5208))
- Bump `@metamask/keyring-internal-api` from `^2.0.1` to `^4.0.1` ([#5190](https://github.com/MetaMask/core/pull/5190)), ([#5208](https://github.com/MetaMask/core/pull/5208))
- Bump `@metamask/eth-snap-keyring` from `^8.1.1` to `^9.1.1` ([#5190](https://github.com/MetaMask/core/pull/5190)), ([#5208](https://github.com/MetaMask/core/pull/5208))

## [21.0.2]

### Changed
Expand Down Expand Up @@ -402,7 +416,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release ([#1637](https://github.com/MetaMask/core/pull/1637))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[22.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[21.0.2]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[21.0.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[21.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
14 changes: 7 additions & 7 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/accounts-controller",
"version": "21.0.2",
"version": "22.0.0",
"description": "Manages internal accounts",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -49,11 +49,11 @@
"dependencies": {
"@ethereumjs/util": "^8.1.0",
"@metamask/base-controller": "^7.1.1",
"@metamask/eth-snap-keyring": "^9.0.0",
"@metamask/keyring-api": "^15.0.0",
"@metamask/keyring-internal-api": "^3.0.0",
"@metamask/snaps-sdk": "^6.7.0",
"@metamask/snaps-utils": "^8.3.0",
"@metamask/eth-snap-keyring": "^9.1.1",
"@metamask/keyring-api": "^16.1.0",
"@metamask/keyring-internal-api": "^4.0.1",
"@metamask/snaps-sdk": "^6.16.0",
"@metamask/snaps-utils": "^8.9.0",
"@metamask/utils": "^11.0.1",
"deepmerge": "^4.2.2",
"ethereum-cryptography": "^2.1.2",
Expand All @@ -62,7 +62,7 @@
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-controller": "^19.0.4",
"@metamask/keyring-controller": "^19.0.5",
"@metamask/providers": "^18.1.1",
"@metamask/snaps-controllers": "^9.10.0",
"@types/jest": "^27.4.1",
Expand Down
20 changes: 10 additions & 10 deletions packages/accounts-controller/src/AccountsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
EthAccountType,
BtcMethod,
EthMethod,
EthScopes,
BtcScopes,
EthScope,
BtcScope,
} from '@metamask/keyring-api';
import { KeyringTypes } from '@metamask/keyring-controller';
import type {
Expand Down Expand Up @@ -73,7 +73,7 @@ const mockAccount: InternalAccount = {
options: {},
methods: [...ETH_EOA_METHODS],
type: EthAccountType.Eoa,
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
metadata: {
name: 'Account 1',
keyring: { type: KeyringTypes.hd },
Expand All @@ -89,7 +89,7 @@ const mockAccount2: InternalAccount = {
options: {},
methods: [...ETH_EOA_METHODS],
type: EthAccountType.Eoa,
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
metadata: {
name: 'Account 2',
keyring: { type: KeyringTypes.hd },
Expand All @@ -104,7 +104,7 @@ const mockAccount3: InternalAccount = {
options: {},
methods: [...ETH_EOA_METHODS],
type: EthAccountType.Eoa,
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
metadata: {
name: '',
keyring: { type: KeyringTypes.snap },
Expand All @@ -124,7 +124,7 @@ const mockAccount4: InternalAccount = {
options: {},
methods: [...ETH_EOA_METHODS],
type: EthAccountType.Eoa,
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
metadata: {
name: 'Custom Name',
keyring: { type: KeyringTypes.snap },
Expand Down Expand Up @@ -213,19 +213,19 @@ function createExpectedInternalAccount({
}): InternalAccount {
const accountTypeToInfo: Record<
string,
{ methods: string[]; scopes: string[] }
{ methods: string[]; scopes: CaipChainId[] }
> = {
[`${EthAccountType.Eoa}`]: {
methods: [...Object.values(ETH_EOA_METHODS)],
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
},
[`${EthAccountType.Erc4337}`]: {
methods: [...Object.values(ETH_ERC_4337_METHODS)],
scopes: [EthScopes.Mainnet], // Assuming we are using mainnet for those Smart Accounts
scopes: [EthScope.Mainnet], // Assuming we are using mainnet for those Smart Accounts
},
[`${BtcAccountType.P2wpkh}`]: {
methods: [...Object.values(BtcMethod)],
scopes: [BtcScopes.Mainnet],
scopes: [BtcScope.Mainnet],
},
};

Expand Down
8 changes: 4 additions & 4 deletions packages/accounts-controller/src/AccountsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { SnapKeyring } from '@metamask/eth-snap-keyring';
import {
EthAccountType,
EthMethod,
EthScopes,
EthScope,
isEvmAccountType,
} from '@metamask/keyring-api';
import { KeyringTypes } from '@metamask/keyring-controller';
Expand Down Expand Up @@ -233,7 +233,7 @@ export const EMPTY_ACCOUNT = {
options: {},
methods: [],
type: EthAccountType.Eoa,
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
metadata: {
name: '',
keyring: {
Expand Down Expand Up @@ -640,7 +640,7 @@ export class AccountsController extends BaseController<
EthMethod.SignTypedDataV3,
EthMethod.SignTypedDataV4,
],
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
type: EthAccountType.Eoa,
metadata: {
name: '',
Expand Down Expand Up @@ -715,7 +715,7 @@ export class AccountsController extends BaseController<
EthMethod.SignTypedDataV3,
EthMethod.SignTypedDataV4,
],
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
type: EthAccountType.Eoa,
metadata: {
name: this.#populateExistingMetadata(id, 'name') ?? '',
Expand Down
11 changes: 10 additions & 1 deletion packages/assets-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [47.0.0]

### Added

- Add `onBreak` and `onDegraded` methods to `CodefiTokenPricesServiceV2` ([#5109](https://github.com/MetaMask/core/pull/5109))
- These serve the same purpose as the `onBreak` and `onDegraded` constructor options, but align more closely with the Cockatiel policy API.

### Changed

- **BREAKING:** Bump `@metamask/accounts-controller` peer dependency from `^21.0.0` to `^22.0.0` ([#5218](https://github.com/MetaMask/core/pull/5218))
- Deprecate `ClientConfigApiService` constructor options `onBreak` and `onDegraded` in favor of methods ([#5109](https://github.com/MetaMask/core/pull/5109))
- Add `@metamask/controller-utils@^11.4.5` as a dependency ([#5109](https://github.com/MetaMask/core/pull/5109))
- `cockatiel` should still be in the dependency tree because it's now a dependency of `@metamask/controller-utils`
- Re-introduce `@metamask/keyring-api` as a runtime dependency ([#5206](https://github.com/MetaMask/core/pull/5206))
- This was required since the introduction of the `MultichainBalancesController`.
- Bump `@metamask/keyring-api` from `^14.0.0` to `^16.1.0` ([#5190](https://github.com/MetaMask/core/pull/5190)), ([#5208](https://github.com/MetaMask/core/pull/5208))
- Bump `@metamask/keyring-internal-api` from `^2.0.1` to `^4.0.1` ([#5190](https://github.com/MetaMask/core/pull/5190)), ([#5208](https://github.com/MetaMask/core/pull/5208))
- Bump `@metamask/keyring-snap-client` from `^3.0.0` to `^3.0.3` ([#5190](https://github.com/MetaMask/core/pull/5190)), ([#5208](https://github.com/MetaMask/core/pull/5208))

## [46.0.1]

Expand Down Expand Up @@ -1349,7 +1357,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[47.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[46.0.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[46.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[45.1.2]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
18 changes: 9 additions & 9 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/assets-controllers",
"version": "46.0.1",
"version": "47.0.0",
"description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -58,11 +58,11 @@
"@metamask/contract-metadata": "^2.4.0",
"@metamask/controller-utils": "^11.4.5",
"@metamask/eth-query": "^4.0.0",
"@metamask/keyring-api": "^15.0.0",
"@metamask/keyring-api": "^16.1.0",
"@metamask/metamask-eth-abis": "^3.1.1",
"@metamask/polling-controller": "^12.0.2",
"@metamask/rpc-errors": "^7.0.2",
"@metamask/snaps-utils": "^8.3.0",
"@metamask/snaps-utils": "^8.9.0",
"@metamask/utils": "^11.0.1",
"@types/bn.js": "^5.1.5",
"@types/uuid": "^8.3.0",
Expand All @@ -77,18 +77,18 @@
},
"devDependencies": {
"@babel/runtime": "^7.23.9",
"@metamask/accounts-controller": "^21.0.2",
"@metamask/accounts-controller": "^22.0.0",
"@metamask/approval-controller": "^7.1.2",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/ethjs-provider-http": "^0.3.0",
"@metamask/keyring-controller": "^19.0.4",
"@metamask/keyring-internal-api": "^3.0.0",
"@metamask/keyring-snap-client": "^3.0.1",
"@metamask/keyring-controller": "^19.0.5",
"@metamask/keyring-internal-api": "^4.0.1",
"@metamask/keyring-snap-client": "^3.0.3",
"@metamask/network-controller": "^22.1.1",
"@metamask/preferences-controller": "^15.0.1",
"@metamask/providers": "^18.1.1",
"@metamask/snaps-controllers": "^9.10.0",
"@metamask/snaps-sdk": "^6.7.0",
"@metamask/snaps-sdk": "^6.16.0",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.191",
"@types/node": "^16.18.54",
Expand All @@ -104,7 +104,7 @@
"webextension-polyfill": "^0.12.0"
},
"peerDependencies": {
"@metamask/accounts-controller": "^21.0.0",
"@metamask/accounts-controller": "^22.0.0",
"@metamask/approval-controller": "^7.0.0",
"@metamask/keyring-controller": "^19.0.0",
"@metamask/network-controller": "^22.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
BtcMethod,
EthAccountType,
EthMethod,
BtcScopes,
EthScopes,
SolScopes,
BtcScope,
EthScope,
SolScope,
} from '@metamask/keyring-api';
import { KeyringTypes } from '@metamask/keyring-controller';
import type { InternalAccount } from '@metamask/keyring-internal-api';
Expand Down Expand Up @@ -43,7 +43,7 @@ const mockBtcAccount = {
},
lastSelected: 0,
},
scopes: [BtcScopes.Namespace],
scopes: [BtcScope.Testnet],
options: {},
methods: [BtcMethod.SendBitcoin],
type: BtcAccountType.P2wpkh,
Expand All @@ -65,7 +65,7 @@ const mockEthAccount = {
},
lastSelected: 0,
},
scopes: [EthScopes.Namespace],
scopes: [EthScope.Eoa],
options: {},
methods: [EthMethod.SignTypedDataV4, EthMethod.SignTransaction],
type: EthAccountType.Eoa,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
SolAccountType,
BtcMethod,
SolMethod,
BtcScopes,
SolScopes,
BtcScope,
SolScope,
} from '@metamask/keyring-api';
import { KeyringTypes } from '@metamask/keyring-controller';
import { validate, Network } from 'bitcoin-address-validation';
Expand Down Expand Up @@ -34,7 +34,7 @@ const mockBtcAccount = {
},
lastSelected: 0,
},
scopes: [BtcScopes.Namespace],
scopes: [BtcScope.Testnet],
options: {},
methods: [BtcMethod.SendBitcoin],
type: BtcAccountType.P2wpkh,
Expand All @@ -59,7 +59,7 @@ const mockSolAccount = {
options: {
scope: 'solana-scope',
},
scopes: [SolScopes.Namespace],
scopes: [SolScope.Testnet],
methods: [SolMethod.SendAndConfirmTransaction],
type: SolAccountType.DataAccount,
};
Expand Down
9 changes: 8 additions & 1 deletion packages/keyring-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]

## [19.0.5]

### Changed

- Bump `@metamask/keyring-api` from `^14.0.0` to `^16.1.0` ([#5190](https://github.com/MetaMask/core/pull/5190)), ([#5208](https://github.com/MetaMask/core/pull/5208))

## [19.0.4]

### Changed
Expand Down Expand Up @@ -640,7 +646,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

All changes listed after this point were applied to this package following the monorepo conversion.

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[19.0.5]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[19.0.4]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[19.0.3]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[19.0.2]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions packages/keyring-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/keyring-controller",
"version": "19.0.4",
"version": "19.0.5",
"description": "Stores identities seen in the wallet and manages interactions such as signing",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -54,8 +54,8 @@
"@metamask/eth-hd-keyring": "^7.0.4",
"@metamask/eth-sig-util": "^8.0.0",
"@metamask/eth-simple-keyring": "^6.0.5",
"@metamask/keyring-api": "^15.0.0",
"@metamask/keyring-internal-api": "^3.0.0",
"@metamask/keyring-api": "^16.1.0",
"@metamask/keyring-internal-api": "^4.0.1",
"@metamask/message-manager": "^12.0.0",
"@metamask/utils": "^11.0.1",
"async-mutex": "^0.5.0",
Expand Down
Loading

0 comments on commit 0972117

Please sign in to comment.