@metamask/network-controller 21.0.0 → 21.1.0
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/CHANGELOG.md +27 -1
- package/dist/NetworkController.cjs +1373 -0
- package/dist/NetworkController.cjs.map +1 -0
- package/dist/{types/NetworkController.d.ts → NetworkController.d.cts} +14 -14
- package/dist/NetworkController.d.cts.map +1 -0
- package/dist/NetworkController.d.mts +636 -0
- package/dist/NetworkController.d.mts.map +1 -0
- package/dist/NetworkController.mjs +1345 -23
- package/dist/NetworkController.mjs.map +1 -1
- package/dist/constants.cjs +32 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/{types/constants.d.ts → constants.d.cts} +1 -1
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +28 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +28 -9
- package/dist/constants.mjs.map +1 -1
- package/dist/create-auto-managed-network-client.cjs +134 -0
- package/dist/create-auto-managed-network-client.cjs.map +1 -0
- package/dist/{types/create-auto-managed-network-client.d.ts → create-auto-managed-network-client.d.cts} +2 -2
- package/dist/create-auto-managed-network-client.d.cts.map +1 -0
- package/dist/create-auto-managed-network-client.d.mts +47 -0
- package/dist/create-auto-managed-network-client.d.mts.map +1 -0
- package/dist/create-auto-managed-network-client.mjs +129 -9
- package/dist/create-auto-managed-network-client.mjs.map +1 -1
- package/dist/create-network-client.cjs +146 -0
- package/dist/create-network-client.cjs.map +1 -0
- package/dist/{types/create-network-client.d.ts → create-network-client.d.cts} +2 -2
- package/dist/create-network-client.d.cts.map +1 -0
- package/dist/create-network-client.d.mts +19 -0
- package/dist/create-network-client.d.mts.map +1 -0
- package/dist/create-network-client.mjs +143 -7
- package/dist/create-network-client.mjs.map +1 -1
- package/dist/index.cjs +27 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{types/index.d.ts → index.d.cts} +9 -9
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -28
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +7 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/{types/logger.d.ts → logger.d.cts} +2 -2
- package/dist/logger.d.cts.map +1 -0
- package/dist/logger.d.mts +5 -0
- package/dist/logger.d.mts.map +1 -0
- package/dist/logger.mjs +3 -9
- package/dist/logger.mjs.map +1 -1
- package/dist/types.cjs +12 -0
- package/dist/types.cjs.map +1 -0
- package/dist/{types/types.d.ts → types.d.cts} +5 -5
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +41 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +8 -7
- package/dist/types.mjs.map +1 -1
- package/package.json +20 -15
- package/dist/NetworkController.js +0 -25
- package/dist/NetworkController.js.map +0 -1
- package/dist/chunk-2QJYHWIP.mjs +0 -15
- package/dist/chunk-2QJYHWIP.mjs.map +0 -1
- package/dist/chunk-AU4UVIPZ.mjs +0 -11
- package/dist/chunk-AU4UVIPZ.mjs.map +0 -1
- package/dist/chunk-BV3ZGWII.mjs +0 -1485
- package/dist/chunk-BV3ZGWII.mjs.map +0 -1
- package/dist/chunk-E4V6XEBR.js +0 -125
- package/dist/chunk-E4V6XEBR.js.map +0 -1
- package/dist/chunk-KHZTS7TF.js +0 -11
- package/dist/chunk-KHZTS7TF.js.map +0 -1
- package/dist/chunk-LLMZDA4Q.js +0 -99
- package/dist/chunk-LLMZDA4Q.js.map +0 -1
- package/dist/chunk-TZA3CBEI.mjs +0 -99
- package/dist/chunk-TZA3CBEI.mjs.map +0 -1
- package/dist/chunk-U43RY4MY.mjs +0 -125
- package/dist/chunk-U43RY4MY.mjs.map +0 -1
- package/dist/chunk-VGYLDDJB.js +0 -9
- package/dist/chunk-VGYLDDJB.js.map +0 -1
- package/dist/chunk-VTLOAS2R.mjs +0 -9
- package/dist/chunk-VTLOAS2R.mjs.map +0 -1
- package/dist/chunk-XUI43LEZ.mjs +0 -30
- package/dist/chunk-XUI43LEZ.mjs.map +0 -1
- package/dist/chunk-YOHMQPGM.js +0 -1485
- package/dist/chunk-YOHMQPGM.js.map +0 -1
- package/dist/chunk-Z4BLTVTB.js +0 -30
- package/dist/chunk-Z4BLTVTB.js.map +0 -1
- package/dist/chunk-ZKNI7MD3.js +0 -15
- package/dist/chunk-ZKNI7MD3.js.map +0 -1
- package/dist/constants.js +0 -10
- package/dist/constants.js.map +0 -1
- package/dist/create-auto-managed-network-client.js +0 -10
- package/dist/create-auto-managed-network-client.js.map +0 -1
- package/dist/create-network-client.js +0 -9
- package/dist/create-network-client.js.map +0 -1
- package/dist/index.js +0 -29
- package/dist/index.js.map +0 -1
- package/dist/logger.js +0 -10
- package/dist/logger.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/NetworkController.d.ts.map +0 -1
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/create-auto-managed-network-client.d.ts.map +0 -1
- package/dist/types/create-network-client.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types.js +0 -8
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,636 @@
|
|
|
1
|
+
import type { ControllerGetStateAction, ControllerStateChangeEvent, RestrictedControllerMessenger } from "@metamask/base-controller";
|
|
2
|
+
import { BaseController } from "@metamask/base-controller";
|
|
3
|
+
import type { Partialize } from "@metamask/controller-utils";
|
|
4
|
+
import { InfuraNetworkType } from "@metamask/controller-utils";
|
|
5
|
+
import EthQuery from "@metamask/eth-query";
|
|
6
|
+
import type { SwappableProxy } from "@metamask/swappable-obj-proxy";
|
|
7
|
+
import type { Hex } from "@metamask/utils";
|
|
8
|
+
import type { Draft } from "immer";
|
|
9
|
+
import type { Logger } from "loglevel";
|
|
10
|
+
import { NetworkStatus } from "./constants.mjs";
|
|
11
|
+
import type { AutoManagedNetworkClient, ProxyWithAccessibleTarget } from "./create-auto-managed-network-client.mjs";
|
|
12
|
+
import { NetworkClientType } from "./types.mjs";
|
|
13
|
+
import type { BlockTracker, Provider, CustomNetworkClientConfiguration, InfuraNetworkClientConfiguration } from "./types.mjs";
|
|
14
|
+
export type Block = {
|
|
15
|
+
baseFeePerGas?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Information about a network not held by any other part of state.
|
|
19
|
+
*/
|
|
20
|
+
export type NetworkMetadata = {
|
|
21
|
+
/**
|
|
22
|
+
* EIPs supported by the network.
|
|
23
|
+
*/
|
|
24
|
+
EIPS: {
|
|
25
|
+
[eipNumber: number]: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Indicates the availability of the network
|
|
29
|
+
*/
|
|
30
|
+
status: NetworkStatus;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The type of an RPC endpoint.
|
|
34
|
+
*
|
|
35
|
+
* @see {@link CustomRpcEndpoint}
|
|
36
|
+
* @see {@link InfuraRpcEndpoint}
|
|
37
|
+
*/
|
|
38
|
+
export declare enum RpcEndpointType {
|
|
39
|
+
Custom = "custom",
|
|
40
|
+
Infura = "infura"
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* An Infura RPC endpoint is a reference to a specific network that Infura
|
|
44
|
+
* supports as well as an Infura account we own that we allow users to make use
|
|
45
|
+
* of for free. We need to disambiguate these endpoints from custom RPC
|
|
46
|
+
* endpoints, because while the types for these kinds of object both have the
|
|
47
|
+
* same interface, the URL for an Infura endpoint contains the Infura project
|
|
48
|
+
* ID, and we don't want this to be present in state. We therefore hide it by
|
|
49
|
+
* representing it in the URL as `{infuraProjectId}`, which we replace this when
|
|
50
|
+
* create network clients. But we need to know somehow that we only need to do
|
|
51
|
+
* this replacement for Infura endpoints and not custom endpoints — hence the
|
|
52
|
+
* separate type.
|
|
53
|
+
*/
|
|
54
|
+
export type InfuraRpcEndpoint = {
|
|
55
|
+
/**
|
|
56
|
+
* The optional user-facing nickname of the endpoint.
|
|
57
|
+
*/
|
|
58
|
+
name?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The identifier for the network client that has been created for this RPC
|
|
61
|
+
* endpoint. This is also used to uniquely identify the RPC endpoint in a
|
|
62
|
+
* set of RPC endpoints as well: once assigned, it is used to determine
|
|
63
|
+
* whether the `name`, `type`, or `url` of the RPC endpoint has changed.
|
|
64
|
+
*/
|
|
65
|
+
networkClientId: BuiltInNetworkClientId;
|
|
66
|
+
/**
|
|
67
|
+
* The type of this endpoint, always "default".
|
|
68
|
+
*/
|
|
69
|
+
type: RpcEndpointType.Infura;
|
|
70
|
+
/**
|
|
71
|
+
* The URL of the endpoint. Expected to be a template with the string
|
|
72
|
+
* `{infuraProjectId}`, which will get replaced with the Infura project ID
|
|
73
|
+
* when the network client is created.
|
|
74
|
+
*/
|
|
75
|
+
url: `https://${InfuraNetworkType}.infura.io/v3/{infuraProjectId}`;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* A custom RPC endpoint is a reference to a user-defined server which fronts an
|
|
79
|
+
* EVM chain. It may refer to an Infura network, but only by coincidence.
|
|
80
|
+
*/
|
|
81
|
+
export type CustomRpcEndpoint = {
|
|
82
|
+
/**
|
|
83
|
+
* The optional user-facing nickname of the endpoint.
|
|
84
|
+
*/
|
|
85
|
+
name?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The identifier for the network client that has been created for this RPC
|
|
88
|
+
* endpoint. This is also used to uniquely identify the RPC endpoint in a
|
|
89
|
+
* set of RPC endpoints as well: once assigned, it is used to determine
|
|
90
|
+
* whether the `name`, `type`, or `url` of the RPC endpoint has changed.
|
|
91
|
+
*/
|
|
92
|
+
networkClientId: CustomNetworkClientId;
|
|
93
|
+
/**
|
|
94
|
+
* The type of this endpoint, always "custom".
|
|
95
|
+
*/
|
|
96
|
+
type: RpcEndpointType.Custom;
|
|
97
|
+
/**
|
|
98
|
+
* The URL of the endpoint.
|
|
99
|
+
*/
|
|
100
|
+
url: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* An RPC endpoint is a reference to a server which fronts an EVM chain. There
|
|
104
|
+
* are two varieties of RPC endpoints: Infura and custom.
|
|
105
|
+
*
|
|
106
|
+
* @see {@link CustomRpcEndpoint}
|
|
107
|
+
* @see {@link InfuraRpcEndpoint}
|
|
108
|
+
*/
|
|
109
|
+
export type RpcEndpoint = InfuraRpcEndpoint | CustomRpcEndpoint;
|
|
110
|
+
/**
|
|
111
|
+
* From a user perspective, a network configuration holds information about a
|
|
112
|
+
* network that a user can select through the client. A "network" in this sense
|
|
113
|
+
* can explicitly refer to an EVM chain that the user explicitly adds or doesn't
|
|
114
|
+
* need to add (because it comes shipped with the client). The properties here
|
|
115
|
+
* therefore directly map to fields that a user sees and can edit for a network
|
|
116
|
+
* within the client.
|
|
117
|
+
*
|
|
118
|
+
* Internally, a network configuration represents a single conceptual EVM chain,
|
|
119
|
+
* which is represented tangibly via multiple RPC endpoints. A "network" is then
|
|
120
|
+
* something for which a network client object is created automatically or
|
|
121
|
+
* created on demand when it is added to the client.
|
|
122
|
+
*/
|
|
123
|
+
export type NetworkConfiguration = {
|
|
124
|
+
/**
|
|
125
|
+
* A set of URLs that allows the user to view activity that has occurred on
|
|
126
|
+
* the chain.
|
|
127
|
+
*/
|
|
128
|
+
blockExplorerUrls: string[];
|
|
129
|
+
/**
|
|
130
|
+
* The ID of the chain. Represented in hexadecimal format with a leading "0x"
|
|
131
|
+
* instead of decimal format so that when viewed out of context it can be
|
|
132
|
+
* unambiguously interpreted.
|
|
133
|
+
*/
|
|
134
|
+
chainId: Hex;
|
|
135
|
+
/**
|
|
136
|
+
* A reference to a URL that the client will use by default to allow the user
|
|
137
|
+
* to view activity that has occurred on the chain. This index must refer to
|
|
138
|
+
* an item in `blockExplorerUrls`.
|
|
139
|
+
*/
|
|
140
|
+
defaultBlockExplorerUrlIndex?: number;
|
|
141
|
+
/**
|
|
142
|
+
* A reference to an RPC endpoint that all requests will use by default in order to
|
|
143
|
+
* interact with the chain. This index must refer to an item in
|
|
144
|
+
* `rpcEndpoints`.
|
|
145
|
+
*/
|
|
146
|
+
defaultRpcEndpointIndex: number;
|
|
147
|
+
/**
|
|
148
|
+
* The user-facing nickname assigned to the chain.
|
|
149
|
+
*/
|
|
150
|
+
name: string;
|
|
151
|
+
/**
|
|
152
|
+
* The name of the currency to use for the chain.
|
|
153
|
+
*/
|
|
154
|
+
nativeCurrency: string;
|
|
155
|
+
/**
|
|
156
|
+
* The collection of possible RPC endpoints that the client can use to
|
|
157
|
+
* interact with the chain.
|
|
158
|
+
*/
|
|
159
|
+
rpcEndpoints: RpcEndpoint[];
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* A custom RPC endpoint in a new network configuration, meant to be used in
|
|
163
|
+
* conjunction with `AddNetworkFields`.
|
|
164
|
+
*
|
|
165
|
+
* Custom RPC endpoints do not need a `networkClientId` property because it is
|
|
166
|
+
* assumed that they have not already been added and therefore network clients
|
|
167
|
+
* do not exist for them yet (and hence IDs need to be generated).
|
|
168
|
+
*/
|
|
169
|
+
export type AddNetworkCustomRpcEndpointFields = Omit<CustomRpcEndpoint, 'networkClientId'>;
|
|
170
|
+
/**
|
|
171
|
+
* A new network configuration that `addNetwork` takes.
|
|
172
|
+
*
|
|
173
|
+
* Custom RPC endpoints do not need a `networkClientId` property because it is
|
|
174
|
+
* assumed that they have not already been added and are not represented by
|
|
175
|
+
* network clients yet.
|
|
176
|
+
*/
|
|
177
|
+
export type AddNetworkFields = Omit<NetworkConfiguration, 'rpcEndpoints'> & {
|
|
178
|
+
rpcEndpoints: (InfuraRpcEndpoint | AddNetworkCustomRpcEndpointFields)[];
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* A custom RPC endpoint in an updated representation of a network
|
|
182
|
+
* configuration, meant to be used in conjunction with `UpdateNetworkFields`.
|
|
183
|
+
*
|
|
184
|
+
* Custom RPC endpoints do not need a `networkClientId` property because it is
|
|
185
|
+
* assumed that they have not already been added and therefore network clients
|
|
186
|
+
* do not exist for them yet (and hence IDs need to be generated).
|
|
187
|
+
*/
|
|
188
|
+
export type UpdateNetworkCustomRpcEndpointFields = Partialize<CustomRpcEndpoint, 'networkClientId'>;
|
|
189
|
+
/**
|
|
190
|
+
* An updated representation of an existing network configuration that
|
|
191
|
+
* `updateNetwork` takes.
|
|
192
|
+
*
|
|
193
|
+
* Custom RPC endpoints may or may not have a `networkClientId` property; if
|
|
194
|
+
* they do, then it is assumed that they already exist, and if not, then it is
|
|
195
|
+
* assumed that they are new and are not represented by network clients yet.
|
|
196
|
+
*/
|
|
197
|
+
export type UpdateNetworkFields = Omit<NetworkConfiguration, 'rpcEndpoints'> & {
|
|
198
|
+
rpcEndpoints: (InfuraRpcEndpoint | UpdateNetworkCustomRpcEndpointFields)[];
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* `Object.keys()` is intentionally generic: it returns the keys of an object,
|
|
202
|
+
* but it cannot make guarantees about the contents of that object, so the type
|
|
203
|
+
* of the keys is merely `string[]`. While this is technically accurate, it is
|
|
204
|
+
* also unnecessary if we have an object that we own and whose contents are
|
|
205
|
+
* known exactly.
|
|
206
|
+
*
|
|
207
|
+
* TODO: Move to @metamask/utils.
|
|
208
|
+
*
|
|
209
|
+
* @param object - The object.
|
|
210
|
+
* @returns The keys of an object, typed according to the type of the object
|
|
211
|
+
* itself.
|
|
212
|
+
*/
|
|
213
|
+
export declare function knownKeysOf<K extends PropertyKey>(object: Partial<Record<K, any>>): K[];
|
|
214
|
+
/**
|
|
215
|
+
* The string that uniquely identifies an Infura network client.
|
|
216
|
+
*/
|
|
217
|
+
export type BuiltInNetworkClientId = InfuraNetworkType;
|
|
218
|
+
/**
|
|
219
|
+
* The string that uniquely identifies a custom network client.
|
|
220
|
+
*/
|
|
221
|
+
export type CustomNetworkClientId = string;
|
|
222
|
+
/**
|
|
223
|
+
* The string that uniquely identifies a network client.
|
|
224
|
+
*/
|
|
225
|
+
export type NetworkClientId = BuiltInNetworkClientId | CustomNetworkClientId;
|
|
226
|
+
/**
|
|
227
|
+
* Extra information about each network, such as whether it is accessible or
|
|
228
|
+
* blocked and whether it supports EIP-1559, keyed by network client ID.
|
|
229
|
+
*/
|
|
230
|
+
export type NetworksMetadata = Record<NetworkClientId, NetworkMetadata>;
|
|
231
|
+
/**
|
|
232
|
+
* The state that NetworkController stores.
|
|
233
|
+
*/
|
|
234
|
+
export type NetworkState = {
|
|
235
|
+
/**
|
|
236
|
+
* The ID of the network client that the proxies returned by
|
|
237
|
+
* `getSelectedNetworkClient` currently point to.
|
|
238
|
+
*/
|
|
239
|
+
selectedNetworkClientId: NetworkClientId;
|
|
240
|
+
/**
|
|
241
|
+
* The registry of networks and corresponding RPC endpoints that the
|
|
242
|
+
* controller can use to make requests for various chains.
|
|
243
|
+
*
|
|
244
|
+
* @see {@link NetworkConfiguration}
|
|
245
|
+
*/
|
|
246
|
+
networkConfigurationsByChainId: Record<Hex, NetworkConfiguration>;
|
|
247
|
+
/**
|
|
248
|
+
* Extra information about each network, such as whether it is accessible or
|
|
249
|
+
* blocked and whether it supports EIP-1559, keyed by network client ID.
|
|
250
|
+
*/
|
|
251
|
+
networksMetadata: NetworksMetadata;
|
|
252
|
+
};
|
|
253
|
+
declare const controllerName = "NetworkController";
|
|
254
|
+
/**
|
|
255
|
+
* Represents the block tracker for the currently selected network. (Note that
|
|
256
|
+
* this is a proxy around a proxy: the inner one exists so that the block
|
|
257
|
+
* tracker doesn't have to exist until it's used, and the outer one exists so
|
|
258
|
+
* that the currently selected network can change without consumers needing to
|
|
259
|
+
* refresh the object reference to that network.)
|
|
260
|
+
*/
|
|
261
|
+
export type BlockTrackerProxy = SwappableProxy<ProxyWithAccessibleTarget<BlockTracker>>;
|
|
262
|
+
/**
|
|
263
|
+
* Represents the provider for the currently selected network. (Note that this
|
|
264
|
+
* is a proxy around a proxy: the inner one exists so that the provider doesn't
|
|
265
|
+
* have to exist until it's used, and the outer one exists so that the currently
|
|
266
|
+
* selected network can change without consumers needing to refresh the object
|
|
267
|
+
* reference to that network.)
|
|
268
|
+
*/
|
|
269
|
+
export type ProviderProxy = SwappableProxy<ProxyWithAccessibleTarget<Provider>>;
|
|
270
|
+
export type NetworkControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, NetworkState>;
|
|
271
|
+
/**
|
|
272
|
+
* `networkWillChange` is published when the current network is about to be
|
|
273
|
+
* switched, but the new provider has not been created and no state changes have
|
|
274
|
+
* occurred yet.
|
|
275
|
+
*/
|
|
276
|
+
export type NetworkControllerNetworkWillChangeEvent = {
|
|
277
|
+
type: 'NetworkController:networkWillChange';
|
|
278
|
+
payload: [NetworkState];
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* `networkDidChange` is published after a provider has been created for a newly
|
|
282
|
+
* switched network (but before the network has been confirmed to be available).
|
|
283
|
+
*/
|
|
284
|
+
export type NetworkControllerNetworkDidChangeEvent = {
|
|
285
|
+
type: 'NetworkController:networkDidChange';
|
|
286
|
+
payload: [NetworkState];
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* `infuraIsBlocked` is published after the network is switched to an Infura
|
|
290
|
+
* network, but when Infura returns an error blocking the user based on their
|
|
291
|
+
* location.
|
|
292
|
+
*/
|
|
293
|
+
export type NetworkControllerInfuraIsBlockedEvent = {
|
|
294
|
+
type: 'NetworkController:infuraIsBlocked';
|
|
295
|
+
payload: [];
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* `infuraIsBlocked` is published either after the network is switched to an
|
|
299
|
+
* Infura network and Infura does not return an error blocking the user based on
|
|
300
|
+
* their location, or the network is switched to a non-Infura network.
|
|
301
|
+
*/
|
|
302
|
+
export type NetworkControllerInfuraIsUnblockedEvent = {
|
|
303
|
+
type: 'NetworkController:infuraIsUnblocked';
|
|
304
|
+
payload: [];
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* `networkAdded` is published after a network configuration is added to the
|
|
308
|
+
* network configuration registry and network clients are created for it.
|
|
309
|
+
*/
|
|
310
|
+
export type NetworkControllerNetworkAddedEvent = {
|
|
311
|
+
type: 'NetworkController:networkAdded';
|
|
312
|
+
payload: [networkConfiguration: NetworkConfiguration];
|
|
313
|
+
};
|
|
314
|
+
export type NetworkControllerEvents = NetworkControllerStateChangeEvent | NetworkControllerNetworkWillChangeEvent | NetworkControllerNetworkDidChangeEvent | NetworkControllerInfuraIsBlockedEvent | NetworkControllerInfuraIsUnblockedEvent | NetworkControllerNetworkAddedEvent;
|
|
315
|
+
export type NetworkControllerGetStateAction = ControllerGetStateAction<typeof controllerName, NetworkState>;
|
|
316
|
+
export type NetworkControllerGetEthQueryAction = {
|
|
317
|
+
type: `NetworkController:getEthQuery`;
|
|
318
|
+
handler: () => EthQuery | undefined;
|
|
319
|
+
};
|
|
320
|
+
export type NetworkControllerGetNetworkClientByIdAction = {
|
|
321
|
+
type: `NetworkController:getNetworkClientById`;
|
|
322
|
+
handler: NetworkController['getNetworkClientById'];
|
|
323
|
+
};
|
|
324
|
+
export type NetworkControllerGetSelectedNetworkClientAction = {
|
|
325
|
+
type: `NetworkController:getSelectedNetworkClient`;
|
|
326
|
+
handler: NetworkController['getSelectedNetworkClient'];
|
|
327
|
+
};
|
|
328
|
+
export type NetworkControllerGetEIP1559CompatibilityAction = {
|
|
329
|
+
type: `NetworkController:getEIP1559Compatibility`;
|
|
330
|
+
handler: NetworkController['getEIP1559Compatibility'];
|
|
331
|
+
};
|
|
332
|
+
export type NetworkControllerFindNetworkClientIdByChainIdAction = {
|
|
333
|
+
type: `NetworkController:findNetworkClientIdByChainId`;
|
|
334
|
+
handler: NetworkController['findNetworkClientIdByChainId'];
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* Change the currently selected network to the given built-in network type.
|
|
338
|
+
*
|
|
339
|
+
* @deprecated This action has been replaced by `setActiveNetwork`, and will be
|
|
340
|
+
* removed in a future release.
|
|
341
|
+
*/
|
|
342
|
+
export type NetworkControllerSetProviderTypeAction = {
|
|
343
|
+
type: `NetworkController:setProviderType`;
|
|
344
|
+
handler: NetworkController['setProviderType'];
|
|
345
|
+
};
|
|
346
|
+
export type NetworkControllerSetActiveNetworkAction = {
|
|
347
|
+
type: `NetworkController:setActiveNetwork`;
|
|
348
|
+
handler: NetworkController['setActiveNetwork'];
|
|
349
|
+
};
|
|
350
|
+
export type NetworkControllerGetNetworkConfigurationByChainId = {
|
|
351
|
+
type: `NetworkController:getNetworkConfigurationByChainId`;
|
|
352
|
+
handler: NetworkController['getNetworkConfigurationByChainId'];
|
|
353
|
+
};
|
|
354
|
+
export type NetworkControllerGetNetworkConfigurationByNetworkClientId = {
|
|
355
|
+
type: `NetworkController:getNetworkConfigurationByNetworkClientId`;
|
|
356
|
+
handler: NetworkController['getNetworkConfigurationByNetworkClientId'];
|
|
357
|
+
};
|
|
358
|
+
export type NetworkControllerActions = NetworkControllerGetStateAction | NetworkControllerGetEthQueryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerGetSelectedNetworkClientAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerFindNetworkClientIdByChainIdAction | NetworkControllerSetActiveNetworkAction | NetworkControllerSetProviderTypeAction | NetworkControllerGetNetworkConfigurationByChainId | NetworkControllerGetNetworkConfigurationByNetworkClientId;
|
|
359
|
+
export type NetworkControllerMessenger = RestrictedControllerMessenger<typeof controllerName, NetworkControllerActions, NetworkControllerEvents, never, never>;
|
|
360
|
+
export type NetworkControllerOptions = {
|
|
361
|
+
messenger: NetworkControllerMessenger;
|
|
362
|
+
infuraProjectId: string;
|
|
363
|
+
state?: Partial<NetworkState>;
|
|
364
|
+
log?: Logger;
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* Constructs properties for the NetworkController state whose values will be
|
|
368
|
+
* used if not provided to the constructor.
|
|
369
|
+
*
|
|
370
|
+
* @returns The default NetworkController state.
|
|
371
|
+
*/
|
|
372
|
+
export declare function getDefaultNetworkControllerState(): NetworkState;
|
|
373
|
+
/**
|
|
374
|
+
* Get a list of all network configurations.
|
|
375
|
+
*
|
|
376
|
+
* @param state - NetworkController state
|
|
377
|
+
* @returns A list of all available network configurations
|
|
378
|
+
*/
|
|
379
|
+
export declare function getNetworkConfigurations(state: NetworkState): NetworkConfiguration[];
|
|
380
|
+
/**
|
|
381
|
+
* Get a list of all available client IDs from a list of
|
|
382
|
+
* network configurations
|
|
383
|
+
* @param networkConfigurations - The array of network configurations
|
|
384
|
+
* @returns A list of all available client IDs
|
|
385
|
+
*/
|
|
386
|
+
export declare function getAvailableNetworkClientIds(networkConfigurations: NetworkConfiguration[]): string[];
|
|
387
|
+
export declare const selectAvailableNetworkClientIds: ((state: NetworkState) => string[]) & {
|
|
388
|
+
clearCache: () => void;
|
|
389
|
+
resultsCount: () => number;
|
|
390
|
+
resetResultsCount: () => void;
|
|
391
|
+
} & {
|
|
392
|
+
resultFunc: (resultFuncArgs_0: NetworkConfiguration[]) => string[];
|
|
393
|
+
memoizedResultFunc: ((resultFuncArgs_0: NetworkConfiguration[]) => string[]) & {
|
|
394
|
+
clearCache: () => void;
|
|
395
|
+
resultsCount: () => number;
|
|
396
|
+
resetResultsCount: () => void;
|
|
397
|
+
};
|
|
398
|
+
lastResult: () => string[];
|
|
399
|
+
dependencies: [typeof getNetworkConfigurations];
|
|
400
|
+
recomputations: () => number;
|
|
401
|
+
resetRecomputations: () => void;
|
|
402
|
+
dependencyRecomputations: () => number;
|
|
403
|
+
resetDependencyRecomputations: () => void;
|
|
404
|
+
} & {
|
|
405
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
406
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
407
|
+
};
|
|
408
|
+
/**
|
|
409
|
+
* The collection of auto-managed network clients that map to Infura networks.
|
|
410
|
+
*/
|
|
411
|
+
export type AutoManagedBuiltInNetworkClientRegistry = Record<BuiltInNetworkClientId, AutoManagedNetworkClient<InfuraNetworkClientConfiguration>>;
|
|
412
|
+
/**
|
|
413
|
+
* The collection of auto-managed network clients that map to Infura networks.
|
|
414
|
+
*/
|
|
415
|
+
export type AutoManagedCustomNetworkClientRegistry = Record<CustomNetworkClientId, AutoManagedNetworkClient<CustomNetworkClientConfiguration>>;
|
|
416
|
+
/**
|
|
417
|
+
* The collection of auto-managed network clients that map to Infura networks
|
|
418
|
+
* as well as custom networks that users have added.
|
|
419
|
+
*/
|
|
420
|
+
export type AutoManagedNetworkClientRegistry = {
|
|
421
|
+
[NetworkClientType.Infura]: AutoManagedBuiltInNetworkClientRegistry;
|
|
422
|
+
[NetworkClientType.Custom]: AutoManagedCustomNetworkClientRegistry;
|
|
423
|
+
};
|
|
424
|
+
/**
|
|
425
|
+
* Controller that creates and manages an Ethereum network provider.
|
|
426
|
+
*/
|
|
427
|
+
export declare class NetworkController extends BaseController<typeof controllerName, NetworkState, NetworkControllerMessenger> {
|
|
428
|
+
#private;
|
|
429
|
+
constructor({ messenger, state, infuraProjectId, log, }: NetworkControllerOptions);
|
|
430
|
+
/**
|
|
431
|
+
* Accesses the provider and block tracker for the currently selected network.
|
|
432
|
+
* @returns The proxy and block tracker proxies.
|
|
433
|
+
* @deprecated This method has been replaced by `getSelectedNetworkClient` (which has a more easily used return type) and will be removed in a future release.
|
|
434
|
+
*/
|
|
435
|
+
getProviderAndBlockTracker(): {
|
|
436
|
+
provider: SwappableProxy<ProxyWithAccessibleTarget<Provider>> | undefined;
|
|
437
|
+
blockTracker: SwappableProxy<ProxyWithAccessibleTarget<BlockTracker>> | undefined;
|
|
438
|
+
};
|
|
439
|
+
/**
|
|
440
|
+
* Accesses the provider and block tracker for the currently selected network.
|
|
441
|
+
*
|
|
442
|
+
* @returns an object with the provider and block tracker proxies for the currently selected network.
|
|
443
|
+
*/
|
|
444
|
+
getSelectedNetworkClient(): {
|
|
445
|
+
provider: SwappableProxy<ProxyWithAccessibleTarget<Provider>>;
|
|
446
|
+
blockTracker: SwappableProxy<ProxyWithAccessibleTarget<BlockTracker>>;
|
|
447
|
+
} | undefined;
|
|
448
|
+
/**
|
|
449
|
+
* Internally, the Infura and custom network clients are categorized by type
|
|
450
|
+
* so that when accessing either kind of network client, TypeScript knows
|
|
451
|
+
* which type to assign to the network client. For some cases it's more useful
|
|
452
|
+
* to be able to access network clients by ID instead of by type and then ID,
|
|
453
|
+
* so this function makes that possible.
|
|
454
|
+
*
|
|
455
|
+
* @returns The network clients registered so far, keyed by ID.
|
|
456
|
+
*/
|
|
457
|
+
getNetworkClientRegistry(): AutoManagedBuiltInNetworkClientRegistry & AutoManagedCustomNetworkClientRegistry;
|
|
458
|
+
/**
|
|
459
|
+
* Returns the Infura network client with the given ID.
|
|
460
|
+
*
|
|
461
|
+
* @param infuraNetworkClientId - An Infura network client ID.
|
|
462
|
+
* @returns The Infura network client.
|
|
463
|
+
* @throws If an Infura network client does not exist with the given ID.
|
|
464
|
+
*/
|
|
465
|
+
getNetworkClientById(infuraNetworkClientId: BuiltInNetworkClientId): AutoManagedNetworkClient<InfuraNetworkClientConfiguration>;
|
|
466
|
+
/**
|
|
467
|
+
* Returns the custom network client with the given ID.
|
|
468
|
+
*
|
|
469
|
+
* @param customNetworkClientId - A custom network client ID.
|
|
470
|
+
* @returns The custom network client.
|
|
471
|
+
* @throws If a custom network client does not exist with the given ID.
|
|
472
|
+
*/
|
|
473
|
+
getNetworkClientById(customNetworkClientId: CustomNetworkClientId): AutoManagedNetworkClient<CustomNetworkClientConfiguration>;
|
|
474
|
+
/**
|
|
475
|
+
* Ensures that network clients for Infura and custom RPC endpoints have been
|
|
476
|
+
* created. Then, consulting state, initializes and establishes the currently
|
|
477
|
+
* selected network client.
|
|
478
|
+
*/
|
|
479
|
+
initializeProvider(): Promise<void>;
|
|
480
|
+
/**
|
|
481
|
+
* Refreshes the network meta with EIP-1559 support and the network status
|
|
482
|
+
* based on the given network client ID.
|
|
483
|
+
*
|
|
484
|
+
* @param networkClientId - The ID of the network client to update.
|
|
485
|
+
*/
|
|
486
|
+
lookupNetworkByClientId(networkClientId: NetworkClientId): Promise<void>;
|
|
487
|
+
/**
|
|
488
|
+
* Persists the following metadata about the given or selected network to
|
|
489
|
+
* state:
|
|
490
|
+
*
|
|
491
|
+
* - The status of the network, namely, whether it is available, geo-blocked
|
|
492
|
+
* (Infura only), or unavailable, or whether the status is unknown
|
|
493
|
+
* - Whether the network supports EIP-1559, or whether it is unknown
|
|
494
|
+
*
|
|
495
|
+
* Note that it is possible for the network to be switched while this data is
|
|
496
|
+
* being collected. If that is the case, no metadata for the (now previously)
|
|
497
|
+
* selected network will be updated.
|
|
498
|
+
*
|
|
499
|
+
* @param networkClientId - The ID of the network client to update.
|
|
500
|
+
* If no ID is provided, uses the currently selected network.
|
|
501
|
+
*/
|
|
502
|
+
lookupNetwork(networkClientId?: NetworkClientId): Promise<void>;
|
|
503
|
+
/**
|
|
504
|
+
* Convenience method to update provider network type settings.
|
|
505
|
+
*
|
|
506
|
+
* @param type - Human readable network name.
|
|
507
|
+
* @deprecated This has been replaced by `setActiveNetwork`, and will be
|
|
508
|
+
* removed in a future release
|
|
509
|
+
*/
|
|
510
|
+
setProviderType(type: InfuraNetworkType): Promise<void>;
|
|
511
|
+
/**
|
|
512
|
+
* Changes the selected network.
|
|
513
|
+
*
|
|
514
|
+
* @param networkClientId - The ID of a network client that will be used to
|
|
515
|
+
* make requests.
|
|
516
|
+
* @param options - Options for this method.
|
|
517
|
+
* @param options.updateState - Allows for updating state.
|
|
518
|
+
* @throws if no network client is associated with the given
|
|
519
|
+
* network client ID.
|
|
520
|
+
*/
|
|
521
|
+
setActiveNetwork(networkClientId: string, options?: {
|
|
522
|
+
updateState?: (state: Draft<NetworkState>) => void;
|
|
523
|
+
}): Promise<void>;
|
|
524
|
+
/**
|
|
525
|
+
* Determines whether the network supports EIP-1559 by checking whether the
|
|
526
|
+
* latest block has a `baseFeePerGas` property, then updates state
|
|
527
|
+
* appropriately.
|
|
528
|
+
*
|
|
529
|
+
* @param networkClientId - The networkClientId to fetch the correct provider against which to check 1559 compatibility.
|
|
530
|
+
* @returns A promise that resolves to true if the network supports EIP-1559
|
|
531
|
+
* , false otherwise, or `undefined` if unable to determine the compatibility.
|
|
532
|
+
*/
|
|
533
|
+
getEIP1559Compatibility(networkClientId?: NetworkClientId): Promise<boolean | undefined>;
|
|
534
|
+
get1559CompatibilityWithNetworkClientId(networkClientId: NetworkClientId): Promise<boolean>;
|
|
535
|
+
/**
|
|
536
|
+
* Ensures that the provider and block tracker proxies are pointed to the
|
|
537
|
+
* currently selected network and refreshes the metadata for the
|
|
538
|
+
*/
|
|
539
|
+
resetConnection(): Promise<void>;
|
|
540
|
+
/**
|
|
541
|
+
* Returns the network configuration that has been filed under the given chain
|
|
542
|
+
* ID.
|
|
543
|
+
*
|
|
544
|
+
* @param chainId - The chain ID to use as a key.
|
|
545
|
+
* @returns The network configuration if one exists, or undefined.
|
|
546
|
+
*/
|
|
547
|
+
getNetworkConfigurationByChainId(chainId: Hex): NetworkConfiguration | undefined;
|
|
548
|
+
/**
|
|
549
|
+
* Returns the network configuration that contains an RPC endpoint with the
|
|
550
|
+
* given network client ID.
|
|
551
|
+
*
|
|
552
|
+
* @param networkClientId - The network client ID to use as a key.
|
|
553
|
+
* @returns The network configuration if one exists, or undefined.
|
|
554
|
+
*/
|
|
555
|
+
getNetworkConfigurationByNetworkClientId(networkClientId: NetworkClientId): NetworkConfiguration | undefined;
|
|
556
|
+
/**
|
|
557
|
+
* Creates and registers network clients for the collection of Infura and
|
|
558
|
+
* custom RPC endpoints that can be used to make requests for a particular
|
|
559
|
+
* chain, storing the given configuration object in state for later reference.
|
|
560
|
+
*
|
|
561
|
+
* @param fields - The object that describes the new network/chain and lists
|
|
562
|
+
* the RPC endpoints which front that chain.
|
|
563
|
+
* @returns The newly added network configuration.
|
|
564
|
+
* @throws if any part of `fields` would produce invalid state.
|
|
565
|
+
* @see {@link NetworkConfiguration}
|
|
566
|
+
*/
|
|
567
|
+
addNetwork(fields: AddNetworkFields): NetworkConfiguration;
|
|
568
|
+
/**
|
|
569
|
+
* Updates the configuration for a previously stored network filed under the
|
|
570
|
+
* given chain ID, creating + registering new network clients to represent RPC
|
|
571
|
+
* endpoints that have been added and destroying + unregistering existing
|
|
572
|
+
* network clients for RPC endpoints that have been removed.
|
|
573
|
+
*
|
|
574
|
+
* Note that if `chainId` is changed, then all network clients associated with
|
|
575
|
+
* that chain will be removed and re-added, even if none of the RPC endpoints
|
|
576
|
+
* have changed.
|
|
577
|
+
*
|
|
578
|
+
* @param chainId - The chain ID associated with an existing network.
|
|
579
|
+
* @param fields - The object that describes the updates to the network/chain,
|
|
580
|
+
* including the new set of RPC endpoints which should front that chain.
|
|
581
|
+
* @param options - Options to provide.
|
|
582
|
+
* @param options.replacementSelectedRpcEndpointIndex - Usually you cannot
|
|
583
|
+
* remove an RPC endpoint that is being represented by the currently selected
|
|
584
|
+
* network client. This option allows you to specify another RPC endpoint
|
|
585
|
+
* (either an existing one or a new one) that should be used to select a new
|
|
586
|
+
* network instead.
|
|
587
|
+
* @returns The updated network configuration.
|
|
588
|
+
* @throws if `chainId` does not refer to an existing network configuration,
|
|
589
|
+
* if any part of `fields` would produce invalid state, etc.
|
|
590
|
+
* @see {@link NetworkConfiguration}
|
|
591
|
+
*/
|
|
592
|
+
updateNetwork(chainId: Hex, fields: UpdateNetworkFields, { replacementSelectedRpcEndpointIndex, }?: {
|
|
593
|
+
replacementSelectedRpcEndpointIndex?: number;
|
|
594
|
+
}): Promise<NetworkConfiguration>;
|
|
595
|
+
/**
|
|
596
|
+
* Destroys and unregisters the network identified by the given chain ID, also
|
|
597
|
+
* removing the associated network configuration from state.
|
|
598
|
+
*
|
|
599
|
+
* @param chainId - The chain ID associated with an existing network.
|
|
600
|
+
* @throws if `chainId` does not refer to an existing network configuration,
|
|
601
|
+
* or if the currently selected network is being removed.
|
|
602
|
+
* @see {@link NetworkConfiguration}
|
|
603
|
+
*/
|
|
604
|
+
removeNetwork(chainId: Hex): void;
|
|
605
|
+
/**
|
|
606
|
+
* Assuming that the network has been previously switched, switches to this
|
|
607
|
+
* new network.
|
|
608
|
+
*
|
|
609
|
+
* If the network has not been previously switched, this method is equivalent
|
|
610
|
+
* to {@link resetConnection}.
|
|
611
|
+
*/
|
|
612
|
+
rollbackToPreviousProvider(): Promise<void>;
|
|
613
|
+
/**
|
|
614
|
+
* Deactivates the controller, stopping any ongoing polling.
|
|
615
|
+
*
|
|
616
|
+
* In-progress requests will not be aborted.
|
|
617
|
+
*/
|
|
618
|
+
destroy(): Promise<void>;
|
|
619
|
+
/**
|
|
620
|
+
* Merges the given backup data into controller state.
|
|
621
|
+
*
|
|
622
|
+
* @param backup - The data that has been backed up.
|
|
623
|
+
* @param backup.networkConfigurationsByChainId - Network configurations,
|
|
624
|
+
* keyed by chain ID.
|
|
625
|
+
*/
|
|
626
|
+
loadBackup({ networkConfigurationsByChainId, }: Pick<NetworkState, 'networkConfigurationsByChainId'>): void;
|
|
627
|
+
/**
|
|
628
|
+
* Searches for a network configuration ID with the given ChainID and returns it.
|
|
629
|
+
*
|
|
630
|
+
* @param chainId - ChainId to search for
|
|
631
|
+
* @returns networkClientId of the network configuration with the given chainId
|
|
632
|
+
*/
|
|
633
|
+
findNetworkClientIdByChainId(chainId: Hex): NetworkClientId;
|
|
634
|
+
}
|
|
635
|
+
export {};
|
|
636
|
+
//# sourceMappingURL=NetworkController.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkController.d.mts","sourceRoot":"","sources":["../src/NetworkController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,EAC9B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,mCAAmC;AAC7D,OAAO,EACL,iBAAiB,EAOlB,mCAAmC;AACpC,OAAO,QAAQ,4BAA4B;AAG3C,OAAO,KAAK,EAAE,cAAc,EAAE,sCAAsC;AACpE,OAAO,KAAK,EAA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