@metamask-previews/network-controller 27.0.0-preview-2cd68d1 → 27.0.0-preview-db01d69
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/dist/NetworkController.cjs +6 -0
- package/dist/NetworkController.cjs.map +1 -1
- package/dist/NetworkController.d.cts.map +1 -1
- package/dist/NetworkController.d.mts.map +1 -1
- package/dist/NetworkController.mjs +7 -1
- package/dist/NetworkController.mjs.map +1 -1
- package/dist/constants.cjs +11 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +8 -0
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +8 -0
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +10 -0
- package/dist/constants.mjs.map +1 -1
- package/package.json +1 -1
package/dist/constants.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEPRECATED_NETWORKS = exports.INFURA_BLOCKED_KEY = exports.NetworkStatus = void 0;
|
|
3
|
+
exports.FALLBACK_INFURA_NETWORK_TYPE_MAPPING = exports.DEPRECATED_NETWORKS = exports.INFURA_BLOCKED_KEY = exports.NetworkStatus = void 0;
|
|
4
|
+
const controller_utils_1 = require("@metamask/controller-utils");
|
|
4
5
|
/**
|
|
5
6
|
* Represents the availability status of an RPC endpoint. (Regrettably, the
|
|
6
7
|
* name of this type is a misnomer.)
|
|
@@ -43,4 +44,13 @@ exports.INFURA_BLOCKED_KEY = 'countryBlocked';
|
|
|
43
44
|
* without the need to remove the network from constant list of controller-utils.
|
|
44
45
|
*/
|
|
45
46
|
exports.DEPRECATED_NETWORKS = new Set(['0xe704', '0x5']);
|
|
47
|
+
/**
|
|
48
|
+
* A mapping of network keys to their corresponding InfuraNetworkType keys.
|
|
49
|
+
* This is used to map the network keys to the InfuraNetworkType keys.
|
|
50
|
+
* For example, `monad-testnet` is mapped to `monad-testnet-infura`.
|
|
51
|
+
* This is used to map the network keys to the InfuraNetworkType keys.
|
|
52
|
+
*/
|
|
53
|
+
exports.FALLBACK_INFURA_NETWORK_TYPE_MAPPING = {
|
|
54
|
+
'monad-testnet': 'monad-testnet-infura',
|
|
55
|
+
};
|
|
46
56
|
//# sourceMappingURL=constants.cjs.map
|
package/dist/constants.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAE/D;;;;;;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;AAEtE;;;;;GAKG;AACU,QAAA,oCAAoC,GAAsC;IACrF,eAAe,EAAE,sBAAsB;CACxC,CAAA","sourcesContent":["import { InfuraNetworkType } from \"@metamask/controller-utils\";\n\n/**\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\n/**\n * A mapping of network keys to their corresponding InfuraNetworkType keys.\n * This is used to map the network keys to the InfuraNetworkType keys.\n * For example, `monad-testnet` is mapped to `monad-testnet-infura`.\n * This is used to map the network keys to the InfuraNetworkType keys.\n */\nexport const FALLBACK_INFURA_NETWORK_TYPE_MAPPING: Record<string, InfuraNetworkType> = {\n 'monad-testnet': 'monad-testnet-infura',\n}\n"]}
|
package/dist/constants.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InfuraNetworkType } from "@metamask/controller-utils";
|
|
1
2
|
/**
|
|
2
3
|
* Represents the availability status of an RPC endpoint. (Regrettably, the
|
|
3
4
|
* name of this type is a misnomer.)
|
|
@@ -39,4 +40,11 @@ export declare const INFURA_BLOCKED_KEY = "countryBlocked";
|
|
|
39
40
|
* without the need to remove the network from constant list of controller-utils.
|
|
40
41
|
*/
|
|
41
42
|
export declare const DEPRECATED_NETWORKS: Set<string>;
|
|
43
|
+
/**
|
|
44
|
+
* A mapping of network keys to their corresponding InfuraNetworkType keys.
|
|
45
|
+
* This is used to map the network keys to the InfuraNetworkType keys.
|
|
46
|
+
* For example, `monad-testnet` is mapped to `monad-testnet-infura`.
|
|
47
|
+
* This is used to map the network keys to the InfuraNetworkType keys.
|
|
48
|
+
*/
|
|
49
|
+
export declare const FALLBACK_INFURA_NETWORK_TYPE_MAPPING: Record<string, InfuraNetworkType>;
|
|
42
50
|
//# sourceMappingURL=constants.d.cts.map
|
package/dist/constants.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mCAAmC;AAE/D;;;;;;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;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAElF,CAAA"}
|
package/dist/constants.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InfuraNetworkType } from "@metamask/controller-utils";
|
|
1
2
|
/**
|
|
2
3
|
* Represents the availability status of an RPC endpoint. (Regrettably, the
|
|
3
4
|
* name of this type is a misnomer.)
|
|
@@ -39,4 +40,11 @@ export declare const INFURA_BLOCKED_KEY = "countryBlocked";
|
|
|
39
40
|
* without the need to remove the network from constant list of controller-utils.
|
|
40
41
|
*/
|
|
41
42
|
export declare const DEPRECATED_NETWORKS: Set<string>;
|
|
43
|
+
/**
|
|
44
|
+
* A mapping of network keys to their corresponding InfuraNetworkType keys.
|
|
45
|
+
* This is used to map the network keys to the InfuraNetworkType keys.
|
|
46
|
+
* For example, `monad-testnet` is mapped to `monad-testnet-infura`.
|
|
47
|
+
* This is used to map the network keys to the InfuraNetworkType keys.
|
|
48
|
+
*/
|
|
49
|
+
export declare const FALLBACK_INFURA_NETWORK_TYPE_MAPPING: Record<string, InfuraNetworkType>;
|
|
42
50
|
//# sourceMappingURL=constants.d.mts.map
|
package/dist/constants.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mCAAmC;AAE/D;;;;;;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;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAElF,CAAA"}
|
package/dist/constants.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InfuraNetworkType } from "@metamask/controller-utils";
|
|
1
2
|
/**
|
|
2
3
|
* Represents the availability status of an RPC endpoint. (Regrettably, the
|
|
3
4
|
* name of this type is a misnomer.)
|
|
@@ -40,4 +41,13 @@ export const INFURA_BLOCKED_KEY = 'countryBlocked';
|
|
|
40
41
|
* without the need to remove the network from constant list of controller-utils.
|
|
41
42
|
*/
|
|
42
43
|
export const DEPRECATED_NETWORKS = new Set(['0xe704', '0x5']);
|
|
44
|
+
/**
|
|
45
|
+
* A mapping of network keys to their corresponding InfuraNetworkType keys.
|
|
46
|
+
* This is used to map the network keys to the InfuraNetworkType keys.
|
|
47
|
+
* For example, `monad-testnet` is mapped to `monad-testnet-infura`.
|
|
48
|
+
* This is used to map the network keys to the InfuraNetworkType keys.
|
|
49
|
+
*/
|
|
50
|
+
export const FALLBACK_INFURA_NETWORK_TYPE_MAPPING = {
|
|
51
|
+
'monad-testnet': 'monad-testnet-infura',
|
|
52
|
+
};
|
|
43
53
|
//# sourceMappingURL=constants.mjs.map
|
package/dist/constants.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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"]}
|
|
1
|
+
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mCAAmC;AAE/D;;;;;;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;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAsC;IACrF,eAAe,EAAE,sBAAsB;CACxC,CAAA","sourcesContent":["import { InfuraNetworkType } from \"@metamask/controller-utils\";\n\n/**\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\n/**\n * A mapping of network keys to their corresponding InfuraNetworkType keys.\n * This is used to map the network keys to the InfuraNetworkType keys.\n * For example, `monad-testnet` is mapped to `monad-testnet-infura`.\n * This is used to map the network keys to the InfuraNetworkType keys.\n */\nexport const FALLBACK_INFURA_NETWORK_TYPE_MAPPING: Record<string, InfuraNetworkType> = {\n 'monad-testnet': 'monad-testnet-infura',\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/network-controller",
|
|
3
|
-
"version": "27.0.0-preview-
|
|
3
|
+
"version": "27.0.0-preview-db01d69",
|
|
4
4
|
"description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|