@metamask-previews/network-controller 23.1.0-preview-da4d93f2 → 23.1.0-preview-8c3b89c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -109,17 +109,6 @@ const controllerName = 'NetworkController';
|
|
|
109
109
|
* @returns The default value for `networkConfigurationsByChainId`.
|
|
110
110
|
*/
|
|
111
111
|
function getDefaultNetworkConfigurationsByChainId() {
|
|
112
|
-
return {
|
|
113
|
-
...getDefaultInfuraNetworkConfigurationsByChainId(),
|
|
114
|
-
...getDefaultCustomNetworkConfigurationsByChainId(),
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Constructs a `networkConfigurationsByChainId` object for all default Infura networks.
|
|
119
|
-
*
|
|
120
|
-
* @returns The `networkConfigurationsByChainId` object of all Infura networks.
|
|
121
|
-
*/
|
|
122
|
-
function getDefaultInfuraNetworkConfigurationsByChainId() {
|
|
123
112
|
return Object.values(controller_utils_1.InfuraNetworkType).reduce((obj, infuraNetworkType) => {
|
|
124
113
|
const chainId = controller_utils_1.ChainId[infuraNetworkType];
|
|
125
114
|
const rpcEndpointUrl =
|
|
@@ -144,32 +133,6 @@ function getDefaultInfuraNetworkConfigurationsByChainId() {
|
|
|
144
133
|
return { ...obj, [chainId]: networkConfiguration };
|
|
145
134
|
}, {});
|
|
146
135
|
}
|
|
147
|
-
/**
|
|
148
|
-
* Constructs a `networkConfigurationsByChainId` object for all default custom networks.
|
|
149
|
-
*
|
|
150
|
-
* @returns The `networkConfigurationsByChainId` object of all custom networks.
|
|
151
|
-
*/
|
|
152
|
-
function getDefaultCustomNetworkConfigurationsByChainId() {
|
|
153
|
-
const { ticker, rpcPrefs } = controller_utils_1.BUILT_IN_NETWORKS[controller_utils_1.BuiltInNetworkName.MegaETHTestnet];
|
|
154
|
-
return {
|
|
155
|
-
[controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.MegaETHTestnet]]: {
|
|
156
|
-
blockExplorerUrls: [rpcPrefs.blockExplorerUrl],
|
|
157
|
-
chainId: controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.MegaETHTestnet],
|
|
158
|
-
defaultRpcEndpointIndex: 0,
|
|
159
|
-
defaultBlockExplorerUrlIndex: 0,
|
|
160
|
-
name: controller_utils_1.NetworkNickname[controller_utils_1.BuiltInNetworkName.MegaETHTestnet],
|
|
161
|
-
nativeCurrency: ticker,
|
|
162
|
-
rpcEndpoints: [
|
|
163
|
-
{
|
|
164
|
-
failoverUrls: [],
|
|
165
|
-
networkClientId: controller_utils_1.BuiltInNetworkName.MegaETHTestnet,
|
|
166
|
-
type: RpcEndpointType.Custom,
|
|
167
|
-
url: controller_utils_1.BUILT_IN_CUSTOM_NETWORKS_RPC.MEGAETH_TESTNET,
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
136
|
/**
|
|
174
137
|
* Constructs properties for the NetworkController state whose values will be
|
|
175
138
|
* used if not provided to the constructor.
|