@metamask-previews/network-controller 26.0.0-preview-d6fe4594 → 27.0.0-preview-84f90603

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.
@@ -2,29 +2,37 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEPRECATED_NETWORKS = exports.INFURA_BLOCKED_KEY = exports.NetworkStatus = void 0;
4
4
  /**
5
- * Represents the availability state of the currently selected network.
5
+ * Represents the availability status of an RPC endpoint. (Regrettably, the
6
+ * name of this type is a misnomer.)
7
+ *
8
+ * The availability status is set both automatically (as requests are made) and
9
+ * manually (when `lookupNetwork` is called).
6
10
  */
7
11
  var NetworkStatus;
8
12
  (function (NetworkStatus) {
9
13
  /**
10
- * The network may or may not be able to receive requests, but either no
11
- * attempt has been made to determine this, or an attempt was made but was
12
- * unsuccessful.
14
+ * Either the availability status of the RPC endpoint has not been determined,
15
+ * or request that `lookupNetwork` performed returned an unknown error.
13
16
  */
14
17
  NetworkStatus["Unknown"] = "unknown";
15
18
  /**
16
- * The network is able to receive and respond to requests.
19
+ * The RPC endpoint is consistently returning successful (2xx) responses.
17
20
  */
18
21
  NetworkStatus["Available"] = "available";
19
22
  /**
20
- * The network was unable to receive and respond to requests for unknown
21
- * reasons.
23
+ * Either the last request to the RPC endpoint was either too slow, or the
24
+ * endpoint is consistently returning errors and the number of retries has
25
+ * been reached.
26
+ */
27
+ NetworkStatus["Degraded"] = "degraded";
28
+ /**
29
+ * The RPC endpoint is consistently returning enough 5xx errors that requests
30
+ * have been paused.
22
31
  */
23
32
  NetworkStatus["Unavailable"] = "unavailable";
24
33
  /**
25
- * The network is not only unavailable, but is also inaccessible for the user
26
- * specifically based on their location. This state only applies to Infura
27
- * networks.
34
+ * The RPC endpoint is inaccessible for the user based on their location. This
35
+ * status only applies to Infura networks.
28
36
  */
29
37
  NetworkStatus["Blocked"] = "blocked";
30
38
  })(NetworkStatus || (exports.NetworkStatus = NetworkStatus = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,aAsBX;AAtBD,WAAY,aAAa;IACvB;;;;OAIG;IACH,oCAAmB,CAAA;IACnB;;OAEG;IACH,wCAAuB,CAAA;IACvB;;;OAGG;IACH,4CAA2B,CAAA;IAC3B;;;;OAIG;IACH,oCAAmB,CAAA;AACrB,CAAC,EAtBW,aAAa,6BAAb,aAAa,QAsBxB;AAEY,QAAA,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,IAAI,GAAG,CAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Represents the availability state of the currently selected network.\n */\nexport enum NetworkStatus {\n /**\n * The network may or may not be able to receive requests, but either no\n * attempt has been made to determine this, or an attempt was made but was\n * unsuccessful.\n */\n Unknown = 'unknown',\n /**\n * The network is able to receive and respond to requests.\n */\n Available = 'available',\n /**\n * The network was unable to receive and respond to requests for unknown\n * reasons.\n */\n Unavailable = 'unavailable',\n /**\n * The network is not only unavailable, but is also inaccessible for the user\n * specifically based on their location. This state only applies to Infura\n * networks.\n */\n Blocked = 'blocked',\n}\n\nexport const INFURA_BLOCKED_KEY = 'countryBlocked';\n\n/**\n * A set of deprecated network ChainId.\n * The network controller will exclude those the networks begin as default network,\n * without the need to remove the network from constant list of controller-utils.\n */\nexport const DEPRECATED_NETWORKS = new Set<string>(['0xe704', '0x5']);\n"]}
1
+ {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,IAAY,aA0BX;AA1BD,WAAY,aAAa;IACvB;;;OAGG;IACH,oCAAmB,CAAA;IACnB;;OAEG;IACH,wCAAuB,CAAA;IACvB;;;;OAIG;IACH,sCAAqB,CAAA;IACrB;;;OAGG;IACH,4CAA2B,CAAA;IAC3B;;;OAGG;IACH,oCAAmB,CAAA;AACrB,CAAC,EA1BW,aAAa,6BAAb,aAAa,QA0BxB;AAEY,QAAA,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,IAAI,GAAG,CAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Represents the availability status of an RPC endpoint. (Regrettably, the\n * name of this type is a misnomer.)\n *\n * The availability status is set both automatically (as requests are made) and\n * manually (when `lookupNetwork` is called).\n */\nexport enum NetworkStatus {\n /**\n * Either the availability status of the RPC endpoint has not been determined,\n * or request that `lookupNetwork` performed returned an unknown error.\n */\n Unknown = 'unknown',\n /**\n * The RPC endpoint is consistently returning successful (2xx) responses.\n */\n Available = 'available',\n /**\n * Either the last request to the RPC endpoint was either too slow, or the\n * endpoint is consistently returning errors and the number of retries has\n * been reached.\n */\n Degraded = 'degraded',\n /**\n * The RPC endpoint is consistently returning enough 5xx errors that requests\n * have been paused.\n */\n Unavailable = 'unavailable',\n /**\n * The RPC endpoint is inaccessible for the user based on their location. This\n * status only applies to Infura networks.\n */\n Blocked = 'blocked',\n}\n\nexport const INFURA_BLOCKED_KEY = 'countryBlocked';\n\n/**\n * A set of deprecated network ChainId.\n * The network controller will exclude those the networks begin as default network,\n * without the need to remove the network from constant list of controller-utils.\n */\nexport const DEPRECATED_NETWORKS = new Set<string>(['0xe704', '0x5']);\n"]}
@@ -1,26 +1,34 @@
1
1
  /**
2
- * Represents the availability state of the currently selected network.
2
+ * Represents the availability status of an RPC endpoint. (Regrettably, the
3
+ * name of this type is a misnomer.)
4
+ *
5
+ * The availability status is set both automatically (as requests are made) and
6
+ * manually (when `lookupNetwork` is called).
3
7
  */
4
8
  export declare enum NetworkStatus {
5
9
  /**
6
- * The network may or may not be able to receive requests, but either no
7
- * attempt has been made to determine this, or an attempt was made but was
8
- * unsuccessful.
10
+ * Either the availability status of the RPC endpoint has not been determined,
11
+ * or request that `lookupNetwork` performed returned an unknown error.
9
12
  */
10
13
  Unknown = "unknown",
11
14
  /**
12
- * The network is able to receive and respond to requests.
15
+ * The RPC endpoint is consistently returning successful (2xx) responses.
13
16
  */
14
17
  Available = "available",
15
18
  /**
16
- * The network was unable to receive and respond to requests for unknown
17
- * reasons.
19
+ * Either the last request to the RPC endpoint was either too slow, or the
20
+ * endpoint is consistently returning errors and the number of retries has
21
+ * been reached.
22
+ */
23
+ Degraded = "degraded",
24
+ /**
25
+ * The RPC endpoint is consistently returning enough 5xx errors that requests
26
+ * have been paused.
18
27
  */
19
28
  Unavailable = "unavailable",
20
29
  /**
21
- * The network is not only unavailable, but is also inaccessible for the user
22
- * specifically based on their location. This state only applies to Infura
23
- * networks.
30
+ * The RPC endpoint is inaccessible for the user based on their location. This
31
+ * status only applies to Infura networks.
24
32
  */
25
33
  Blocked = "blocked"
26
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa;IACvB;;;;OAIG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,SAAS,cAAc;IACvB;;;OAGG;IACH,WAAW,gBAAgB;IAC3B;;;;OAIG;IACH,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,aAAqC,CAAC"}
1
+ {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,aAAa;IACvB;;;OAGG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,SAAS,cAAc;IACvB;;;;OAIG;IACH,QAAQ,aAAa;IACrB;;;OAGG;IACH,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,aAAqC,CAAC"}
@@ -1,26 +1,34 @@
1
1
  /**
2
- * Represents the availability state of the currently selected network.
2
+ * Represents the availability status of an RPC endpoint. (Regrettably, the
3
+ * name of this type is a misnomer.)
4
+ *
5
+ * The availability status is set both automatically (as requests are made) and
6
+ * manually (when `lookupNetwork` is called).
3
7
  */
4
8
  export declare enum NetworkStatus {
5
9
  /**
6
- * The network may or may not be able to receive requests, but either no
7
- * attempt has been made to determine this, or an attempt was made but was
8
- * unsuccessful.
10
+ * Either the availability status of the RPC endpoint has not been determined,
11
+ * or request that `lookupNetwork` performed returned an unknown error.
9
12
  */
10
13
  Unknown = "unknown",
11
14
  /**
12
- * The network is able to receive and respond to requests.
15
+ * The RPC endpoint is consistently returning successful (2xx) responses.
13
16
  */
14
17
  Available = "available",
15
18
  /**
16
- * The network was unable to receive and respond to requests for unknown
17
- * reasons.
19
+ * Either the last request to the RPC endpoint was either too slow, or the
20
+ * endpoint is consistently returning errors and the number of retries has
21
+ * been reached.
22
+ */
23
+ Degraded = "degraded",
24
+ /**
25
+ * The RPC endpoint is consistently returning enough 5xx errors that requests
26
+ * have been paused.
18
27
  */
19
28
  Unavailable = "unavailable",
20
29
  /**
21
- * The network is not only unavailable, but is also inaccessible for the user
22
- * specifically based on their location. This state only applies to Infura
23
- * networks.
30
+ * The RPC endpoint is inaccessible for the user based on their location. This
31
+ * status only applies to Infura networks.
24
32
  */
25
33
  Blocked = "blocked"
26
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa;IACvB;;;;OAIG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,SAAS,cAAc;IACvB;;;OAGG;IACH,WAAW,gBAAgB;IAC3B;;;;OAIG;IACH,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,aAAqC,CAAC"}
1
+ {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,aAAa;IACvB;;;OAGG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,SAAS,cAAc;IACvB;;;;OAIG;IACH,QAAQ,aAAa;IACrB;;;OAGG;IACH,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,OAAO,YAAY;CACpB;AAED,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,aAAqC,CAAC"}
@@ -1,27 +1,35 @@
1
1
  /**
2
- * Represents the availability state of the currently selected network.
2
+ * Represents the availability status of an RPC endpoint. (Regrettably, the
3
+ * name of this type is a misnomer.)
4
+ *
5
+ * The availability status is set both automatically (as requests are made) and
6
+ * manually (when `lookupNetwork` is called).
3
7
  */
4
8
  export var NetworkStatus;
5
9
  (function (NetworkStatus) {
6
10
  /**
7
- * The network may or may not be able to receive requests, but either no
8
- * attempt has been made to determine this, or an attempt was made but was
9
- * unsuccessful.
11
+ * Either the availability status of the RPC endpoint has not been determined,
12
+ * or request that `lookupNetwork` performed returned an unknown error.
10
13
  */
11
14
  NetworkStatus["Unknown"] = "unknown";
12
15
  /**
13
- * The network is able to receive and respond to requests.
16
+ * The RPC endpoint is consistently returning successful (2xx) responses.
14
17
  */
15
18
  NetworkStatus["Available"] = "available";
16
19
  /**
17
- * The network was unable to receive and respond to requests for unknown
18
- * reasons.
20
+ * Either the last request to the RPC endpoint was either too slow, or the
21
+ * endpoint is consistently returning errors and the number of retries has
22
+ * been reached.
23
+ */
24
+ NetworkStatus["Degraded"] = "degraded";
25
+ /**
26
+ * The RPC endpoint is consistently returning enough 5xx errors that requests
27
+ * have been paused.
19
28
  */
20
29
  NetworkStatus["Unavailable"] = "unavailable";
21
30
  /**
22
- * The network is not only unavailable, but is also inaccessible for the user
23
- * specifically based on their location. This state only applies to Infura
24
- * networks.
31
+ * The RPC endpoint is inaccessible for the user based on their location. This
32
+ * status only applies to Infura networks.
25
33
  */
26
34
  NetworkStatus["Blocked"] = "blocked";
27
35
  })(NetworkStatus || (NetworkStatus = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,aAsBX;AAtBD,WAAY,aAAa;IACvB;;;;OAIG;IACH,oCAAmB,CAAA;IACnB;;OAEG;IACH,wCAAuB,CAAA;IACvB;;;OAGG;IACH,4CAA2B,CAAA;IAC3B;;;;OAIG;IACH,oCAAmB,CAAA;AACrB,CAAC,EAtBW,aAAa,KAAb,aAAa,QAsBxB;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Represents the availability state of the currently selected network.\n */\nexport enum NetworkStatus {\n /**\n * The network may or may not be able to receive requests, but either no\n * attempt has been made to determine this, or an attempt was made but was\n * unsuccessful.\n */\n Unknown = 'unknown',\n /**\n * The network is able to receive and respond to requests.\n */\n Available = 'available',\n /**\n * The network was unable to receive and respond to requests for unknown\n * reasons.\n */\n Unavailable = 'unavailable',\n /**\n * The network is not only unavailable, but is also inaccessible for the user\n * specifically based on their location. This state only applies to Infura\n * networks.\n */\n Blocked = 'blocked',\n}\n\nexport const INFURA_BLOCKED_KEY = 'countryBlocked';\n\n/**\n * A set of deprecated network ChainId.\n * The network controller will exclude those the networks begin as default network,\n * without the need to remove the network from constant list of controller-utils.\n */\nexport const DEPRECATED_NETWORKS = new Set<string>(['0xe704', '0x5']);\n"]}
1
+ {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,aA0BX;AA1BD,WAAY,aAAa;IACvB;;;OAGG;IACH,oCAAmB,CAAA;IACnB;;OAEG;IACH,wCAAuB,CAAA;IACvB;;;;OAIG;IACH,sCAAqB,CAAA;IACrB;;;OAGG;IACH,4CAA2B,CAAA;IAC3B;;;OAGG;IACH,oCAAmB,CAAA;AACrB,CAAC,EA1BW,aAAa,KAAb,aAAa,QA0BxB;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Represents the availability status of an RPC endpoint. (Regrettably, the\n * name of this type is a misnomer.)\n *\n * The availability status is set both automatically (as requests are made) and\n * manually (when `lookupNetwork` is called).\n */\nexport enum NetworkStatus {\n /**\n * Either the availability status of the RPC endpoint has not been determined,\n * or request that `lookupNetwork` performed returned an unknown error.\n */\n Unknown = 'unknown',\n /**\n * The RPC endpoint is consistently returning successful (2xx) responses.\n */\n Available = 'available',\n /**\n * Either the last request to the RPC endpoint was either too slow, or the\n * endpoint is consistently returning errors and the number of retries has\n * been reached.\n */\n Degraded = 'degraded',\n /**\n * The RPC endpoint is consistently returning enough 5xx errors that requests\n * have been paused.\n */\n Unavailable = 'unavailable',\n /**\n * The RPC endpoint is inaccessible for the user based on their location. This\n * status only applies to Infura networks.\n */\n Blocked = 'blocked',\n}\n\nexport const INFURA_BLOCKED_KEY = 'countryBlocked';\n\n/**\n * A set of deprecated network ChainId.\n * The network controller will exclude those the networks begin as default network,\n * without the need to remove the network from constant list of controller-utils.\n */\nexport const DEPRECATED_NETWORKS = new Set<string>(['0xe704', '0x5']);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/network-controller",
3
- "version": "26.0.0-preview-d6fe4594",
3
+ "version": "27.0.0-preview-84f90603",
4
4
  "description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object",
5
5
  "keywords": [
6
6
  "MetaMask",