@metamask-previews/network-controller 22.2.1-preview-5b37150f → 22.2.1-preview-def92ff7
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 +1 -6
- package/dist/NetworkController.cjs +1 -7
- package/dist/NetworkController.cjs.map +1 -1
- package/dist/NetworkController.d.cts +0 -8
- package/dist/NetworkController.d.cts.map +1 -1
- package/dist/NetworkController.d.mts +0 -8
- package/dist/NetworkController.d.mts.map +1 -1
- package/dist/NetworkController.mjs +1 -7
- package/dist/NetworkController.mjs.map +1 -1
- package/dist/create-network-client.cjs +12 -15
- 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 -15
- package/dist/create-network-client.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +6 -11
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +6 -11
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,16 +17,11 @@ 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 via `failoverUrls`.
|
|
22
|
-
- If, after many attempts, an Infura network is perceived to be down, the list of failover URLs will be tried in turn.
|
|
23
20
|
|
|
24
21
|
### Changed
|
|
25
22
|
|
|
26
23
|
- **BREAKING:** `NetworkController` constructor now takes two required options, `fetch` and `btoa` ([#5290](https://github.com/MetaMask/core/pull/5290))
|
|
27
|
-
- These are passed along to functions that create the JSON-RPC middleware
|
|
28
|
-
- **BREAKING:** Add required property `failoverUrls` to `RpcEndpoint` ([#5630](https://github.com/MetaMask/core/pull/5630))
|
|
29
|
-
- **BREAKING:** Add required property `failoverRpcUrls` to `NetworkClientConfiguration` ([#5630](https://github.com/MetaMask/core/pull/5630))
|
|
24
|
+
- These are passed along to functions that create the JSON-RPC middleware
|
|
30
25
|
- Synchronize retry logic and error handling behavior between Infura and custom RPC endpoints ([#5290](https://github.com/MetaMask/core/pull/5290))
|
|
31
26
|
- 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"
|
|
32
27
|
- 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,7 +123,6 @@ function getDefaultNetworkConfigurationsByChainId() {
|
|
|
123
123
|
nativeCurrency: controller_utils_1.NetworksTicker[infuraNetworkType],
|
|
124
124
|
rpcEndpoints: [
|
|
125
125
|
{
|
|
126
|
-
failoverUrls: [],
|
|
127
126
|
networkClientId: infuraNetworkType,
|
|
128
127
|
type: RpcEndpointType.Infura,
|
|
129
128
|
url: rpcEndpointUrl,
|
|
@@ -465,8 +464,7 @@ class NetworkController extends base_controller_1.BaseController {
|
|
|
465
464
|
let updatedNetworkStatus;
|
|
466
465
|
let updatedIsEIP1559Compatible;
|
|
467
466
|
try {
|
|
468
|
-
updatedIsEIP1559Compatible =
|
|
469
|
-
await __classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_determineEIP1559Compatibility).call(this, networkClientId);
|
|
467
|
+
updatedIsEIP1559Compatible = await __classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_determineEIP1559Compatibility).call(this, networkClientId);
|
|
470
468
|
updatedNetworkStatus = constants_1.NetworkStatus.Available;
|
|
471
469
|
}
|
|
472
470
|
catch (error) {
|
|
@@ -1323,7 +1321,6 @@ async function _NetworkController_determineEIP1559Compatibility(networkClientId)
|
|
|
1323
1321
|
type: types_1.NetworkClientType.Infura,
|
|
1324
1322
|
chainId: networkFields.chainId,
|
|
1325
1323
|
network: addedRpcEndpoint.networkClientId,
|
|
1326
|
-
failoverRpcUrls: addedRpcEndpoint.failoverUrls,
|
|
1327
1324
|
infuraProjectId: __classPrivateFieldGet(this, _NetworkController_infuraProjectId, "f"),
|
|
1328
1325
|
ticker: networkFields.nativeCurrency,
|
|
1329
1326
|
},
|
|
@@ -1336,7 +1333,6 @@ async function _NetworkController_determineEIP1559Compatibility(networkClientId)
|
|
|
1336
1333
|
networkClientConfiguration: {
|
|
1337
1334
|
type: types_1.NetworkClientType.Custom,
|
|
1338
1335
|
chainId: networkFields.chainId,
|
|
1339
|
-
failoverRpcUrls: addedRpcEndpoint.failoverUrls,
|
|
1340
1336
|
rpcUrl: addedRpcEndpoint.url,
|
|
1341
1337
|
ticker: networkFields.nativeCurrency,
|
|
1342
1338
|
},
|
|
@@ -1392,7 +1388,6 @@ async function _NetworkController_determineEIP1559Compatibility(networkClientId)
|
|
|
1392
1388
|
networkClientConfiguration: {
|
|
1393
1389
|
type: types_1.NetworkClientType.Infura,
|
|
1394
1390
|
network: infuraNetworkName,
|
|
1395
|
-
failoverRpcUrls: rpcEndpoint.failoverUrls,
|
|
1396
1391
|
infuraProjectId: __classPrivateFieldGet(this, _NetworkController_infuraProjectId, "f"),
|
|
1397
1392
|
chainId: networkConfiguration.chainId,
|
|
1398
1393
|
ticker: networkConfiguration.nativeCurrency,
|
|
@@ -1408,7 +1403,6 @@ async function _NetworkController_determineEIP1559Compatibility(networkClientId)
|
|
|
1408
1403
|
networkClientConfiguration: {
|
|
1409
1404
|
type: types_1.NetworkClientType.Custom,
|
|
1410
1405
|
chainId: networkConfiguration.chainId,
|
|
1411
|
-
failoverRpcUrls: rpcEndpoint.failoverUrls,
|
|
1412
1406
|
rpcUrl: rpcEndpoint.url,
|
|
1413
1407
|
ticker: networkConfiguration.nativeCurrency,
|
|
1414
1408
|
},
|