@metamask-previews/network-controller 37.0.1-preview-7ef511c85 → 37.0.1-preview-cbae429b5
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 +0 -10
- package/dist/NetworkController.d.ts +100 -691
- package/dist/NetworkController.d.ts.map +1 -1
- package/dist/NetworkController.js +1 -142
- package/dist/NetworkController.js.map +1 -1
- package/package.json +9 -15
|
@@ -9,7 +9,6 @@ import type { PollingBlockTrackerOptions } from '@metamask/eth-block-tracker';
|
|
|
9
9
|
import EthQuery from '@metamask/eth-query';
|
|
10
10
|
import type { Messenger } from '@metamask/messenger';
|
|
11
11
|
import { RemoteFeatureFlagControllerGetStateAction, RemoteFeatureFlagControllerStateChangeEvent } from '@metamask/remote-feature-flag-controller';
|
|
12
|
-
import type { Infer } from '@metamask/superstruct';
|
|
13
12
|
import type { SwappableProxy } from '@metamask/swappable-obj-proxy';
|
|
14
13
|
import type { Hex } from '@metamask/utils';
|
|
15
14
|
import type { Draft } from 'immer';
|
|
@@ -25,6 +24,21 @@ import type { BlockTracker, Provider, CustomNetworkClientConfiguration, InfuraNe
|
|
|
25
24
|
export type Block = {
|
|
26
25
|
baseFeePerGas?: string;
|
|
27
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Information about a network not held by any other part of state.
|
|
29
|
+
*/
|
|
30
|
+
export type NetworkMetadata = {
|
|
31
|
+
/**
|
|
32
|
+
* EIPs supported by the network.
|
|
33
|
+
*/
|
|
34
|
+
EIPS: {
|
|
35
|
+
[eipNumber: number]: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Indicates the availability of the network
|
|
39
|
+
*/
|
|
40
|
+
status: NetworkStatus;
|
|
41
|
+
};
|
|
28
42
|
/**
|
|
29
43
|
* The type of an RPC endpoint.
|
|
30
44
|
*
|
|
@@ -35,116 +49,74 @@ export declare enum RpcEndpointType {
|
|
|
35
49
|
Custom = "custom",
|
|
36
50
|
Infura = "infura"
|
|
37
51
|
}
|
|
38
|
-
declare const NetworkClientIdStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
39
|
-
/**
|
|
40
|
-
* The string that uniquely identifies a network client.
|
|
41
|
-
*/
|
|
42
|
-
export type NetworkClientId = Infer<typeof NetworkClientIdStruct>;
|
|
43
|
-
declare const BuiltInNetworkClientIdStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
44
|
-
/**
|
|
45
|
-
* The string that uniquely identifies an Infura network client.
|
|
46
|
-
*/
|
|
47
|
-
export type BuiltInNetworkClientId = Infer<typeof BuiltInNetworkClientIdStruct>;
|
|
48
|
-
declare const CustomNetworkClientIdStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
49
52
|
/**
|
|
50
|
-
*
|
|
53
|
+
* An Infura RPC endpoint is a reference to a specific network that Infura
|
|
54
|
+
* supports as well as an Infura account we own that we allow users to make use
|
|
55
|
+
* of for free. We need to disambiguate these endpoints from custom RPC
|
|
56
|
+
* endpoints, because while the types for these kinds of object both have the
|
|
57
|
+
* same interface, the URL for an Infura endpoint contains the Infura project
|
|
58
|
+
* ID, and we don't want this to be present in state. We therefore hide it by
|
|
59
|
+
* representing it in the URL as `{infuraProjectId}`, which we replace this when
|
|
60
|
+
* create network clients. But we need to know somehow that we only need to do
|
|
61
|
+
* this replacement for Infura endpoints and not custom endpoints — hence the
|
|
62
|
+
* separate type.
|
|
51
63
|
*/
|
|
52
|
-
export type
|
|
53
|
-
declare const InfuraRpcEndpointStruct: import("@metamask/superstruct").Struct<{
|
|
54
|
-
failoverUrls?: string[] | undefined;
|
|
55
|
-
name?: string | undefined;
|
|
56
|
-
networkClientId: string;
|
|
57
|
-
type: RpcEndpointType.Infura;
|
|
58
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
59
|
-
}, {
|
|
64
|
+
export type InfuraRpcEndpoint = {
|
|
60
65
|
/**
|
|
61
66
|
* Alternate RPC endpoints to use when this endpoint is down.
|
|
62
67
|
*/
|
|
63
|
-
failoverUrls
|
|
68
|
+
failoverUrls?: string[];
|
|
64
69
|
/**
|
|
65
70
|
* The optional user-facing nickname of the endpoint.
|
|
66
71
|
*/
|
|
67
|
-
name
|
|
72
|
+
name?: string;
|
|
68
73
|
/**
|
|
69
74
|
* The identifier for the network client that has been created for this RPC
|
|
70
75
|
* endpoint. This is also used to uniquely identify the RPC endpoint in a
|
|
71
76
|
* set of RPC endpoints as well: once assigned, it is used to determine
|
|
72
77
|
* whether the `name`, `type`, or `url` of the RPC endpoint has changed.
|
|
73
78
|
*/
|
|
74
|
-
networkClientId:
|
|
79
|
+
networkClientId: BuiltInNetworkClientId;
|
|
75
80
|
/**
|
|
76
81
|
* The type of this endpoint, always "default".
|
|
77
82
|
*/
|
|
78
|
-
type:
|
|
83
|
+
type: RpcEndpointType.Infura;
|
|
79
84
|
/**
|
|
80
85
|
* The URL of the endpoint. Expected to be a template with the string
|
|
81
86
|
* `{infuraProjectId}`, which will get replaced with the Infura project ID
|
|
82
87
|
* when the network client is created.
|
|
83
88
|
*/
|
|
84
|
-
url:
|
|
85
|
-
}
|
|
89
|
+
url: `https://${InfuraNetworkType}.infura.io/v3/{infuraProjectId}`;
|
|
90
|
+
};
|
|
86
91
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* of for free. We need to disambiguate these endpoints from custom RPC
|
|
90
|
-
* endpoints, because while the types for these kinds of object both have the
|
|
91
|
-
* same interface, the URL for an Infura endpoint contains the Infura project
|
|
92
|
-
* ID, and we don't want this to be present in state. We therefore hide it by
|
|
93
|
-
* representing it in the URL as `{infuraProjectId}`, which we replace this when
|
|
94
|
-
* create network clients. But we need to know somehow that we only need to do
|
|
95
|
-
* this replacement for Infura endpoints and not custom endpoints — hence the
|
|
96
|
-
* separate type.
|
|
92
|
+
* A custom RPC endpoint is a reference to a user-defined server which fronts an
|
|
93
|
+
* EVM chain. It may refer to an Infura network, but only by coincidence.
|
|
97
94
|
*/
|
|
98
|
-
export type
|
|
99
|
-
declare const CustomRpcEndpointStruct: import("@metamask/superstruct").Struct<{
|
|
100
|
-
failoverUrls?: string[] | undefined;
|
|
101
|
-
name?: string | undefined;
|
|
102
|
-
networkClientId: string;
|
|
103
|
-
type: RpcEndpointType.Custom;
|
|
104
|
-
url: string;
|
|
105
|
-
}, {
|
|
95
|
+
export type CustomRpcEndpoint = {
|
|
106
96
|
/**
|
|
107
97
|
* Alternate RPC endpoints to use when this endpoint is down.
|
|
108
98
|
*/
|
|
109
|
-
failoverUrls
|
|
99
|
+
failoverUrls?: string[];
|
|
110
100
|
/**
|
|
111
101
|
* The optional user-facing nickname of the endpoint.
|
|
112
102
|
*/
|
|
113
|
-
name
|
|
103
|
+
name?: string;
|
|
114
104
|
/**
|
|
115
105
|
* The identifier for the network client that has been created for this RPC
|
|
116
106
|
* endpoint. This is also used to uniquely identify the RPC endpoint in a
|
|
117
107
|
* set of RPC endpoints as well: once assigned, it is used to determine
|
|
118
108
|
* whether the `name`, `type`, or `url` of the RPC endpoint has changed.
|
|
119
109
|
*/
|
|
120
|
-
networkClientId:
|
|
110
|
+
networkClientId: CustomNetworkClientId;
|
|
121
111
|
/**
|
|
122
112
|
* The type of this endpoint, always "custom".
|
|
123
113
|
*/
|
|
124
|
-
type:
|
|
114
|
+
type: RpcEndpointType.Custom;
|
|
125
115
|
/**
|
|
126
116
|
* The URL of the endpoint.
|
|
127
117
|
*/
|
|
128
|
-
url: import("@metamask/superstruct").Struct<string, null>;
|
|
129
|
-
}>;
|
|
130
|
-
/**
|
|
131
|
-
* A custom RPC endpoint is a reference to a user-defined server which fronts an
|
|
132
|
-
* EVM chain. It may refer to an Infura network, but only by coincidence.
|
|
133
|
-
*/
|
|
134
|
-
export type CustomRpcEndpoint = Infer<typeof CustomRpcEndpointStruct>;
|
|
135
|
-
declare const RpcEndpointStruct: import("@metamask/superstruct").Struct<{
|
|
136
|
-
failoverUrls?: string[] | undefined;
|
|
137
|
-
name?: string | undefined;
|
|
138
|
-
networkClientId: string;
|
|
139
|
-
type: RpcEndpointType.Infura;
|
|
140
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
141
|
-
} | {
|
|
142
|
-
failoverUrls?: string[] | undefined;
|
|
143
|
-
name?: string | undefined;
|
|
144
|
-
networkClientId: string;
|
|
145
|
-
type: RpcEndpointType.Custom;
|
|
146
118
|
url: string;
|
|
147
|
-
}
|
|
119
|
+
};
|
|
148
120
|
/**
|
|
149
121
|
* An RPC endpoint is a reference to a server which fronts an EVM chain. There
|
|
150
122
|
* are two varieties of RPC endpoints: Infura and custom.
|
|
@@ -152,141 +124,63 @@ declare const RpcEndpointStruct: import("@metamask/superstruct").Struct<{
|
|
|
152
124
|
* @see {@link CustomRpcEndpoint}
|
|
153
125
|
* @see {@link InfuraRpcEndpoint}
|
|
154
126
|
*/
|
|
155
|
-
export type RpcEndpoint =
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
failoverUrls?: string[] | undefined;
|
|
171
|
-
name?: string | undefined;
|
|
172
|
-
networkClientId: string;
|
|
173
|
-
type: RpcEndpointType.Custom;
|
|
174
|
-
url: string;
|
|
175
|
-
})[];
|
|
176
|
-
lastUpdatedAt?: number | undefined;
|
|
177
|
-
}, {
|
|
127
|
+
export type RpcEndpoint = InfuraRpcEndpoint | CustomRpcEndpoint;
|
|
128
|
+
/**
|
|
129
|
+
* From a user perspective, a network configuration holds information about a
|
|
130
|
+
* network that a user can select through the client. A "network" in this sense
|
|
131
|
+
* can explicitly refer to an EVM chain that the user explicitly adds or doesn't
|
|
132
|
+
* need to add (because it comes shipped with the client). The properties here
|
|
133
|
+
* therefore directly map to fields that a user sees and can edit for a network
|
|
134
|
+
* within the client.
|
|
135
|
+
*
|
|
136
|
+
* Internally, a network configuration represents a single conceptual EVM chain,
|
|
137
|
+
* which is represented tangibly via multiple RPC endpoints. A "network" is then
|
|
138
|
+
* something for which a network client object is created automatically or
|
|
139
|
+
* created on demand when it is added to the client.
|
|
140
|
+
*/
|
|
141
|
+
export type NetworkConfiguration = {
|
|
178
142
|
/**
|
|
179
143
|
* A set of URLs that allows the user to view activity that has occurred on
|
|
180
144
|
* the chain.
|
|
181
145
|
*/
|
|
182
|
-
blockExplorerUrls:
|
|
146
|
+
blockExplorerUrls: string[];
|
|
183
147
|
/**
|
|
184
148
|
* The ID of the chain. Represented in hexadecimal format with a leading "0x"
|
|
185
149
|
* instead of decimal format so that when viewed out of context it can be
|
|
186
150
|
* unambiguously interpreted.
|
|
187
151
|
*/
|
|
188
|
-
chainId:
|
|
152
|
+
chainId: Hex;
|
|
189
153
|
/**
|
|
190
154
|
* A reference to a URL that the client will use by default to allow the user
|
|
191
155
|
* to view activity that has occurred on the chain. This index must refer to
|
|
192
156
|
* an item in `blockExplorerUrls`.
|
|
193
157
|
*/
|
|
194
|
-
defaultBlockExplorerUrlIndex
|
|
158
|
+
defaultBlockExplorerUrlIndex?: number;
|
|
195
159
|
/**
|
|
196
160
|
* A reference to an RPC endpoint that all requests will use by default in order to
|
|
197
161
|
* interact with the chain. This index must refer to an item in
|
|
198
162
|
* `rpcEndpoints`.
|
|
199
163
|
*/
|
|
200
|
-
defaultRpcEndpointIndex:
|
|
164
|
+
defaultRpcEndpointIndex: number;
|
|
201
165
|
/**
|
|
202
166
|
* The user-facing nickname assigned to the chain.
|
|
203
167
|
*/
|
|
204
|
-
name:
|
|
168
|
+
name: string;
|
|
205
169
|
/**
|
|
206
170
|
* The name of the currency to use for the chain.
|
|
207
171
|
*/
|
|
208
|
-
nativeCurrency:
|
|
172
|
+
nativeCurrency: string;
|
|
209
173
|
/**
|
|
210
174
|
* The collection of possible RPC endpoints that the client can use to
|
|
211
175
|
* interact with the chain.
|
|
212
176
|
*/
|
|
213
|
-
rpcEndpoints:
|
|
214
|
-
failoverUrls?: string[] | undefined;
|
|
215
|
-
name?: string | undefined;
|
|
216
|
-
networkClientId: string;
|
|
217
|
-
type: RpcEndpointType.Infura;
|
|
218
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
219
|
-
} | {
|
|
220
|
-
failoverUrls?: string[] | undefined;
|
|
221
|
-
name?: string | undefined;
|
|
222
|
-
networkClientId: string;
|
|
223
|
-
type: RpcEndpointType.Custom;
|
|
224
|
-
url: string;
|
|
225
|
-
})[], import("@metamask/superstruct").Struct<{
|
|
226
|
-
failoverUrls?: string[] | undefined;
|
|
227
|
-
name?: string | undefined;
|
|
228
|
-
networkClientId: string;
|
|
229
|
-
type: RpcEndpointType.Infura;
|
|
230
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
231
|
-
} | {
|
|
232
|
-
failoverUrls?: string[] | undefined;
|
|
233
|
-
name?: string | undefined;
|
|
234
|
-
networkClientId: string;
|
|
235
|
-
type: RpcEndpointType.Custom;
|
|
236
|
-
url: string;
|
|
237
|
-
}, null>>;
|
|
177
|
+
rpcEndpoints: RpcEndpoint[];
|
|
238
178
|
/**
|
|
239
179
|
* Profile Sync - Network Sync field.
|
|
240
180
|
* Allows comparison of local network state with state to sync.
|
|
241
181
|
*/
|
|
242
|
-
lastUpdatedAt
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* From a user perspective, a network configuration holds information about a
|
|
246
|
-
* network that a user can select through the client. A "network" in this sense
|
|
247
|
-
* can explicitly refer to an EVM chain that the user explicitly adds or doesn't
|
|
248
|
-
* need to add (because it comes shipped with the client). The properties here
|
|
249
|
-
* therefore directly map to fields that a user sees and can edit for a network
|
|
250
|
-
* within the client.
|
|
251
|
-
*
|
|
252
|
-
* Internally, a network configuration represents a single conceptual EVM chain,
|
|
253
|
-
* which is represented tangibly via multiple RPC endpoints. A "network" is then
|
|
254
|
-
* something for which a network client object is created automatically or
|
|
255
|
-
* created on demand when it is added to the client.
|
|
256
|
-
*/
|
|
257
|
-
export type NetworkConfiguration = Infer<typeof NetworkConfigurationStruct>;
|
|
258
|
-
declare const NetworkMetadataStruct: import("@metamask/superstruct").Struct<{
|
|
259
|
-
EIPS: Record<string, boolean>;
|
|
260
|
-
status: NetworkStatus;
|
|
261
|
-
}, {
|
|
262
|
-
/**
|
|
263
|
-
* EIPs supported by the network.
|
|
264
|
-
*/
|
|
265
|
-
EIPS: import("@metamask/superstruct").Struct<Record<string, boolean>, null>;
|
|
266
|
-
/**
|
|
267
|
-
* Indicates the availability of the network
|
|
268
|
-
*/
|
|
269
|
-
status: import("@metamask/superstruct").Struct<NetworkStatus, {
|
|
270
|
-
available: NetworkStatus.Available;
|
|
271
|
-
blocked: NetworkStatus.Blocked;
|
|
272
|
-
degraded: NetworkStatus.Degraded;
|
|
273
|
-
unavailable: NetworkStatus.Unavailable;
|
|
274
|
-
unknown: NetworkStatus.Unknown;
|
|
275
|
-
}>;
|
|
276
|
-
}>;
|
|
277
|
-
/**
|
|
278
|
-
* Information about a network not held by any other part of state.
|
|
279
|
-
*/
|
|
280
|
-
export type NetworkMetadata = Infer<typeof NetworkMetadataStruct>;
|
|
281
|
-
declare const NetworksMetadataStruct: import("@metamask/superstruct").Struct<Record<string, {
|
|
282
|
-
EIPS: Record<string, boolean>;
|
|
283
|
-
status: NetworkStatus;
|
|
284
|
-
}>, null>;
|
|
285
|
-
/**
|
|
286
|
-
* Extra information about each network, such as whether it is accessible or
|
|
287
|
-
* blocked and whether it supports EIP-1559, keyed by network client ID.
|
|
288
|
-
*/
|
|
289
|
-
export type NetworksMetadata = Infer<typeof NetworksMetadataStruct>;
|
|
182
|
+
lastUpdatedAt?: number;
|
|
183
|
+
};
|
|
290
184
|
/**
|
|
291
185
|
* A custom RPC endpoint in a new network configuration, meant to be used in
|
|
292
186
|
* conjunction with `AddNetworkFields`.
|
|
@@ -340,81 +234,45 @@ export type UpdateNetworkFields = Omit<NetworkConfiguration, 'rpcEndpoints'> & {
|
|
|
340
234
|
* itself.
|
|
341
235
|
*/
|
|
342
236
|
export declare function knownKeysOf<Key extends PropertyKey>(object: Partial<Record<Key, any>>): Key[];
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
})[];
|
|
365
|
-
lastUpdatedAt?: number | undefined;
|
|
366
|
-
}>;
|
|
367
|
-
networksMetadata: Record<string, {
|
|
368
|
-
EIPS: Record<string, boolean>;
|
|
369
|
-
status: NetworkStatus;
|
|
370
|
-
}>;
|
|
371
|
-
}, {
|
|
237
|
+
/**
|
|
238
|
+
* The string that uniquely identifies an Infura network client.
|
|
239
|
+
*/
|
|
240
|
+
export type BuiltInNetworkClientId = string;
|
|
241
|
+
/**
|
|
242
|
+
* The string that uniquely identifies a custom network client.
|
|
243
|
+
*/
|
|
244
|
+
export type CustomNetworkClientId = string;
|
|
245
|
+
/**
|
|
246
|
+
* The string that uniquely identifies a network client.
|
|
247
|
+
*/
|
|
248
|
+
export type NetworkClientId = BuiltInNetworkClientId | CustomNetworkClientId;
|
|
249
|
+
/**
|
|
250
|
+
* Extra information about each network, such as whether it is accessible or
|
|
251
|
+
* blocked and whether it supports EIP-1559, keyed by network client ID.
|
|
252
|
+
*/
|
|
253
|
+
export type NetworksMetadata = Record<NetworkClientId, NetworkMetadata>;
|
|
254
|
+
/**
|
|
255
|
+
* The state that NetworkController stores.
|
|
256
|
+
*/
|
|
257
|
+
export type NetworkState = {
|
|
372
258
|
/**
|
|
373
259
|
* The ID of the network client that the proxies returned by
|
|
374
260
|
* `getSelectedNetworkClient` currently point to.
|
|
375
261
|
*/
|
|
376
|
-
selectedNetworkClientId:
|
|
262
|
+
selectedNetworkClientId: NetworkClientId;
|
|
377
263
|
/**
|
|
378
264
|
* The registry of networks and corresponding RPC endpoints that the
|
|
379
265
|
* controller can use to make requests for various chains.
|
|
380
266
|
*
|
|
381
267
|
* @see {@link NetworkConfiguration}
|
|
382
268
|
*/
|
|
383
|
-
networkConfigurationsByChainId:
|
|
384
|
-
blockExplorerUrls: string[];
|
|
385
|
-
chainId: `0x${string}`;
|
|
386
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
387
|
-
defaultRpcEndpointIndex: number;
|
|
388
|
-
name: string;
|
|
389
|
-
nativeCurrency: string;
|
|
390
|
-
rpcEndpoints: ({
|
|
391
|
-
failoverUrls?: string[] | undefined;
|
|
392
|
-
name?: string | undefined;
|
|
393
|
-
networkClientId: string;
|
|
394
|
-
type: RpcEndpointType.Infura;
|
|
395
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
396
|
-
} | {
|
|
397
|
-
failoverUrls?: string[] | undefined;
|
|
398
|
-
name?: string | undefined;
|
|
399
|
-
networkClientId: string;
|
|
400
|
-
type: RpcEndpointType.Custom;
|
|
401
|
-
url: string;
|
|
402
|
-
})[];
|
|
403
|
-
lastUpdatedAt?: number | undefined;
|
|
404
|
-
}>, null>;
|
|
269
|
+
networkConfigurationsByChainId: Record<Hex, NetworkConfiguration>;
|
|
405
270
|
/**
|
|
406
271
|
* Extra information about each network, such as whether it is accessible or
|
|
407
272
|
* blocked and whether it supports EIP-1559, keyed by network client ID.
|
|
408
273
|
*/
|
|
409
|
-
networksMetadata:
|
|
410
|
-
|
|
411
|
-
status: NetworkStatus;
|
|
412
|
-
}>, null>;
|
|
413
|
-
}>;
|
|
414
|
-
/**
|
|
415
|
-
* The state that NetworkController stores.
|
|
416
|
-
*/
|
|
417
|
-
export type NetworkState = Infer<typeof NetworkStateStruct>;
|
|
274
|
+
networksMetadata: NetworksMetadata;
|
|
275
|
+
};
|
|
418
276
|
declare const controllerName = "NetworkController";
|
|
419
277
|
/**
|
|
420
278
|
* Represents the block tracker for the currently selected network. (Note that
|
|
@@ -771,172 +629,18 @@ export declare function getNetworkConfigurations(state: NetworkState): NetworkCo
|
|
|
771
629
|
* @param state - NetworkController state
|
|
772
630
|
* @returns A list of all available network configurations
|
|
773
631
|
*/
|
|
774
|
-
export declare const selectNetworkConfigurations: ((state: {
|
|
775
|
-
selectedNetworkClientId: string;
|
|
776
|
-
networkConfigurationsByChainId: Record<`0x${string}`, {
|
|
777
|
-
blockExplorerUrls: string[];
|
|
778
|
-
chainId: `0x${string}`;
|
|
779
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
780
|
-
defaultRpcEndpointIndex: number;
|
|
781
|
-
name: string;
|
|
782
|
-
nativeCurrency: string;
|
|
783
|
-
rpcEndpoints: ({
|
|
784
|
-
failoverUrls?: string[] | undefined;
|
|
785
|
-
name?: string | undefined;
|
|
786
|
-
networkClientId: string;
|
|
787
|
-
type: RpcEndpointType.Infura;
|
|
788
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
789
|
-
} | {
|
|
790
|
-
failoverUrls?: string[] | undefined;
|
|
791
|
-
name?: string | undefined;
|
|
792
|
-
networkClientId: string;
|
|
793
|
-
type: RpcEndpointType.Custom;
|
|
794
|
-
url: string;
|
|
795
|
-
})[];
|
|
796
|
-
lastUpdatedAt?: number | undefined;
|
|
797
|
-
}>;
|
|
798
|
-
networksMetadata: Record<string, {
|
|
799
|
-
EIPS: Record<string, boolean>;
|
|
800
|
-
status: NetworkStatus;
|
|
801
|
-
}>;
|
|
802
|
-
}) => {
|
|
803
|
-
blockExplorerUrls: string[];
|
|
804
|
-
chainId: `0x${string}`;
|
|
805
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
806
|
-
defaultRpcEndpointIndex: number;
|
|
807
|
-
name: string;
|
|
808
|
-
nativeCurrency: string;
|
|
809
|
-
rpcEndpoints: ({
|
|
810
|
-
failoverUrls?: string[] | undefined;
|
|
811
|
-
name?: string | undefined;
|
|
812
|
-
networkClientId: string;
|
|
813
|
-
type: RpcEndpointType.Infura;
|
|
814
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
815
|
-
} | {
|
|
816
|
-
failoverUrls?: string[] | undefined;
|
|
817
|
-
name?: string | undefined;
|
|
818
|
-
networkClientId: string;
|
|
819
|
-
type: RpcEndpointType.Custom;
|
|
820
|
-
url: string;
|
|
821
|
-
})[];
|
|
822
|
-
lastUpdatedAt?: number | undefined;
|
|
823
|
-
}[]) & {
|
|
632
|
+
export declare const selectNetworkConfigurations: ((state: NetworkState) => NetworkConfiguration[]) & {
|
|
824
633
|
clearCache: () => void;
|
|
825
634
|
resultsCount: () => number;
|
|
826
635
|
resetResultsCount: () => void;
|
|
827
636
|
} & {
|
|
828
|
-
resultFunc: (resultFuncArgs_0: Record<`0x${string}`,
|
|
829
|
-
|
|
830
|
-
chainId: `0x${string}`;
|
|
831
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
832
|
-
defaultRpcEndpointIndex: number;
|
|
833
|
-
name: string;
|
|
834
|
-
nativeCurrency: string;
|
|
835
|
-
rpcEndpoints: ({
|
|
836
|
-
failoverUrls?: string[] | undefined;
|
|
837
|
-
name?: string | undefined;
|
|
838
|
-
networkClientId: string;
|
|
839
|
-
type: RpcEndpointType.Infura;
|
|
840
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
841
|
-
} | {
|
|
842
|
-
failoverUrls?: string[] | undefined;
|
|
843
|
-
name?: string | undefined;
|
|
844
|
-
networkClientId: string;
|
|
845
|
-
type: RpcEndpointType.Custom;
|
|
846
|
-
url: string;
|
|
847
|
-
})[];
|
|
848
|
-
lastUpdatedAt?: number | undefined;
|
|
849
|
-
}>) => {
|
|
850
|
-
blockExplorerUrls: string[];
|
|
851
|
-
chainId: `0x${string}`;
|
|
852
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
853
|
-
defaultRpcEndpointIndex: number;
|
|
854
|
-
name: string;
|
|
855
|
-
nativeCurrency: string;
|
|
856
|
-
rpcEndpoints: ({
|
|
857
|
-
failoverUrls?: string[] | undefined;
|
|
858
|
-
name?: string | undefined;
|
|
859
|
-
networkClientId: string;
|
|
860
|
-
type: RpcEndpointType.Infura;
|
|
861
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
862
|
-
} | {
|
|
863
|
-
failoverUrls?: string[] | undefined;
|
|
864
|
-
name?: string | undefined;
|
|
865
|
-
networkClientId: string;
|
|
866
|
-
type: RpcEndpointType.Custom;
|
|
867
|
-
url: string;
|
|
868
|
-
})[];
|
|
869
|
-
lastUpdatedAt?: number | undefined;
|
|
870
|
-
}[];
|
|
871
|
-
memoizedResultFunc: ((resultFuncArgs_0: Record<`0x${string}`, {
|
|
872
|
-
blockExplorerUrls: string[];
|
|
873
|
-
chainId: `0x${string}`;
|
|
874
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
875
|
-
defaultRpcEndpointIndex: number;
|
|
876
|
-
name: string;
|
|
877
|
-
nativeCurrency: string;
|
|
878
|
-
rpcEndpoints: ({
|
|
879
|
-
failoverUrls?: string[] | undefined;
|
|
880
|
-
name?: string | undefined;
|
|
881
|
-
networkClientId: string;
|
|
882
|
-
type: RpcEndpointType.Infura;
|
|
883
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
884
|
-
} | {
|
|
885
|
-
failoverUrls?: string[] | undefined;
|
|
886
|
-
name?: string | undefined;
|
|
887
|
-
networkClientId: string;
|
|
888
|
-
type: RpcEndpointType.Custom;
|
|
889
|
-
url: string;
|
|
890
|
-
})[];
|
|
891
|
-
lastUpdatedAt?: number | undefined;
|
|
892
|
-
}>) => {
|
|
893
|
-
blockExplorerUrls: string[];
|
|
894
|
-
chainId: `0x${string}`;
|
|
895
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
896
|
-
defaultRpcEndpointIndex: number;
|
|
897
|
-
name: string;
|
|
898
|
-
nativeCurrency: string;
|
|
899
|
-
rpcEndpoints: ({
|
|
900
|
-
failoverUrls?: string[] | undefined;
|
|
901
|
-
name?: string | undefined;
|
|
902
|
-
networkClientId: string;
|
|
903
|
-
type: RpcEndpointType.Infura;
|
|
904
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
905
|
-
} | {
|
|
906
|
-
failoverUrls?: string[] | undefined;
|
|
907
|
-
name?: string | undefined;
|
|
908
|
-
networkClientId: string;
|
|
909
|
-
type: RpcEndpointType.Custom;
|
|
910
|
-
url: string;
|
|
911
|
-
})[];
|
|
912
|
-
lastUpdatedAt?: number | undefined;
|
|
913
|
-
}[]) & {
|
|
637
|
+
resultFunc: (resultFuncArgs_0: Record<`0x${string}`, NetworkConfiguration>) => NetworkConfiguration[];
|
|
638
|
+
memoizedResultFunc: ((resultFuncArgs_0: Record<`0x${string}`, NetworkConfiguration>) => NetworkConfiguration[]) & {
|
|
914
639
|
clearCache: () => void;
|
|
915
640
|
resultsCount: () => number;
|
|
916
641
|
resetResultsCount: () => void;
|
|
917
642
|
};
|
|
918
|
-
lastResult: () =>
|
|
919
|
-
blockExplorerUrls: string[];
|
|
920
|
-
chainId: `0x${string}`;
|
|
921
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
922
|
-
defaultRpcEndpointIndex: number;
|
|
923
|
-
name: string;
|
|
924
|
-
nativeCurrency: string;
|
|
925
|
-
rpcEndpoints: ({
|
|
926
|
-
failoverUrls?: string[] | undefined;
|
|
927
|
-
name?: string | undefined;
|
|
928
|
-
networkClientId: string;
|
|
929
|
-
type: RpcEndpointType.Infura;
|
|
930
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
931
|
-
} | {
|
|
932
|
-
failoverUrls?: string[] | undefined;
|
|
933
|
-
name?: string | undefined;
|
|
934
|
-
networkClientId: string;
|
|
935
|
-
type: RpcEndpointType.Custom;
|
|
936
|
-
url: string;
|
|
937
|
-
})[];
|
|
938
|
-
lastUpdatedAt?: number | undefined;
|
|
939
|
-
}[];
|
|
643
|
+
lastResult: () => NetworkConfiguration[];
|
|
940
644
|
dependencies: [typeof selectNetworkConfigurationsByChainId];
|
|
941
645
|
recomputations: () => number;
|
|
942
646
|
resetRecomputations: () => void;
|
|
@@ -961,254 +665,30 @@ export declare function getAvailableNetworkClientIds(networkConfigurations: Netw
|
|
|
961
665
|
* @param state - NetworkController state
|
|
962
666
|
* @returns A list of all available network client IDs.
|
|
963
667
|
*/
|
|
964
|
-
export declare const selectAvailableNetworkClientIds: ((state: {
|
|
965
|
-
selectedNetworkClientId: string;
|
|
966
|
-
networkConfigurationsByChainId: Record<`0x${string}`, {
|
|
967
|
-
blockExplorerUrls: string[];
|
|
968
|
-
chainId: `0x${string}`;
|
|
969
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
970
|
-
defaultRpcEndpointIndex: number;
|
|
971
|
-
name: string;
|
|
972
|
-
nativeCurrency: string;
|
|
973
|
-
rpcEndpoints: ({
|
|
974
|
-
failoverUrls?: string[] | undefined;
|
|
975
|
-
name?: string | undefined;
|
|
976
|
-
networkClientId: string;
|
|
977
|
-
type: RpcEndpointType.Infura;
|
|
978
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
979
|
-
} | {
|
|
980
|
-
failoverUrls?: string[] | undefined;
|
|
981
|
-
name?: string | undefined;
|
|
982
|
-
networkClientId: string;
|
|
983
|
-
type: RpcEndpointType.Custom;
|
|
984
|
-
url: string;
|
|
985
|
-
})[];
|
|
986
|
-
lastUpdatedAt?: number | undefined;
|
|
987
|
-
}>;
|
|
988
|
-
networksMetadata: Record<string, {
|
|
989
|
-
EIPS: Record<string, boolean>;
|
|
990
|
-
status: NetworkStatus;
|
|
991
|
-
}>;
|
|
992
|
-
}) => string[]) & {
|
|
668
|
+
export declare const selectAvailableNetworkClientIds: ((state: NetworkState) => string[]) & {
|
|
993
669
|
clearCache: () => void;
|
|
994
670
|
resultsCount: () => number;
|
|
995
671
|
resetResultsCount: () => void;
|
|
996
672
|
} & {
|
|
997
|
-
resultFunc: (resultFuncArgs_0:
|
|
998
|
-
|
|
999
|
-
chainId: `0x${string}`;
|
|
1000
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1001
|
-
defaultRpcEndpointIndex: number;
|
|
1002
|
-
name: string;
|
|
1003
|
-
nativeCurrency: string;
|
|
1004
|
-
rpcEndpoints: ({
|
|
1005
|
-
failoverUrls?: string[] | undefined;
|
|
1006
|
-
name?: string | undefined;
|
|
1007
|
-
networkClientId: string;
|
|
1008
|
-
type: RpcEndpointType.Infura;
|
|
1009
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1010
|
-
} | {
|
|
1011
|
-
failoverUrls?: string[] | undefined;
|
|
1012
|
-
name?: string | undefined;
|
|
1013
|
-
networkClientId: string;
|
|
1014
|
-
type: RpcEndpointType.Custom;
|
|
1015
|
-
url: string;
|
|
1016
|
-
})[];
|
|
1017
|
-
lastUpdatedAt?: number | undefined;
|
|
1018
|
-
}[]) => string[];
|
|
1019
|
-
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
1020
|
-
blockExplorerUrls: string[];
|
|
1021
|
-
chainId: `0x${string}`;
|
|
1022
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1023
|
-
defaultRpcEndpointIndex: number;
|
|
1024
|
-
name: string;
|
|
1025
|
-
nativeCurrency: string;
|
|
1026
|
-
rpcEndpoints: ({
|
|
1027
|
-
failoverUrls?: string[] | undefined;
|
|
1028
|
-
name?: string | undefined;
|
|
1029
|
-
networkClientId: string;
|
|
1030
|
-
type: RpcEndpointType.Infura;
|
|
1031
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1032
|
-
} | {
|
|
1033
|
-
failoverUrls?: string[] | undefined;
|
|
1034
|
-
name?: string | undefined;
|
|
1035
|
-
networkClientId: string;
|
|
1036
|
-
type: RpcEndpointType.Custom;
|
|
1037
|
-
url: string;
|
|
1038
|
-
})[];
|
|
1039
|
-
lastUpdatedAt?: number | undefined;
|
|
1040
|
-
}[]) => string[]) & {
|
|
673
|
+
resultFunc: (resultFuncArgs_0: NetworkConfiguration[]) => string[];
|
|
674
|
+
memoizedResultFunc: ((resultFuncArgs_0: NetworkConfiguration[]) => string[]) & {
|
|
1041
675
|
clearCache: () => void;
|
|
1042
676
|
resultsCount: () => number;
|
|
1043
677
|
resetResultsCount: () => void;
|
|
1044
678
|
};
|
|
1045
679
|
lastResult: () => string[];
|
|
1046
|
-
dependencies: [((state: {
|
|
1047
|
-
selectedNetworkClientId: string;
|
|
1048
|
-
networkConfigurationsByChainId: Record<`0x${string}`, {
|
|
1049
|
-
blockExplorerUrls: string[];
|
|
1050
|
-
chainId: `0x${string}`;
|
|
1051
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1052
|
-
defaultRpcEndpointIndex: number;
|
|
1053
|
-
name: string;
|
|
1054
|
-
nativeCurrency: string;
|
|
1055
|
-
rpcEndpoints: ({
|
|
1056
|
-
failoverUrls?: string[] | undefined;
|
|
1057
|
-
name?: string | undefined;
|
|
1058
|
-
networkClientId: string;
|
|
1059
|
-
type: RpcEndpointType.Infura;
|
|
1060
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1061
|
-
} | {
|
|
1062
|
-
failoverUrls?: string[] | undefined;
|
|
1063
|
-
name?: string | undefined;
|
|
1064
|
-
networkClientId: string;
|
|
1065
|
-
type: RpcEndpointType.Custom;
|
|
1066
|
-
url: string;
|
|
1067
|
-
})[];
|
|
1068
|
-
lastUpdatedAt?: number | undefined;
|
|
1069
|
-
}>;
|
|
1070
|
-
networksMetadata: Record<string, {
|
|
1071
|
-
EIPS: Record<string, boolean>;
|
|
1072
|
-
status: NetworkStatus;
|
|
1073
|
-
}>;
|
|
1074
|
-
}) => {
|
|
1075
|
-
blockExplorerUrls: string[];
|
|
1076
|
-
chainId: `0x${string}`;
|
|
1077
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1078
|
-
defaultRpcEndpointIndex: number;
|
|
1079
|
-
name: string;
|
|
1080
|
-
nativeCurrency: string;
|
|
1081
|
-
rpcEndpoints: ({
|
|
1082
|
-
failoverUrls?: string[] | undefined;
|
|
1083
|
-
name?: string | undefined;
|
|
1084
|
-
networkClientId: string;
|
|
1085
|
-
type: RpcEndpointType.Infura;
|
|
1086
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1087
|
-
} | {
|
|
1088
|
-
failoverUrls?: string[] | undefined;
|
|
1089
|
-
name?: string | undefined;
|
|
1090
|
-
networkClientId: string;
|
|
1091
|
-
type: RpcEndpointType.Custom;
|
|
1092
|
-
url: string;
|
|
1093
|
-
})[];
|
|
1094
|
-
lastUpdatedAt?: number | undefined;
|
|
1095
|
-
}[]) & {
|
|
680
|
+
dependencies: [((state: NetworkState) => NetworkConfiguration[]) & {
|
|
1096
681
|
clearCache: () => void;
|
|
1097
682
|
resultsCount: () => number;
|
|
1098
683
|
resetResultsCount: () => void;
|
|
1099
684
|
} & {
|
|
1100
|
-
resultFunc: (resultFuncArgs_0: Record<`0x${string}`,
|
|
1101
|
-
|
|
1102
|
-
chainId: `0x${string}`;
|
|
1103
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1104
|
-
defaultRpcEndpointIndex: number;
|
|
1105
|
-
name: string;
|
|
1106
|
-
nativeCurrency: string;
|
|
1107
|
-
rpcEndpoints: ({
|
|
1108
|
-
failoverUrls?: string[] | undefined;
|
|
1109
|
-
name?: string | undefined;
|
|
1110
|
-
networkClientId: string;
|
|
1111
|
-
type: RpcEndpointType.Infura;
|
|
1112
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1113
|
-
} | {
|
|
1114
|
-
failoverUrls?: string[] | undefined;
|
|
1115
|
-
name?: string | undefined;
|
|
1116
|
-
networkClientId: string;
|
|
1117
|
-
type: RpcEndpointType.Custom;
|
|
1118
|
-
url: string;
|
|
1119
|
-
})[];
|
|
1120
|
-
lastUpdatedAt?: number | undefined;
|
|
1121
|
-
}>) => {
|
|
1122
|
-
blockExplorerUrls: string[];
|
|
1123
|
-
chainId: `0x${string}`;
|
|
1124
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1125
|
-
defaultRpcEndpointIndex: number;
|
|
1126
|
-
name: string;
|
|
1127
|
-
nativeCurrency: string;
|
|
1128
|
-
rpcEndpoints: ({
|
|
1129
|
-
failoverUrls?: string[] | undefined;
|
|
1130
|
-
name?: string | undefined;
|
|
1131
|
-
networkClientId: string;
|
|
1132
|
-
type: RpcEndpointType.Infura;
|
|
1133
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1134
|
-
} | {
|
|
1135
|
-
failoverUrls?: string[] | undefined;
|
|
1136
|
-
name?: string | undefined;
|
|
1137
|
-
networkClientId: string;
|
|
1138
|
-
type: RpcEndpointType.Custom;
|
|
1139
|
-
url: string;
|
|
1140
|
-
})[];
|
|
1141
|
-
lastUpdatedAt?: number | undefined;
|
|
1142
|
-
}[];
|
|
1143
|
-
memoizedResultFunc: ((resultFuncArgs_0: Record<`0x${string}`, {
|
|
1144
|
-
blockExplorerUrls: string[];
|
|
1145
|
-
chainId: `0x${string}`;
|
|
1146
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1147
|
-
defaultRpcEndpointIndex: number;
|
|
1148
|
-
name: string;
|
|
1149
|
-
nativeCurrency: string;
|
|
1150
|
-
rpcEndpoints: ({
|
|
1151
|
-
failoverUrls?: string[] | undefined;
|
|
1152
|
-
name?: string | undefined;
|
|
1153
|
-
networkClientId: string;
|
|
1154
|
-
type: RpcEndpointType.Infura;
|
|
1155
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1156
|
-
} | {
|
|
1157
|
-
failoverUrls?: string[] | undefined;
|
|
1158
|
-
name?: string | undefined;
|
|
1159
|
-
networkClientId: string;
|
|
1160
|
-
type: RpcEndpointType.Custom;
|
|
1161
|
-
url: string;
|
|
1162
|
-
})[];
|
|
1163
|
-
lastUpdatedAt?: number | undefined;
|
|
1164
|
-
}>) => {
|
|
1165
|
-
blockExplorerUrls: string[];
|
|
1166
|
-
chainId: `0x${string}`;
|
|
1167
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1168
|
-
defaultRpcEndpointIndex: number;
|
|
1169
|
-
name: string;
|
|
1170
|
-
nativeCurrency: string;
|
|
1171
|
-
rpcEndpoints: ({
|
|
1172
|
-
failoverUrls?: string[] | undefined;
|
|
1173
|
-
name?: string | undefined;
|
|
1174
|
-
networkClientId: string;
|
|
1175
|
-
type: RpcEndpointType.Infura;
|
|
1176
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1177
|
-
} | {
|
|
1178
|
-
failoverUrls?: string[] | undefined;
|
|
1179
|
-
name?: string | undefined;
|
|
1180
|
-
networkClientId: string;
|
|
1181
|
-
type: RpcEndpointType.Custom;
|
|
1182
|
-
url: string;
|
|
1183
|
-
})[];
|
|
1184
|
-
lastUpdatedAt?: number | undefined;
|
|
1185
|
-
}[]) & {
|
|
685
|
+
resultFunc: (resultFuncArgs_0: Record<`0x${string}`, NetworkConfiguration>) => NetworkConfiguration[];
|
|
686
|
+
memoizedResultFunc: ((resultFuncArgs_0: Record<`0x${string}`, NetworkConfiguration>) => NetworkConfiguration[]) & {
|
|
1186
687
|
clearCache: () => void;
|
|
1187
688
|
resultsCount: () => number;
|
|
1188
689
|
resetResultsCount: () => void;
|
|
1189
690
|
};
|
|
1190
|
-
lastResult: () =>
|
|
1191
|
-
blockExplorerUrls: string[];
|
|
1192
|
-
chainId: `0x${string}`;
|
|
1193
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1194
|
-
defaultRpcEndpointIndex: number;
|
|
1195
|
-
name: string;
|
|
1196
|
-
nativeCurrency: string;
|
|
1197
|
-
rpcEndpoints: ({
|
|
1198
|
-
failoverUrls?: string[] | undefined;
|
|
1199
|
-
name?: string | undefined;
|
|
1200
|
-
networkClientId: string;
|
|
1201
|
-
type: RpcEndpointType.Infura;
|
|
1202
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1203
|
-
} | {
|
|
1204
|
-
failoverUrls?: string[] | undefined;
|
|
1205
|
-
name?: string | undefined;
|
|
1206
|
-
networkClientId: string;
|
|
1207
|
-
type: RpcEndpointType.Custom;
|
|
1208
|
-
url: string;
|
|
1209
|
-
})[];
|
|
1210
|
-
lastUpdatedAt?: number | undefined;
|
|
1211
|
-
}[];
|
|
691
|
+
lastResult: () => NetworkConfiguration[];
|
|
1212
692
|
dependencies: [typeof selectNetworkConfigurationsByChainId];
|
|
1213
693
|
recomputations: () => number;
|
|
1214
694
|
resetRecomputations: () => void;
|
|
@@ -1247,77 +727,6 @@ export type AutoManagedNetworkClientRegistry = {
|
|
|
1247
727
|
*/
|
|
1248
728
|
export declare class NetworkController extends BaseController<typeof controllerName, NetworkState, NetworkControllerMessenger> {
|
|
1249
729
|
#private;
|
|
1250
|
-
static readonly struct: import("@metamask/superstruct").Struct<{
|
|
1251
|
-
selectedNetworkClientId: string;
|
|
1252
|
-
networkConfigurationsByChainId: Record<`0x${string}`, {
|
|
1253
|
-
blockExplorerUrls: string[];
|
|
1254
|
-
chainId: `0x${string}`;
|
|
1255
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1256
|
-
defaultRpcEndpointIndex: number;
|
|
1257
|
-
name: string;
|
|
1258
|
-
nativeCurrency: string;
|
|
1259
|
-
rpcEndpoints: ({
|
|
1260
|
-
failoverUrls?: string[] | undefined;
|
|
1261
|
-
name?: string | undefined;
|
|
1262
|
-
networkClientId: string;
|
|
1263
|
-
type: RpcEndpointType.Infura;
|
|
1264
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1265
|
-
} | {
|
|
1266
|
-
failoverUrls?: string[] | undefined;
|
|
1267
|
-
name?: string | undefined;
|
|
1268
|
-
networkClientId: string;
|
|
1269
|
-
type: RpcEndpointType.Custom;
|
|
1270
|
-
url: string;
|
|
1271
|
-
})[];
|
|
1272
|
-
lastUpdatedAt?: number | undefined;
|
|
1273
|
-
}>;
|
|
1274
|
-
networksMetadata: Record<string, {
|
|
1275
|
-
EIPS: Record<string, boolean>;
|
|
1276
|
-
status: NetworkStatus;
|
|
1277
|
-
}>;
|
|
1278
|
-
}, {
|
|
1279
|
-
/**
|
|
1280
|
-
* The ID of the network client that the proxies returned by
|
|
1281
|
-
* `getSelectedNetworkClient` currently point to.
|
|
1282
|
-
*/
|
|
1283
|
-
selectedNetworkClientId: import("@metamask/superstruct").Struct<string, null>;
|
|
1284
|
-
/**
|
|
1285
|
-
* The registry of networks and corresponding RPC endpoints that the
|
|
1286
|
-
* controller can use to make requests for various chains.
|
|
1287
|
-
*
|
|
1288
|
-
* @see {@link NetworkConfiguration}
|
|
1289
|
-
*/
|
|
1290
|
-
networkConfigurationsByChainId: import("@metamask/superstruct").Struct<Record<`0x${string}`, {
|
|
1291
|
-
blockExplorerUrls: string[];
|
|
1292
|
-
chainId: `0x${string}`;
|
|
1293
|
-
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
1294
|
-
defaultRpcEndpointIndex: number;
|
|
1295
|
-
name: string;
|
|
1296
|
-
nativeCurrency: string;
|
|
1297
|
-
rpcEndpoints: ({
|
|
1298
|
-
failoverUrls?: string[] | undefined;
|
|
1299
|
-
name?: string | undefined;
|
|
1300
|
-
networkClientId: string;
|
|
1301
|
-
type: RpcEndpointType.Infura;
|
|
1302
|
-
url: "https://arbitrum-mainnet.infura.io/v3/{infuraProjectId}" | "https://avalanche-mainnet.infura.io/v3/{infuraProjectId}" | "https://base-mainnet.infura.io/v3/{infuraProjectId}" | "https://bsc-mainnet.infura.io/v3/{infuraProjectId}" | "https://goerli.infura.io/v3/{infuraProjectId}" | "https://linea-goerli.infura.io/v3/{infuraProjectId}" | "https://linea-mainnet.infura.io/v3/{infuraProjectId}" | "https://linea-sepolia.infura.io/v3/{infuraProjectId}" | "https://mainnet.infura.io/v3/{infuraProjectId}" | "https://megaeth-mainnet.infura.io/v3/{infuraProjectId}" | "https://monad-mainnet.infura.io/v3/{infuraProjectId}" | "https://optimism-mainnet.infura.io/v3/{infuraProjectId}" | "https://polygon-mainnet.infura.io/v3/{infuraProjectId}" | "https://sei-mainnet.infura.io/v3/{infuraProjectId}" | "https://sepolia.infura.io/v3/{infuraProjectId}" | "https://zksync-mainnet.infura.io/v3/{infuraProjectId}";
|
|
1303
|
-
} | {
|
|
1304
|
-
failoverUrls?: string[] | undefined;
|
|
1305
|
-
name?: string | undefined;
|
|
1306
|
-
networkClientId: string;
|
|
1307
|
-
type: RpcEndpointType.Custom;
|
|
1308
|
-
url: string;
|
|
1309
|
-
})[];
|
|
1310
|
-
lastUpdatedAt?: number | undefined;
|
|
1311
|
-
}>, null>;
|
|
1312
|
-
/**
|
|
1313
|
-
* Extra information about each network, such as whether it is accessible or
|
|
1314
|
-
* blocked and whether it supports EIP-1559, keyed by network client ID.
|
|
1315
|
-
*/
|
|
1316
|
-
networksMetadata: import("@metamask/superstruct").Struct<Record<string, {
|
|
1317
|
-
EIPS: Record<string, boolean>;
|
|
1318
|
-
status: NetworkStatus;
|
|
1319
|
-
}>, null>;
|
|
1320
|
-
}>;
|
|
1321
730
|
/**
|
|
1322
731
|
* Constructs a NetworkController.
|
|
1323
732
|
*
|