@metamask-previews/network-controller 22.1.1-preview-83c8a21 → 22.1.1-preview-2ba45577

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.
@@ -46,6 +46,7 @@ const rpc_errors_1 = require("@metamask/rpc-errors");
46
46
  const swappable_obj_proxy_1 = require("@metamask/swappable-obj-proxy");
47
47
  const utils_1 = require("@metamask/utils");
48
48
  const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
49
+ const lodash_1 = require("lodash");
49
50
  const reselect_1 = require("reselect");
50
51
  const URI = __importStar(require("uri-js"));
51
52
  const uuid_1 = require("uuid");
@@ -748,7 +749,6 @@ class NetworkController extends base_controller_1.BaseController {
748
749
  networkConfigurationToPersist: newNetworkConfiguration,
749
750
  });
750
751
  });
751
- __classPrivateFieldSet(this, _NetworkController_networkConfigurationsByNetworkClientId, buildNetworkConfigurationsByNetworkClientId(this.state.networkConfigurationsByChainId), "f");
752
752
  this.messagingSystem.publish(`${controllerName}:networkAdded`, newNetworkConfiguration);
753
753
  return newNetworkConfiguration;
754
754
  }
@@ -959,7 +959,6 @@ class NetworkController extends base_controller_1.BaseController {
959
959
  });
960
960
  });
961
961
  }
962
- __classPrivateFieldSet(this, _NetworkController_networkConfigurationsByNetworkClientId, buildNetworkConfigurationsByNetworkClientId(this.state.networkConfigurationsByChainId), "f");
963
962
  __classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_unregisterNetworkClientsAsNeeded).call(this, {
964
963
  networkClientOperations,
965
964
  autoManagedNetworkClientRegistry,
@@ -1001,7 +1000,6 @@ class NetworkController extends base_controller_1.BaseController {
1001
1000
  existingNetworkConfiguration,
1002
1001
  });
1003
1002
  });
1004
- __classPrivateFieldSet(this, _NetworkController_networkConfigurationsByNetworkClientId, buildNetworkConfigurationsByNetworkClientId(this.state.networkConfigurationsByChainId), "f");
1005
1003
  this.messagingSystem.publish('NetworkController:networkRemoved', existingNetworkConfiguration);
1006
1004
  }
1007
1005
  /**
@@ -1310,6 +1308,7 @@ async function _NetworkController_determineEIP1559Compatibility(networkClientId)
1310
1308
  state.networkConfigurationsByChainId[args.networkFields.chainId] =
1311
1309
  args.networkConfigurationToPersist;
1312
1310
  }
1311
+ __classPrivateFieldSet(this, _NetworkController_networkConfigurationsByNetworkClientId, buildNetworkConfigurationsByNetworkClientId((0, lodash_1.cloneDeep)(state.networkConfigurationsByChainId)), "f");
1313
1312
  }, _NetworkController_ensureAutoManagedNetworkClientRegistryPopulated = function _NetworkController_ensureAutoManagedNetworkClientRegistryPopulated() {
1314
1313
  return (__classPrivateFieldSet(this, _NetworkController_autoManagedNetworkClientRegistry, __classPrivateFieldGet(this, _NetworkController_autoManagedNetworkClientRegistry, "f") ?? __classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_createAutoManagedNetworkClientRegistry).call(this), "f"));
1315
1314
  }, _NetworkController_createAutoManagedNetworkClientRegistry = function _NetworkController_createAutoManagedNetworkClientRegistry() {