@toruslabs/ethereum-controllers 6.1.0 → 6.1.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.
@@ -243,11 +243,14 @@ class TokensController extends baseControllers.BaseController {
243
243
  chainId: x.chainId
244
244
  };
245
245
  } catch (error) {
246
- log.warn("Invalid contract address while fetching", error);
246
+ log.warn("could not fetch user token balance", error);
247
247
  return undefined;
248
248
  }
249
249
  }));
250
- const nonZeroTokens = promiseSettledResult.filter(x => x.status === "fulfilled").map(x => x.value);
250
+ const nonZeroTokens = promiseSettledResult.reduce((acc, x) => {
251
+ if (x.status === "fulfilled" && x.value) acc.push(x.value);
252
+ return acc;
253
+ }, []);
251
254
  this.update({
252
255
  tokens: {
253
256
  [this.userSelectedAddress]: mergeTokenArrays(this.userTokens, nonZeroTokens)
@@ -241,11 +241,14 @@ class TokensController extends BaseController {
241
241
  chainId: x.chainId
242
242
  };
243
243
  } catch (error) {
244
- log.warn("Invalid contract address while fetching", error);
244
+ log.warn("could not fetch user token balance", error);
245
245
  return undefined;
246
246
  }
247
247
  }));
248
- const nonZeroTokens = promiseSettledResult.filter(x => x.status === "fulfilled").map(x => x.value);
248
+ const nonZeroTokens = promiseSettledResult.reduce((acc, x) => {
249
+ if (x.status === "fulfilled" && x.value) acc.push(x.value);
250
+ return acc;
251
+ }, []);
249
252
  this.update({
250
253
  tokens: {
251
254
  [this.userSelectedAddress]: mergeTokenArrays(this.userTokens, nonZeroTokens)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toruslabs/ethereum-controllers",
3
- "version": "6.1.0",
3
+ "version": "6.1.2",
4
4
  "homepage": "https://github.com/torusresearch/controllers#readme",
5
5
  "license": "ISC",
6
6
  "sideEffects": false,
@@ -21,9 +21,9 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@ethereumjs/util": "^9.1.0",
24
- "@toruslabs/base-controllers": "^6.1.0",
24
+ "@toruslabs/base-controllers": "^6.1.2",
25
25
  "@toruslabs/http-helpers": "^7.0.0",
26
- "@web3auth/auth": "^9.1.3",
26
+ "@web3auth/auth": "^9.3.3",
27
27
  "async-mutex": "^0.5.0",
28
28
  "bignumber.js": "^9.1.2",
29
29
  "bn.js": "^5.2.1",
@@ -32,7 +32,7 @@
32
32
  "fast-json-patch": "^3.1.1",
33
33
  "fast-safe-stringify": "^2.1.1",
34
34
  "jsonschema": "^1.4.1",
35
- "loglevel": "^1.9.1"
35
+ "loglevel": "^1.9.2"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@babel/runtime": "7.x"
@@ -61,20 +61,20 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "35edfaeec9b9b6261a24bacabe1d59cdcd50e30e",
64
+ "gitHead": "f7cd669bee5c64cd5ef95a6b815a12e1426d942b",
65
65
  "devDependencies": {
66
66
  "@nomicfoundation/hardhat-chai-matchers": "^2.0.7",
67
- "@nomicfoundation/hardhat-ethers": "^3.0.7",
67
+ "@nomicfoundation/hardhat-ethers": "^3.0.8",
68
68
  "@nomicfoundation/hardhat-ignition-ethers": "^0.15.5",
69
69
  "@nomicfoundation/hardhat-network-helpers": "^1.0.11",
70
70
  "@nomicfoundation/hardhat-toolbox": "^5.0.0",
71
- "@nomicfoundation/hardhat-verify": "^2.0.9",
71
+ "@nomicfoundation/hardhat-verify": "^2.0.10",
72
72
  "@typechain/ethers-v6": "^0.5.1",
73
73
  "@typechain/hardhat": "^9.1.0",
74
74
  "@types/proxyquire": "^1.3.31",
75
- "hardhat": "^2.22.9",
75
+ "hardhat": "^2.22.10",
76
76
  "proxyquire": "^2.1.3",
77
- "solidity-coverage": "^0.8.12",
77
+ "solidity-coverage": "^0.8.13",
78
78
  "typechain": "^8.3.2"
79
79
  }
80
80
  }