diff --git a/packages/controller-utils/CHANGELOG.md b/packages/controller-utils/CHANGELOG.md index 8a37dad418f..f5f20c11f7e 100644 --- a/packages/controller-utils/CHANGELOG.md +++ b/packages/controller-utils/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Change network nicknames ([#7045](https://github.com/MetaMask/core/pull/7045)) + ## [11.15.0] ### Added diff --git a/packages/controller-utils/src/types.ts b/packages/controller-utils/src/types.ts index bb7c2e3d1bf..22222896654 100644 --- a/packages/controller-utils/src/types.ts +++ b/packages/controller-utils/src/types.ts @@ -159,7 +159,7 @@ export type BlockExplorerUrl = (typeof BlockExplorerUrl)[keyof typeof BlockExplorerUrl]; export const NetworkNickname = { - [BuiltInNetworkName.Mainnet]: 'Ethereum Mainnet', + [BuiltInNetworkName.Mainnet]: 'Ethereum', [BuiltInNetworkName.Goerli]: 'Goerli', [BuiltInNetworkName.Sepolia]: 'Sepolia', [BuiltInNetworkName.LineaGoerli]: 'Linea Goerli', @@ -167,12 +167,12 @@ export const NetworkNickname = { [BuiltInNetworkName.LineaMainnet]: 'Linea', [BuiltInNetworkName.MegaETHTestnet]: 'Mega Testnet', [BuiltInNetworkName.MonadTestnet]: 'Monad Testnet', - [BuiltInNetworkName.BaseMainnet]: 'Base Mainnet', - [BuiltInNetworkName.ArbitrumOne]: 'Arbitrum One', - [BuiltInNetworkName.BscMainnet]: 'BSC Mainnet', - [BuiltInNetworkName.OptimismMainnet]: 'Optimism Mainnet', - [BuiltInNetworkName.PolygonMainnet]: 'Polygon Mainnet', - [BuiltInNetworkName.SeiMainnet]: 'Sei Mainnet', + [BuiltInNetworkName.BaseMainnet]: 'Base', + [BuiltInNetworkName.ArbitrumOne]: 'Arbitrum', + [BuiltInNetworkName.BscMainnet]: 'BNB Chain', + [BuiltInNetworkName.OptimismMainnet]: 'OP', + [BuiltInNetworkName.PolygonMainnet]: 'Polygon', + [BuiltInNetworkName.SeiMainnet]: 'Sei', } as const satisfies Record; export type NetworkNickname = (typeof NetworkNickname)[keyof typeof NetworkNickname]; diff --git a/packages/network-controller/tests/NetworkController.test.ts b/packages/network-controller/tests/NetworkController.test.ts index 18cbac232a2..749d5b63b54 100644 --- a/packages/network-controller/tests/NetworkController.test.ts +++ b/packages/network-controller/tests/NetworkController.test.ts @@ -485,7 +485,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x1", "defaultRpcEndpointIndex": 0, - "name": "Ethereum Mainnet", + "name": "Ethereum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -500,7 +500,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x2105", "defaultRpcEndpointIndex": 0, - "name": "Base Mainnet", + "name": "Base", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -515,7 +515,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x38", "defaultRpcEndpointIndex": 0, - "name": "BSC Mainnet", + "name": "BNB Chain", "nativeCurrency": "BNB", "rpcEndpoints": Array [ Object { @@ -530,7 +530,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x531", "defaultRpcEndpointIndex": 0, - "name": "Sei Mainnet", + "name": "Sei", "nativeCurrency": "SEI", "rpcEndpoints": Array [ Object { @@ -545,7 +545,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x89", "defaultRpcEndpointIndex": 0, - "name": "Polygon Mainnet", + "name": "Polygon", "nativeCurrency": "POL", "rpcEndpoints": Array [ Object { @@ -560,7 +560,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa", "defaultRpcEndpointIndex": 0, - "name": "Optimism Mainnet", + "name": "OP", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -575,7 +575,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa4b1", "defaultRpcEndpointIndex": 0, - "name": "Arbitrum One", + "name": "Arbitrum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -654,7 +654,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x1", "defaultRpcEndpointIndex": 0, - "name": "Ethereum Mainnet", + "name": "Ethereum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -687,7 +687,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x2105", "defaultRpcEndpointIndex": 0, - "name": "Base Mainnet", + "name": "Base", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -702,7 +702,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x38", "defaultRpcEndpointIndex": 0, - "name": "BSC Mainnet", + "name": "BNB Chain", "nativeCurrency": "BNB", "rpcEndpoints": Array [ Object { @@ -717,7 +717,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x531", "defaultRpcEndpointIndex": 0, - "name": "Sei Mainnet", + "name": "Sei", "nativeCurrency": "SEI", "rpcEndpoints": Array [ Object { @@ -732,7 +732,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x89", "defaultRpcEndpointIndex": 0, - "name": "Polygon Mainnet", + "name": "Polygon", "nativeCurrency": "POL", "rpcEndpoints": Array [ Object { @@ -747,7 +747,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa", "defaultRpcEndpointIndex": 0, - "name": "Optimism Mainnet", + "name": "OP", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -762,7 +762,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa4b1", "defaultRpcEndpointIndex": 0, - "name": "Arbitrum One", + "name": "Arbitrum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -4967,7 +4967,7 @@ describe('NetworkController', () => { }), ).toThrow( new Error( - "Could not add network with chain ID 0x1337 and Infura RPC endpoint for 'Ethereum Mainnet' which represents 0x1, as the two conflict", + "Could not add network with chain ID 0x1337 and Infura RPC endpoint for 'Ethereum' which represents 0x1, as the two conflict", ), ); }, @@ -8051,7 +8051,7 @@ describe('NetworkController', () => { ], }), ).rejects.toThrow( - "Could not update network to point to same RPC endpoint as existing network for chain 0x1 ('Ethereum Mainnet')", + "Could not update network to point to same RPC endpoint as existing network for chain 0x1 ('Ethereum')", ); }, ); @@ -14770,7 +14770,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x1", "defaultRpcEndpointIndex": 0, - "name": "Ethereum Mainnet", + "name": "Ethereum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -14785,7 +14785,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x2105", "defaultRpcEndpointIndex": 0, - "name": "Base Mainnet", + "name": "Base", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -14800,7 +14800,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x38", "defaultRpcEndpointIndex": 0, - "name": "BSC Mainnet", + "name": "BNB Chain", "nativeCurrency": "BNB", "rpcEndpoints": Array [ Object { @@ -14815,7 +14815,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x531", "defaultRpcEndpointIndex": 0, - "name": "Sei Mainnet", + "name": "Sei", "nativeCurrency": "SEI", "rpcEndpoints": Array [ Object { @@ -14830,7 +14830,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x89", "defaultRpcEndpointIndex": 0, - "name": "Polygon Mainnet", + "name": "Polygon", "nativeCurrency": "POL", "rpcEndpoints": Array [ Object { @@ -14845,7 +14845,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa", "defaultRpcEndpointIndex": 0, - "name": "Optimism Mainnet", + "name": "OP", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -14860,7 +14860,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa4b1", "defaultRpcEndpointIndex": 0, - "name": "Arbitrum One", + "name": "Arbitrum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -14939,7 +14939,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x1", "defaultRpcEndpointIndex": 0, - "name": "Ethereum Mainnet", + "name": "Ethereum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -14954,7 +14954,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x2105", "defaultRpcEndpointIndex": 0, - "name": "Base Mainnet", + "name": "Base", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -14969,7 +14969,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x38", "defaultRpcEndpointIndex": 0, - "name": "BSC Mainnet", + "name": "BNB Chain", "nativeCurrency": "BNB", "rpcEndpoints": Array [ Object { @@ -14984,7 +14984,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x531", "defaultRpcEndpointIndex": 0, - "name": "Sei Mainnet", + "name": "Sei", "nativeCurrency": "SEI", "rpcEndpoints": Array [ Object { @@ -14999,7 +14999,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x89", "defaultRpcEndpointIndex": 0, - "name": "Polygon Mainnet", + "name": "Polygon", "nativeCurrency": "POL", "rpcEndpoints": Array [ Object { @@ -15014,7 +15014,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa", "defaultRpcEndpointIndex": 0, - "name": "Optimism Mainnet", + "name": "OP", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -15029,7 +15029,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa4b1", "defaultRpcEndpointIndex": 0, - "name": "Arbitrum One", + "name": "Arbitrum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -15108,7 +15108,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x1", "defaultRpcEndpointIndex": 0, - "name": "Ethereum Mainnet", + "name": "Ethereum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -15123,7 +15123,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x2105", "defaultRpcEndpointIndex": 0, - "name": "Base Mainnet", + "name": "Base", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -15138,7 +15138,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x38", "defaultRpcEndpointIndex": 0, - "name": "BSC Mainnet", + "name": "BNB Chain", "nativeCurrency": "BNB", "rpcEndpoints": Array [ Object { @@ -15153,7 +15153,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x531", "defaultRpcEndpointIndex": 0, - "name": "Sei Mainnet", + "name": "Sei", "nativeCurrency": "SEI", "rpcEndpoints": Array [ Object { @@ -15168,7 +15168,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0x89", "defaultRpcEndpointIndex": 0, - "name": "Polygon Mainnet", + "name": "Polygon", "nativeCurrency": "POL", "rpcEndpoints": Array [ Object { @@ -15183,7 +15183,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa", "defaultRpcEndpointIndex": 0, - "name": "Optimism Mainnet", + "name": "OP", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object { @@ -15198,7 +15198,7 @@ describe('NetworkController', () => { "blockExplorerUrls": Array [], "chainId": "0xa4b1", "defaultRpcEndpointIndex": 0, - "name": "Arbitrum One", + "name": "Arbitrum", "nativeCurrency": "ETH", "rpcEndpoints": Array [ Object {