@metamask-previews/network-controller 36.0.0-preview-4f4c98e → 36.0.0-preview-5b293ee50

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 (158) hide show
  1. package/CHANGELOG.md +0 -5
  2. package/dist/NetworkController-method-action-types.cjs +7 -0
  3. package/dist/NetworkController-method-action-types.cjs.map +1 -0
  4. package/dist/{NetworkController-method-action-types.d.ts → NetworkController-method-action-types.d.cts} +2 -2
  5. package/dist/NetworkController-method-action-types.d.cts.map +1 -0
  6. package/dist/NetworkController-method-action-types.d.mts +268 -0
  7. package/dist/NetworkController-method-action-types.d.mts.map +1 -0
  8. package/dist/{NetworkController-method-action-types.js → NetworkController-method-action-types.mjs} +1 -1
  9. package/dist/NetworkController-method-action-types.mjs.map +1 -0
  10. package/dist/NetworkController.cjs +1599 -0
  11. package/dist/NetworkController.cjs.map +1 -0
  12. package/dist/{NetworkController.d.ts → NetworkController.d.cts} +29 -37
  13. package/dist/NetworkController.d.cts.map +1 -0
  14. package/dist/NetworkController.d.mts +956 -0
  15. package/dist/NetworkController.d.mts.map +1 -0
  16. package/dist/{NetworkController.js → NetworkController.mjs} +29 -20
  17. package/dist/NetworkController.mjs.map +1 -0
  18. package/dist/constants.cjs +46 -0
  19. package/dist/constants.cjs.map +1 -0
  20. package/dist/{constants.d.ts → constants.d.cts} +1 -1
  21. package/dist/constants.d.cts.map +1 -0
  22. package/dist/constants.d.mts +42 -0
  23. package/dist/constants.d.mts.map +1 -0
  24. package/dist/{constants.js → constants.mjs} +1 -1
  25. package/dist/constants.mjs.map +1 -0
  26. package/dist/create-auto-managed-network-client.cjs +149 -0
  27. package/dist/create-auto-managed-network-client.cjs.map +1 -0
  28. package/dist/{create-auto-managed-network-client.d.ts → create-auto-managed-network-client.d.cts} +7 -7
  29. package/dist/create-auto-managed-network-client.d.cts.map +1 -0
  30. package/dist/create-auto-managed-network-client.d.mts +74 -0
  31. package/dist/create-auto-managed-network-client.d.mts.map +1 -0
  32. package/dist/{create-auto-managed-network-client.js → create-auto-managed-network-client.mjs} +2 -2
  33. package/dist/create-auto-managed-network-client.mjs.map +1 -0
  34. package/dist/create-network-client.cjs +439 -0
  35. package/dist/create-network-client.cjs.map +1 -0
  36. package/dist/{create-network-client.d.ts → create-network-client.d.cts} +7 -7
  37. package/dist/create-network-client.d.cts.map +1 -0
  38. package/dist/create-network-client.d.mts +60 -0
  39. package/dist/create-network-client.d.mts.map +1 -0
  40. package/dist/{create-network-client.js → create-network-client.mjs} +14 -15
  41. package/dist/create-network-client.mjs.map +1 -0
  42. package/dist/index.cjs +31 -0
  43. package/dist/index.cjs.map +1 -0
  44. package/dist/{index.d.ts → index.d.cts} +16 -16
  45. package/dist/index.d.cts.map +1 -0
  46. package/dist/index.d.mts +16 -0
  47. package/dist/index.d.mts.map +1 -0
  48. package/dist/index.mjs +6 -0
  49. package/dist/index.mjs.map +1 -0
  50. package/dist/logger.cjs +7 -0
  51. package/dist/logger.cjs.map +1 -0
  52. package/dist/logger.d.cts +5 -0
  53. package/dist/logger.d.cts.map +1 -0
  54. package/dist/logger.d.mts +5 -0
  55. package/dist/logger.d.mts.map +1 -0
  56. package/dist/logger.mjs +4 -0
  57. package/dist/logger.mjs.map +1 -0
  58. package/dist/rpc-service/abstract-rpc-service.cjs +3 -0
  59. package/dist/rpc-service/abstract-rpc-service.cjs.map +1 -0
  60. package/dist/rpc-service/{abstract-rpc-service.d.ts → abstract-rpc-service.d.cts} +2 -2
  61. package/dist/rpc-service/abstract-rpc-service.d.cts.map +1 -0
  62. package/dist/rpc-service/abstract-rpc-service.d.mts +17 -0
  63. package/dist/rpc-service/abstract-rpc-service.d.mts.map +1 -0
  64. package/dist/rpc-service/abstract-rpc-service.mjs +2 -0
  65. package/dist/rpc-service/abstract-rpc-service.mjs.map +1 -0
  66. package/dist/rpc-service/rpc-service-chain.cjs +304 -0
  67. package/dist/rpc-service/rpc-service-chain.cjs.map +1 -0
  68. package/dist/rpc-service/{rpc-service-chain.d.ts → rpc-service-chain.d.cts} +6 -6
  69. package/dist/rpc-service/rpc-service-chain.d.cts.map +1 -0
  70. package/dist/rpc-service/rpc-service-chain.d.mts +169 -0
  71. package/dist/rpc-service/rpc-service-chain.d.mts.map +1 -0
  72. package/dist/rpc-service/{rpc-service-chain.js → rpc-service-chain.mjs} +4 -4
  73. package/dist/rpc-service/rpc-service-chain.mjs.map +1 -0
  74. package/dist/rpc-service/rpc-service-requestable.cjs +3 -0
  75. package/dist/rpc-service/rpc-service-requestable.cjs.map +1 -0
  76. package/dist/rpc-service/{rpc-service-requestable.d.ts → rpc-service-requestable.d.cts} +4 -4
  77. package/dist/rpc-service/rpc-service-requestable.d.cts.map +1 -0
  78. package/dist/rpc-service/rpc-service-requestable.d.mts +63 -0
  79. package/dist/rpc-service/rpc-service-requestable.d.mts.map +1 -0
  80. package/dist/rpc-service/rpc-service-requestable.mjs +2 -0
  81. package/dist/rpc-service/rpc-service-requestable.mjs.map +1 -0
  82. package/dist/rpc-service/rpc-service.cjs +540 -0
  83. package/dist/rpc-service/rpc-service.cjs.map +1 -0
  84. package/dist/rpc-service/{rpc-service.d.ts → rpc-service.d.cts} +6 -6
  85. package/dist/rpc-service/rpc-service.d.cts.map +1 -0
  86. package/dist/rpc-service/rpc-service.d.mts +247 -0
  87. package/dist/rpc-service/rpc-service.d.mts.map +1 -0
  88. package/dist/rpc-service/{rpc-service.js → rpc-service.mjs} +14 -6
  89. package/dist/rpc-service/rpc-service.mjs.map +1 -0
  90. package/dist/rpc-service/shared.cjs +3 -0
  91. package/dist/rpc-service/shared.cjs.map +1 -0
  92. package/dist/rpc-service/{shared.d.ts → shared.d.cts} +2 -2
  93. package/dist/rpc-service/shared.d.cts.map +1 -0
  94. package/dist/rpc-service/shared.d.mts +32 -0
  95. package/dist/rpc-service/shared.d.mts.map +1 -0
  96. package/dist/rpc-service/shared.mjs +2 -0
  97. package/dist/rpc-service/shared.mjs.map +1 -0
  98. package/dist/rpc-service-analytics.cjs +180 -0
  99. package/dist/rpc-service-analytics.cjs.map +1 -0
  100. package/dist/{rpc-service-analytics.d.ts → rpc-service-analytics.d.cts} +3 -3
  101. package/dist/rpc-service-analytics.d.cts.map +1 -0
  102. package/dist/rpc-service-analytics.d.mts +85 -0
  103. package/dist/rpc-service-analytics.d.mts.map +1 -0
  104. package/dist/{rpc-service-analytics.js → rpc-service-analytics.mjs} +4 -4
  105. package/dist/rpc-service-analytics.mjs.map +1 -0
  106. package/dist/selectors.cjs +16 -0
  107. package/dist/selectors.cjs.map +1 -0
  108. package/dist/{selectors.d.ts → selectors.d.cts} +2 -2
  109. package/dist/selectors.d.cts.map +1 -0
  110. package/dist/selectors.d.mts +22 -0
  111. package/dist/selectors.d.mts.map +1 -0
  112. package/dist/{selectors.js → selectors.mjs} +1 -1
  113. package/dist/selectors.mjs.map +1 -0
  114. package/dist/types.cjs +12 -0
  115. package/dist/types.cjs.map +1 -0
  116. package/dist/{types.d.ts → types.d.cts} +5 -5
  117. package/dist/types.d.cts.map +1 -0
  118. package/dist/types.d.mts +49 -0
  119. package/dist/types.d.mts.map +1 -0
  120. package/dist/{types.js → types.mjs} +1 -1
  121. package/dist/types.mjs.map +1 -0
  122. package/package.json +19 -15
  123. package/dist/NetworkController-method-action-types.d.ts.map +0 -1
  124. package/dist/NetworkController-method-action-types.js.map +0 -1
  125. package/dist/NetworkController.d.ts.map +0 -1
  126. package/dist/NetworkController.js.map +0 -1
  127. package/dist/constants.d.ts.map +0 -1
  128. package/dist/constants.js.map +0 -1
  129. package/dist/create-auto-managed-network-client.d.ts.map +0 -1
  130. package/dist/create-auto-managed-network-client.js.map +0 -1
  131. package/dist/create-network-client.d.ts.map +0 -1
  132. package/dist/create-network-client.js.map +0 -1
  133. package/dist/index.d.ts.map +0 -1
  134. package/dist/index.js +0 -6
  135. package/dist/index.js.map +0 -1
  136. package/dist/logger.d.ts +0 -4
  137. package/dist/logger.d.ts.map +0 -1
  138. package/dist/logger.js +0 -4
  139. package/dist/logger.js.map +0 -1
  140. package/dist/rpc-service/abstract-rpc-service.d.ts.map +0 -1
  141. package/dist/rpc-service/abstract-rpc-service.js +0 -2
  142. package/dist/rpc-service/abstract-rpc-service.js.map +0 -1
  143. package/dist/rpc-service/rpc-service-chain.d.ts.map +0 -1
  144. package/dist/rpc-service/rpc-service-chain.js.map +0 -1
  145. package/dist/rpc-service/rpc-service-requestable.d.ts.map +0 -1
  146. package/dist/rpc-service/rpc-service-requestable.js +0 -2
  147. package/dist/rpc-service/rpc-service-requestable.js.map +0 -1
  148. package/dist/rpc-service/rpc-service.d.ts.map +0 -1
  149. package/dist/rpc-service/rpc-service.js.map +0 -1
  150. package/dist/rpc-service/shared.d.ts.map +0 -1
  151. package/dist/rpc-service/shared.js +0 -2
  152. package/dist/rpc-service/shared.js.map +0 -1
  153. package/dist/rpc-service-analytics.d.ts.map +0 -1
  154. package/dist/rpc-service-analytics.js.map +0 -1
  155. package/dist/selectors.d.ts.map +0 -1
  156. package/dist/selectors.js.map +0 -1
  157. package/dist/types.d.ts.map +0 -1
  158. package/dist/types.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,11 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Changed
11
-
12
- - **BREAKING:** Bump minimum Node.js version to 22 ([#9168](https://github.com/MetaMask/core/pull/9168))
13
- - Bump `@metamask/remote-feature-flag-controller` from `^6.0.0` to `^6.1.0` ([#9980](https://github.com/MetaMask/core/pull/9980))
14
-
15
10
  ## [36.0.0]
16
11
 
17
12
  ### Changed
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * This file is auto generated.
4
+ * Do not edit manually.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=NetworkController-method-action-types.cjs.map
@@ -0,0 +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.js';\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 * 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 | 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"]}
@@ -2,7 +2,7 @@
2
2
  * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
- import type { NetworkController } from './NetworkController.js';
5
+ import type { NetworkController } from "./NetworkController.cjs";
6
6
  /**
7
7
  * Returns the EthQuery instance for the currently selected network.
8
8
  *
@@ -265,4 +265,4 @@ export type NetworkControllerFindNetworkClientIdByChainIdAction = {
265
265
  * Union of all NetworkController action types.
266
266
  */
267
267
  export type NetworkControllerMethodActions = NetworkControllerGetEthQueryAction | NetworkControllerGetProviderAndBlockTrackerAction | NetworkControllerGetSelectedNetworkClientAction | NetworkControllerGetSelectedChainIdAction | NetworkControllerGetNetworkClientRegistryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerLookupNetworkAction | NetworkControllerLookupNetworkByClientIdAction | NetworkControllerSetProviderTypeAction | NetworkControllerSetActiveNetworkAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction | NetworkControllerResetConnectionAction | NetworkControllerGetNetworkConfigurationByChainIdAction | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction | NetworkControllerAddNetworkAction | NetworkControllerUpdateNetworkAction | NetworkControllerRemoveNetworkAction | NetworkControllerRollbackToPreviousProviderAction | NetworkControllerLoadBackupAction | NetworkControllerFindNetworkClientIdByChainIdAction;
268
- //# sourceMappingURL=NetworkController-method-action-types.d.ts.map
268
+ //# sourceMappingURL=NetworkController-method-action-types.d.cts.map
@@ -0,0 +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,gCAA+B;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CAC3C,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;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IAC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G;AACH,MAAM,MAAM,8BAA8B,GACtC,kCAAkC,GAClC,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"}
@@ -0,0 +1,268 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { NetworkController } from "./NetworkController.mjs";
6
+ /**
7
+ * Returns the EthQuery instance for the currently selected network.
8
+ *
9
+ * @returns The EthQuery instance, or undefined if the provider has not been
10
+ * initialized.
11
+ */
12
+ export type NetworkControllerGetEthQueryAction = {
13
+ type: `NetworkController:getEthQuery`;
14
+ handler: NetworkController['getEthQuery'];
15
+ };
16
+ /**
17
+ * Accesses the provider and block tracker for the currently selected network.
18
+ *
19
+ * @returns The proxy and block tracker proxies.
20
+ * @deprecated This method has been replaced by `getSelectedNetworkClient` (which has a more easily used return type) and will be removed in a future release.
21
+ */
22
+ export type NetworkControllerGetProviderAndBlockTrackerAction = {
23
+ type: `NetworkController:getProviderAndBlockTracker`;
24
+ handler: NetworkController['getProviderAndBlockTracker'];
25
+ };
26
+ /**
27
+ * Accesses the provider and block tracker for the currently selected network.
28
+ *
29
+ * @returns an object with the provider and block tracker proxies for the currently selected network.
30
+ */
31
+ export type NetworkControllerGetSelectedNetworkClientAction = {
32
+ type: `NetworkController:getSelectedNetworkClient`;
33
+ handler: NetworkController['getSelectedNetworkClient'];
34
+ };
35
+ /**
36
+ * Accesses the chain ID from the selected network client.
37
+ *
38
+ * @returns The chain ID of the selected network client in hex format or undefined if there is no network client.
39
+ */
40
+ export type NetworkControllerGetSelectedChainIdAction = {
41
+ type: `NetworkController:getSelectedChainId`;
42
+ handler: NetworkController['getSelectedChainId'];
43
+ };
44
+ /**
45
+ * Internally, the Infura and custom network clients are categorized by type
46
+ * so that when accessing either kind of network client, TypeScript knows
47
+ * which type to assign to the network client. For some cases it's more useful
48
+ * to be able to access network clients by ID instead of by type and then ID,
49
+ * so this function makes that possible.
50
+ *
51
+ * @returns The network clients registered so far, keyed by ID.
52
+ */
53
+ export type NetworkControllerGetNetworkClientRegistryAction = {
54
+ type: `NetworkController:getNetworkClientRegistry`;
55
+ handler: NetworkController['getNetworkClientRegistry'];
56
+ };
57
+ /**
58
+ * Returns the Infura network client with the given ID.
59
+ *
60
+ * @param infuraNetworkClientId - An Infura network client ID.
61
+ * @returns The Infura network client.
62
+ * @throws If an Infura network client does not exist with the given ID.
63
+ */
64
+ export type NetworkControllerGetNetworkClientByIdAction = {
65
+ type: `NetworkController:getNetworkClientById`;
66
+ handler: NetworkController['getNetworkClientById'];
67
+ };
68
+ /**
69
+ * Uses a request for the latest block to gather the following information on
70
+ * the given or selected network, persisting it to state:
71
+ *
72
+ * - The connectivity status: whether it is available, geo-blocked (Infura
73
+ * only), unavailable, or unknown
74
+ * - The capabilities status: whether it supports EIP-1559, whether it does
75
+ * not, or whether it is unknown
76
+ *
77
+ * @param networkClientId - The ID of the network client to inspect.
78
+ * If no ID is provided, uses the currently selected network.
79
+ */
80
+ export type NetworkControllerLookupNetworkAction = {
81
+ type: `NetworkController:lookupNetwork`;
82
+ handler: NetworkController['lookupNetwork'];
83
+ };
84
+ /**
85
+ * Uses a request for the latest block to gather the following information on
86
+ * the given network, persisting it to state:
87
+ *
88
+ * - The connectivity status: whether the network is available, geo-blocked
89
+ * (Infura only), unavailable, or unknown
90
+ * - The feature compatibility status: whether the network supports EIP-1559,
91
+ * whether it does not, or whether it is unknown
92
+ *
93
+ * @param networkClientId - The ID of the network client to inspect.
94
+ * @deprecated Please use `lookupNetwork` and pass a network client ID
95
+ * instead. This method will be removed in a future major version.
96
+ */
97
+ export type NetworkControllerLookupNetworkByClientIdAction = {
98
+ type: `NetworkController:lookupNetworkByClientId`;
99
+ handler: NetworkController['lookupNetworkByClientId'];
100
+ };
101
+ /**
102
+ * Convenience method to update provider network type settings.
103
+ *
104
+ * @param type - Human readable network name.
105
+ * @deprecated This has been replaced by `setActiveNetwork`, and will be
106
+ * removed in a future release
107
+ */
108
+ export type NetworkControllerSetProviderTypeAction = {
109
+ type: `NetworkController:setProviderType`;
110
+ handler: NetworkController['setProviderType'];
111
+ };
112
+ /**
113
+ * Changes the selected network.
114
+ *
115
+ * @param networkClientId - The ID of a network client that will be used to
116
+ * make requests.
117
+ * @param options - Options for this method.
118
+ * @param options.updateState - Allows for updating state.
119
+ * @throws if no network client is associated with the given
120
+ * network client ID.
121
+ */
122
+ export type NetworkControllerSetActiveNetworkAction = {
123
+ type: `NetworkController:setActiveNetwork`;
124
+ handler: NetworkController['setActiveNetwork'];
125
+ };
126
+ /**
127
+ * Determines whether the network supports EIP-1559 by checking whether the
128
+ * latest block has a `baseFeePerGas` property, then updates state
129
+ * appropriately.
130
+ *
131
+ * @param networkClientId - The networkClientId to fetch the correct provider against which to check 1559 compatibility.
132
+ * @returns A promise that resolves to true if the network supports EIP-1559
133
+ * , false otherwise, or `undefined` if unable to determine the compatibility.
134
+ */
135
+ export type NetworkControllerGetEIP1559CompatibilityAction = {
136
+ type: `NetworkController:getEIP1559Compatibility`;
137
+ handler: NetworkController['getEIP1559Compatibility'];
138
+ };
139
+ export type NetworkControllerGet1559CompatibilityWithNetworkClientIdAction = {
140
+ type: `NetworkController:get1559CompatibilityWithNetworkClientId`;
141
+ handler: NetworkController['get1559CompatibilityWithNetworkClientId'];
142
+ };
143
+ /**
144
+ * Ensures that the provider and block tracker proxies are pointed to the
145
+ * currently selected network and refreshes the metadata for the
146
+ */
147
+ export type NetworkControllerResetConnectionAction = {
148
+ type: `NetworkController:resetConnection`;
149
+ handler: NetworkController['resetConnection'];
150
+ };
151
+ /**
152
+ * Returns the network configuration that has been filed under the given chain
153
+ * ID.
154
+ *
155
+ * @param chainId - The chain ID to use as a key.
156
+ * @returns The network configuration if one exists, or undefined.
157
+ */
158
+ export type NetworkControllerGetNetworkConfigurationByChainIdAction = {
159
+ type: `NetworkController:getNetworkConfigurationByChainId`;
160
+ handler: NetworkController['getNetworkConfigurationByChainId'];
161
+ };
162
+ /**
163
+ * Returns the network configuration that contains an RPC endpoint with the
164
+ * given network client ID.
165
+ *
166
+ * @param networkClientId - The network client ID to use as a key.
167
+ * @returns The network configuration if one exists, or undefined.
168
+ */
169
+ export type NetworkControllerGetNetworkConfigurationByNetworkClientIdAction = {
170
+ type: `NetworkController:getNetworkConfigurationByNetworkClientId`;
171
+ handler: NetworkController['getNetworkConfigurationByNetworkClientId'];
172
+ };
173
+ /**
174
+ * Creates and registers network clients for the collection of Infura and
175
+ * custom RPC endpoints that can be used to make requests for a particular
176
+ * chain, storing the given configuration object in state for later reference.
177
+ *
178
+ * @param fields - The object that describes the new network/chain and lists
179
+ * the RPC endpoints which front that chain.
180
+ * @returns The newly added network configuration.
181
+ * @throws if any part of `fields` would produce invalid state.
182
+ * @see {@link NetworkConfiguration}
183
+ */
184
+ export type NetworkControllerAddNetworkAction = {
185
+ type: `NetworkController:addNetwork`;
186
+ handler: NetworkController['addNetwork'];
187
+ };
188
+ /**
189
+ * Updates the configuration for a previously stored network filed under the
190
+ * given chain ID, creating + registering new network clients to represent RPC
191
+ * endpoints that have been added and destroying + unregistering existing
192
+ * network clients for RPC endpoints that have been removed.
193
+ *
194
+ * Note that if `chainId` is changed, then all network clients associated with
195
+ * that chain will be removed and re-added, even if none of the RPC endpoints
196
+ * have changed.
197
+ *
198
+ * @param chainId - The chain ID associated with an existing network.
199
+ * @param fields - The object that describes the updates to the network/chain,
200
+ * including the new set of RPC endpoints which should front that chain.
201
+ * @param options - Options to provide.
202
+ * @param options.replacementSelectedRpcEndpointIndex - Usually you cannot
203
+ * remove an RPC endpoint that is being represented by the currently selected
204
+ * network client. This option allows you to specify another RPC endpoint
205
+ * (either an existing one or a new one) that should be used to select a new
206
+ * network instead.
207
+ * @returns The updated network configuration.
208
+ * @throws if `chainId` does not refer to an existing network configuration,
209
+ * if any part of `fields` would produce invalid state, etc.
210
+ * @see {@link NetworkConfiguration}
211
+ */
212
+ export type NetworkControllerUpdateNetworkAction = {
213
+ type: `NetworkController:updateNetwork`;
214
+ handler: NetworkController['updateNetwork'];
215
+ };
216
+ /**
217
+ * Destroys and unregisters the network identified by the given chain ID, also
218
+ * removing the associated network configuration from state.
219
+ *
220
+ * @param chainId - The chain ID associated with an existing network.
221
+ * @throws if `chainId` does not refer to an existing network configuration,
222
+ * or if the currently selected network is being removed.
223
+ * @see {@link NetworkConfiguration}
224
+ */
225
+ export type NetworkControllerRemoveNetworkAction = {
226
+ type: `NetworkController:removeNetwork`;
227
+ handler: NetworkController['removeNetwork'];
228
+ };
229
+ /**
230
+ * Assuming that the network has been previously switched, switches to this
231
+ * new network.
232
+ *
233
+ * If the network has not been previously switched, this method is equivalent
234
+ * to {@link resetConnection}.
235
+ */
236
+ export type NetworkControllerRollbackToPreviousProviderAction = {
237
+ type: `NetworkController:rollbackToPreviousProvider`;
238
+ handler: NetworkController['rollbackToPreviousProvider'];
239
+ };
240
+ /**
241
+ * Merges the given backup data into controller state.
242
+ *
243
+ * @param backup - The data that has been backed up.
244
+ * @param backup.networkConfigurationsByChainId - Network configurations,
245
+ * keyed by chain ID.
246
+ */
247
+ export type NetworkControllerLoadBackupAction = {
248
+ type: `NetworkController:loadBackup`;
249
+ handler: NetworkController['loadBackup'];
250
+ };
251
+ /**
252
+ * Searches for the default RPC endpoint configured for the given chain and
253
+ * returns its network client ID. This can then be passed to
254
+ * {@link getNetworkClientById} to retrieve the network client.
255
+ *
256
+ * @param chainId - Chain ID to search for.
257
+ * @returns The ID of the network client created for the chain's default RPC
258
+ * endpoint.
259
+ */
260
+ export type NetworkControllerFindNetworkClientIdByChainIdAction = {
261
+ type: `NetworkController:findNetworkClientIdByChainId`;
262
+ handler: NetworkController['findNetworkClientIdByChainId'];
263
+ };
264
+ /**
265
+ * Union of all NetworkController action types.
266
+ */
267
+ export type NetworkControllerMethodActions = NetworkControllerGetEthQueryAction | NetworkControllerGetProviderAndBlockTrackerAction | NetworkControllerGetSelectedNetworkClientAction | NetworkControllerGetSelectedChainIdAction | NetworkControllerGetNetworkClientRegistryAction | NetworkControllerGetNetworkClientByIdAction | NetworkControllerLookupNetworkAction | NetworkControllerLookupNetworkByClientIdAction | NetworkControllerSetProviderTypeAction | NetworkControllerSetActiveNetworkAction | NetworkControllerGetEIP1559CompatibilityAction | NetworkControllerGet1559CompatibilityWithNetworkClientIdAction | NetworkControllerResetConnectionAction | NetworkControllerGetNetworkConfigurationByChainIdAction | NetworkControllerGetNetworkConfigurationByNetworkClientIdAction | NetworkControllerAddNetworkAction | NetworkControllerUpdateNetworkAction | NetworkControllerRemoveNetworkAction | NetworkControllerRollbackToPreviousProviderAction | NetworkControllerLoadBackupAction | NetworkControllerFindNetworkClientIdByChainIdAction;
268
+ //# sourceMappingURL=NetworkController-method-action-types.d.mts.map
@@ -0,0 +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,gCAA+B;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CAC3C,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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H,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,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"}
@@ -3,4 +3,4 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=NetworkController-method-action-types.js.map
6
+ //# sourceMappingURL=NetworkController-method-action-types.mjs.map
@@ -0,0 +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.js';\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 * 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 | 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"]}