Skip to content

Commit a9567f9

Browse files
authored
Merge branch 'main' into 231011-update-readme-with-eth-json-rpc-provider
2 parents 1ba4086 + 1399b43 commit a9567f9

File tree

9 files changed

+167
-0
lines changed

9 files changed

+167
-0
lines changed

packages/assets-controllers/src/AssetsContractController.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ async function setupAssetContractControllers() {
4646
network: 'mainnet',
4747
infuraProjectId: '341eacb578dd44a1a049cbc5f6fd4035',
4848
chainId: BUILT_IN_NETWORKS.mainnet.chainId,
49+
ticker: BUILT_IN_NETWORKS.mainnet.ticker,
4950
} as const;
5051

5152
const messenger: NetworkControllerMessenger =
@@ -835,6 +836,7 @@ describe('AssetsContractController', () => {
835836
mockNetworkWithDefaultChainId({
836837
networkClientConfiguration: {
837838
chainId: BUILT_IN_NETWORKS.sepolia.chainId,
839+
ticker: BUILT_IN_NETWORKS.sepolia.ticker,
838840
type: NetworkClientType.Infura,
839841
network: 'sepolia',
840842
infuraProjectId: networkClientConfiguration.infuraProjectId,

packages/assets-controllers/src/AssetsContractControllerWithNetworkClientId.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ describe('AssetsContractController with NetworkClientId', () => {
702702
mockNetworkWithDefaultChainId({
703703
networkClientConfiguration: {
704704
chainId: BUILT_IN_NETWORKS.sepolia.chainId,
705+
ticker: BUILT_IN_NETWORKS.sepolia.ticker,
705706
type: NetworkClientType.Infura,
706707
network: 'sepolia',
707708
infuraProjectId: networkClientConfiguration.infuraProjectId,

packages/controller-utils/src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const BUILT_IN_NETWORKS = {
9191
[NetworkType.rpc]: {
9292
chainId: undefined,
9393
blockExplorerUrl: undefined,
94+
ticker: undefined,
9495
rpcPrefs: undefined,
9596
},
9697
} as const;

packages/network-controller/src/NetworkController.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,7 @@ export class NetworkController extends BaseControllerV2<
11901190
type: NetworkClientType.Custom,
11911191
chainId,
11921192
rpcUrl,
1193+
ticker,
11931194
});
11941195
}
11951196

@@ -1380,6 +1381,7 @@ export class NetworkController extends BaseControllerV2<
13801381
network,
13811382
infuraProjectId: this.#infuraProjectId,
13821383
chainId: BUILT_IN_NETWORKS[network].chainId,
1384+
ticker: BUILT_IN_NETWORKS[network].ticker,
13831385
};
13841386
return [
13851387
NetworkClientType.Infura,
@@ -1415,6 +1417,7 @@ export class NetworkController extends BaseControllerV2<
14151417
type: NetworkClientType.Custom,
14161418
chainId: networkConfiguration.chainId,
14171419
rpcUrl: networkConfiguration.rpcUrl,
1420+
ticker: networkConfiguration.ticker,
14181421
};
14191422
return [
14201423
NetworkClientType.Custom,
@@ -1454,6 +1457,7 @@ export class NetworkController extends BaseControllerV2<
14541457
chainId: providerConfig.chainId,
14551458
rpcUrl: providerConfig.rpcUrl,
14561459
type: NetworkClientType.Custom,
1460+
ticker: providerConfig.ticker,
14571461
};
14581462
return [
14591463
[NetworkClientType.Custom, networkClientId, networkClientConfiguration],

packages/network-controller/src/create-auto-managed-network-client.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ describe('createAutoManagedNetworkClient', () => {
1919
type: NetworkClientType.Custom,
2020
rpcUrl: 'https://test.chain',
2121
chainId: '0x1337',
22+
ticker: 'ETH',
2223
} as const,
2324
{
2425
type: NetworkClientType.Infura,
2526
network: NetworkType.mainnet,
2627
chainId: BUILT_IN_NETWORKS[NetworkType.mainnet].chainId,
2728
infuraProjectId: 'some-infura-project-id',
29+
ticker: BUILT_IN_NETWORKS[NetworkType.mainnet].ticker,
2830
} as const,
2931
];
3032
for (const networkClientConfiguration of networkClientConfigurations) {

packages/network-controller/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export enum NetworkClientType {
2424
export type CustomNetworkClientConfiguration = {
2525
chainId: Hex;
2626
rpcUrl: string;
27+
ticker: string;
2728
type: NetworkClientType.Custom;
2829
};
2930

@@ -35,6 +36,7 @@ export type InfuraNetworkClientConfiguration = {
3536
chainId: Hex;
3637
network: InfuraNetworkType;
3738
infuraProjectId: string;
39+
ticker: string;
3840
type: NetworkClientType.Infura;
3941
};
4042

0 commit comments

Comments
 (0)