@metamask-previews/network-controller 37.0.1-preview-32b6da31c → 37.0.1-preview-eefc6963e
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 +4 -0
- package/dist/NetworkController.d.ts +691 -100
- package/dist/NetworkController.d.ts.map +1 -1
- package/dist/NetworkController.js +142 -1
- package/dist/NetworkController.js.map +1 -1
- package/package.json +10 -4
|
@@ -9,6 +9,7 @@ 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';
|
|
12
13
|
import type { SwappableProxy } from '@metamask/swappable-obj-proxy';
|
|
13
14
|
import type { Hex } from '@metamask/utils';
|
|
14
15
|
import type { Draft } from 'immer';
|
|
@@ -24,21 +25,6 @@ import type { BlockTracker, Provider, CustomNetworkClientConfiguration, InfuraNe
|
|
|
24
25
|
export type Block = {
|
|
25
26
|
baseFeePerGas?: string;
|
|
26
27
|
};
|
|
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
|
-
};
|
|
42
28
|
/**
|
|
43
29
|
* The type of an RPC endpoint.
|
|
44
30
|
*
|
|
@@ -49,74 +35,116 @@ export declare enum RpcEndpointType {
|
|
|
49
35
|
Custom = "custom",
|
|
50
36
|
Infura = "infura"
|
|
51
37
|
}
|
|
38
|
+
declare const NetworkClientIdStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
52
39
|
/**
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
+
/**
|
|
50
|
+
* The string that uniquely identifies a custom network client.
|
|
63
51
|
*/
|
|
64
|
-
export type
|
|
52
|
+
export type CustomNetworkClientId = Infer<typeof CustomNetworkClientIdStruct>;
|
|
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
|
+
}, {
|
|
65
60
|
/**
|
|
66
61
|
* Alternate RPC endpoints to use when this endpoint is down.
|
|
67
62
|
*/
|
|
68
|
-
failoverUrls
|
|
63
|
+
failoverUrls: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
69
64
|
/**
|
|
70
65
|
* The optional user-facing nickname of the endpoint.
|
|
71
66
|
*/
|
|
72
|
-
name
|
|
67
|
+
name: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
73
68
|
/**
|
|
74
69
|
* The identifier for the network client that has been created for this RPC
|
|
75
70
|
* endpoint. This is also used to uniquely identify the RPC endpoint in a
|
|
76
71
|
* set of RPC endpoints as well: once assigned, it is used to determine
|
|
77
72
|
* whether the `name`, `type`, or `url` of the RPC endpoint has changed.
|
|
78
73
|
*/
|
|
79
|
-
networkClientId:
|
|
74
|
+
networkClientId: import("@metamask/superstruct").Struct<string, null>;
|
|
80
75
|
/**
|
|
81
76
|
* The type of this endpoint, always "default".
|
|
82
77
|
*/
|
|
83
|
-
type: RpcEndpointType.Infura
|
|
78
|
+
type: import("@metamask/superstruct").Struct<RpcEndpointType.Infura, RpcEndpointType.Infura>;
|
|
84
79
|
/**
|
|
85
80
|
* The URL of the endpoint. Expected to be a template with the string
|
|
86
81
|
* `{infuraProjectId}`, which will get replaced with the Infura project ID
|
|
87
82
|
* when the network client is created.
|
|
88
83
|
*/
|
|
89
|
-
url:
|
|
90
|
-
}
|
|
84
|
+
url: import("@metamask/superstruct").Struct<"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}", null>;
|
|
85
|
+
}>;
|
|
91
86
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
87
|
+
* An Infura RPC endpoint is a reference to a specific network that Infura
|
|
88
|
+
* supports as well as an Infura account we own that we allow users to make use
|
|
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.
|
|
94
97
|
*/
|
|
95
|
-
export type
|
|
98
|
+
export type InfuraRpcEndpoint = Infer<typeof InfuraRpcEndpointStruct>;
|
|
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
|
+
}, {
|
|
96
106
|
/**
|
|
97
107
|
* Alternate RPC endpoints to use when this endpoint is down.
|
|
98
108
|
*/
|
|
99
|
-
failoverUrls
|
|
109
|
+
failoverUrls: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
100
110
|
/**
|
|
101
111
|
* The optional user-facing nickname of the endpoint.
|
|
102
112
|
*/
|
|
103
|
-
name
|
|
113
|
+
name: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
104
114
|
/**
|
|
105
115
|
* The identifier for the network client that has been created for this RPC
|
|
106
116
|
* endpoint. This is also used to uniquely identify the RPC endpoint in a
|
|
107
117
|
* set of RPC endpoints as well: once assigned, it is used to determine
|
|
108
118
|
* whether the `name`, `type`, or `url` of the RPC endpoint has changed.
|
|
109
119
|
*/
|
|
110
|
-
networkClientId:
|
|
120
|
+
networkClientId: import("@metamask/superstruct").Struct<string, null>;
|
|
111
121
|
/**
|
|
112
122
|
* The type of this endpoint, always "custom".
|
|
113
123
|
*/
|
|
114
|
-
type: RpcEndpointType.Custom
|
|
124
|
+
type: import("@metamask/superstruct").Struct<RpcEndpointType.Custom, RpcEndpointType.Custom>;
|
|
115
125
|
/**
|
|
116
126
|
* The URL of the endpoint.
|
|
117
127
|
*/
|
|
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;
|
|
118
146
|
url: string;
|
|
119
|
-
}
|
|
147
|
+
}, null>;
|
|
120
148
|
/**
|
|
121
149
|
* An RPC endpoint is a reference to a server which fronts an EVM chain. There
|
|
122
150
|
* are two varieties of RPC endpoints: Infura and custom.
|
|
@@ -124,63 +152,141 @@ export type CustomRpcEndpoint = {
|
|
|
124
152
|
* @see {@link CustomRpcEndpoint}
|
|
125
153
|
* @see {@link InfuraRpcEndpoint}
|
|
126
154
|
*/
|
|
127
|
-
export type RpcEndpoint =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
155
|
+
export type RpcEndpoint = Infer<typeof RpcEndpointStruct>;
|
|
156
|
+
declare const NetworkConfigurationStruct: import("@metamask/superstruct").Struct<{
|
|
157
|
+
blockExplorerUrls: string[];
|
|
158
|
+
chainId: `0x${string}`;
|
|
159
|
+
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
160
|
+
defaultRpcEndpointIndex: number;
|
|
161
|
+
name: string;
|
|
162
|
+
nativeCurrency: string;
|
|
163
|
+
rpcEndpoints: ({
|
|
164
|
+
failoverUrls?: string[] | undefined;
|
|
165
|
+
name?: string | undefined;
|
|
166
|
+
networkClientId: string;
|
|
167
|
+
type: RpcEndpointType.Infura;
|
|
168
|
+
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}";
|
|
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
|
+
}, {
|
|
142
178
|
/**
|
|
143
179
|
* A set of URLs that allows the user to view activity that has occurred on
|
|
144
180
|
* the chain.
|
|
145
181
|
*/
|
|
146
|
-
blockExplorerUrls: string[]
|
|
182
|
+
blockExplorerUrls: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
147
183
|
/**
|
|
148
184
|
* The ID of the chain. Represented in hexadecimal format with a leading "0x"
|
|
149
185
|
* instead of decimal format so that when viewed out of context it can be
|
|
150
186
|
* unambiguously interpreted.
|
|
151
187
|
*/
|
|
152
|
-
chainId:
|
|
188
|
+
chainId: import("@metamask/superstruct").Struct<`0x${string}`, null>;
|
|
153
189
|
/**
|
|
154
190
|
* A reference to a URL that the client will use by default to allow the user
|
|
155
191
|
* to view activity that has occurred on the chain. This index must refer to
|
|
156
192
|
* an item in `blockExplorerUrls`.
|
|
157
193
|
*/
|
|
158
|
-
defaultBlockExplorerUrlIndex
|
|
194
|
+
defaultBlockExplorerUrlIndex: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
159
195
|
/**
|
|
160
196
|
* A reference to an RPC endpoint that all requests will use by default in order to
|
|
161
197
|
* interact with the chain. This index must refer to an item in
|
|
162
198
|
* `rpcEndpoints`.
|
|
163
199
|
*/
|
|
164
|
-
defaultRpcEndpointIndex: number
|
|
200
|
+
defaultRpcEndpointIndex: import("@metamask/superstruct").Struct<number, null>;
|
|
165
201
|
/**
|
|
166
202
|
* The user-facing nickname assigned to the chain.
|
|
167
203
|
*/
|
|
168
|
-
name: string
|
|
204
|
+
name: import("@metamask/superstruct").Struct<string, null>;
|
|
169
205
|
/**
|
|
170
206
|
* The name of the currency to use for the chain.
|
|
171
207
|
*/
|
|
172
|
-
nativeCurrency: string
|
|
208
|
+
nativeCurrency: import("@metamask/superstruct").Struct<string, null>;
|
|
173
209
|
/**
|
|
174
210
|
* The collection of possible RPC endpoints that the client can use to
|
|
175
211
|
* interact with the chain.
|
|
176
212
|
*/
|
|
177
|
-
rpcEndpoints:
|
|
213
|
+
rpcEndpoints: import("@metamask/superstruct").Struct<({
|
|
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>>;
|
|
178
238
|
/**
|
|
179
239
|
* Profile Sync - Network Sync field.
|
|
180
240
|
* Allows comparison of local network state with state to sync.
|
|
181
241
|
*/
|
|
182
|
-
lastUpdatedAt
|
|
183
|
-
}
|
|
242
|
+
lastUpdatedAt: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
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>;
|
|
184
290
|
/**
|
|
185
291
|
* A custom RPC endpoint in a new network configuration, meant to be used in
|
|
186
292
|
* conjunction with `AddNetworkFields`.
|
|
@@ -234,45 +340,81 @@ export type UpdateNetworkFields = Omit<NetworkConfiguration, 'rpcEndpoints'> & {
|
|
|
234
340
|
* itself.
|
|
235
341
|
*/
|
|
236
342
|
export declare function knownKeysOf<Key extends PropertyKey>(object: Partial<Record<Key, any>>): Key[];
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
343
|
+
declare const NetworkStateStruct: import("@metamask/superstruct").Struct<{
|
|
344
|
+
selectedNetworkClientId: string;
|
|
345
|
+
networkConfigurationsByChainId: Record<`0x${string}`, {
|
|
346
|
+
blockExplorerUrls: string[];
|
|
347
|
+
chainId: `0x${string}`;
|
|
348
|
+
defaultBlockExplorerUrlIndex?: number | undefined;
|
|
349
|
+
defaultRpcEndpointIndex: number;
|
|
350
|
+
name: string;
|
|
351
|
+
nativeCurrency: string;
|
|
352
|
+
rpcEndpoints: ({
|
|
353
|
+
failoverUrls?: string[] | undefined;
|
|
354
|
+
name?: string | undefined;
|
|
355
|
+
networkClientId: string;
|
|
356
|
+
type: RpcEndpointType.Infura;
|
|
357
|
+
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}";
|
|
358
|
+
} | {
|
|
359
|
+
failoverUrls?: string[] | undefined;
|
|
360
|
+
name?: string | undefined;
|
|
361
|
+
networkClientId: string;
|
|
362
|
+
type: RpcEndpointType.Custom;
|
|
363
|
+
url: string;
|
|
364
|
+
})[];
|
|
365
|
+
lastUpdatedAt?: number | undefined;
|
|
366
|
+
}>;
|
|
367
|
+
networksMetadata: Record<string, {
|
|
368
|
+
EIPS: Record<string, boolean>;
|
|
369
|
+
status: NetworkStatus;
|
|
370
|
+
}>;
|
|
371
|
+
}, {
|
|
258
372
|
/**
|
|
259
373
|
* The ID of the network client that the proxies returned by
|
|
260
374
|
* `getSelectedNetworkClient` currently point to.
|
|
261
375
|
*/
|
|
262
|
-
selectedNetworkClientId:
|
|
376
|
+
selectedNetworkClientId: import("@metamask/superstruct").Struct<string, null>;
|
|
263
377
|
/**
|
|
264
378
|
* The registry of networks and corresponding RPC endpoints that the
|
|
265
379
|
* controller can use to make requests for various chains.
|
|
266
380
|
*
|
|
267
381
|
* @see {@link NetworkConfiguration}
|
|
268
382
|
*/
|
|
269
|
-
networkConfigurationsByChainId: Record
|
|
383
|
+
networkConfigurationsByChainId: import("@metamask/superstruct").Struct<Record<`0x${string}`, {
|
|
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>;
|
|
270
405
|
/**
|
|
271
406
|
* Extra information about each network, such as whether it is accessible or
|
|
272
407
|
* blocked and whether it supports EIP-1559, keyed by network client ID.
|
|
273
408
|
*/
|
|
274
|
-
networksMetadata:
|
|
275
|
-
|
|
409
|
+
networksMetadata: import("@metamask/superstruct").Struct<Record<string, {
|
|
410
|
+
EIPS: Record<string, boolean>;
|
|
411
|
+
status: NetworkStatus;
|
|
412
|
+
}>, null>;
|
|
413
|
+
}>;
|
|
414
|
+
/**
|
|
415
|
+
* The state that NetworkController stores.
|
|
416
|
+
*/
|
|
417
|
+
export type NetworkState = Infer<typeof NetworkStateStruct>;
|
|
276
418
|
declare const controllerName = "NetworkController";
|
|
277
419
|
/**
|
|
278
420
|
* Represents the block tracker for the currently selected network. (Note that
|
|
@@ -629,18 +771,172 @@ export declare function getNetworkConfigurations(state: NetworkState): NetworkCo
|
|
|
629
771
|
* @param state - NetworkController state
|
|
630
772
|
* @returns A list of all available network configurations
|
|
631
773
|
*/
|
|
632
|
-
export declare const selectNetworkConfigurations: ((state:
|
|
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
|
+
}[]) & {
|
|
633
824
|
clearCache: () => void;
|
|
634
825
|
resultsCount: () => number;
|
|
635
826
|
resetResultsCount: () => void;
|
|
636
827
|
} & {
|
|
637
|
-
resultFunc: (resultFuncArgs_0: Record<`0x${string}`,
|
|
638
|
-
|
|
828
|
+
resultFunc: (resultFuncArgs_0: Record<`0x${string}`, {
|
|
829
|
+
blockExplorerUrls: string[];
|
|
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
|
+
}[]) & {
|
|
639
914
|
clearCache: () => void;
|
|
640
915
|
resultsCount: () => number;
|
|
641
916
|
resetResultsCount: () => void;
|
|
642
917
|
};
|
|
643
|
-
lastResult: () =>
|
|
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
|
+
}[];
|
|
644
940
|
dependencies: [typeof selectNetworkConfigurationsByChainId];
|
|
645
941
|
recomputations: () => number;
|
|
646
942
|
resetRecomputations: () => void;
|
|
@@ -665,30 +961,254 @@ export declare function getAvailableNetworkClientIds(networkConfigurations: Netw
|
|
|
665
961
|
* @param state - NetworkController state
|
|
666
962
|
* @returns A list of all available network client IDs.
|
|
667
963
|
*/
|
|
668
|
-
export declare const selectAvailableNetworkClientIds: ((state:
|
|
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[]) & {
|
|
669
993
|
clearCache: () => void;
|
|
670
994
|
resultsCount: () => number;
|
|
671
995
|
resetResultsCount: () => void;
|
|
672
996
|
} & {
|
|
673
|
-
resultFunc: (resultFuncArgs_0:
|
|
674
|
-
|
|
997
|
+
resultFunc: (resultFuncArgs_0: {
|
|
998
|
+
blockExplorerUrls: string[];
|
|
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[]) & {
|
|
675
1041
|
clearCache: () => void;
|
|
676
1042
|
resultsCount: () => number;
|
|
677
1043
|
resetResultsCount: () => void;
|
|
678
1044
|
};
|
|
679
1045
|
lastResult: () => string[];
|
|
680
|
-
dependencies: [((state:
|
|
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
|
+
}[]) & {
|
|
681
1096
|
clearCache: () => void;
|
|
682
1097
|
resultsCount: () => number;
|
|
683
1098
|
resetResultsCount: () => void;
|
|
684
1099
|
} & {
|
|
685
|
-
resultFunc: (resultFuncArgs_0: Record<`0x${string}`,
|
|
686
|
-
|
|
1100
|
+
resultFunc: (resultFuncArgs_0: Record<`0x${string}`, {
|
|
1101
|
+
blockExplorerUrls: string[];
|
|
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
|
+
}[]) & {
|
|
687
1186
|
clearCache: () => void;
|
|
688
1187
|
resultsCount: () => number;
|
|
689
1188
|
resetResultsCount: () => void;
|
|
690
1189
|
};
|
|
691
|
-
lastResult: () =>
|
|
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
|
+
}[];
|
|
692
1212
|
dependencies: [typeof selectNetworkConfigurationsByChainId];
|
|
693
1213
|
recomputations: () => number;
|
|
694
1214
|
resetRecomputations: () => void;
|
|
@@ -727,6 +1247,77 @@ export type AutoManagedNetworkClientRegistry = {
|
|
|
727
1247
|
*/
|
|
728
1248
|
export declare class NetworkController extends BaseController<typeof controllerName, NetworkState, NetworkControllerMessenger> {
|
|
729
1249
|
#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
|
+
}>;
|
|
730
1321
|
/**
|
|
731
1322
|
* Constructs a NetworkController.
|
|
732
1323
|
*
|