@deeeed/metamask-harness 0.33.1 → 0.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.33.2 - 2026-08-04
6
+
7
+ ### Fixed
8
+
9
+ - Keep generated Extension account-tracker state aligned with its Mainnet-only network configuration so stale chain entries cannot break RPC polling.
10
+
5
11
  ## 0.33.1 - 2026-08-04
6
12
 
7
13
  ### Fixed
@@ -31,6 +31,8 @@ const EOA_METHODS = [
31
31
  'eth_signTypedData_v3',
32
32
  'eth_signTypedData_v4',
33
33
  ];
34
+ const MAINNET_CHAIN_ID = '0x1';
35
+ const MAINNET_CLIENT_ID = 'mainnet';
34
36
 
35
37
  function usage() {
36
38
  console.error(`Usage:
@@ -224,46 +226,38 @@ async function buildKeyringEntries(target, wallet) {
224
226
  }
225
227
 
226
228
  function patchAccountTracker(data, addresses) {
227
- if (!data.AccountTracker?.accountsByChainId) {
229
+ const accountsByChainId = data.AccountTracker?.accountsByChainId;
230
+ if (!accountsByChainId) {
228
231
  return;
229
232
  }
230
- for (const chain of Object.values(data.AccountTracker.accountsByChainId)) {
231
- if (!chain || typeof chain !== 'object') {
232
- continue;
233
- }
234
- for (const oldAddress of Object.keys(chain)) {
235
- delete chain[oldAddress];
236
- }
237
- for (const address of addresses) {
238
- chain[address] = { balance: '0x0' };
239
- }
233
+ const mainnetAccounts = {};
234
+ for (const address of addresses) {
235
+ mainnetAccounts[address] = { balance: '0x0' };
240
236
  }
237
+ data.AccountTracker.accountsByChainId = { [MAINNET_CHAIN_ID]: mainnetAccounts };
241
238
  }
242
239
 
243
240
  function patchNetworkState(data) {
244
- const mainnetChainId = '0x1';
245
- const mainnetClientId = 'mainnet';
246
-
247
241
  if (data.NetworkController) {
248
- data.NetworkController.selectedNetworkClientId = mainnetClientId;
242
+ data.NetworkController.selectedNetworkClientId = MAINNET_CLIENT_ID;
249
243
 
250
244
  const configs = data.NetworkController.networkConfigurationsByChainId || {};
251
245
  for (const chainId of Object.keys(configs)) {
252
- if (chainId !== mainnetChainId) {
246
+ if (chainId !== MAINNET_CHAIN_ID) {
253
247
  delete configs[chainId];
254
248
  }
255
249
  }
256
250
 
257
251
  const metadata = data.NetworkController.networksMetadata || {};
258
252
  for (const clientId of Object.keys(metadata)) {
259
- if (clientId !== mainnetClientId) {
253
+ if (clientId !== MAINNET_CLIENT_ID) {
260
254
  delete metadata[clientId];
261
255
  }
262
256
  }
263
257
  }
264
258
 
265
259
  if (data.NetworkEnablementController?.enabledNetworkMap?.eip155) {
266
- data.NetworkEnablementController.enabledNetworkMap.eip155 = { [mainnetChainId]: true };
260
+ data.NetworkEnablementController.enabledNetworkMap.eip155 = { [MAINNET_CHAIN_ID]: true };
267
261
  }
268
262
 
269
263
  if (Array.isArray(data.NetworkOrderController?.orderedNetworkList)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.33.1",
3
+ "version": "0.33.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mm-harness": "bin/mm-harness"