Skip to content

Commit 96db928

Browse files
authored
Merge branch 'main' into 240610-upgrade-AssetsContractController
2 parents b758d93 + 83957e2 commit 96db928

File tree

18 files changed

+333
-87
lines changed

18 files changed

+333
-87
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/core-monorepo",
3-
"version": "174.0.0",
3+
"version": "176.0.0",
44
"private": true,
55
"description": "Monorepo for packages shared between MetaMask clients",
66
"repository": {

packages/accounts-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@metamask/base-controller": "^6.0.1",
4646
"@metamask/eth-snap-keyring": "^4.3.1",
4747
"@metamask/keyring-api": "^8.0.0",
48-
"@metamask/keyring-controller": "^17.1.0",
48+
"@metamask/keyring-controller": "^17.1.1",
4949
"@metamask/snaps-sdk": "^4.2.0",
5050
"@metamask/snaps-utils": "^7.4.0",
5151
"@metamask/utils": "^9.0.0",

packages/assets-controllers/CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [36.0.0]
11+
12+
### Added
13+
14+
- Add optional `topBid` property to the `NftMetadata` type. This property must be of type `TopBid`. ([#4522](https://github.com/MetaMask/core/pull/4522))
15+
- Add optional `floorAsk` property to the `TokenCollection` type. This property must be of type `FloorAskCollection`. ([#4522](https://github.com/MetaMask/core/pull/4522))
16+
- Add linea mainnet support to nft detection supported networks ([#4515](https://github.com/MetaMask/core/pull/4515))
17+
- The `Collection` type is expanded to include the following 'string'-type optional properties: `contractDeployedAt`, `creator`, `ownerCount`, and an optional property `topBid` of the type `TopBid & { sourceDomain?: string; }`. ([#4443](https://github.com/MetaMask/core/pull/4443))
18+
19+
### Changed
20+
21+
- Fetch NFT collections data from the NFT-API `Get Collections` endpoint when calling the `detectNfts` method of `NftDetectionController`, and the `updateNftMetadata` and `watchNft` methods of `NftController`. ([#4443](https://github.com/MetaMask/core/pull/4443))
22+
- Bump `@metamask/utils` to `^9.0.0` ([#4516](https://github.com/MetaMask/core/pull/4516))
23+
- Bump `@metamask/rpc-errors` to `^6.3.1` ([#4516](https://github.com/MetaMask/core/pull/4516))
24+
25+
### Fixed
26+
27+
- **BREAKING:** The `attributes` property of the `NftMetadata` type must be of type `Attributes[]` ([#4522](https://github.com/MetaMask/core/pull/4522))
28+
- The `attributes` property was added and typed as `Attributes` on `v28.0.0`.
29+
1030
## [35.0.0]
1131

1232
### Changed
@@ -993,7 +1013,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9931013
9941014
- Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))
9951015
996-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
1016+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
1017+
[36.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
9971018
[35.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
9981019
[34.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
9991020
[33.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]

packages/assets-controllers/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/assets-controllers",
3-
"version": "35.0.0",
3+
"version": "36.0.0",
44
"description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
55
"keywords": [
66
"MetaMask",
@@ -53,7 +53,7 @@
5353
"@metamask/contract-metadata": "^2.4.0",
5454
"@metamask/controller-utils": "^11.0.1",
5555
"@metamask/eth-query": "^4.0.0",
56-
"@metamask/keyring-controller": "^17.1.0",
56+
"@metamask/keyring-controller": "^17.1.1",
5757
"@metamask/metamask-eth-abis": "^3.1.1",
5858
"@metamask/network-controller": "^20.0.0",
5959
"@metamask/polling-controller": "^9.0.0",

packages/keyring-controller/CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [17.1.1]
11+
12+
### Changed
13+
14+
- Bump `@metamask/utils` to `^9.0.0`, `@metamask/rpc-errors` to `^6.3.1` ([#4516](https://github.com/MetaMask/core/pull/4516))
15+
16+
### Fixed
17+
18+
- Clear encryption salt and key in `setLocked` and `#createNewVaultWithKeyring` to ensure that encryption key is always generated with the latest password ([#4514](https://github.com/MetaMask/core/pull/4514))
19+
1020
## [17.1.0]
1121

1222
### Added
@@ -497,7 +507,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
497507

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

500-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
510+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
511+
[17.1.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
501512
[17.1.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
502513
[17.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
503514
[16.1.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]

packages/keyring-controller/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/keyring-controller",
3-
"version": "17.1.0",
3+
"version": "17.1.1",
44
"description": "Stores identities seen in the wallet and manages interactions such as signing",
55
"keywords": [
66
"MetaMask",
@@ -49,7 +49,7 @@
4949
"@metamask/eth-sig-util": "^7.0.1",
5050
"@metamask/eth-simple-keyring": "^6.0.1",
5151
"@metamask/keyring-api": "^8.0.0",
52-
"@metamask/message-manager": "^10.0.0",
52+
"@metamask/message-manager": "^10.0.1",
5353
"@metamask/utils": "^9.0.0",
5454
"async-mutex": "^0.5.0",
5555
"ethereumjs-wallet": "^1.0.1",

packages/message-manager/CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [10.0.1]
11+
12+
### Changed
13+
14+
- Bump `@metamask/utils` to `^9.0.0`, `@metamask/rpc-errors` to `^6.3.1` ([#4516](https://github.com/MetaMask/core/pull/4516))
15+
16+
### Fixed
17+
18+
- Add `EventEmitter` type annotation to the `hub` class field of `AbstractMessageManager` ([#4510](https://github.com/MetaMask/core/pull/4510))
19+
- This ensures that `hub` is not inferred to be a generic type, which would break types for downstream consumers.
20+
1021
## [10.0.0]
1122

1223
### Changed
@@ -255,7 +266,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
255266

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

258-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
269+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
270+
[10.0.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
259271
[10.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
260272
[9.0.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
261273
[8.0.2]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]

packages/message-manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/message-manager",
3-
"version": "10.0.0",
3+
"version": "10.0.1",
44
"description": "Stores and manages interactions with signing requests",
55
"keywords": [
66
"MetaMask",

packages/notification-services-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@contentful/rich-text-html-renderer": "^16.5.2",
4545
"@metamask/base-controller": "^6.0.1",
4646
"@metamask/controller-utils": "^11.0.1",
47-
"@metamask/keyring-controller": "^17.1.0",
47+
"@metamask/keyring-controller": "^17.1.1",
4848
"@metamask/profile-sync-controller": "^0.1.3",
4949
"bignumber.js": "^4.1.0",
5050
"contentful": "^10.3.6",

packages/phishing-controller/src/PhishingController.test.ts

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
type PhishingControllerActions,
1313
type PhishingControllerOptions,
1414
} from './PhishingController';
15+
import { formatHostnameToUrl } from './tests/utils';
1516

1617
const controllerName = 'PhishingController';
1718

@@ -218,14 +219,18 @@ describe('PhishingController', () => {
218219
expect(controller.isStalelistOutOfDate()).toBe(false);
219220
await controller.maybeUpdateState();
220221
expect(
221-
controller.test('this-should-not-be-in-default-blocklist.com'),
222+
controller.test(
223+
formatHostnameToUrl('this-should-not-be-in-default-blocklist.com'),
224+
),
222225
).toMatchObject({
223226
result: false,
224227
type: 'all',
225228
});
226229

227230
expect(
228-
controller.test('this-should-not-be-in-default-allowlist.com'),
231+
controller.test(
232+
formatHostnameToUrl('this-should-not-be-in-default-allowlist.com'),
233+
),
229234
).toMatchObject({
230235
result: false,
231236
type: 'all',
@@ -235,14 +240,18 @@ describe('PhishingController', () => {
235240
await controller.maybeUpdateState();
236241

237242
expect(
238-
controller.test('this-should-not-be-in-default-blocklist.com'),
243+
controller.test(
244+
formatHostnameToUrl('this-should-not-be-in-default-blocklist.com'),
245+
),
239246
).toMatchObject({
240247
result: true,
241248
type: 'blocklist',
242249
});
243250

244251
expect(
245-
controller.test('this-should-not-be-in-default-allowlist.com'),
252+
controller.test(
253+
formatHostnameToUrl('this-should-not-be-in-default-allowlist.com'),
254+
),
246255
).toMatchObject({
247256
result: false,
248257
type: 'allowlist',
@@ -479,7 +488,7 @@ describe('PhishingController', () => {
479488
.reply(200, { data: [] });
480489
const controller = getPhishingController();
481490
await controller.updateStalelist();
482-
expect(controller.test('metamask.io')).toMatchObject({
491+
expect(controller.test(formatHostnameToUrl('metamask.io'))).toMatchObject({
483492
result: false,
484493
type: 'allowlist',
485494
name: ListNames.MetaMask,
@@ -513,7 +522,7 @@ describe('PhishingController', () => {
513522

514523
const controller = getPhishingController();
515524
await controller.updateStalelist();
516-
expect(controller.test('i❤.ws')).toMatchObject({
525+
expect(controller.test(formatHostnameToUrl('i❤.ws'))).toMatchObject({
517526
result: false,
518527
type: 'all',
519528
});
@@ -546,7 +555,7 @@ describe('PhishingController', () => {
546555

547556
const controller = getPhishingController();
548557
await controller.updateStalelist();
549-
expect(controller.test('xn--i-7iq.ws')).toMatchObject({
558+
expect(controller.test(formatHostnameToUrl('xn--i-7iq.ws'))).toMatchObject({
550559
result: false,
551560
type: 'all',
552561
});
@@ -579,7 +588,7 @@ describe('PhishingController', () => {
579588

580589
const controller = getPhishingController();
581590
await controller.updateStalelist();
582-
expect(controller.test('etnerscan.io')).toMatchObject({
591+
expect(controller.test(formatHostnameToUrl('etnerscan.io'))).toMatchObject({
583592
result: true,
584593
type: 'blocklist',
585594
name: ListNames.MetaMask,
@@ -612,7 +621,9 @@ describe('PhishingController', () => {
612621
.reply(200, { data: [] });
613622
const controller = getPhishingController();
614623
await controller.updateStalelist();
615-
expect(controller.test('myetherẉalletṭ.com')).toMatchObject({
624+
expect(
625+
controller.test(formatHostnameToUrl('myetherẉalletṭ.com')),
626+
).toMatchObject({
616627
result: true,
617628
type: 'blocklist',
618629
name: ListNames.MetaMask,
@@ -646,7 +657,9 @@ describe('PhishingController', () => {
646657

647658
const controller = getPhishingController();
648659
await controller.updateStalelist();
649-
expect(controller.test('xn--myetherallet-4k5fwn.com')).toMatchObject({
660+
expect(
661+
controller.test(formatHostnameToUrl('xn--myetherallet-4k5fwn.com')),
662+
).toMatchObject({
650663
result: true,
651664
type: 'blocklist',
652665
name: ListNames.MetaMask,
@@ -689,7 +702,9 @@ describe('PhishingController', () => {
689702
const controller = getPhishingController();
690703
await controller.updateStalelist();
691704
expect(
692-
controller.test('e4d600ab9141b7a9859511c77e63b9b3.com'),
705+
controller.test(
706+
formatHostnameToUrl('e4d600ab9141b7a9859511c77e63b9b3.com'),
707+
),
693708
).toMatchObject({
694709
result: true,
695710
type: 'blocklist',
@@ -725,7 +740,9 @@ describe('PhishingController', () => {
725740
const controller = getPhishingController();
726741
await controller.updateStalelist();
727742
expect(
728-
controller.test('e4d600ab9141b7a9859511c77e63b9b3.com'),
743+
controller.test(
744+
formatHostnameToUrl('e4d600ab9141b7a9859511c77e63b9b3.com'),
745+
),
729746
).toMatchObject({
730747
result: false,
731748
type: 'all',
@@ -758,7 +775,7 @@ describe('PhishingController', () => {
758775
.reply(200, { data: [] });
759776
const controller = getPhishingController();
760777
await controller.updateStalelist();
761-
expect(controller.test('opensea.io')).toMatchObject({
778+
expect(controller.test(formatHostnameToUrl('opensea.io'))).toMatchObject({
762779
result: false,
763780
type: 'allowlist',
764781
name: ListNames.MetaMask,
@@ -791,7 +808,7 @@ describe('PhishingController', () => {
791808
.reply(200, { data: [] });
792809
const controller = getPhishingController();
793810
await controller.updateStalelist();
794-
expect(controller.test('ohpensea.io')).toMatchObject({
811+
expect(controller.test(formatHostnameToUrl('ohpensea.io'))).toMatchObject({
795812
result: true,
796813
type: 'fuzzy',
797814
name: ListNames.MetaMask,
@@ -825,7 +842,9 @@ describe('PhishingController', () => {
825842
const controller = getPhishingController();
826843
await controller.updateStalelist();
827844
expect(
828-
controller.test('this-is-the-official-website-of-opensea.io'),
845+
controller.test(
846+
formatHostnameToUrl('this-is-the-official-website-of-opensea.io'),
847+
),
829848
).toMatchObject({
830849
result: false,
831850
type: 'all',
@@ -860,12 +879,12 @@ describe('PhishingController', () => {
860879
await controller.updateStalelist();
861880
const unsafeDomain = 'electrum.mx';
862881
assert.equal(
863-
controller.test(unsafeDomain).result,
882+
controller.test(formatHostnameToUrl(unsafeDomain)).result,
864883
true,
865884
'Example unsafe domain seems to be safe',
866885
);
867-
controller.bypass(unsafeDomain);
868-
expect(controller.test(unsafeDomain)).toMatchObject({
886+
controller.bypass(formatHostnameToUrl(unsafeDomain));
887+
expect(controller.test(formatHostnameToUrl(unsafeDomain))).toMatchObject({
869888
result: false,
870889
type: 'all',
871890
});
@@ -899,13 +918,13 @@ describe('PhishingController', () => {
899918
await controller.updateStalelist();
900919
const unsafeDomain = 'electrum.mx';
901920
assert.equal(
902-
controller.test(unsafeDomain).result,
921+
controller.test(formatHostnameToUrl(unsafeDomain)).result,
903922
true,
904923
'Example unsafe domain seems to be safe',
905924
);
906-
controller.bypass(unsafeDomain);
907-
controller.bypass(unsafeDomain);
908-
expect(controller.test(unsafeDomain)).toMatchObject({
925+
controller.bypass(formatHostnameToUrl(unsafeDomain));
926+
controller.bypass(formatHostnameToUrl(unsafeDomain));
927+
expect(controller.test(formatHostnameToUrl(unsafeDomain))).toMatchObject({
909928
result: false,
910929
type: 'all',
911930
});
@@ -939,12 +958,12 @@ describe('PhishingController', () => {
939958
await controller.updateStalelist();
940959
const unsafeDomain = 'myetherẉalletṭ.com';
941960
assert.equal(
942-
controller.test(unsafeDomain).result,
961+
controller.test(formatHostnameToUrl(unsafeDomain)).result,
943962
true,
944963
'Example unsafe domain seems to be safe',
945964
);
946-
controller.bypass(unsafeDomain);
947-
expect(controller.test(unsafeDomain)).toMatchObject({
965+
controller.bypass(formatHostnameToUrl(unsafeDomain));
966+
expect(controller.test(formatHostnameToUrl(unsafeDomain))).toMatchObject({
948967
result: false,
949968
type: 'all',
950969
});
@@ -978,12 +997,12 @@ describe('PhishingController', () => {
978997
await controller.updateStalelist();
979998
const unsafeDomain = 'xn--myetherallet-4k5fwn.com';
980999
assert.equal(
981-
controller.test(unsafeDomain).result,
1000+
controller.test(formatHostnameToUrl(unsafeDomain)).result,
9821001
true,
9831002
'Example unsafe domain seems to be safe',
9841003
);
985-
controller.bypass(unsafeDomain);
986-
expect(controller.test(unsafeDomain)).toMatchObject({
1004+
controller.bypass(formatHostnameToUrl(unsafeDomain));
1005+
expect(controller.test(formatHostnameToUrl(unsafeDomain))).toMatchObject({
9871006
result: false,
9881007
type: 'all',
9891008
});

0 commit comments

Comments
 (0)