@metamask-previews/network-controller 32.0.0-preview-5620ede0b → 32.0.0-preview-cf351fcd3

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/NetworkController-method-action-types.cjs.map +1 -1
  3. package/dist/NetworkController-method-action-types.d.cts +1 -23
  4. package/dist/NetworkController-method-action-types.d.cts.map +1 -1
  5. package/dist/NetworkController-method-action-types.d.mts +1 -23
  6. package/dist/NetworkController-method-action-types.d.mts.map +1 -1
  7. package/dist/NetworkController-method-action-types.mjs.map +1 -1
  8. package/dist/NetworkController.cjs +23 -24
  9. package/dist/NetworkController.cjs.map +1 -1
  10. package/dist/NetworkController.d.cts +12 -59
  11. package/dist/NetworkController.d.cts.map +1 -1
  12. package/dist/NetworkController.d.mts +12 -59
  13. package/dist/NetworkController.d.mts.map +1 -1
  14. package/dist/NetworkController.mjs +23 -24
  15. package/dist/NetworkController.mjs.map +1 -1
  16. package/dist/create-auto-managed-network-client.cjs.map +1 -1
  17. package/dist/create-auto-managed-network-client.d.cts +2 -2
  18. package/dist/create-auto-managed-network-client.d.cts.map +1 -1
  19. package/dist/create-auto-managed-network-client.d.mts +2 -2
  20. package/dist/create-auto-managed-network-client.d.mts.map +1 -1
  21. package/dist/create-auto-managed-network-client.mjs.map +1 -1
  22. package/dist/create-network-client.cjs +53 -16
  23. package/dist/create-network-client.cjs.map +1 -1
  24. package/dist/create-network-client.d.cts +2 -2
  25. package/dist/create-network-client.d.cts.map +1 -1
  26. package/dist/create-network-client.d.mts +2 -2
  27. package/dist/create-network-client.d.mts.map +1 -1
  28. package/dist/create-network-client.mjs +54 -17
  29. package/dist/create-network-client.mjs.map +1 -1
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +1 -1
  32. package/dist/index.d.cts.map +1 -1
  33. package/dist/index.d.mts +1 -1
  34. package/dist/index.d.mts.map +1 -1
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/rpc-service/rpc-service.cjs +2 -0
  37. package/dist/rpc-service/rpc-service.cjs.map +1 -1
  38. package/dist/rpc-service/rpc-service.d.cts +6 -0
  39. package/dist/rpc-service/rpc-service.d.cts.map +1 -1
  40. package/dist/rpc-service/rpc-service.d.mts +6 -0
  41. package/dist/rpc-service/rpc-service.d.mts.map +1 -1
  42. package/dist/rpc-service/rpc-service.mjs +2 -0
  43. package/dist/rpc-service/rpc-service.mjs.map +1 -1
  44. package/dist/selectors.cjs +10 -0
  45. package/dist/selectors.cjs.map +1 -0
  46. package/dist/selectors.d.cts +3 -0
  47. package/dist/selectors.d.cts.map +1 -0
  48. package/dist/selectors.d.mts +3 -0
  49. package/dist/selectors.d.mts.map +1 -0
  50. package/dist/selectors.mjs +6 -0
  51. package/dist/selectors.mjs.map +1 -0
  52. package/dist/types.cjs.map +1 -1
  53. package/dist/types.d.cts +1 -5
  54. package/dist/types.d.cts.map +1 -1
  55. package/dist/types.d.mts +1 -5
  56. package/dist/types.d.mts.map +1 -1
  57. package/dist/types.mjs.map +1 -1
  58. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - Add defaults for policy and block tracker options ([#9002](https://github.com/MetaMask/core/pull/9002))
13
+ - The `NetworkController` constructor argument `getRpcServiceOptions` is now optional.
14
+ - The default `policyOptions.maxRetries` is now `3`.
15
+ - The default `policyOptions.maxConsecutiveFailures` is now `12` for regular RPC endpoints and `40` for fallback RPC endpoints.
16
+ - The default `policyOptions.circuitBreakDuration` is now `30` seconds.
17
+ - The default `pollingInterval` for the block tracker is now `20` seconds.
18
+ - The default `retryTimeout` for the block tracker is now `20` seconds.
19
+
20
+ ### Changed
21
+
22
+ - **BREAKING:** Automatically populate `isRpcFailoverEnabled` using `RemoteFeatureFlagController` ([#9013](https://github.com/MetaMask/core/pull/9013))
23
+ - `NetworkController.init` must now be called to fully initialize the controller.
24
+ - The constructor argument `isRpcFailoverEnabled` is no longer available.
25
+ - `RemoteFeatureFlagController:stateChange` and `RemoteFeatureFlagController:getState` are now required.
26
+
27
+ ### Removed
28
+
29
+ - **BREAKING:** Remove `initializeProvider` in favor of `init` ([#9034](https://github.com/MetaMask/core/pull/9034))
30
+ - `init` does not call `lookupNetwork`, if this is required it must be called manually.
31
+ - **BREAKING:** Remove `additionalDefaultNetworks` constructor option ([#9035](https://github.com/MetaMask/core/pull/9035))
32
+
33
+ ### Fixed
34
+
35
+ - Add defaults for `fetch`, `btoa` and `isOffline` in `RpcServiceOptions` ([#9000](https://github.com/MetaMask/core/pull/9000))
36
+ - Ensure block explorer URLs are populated for default networks ([#9005](https://github.com/MetaMask/core/pull/9005))
37
+
10
38
  ## [32.0.0]
11
39
 
12
40
  ### Changed
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkController-method-action-types.cjs","sourceRoot":"","sources":["../src/NetworkController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NetworkController } from './NetworkController';\n\n/**\n * Returns the EthQuery instance for the currently selected network.\n *\n * @returns The EthQuery instance, or undefined if the provider has not been\n * initialized.\n */\nexport type NetworkControllerGetEthQueryAction = {\n type: `NetworkController:getEthQuery`;\n handler: NetworkController['getEthQuery'];\n};\n\n/**\n * Enables the RPC failover functionality. That is, if any RPC endpoints are\n * configured with failover URLs, then traffic will automatically be diverted\n * to them if those RPC endpoints are unavailable.\n */\nexport type NetworkControllerEnableRpcFailoverAction = {\n type: `NetworkController:enableRpcFailover`;\n handler: NetworkController['enableRpcFailover'];\n};\n\n/**\n * Disables the RPC failover functionality. That is, even if any RPC endpoints\n * are configured with failover URLs, then traffic will not automatically be\n * diverted to them if those RPC endpoints are unavailable.\n */\nexport type NetworkControllerDisableRpcFailoverAction = {\n type: `NetworkController:disableRpcFailover`;\n handler: NetworkController['disableRpcFailover'];\n};\n\n/**\n * Accesses the provider and block tracker for the currently selected network.\n *\n * @returns The proxy and block tracker proxies.\n * @deprecated This method has been replaced by `getSelectedNetworkClient` (which has a more easily used return type) and will be removed in a future release.\n */\nexport type NetworkControllerGetProviderAndBlockTrackerAction = {\n type: `NetworkController:getProviderAndBlockTracker`;\n handler: NetworkController['getProviderAndBlockTracker'];\n};\n\n/**\n * Accesses the provider and block tracker for the currently selected network.\n *\n * @returns an object with the provider and block tracker proxies for the currently selected network.\n */\nexport type NetworkControllerGetSelectedNetworkClientAction = {\n type: `NetworkController:getSelectedNetworkClient`;\n handler: NetworkController['getSelectedNetworkClient'];\n};\n\n/**\n * Accesses the chain ID from the selected network client.\n *\n * @returns The chain ID of the selected network client in hex format or undefined if there is no network client.\n */\nexport type NetworkControllerGetSelectedChainIdAction = {\n type: `NetworkController:getSelectedChainId`;\n handler: NetworkController['getSelectedChainId'];\n};\n\n/**\n * Internally, the Infura and custom network clients are categorized by type\n * so that when accessing either kind of network client, TypeScript knows\n * which type to assign to the network client. For some cases it's more useful\n * to be able to access network clients by ID instead of by type and then ID,\n * so this function makes that possible.\n *\n * @returns The network clients registered so far, keyed by ID.\n */\nexport type NetworkControllerGetNetworkClientRegistryAction = {\n type: `NetworkController:getNetworkClientRegistry`;\n handler: NetworkController['getNetworkClientRegistry'];\n};\n\n/**\n * Returns the Infura network client with the given ID.\n *\n * @param infuraNetworkClientId - An Infura network client ID.\n * @returns The Infura network client.\n * @throws If an Infura network client does not exist with the given ID.\n */\nexport type NetworkControllerGetNetworkClientByIdAction = {\n type: `NetworkController:getNetworkClientById`;\n handler: NetworkController['getNetworkClientById'];\n};\n\n/**\n * Creates proxies for accessing the global network client and its block\n * tracker. You must call this method in order to use\n * `getProviderAndBlockTracker` (or its replacement,\n * `getSelectedNetworkClient`).\n *\n * @param options - Optional arguments.\n * @param options.lookupNetwork - Usually, metadata for the global network\n * will be populated via a call to `lookupNetwork` after creating the provider\n * and block tracker proxies. This allows for responding to the status of the\n * global network after initializing this controller; however, it requires\n * making a request to the network to do so. In the clients, where controllers\n * are initialized before the UI is shown, this may be undesirable, as it\n * means that if the user has just installed MetaMask, their IP address may be\n * shared with a third party before they have a chance to finish onboarding.\n * You can pass `false` if you'd like to disable this request and call\n * `lookupNetwork` yourself.\n */\nexport type NetworkControllerInitializeProviderAction = {\n type: `NetworkController:initializeProvider`;\n handler: NetworkController['initializeProvider'];\n};\n\n/**\n * Uses a request for the latest block to gather the following information on\n * the given or selected network, persisting it to state:\n *\n * - The connectivity status: whether it is available, geo-blocked (Infura\n * only), unavailable, or unknown\n * - The capabilities status: whether it supports EIP-1559, whether it does\n * not, or whether it is unknown\n *\n * @param networkClientId - The ID of the network client to inspect.\n * If no ID is provided, uses the currently selected network.\n */\nexport type NetworkControllerLookupNetworkAction = {\n type: `NetworkController:lookupNetwork`;\n handler: NetworkController['lookupNetwork'];\n};\n\n/**\n * Uses a request for the latest block to gather the following information on\n * the given network, persisting it to state:\n *\n * - The connectivity status: whether the network is available, geo-blocked\n * (Infura only), unavailable, or unknown\n * - The feature compatibility status: whether the network supports EIP-1559,\n * whether it does not, or whether it is unknown\n *\n * @param networkClientId - The ID of the network client to inspect.\n * @deprecated Please use `lookupNetwork` and pass a network client ID\n * instead. This method will be removed in a future major version.\n */\nexport type NetworkControllerLookupNetworkByClientIdAction = {\n type: `NetworkController:lookupNetworkByClientId`;\n handler: NetworkController['lookupNetworkByClientId'];\n};\n\n/**\n * Convenience method to update provider network type settings.\n *\n * @param type - Human readable network name.\n * @deprecated This has been replaced by `setActiveNetwork`, and will be\n * removed in a future release\n */\nexport type NetworkControllerSetProviderTypeAction = {\n type: `NetworkController:setProviderType`;\n handler: NetworkController['setProviderType'];\n};\n\n/**\n * Changes the selected network.\n *\n * @param networkClientId - The ID of a network client that will be used to\n * make requests.\n * @param options - Options for this method.\n * @param options.updateState - Allows for updating state.\n * @throws if no network client is associated with the given\n * network client ID.\n */\nexport type NetworkControllerSetActiveNetworkAction = {\n type: `NetworkController:setActiveNetwork`;\n handler: NetworkController['setActiveNetwork'];\n};\n\n/**\n * Determines whether the network supports EIP-1559 by checking whether the\n * latest block has a `baseFeePerGas` property, then updates state\n * appropriately.\n *\n * @param networkClientId - The networkClientId to fetch the correct provider against which to check 1559 compatibility.\n * @returns A promise that resolves to true if the network supports EIP-1559\n * , false otherwise, or `undefined` if unable to determine the compatibility.\n */\nexport type NetworkControllerGetEIP1559CompatibilityAction = {\n type: `NetworkController:getEIP1559Compatibility`;\n handler: NetworkController['getEIP1559Compatibility'];\n};\n\nexport type NetworkControllerGet1559CompatibilityWithNetworkClientIdAction = {\n type: `NetworkController:get1559CompatibilityWithNetworkClientId`;\n handler: NetworkController['get1559CompatibilityWithNetworkClientId'];\n};\n\n/**\n * Ensures that the provider and block tracker proxies are pointed to the\n * currently selected network and refreshes the metadata for the\n */\nexport type NetworkControllerResetConnectionAction = {\n type: `NetworkController:resetConnection`;\n handler: NetworkController['resetConnection'];\n};\n\n/**\n * Returns the network configuration that has been filed under the given chain\n * ID.\n *\n * @param chainId - The chain ID to use as a key.\n * @returns The network configuration if one exists, or undefined.\n */\nexport type NetworkControllerGetNetworkConfigurationByChainIdAction = {\n type: `NetworkController:getNetworkConfigurationByChainId`;\n handler: NetworkController['getNetworkConfigurationByChainId'];\n};\n\n/**\n * Returns the network configuration that contains an RPC endpoint with the\n * given network client ID.\n *\n * @param networkClientId - The network client ID to use as a key.\n * @returns The network configuration if one exists, or undefined.\n */\nexport type NetworkControllerGetNetworkConfigurationByNetworkClientIdAction = {\n type: `NetworkController:getNetworkConfigurationByNetworkClientId`;\n handler: NetworkController['getNetworkConfigurationByNetworkClientId'];\n};\n\n/**\n * Creates and registers network clients for the collection of Infura and\n * custom RPC endpoints that can be used to make requests for a particular\n * chain, storing the given configuration object in state for later reference.\n *\n * @param fields - The object that describes the new network/chain and lists\n * the RPC endpoints which front that chain.\n * @returns The newly added network configuration.\n * @throws if any part of `fields` would produce invalid state.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerAddNetworkAction = {\n type: `NetworkController:addNetwork`;\n handler: NetworkController['addNetwork'];\n};\n\n/**\n * Updates the configuration for a previously stored network filed under the\n * given chain ID, creating + registering new network clients to represent RPC\n * endpoints that have been added and destroying + unregistering existing\n * network clients for RPC endpoints that have been removed.\n *\n * Note that if `chainId` is changed, then all network clients associated with\n * that chain will be removed and re-added, even if none of the RPC endpoints\n * have changed.\n *\n * @param chainId - The chain ID associated with an existing network.\n * @param fields - The object that describes the updates to the network/chain,\n * including the new set of RPC endpoints which should front that chain.\n * @param options - Options to provide.\n * @param options.replacementSelectedRpcEndpointIndex - Usually you cannot\n * remove an RPC endpoint that is being represented by the currently selected\n * network client. This option allows you to specify another RPC endpoint\n * (either an existing one or a new one) that should be used to select a new\n * network instead.\n * @returns The updated network configuration.\n * @throws if `chainId` does not refer to an existing network configuration,\n * if any part of `fields` would produce invalid state, etc.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerUpdateNetworkAction = {\n type: `NetworkController:updateNetwork`;\n handler: NetworkController['updateNetwork'];\n};\n\n/**\n * Destroys and unregisters the network identified by the given chain ID, also\n * removing the associated network configuration from state.\n *\n * @param chainId - The chain ID associated with an existing network.\n * @throws if `chainId` does not refer to an existing network configuration,\n * or if the currently selected network is being removed.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerRemoveNetworkAction = {\n type: `NetworkController:removeNetwork`;\n handler: NetworkController['removeNetwork'];\n};\n\n/**\n * Assuming that the network has been previously switched, switches to this\n * new network.\n *\n * If the network has not been previously switched, this method is equivalent\n * to {@link resetConnection}.\n */\nexport type NetworkControllerRollbackToPreviousProviderAction = {\n type: `NetworkController:rollbackToPreviousProvider`;\n handler: NetworkController['rollbackToPreviousProvider'];\n};\n\n/**\n * Merges the given backup data into controller state.\n *\n * @param backup - The data that has been backed up.\n * @param backup.networkConfigurationsByChainId - Network configurations,\n * keyed by chain ID.\n */\nexport type NetworkControllerLoadBackupAction = {\n type: `NetworkController:loadBackup`;\n handler: NetworkController['loadBackup'];\n};\n\n/**\n * Searches for the default RPC endpoint configured for the given chain and\n * returns its network client ID. This can then be passed to\n * {@link getNetworkClientById} to retrieve the network client.\n *\n * @param chainId - Chain ID to search for.\n * @returns The ID of the network client created for the chain's default RPC\n * endpoint.\n */\nexport type NetworkControllerFindNetworkClientIdByChainIdAction = {\n type: `NetworkController:findNetworkClientIdByChainId`;\n handler: NetworkController['findNetworkClientIdByChainId'];\n};\n\n/**\n * Union of all NetworkController action types.\n */\nexport type NetworkControllerMethodActions =\n | NetworkControllerGetEthQueryAction\n | NetworkControllerEnableRpcFailoverAction\n | NetworkControllerDisableRpcFailoverAction\n | NetworkControllerGetProviderAndBlockTrackerAction\n | NetworkControllerGetSelectedNetworkClientAction\n | NetworkControllerGetSelectedChainIdAction\n | NetworkControllerGetNetworkClientRegistryAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerInitializeProviderAction\n | NetworkControllerLookupNetworkAction\n | NetworkControllerLookupNetworkByClientIdAction\n | NetworkControllerSetProviderTypeAction\n | NetworkControllerSetActiveNetworkAction\n | NetworkControllerGetEIP1559CompatibilityAction\n | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction\n | NetworkControllerResetConnectionAction\n | NetworkControllerGetNetworkConfigurationByChainIdAction\n | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction\n | NetworkControllerAddNetworkAction\n | NetworkControllerUpdateNetworkAction\n | NetworkControllerRemoveNetworkAction\n | NetworkControllerRollbackToPreviousProviderAction\n | NetworkControllerLoadBackupAction\n | NetworkControllerFindNetworkClientIdByChainIdAction;\n"]}
1
+ {"version":3,"file":"NetworkController-method-action-types.cjs","sourceRoot":"","sources":["../src/NetworkController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NetworkController } from './NetworkController';\n\n/**\n * Returns the EthQuery instance for the currently selected network.\n *\n * @returns The EthQuery instance, or undefined if the provider has not been\n * initialized.\n */\nexport type NetworkControllerGetEthQueryAction = {\n type: `NetworkController:getEthQuery`;\n handler: NetworkController['getEthQuery'];\n};\n\n/**\n * Enables the RPC failover functionality. That is, if any RPC endpoints are\n * configured with failover URLs, then traffic will automatically be diverted\n * to them if those RPC endpoints are unavailable.\n */\nexport type NetworkControllerEnableRpcFailoverAction = {\n type: `NetworkController:enableRpcFailover`;\n handler: NetworkController['enableRpcFailover'];\n};\n\n/**\n * Disables the RPC failover functionality. That is, even if any RPC endpoints\n * are configured with failover URLs, then traffic will not automatically be\n * diverted to them if those RPC endpoints are unavailable.\n */\nexport type NetworkControllerDisableRpcFailoverAction = {\n type: `NetworkController:disableRpcFailover`;\n handler: NetworkController['disableRpcFailover'];\n};\n\n/**\n * Accesses the provider and block tracker for the currently selected network.\n *\n * @returns The proxy and block tracker proxies.\n * @deprecated This method has been replaced by `getSelectedNetworkClient` (which has a more easily used return type) and will be removed in a future release.\n */\nexport type NetworkControllerGetProviderAndBlockTrackerAction = {\n type: `NetworkController:getProviderAndBlockTracker`;\n handler: NetworkController['getProviderAndBlockTracker'];\n};\n\n/**\n * Accesses the provider and block tracker for the currently selected network.\n *\n * @returns an object with the provider and block tracker proxies for the currently selected network.\n */\nexport type NetworkControllerGetSelectedNetworkClientAction = {\n type: `NetworkController:getSelectedNetworkClient`;\n handler: NetworkController['getSelectedNetworkClient'];\n};\n\n/**\n * Accesses the chain ID from the selected network client.\n *\n * @returns The chain ID of the selected network client in hex format or undefined if there is no network client.\n */\nexport type NetworkControllerGetSelectedChainIdAction = {\n type: `NetworkController:getSelectedChainId`;\n handler: NetworkController['getSelectedChainId'];\n};\n\n/**\n * Internally, the Infura and custom network clients are categorized by type\n * so that when accessing either kind of network client, TypeScript knows\n * which type to assign to the network client. For some cases it's more useful\n * to be able to access network clients by ID instead of by type and then ID,\n * so this function makes that possible.\n *\n * @returns The network clients registered so far, keyed by ID.\n */\nexport type NetworkControllerGetNetworkClientRegistryAction = {\n type: `NetworkController:getNetworkClientRegistry`;\n handler: NetworkController['getNetworkClientRegistry'];\n};\n\n/**\n * Returns the Infura network client with the given ID.\n *\n * @param infuraNetworkClientId - An Infura network client ID.\n * @returns The Infura network client.\n * @throws If an Infura network client does not exist with the given ID.\n */\nexport type NetworkControllerGetNetworkClientByIdAction = {\n type: `NetworkController:getNetworkClientById`;\n handler: NetworkController['getNetworkClientById'];\n};\n\n/**\n * Uses a request for the latest block to gather the following information on\n * the given or selected network, persisting it to state:\n *\n * - The connectivity status: whether it is available, geo-blocked (Infura\n * only), unavailable, or unknown\n * - The capabilities status: whether it supports EIP-1559, whether it does\n * not, or whether it is unknown\n *\n * @param networkClientId - The ID of the network client to inspect.\n * If no ID is provided, uses the currently selected network.\n */\nexport type NetworkControllerLookupNetworkAction = {\n type: `NetworkController:lookupNetwork`;\n handler: NetworkController['lookupNetwork'];\n};\n\n/**\n * Uses a request for the latest block to gather the following information on\n * the given network, persisting it to state:\n *\n * - The connectivity status: whether the network is available, geo-blocked\n * (Infura only), unavailable, or unknown\n * - The feature compatibility status: whether the network supports EIP-1559,\n * whether it does not, or whether it is unknown\n *\n * @param networkClientId - The ID of the network client to inspect.\n * @deprecated Please use `lookupNetwork` and pass a network client ID\n * instead. This method will be removed in a future major version.\n */\nexport type NetworkControllerLookupNetworkByClientIdAction = {\n type: `NetworkController:lookupNetworkByClientId`;\n handler: NetworkController['lookupNetworkByClientId'];\n};\n\n/**\n * Convenience method to update provider network type settings.\n *\n * @param type - Human readable network name.\n * @deprecated This has been replaced by `setActiveNetwork`, and will be\n * removed in a future release\n */\nexport type NetworkControllerSetProviderTypeAction = {\n type: `NetworkController:setProviderType`;\n handler: NetworkController['setProviderType'];\n};\n\n/**\n * Changes the selected network.\n *\n * @param networkClientId - The ID of a network client that will be used to\n * make requests.\n * @param options - Options for this method.\n * @param options.updateState - Allows for updating state.\n * @throws if no network client is associated with the given\n * network client ID.\n */\nexport type NetworkControllerSetActiveNetworkAction = {\n type: `NetworkController:setActiveNetwork`;\n handler: NetworkController['setActiveNetwork'];\n};\n\n/**\n * Determines whether the network supports EIP-1559 by checking whether the\n * latest block has a `baseFeePerGas` property, then updates state\n * appropriately.\n *\n * @param networkClientId - The networkClientId to fetch the correct provider against which to check 1559 compatibility.\n * @returns A promise that resolves to true if the network supports EIP-1559\n * , false otherwise, or `undefined` if unable to determine the compatibility.\n */\nexport type NetworkControllerGetEIP1559CompatibilityAction = {\n type: `NetworkController:getEIP1559Compatibility`;\n handler: NetworkController['getEIP1559Compatibility'];\n};\n\nexport type NetworkControllerGet1559CompatibilityWithNetworkClientIdAction = {\n type: `NetworkController:get1559CompatibilityWithNetworkClientId`;\n handler: NetworkController['get1559CompatibilityWithNetworkClientId'];\n};\n\n/**\n * Ensures that the provider and block tracker proxies are pointed to the\n * currently selected network and refreshes the metadata for the\n */\nexport type NetworkControllerResetConnectionAction = {\n type: `NetworkController:resetConnection`;\n handler: NetworkController['resetConnection'];\n};\n\n/**\n * Returns the network configuration that has been filed under the given chain\n * ID.\n *\n * @param chainId - The chain ID to use as a key.\n * @returns The network configuration if one exists, or undefined.\n */\nexport type NetworkControllerGetNetworkConfigurationByChainIdAction = {\n type: `NetworkController:getNetworkConfigurationByChainId`;\n handler: NetworkController['getNetworkConfigurationByChainId'];\n};\n\n/**\n * Returns the network configuration that contains an RPC endpoint with the\n * given network client ID.\n *\n * @param networkClientId - The network client ID to use as a key.\n * @returns The network configuration if one exists, or undefined.\n */\nexport type NetworkControllerGetNetworkConfigurationByNetworkClientIdAction = {\n type: `NetworkController:getNetworkConfigurationByNetworkClientId`;\n handler: NetworkController['getNetworkConfigurationByNetworkClientId'];\n};\n\n/**\n * Creates and registers network clients for the collection of Infura and\n * custom RPC endpoints that can be used to make requests for a particular\n * chain, storing the given configuration object in state for later reference.\n *\n * @param fields - The object that describes the new network/chain and lists\n * the RPC endpoints which front that chain.\n * @returns The newly added network configuration.\n * @throws if any part of `fields` would produce invalid state.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerAddNetworkAction = {\n type: `NetworkController:addNetwork`;\n handler: NetworkController['addNetwork'];\n};\n\n/**\n * Updates the configuration for a previously stored network filed under the\n * given chain ID, creating + registering new network clients to represent RPC\n * endpoints that have been added and destroying + unregistering existing\n * network clients for RPC endpoints that have been removed.\n *\n * Note that if `chainId` is changed, then all network clients associated with\n * that chain will be removed and re-added, even if none of the RPC endpoints\n * have changed.\n *\n * @param chainId - The chain ID associated with an existing network.\n * @param fields - The object that describes the updates to the network/chain,\n * including the new set of RPC endpoints which should front that chain.\n * @param options - Options to provide.\n * @param options.replacementSelectedRpcEndpointIndex - Usually you cannot\n * remove an RPC endpoint that is being represented by the currently selected\n * network client. This option allows you to specify another RPC endpoint\n * (either an existing one or a new one) that should be used to select a new\n * network instead.\n * @returns The updated network configuration.\n * @throws if `chainId` does not refer to an existing network configuration,\n * if any part of `fields` would produce invalid state, etc.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerUpdateNetworkAction = {\n type: `NetworkController:updateNetwork`;\n handler: NetworkController['updateNetwork'];\n};\n\n/**\n * Destroys and unregisters the network identified by the given chain ID, also\n * removing the associated network configuration from state.\n *\n * @param chainId - The chain ID associated with an existing network.\n * @throws if `chainId` does not refer to an existing network configuration,\n * or if the currently selected network is being removed.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerRemoveNetworkAction = {\n type: `NetworkController:removeNetwork`;\n handler: NetworkController['removeNetwork'];\n};\n\n/**\n * Assuming that the network has been previously switched, switches to this\n * new network.\n *\n * If the network has not been previously switched, this method is equivalent\n * to {@link resetConnection}.\n */\nexport type NetworkControllerRollbackToPreviousProviderAction = {\n type: `NetworkController:rollbackToPreviousProvider`;\n handler: NetworkController['rollbackToPreviousProvider'];\n};\n\n/**\n * Merges the given backup data into controller state.\n *\n * @param backup - The data that has been backed up.\n * @param backup.networkConfigurationsByChainId - Network configurations,\n * keyed by chain ID.\n */\nexport type NetworkControllerLoadBackupAction = {\n type: `NetworkController:loadBackup`;\n handler: NetworkController['loadBackup'];\n};\n\n/**\n * Searches for the default RPC endpoint configured for the given chain and\n * returns its network client ID. This can then be passed to\n * {@link getNetworkClientById} to retrieve the network client.\n *\n * @param chainId - Chain ID to search for.\n * @returns The ID of the network client created for the chain's default RPC\n * endpoint.\n */\nexport type NetworkControllerFindNetworkClientIdByChainIdAction = {\n type: `NetworkController:findNetworkClientIdByChainId`;\n handler: NetworkController['findNetworkClientIdByChainId'];\n};\n\n/**\n * Union of all NetworkController action types.\n */\nexport type NetworkControllerMethodActions =\n | NetworkControllerGetEthQueryAction\n | NetworkControllerEnableRpcFailoverAction\n | NetworkControllerDisableRpcFailoverAction\n | NetworkControllerGetProviderAndBlockTrackerAction\n | NetworkControllerGetSelectedNetworkClientAction\n | NetworkControllerGetSelectedChainIdAction\n | NetworkControllerGetNetworkClientRegistryAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerLookupNetworkAction\n | NetworkControllerLookupNetworkByClientIdAction\n | NetworkControllerSetProviderTypeAction\n | NetworkControllerSetActiveNetworkAction\n | NetworkControllerGetEIP1559CompatibilityAction\n | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction\n | NetworkControllerResetConnectionAction\n | NetworkControllerGetNetworkConfigurationByChainIdAction\n | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction\n | NetworkControllerAddNetworkAction\n | NetworkControllerUpdateNetworkAction\n | NetworkControllerRemoveNetworkAction\n | NetworkControllerRollbackToPreviousProviderAction\n | NetworkControllerLoadBackupAction\n | NetworkControllerFindNetworkClientIdByChainIdAction;\n"]}
@@ -83,28 +83,6 @@ export type NetworkControllerGetNetworkClientByIdAction = {
83
83
  type: `NetworkController:getNetworkClientById`;
84
84
  handler: NetworkController['getNetworkClientById'];
85
85
  };
86
- /**
87
- * Creates proxies for accessing the global network client and its block
88
- * tracker. You must call this method in order to use
89
- * `getProviderAndBlockTracker` (or its replacement,
90
- * `getSelectedNetworkClient`).
91
- *
92
- * @param options - Optional arguments.
93
- * @param options.lookupNetwork - Usually, metadata for the global network
94
- * will be populated via a call to `lookupNetwork` after creating the provider
95
- * and block tracker proxies. This allows for responding to the status of the
96
- * global network after initializing this controller; however, it requires
97
- * making a request to the network to do so. In the clients, where controllers
98
- * are initialized before the UI is shown, this may be undesirable, as it
99
- * means that if the user has just installed MetaMask, their IP address may be
100
- * shared with a third party before they have a chance to finish onboarding.
101
- * You can pass `false` if you'd like to disable this request and call
102
- * `lookupNetwork` yourself.
103
- */
104
- export type NetworkControllerInitializeProviderAction = {
105
- type: `NetworkController:initializeProvider`;
106
- handler: NetworkController['initializeProvider'];
107
- };
108
86
  /**
109
87
  * Uses a request for the latest block to gather the following information on
110
88
  * the given or selected network, persisting it to state:
@@ -304,5 +282,5 @@ export type NetworkControllerFindNetworkClientIdByChainIdAction = {
304
282
  /**
305
283
  * Union of all NetworkController action types.
306
284
  */
307
- export type NetworkControllerMethodActions = NetworkControllerGetEthQueryAction | NetworkControllerEnableRpcFailoverAction | NetworkControllerDisableRpcFailoverAction | NetworkControllerGetProviderAndBlockTrackerAction | NetworkControllerGetSelectedNetworkClientAction | NetworkControllerGetSelectedChainIdAction | NetworkControllerGetNetworkClientRegistryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerInitializeProviderAction | NetworkControllerLookupNetworkAction | NetworkControllerLookupNetworkByClientIdAction | NetworkControllerSetProviderTypeAction | NetworkControllerSetActiveNetworkAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction | NetworkControllerResetConnectionAction | NetworkControllerGetNetworkConfigurationByChainIdAction | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction | NetworkControllerAddNetworkAction | NetworkControllerUpdateNetworkAction | NetworkControllerRemoveNetworkAction | NetworkControllerRollbackToPreviousProviderAction | NetworkControllerLoadBackupAction | NetworkControllerFindNetworkClientIdByChainIdAction;
285
+ export type NetworkControllerMethodActions = NetworkControllerGetEthQueryAction | NetworkControllerEnableRpcFailoverAction | NetworkControllerDisableRpcFailoverAction | NetworkControllerGetProviderAndBlockTrackerAction | NetworkControllerGetSelectedNetworkClientAction | NetworkControllerGetSelectedChainIdAction | NetworkControllerGetNetworkClientRegistryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerLookupNetworkAction | NetworkControllerLookupNetworkByClientIdAction | NetworkControllerSetProviderTypeAction | NetworkControllerSetActiveNetworkAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction | NetworkControllerResetConnectionAction | NetworkControllerGetNetworkConfigurationByChainIdAction | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction | NetworkControllerAddNetworkAction | NetworkControllerUpdateNetworkAction | NetworkControllerRemoveNetworkAction | NetworkControllerRollbackToPreviousProviderAction | NetworkControllerLoadBackupAction | NetworkControllerFindNetworkClientIdByChainIdAction;
308
286
  //# sourceMappingURL=NetworkController-method-action-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkController-method-action-types.d.cts","sourceRoot":"","sources":["../src/NetworkController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gCAA4B;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;CAClD,CAAC;AAEF;;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CAAiC,CAAC;IACxC,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,iBAAiB,CAAC,4BAA4B,CAAC,CAAC;CAC1D,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,iBAAiB,CAAC,8BAA8B,CAAC,CAAC;CAC5D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,kCAAkC,GAClC,wCAAwC,GACxC,yCAAyC,GACzC,iDAAiD,GACjD,+CAA+C,GAC/C,yCAAyC,GACzC,+CAA+C,GAC/C,2CAA2C,GAC3C,yCAAyC,GACzC,oCAAoC,GACpC,8CAA8C,GAC9C,sCAAsC,GACtC,uCAAuC,GACvC,8CAA8C,GAC9C,8DAA8D,GAC9D,sCAAsC,GACtC,uDAAuD,GACvD,+DAA+D,GAC/D,iCAAiC,GACjC,oCAAoC,GACpC,oCAAoC,GACpC,iDAAiD,GACjD,iCAAiC,GACjC,mDAAmD,CAAC"}
1
+ {"version":3,"file":"NetworkController-method-action-types.d.cts","sourceRoot":"","sources":["../src/NetworkController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gCAA4B;AAE7D;;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A+D,GAC/D,iCAAiC,GACjC,oCAAoC,GACpC,oCAAoC,GACpC,iDAAiD,GACjD,iCAAiC,GACjC,mDAAmD,CAAC"}
@@ -83,28 +83,6 @@ export type NetworkControllerGetNetworkClientByIdAction = {
83
83
  type: `NetworkController:getNetworkClientById`;
84
84
  handler: NetworkController['getNetworkClientById'];
85
85
  };
86
- /**
87
- * Creates proxies for accessing the global network client and its block
88
- * tracker. You must call this method in order to use
89
- * `getProviderAndBlockTracker` (or its replacement,
90
- * `getSelectedNetworkClient`).
91
- *
92
- * @param options - Optional arguments.
93
- * @param options.lookupNetwork - Usually, metadata for the global network
94
- * will be populated via a call to `lookupNetwork` after creating the provider
95
- * and block tracker proxies. This allows for responding to the status of the
96
- * global network after initializing this controller; however, it requires
97
- * making a request to the network to do so. In the clients, where controllers
98
- * are initialized before the UI is shown, this may be undesirable, as it
99
- * means that if the user has just installed MetaMask, their IP address may be
100
- * shared with a third party before they have a chance to finish onboarding.
101
- * You can pass `false` if you'd like to disable this request and call
102
- * `lookupNetwork` yourself.
103
- */
104
- export type NetworkControllerInitializeProviderAction = {
105
- type: `NetworkController:initializeProvider`;
106
- handler: NetworkController['initializeProvider'];
107
- };
108
86
  /**
109
87
  * Uses a request for the latest block to gather the following information on
110
88
  * the given or selected network, persisting it to state:
@@ -304,5 +282,5 @@ export type NetworkControllerFindNetworkClientIdByChainIdAction = {
304
282
  /**
305
283
  * Union of all NetworkController action types.
306
284
  */
307
- export type NetworkControllerMethodActions = NetworkControllerGetEthQueryAction | NetworkControllerEnableRpcFailoverAction | NetworkControllerDisableRpcFailoverAction | NetworkControllerGetProviderAndBlockTrackerAction | NetworkControllerGetSelectedNetworkClientAction | NetworkControllerGetSelectedChainIdAction | NetworkControllerGetNetworkClientRegistryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerInitializeProviderAction | NetworkControllerLookupNetworkAction | NetworkControllerLookupNetworkByClientIdAction | NetworkControllerSetProviderTypeAction | NetworkControllerSetActiveNetworkAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction | NetworkControllerResetConnectionAction | NetworkControllerGetNetworkConfigurationByChainIdAction | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction | NetworkControllerAddNetworkAction | NetworkControllerUpdateNetworkAction | NetworkControllerRemoveNetworkAction | NetworkControllerRollbackToPreviousProviderAction | NetworkControllerLoadBackupAction | NetworkControllerFindNetworkClientIdByChainIdAction;
285
+ export type NetworkControllerMethodActions = NetworkControllerGetEthQueryAction | NetworkControllerEnableRpcFailoverAction | NetworkControllerDisableRpcFailoverAction | NetworkControllerGetProviderAndBlockTrackerAction | NetworkControllerGetSelectedNetworkClientAction | NetworkControllerGetSelectedChainIdAction | NetworkControllerGetNetworkClientRegistryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerLookupNetworkAction | NetworkControllerLookupNetworkByClientIdAction | NetworkControllerSetProviderTypeAction | NetworkControllerSetActiveNetworkAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction | NetworkControllerResetConnectionAction | NetworkControllerGetNetworkConfigurationByChainIdAction | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction | NetworkControllerAddNetworkAction | NetworkControllerUpdateNetworkAction | NetworkControllerRemoveNetworkAction | NetworkControllerRollbackToPreviousProviderAction | NetworkControllerLoadBackupAction | NetworkControllerFindNetworkClientIdByChainIdAction;
308
286
  //# sourceMappingURL=NetworkController-method-action-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkController-method-action-types.d.mts","sourceRoot":"","sources":["../src/NetworkController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gCAA4B;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC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C9C,8DAA8D,GAC9D,sCAAsC,GACtC,uDAAuD,GACvD,+DAA+D,GAC/D,iCAAiC,GACjC,oCAAoC,GACpC,oCAAoC,GACpC,iDAAiD,GACjD,iCAAiC,GACjC,mDAAmD,CAAC"}
1
+ {"version":3,"file":"NetworkController-method-action-types.d.mts","sourceRoot":"","sources":["../src/NetworkController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gCAA4B;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,iBAAiB,CAAC,4BAA4B,CAAC,CAAC;CAC1D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,iBAAiB,CAAC,0BAA0B,CAAC,CAAC;CACxD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,+CAA+C,GAAG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,CAAC,CAAC;CAC5D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,kCAAkC,GAClC,wCAAwC,GACxC,yCAAyC,GACzC,iDAAiD,GACjD,+CAA+C,GAC/C,yCAAyC,GACzC,+CAA+C,GAC/C,2CAA2C,GAC3C,oCAAoC,GACpC,8CAA8C,GAC9C,sCAAsC,GACtC,uCAAuC,GACvC,8CAA8C,GAC9C,8DAA8D,GAC9D,sCAAsC,GACtC,uDAAuD,GACvD,+DAA+D,GAC/D,iCAAiC,GACjC,oCAAoC,GACpC,oCAAoC,GACpC,iDAAiD,GACjD,iCAAiC,GACjC,mDAAmD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkController-method-action-types.mjs","sourceRoot":"","sources":["../src/NetworkController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NetworkController } from './NetworkController';\n\n/**\n * Returns the EthQuery instance for the currently selected network.\n *\n * @returns The EthQuery instance, or undefined if the provider has not been\n * initialized.\n */\nexport type NetworkControllerGetEthQueryAction = {\n type: `NetworkController:getEthQuery`;\n handler: NetworkController['getEthQuery'];\n};\n\n/**\n * Enables the RPC failover functionality. That is, if any RPC endpoints are\n * configured with failover URLs, then traffic will automatically be diverted\n * to them if those RPC endpoints are unavailable.\n */\nexport type NetworkControllerEnableRpcFailoverAction = {\n type: `NetworkController:enableRpcFailover`;\n handler: NetworkController['enableRpcFailover'];\n};\n\n/**\n * Disables the RPC failover functionality. That is, even if any RPC endpoints\n * are configured with failover URLs, then traffic will not automatically be\n * diverted to them if those RPC endpoints are unavailable.\n */\nexport type NetworkControllerDisableRpcFailoverAction = {\n type: `NetworkController:disableRpcFailover`;\n handler: NetworkController['disableRpcFailover'];\n};\n\n/**\n * Accesses the provider and block tracker for the currently selected network.\n *\n * @returns The proxy and block tracker proxies.\n * @deprecated This method has been replaced by `getSelectedNetworkClient` (which has a more easily used return type) and will be removed in a future release.\n */\nexport type NetworkControllerGetProviderAndBlockTrackerAction = {\n type: `NetworkController:getProviderAndBlockTracker`;\n handler: NetworkController['getProviderAndBlockTracker'];\n};\n\n/**\n * Accesses the provider and block tracker for the currently selected network.\n *\n * @returns an object with the provider and block tracker proxies for the currently selected network.\n */\nexport type NetworkControllerGetSelectedNetworkClientAction = {\n type: `NetworkController:getSelectedNetworkClient`;\n handler: NetworkController['getSelectedNetworkClient'];\n};\n\n/**\n * Accesses the chain ID from the selected network client.\n *\n * @returns The chain ID of the selected network client in hex format or undefined if there is no network client.\n */\nexport type NetworkControllerGetSelectedChainIdAction = {\n type: `NetworkController:getSelectedChainId`;\n handler: NetworkController['getSelectedChainId'];\n};\n\n/**\n * Internally, the Infura and custom network clients are categorized by type\n * so that when accessing either kind of network client, TypeScript knows\n * which type to assign to the network client. For some cases it's more useful\n * to be able to access network clients by ID instead of by type and then ID,\n * so this function makes that possible.\n *\n * @returns The network clients registered so far, keyed by ID.\n */\nexport type NetworkControllerGetNetworkClientRegistryAction = {\n type: `NetworkController:getNetworkClientRegistry`;\n handler: NetworkController['getNetworkClientRegistry'];\n};\n\n/**\n * Returns the Infura network client with the given ID.\n *\n * @param infuraNetworkClientId - An Infura network client ID.\n * @returns The Infura network client.\n * @throws If an Infura network client does not exist with the given ID.\n */\nexport type NetworkControllerGetNetworkClientByIdAction = {\n type: `NetworkController:getNetworkClientById`;\n handler: NetworkController['getNetworkClientById'];\n};\n\n/**\n * Creates proxies for accessing the global network client and its block\n * tracker. You must call this method in order to use\n * `getProviderAndBlockTracker` (or its replacement,\n * `getSelectedNetworkClient`).\n *\n * @param options - Optional arguments.\n * @param options.lookupNetwork - Usually, metadata for the global network\n * will be populated via a call to `lookupNetwork` after creating the provider\n * and block tracker proxies. This allows for responding to the status of the\n * global network after initializing this controller; however, it requires\n * making a request to the network to do so. In the clients, where controllers\n * are initialized before the UI is shown, this may be undesirable, as it\n * means that if the user has just installed MetaMask, their IP address may be\n * shared with a third party before they have a chance to finish onboarding.\n * You can pass `false` if you'd like to disable this request and call\n * `lookupNetwork` yourself.\n */\nexport type NetworkControllerInitializeProviderAction = {\n type: `NetworkController:initializeProvider`;\n handler: NetworkController['initializeProvider'];\n};\n\n/**\n * Uses a request for the latest block to gather the following information on\n * the given or selected network, persisting it to state:\n *\n * - The connectivity status: whether it is available, geo-blocked (Infura\n * only), unavailable, or unknown\n * - The capabilities status: whether it supports EIP-1559, whether it does\n * not, or whether it is unknown\n *\n * @param networkClientId - The ID of the network client to inspect.\n * If no ID is provided, uses the currently selected network.\n */\nexport type NetworkControllerLookupNetworkAction = {\n type: `NetworkController:lookupNetwork`;\n handler: NetworkController['lookupNetwork'];\n};\n\n/**\n * Uses a request for the latest block to gather the following information on\n * the given network, persisting it to state:\n *\n * - The connectivity status: whether the network is available, geo-blocked\n * (Infura only), unavailable, or unknown\n * - The feature compatibility status: whether the network supports EIP-1559,\n * whether it does not, or whether it is unknown\n *\n * @param networkClientId - The ID of the network client to inspect.\n * @deprecated Please use `lookupNetwork` and pass a network client ID\n * instead. This method will be removed in a future major version.\n */\nexport type NetworkControllerLookupNetworkByClientIdAction = {\n type: `NetworkController:lookupNetworkByClientId`;\n handler: NetworkController['lookupNetworkByClientId'];\n};\n\n/**\n * Convenience method to update provider network type settings.\n *\n * @param type - Human readable network name.\n * @deprecated This has been replaced by `setActiveNetwork`, and will be\n * removed in a future release\n */\nexport type NetworkControllerSetProviderTypeAction = {\n type: `NetworkController:setProviderType`;\n handler: NetworkController['setProviderType'];\n};\n\n/**\n * Changes the selected network.\n *\n * @param networkClientId - The ID of a network client that will be used to\n * make requests.\n * @param options - Options for this method.\n * @param options.updateState - Allows for updating state.\n * @throws if no network client is associated with the given\n * network client ID.\n */\nexport type NetworkControllerSetActiveNetworkAction = {\n type: `NetworkController:setActiveNetwork`;\n handler: NetworkController['setActiveNetwork'];\n};\n\n/**\n * Determines whether the network supports EIP-1559 by checking whether the\n * latest block has a `baseFeePerGas` property, then updates state\n * appropriately.\n *\n * @param networkClientId - The networkClientId to fetch the correct provider against which to check 1559 compatibility.\n * @returns A promise that resolves to true if the network supports EIP-1559\n * , false otherwise, or `undefined` if unable to determine the compatibility.\n */\nexport type NetworkControllerGetEIP1559CompatibilityAction = {\n type: `NetworkController:getEIP1559Compatibility`;\n handler: NetworkController['getEIP1559Compatibility'];\n};\n\nexport type NetworkControllerGet1559CompatibilityWithNetworkClientIdAction = {\n type: `NetworkController:get1559CompatibilityWithNetworkClientId`;\n handler: NetworkController['get1559CompatibilityWithNetworkClientId'];\n};\n\n/**\n * Ensures that the provider and block tracker proxies are pointed to the\n * currently selected network and refreshes the metadata for the\n */\nexport type NetworkControllerResetConnectionAction = {\n type: `NetworkController:resetConnection`;\n handler: NetworkController['resetConnection'];\n};\n\n/**\n * Returns the network configuration that has been filed under the given chain\n * ID.\n *\n * @param chainId - The chain ID to use as a key.\n * @returns The network configuration if one exists, or undefined.\n */\nexport type NetworkControllerGetNetworkConfigurationByChainIdAction = {\n type: `NetworkController:getNetworkConfigurationByChainId`;\n handler: NetworkController['getNetworkConfigurationByChainId'];\n};\n\n/**\n * Returns the network configuration that contains an RPC endpoint with the\n * given network client ID.\n *\n * @param networkClientId - The network client ID to use as a key.\n * @returns The network configuration if one exists, or undefined.\n */\nexport type NetworkControllerGetNetworkConfigurationByNetworkClientIdAction = {\n type: `NetworkController:getNetworkConfigurationByNetworkClientId`;\n handler: NetworkController['getNetworkConfigurationByNetworkClientId'];\n};\n\n/**\n * Creates and registers network clients for the collection of Infura and\n * custom RPC endpoints that can be used to make requests for a particular\n * chain, storing the given configuration object in state for later reference.\n *\n * @param fields - The object that describes the new network/chain and lists\n * the RPC endpoints which front that chain.\n * @returns The newly added network configuration.\n * @throws if any part of `fields` would produce invalid state.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerAddNetworkAction = {\n type: `NetworkController:addNetwork`;\n handler: NetworkController['addNetwork'];\n};\n\n/**\n * Updates the configuration for a previously stored network filed under the\n * given chain ID, creating + registering new network clients to represent RPC\n * endpoints that have been added and destroying + unregistering existing\n * network clients for RPC endpoints that have been removed.\n *\n * Note that if `chainId` is changed, then all network clients associated with\n * that chain will be removed and re-added, even if none of the RPC endpoints\n * have changed.\n *\n * @param chainId - The chain ID associated with an existing network.\n * @param fields - The object that describes the updates to the network/chain,\n * including the new set of RPC endpoints which should front that chain.\n * @param options - Options to provide.\n * @param options.replacementSelectedRpcEndpointIndex - Usually you cannot\n * remove an RPC endpoint that is being represented by the currently selected\n * network client. This option allows you to specify another RPC endpoint\n * (either an existing one or a new one) that should be used to select a new\n * network instead.\n * @returns The updated network configuration.\n * @throws if `chainId` does not refer to an existing network configuration,\n * if any part of `fields` would produce invalid state, etc.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerUpdateNetworkAction = {\n type: `NetworkController:updateNetwork`;\n handler: NetworkController['updateNetwork'];\n};\n\n/**\n * Destroys and unregisters the network identified by the given chain ID, also\n * removing the associated network configuration from state.\n *\n * @param chainId - The chain ID associated with an existing network.\n * @throws if `chainId` does not refer to an existing network configuration,\n * or if the currently selected network is being removed.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerRemoveNetworkAction = {\n type: `NetworkController:removeNetwork`;\n handler: NetworkController['removeNetwork'];\n};\n\n/**\n * Assuming that the network has been previously switched, switches to this\n * new network.\n *\n * If the network has not been previously switched, this method is equivalent\n * to {@link resetConnection}.\n */\nexport type NetworkControllerRollbackToPreviousProviderAction = {\n type: `NetworkController:rollbackToPreviousProvider`;\n handler: NetworkController['rollbackToPreviousProvider'];\n};\n\n/**\n * Merges the given backup data into controller state.\n *\n * @param backup - The data that has been backed up.\n * @param backup.networkConfigurationsByChainId - Network configurations,\n * keyed by chain ID.\n */\nexport type NetworkControllerLoadBackupAction = {\n type: `NetworkController:loadBackup`;\n handler: NetworkController['loadBackup'];\n};\n\n/**\n * Searches for the default RPC endpoint configured for the given chain and\n * returns its network client ID. This can then be passed to\n * {@link getNetworkClientById} to retrieve the network client.\n *\n * @param chainId - Chain ID to search for.\n * @returns The ID of the network client created for the chain's default RPC\n * endpoint.\n */\nexport type NetworkControllerFindNetworkClientIdByChainIdAction = {\n type: `NetworkController:findNetworkClientIdByChainId`;\n handler: NetworkController['findNetworkClientIdByChainId'];\n};\n\n/**\n * Union of all NetworkController action types.\n */\nexport type NetworkControllerMethodActions =\n | NetworkControllerGetEthQueryAction\n | NetworkControllerEnableRpcFailoverAction\n | NetworkControllerDisableRpcFailoverAction\n | NetworkControllerGetProviderAndBlockTrackerAction\n | NetworkControllerGetSelectedNetworkClientAction\n | NetworkControllerGetSelectedChainIdAction\n | NetworkControllerGetNetworkClientRegistryAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerInitializeProviderAction\n | NetworkControllerLookupNetworkAction\n | NetworkControllerLookupNetworkByClientIdAction\n | NetworkControllerSetProviderTypeAction\n | NetworkControllerSetActiveNetworkAction\n | NetworkControllerGetEIP1559CompatibilityAction\n | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction\n | NetworkControllerResetConnectionAction\n | NetworkControllerGetNetworkConfigurationByChainIdAction\n | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction\n | NetworkControllerAddNetworkAction\n | NetworkControllerUpdateNetworkAction\n | NetworkControllerRemoveNetworkAction\n | NetworkControllerRollbackToPreviousProviderAction\n | NetworkControllerLoadBackupAction\n | NetworkControllerFindNetworkClientIdByChainIdAction;\n"]}
1
+ {"version":3,"file":"NetworkController-method-action-types.mjs","sourceRoot":"","sources":["../src/NetworkController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NetworkController } from './NetworkController';\n\n/**\n * Returns the EthQuery instance for the currently selected network.\n *\n * @returns The EthQuery instance, or undefined if the provider has not been\n * initialized.\n */\nexport type NetworkControllerGetEthQueryAction = {\n type: `NetworkController:getEthQuery`;\n handler: NetworkController['getEthQuery'];\n};\n\n/**\n * Enables the RPC failover functionality. That is, if any RPC endpoints are\n * configured with failover URLs, then traffic will automatically be diverted\n * to them if those RPC endpoints are unavailable.\n */\nexport type NetworkControllerEnableRpcFailoverAction = {\n type: `NetworkController:enableRpcFailover`;\n handler: NetworkController['enableRpcFailover'];\n};\n\n/**\n * Disables the RPC failover functionality. That is, even if any RPC endpoints\n * are configured with failover URLs, then traffic will not automatically be\n * diverted to them if those RPC endpoints are unavailable.\n */\nexport type NetworkControllerDisableRpcFailoverAction = {\n type: `NetworkController:disableRpcFailover`;\n handler: NetworkController['disableRpcFailover'];\n};\n\n/**\n * Accesses the provider and block tracker for the currently selected network.\n *\n * @returns The proxy and block tracker proxies.\n * @deprecated This method has been replaced by `getSelectedNetworkClient` (which has a more easily used return type) and will be removed in a future release.\n */\nexport type NetworkControllerGetProviderAndBlockTrackerAction = {\n type: `NetworkController:getProviderAndBlockTracker`;\n handler: NetworkController['getProviderAndBlockTracker'];\n};\n\n/**\n * Accesses the provider and block tracker for the currently selected network.\n *\n * @returns an object with the provider and block tracker proxies for the currently selected network.\n */\nexport type NetworkControllerGetSelectedNetworkClientAction = {\n type: `NetworkController:getSelectedNetworkClient`;\n handler: NetworkController['getSelectedNetworkClient'];\n};\n\n/**\n * Accesses the chain ID from the selected network client.\n *\n * @returns The chain ID of the selected network client in hex format or undefined if there is no network client.\n */\nexport type NetworkControllerGetSelectedChainIdAction = {\n type: `NetworkController:getSelectedChainId`;\n handler: NetworkController['getSelectedChainId'];\n};\n\n/**\n * Internally, the Infura and custom network clients are categorized by type\n * so that when accessing either kind of network client, TypeScript knows\n * which type to assign to the network client. For some cases it's more useful\n * to be able to access network clients by ID instead of by type and then ID,\n * so this function makes that possible.\n *\n * @returns The network clients registered so far, keyed by ID.\n */\nexport type NetworkControllerGetNetworkClientRegistryAction = {\n type: `NetworkController:getNetworkClientRegistry`;\n handler: NetworkController['getNetworkClientRegistry'];\n};\n\n/**\n * Returns the Infura network client with the given ID.\n *\n * @param infuraNetworkClientId - An Infura network client ID.\n * @returns The Infura network client.\n * @throws If an Infura network client does not exist with the given ID.\n */\nexport type NetworkControllerGetNetworkClientByIdAction = {\n type: `NetworkController:getNetworkClientById`;\n handler: NetworkController['getNetworkClientById'];\n};\n\n/**\n * Uses a request for the latest block to gather the following information on\n * the given or selected network, persisting it to state:\n *\n * - The connectivity status: whether it is available, geo-blocked (Infura\n * only), unavailable, or unknown\n * - The capabilities status: whether it supports EIP-1559, whether it does\n * not, or whether it is unknown\n *\n * @param networkClientId - The ID of the network client to inspect.\n * If no ID is provided, uses the currently selected network.\n */\nexport type NetworkControllerLookupNetworkAction = {\n type: `NetworkController:lookupNetwork`;\n handler: NetworkController['lookupNetwork'];\n};\n\n/**\n * Uses a request for the latest block to gather the following information on\n * the given network, persisting it to state:\n *\n * - The connectivity status: whether the network is available, geo-blocked\n * (Infura only), unavailable, or unknown\n * - The feature compatibility status: whether the network supports EIP-1559,\n * whether it does not, or whether it is unknown\n *\n * @param networkClientId - The ID of the network client to inspect.\n * @deprecated Please use `lookupNetwork` and pass a network client ID\n * instead. This method will be removed in a future major version.\n */\nexport type NetworkControllerLookupNetworkByClientIdAction = {\n type: `NetworkController:lookupNetworkByClientId`;\n handler: NetworkController['lookupNetworkByClientId'];\n};\n\n/**\n * Convenience method to update provider network type settings.\n *\n * @param type - Human readable network name.\n * @deprecated This has been replaced by `setActiveNetwork`, and will be\n * removed in a future release\n */\nexport type NetworkControllerSetProviderTypeAction = {\n type: `NetworkController:setProviderType`;\n handler: NetworkController['setProviderType'];\n};\n\n/**\n * Changes the selected network.\n *\n * @param networkClientId - The ID of a network client that will be used to\n * make requests.\n * @param options - Options for this method.\n * @param options.updateState - Allows for updating state.\n * @throws if no network client is associated with the given\n * network client ID.\n */\nexport type NetworkControllerSetActiveNetworkAction = {\n type: `NetworkController:setActiveNetwork`;\n handler: NetworkController['setActiveNetwork'];\n};\n\n/**\n * Determines whether the network supports EIP-1559 by checking whether the\n * latest block has a `baseFeePerGas` property, then updates state\n * appropriately.\n *\n * @param networkClientId - The networkClientId to fetch the correct provider against which to check 1559 compatibility.\n * @returns A promise that resolves to true if the network supports EIP-1559\n * , false otherwise, or `undefined` if unable to determine the compatibility.\n */\nexport type NetworkControllerGetEIP1559CompatibilityAction = {\n type: `NetworkController:getEIP1559Compatibility`;\n handler: NetworkController['getEIP1559Compatibility'];\n};\n\nexport type NetworkControllerGet1559CompatibilityWithNetworkClientIdAction = {\n type: `NetworkController:get1559CompatibilityWithNetworkClientId`;\n handler: NetworkController['get1559CompatibilityWithNetworkClientId'];\n};\n\n/**\n * Ensures that the provider and block tracker proxies are pointed to the\n * currently selected network and refreshes the metadata for the\n */\nexport type NetworkControllerResetConnectionAction = {\n type: `NetworkController:resetConnection`;\n handler: NetworkController['resetConnection'];\n};\n\n/**\n * Returns the network configuration that has been filed under the given chain\n * ID.\n *\n * @param chainId - The chain ID to use as a key.\n * @returns The network configuration if one exists, or undefined.\n */\nexport type NetworkControllerGetNetworkConfigurationByChainIdAction = {\n type: `NetworkController:getNetworkConfigurationByChainId`;\n handler: NetworkController['getNetworkConfigurationByChainId'];\n};\n\n/**\n * Returns the network configuration that contains an RPC endpoint with the\n * given network client ID.\n *\n * @param networkClientId - The network client ID to use as a key.\n * @returns The network configuration if one exists, or undefined.\n */\nexport type NetworkControllerGetNetworkConfigurationByNetworkClientIdAction = {\n type: `NetworkController:getNetworkConfigurationByNetworkClientId`;\n handler: NetworkController['getNetworkConfigurationByNetworkClientId'];\n};\n\n/**\n * Creates and registers network clients for the collection of Infura and\n * custom RPC endpoints that can be used to make requests for a particular\n * chain, storing the given configuration object in state for later reference.\n *\n * @param fields - The object that describes the new network/chain and lists\n * the RPC endpoints which front that chain.\n * @returns The newly added network configuration.\n * @throws if any part of `fields` would produce invalid state.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerAddNetworkAction = {\n type: `NetworkController:addNetwork`;\n handler: NetworkController['addNetwork'];\n};\n\n/**\n * Updates the configuration for a previously stored network filed under the\n * given chain ID, creating + registering new network clients to represent RPC\n * endpoints that have been added and destroying + unregistering existing\n * network clients for RPC endpoints that have been removed.\n *\n * Note that if `chainId` is changed, then all network clients associated with\n * that chain will be removed and re-added, even if none of the RPC endpoints\n * have changed.\n *\n * @param chainId - The chain ID associated with an existing network.\n * @param fields - The object that describes the updates to the network/chain,\n * including the new set of RPC endpoints which should front that chain.\n * @param options - Options to provide.\n * @param options.replacementSelectedRpcEndpointIndex - Usually you cannot\n * remove an RPC endpoint that is being represented by the currently selected\n * network client. This option allows you to specify another RPC endpoint\n * (either an existing one or a new one) that should be used to select a new\n * network instead.\n * @returns The updated network configuration.\n * @throws if `chainId` does not refer to an existing network configuration,\n * if any part of `fields` would produce invalid state, etc.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerUpdateNetworkAction = {\n type: `NetworkController:updateNetwork`;\n handler: NetworkController['updateNetwork'];\n};\n\n/**\n * Destroys and unregisters the network identified by the given chain ID, also\n * removing the associated network configuration from state.\n *\n * @param chainId - The chain ID associated with an existing network.\n * @throws if `chainId` does not refer to an existing network configuration,\n * or if the currently selected network is being removed.\n * @see {@link NetworkConfiguration}\n */\nexport type NetworkControllerRemoveNetworkAction = {\n type: `NetworkController:removeNetwork`;\n handler: NetworkController['removeNetwork'];\n};\n\n/**\n * Assuming that the network has been previously switched, switches to this\n * new network.\n *\n * If the network has not been previously switched, this method is equivalent\n * to {@link resetConnection}.\n */\nexport type NetworkControllerRollbackToPreviousProviderAction = {\n type: `NetworkController:rollbackToPreviousProvider`;\n handler: NetworkController['rollbackToPreviousProvider'];\n};\n\n/**\n * Merges the given backup data into controller state.\n *\n * @param backup - The data that has been backed up.\n * @param backup.networkConfigurationsByChainId - Network configurations,\n * keyed by chain ID.\n */\nexport type NetworkControllerLoadBackupAction = {\n type: `NetworkController:loadBackup`;\n handler: NetworkController['loadBackup'];\n};\n\n/**\n * Searches for the default RPC endpoint configured for the given chain and\n * returns its network client ID. This can then be passed to\n * {@link getNetworkClientById} to retrieve the network client.\n *\n * @param chainId - Chain ID to search for.\n * @returns The ID of the network client created for the chain's default RPC\n * endpoint.\n */\nexport type NetworkControllerFindNetworkClientIdByChainIdAction = {\n type: `NetworkController:findNetworkClientIdByChainId`;\n handler: NetworkController['findNetworkClientIdByChainId'];\n};\n\n/**\n * Union of all NetworkController action types.\n */\nexport type NetworkControllerMethodActions =\n | NetworkControllerGetEthQueryAction\n | NetworkControllerEnableRpcFailoverAction\n | NetworkControllerDisableRpcFailoverAction\n | NetworkControllerGetProviderAndBlockTrackerAction\n | NetworkControllerGetSelectedNetworkClientAction\n | NetworkControllerGetSelectedChainIdAction\n | NetworkControllerGetNetworkClientRegistryAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerLookupNetworkAction\n | NetworkControllerLookupNetworkByClientIdAction\n | NetworkControllerSetProviderTypeAction\n | NetworkControllerSetActiveNetworkAction\n | NetworkControllerGetEIP1559CompatibilityAction\n | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction\n | NetworkControllerResetConnectionAction\n | NetworkControllerGetNetworkConfigurationByChainIdAction\n | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction\n | NetworkControllerAddNetworkAction\n | NetworkControllerUpdateNetworkAction\n | NetworkControllerRemoveNetworkAction\n | NetworkControllerRollbackToPreviousProviderAction\n | NetworkControllerLoadBackupAction\n | NetworkControllerFindNetworkClientIdByChainIdAction;\n"]}
@@ -54,6 +54,7 @@ const uuid_1 = require("uuid");
54
54
  const constants_1 = require("./constants.cjs");
55
55
  const create_auto_managed_network_client_1 = require("./create-auto-managed-network-client.cjs");
56
56
  const logger_1 = require("./logger.cjs");
57
+ const selectors_1 = require("./selectors.cjs");
57
58
  const types_1 = require("./types.cjs");
58
59
  const debugLog = (0, logger_1.createModuleLogger)(logger_1.projectLogger, 'NetworkController');
59
60
  const INFURA_URL_REGEX = /^https:\/\/(?<networkName>[^.]+)\.infura\.io\/v\d+\/(?<apiKey>.+)$/u;
@@ -116,7 +117,6 @@ const MESSENGER_EXPOSED_METHODS = [
116
117
  'getProviderAndBlockTracker',
117
118
  'getSelectedChainId',
118
119
  'getSelectedNetworkClient',
119
- 'initializeProvider',
120
120
  'loadBackup',
121
121
  'lookupNetwork',
122
122
  'lookupNetworkByClientId',
@@ -131,20 +131,12 @@ const MESSENGER_EXPOSED_METHODS = [
131
131
  * Constructs a value for the state property `networkConfigurationsByChainId`
132
132
  * which will be used if it has not been provided to the constructor.
133
133
  *
134
- * @param [additionalDefaultNetworks] - An array of Hex Chain IDs representing the additional networks to be included as default.
135
134
  * @returns The default value for `networkConfigurationsByChainId`.
136
135
  */
137
- function getDefaultNetworkConfigurationsByChainId(additionalDefaultNetworks = []) {
136
+ function getDefaultNetworkConfigurationsByChainId() {
138
137
  const infuraNetworks = getDefaultInfuraNetworkConfigurationsByChainId();
139
138
  const customNetworks = getDefaultCustomNetworkConfigurationsByChainId();
140
- return additionalDefaultNetworks.reduce((obj, chainId) => {
141
- if ((0, utils_1.hasProperty)(customNetworks, chainId)) {
142
- obj[chainId] = customNetworks[chainId];
143
- }
144
- return obj;
145
- },
146
- // Always include the infura networks in the default networks
147
- infuraNetworks);
139
+ return { ...customNetworks, ...infuraNetworks };
148
140
  }
149
141
  /**
150
142
  * Constructs a `networkConfigurationsByChainId` object for all default Infura networks.
@@ -159,8 +151,10 @@ function getDefaultInfuraNetworkConfigurationsByChainId() {
159
151
  return obj;
160
152
  }
161
153
  const rpcEndpointUrl = `https://${infuraNetworkType}.infura.io/v3/{infuraProjectId}`;
154
+ const { rpcPrefs } = controller_utils_1.BUILT_IN_NETWORKS[infuraNetworkType];
162
155
  const networkConfiguration = {
163
- blockExplorerUrls: [],
156
+ blockExplorerUrls: [rpcPrefs.blockExplorerUrl],
157
+ defaultBlockExplorerUrlIndex: 0,
164
158
  chainId,
165
159
  defaultRpcEndpointIndex: 0,
166
160
  name: controller_utils_1.NetworkNickname[infuraNetworkType],
@@ -222,12 +216,11 @@ function getCustomNetworkConfiguration(customNetworkType) {
222
216
  * Constructs properties for the NetworkController state whose values will be
223
217
  * used if not provided to the constructor.
224
218
  *
225
- * @param [additionalDefaultNetworks] - An array of Hex Chain IDs representing the additional networks to be included as default.
226
219
  * @returns The default NetworkController state.
227
220
  */
228
- function getDefaultNetworkControllerState(additionalDefaultNetworks) {
221
+ function getDefaultNetworkControllerState() {
229
222
  const networksMetadata = {};
230
- const networkConfigurationsByChainId = getDefaultNetworkConfigurationsByChainId(additionalDefaultNetworks);
223
+ const networkConfigurationsByChainId = getDefaultNetworkConfigurationsByChainId();
231
224
  return {
232
225
  selectedNetworkClientId: controller_utils_1.InfuraNetworkType.mainnet,
233
226
  networksMetadata,
@@ -401,9 +394,9 @@ class NetworkController extends base_controller_1.BaseController {
401
394
  * @param options - The options; see {@link NetworkControllerOptions}.
402
395
  */
403
396
  constructor(options) {
404
- const { messenger, state, infuraProjectId, log, getRpcServiceOptions, getBlockTrackerOptions, additionalDefaultNetworks, isRpcFailoverEnabled = false, } = options;
397
+ const { messenger, state, infuraProjectId, log, getRpcServiceOptions, getBlockTrackerOptions, } = options;
405
398
  const initialState = {
406
- ...getDefaultNetworkControllerState(additionalDefaultNetworks),
399
+ ...getDefaultNetworkControllerState(),
407
400
  ...state,
408
401
  };
409
402
  validateInitialState(initialState);
@@ -448,12 +441,11 @@ class NetworkController extends base_controller_1.BaseController {
448
441
  _NetworkController_getRpcServiceOptions.set(this, void 0);
449
442
  _NetworkController_getBlockTrackerOptions.set(this, void 0);
450
443
  _NetworkController_networkConfigurationsByNetworkClientId.set(this, void 0);
451
- _NetworkController_isRpcFailoverEnabled.set(this, void 0);
444
+ _NetworkController_isRpcFailoverEnabled.set(this, false);
452
445
  __classPrivateFieldSet(this, _NetworkController_infuraProjectId, infuraProjectId, "f");
453
446
  __classPrivateFieldSet(this, _NetworkController_log, log, "f");
454
447
  __classPrivateFieldSet(this, _NetworkController_getRpcServiceOptions, getRpcServiceOptions, "f");
455
448
  __classPrivateFieldSet(this, _NetworkController_getBlockTrackerOptions, getBlockTrackerOptions, "f");
456
- __classPrivateFieldSet(this, _NetworkController_isRpcFailoverEnabled, isRpcFailoverEnabled, "f");
457
449
  __classPrivateFieldSet(this, _NetworkController_previouslySelectedNetworkClientId, this.state.selectedNetworkClientId, "f");
458
450
  __classPrivateFieldSet(this, _NetworkController_networkConfigurationsByNetworkClientId, buildNetworkConfigurationsByNetworkClientId(this.state.networkConfigurationsByChainId), "f");
459
451
  this.messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);
@@ -472,6 +464,11 @@ class NetworkController extends base_controller_1.BaseController {
472
464
  networkStatus: constants_1.NetworkStatus.Available,
473
465
  });
474
466
  });
467
+ this.messenger.subscribe(
468
+ // eslint-disable-next-line no-restricted-syntax
469
+ 'RemoteFeatureFlagController:stateChange', (isRpcFailoverEnabled) => {
470
+ __classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_updateRpcFailoverEnabled).call(this, isRpcFailoverEnabled);
471
+ }, selectors_1.getIsRpcFailoverEnabled);
475
472
  }
476
473
  /**
477
474
  * Returns the EthQuery instance for the currently selected network.
@@ -566,12 +563,14 @@ class NetworkController extends base_controller_1.BaseController {
566
563
  }
567
564
  return customNetworkClient;
568
565
  }
569
- initializeProvider({ lookupNetwork = true, } = {}) {
566
+ /**
567
+ * Initialize the NetworkController, updating the RPC failover feature flag
568
+ * and applying the network selection.
569
+ */
570
+ init() {
571
+ const state = this.messenger.call('RemoteFeatureFlagController:getState');
572
+ __classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_updateRpcFailoverEnabled).call(this, (0, selectors_1.getIsRpcFailoverEnabled)(state));
570
573
  __classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_applyNetworkSelection).call(this, this.state.selectedNetworkClientId);
571
- if (lookupNetwork) {
572
- return this.lookupNetwork();
573
- }
574
- return undefined;
575
574
  }
576
575
  /**
577
576
  * Uses a request for the latest block to gather the following information on