@toruslabs/ethereum-controllers 7.0.1 → 7.1.1

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 (29) hide show
  1. package/dist/ethereumControllers.cjs.js +57 -31
  2. package/dist/ethereumControllers.esm.js +29 -20
  3. package/dist/ethereumControllers.umd.min.js +1 -1
  4. package/dist/lib.cjs/AccountAbstraction/AccountAbstractionController.js +13 -6
  5. package/dist/lib.cjs/AccountAbstraction/smartAccounts/KernelSmartAccount.js +0 -2
  6. package/dist/lib.cjs/AccountAbstraction/smartAccounts/SafeSmartAccount.js +0 -2
  7. package/dist/lib.cjs/AccountAbstraction/smartAccounts/TrustSmartAccount.js +0 -2
  8. package/dist/lib.cjs/Nfts/NftsController.js +2 -2
  9. package/dist/lib.cjs/Preferences/PreferencesController.js +12 -4
  10. package/dist/lib.cjs/Tokens/TokensController.js +2 -2
  11. package/dist/lib.esm/AccountAbstraction/AccountAbstractionController.js +13 -6
  12. package/dist/lib.esm/AccountAbstraction/smartAccounts/KernelSmartAccount.js +0 -2
  13. package/dist/lib.esm/AccountAbstraction/smartAccounts/SafeSmartAccount.js +0 -2
  14. package/dist/lib.esm/AccountAbstraction/smartAccounts/TrustSmartAccount.js +0 -2
  15. package/dist/lib.esm/Nfts/NftsController.js +2 -2
  16. package/dist/lib.esm/Preferences/PreferencesController.js +12 -4
  17. package/dist/lib.esm/Tokens/TokensController.js +2 -2
  18. package/dist/types/AccountAbstraction/smartAccounts/BiconomySmartAccount.d.ts +1 -3
  19. package/dist/types/AccountAbstraction/smartAccounts/KernelSmartAccount.d.ts +1 -5
  20. package/dist/types/AccountAbstraction/smartAccounts/LightSmartAccount.d.ts +1 -3
  21. package/dist/types/AccountAbstraction/smartAccounts/NexusSmartAccount.d.ts +1 -3
  22. package/dist/types/AccountAbstraction/smartAccounts/SafeSmartAccount.d.ts +1 -5
  23. package/dist/types/AccountAbstraction/smartAccounts/SimpleSmartAccount.d.ts +1 -5
  24. package/dist/types/AccountAbstraction/smartAccounts/TrustSmartAccount.d.ts +1 -5
  25. package/dist/types/Nfts/NftsController.d.ts +1 -1
  26. package/dist/types/Preferences/PreferencesController.d.ts +2 -2
  27. package/dist/types/Tokens/TokensController.d.ts +1 -1
  28. package/dist/types/utils/interfaces.d.ts +14 -2
  29. package/package.json +4 -4
@@ -3655,7 +3655,7 @@ __webpack_require__.d(__webpack_exports__, {
3655
3655
  // UNUSED EXPORTS: setErrorConfig
3656
3656
 
3657
3657
  ;// ../../node_modules/viem/_esm/errors/version.js
3658
- const version = '2.21.55';
3658
+ const version = '2.22.8';
3659
3659
  //# sourceMappingURL=version.js.map
3660
3660
  ;// ../../node_modules/viem/_esm/errors/base.js
3661
3661
 
@@ -4237,7 +4237,14 @@ class RpcRequestError extends _base_js__WEBPACK_IMPORTED_MODULE_0__/* .BaseError
4237
4237
  writable: true,
4238
4238
  value: void 0
4239
4239
  });
4240
+ Object.defineProperty(this, "data", {
4241
+ enumerable: true,
4242
+ configurable: true,
4243
+ writable: true,
4244
+ value: void 0
4245
+ });
4240
4246
  this.code = error.code;
4247
+ this.data = error.data;
4241
4248
  }
4242
4249
  }
4243
4250
  class SocketClosedError extends _base_js__WEBPACK_IMPORTED_MODULE_0__/* .BaseError */ .C {
@@ -9434,7 +9441,7 @@ Object.defineProperty(src_AccountNotDeployedError, "message", {
9434
9441
  value: /aa20/
9435
9442
  });
9436
9443
  class src_ExecutionRevertedError extends src_base/* BaseError */.C {
9437
- constructor({ cause, message, } = {}) {
9444
+ constructor({ cause, data, message, } = {}) {
9438
9445
  const reason = message
9439
9446
  ?.replace('execution reverted: ', '')
9440
9447
  ?.replace('execution reverted', '');
@@ -9442,6 +9449,13 @@ class src_ExecutionRevertedError extends src_base/* BaseError */.C {
9442
9449
  cause,
9443
9450
  name: 'ExecutionRevertedError',
9444
9451
  });
9452
+ Object.defineProperty(this, "data", {
9453
+ enumerable: true,
9454
+ configurable: true,
9455
+ writable: true,
9456
+ value: void 0
9457
+ });
9458
+ this.data = data;
9445
9459
  }
9446
9460
  }
9447
9461
  Object.defineProperty(src_ExecutionRevertedError, "code", {
@@ -10211,6 +10225,7 @@ function src_getBundlerError(err, args) {
10211
10225
  if (error.code === src_ExecutionRevertedError.code)
10212
10226
  return new src_ExecutionRevertedError({
10213
10227
  cause: err,
10228
+ data: error.data,
10214
10229
  message: error.details,
10215
10230
  });
10216
10231
  if (error.code === src_InvalidFieldsError.code)
@@ -10271,7 +10286,7 @@ function src_getUserOperationError(err, { calls, docsPath, ...args }) {
10271
10286
  const cause = src_getBundlerError(err, args);
10272
10287
  if (calls && cause instanceof src_ExecutionRevertedError) {
10273
10288
  const revertData = src_getRevertData(cause);
10274
- const contractCalls = calls?.filter((call) => call.abi || call.data);
10289
+ const contractCalls = calls?.filter((call) => call.abi);
10275
10290
  if (revertData && contractCalls.length > 0)
10276
10291
  return src_getContractError({ calls: contractCalls, revertData });
10277
10292
  }
@@ -10949,7 +10964,7 @@ async function src_prepareUserOperation(client, parameters_) {
10949
10964
  if (parameters.calls)
10950
10965
  return account.encodeCalls(parameters.calls.map((call_) => {
10951
10966
  const call = call_;
10952
- if ('abi' in call)
10967
+ if (call.abi)
10953
10968
  return {
10954
10969
  data: (0,src_abi_encodeFunctionData/* encodeFunctionData */.p)(call),
10955
10970
  to: call.to,
@@ -11845,6 +11860,7 @@ class src_AccountAbstractionController extends src_base_controllers_namespaceObj
11845
11860
  throw new Error("Invalid address");
11846
11861
  }
11847
11862
  const txParams = tx;
11863
+ // @ts-expect-error TODO: viem types are too deep
11848
11864
  const userOperationParams = {
11849
11865
  account: this.smartAccount,
11850
11866
  calls: [{
@@ -11868,7 +11884,6 @@ class src_AccountAbstractionController extends src_base_controllers_namespaceObj
11868
11884
  status: src_base_controllers_namespaceObject.TransactionStatus.approved
11869
11885
  };
11870
11886
  this.updateUserOpMeta(id, userOpMeta);
11871
- // @ts-expect-error viem types are too deep
11872
11887
  const userOpHash = await this.bundlerClient.sendUserOperation(userOperationParams);
11873
11888
  this.updateUserOpMeta(id, {
11874
11889
  userOpHash,
@@ -11894,7 +11909,7 @@ class src_AccountAbstractionController extends src_base_controllers_namespaceObj
11894
11909
  if (address.toLowerCase() !== this.smartAccount.address.toLowerCase()) throw new Error("Invalid address");
11895
11910
  const calls = [{
11896
11911
  to: txParams.to,
11897
- value: BigInt(txParams.value),
11912
+ value: txParams.value ? BigInt(txParams.value) : undefined,
11898
11913
  data: txParams.data
11899
11914
  }];
11900
11915
  let maxFeePerGas = txParams.maxFeePerGas ? BigInt(txParams.maxFeePerGas) : undefined;
@@ -11911,18 +11926,25 @@ class src_AccountAbstractionController extends src_base_controllers_namespaceObj
11911
11926
 
11912
11927
  // estimate gas: maxFeePerGas and maxPriorityFeePerGas are required
11913
11928
  const estimateGasParams = {
11929
+ account: this.smartAccount,
11914
11930
  calls,
11915
11931
  maxFeePerGas,
11916
11932
  maxPriorityFeePerGas
11917
11933
  };
11918
11934
  const result = await this.bundlerClient.estimateUserOperationGas(estimateGasParams);
11919
- return {
11935
+ const gasData = {
11920
11936
  callGasLimit: (0,src_external_viem_namespaceObject.toHex)(result.callGasLimit),
11921
11937
  preVerificationGas: (0,src_external_viem_namespaceObject.toHex)(result.preVerificationGas),
11922
- verificationGasLimit: (0,src_external_viem_namespaceObject.toHex)(result.verificationGasLimit),
11923
- paymasterVerificationGasLimit: (0,src_external_viem_namespaceObject.toHex)(result.paymasterVerificationGasLimit || 0),
11924
- paymasterPostOpGasLimit: (0,src_external_viem_namespaceObject.toHex)(result.paymasterPostOpGasLimit || 0)
11938
+ verificationGasLimit: (0,src_external_viem_namespaceObject.toHex)(result.verificationGasLimit)
11925
11939
  };
11940
+ // NOTE: paymasterVerificationGasLimit and paymasterPostOpGasLimit are optional don't include it in the object otherwise bundler rpc call will throw error (depend on bundler)
11941
+ if (result.paymasterVerificationGasLimit) {
11942
+ gasData.paymasterVerificationGasLimit = (0,src_external_viem_namespaceObject.toHex)(result.paymasterVerificationGasLimit);
11943
+ }
11944
+ if (result.paymasterPostOpGasLimit) {
11945
+ gasData.paymasterPostOpGasLimit = (0,src_external_viem_namespaceObject.toHex)(result.paymasterPostOpGasLimit);
11946
+ }
11947
+ return gasData;
11926
11948
  }
11927
11949
  async signMessage(message, address) {
11928
11950
  if (address.toLowerCase() !== this.smartAccount.address.toLowerCase()) {
@@ -13664,23 +13686,27 @@ class src_UnknownRpcError extends src_RpcError {
13664
13686
 
13665
13687
 
13666
13688
 
13689
+
13667
13690
  const src_EXECUTION_REVERTED_ERROR_CODE = 3;
13668
13691
  function src_getContractError_getContractError(err, { abi, address, args, docsPath, functionName, sender, }) {
13669
- const { code, data, message, shortMessage } = (err instanceof src_contract/* RawContractError */.$S
13692
+ const error = (err instanceof src_contract/* RawContractError */.$S
13670
13693
  ? err
13671
13694
  : err instanceof src_base/* BaseError */.C
13672
13695
  ? err.walk((err) => 'data' in err) || err.walk()
13673
13696
  : {});
13697
+ const { code, data, details, message, shortMessage } = error;
13674
13698
  const cause = (() => {
13675
13699
  if (err instanceof src_errors_abi/* AbiDecodingZeroDataError */.O)
13676
13700
  return new src_contract/* ContractFunctionZeroDataError */.rR({ functionName });
13677
13701
  if ([src_EXECUTION_REVERTED_ERROR_CODE, src_InternalRpcError.code].includes(code) &&
13678
- (data || message || shortMessage)) {
13702
+ (data || details || message || shortMessage)) {
13679
13703
  return new src_contract/* ContractFunctionRevertedError */.M({
13680
13704
  abi,
13681
13705
  data: typeof data === 'object' ? data.data : data,
13682
13706
  functionName,
13683
- message: shortMessage ?? message,
13707
+ message: error instanceof src_request/* RpcRequestError */.J8
13708
+ ? details
13709
+ : (shortMessage ?? message),
13684
13710
  });
13685
13711
  }
13686
13712
  return err;
@@ -14406,7 +14432,8 @@ function src_getTypesForEIP712Domain({ domain, }) {
14406
14432
  return [
14407
14433
  typeof domain?.name === 'string' && { name: 'name', type: 'string' },
14408
14434
  domain?.version && { name: 'version', type: 'string' },
14409
- typeof domain?.chainId === 'number' && {
14435
+ (typeof domain?.chainId === 'number' ||
14436
+ typeof domain?.chainId === 'bigint') && {
14410
14437
  name: 'chainId',
14411
14438
  type: 'uint256',
14412
14439
  },
@@ -17227,9 +17254,6 @@ async function src_toEcdsaKernelSmartAccount(parameters) {
17227
17254
 
17228
17255
 
17229
17256
 
17230
-
17231
- // use type of function so we don't need to pass in generic to parameter type
17232
-
17233
17257
  class src_KernelSmartAccount {
17234
17258
  constructor(options) {
17235
17259
  src_defineProperty_default()(this, "name", src_SMART_ACCOUNT.KERNEL);
@@ -18485,9 +18509,6 @@ async function src_toSafeSmartAccount(parameters) {
18485
18509
 
18486
18510
 
18487
18511
 
18488
-
18489
- // use type of function so we don't need to pass in generic to parameter type
18490
-
18491
18512
  class src_SafeSmartAccount {
18492
18513
  constructor(options) {
18493
18514
  src_defineProperty_default()(this, "name", src_SMART_ACCOUNT.SAFE);
@@ -18757,9 +18778,6 @@ async function src_toTrustSmartAccount(parameters) {
18757
18778
 
18758
18779
 
18759
18780
 
18760
-
18761
- // use type of function so we don't need to pass in generic to parameter type
18762
-
18763
18781
  class src_TrustSmartAccount {
18764
18782
  constructor(options) {
18765
18783
  src_defineProperty_default()(this, "name", src_SMART_ACCOUNT.TRUST);
@@ -21673,7 +21691,7 @@ class src_NftsController extends src_base_controllers_namespaceObject.BaseContro
21673
21691
  }
21674
21692
  });
21675
21693
  }
21676
- async refreshNftBalances() {
21694
+ async refreshNftBalances(skipCache) {
21677
21695
  const userAddress = this.userSelectedAddress;
21678
21696
  if (userAddress === "") return;
21679
21697
  const oldNfts = [...this.userNfts];
@@ -21681,7 +21699,7 @@ class src_NftsController extends src_base_controllers_namespaceObject.BaseContro
21681
21699
  try {
21682
21700
  const currentChainId = this.config.chainId;
21683
21701
  if (src_SIMPLEHASH_SUPPORTED_CHAINS.includes(currentChainId)) {
21684
- const simpleHashBalances = await this.getSimpleHashNfts(userAddress, currentChainId);
21702
+ const simpleHashBalances = await this.getSimpleHashNfts(userAddress, currentChainId, skipCache);
21685
21703
  nonZeroNfts.push(...simpleHashBalances);
21686
21704
  this.update({
21687
21705
  nfts: {
@@ -21994,14 +22012,22 @@ class src_PreferencesController extends src_base_controllers_namespaceObject.Bas
21994
22012
  return [];
21995
22013
  }
21996
22014
  }
21997
- async getEtherScanTokens(address, chainId) {
22015
+ async getEtherScanTokens(address, chainId, skipCache) {
21998
22016
  const selectedAddress = address;
21999
- const result = await this.wsApiClient.authGet(`tokens?chainId=${chainId}&address=${selectedAddress}`, this.authCredentials());
22017
+ let path = `tokens?chainId=${chainId}&address=${selectedAddress}`;
22018
+ if (skipCache) {
22019
+ path += `&skipCache=true`;
22020
+ }
22021
+ const result = await this.wsApiClient.authGet(path, this.authCredentials());
22000
22022
  return result.data;
22001
22023
  }
22002
- async getSimpleHashNfts(address, chainId) {
22024
+ async getSimpleHashNfts(address, chainId, skipCache) {
22003
22025
  const selectedAddress = address;
22004
- const result = await this.wsApiClient.authGet(`nfts?chainId=${chainId}&address=${selectedAddress}`, this.authCredentials());
22026
+ let path = `nfts?chainId=${chainId}&address=${selectedAddress}`;
22027
+ if (skipCache) {
22028
+ path += `&skipCache=true`;
22029
+ }
22030
+ const result = await this.wsApiClient.authGet(path, this.authCredentials());
22005
22031
  return result.data;
22006
22032
  }
22007
22033
  getCustomTokens(address) {
@@ -22549,7 +22575,7 @@ class src_TokensController extends src_base_controllers_namespaceObject.BaseCont
22549
22575
  }
22550
22576
  });
22551
22577
  }
22552
- async refreshTokenBalances() {
22578
+ async refreshTokenBalances(skipCache) {
22553
22579
  const userAddress = this.userSelectedAddress;
22554
22580
  if (userAddress === "") return;
22555
22581
  const oldTokens = [...this.userTokens];
@@ -22558,7 +22584,7 @@ class src_TokensController extends src_base_controllers_namespaceObject.BaseCont
22558
22584
  try {
22559
22585
  const currentChainId = this.config.chainId;
22560
22586
  if (src_ETHERSCAN_SUPPORTED_CHAINS.includes(currentChainId)) {
22561
- const etherscanBalances = await this.getEtherScanTokens(userAddress, currentChainId);
22587
+ const etherscanBalances = await this.getEtherScanTokens(userAddress, currentChainId, skipCache);
22562
22588
  nonZeroTokens.push(...etherscanBalances);
22563
22589
  }
22564
22590
  if (tokenAddresses.length > 0) {
@@ -1125,6 +1125,7 @@ class AccountAbstractionController extends BaseController {
1125
1125
  throw new Error("Invalid address");
1126
1126
  }
1127
1127
  const txParams = tx;
1128
+ // @ts-expect-error TODO: viem types are too deep
1128
1129
  const userOperationParams = {
1129
1130
  account: this.smartAccount,
1130
1131
  calls: [{
@@ -1148,7 +1149,6 @@ class AccountAbstractionController extends BaseController {
1148
1149
  status: TransactionStatus.approved
1149
1150
  };
1150
1151
  this.updateUserOpMeta(id, userOpMeta);
1151
- // @ts-expect-error viem types are too deep
1152
1152
  const userOpHash = await this.bundlerClient.sendUserOperation(userOperationParams);
1153
1153
  this.updateUserOpMeta(id, {
1154
1154
  userOpHash,
@@ -1174,7 +1174,7 @@ class AccountAbstractionController extends BaseController {
1174
1174
  if (address.toLowerCase() !== this.smartAccount.address.toLowerCase()) throw new Error("Invalid address");
1175
1175
  const calls = [{
1176
1176
  to: txParams.to,
1177
- value: BigInt(txParams.value),
1177
+ value: txParams.value ? BigInt(txParams.value) : undefined,
1178
1178
  data: txParams.data
1179
1179
  }];
1180
1180
  let maxFeePerGas = txParams.maxFeePerGas ? BigInt(txParams.maxFeePerGas) : undefined;
@@ -1191,18 +1191,25 @@ class AccountAbstractionController extends BaseController {
1191
1191
 
1192
1192
  // estimate gas: maxFeePerGas and maxPriorityFeePerGas are required
1193
1193
  const estimateGasParams = {
1194
+ account: this.smartAccount,
1194
1195
  calls,
1195
1196
  maxFeePerGas,
1196
1197
  maxPriorityFeePerGas
1197
1198
  };
1198
1199
  const result = await this.bundlerClient.estimateUserOperationGas(estimateGasParams);
1199
- return {
1200
+ const gasData = {
1200
1201
  callGasLimit: toHex(result.callGasLimit),
1201
1202
  preVerificationGas: toHex(result.preVerificationGas),
1202
- verificationGasLimit: toHex(result.verificationGasLimit),
1203
- paymasterVerificationGasLimit: toHex(result.paymasterVerificationGasLimit || 0),
1204
- paymasterPostOpGasLimit: toHex(result.paymasterPostOpGasLimit || 0)
1203
+ verificationGasLimit: toHex(result.verificationGasLimit)
1205
1204
  };
1205
+ // NOTE: paymasterVerificationGasLimit and paymasterPostOpGasLimit are optional don't include it in the object otherwise bundler rpc call will throw error (depend on bundler)
1206
+ if (result.paymasterVerificationGasLimit) {
1207
+ gasData.paymasterVerificationGasLimit = toHex(result.paymasterVerificationGasLimit);
1208
+ }
1209
+ if (result.paymasterPostOpGasLimit) {
1210
+ gasData.paymasterPostOpGasLimit = toHex(result.paymasterPostOpGasLimit);
1211
+ }
1212
+ return gasData;
1206
1213
  }
1207
1214
  async signMessage(message, address) {
1208
1215
  if (address.toLowerCase() !== this.smartAccount.address.toLowerCase()) {
@@ -1271,8 +1278,6 @@ class BiconomySmartAccount {
1271
1278
  }
1272
1279
  }
1273
1280
 
1274
- // use type of function so we don't need to pass in generic to parameter type
1275
-
1276
1281
  class KernelSmartAccount {
1277
1282
  constructor(options) {
1278
1283
  _defineProperty(this, "name", SMART_ACCOUNT.KERNEL);
@@ -1308,8 +1313,6 @@ class NexusSmartAccount {
1308
1313
  }
1309
1314
  }
1310
1315
 
1311
- // use type of function so we don't need to pass in generic to parameter type
1312
-
1313
1316
  class SafeSmartAccount {
1314
1317
  constructor(options) {
1315
1318
  _defineProperty(this, "name", SMART_ACCOUNT.SAFE);
@@ -1331,8 +1334,6 @@ class SafeSmartAccount {
1331
1334
  }
1332
1335
  }
1333
1336
 
1334
- // use type of function so we don't need to pass in generic to parameter type
1335
-
1336
1337
  class TrustSmartAccount {
1337
1338
  constructor(options) {
1338
1339
  _defineProperty(this, "name", SMART_ACCOUNT.TRUST);
@@ -4077,7 +4078,7 @@ class NftsController extends BaseController {
4077
4078
  }
4078
4079
  });
4079
4080
  }
4080
- async refreshNftBalances() {
4081
+ async refreshNftBalances(skipCache) {
4081
4082
  const userAddress = this.userSelectedAddress;
4082
4083
  if (userAddress === "") return;
4083
4084
  const oldNfts = [...this.userNfts];
@@ -4085,7 +4086,7 @@ class NftsController extends BaseController {
4085
4086
  try {
4086
4087
  const currentChainId = this.config.chainId;
4087
4088
  if (SIMPLEHASH_SUPPORTED_CHAINS.includes(currentChainId)) {
4088
- const simpleHashBalances = await this.getSimpleHashNfts(userAddress, currentChainId);
4089
+ const simpleHashBalances = await this.getSimpleHashNfts(userAddress, currentChainId, skipCache);
4089
4090
  nonZeroNfts.push(...simpleHashBalances);
4090
4091
  this.update({
4091
4092
  nfts: {
@@ -4391,14 +4392,22 @@ class PreferencesController extends BasePreferencesController {
4391
4392
  return [];
4392
4393
  }
4393
4394
  }
4394
- async getEtherScanTokens(address, chainId) {
4395
+ async getEtherScanTokens(address, chainId, skipCache) {
4395
4396
  const selectedAddress = address;
4396
- const result = await this.wsApiClient.authGet(`tokens?chainId=${chainId}&address=${selectedAddress}`, this.authCredentials());
4397
+ let path = `tokens?chainId=${chainId}&address=${selectedAddress}`;
4398
+ if (skipCache) {
4399
+ path += `&skipCache=true`;
4400
+ }
4401
+ const result = await this.wsApiClient.authGet(path, this.authCredentials());
4397
4402
  return result.data;
4398
4403
  }
4399
- async getSimpleHashNfts(address, chainId) {
4404
+ async getSimpleHashNfts(address, chainId, skipCache) {
4400
4405
  const selectedAddress = address;
4401
- const result = await this.wsApiClient.authGet(`nfts?chainId=${chainId}&address=${selectedAddress}`, this.authCredentials());
4406
+ let path = `nfts?chainId=${chainId}&address=${selectedAddress}`;
4407
+ if (skipCache) {
4408
+ path += `&skipCache=true`;
4409
+ }
4410
+ const result = await this.wsApiClient.authGet(path, this.authCredentials());
4402
4411
  return result.data;
4403
4412
  }
4404
4413
  getCustomTokens(address) {
@@ -4926,7 +4935,7 @@ class TokensController extends BaseController {
4926
4935
  }
4927
4936
  });
4928
4937
  }
4929
- async refreshTokenBalances() {
4938
+ async refreshTokenBalances(skipCache) {
4930
4939
  const userAddress = this.userSelectedAddress;
4931
4940
  if (userAddress === "") return;
4932
4941
  const oldTokens = [...this.userTokens];
@@ -4935,7 +4944,7 @@ class TokensController extends BaseController {
4935
4944
  try {
4936
4945
  const currentChainId = this.config.chainId;
4937
4946
  if (ETHERSCAN_SUPPORTED_CHAINS.includes(currentChainId)) {
4938
- const etherscanBalances = await this.getEtherScanTokens(userAddress, currentChainId);
4947
+ const etherscanBalances = await this.getEtherScanTokens(userAddress, currentChainId, skipCache);
4939
4948
  nonZeroTokens.push(...etherscanBalances);
4940
4949
  }
4941
4950
  if (tokenAddresses.length > 0) {