@talismn/balances 0.0.0-pr2075-20250707142247 → 0.0.0-pr2075-20250707152840

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.
@@ -1717,15 +1717,7 @@ const fetchTokens$8 = async ({
1717
1717
  name,
1718
1718
  decimals,
1719
1719
  symbol
1720
- } = await viem.withRetry(() => getErc20ContractData$1(client, tokenConfig.contractAddress), {
1721
- delay: 1000,
1722
- // should help with rate limiting
1723
- retryCount: 1,
1724
- shouldRetry: err => {
1725
- const msg = err.error.shortMessage;
1726
- return !msg.includes("returned no data") && !msg.includes("is out of bounds") && !msg.includes("reverted");
1727
- }
1728
- });
1720
+ } = await getErc20ContractData$1(client, tokenConfig.contractAddress);
1729
1721
  cache[tokenId] = {
1730
1722
  id: tokenId,
1731
1723
  symbol,
@@ -1749,14 +1741,12 @@ const fetchTokens$8 = async ({
1749
1741
  networkId
1750
1742
  };
1751
1743
  const cached2 = cache[tokenId] && TokenCacheSchema$1.safeParse(cache[tokenId]).data;
1744
+ if (cached2?.isValid === false) continue;
1752
1745
  const token = lodash.assign(base, cached2?.isValid ? lodash.omit(cached2, ["isValid"]) : {}, tokenConfig);
1753
1746
  const parsed = chaindataProvider.EvmErc20TokenSchema.safeParse(token);
1754
1747
  if (!parsed.success) {
1755
1748
  log.warn("Ignoring token with invalid EvmErc20TokenSchema", {
1756
- token,
1757
- base,
1758
- cached: cached2?.isValid ? lodash.omit(cached2, ["isValid"]) : {},
1759
- tokenConfig
1749
+ token
1760
1750
  });
1761
1751
  continue;
1762
1752
  }
@@ -2300,6 +2290,7 @@ const fetchTokens$6 = async ({
2300
2290
  networkId
2301
2291
  };
2302
2292
  const cached2 = cache[tokenId] && TokenCacheSchema.safeParse(cache[tokenId]).data;
2293
+ if (cached2?.isValid === false) continue;
2303
2294
  const token = lodash.assign(base, cached2?.isValid ? lodash.omit(cached2, ["isValid"]) : {}, tokenConfig);
2304
2295
  const parsed = chaindataProvider.EvmUniswapV2TokenSchema.safeParse(token);
2305
2296
  if (!parsed.success) {
@@ -1717,15 +1717,7 @@ const fetchTokens$8 = async ({
1717
1717
  name,
1718
1718
  decimals,
1719
1719
  symbol
1720
- } = await viem.withRetry(() => getErc20ContractData$1(client, tokenConfig.contractAddress), {
1721
- delay: 1000,
1722
- // should help with rate limiting
1723
- retryCount: 1,
1724
- shouldRetry: err => {
1725
- const msg = err.error.shortMessage;
1726
- return !msg.includes("returned no data") && !msg.includes("is out of bounds") && !msg.includes("reverted");
1727
- }
1728
- });
1720
+ } = await getErc20ContractData$1(client, tokenConfig.contractAddress);
1729
1721
  cache[tokenId] = {
1730
1722
  id: tokenId,
1731
1723
  symbol,
@@ -1749,14 +1741,12 @@ const fetchTokens$8 = async ({
1749
1741
  networkId
1750
1742
  };
1751
1743
  const cached2 = cache[tokenId] && TokenCacheSchema$1.safeParse(cache[tokenId]).data;
1744
+ if (cached2?.isValid === false) continue;
1752
1745
  const token = lodash.assign(base, cached2?.isValid ? lodash.omit(cached2, ["isValid"]) : {}, tokenConfig);
1753
1746
  const parsed = chaindataProvider.EvmErc20TokenSchema.safeParse(token);
1754
1747
  if (!parsed.success) {
1755
1748
  log.warn("Ignoring token with invalid EvmErc20TokenSchema", {
1756
- token,
1757
- base,
1758
- cached: cached2?.isValid ? lodash.omit(cached2, ["isValid"]) : {},
1759
- tokenConfig
1749
+ token
1760
1750
  });
1761
1751
  continue;
1762
1752
  }
@@ -2300,6 +2290,7 @@ const fetchTokens$6 = async ({
2300
2290
  networkId
2301
2291
  };
2302
2292
  const cached2 = cache[tokenId] && TokenCacheSchema.safeParse(cache[tokenId]).data;
2293
+ if (cached2?.isValid === false) continue;
2303
2294
  const token = lodash.assign(base, cached2?.isValid ? lodash.omit(cached2, ["isValid"]) : {}, tokenConfig);
2304
2295
  const parsed = chaindataProvider.EvmUniswapV2TokenSchema.safeParse(token);
2305
2296
  if (!parsed.success) {
@@ -8,7 +8,7 @@ import BigNumber from 'bignumber.js';
8
8
  import { u8aToHex, assert, stringCamelCase, u8aConcatStrict, u8aToString, hexToNumber, arrayChunk, hexToU8a } from '@polkadot/util';
9
9
  import { xxhashAsU8a } from '@polkadot/util-crypto';
10
10
  import pako from 'pako';
11
- import { parseAbi, erc20Abi, getContract, ContractFunctionExecutionError, hexToString, erc20Abi_bytes32, withRetry, encodeFunctionData, isHex, hexToBigInt } from 'viem';
11
+ import { parseAbi, erc20Abi, getContract, ContractFunctionExecutionError, hexToString, erc20Abi_bytes32, encodeFunctionData, isHex, hexToBigInt, withRetry } from 'viem';
12
12
  import { assign, omit, isEqual, fromPairs, toPairs, keys, keyBy, uniq, values, groupBy as groupBy$1 } from 'lodash';
13
13
  import z from 'zod/v4';
14
14
  import { Observable, distinctUntilChanged, of, timer, switchMap, from, firstValueFrom, scan, share, map, switchAll, combineLatest, mergeMap, toArray, interval, startWith, exhaustMap, BehaviorSubject, debounceTime, takeUntil, withLatestFrom, concatMap } from 'rxjs';
@@ -1704,15 +1704,7 @@ const fetchTokens$8 = async ({
1704
1704
  name,
1705
1705
  decimals,
1706
1706
  symbol
1707
- } = await withRetry(() => getErc20ContractData$1(client, tokenConfig.contractAddress), {
1708
- delay: 1000,
1709
- // should help with rate limiting
1710
- retryCount: 1,
1711
- shouldRetry: err => {
1712
- const msg = err.error.shortMessage;
1713
- return !msg.includes("returned no data") && !msg.includes("is out of bounds") && !msg.includes("reverted");
1714
- }
1715
- });
1707
+ } = await getErc20ContractData$1(client, tokenConfig.contractAddress);
1716
1708
  cache[tokenId] = {
1717
1709
  id: tokenId,
1718
1710
  symbol,
@@ -1736,14 +1728,12 @@ const fetchTokens$8 = async ({
1736
1728
  networkId
1737
1729
  };
1738
1730
  const cached2 = cache[tokenId] && TokenCacheSchema$1.safeParse(cache[tokenId]).data;
1731
+ if (cached2?.isValid === false) continue;
1739
1732
  const token = assign(base, cached2?.isValid ? omit(cached2, ["isValid"]) : {}, tokenConfig);
1740
1733
  const parsed = EvmErc20TokenSchema.safeParse(token);
1741
1734
  if (!parsed.success) {
1742
1735
  log.warn("Ignoring token with invalid EvmErc20TokenSchema", {
1743
- token,
1744
- base,
1745
- cached: cached2?.isValid ? omit(cached2, ["isValid"]) : {},
1746
- tokenConfig
1736
+ token
1747
1737
  });
1748
1738
  continue;
1749
1739
  }
@@ -2287,6 +2277,7 @@ const fetchTokens$6 = async ({
2287
2277
  networkId
2288
2278
  };
2289
2279
  const cached2 = cache[tokenId] && TokenCacheSchema.safeParse(cache[tokenId]).data;
2280
+ if (cached2?.isValid === false) continue;
2290
2281
  const token = assign(base, cached2?.isValid ? omit(cached2, ["isValid"]) : {}, tokenConfig);
2291
2282
  const parsed = EvmUniswapV2TokenSchema.safeParse(token);
2292
2283
  if (!parsed.success) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/balances",
3
- "version": "0.0.0-pr2075-20250707142247",
3
+ "version": "0.0.0-pr2075-20250707152840",
4
4
  "author": "Talisman",
5
5
  "homepage": "https://talisman.xyz",
6
6
  "license": "GPL-3.0-or-later",
@@ -35,13 +35,13 @@
35
35
  "scale-ts": "^1.6.1",
36
36
  "viem": "^2.27.3",
37
37
  "zod": "^3.25.62",
38
- "@talismn/chain-connector": "0.0.0-pr2075-20250707142247",
39
- "@talismn/chaindata-provider": "0.0.0-pr2075-20250707142247",
40
- "@talismn/sapi": "0.0.0-pr2075-20250707142247",
41
- "@talismn/scale": "0.0.0-pr2075-20250707142247",
42
- "@talismn/token-rates": "0.0.0-pr2075-20250707142247",
43
- "@talismn/chain-connector-evm": "0.0.0-pr2075-20250707142247",
44
- "@talismn/util": "0.0.0-pr2075-20250707142247"
38
+ "@talismn/chain-connector": "0.0.0-pr2075-20250707152840",
39
+ "@talismn/chain-connector-evm": "0.0.0-pr2075-20250707152840",
40
+ "@talismn/chaindata-provider": "0.0.0-pr2075-20250707152840",
41
+ "@talismn/sapi": "0.0.0-pr2075-20250707152840",
42
+ "@talismn/scale": "0.0.0-pr2075-20250707152840",
43
+ "@talismn/token-rates": "0.0.0-pr2075-20250707152840",
44
+ "@talismn/util": "0.0.0-pr2075-20250707152840"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@polkadot/api-contract": "16.1.2",