@metamask-previews/network-controller
Advanced tools
Comparing version 14.0.0-preview.7cc5454 to 14.0.0-preview.885fefd
@@ -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; |
@@ -198,3 +198,15 @@ import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
}; | ||
export declare type NetworkControllerActions = NetworkControllerGetStateAction | NetworkControllerGetProviderConfigAction | NetworkControllerGetEthQueryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerGetEIP1559CompatibilityAction; | ||
export declare type NetworkControllerFindNetworkClientIdByChainIdAction = { | ||
type: `NetworkController:findNetworkClientIdByChainId`; | ||
handler: NetworkController['findNetworkClientIdByChainId']; | ||
}; | ||
export declare type NetworkControllerSetProviderTypeAction = { | ||
type: `NetworkController:setProviderType`; | ||
handler: NetworkController['setProviderType']; | ||
}; | ||
export declare type NetworkControllerSetActiveNetworkAction = { | ||
type: `NetworkController:setActiveNetwork`; | ||
handler: NetworkController['setActiveNetwork']; | ||
}; | ||
export declare type NetworkControllerActions = NetworkControllerGetStateAction | NetworkControllerGetProviderConfigAction | NetworkControllerGetEthQueryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerSetActiveNetworkAction | NetworkControllerSetProviderTypeAction; | ||
export declare type NetworkControllerMessenger = RestrictedControllerMessenger<typeof name, NetworkControllerActions, NetworkControllerEvents, string, string>; | ||
@@ -201,0 +213,0 @@ export declare type NetworkControllerOptions = { |
@@ -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,3 +649,2 @@ } | ||
rpcUrl, | ||
ticker, | ||
}); | ||
@@ -761,2 +760,3 @@ } | ||
const networkClient = this.getNetworkClientById(networkClientId); | ||
// @ts-expect-error TODO: Provider type alignment | ||
const ethQuery = new eth_query_1.default(networkClient.provider); | ||
@@ -810,3 +810,2 @@ return new Promise((resolve, reject) => { | ||
chainId: controller_utils_1.BUILT_IN_NETWORKS[network].chainId, | ||
ticker: controller_utils_1.BUILT_IN_NETWORKS[network].ticker, | ||
}; | ||
@@ -832,3 +831,2 @@ return [ | ||
rpcUrl: networkConfiguration.rpcUrl, | ||
ticker: networkConfiguration.ticker, | ||
}; | ||
@@ -850,3 +848,2 @@ return [ | ||
type: types_1.NetworkClientType.Custom, | ||
ticker: providerConfig.ticker, | ||
}; | ||
@@ -916,4 +913,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,3 +23,2 @@ * The type of network client that can be created. | ||
rpcUrl: string; | ||
ticker: string; | ||
type: NetworkClientType.Custom; | ||
@@ -33,3 +34,2 @@ }; | ||
infuraProjectId: string; | ||
ticker: string; | ||
type: NetworkClientType.Infura; | ||
@@ -36,0 +36,0 @@ }; |
{ | ||
"name": "@metamask-previews/network-controller", | ||
"version": "14.0.0-preview.7cc5454", | ||
"version": "14.0.0-preview.885fefd", | ||
"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.1.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
221391
1777
+ 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/safe-event-emitter@2.0.0(transitive)
- Removed@metamask/utils@3.6.04.0.05.0.2(transitive)
- Removed@scure/base@1.2.4(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