@metamask-previews/network-controller
Advanced tools
Comparing version 14.0.0-preview.ce06456 to 15.0.0-preview.72e94e9
@@ -9,2 +9,11 @@ # Changelog | ||
## [15.0.0] | ||
### Changed | ||
- **BREAKING:** Bump dependency on `@metamask/eth-json-rpc-infura` to ^9.0.0 ([#1653](https://github.com/MetaMask/core/pull/1653)) | ||
- **BREAKING:** Bump dependency on `@metamask/eth-json-rpc-middleware` to ^12.0.0 ([#1653](https://github.com/MetaMask/core/pull/1653)) | ||
- **BREAKING:** Move from `json-rpc-engine` ^7.1.1 to `@metamask/json-rpc-engine` ^8.0.0 ([#1653](https://github.com/MetaMask/core/pull/1653)) | ||
- **BREAKING:** Bump dependency on `eth-block-tracker` to ^8.0.0 ([#1653](https://github.com/MetaMask/core/pull/1653)) | ||
- Bump dependency on `@metamask/eth-json-rpc-provider` to ^2.1.0 ([#1653](https://github.com/MetaMask/core/pull/1653)) | ||
- Move from `eth-rpc-errors` ^4.0.2 to `@metamask/rpc-errors` ^6.1.0 ([#1653](https://github.com/MetaMask/core/pull/1653)) | ||
## [14.0.0] | ||
@@ -282,3 +291,4 @@ ### Added | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/network-controller@14.0.0...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/network-controller@15.0.0...HEAD | ||
[15.0.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@14.0.0...@metamask/network-controller@15.0.0 | ||
[14.0.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@13.0.1...@metamask/network-controller@14.0.0 | ||
@@ -285,0 +295,0 @@ [13.0.1]: https://github.com/MetaMask/core/compare/@metamask/network-controller@13.0.0...@metamask/network-controller@13.0.1 |
@@ -17,4 +17,4 @@ "use strict"; | ||
const eth_json_rpc_provider_1 = require("@metamask/eth-json-rpc-provider"); | ||
const json_rpc_engine_1 = require("@metamask/json-rpc-engine"); | ||
const eth_block_tracker_1 = require("eth-block-tracker"); | ||
const json_rpc_engine_1 = require("json-rpc-engine"); | ||
const types_1 = require("./types"); | ||
@@ -21,0 +21,0 @@ const SECOND = 1000; |
@@ -31,6 +31,6 @@ "use strict"; | ||
const eth_query_1 = __importDefault(require("@metamask/eth-query")); | ||
const rpc_errors_1 = require("@metamask/rpc-errors"); | ||
const swappable_obj_proxy_1 = require("@metamask/swappable-obj-proxy"); | ||
const utils_1 = require("@metamask/utils"); | ||
const assert_1 = require("assert"); | ||
const eth_rpc_errors_1 = require("eth-rpc-errors"); | ||
const uuid_1 = require("uuid"); | ||
@@ -338,3 +338,3 @@ const constants_1 = require("./constants"); | ||
} | ||
else if (error.code === eth_rpc_errors_1.errorCodes.rpc.internal) { | ||
else if (error.code === rpc_errors_1.errorCodes.rpc.internal) { | ||
updatedNetworkStatus = constants_1.NetworkStatus.Unknown; | ||
@@ -428,3 +428,3 @@ } | ||
} | ||
else if (error.code === eth_rpc_errors_1.errorCodes.rpc.internal) { | ||
else if (error.code === rpc_errors_1.errorCodes.rpc.internal) { | ||
updatedNetworkStatus = constants_1.NetworkStatus.Unknown; | ||
@@ -649,2 +649,3 @@ } | ||
rpcUrl, | ||
ticker, | ||
}); | ||
@@ -760,2 +761,3 @@ } | ||
const networkClient = this.getNetworkClientById(networkClientId); | ||
// @ts-expect-error TODO: Provider type alignment | ||
const ethQuery = new eth_query_1.default(networkClient.provider); | ||
@@ -809,2 +811,3 @@ return new Promise((resolve, reject) => { | ||
chainId: controller_utils_1.BUILT_IN_NETWORKS[network].chainId, | ||
ticker: controller_utils_1.BUILT_IN_NETWORKS[network].ticker, | ||
}; | ||
@@ -830,2 +833,3 @@ return [ | ||
rpcUrl: networkConfiguration.rpcUrl, | ||
ticker: networkConfiguration.ticker, | ||
}; | ||
@@ -847,2 +851,3 @@ return [ | ||
type: types_1.NetworkClientType.Custom, | ||
ticker: providerConfig.ticker, | ||
}; | ||
@@ -912,4 +917,5 @@ return [ | ||
} | ||
// @ts-expect-error TODO: Provider type alignment | ||
__classPrivateFieldSet(this, _NetworkController_ethQuery, new eth_query_1.default(__classPrivateFieldGet(this, _NetworkController_providerProxy, "f")), "f"); | ||
}; | ||
//# sourceMappingURL=NetworkController.js.map |
import type { InfuraNetworkType } from '@metamask/controller-utils'; | ||
import type { SafeEventEmitterProvider } from '@metamask/eth-json-rpc-provider'; | ||
import type { Hex } from '@metamask/utils'; | ||
import type { PollingBlockTracker } from 'eth-block-tracker'; | ||
import type { BlockTracker as BaseBlockTracker } from 'eth-block-tracker'; | ||
export declare type Provider = SafeEventEmitterProvider; | ||
export declare type BlockTracker = PollingBlockTracker; | ||
export declare type BlockTracker = BaseBlockTracker & { | ||
checkForLatestBlock(): Promise<string>; | ||
}; | ||
/** | ||
@@ -21,2 +23,3 @@ * The type of network client that can be created. | ||
rpcUrl: string; | ||
ticker: string; | ||
type: NetworkClientType.Custom; | ||
@@ -32,2 +35,3 @@ }; | ||
infuraProjectId: string; | ||
ticker: string; | ||
type: NetworkClientType.Infura; | ||
@@ -34,0 +38,0 @@ }; |
{ | ||
"name": "@metamask-previews/network-controller", | ||
"version": "14.0.0-preview.ce06456", | ||
"version": "15.0.0-preview.72e94e9", | ||
"description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object", | ||
@@ -34,13 +34,13 @@ "keywords": [ | ||
"@metamask/controller-utils": "^5.0.2", | ||
"@metamask/eth-json-rpc-infura": "^8.1.1", | ||
"@metamask/eth-json-rpc-middleware": "^11.0.2", | ||
"@metamask/eth-json-rpc-provider": "^1.0.0", | ||
"@metamask/eth-json-rpc-infura": "^9.0.0", | ||
"@metamask/eth-json-rpc-middleware": "^12.0.0", | ||
"@metamask/eth-json-rpc-provider": "^2.2.0", | ||
"@metamask/eth-query": "^3.0.1", | ||
"@metamask/json-rpc-engine": "^7.1.1", | ||
"@metamask/rpc-errors": "^6.1.0", | ||
"@metamask/swappable-obj-proxy": "^2.1.0", | ||
"@metamask/utils": "^8.1.0", | ||
"async-mutex": "^0.2.6", | ||
"eth-block-tracker": "^7.0.1", | ||
"eth-rpc-errors": "^4.0.2", | ||
"eth-block-tracker": "^8.0.0", | ||
"immer": "^9.0.6", | ||
"json-rpc-engine": "^6.1.0", | ||
"uuid": "^8.3.2" | ||
@@ -47,0 +47,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
221227
1770
+ Added@metamask/rpc-errors@^6.1.0
+ Added@metamask/abi-utils@2.0.4(transitive)
+ Added@metamask/eth-block-tracker@9.0.3(transitive)
+ Added@metamask/eth-json-rpc-infura@9.1.0(transitive)
+ Added@metamask/eth-json-rpc-middleware@12.1.2(transitive)
+ Added@metamask/eth-json-rpc-provider@2.3.23.0.2(transitive)
+ Added@metamask/eth-sig-util@7.0.3(transitive)
+ Added@metamask/json-rpc-engine@8.0.2(transitive)
+ Addedeth-block-tracker@8.1.0(transitive)
+ Addedklona@2.0.6(transitive)
+ Addedpify@5.0.0(transitive)
- Removedeth-rpc-errors@^4.0.2
- Removedjson-rpc-engine@^6.1.0
- Removed@metamask/abi-utils@1.2.0(transitive)
- Removed@metamask/eth-json-rpc-infura@8.1.1(transitive)
- Removed@metamask/eth-json-rpc-middleware@11.0.2(transitive)
- Removed@metamask/eth-json-rpc-provider@1.0.1(transitive)
- Removed@metamask/eth-sig-util@6.0.2(transitive)
- Removed@metamask/utils@3.6.04.0.05.0.2(transitive)
- Removed@scure/base@1.2.1(transitive)
- Removedclone@2.1.2(transitive)
- Removedeth-block-tracker@7.1.0(transitive)
- Removedeth-rpc-errors@4.0.3(transitive)
- Removedethjs-util@0.1.6(transitive)
- Removedjson-rpc-engine@6.1.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedsuperstruct@1.0.4(transitive)
- Removedtweetnacl-util@0.15.1(transitive)
Updatedeth-block-tracker@^8.0.0