@metamask-previews/network-controller
Advanced tools
Comparing version 12.1.2-preview.0f6a2fb to 12.1.2-preview.2f7e793
@@ -196,3 +196,7 @@ import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
}; | ||
export declare type NetworkControllerActions = NetworkControllerGetStateAction | NetworkControllerGetProviderConfigAction | NetworkControllerGetEthQueryAction; | ||
export declare type NetworkControllerGetNetworkClientByIdAction = { | ||
type: `NetworkController:getNetworkClientById`; | ||
handler: NetworkController['getNetworkClientById']; | ||
}; | ||
export declare type NetworkControllerActions = NetworkControllerGetStateAction | NetworkControllerGetProviderConfigAction | NetworkControllerGetEthQueryAction | NetworkControllerGetNetworkClientByIdAction; | ||
export declare type NetworkControllerMessenger = RestrictedControllerMessenger<typeof name, NetworkControllerActions, NetworkControllerEvents, string, string>; | ||
@@ -199,0 +203,0 @@ export declare type NetworkControllerOptions = { |
@@ -274,2 +274,3 @@ "use strict"; | ||
}); | ||
this.messagingSystem.registerActionHandler(`${this.name}:getNetworkClientById`, this.getNetworkClientById.bind(this)); | ||
__classPrivateFieldSet(this, _NetworkController_previousProviderConfig, this.state.providerConfig, "f"); | ||
@@ -337,3 +338,3 @@ } | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const isInfura = networkClientId in controller_utils_1.InfuraNetworkType; | ||
const isInfura = isInfuraProviderType(networkClientId); | ||
let updatedNetworkStatus; | ||
@@ -814,5 +815,2 @@ let updatedIsEIP1559Compatible; | ||
const ethQuery = new eth_query_1.default(networkClient.provider); | ||
if (!ethQuery) { | ||
throw new Error('Provider has not been initialized'); | ||
} | ||
return new Promise((resolve, reject) => { | ||
@@ -819,0 +817,0 @@ ethQuery.sendAsync({ method: 'eth_getBlockByNumber', params: ['latest', false] }, (error, block) => { |
{ | ||
"name": "@metamask-previews/network-controller", | ||
"version": "12.1.2-preview.0f6a2fb", | ||
"version": "12.1.2-preview.2f7e793", | ||
"description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
222742
1819