Skip to content

Commit 60b5fc7

Browse files
authored
Merge branch 'develop' into kevinghim-patch-1
2 parents bf9a429 + 34d43e6 commit 60b5fc7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1113
-296
lines changed

.circleci/scripts/yarn-audit.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set -x
66
set -o pipefail
77

88
# use `improved-yarn-audit` since that allows for exclude
9-
# exclude 1002401 until we remove use of 3Box, 1002581 until we can find a better solution
10-
yarn run improved-yarn-audit --ignore-dev-deps --min-severity moderate --exclude GHSA-93q8-gq69-wqmw,GHSA-257v-vj4p-3w2h,GHSA-fwr7-v2mv-hh25
11-
audit_status="$?"
9+
# exclusions are in .iyarc now
10+
yarn run improved-yarn-audit \
11+
--ignore-dev-deps \
12+
--min-severity moderate \
13+
--fail-on-missing-exclusions
1214

13-
# Use a bitmask to ignore INFO and LOW severity audit results
14-
# See here: https://yarnpkg.com/lang/en/docs/cli/audit/
15-
audit_status="$(( audit_status & 11100 ))"
15+
audit_status="$?"
1616

1717
if [[ "$audit_status" != 0 ]]
1818
then

.eslintrc.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ module.exports = {
4444
path.resolve(__dirname, '.eslintrc.babel.js'),
4545
path.resolve(__dirname, '.eslintrc.typescript-compat.js'),
4646
],
47-
parserOptions: {
48-
sourceType: 'module',
49-
},
50-
rules: {
51-
// This rule does not work with CommonJS modules. We will just have to
52-
// trust that all of the files specified above are indeed modules.
53-
'import/unambiguous': 'off',
54-
},
5547
settings: {
5648
'import/resolver': {
5749
// When determining the location of a `require()` call, use Node's

.github/workflows/crowdin_action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v2
2222

2323
- name: crowdin action
24-
uses: crowdin/github-action@9237b4cb361788dfce63feb2e2f15c09e2fe7415
24+
uses: crowdin/github-action@a3160b9e5a9e00739392c23da5e580c6cabe526d
2525
with:
2626
upload_translations: true
2727
download_translations: true

.iyarc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# improved-yarn-audit advisory exclusions
2+
GHSA-93q8-gq69-wqmw
3+
GHSA-257v-vj4p-3w2h
4+
GHSA-fwr7-v2mv-hh25

.storybook/test-data.js

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,20 +1248,7 @@ const state = {
12481248
method: 'eth_accounts',
12491249
methodType: 'restricted',
12501250
origin: 'https://metamask.io',
1251-
request: {
1252-
method: 'eth_accounts',
1253-
params: [],
1254-
jsonrpc: '2.0',
1255-
id: 522690215,
1256-
origin: 'https://metamask.io',
1257-
tabId: 5,
1258-
},
12591251
requestTime: 1602643170686,
1260-
response: {
1261-
id: 522690215,
1262-
jsonrpc: '2.0',
1263-
result: [],
1264-
},
12651252
responseTime: 1602643170688,
12661253
success: true,
12671254
},
@@ -1270,20 +1257,7 @@ const state = {
12701257
method: 'eth_accounts',
12711258
methodType: 'restricted',
12721259
origin: 'https://widget.getacute.io',
1273-
request: {
1274-
method: 'eth_accounts',
1275-
params: [],
1276-
jsonrpc: '2.0',
1277-
id: 1620464600,
1278-
origin: 'https://widget.getacute.io',
1279-
tabId: 5,
1280-
},
12811260
requestTime: 1602643172935,
1282-
response: {
1283-
id: 1620464600,
1284-
jsonrpc: '2.0',
1285-
result: [],
1286-
},
12871261
responseTime: 1602643172935,
12881262
success: true,
12891263
},
@@ -1292,19 +1266,7 @@ const state = {
12921266
method: 'eth_accounts',
12931267
methodType: 'restricted',
12941268
origin: 'https://app.uniswap.org',
1295-
request: {
1296-
method: 'eth_accounts',
1297-
jsonrpc: '2.0',
1298-
id: 4279100021,
1299-
origin: 'https://app.uniswap.org',
1300-
tabId: 5,
1301-
},
13021269
requestTime: 1620710669962,
1303-
response: {
1304-
id: 4279100021,
1305-
jsonrpc: '2.0',
1306-
result: [],
1307-
},
13081270
responseTime: 1620710669963,
13091271
success: true,
13101272
},
@@ -1313,19 +1275,7 @@ const state = {
13131275
method: 'eth_requestAccounts',
13141276
methodType: 'restricted',
13151277
origin: 'https://app.uniswap.org',
1316-
request: {
1317-
method: 'eth_requestAccounts',
1318-
jsonrpc: '2.0',
1319-
id: 4279100022,
1320-
origin: 'https://app.uniswap.org',
1321-
tabId: 5,
1322-
},
13231278
requestTime: 1620710686872,
1324-
response: {
1325-
id: 4279100022,
1326-
jsonrpc: '2.0',
1327-
result: ['0x64a845a5b02460acf8a3d84503b0d68d028b4bb4'],
1328-
},
13291279
responseTime: 1620710693187,
13301280
success: true,
13311281
},
@@ -1334,19 +1284,7 @@ const state = {
13341284
method: 'eth_requestAccounts',
13351285
methodType: 'restricted',
13361286
origin: 'https://app.uniswap.org',
1337-
request: {
1338-
method: 'eth_requestAccounts',
1339-
jsonrpc: '2.0',
1340-
id: 4279100023,
1341-
origin: 'https://app.uniswap.org',
1342-
tabId: 5,
1343-
},
13441287
requestTime: 1620710693204,
1345-
response: {
1346-
id: 4279100023,
1347-
jsonrpc: '2.0',
1348-
result: ['0x64a845a5b02460acf8a3d84503b0d68d028b4bb4'],
1349-
},
13501288
responseTime: 1620710693213,
13511289
success: true,
13521290
},
@@ -1355,20 +1293,7 @@ const state = {
13551293
method: 'eth_accounts',
13561294
methodType: 'restricted',
13571295
origin: 'https://app.uniswap.org',
1358-
request: {
1359-
method: 'eth_accounts',
1360-
params: [],
1361-
jsonrpc: '2.0',
1362-
id: 4279100034,
1363-
origin: 'https://app.uniswap.org',
1364-
tabId: 5,
1365-
},
13661296
requestTime: 1620710712072,
1367-
response: {
1368-
id: 4279100034,
1369-
jsonrpc: '2.0',
1370-
result: ['0x64a845a5b02460acf8a3d84503b0d68d028b4bb4'],
1371-
},
13721297
responseTime: 1620710712075,
13731298
success: true,
13741299
},

CHANGELOG.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [10.13.0]
10+
### Added
11+
- Add a new fiat onboarding option via MoonPay ([#13934](https://github.com/MetaMask/metamask-extension/pull/13934))
12+
- Available for the following networks: Ethereum, BNB Chain, Polygon, Avalanche, Celo
13+
- Add support for a Dark Mode theme ([#14207](https://github.com/MetaMask/metamask-extension/pull/14207))
14+
- **[FLASK]** Add native browser notifications for Snaps via `snap_notify` permission ([#13613](https://github.com/MetaMask/metamask-extension/pull/13613))
15+
- **[FLASK]** Add Snaps settting to search index ([#14100](https://github.com/MetaMask/metamask-extension/pull/14100))
16+
- **[FLASK]** Display the Snap version during Snap installation ([#13931](https://github.com/MetaMask/metamask-extension/pull/13931))
17+
18+
### Changed
19+
- Improvements for multi-layer fee UX ([#13547](https://github.com/MetaMask/metamask-extension/pull/13547))
20+
- Fix 'Send max' button when on a multi-layer fee network
21+
- Show fiat currency estimates alongside ETH estimates on multi-layer fee networks
22+
- Display L1+L2 gas fees as a combined total on multi-layer fee networks
23+
- Don't allow users to set gas price on Optimism
24+
- Move Token Detection toggle to Advanced tab. ([#13977](https://github.com/MetaMask/metamask-extension/pull/13977))
25+
- Don’t show ‘What’s new’ pop up to new users ([#13886](https://github.com/MetaMask/metamask-extension/pull/13886))
26+
- Improving settings toggle accessibility by allowing label interaction ([#13876](https://github.com/MetaMask/metamask-extension/pull/13876))
27+
- Updating account and network icons ([#13947](https://github.com/MetaMask/metamask-extension/pull/13947))
28+
- Add 'Enhanced Gas UI' setting to search index ([#14206](https://github.com/MetaMask/metamask-extension/pull/14206))
29+
- Add buy modal link to insufficient currency warning of all networks that have a fiat onramp, and update spacing in the warning's copy ([#14019](https://github.com/MetaMask/metamask-extension/pull/14019))
30+
31+
### Fixed
32+
- Fix issue where editing advanced gas while speeeding up a transaction exits speedup ([#14101](https://github.com/MetaMask/metamask-extension/pull/14101))
33+
- Fix typo in cancel/speed up messaging ([#14067](https://github.com/MetaMask/metamask-extension/pull/14067))
34+
- Fix token icon when going from token detail page to Swaps view ([#14062](https://github.com/MetaMask/metamask-extension/pull/14062))
35+
- Fix issue where the contract address is shown as recipient when calling safe transfer method on erc721 or erc1155 contracts ([#13535](https://github.com/MetaMask/metamask-extension/pull/13535))
36+
- Ensure accounts still line up in dropdown ([#13986](https://github.com/MetaMask/metamask-extension/pull/13986))
37+
938
## [10.12.4]
1039
### Fixed
1140
- Fix MetaMask internal error reporting (#14344)
@@ -52,7 +81,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5281
- Harden keyring type check in EthOverview ([#13711](https://github.com/MetaMask/metamask-extension/pull/13711))
5382
- Update "Forgot Password?" copy ([#13493](https://github.com/MetaMask/metamask-extension/pull/13493))
5483
- Confirm transaction page: use method name only for contract transactions ([#13643](https://github.com/MetaMask/metamask-extension/pull/13643))
55-
- Fix issues
5684
- **[FLASK]** Fix Snap permission list item shrinkage with short permission names ([#13996](https://github.com/MetaMask/metamask-extension/pull/13996))
5785

5886
## [10.11.4]
@@ -2857,7 +2885,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
28572885
### Uncategorized
28582886
- Added the ability to restore accounts from seed words.
28592887

2860-
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.12.4...HEAD
2888+
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.13.0...HEAD
2889+
[10.13.0]: https://github.com/MetaMask/metamask-extension/compare/v10.12.4...v10.13.0
28612890
[10.12.4]: https://github.com/MetaMask/metamask-extension/compare/v10.12.3...v10.12.4
28622891
[10.12.3]: https://github.com/MetaMask/metamask-extension/compare/v10.12.2...v10.12.3
28632892
[10.12.2]: https://github.com/MetaMask/metamask-extension/compare/v10.12.1...v10.12.2

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To learn how to contribute to the MetaMask project itself, visit our [Internal D
2020
- Install dependencies: `yarn setup` (not the usual install command)
2121
- Copy the `.metamaskrc.dist` file to `.metamaskrc`
2222
- Replace the `INFURA_PROJECT_ID` value with your own personal [Infura Project ID](https://infura.io/docs).
23-
- If debugging MetaMetrics, you'll need to add a value for `SEGMENT_WRITE_KEY` [Segment write key](https://segment.com/docs/connections/find-writekey/).
23+
- If debugging MetaMetrics, you'll need to add a value for `SEGMENT_WRITE_KEY` [Segment write key](https://segment.com/docs/connections/find-writekey/), see [Developing on MetaMask](./development/README.md).
2424
- Build the project to the `./dist/` folder with `yarn dist`.
2525

2626
Uncompressed builds can be found in `/dist`, compressed builds can be found in `/builds` once they're built.
@@ -60,9 +60,23 @@ You can run the linter by itself with `yarn lint`, and you can automatically fix
6060

6161
Our e2e test suite can be run on either Firefox or Chrome. In either case, start by creating a test build by running `yarn build:test`.
6262

63-
Firefox e2e tests can be run with `yarn test:e2e:firefox`.
63+
- Firefox e2e tests can be run with `yarn test:e2e:firefox`.
6464

65-
Chrome e2e tests can be run with `yarn test:e2e:chrome`, but they will only work if you have Chrome v79 installed. Update the `chromedriver` package to a version matching your local Chrome installation to run e2e tests on newer Chrome versions.
65+
- Chrome e2e tests can be run with `yarn test:e2e:chrome`. The `chromedriver` package major version must match the major version of your local Chrome installation. If they don't match, update whichever is behind before running Chrome e2e tests.
66+
67+
- Single e2e tests can be run with `yarn test:e2e:single test/e2e/tests/TEST_NAME.spec.js` along with the options below.
68+
69+
```console
70+
--browser Set the browser used; either 'chrome' or 'firefox'.
71+
72+
--leave-running Leaves the browser running after a test fails, along with anything else
73+
that the test used (ganache, the test dapp, etc.).
74+
75+
--retries Set how many times the test should be retried upon failure. Default is 0.
76+
```
77+
78+
An example for running `account-details` testcase with chrome and leaving the browser open would be:
79+
`yarn test:e2e:single test/e2e/tests/account-details.spec.js --browser=chrome --leave-running`
6680

6781
### Changing dependencies
6882

@@ -97,6 +111,7 @@ Whenever you change dependencies (adding, removing, or updating, either in `pack
97111
- [How to add a new translation to MetaMask](./docs/translating-guide.md)
98112
- [Publishing Guide](./docs/publishing.md)
99113
- [How to use the TREZOR emulator](./docs/trezor-emulator.md)
114+
- [Developing on MetaMask](./development/README.md)
100115
- [How to generate a visualization of this repository's development](./development/gource-viz.sh)
101116

102117
[1]: http://www.nomnoml.com/#view/%5B%3Cactor%3Euser%5D%0A%0A%5Bmetamask-ui%7C%0A%20%20%20%5Btools%7C%0A%20%20%20%20%20react%0A%20%20%20%20%20redux%0A%20%20%20%20%20thunk%0A%20%20%20%20%20ethUtils%0A%20%20%20%20%20jazzicon%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20account-detail%0A%20%20%20%20%20accounts%0A%20%20%20%20%20locked-screen%0A%20%20%20%20%20restore-vault%0A%20%20%20%20%20identicon%0A%20%20%20%20%20config%0A%20%20%20%20%20info%0A%20%20%20%5D%0A%20%20%20%5Breducers%7C%0A%20%20%20%20%20app%0A%20%20%20%20%20metamask%0A%20%20%20%20%20identities%0A%20%20%20%5D%0A%20%20%20%5Bactions%7C%0A%20%20%20%20%20%5BbackgroundConnection%5D%0A%20%20%20%5D%0A%20%20%20%5Bcomponents%5D%3A-%3E%5Bactions%5D%0A%20%20%20%5Bactions%5D%3A-%3E%5Breducers%5D%0A%20%20%20%5Breducers%5D%3A-%3E%5Bcomponents%5D%0A%5D%0A%0A%5Bweb%20dapp%7C%0A%20%20%5Bui%20code%5D%0A%20%20%5Bweb3%5D%0A%20%20%5Bmetamask-inpage%5D%0A%20%20%0A%20%20%5B%3Cactor%3Eui%20developer%5D%0A%20%20%5Bui%20developer%5D-%3E%5Bui%20code%5D%0A%20%20%5Bui%20code%5D%3C-%3E%5Bweb3%5D%0A%20%20%5Bweb3%5D%3C-%3E%5Bmetamask-inpage%5D%0A%5D%0A%0A%5Bmetamask-background%7C%0A%20%20%5Bprovider-engine%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bid%20store%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%3E%5Bhooked%20wallet%20subprovider%5D%0A%20%20%5Bhooked%20wallet%20subprovider%5D%3C-%3E%5Bid%20store%5D%0A%20%20%5Bconfig%20manager%7C%0A%20%20%20%20%5Brpc%20configuration%5D%0A%20%20%20%20%5Bencrypted%20keys%5D%0A%20%20%20%20%5Bwallet%20nicknames%5D%0A%20%20%5D%0A%20%20%0A%20%20%5Bprovider-engine%5D%3C-%5Bconfig%20manager%5D%0A%20%20%5Bid%20store%5D%3C-%3E%5Bconfig%20manager%5D%0A%5D%0A%0A%5Buser%5D%3C-%3E%5Bmetamask-ui%5D%0A%0A%5Buser%5D%3C%3A--%3A%3E%5Bweb%20dapp%5D%0A%0A%5Bmetamask-contentscript%7C%0A%20%20%5Bplugin%20restart%20detector%5D%0A%20%20%5Brpc%20passthrough%5D%0A%5D%0A%0A%5Brpc%20%7C%0A%20%20%5Bethereum%20blockchain%20%7C%0A%20%20%20%20%5Bcontracts%5D%0A%20%20%20%20%5Baccounts%5D%0A%20%20%5D%0A%5D%0A%0A%5Bweb%20dapp%5D%3C%3A--%3A%3E%5Bmetamask-contentscript%5D%0A%5Bmetamask-contentscript%5D%3C-%3E%5Bmetamask-background%5D%0A%5Bmetamask-background%5D%3C-%3E%5Bmetamask-ui%5D%0A%5Bmetamask-background%5D%3C-%3E%5Brpc%5D%0A

app/scripts/controllers/metametrics.js

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
import { isEqual, merge, omit, omitBy, pickBy, size, sum } from 'lodash';
1+
import {
2+
isEqual,
3+
memoize,
4+
merge,
5+
omit,
6+
omitBy,
7+
pickBy,
8+
size,
9+
sum,
10+
} from 'lodash';
211
import { ObservableStore } from '@metamask/obs-store';
312
import { bufferToHex, keccak } from 'ethereumjs-util';
413
import { generateUUID } from 'pubnub';
@@ -540,9 +549,7 @@ export default class MetaMetricsController {
540549
* @returns {MetaMetricsTraits | null} traits that have changed since last update
541550
*/
542551
_buildUserTraitsObject(metamaskState) {
543-
/**
544-
* @type {MetaMetricsTraits}
545-
*/
552+
/** @type {MetaMetricsTraits} */
546553
const currentTraits = {
547554
[TRAITS.ADDRESS_BOOK_ENTRIES]: sum(
548555
Object.values(metamaskState.addressBook).map(size),
@@ -554,9 +561,12 @@ export default class MetaMetricsController {
554561
[TRAITS.NFT_AUTODETECTION_ENABLED]: metamaskState.useCollectibleDetection,
555562
[TRAITS.NUMBER_OF_ACCOUNTS]: Object.values(metamaskState.identities)
556563
.length,
557-
[TRAITS.NUMBER_OF_NFT_COLLECTIONS]: this._getNumberOfNFtCollection(
558-
metamaskState,
564+
[TRAITS.NUMBER_OF_NFT_COLLECTIONS]: this._getAllUniqueNFTAddressesLength(
565+
metamaskState.allCollectibles,
559566
),
567+
[TRAITS.NUMBER_OF_NFTS]: this._getAllNFTsFlattened(
568+
metamaskState.allCollectibles,
569+
).length,
560570
[TRAITS.NUMBER_OF_TOKENS]: this._getNumberOfTokens(metamaskState),
561571
[TRAITS.OPENSEA_API_ENABLED]: metamaskState.openSeaEnabled,
562572
[TRAITS.THREE_BOX_ENABLED]: metamaskState.threeBoxSyncingAllowed,
@@ -603,22 +613,31 @@ export default class MetaMetricsController {
603613
}
604614

605615
/**
616+
* Returns an array of all of the collectibles/NFTs the user
617+
* possesses across all networks and accounts.
606618
*
607-
* @param {object} metamaskState
608-
* @returns number of unique collectible addresses
619+
* @param {Object} allCollectibles
620+
* @returns {[]}
609621
*/
610-
_getNumberOfNFtCollection(metamaskState) {
611-
const { allCollectibles } = metamaskState;
612-
if (!allCollectibles) {
613-
return 0;
614-
}
622+
_getAllNFTsFlattened = memoize((allCollectibles = {}) => {
623+
return Object.values(allCollectibles)
624+
.flatMap((chainNFTs) => Object.values(chainNFTs))
625+
.flat();
626+
});
615627

616-
const allAddresses = Object.values(allCollectibles)
617-
.flatMap((chainCollectibles) => Object.values(chainCollectibles))
618-
.flat()
619-
.map((collectible) => collectible.address);
620-
const unique = [...new Set(allAddresses)];
621-
return unique.length;
628+
/**
629+
* Returns the number of unique collectible/NFT addresses the user
630+
* possesses across all networks and accounts.
631+
*
632+
* @param {Object} allCollectibles
633+
* @returns {number}
634+
*/
635+
_getAllUniqueNFTAddressesLength(allCollectibles = {}) {
636+
const allNFTAddresses = this._getAllNFTsFlattened(allCollectibles).map(
637+
(nft) => nft.address,
638+
);
639+
const uniqueAddresses = new Set(allNFTAddresses);
640+
return uniqueAddresses.size;
622641
}
623642

624643
/**

app/scripts/controllers/metametrics.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ describe('MetaMetricsController', function () {
691691
[TRAITS.NFT_AUTODETECTION_ENABLED]: false,
692692
[TRAITS.NUMBER_OF_ACCOUNTS]: 2,
693693
[TRAITS.NUMBER_OF_NFT_COLLECTIONS]: 3,
694+
[TRAITS.NUMBER_OF_NFTS]: 4,
694695
[TRAITS.NUMBER_OF_TOKENS]: 5,
695696
[TRAITS.OPENSEA_API_ENABLED]: true,
696697
[TRAITS.THREE_BOX_ENABLED]: false,

app/scripts/controllers/network/network.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
MAINNET_CHAIN_ID,
1919
RINKEBY_CHAIN_ID,
2020
INFURA_BLOCKED_KEY,
21+
TEST_NETWORK_TICKER_MAP,
2122
} from '../../../../shared/constants/network';
2223
import { SECOND } from '../../../../shared/constants/time';
2324
import {
@@ -41,7 +42,11 @@ if (process.env.IN_TEST) {
4142
nickname: 'Localhost 8545',
4243
};
4344
} else if (process.env.METAMASK_DEBUG || env === 'test') {
44-
defaultProviderConfigOpts = { type: RINKEBY, chainId: RINKEBY_CHAIN_ID };
45+
defaultProviderConfigOpts = {
46+
type: RINKEBY,
47+
chainId: RINKEBY_CHAIN_ID,
48+
ticker: TEST_NETWORK_TICKER_MAP.rinkeby,
49+
};
4550
} else {
4651
defaultProviderConfigOpts = { type: MAINNET, chainId: MAINNET_CHAIN_ID };
4752
}
@@ -296,12 +301,12 @@ export default class NetworkController extends EventEmitter {
296301
INFURA_PROVIDER_TYPES.includes(type),
297302
`Unknown Infura provider type "${type}".`,
298303
);
299-
const { chainId } = NETWORK_TYPE_TO_ID_MAP[type];
304+
const { chainId, ticker } = NETWORK_TYPE_TO_ID_MAP[type];
300305
this.setProviderConfig({
301306
type,
302307
rpcUrl: '',
303308
chainId,
304-
ticker: 'ETH',
309+
ticker: ticker ?? 'ETH',
305310
nickname: '',
306311
});
307312
}

0 commit comments

Comments
 (0)