@metamask-previews/network-controller 22.2.1-preview-52c28555 → 22.2.1-preview-e2b3b183
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.
- package/CHANGELOG.md +6 -0
- package/dist/NetworkController.cjs +3 -0
- package/dist/NetworkController.cjs.map +1 -1
- package/dist/NetworkController.d.cts +16 -0
- package/dist/NetworkController.d.cts.map +1 -1
- package/dist/NetworkController.d.mts +16 -0
- package/dist/NetworkController.d.mts.map +1 -1
- package/dist/NetworkController.mjs +4 -1
- package/dist/NetworkController.mjs.map +1 -1
- package/dist/constants.cjs +5 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +4 -0
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +4 -0
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +4 -0
- package/dist/constants.mjs.map +1 -1
- package/dist/create-network-client.cjs +12 -12
- package/dist/create-network-client.cjs.map +1 -1
- package/dist/create-network-client.d.cts.map +1 -1
- package/dist/create-network-client.d.mts.map +1 -1
- package/dist/create-network-client.mjs +12 -12
- package/dist/create-network-client.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +17 -6
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +17 -6
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -17,11 +17,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
17
17
|
- The request returns a non-200 response
|
|
18
18
|
- Use exponential backoff / jitter when retrying requests to Infura and custom RPC endpoints ([#5290](https://github.com/MetaMask/core/pull/5290))
|
|
19
19
|
- As requests are retried, the delay between retries will increase exponentially (using random variance to prevent bursts)
|
|
20
|
+
- Add support for automatic failover when Infura is down ([#5630](https://github.com/MetaMask/core/pull/5630))
|
|
21
|
+
- An Infura RPC endpoint can now be configured with a list of failover URLs (see "Changed" for details).
|
|
22
|
+
- If, after many attempts, an Infura network is perceived to be down, the list of failover URLs will be tried in turn.
|
|
23
|
+
- All Infura RPC endpoints are configured to use Quicknode by default.
|
|
20
24
|
|
|
21
25
|
### Changed
|
|
22
26
|
|
|
23
27
|
- **BREAKING:** `NetworkController` constructor now takes two required options, `fetch` and `btoa` ([#5290](https://github.com/MetaMask/core/pull/5290))
|
|
24
28
|
- These are passed along to functions that create the JSON-RPC middleware
|
|
29
|
+
- **BREAKING:** Add required property `failoverEndpointUrls` to `InfuraRpcEndpoint` ([#5630](https://github.com/MetaMask/core/pull/5630))
|
|
30
|
+
- **BREAKING:** Add required property `failoverEndpointUrls` to `InfuraNetworkClientConfiguration` ([#5630](https://github.com/MetaMask/core/pull/5630))
|
|
25
31
|
- Synchronize retry logic and error handling behavior between Infura and custom RPC endpoints ([#5290](https://github.com/MetaMask/core/pull/5290))
|
|
26
32
|
- A request to a custom endpoint that returns a 418 response will no longer return a JSON-RPC response with the error "Request is being rate limited"
|
|
27
33
|
- A request to a custom endpoint that returns a 429 response now returns a JSON-RPC response with the error "Request is being rate limited"
|
|
@@ -123,6 +123,7 @@ function getDefaultNetworkConfigurationsByChainId() {
|
|
|
123
123
|
nativeCurrency: controller_utils_1.NetworksTicker[infuraNetworkType],
|
|
124
124
|
rpcEndpoints: [
|
|
125
125
|
{
|
|
126
|
+
failoverUrls: [constants_1.DEFAULT_INFURA_FAILOVER_URL],
|
|
126
127
|
networkClientId: infuraNetworkType,
|
|
127
128
|
type: RpcEndpointType.Infura,
|
|
128
129
|
url: rpcEndpointUrl,
|
|
@@ -1321,6 +1322,7 @@ async function _NetworkController_determineEIP1559Compatibility(networkClientId)
|
|
|
1321
1322
|
type: types_1.NetworkClientType.Infura,
|
|
1322
1323
|
chainId: networkFields.chainId,
|
|
1323
1324
|
network: addedRpcEndpoint.networkClientId,
|
|
1325
|
+
failoverEndpointUrls: addedRpcEndpoint.failoverUrls,
|
|
1324
1326
|
infuraProjectId: __classPrivateFieldGet(this, _NetworkController_infuraProjectId, "f"),
|
|
1325
1327
|
ticker: networkFields.nativeCurrency,
|
|
1326
1328
|
},
|
|
@@ -1388,6 +1390,7 @@ async function _NetworkController_determineEIP1559Compatibility(networkClientId)
|
|
|
1388
1390
|
networkClientConfiguration: {
|
|
1389
1391
|
type: types_1.NetworkClientType.Infura,
|
|
1390
1392
|
network: infuraNetworkName,
|
|
1393
|
+
failoverEndpointUrls: rpcEndpoint.failoverUrls,
|
|
1391
1394
|
infuraProjectId: __classPrivateFieldGet(this, _NetworkController_infuraProjectId, "f"),
|
|
1392
1395
|
chainId: networkConfiguration.chainId,
|
|
1393
1396
|
ticker: networkConfiguration.nativeCurrency,
|