@talismn/balances 0.0.0-pr2075-20250707095746 → 0.0.0-pr2075-20250707102950
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.
@@ -1710,7 +1710,15 @@ const fetchTokens$8 = async ({
|
|
1710
1710
|
name,
|
1711
1711
|
decimals,
|
1712
1712
|
symbol
|
1713
|
-
} = await getErc20ContractData$1(client, tokenConfig.contractAddress)
|
1713
|
+
} = await viem.withRetry(() => getErc20ContractData$1(client, tokenConfig.contractAddress), {
|
1714
|
+
delay: 1000,
|
1715
|
+
// should help with rate limiting
|
1716
|
+
retryCount: 1,
|
1717
|
+
shouldRetry: err => {
|
1718
|
+
const msg = err.error.shortMessage;
|
1719
|
+
return !msg.includes("returned no data") && !msg.includes("is out of bounds") && !msg.includes("reverted");
|
1720
|
+
}
|
1721
|
+
});
|
1714
1722
|
cache[tokenId] = {
|
1715
1723
|
id: tokenId,
|
1716
1724
|
symbol,
|
@@ -1718,7 +1726,7 @@ const fetchTokens$8 = async ({
|
|
1718
1726
|
name
|
1719
1727
|
};
|
1720
1728
|
} catch (err) {
|
1721
|
-
log.warn(`Failed to fetch ERC20 token data for ${tokenConfig.contractAddress}`, err);
|
1729
|
+
log.warn(`Failed to fetch ERC20 token data for ${tokenConfig.contractAddress}`, err.shortMessage);
|
1722
1730
|
continue;
|
1723
1731
|
}
|
1724
1732
|
}
|
@@ -1710,7 +1710,15 @@ const fetchTokens$8 = async ({
|
|
1710
1710
|
name,
|
1711
1711
|
decimals,
|
1712
1712
|
symbol
|
1713
|
-
} = await getErc20ContractData$1(client, tokenConfig.contractAddress)
|
1713
|
+
} = await viem.withRetry(() => getErc20ContractData$1(client, tokenConfig.contractAddress), {
|
1714
|
+
delay: 1000,
|
1715
|
+
// should help with rate limiting
|
1716
|
+
retryCount: 1,
|
1717
|
+
shouldRetry: err => {
|
1718
|
+
const msg = err.error.shortMessage;
|
1719
|
+
return !msg.includes("returned no data") && !msg.includes("is out of bounds") && !msg.includes("reverted");
|
1720
|
+
}
|
1721
|
+
});
|
1714
1722
|
cache[tokenId] = {
|
1715
1723
|
id: tokenId,
|
1716
1724
|
symbol,
|
@@ -1718,7 +1726,7 @@ const fetchTokens$8 = async ({
|
|
1718
1726
|
name
|
1719
1727
|
};
|
1720
1728
|
} catch (err) {
|
1721
|
-
log.warn(`Failed to fetch ERC20 token data for ${tokenConfig.contractAddress}`, err);
|
1729
|
+
log.warn(`Failed to fetch ERC20 token data for ${tokenConfig.contractAddress}`, err.shortMessage);
|
1722
1730
|
continue;
|
1723
1731
|
}
|
1724
1732
|
}
|
@@ -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, encodeFunctionData, isHex, hexToBigInt
|
11
|
+
import { parseAbi, erc20Abi, getContract, ContractFunctionExecutionError, hexToString, erc20Abi_bytes32, withRetry, encodeFunctionData, isHex, hexToBigInt } from 'viem';
|
12
12
|
import { assign, isEqual, fromPairs, toPairs, keys, keyBy, uniq, values, groupBy as groupBy$1 } from 'lodash';
|
13
13
|
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';
|
14
14
|
import z from 'zod/v4';
|
@@ -1697,7 +1697,15 @@ const fetchTokens$8 = async ({
|
|
1697
1697
|
name,
|
1698
1698
|
decimals,
|
1699
1699
|
symbol
|
1700
|
-
} = await getErc20ContractData$1(client, tokenConfig.contractAddress)
|
1700
|
+
} = await withRetry(() => getErc20ContractData$1(client, tokenConfig.contractAddress), {
|
1701
|
+
delay: 1000,
|
1702
|
+
// should help with rate limiting
|
1703
|
+
retryCount: 1,
|
1704
|
+
shouldRetry: err => {
|
1705
|
+
const msg = err.error.shortMessage;
|
1706
|
+
return !msg.includes("returned no data") && !msg.includes("is out of bounds") && !msg.includes("reverted");
|
1707
|
+
}
|
1708
|
+
});
|
1701
1709
|
cache[tokenId] = {
|
1702
1710
|
id: tokenId,
|
1703
1711
|
symbol,
|
@@ -1705,7 +1713,7 @@ const fetchTokens$8 = async ({
|
|
1705
1713
|
name
|
1706
1714
|
};
|
1707
1715
|
} catch (err) {
|
1708
|
-
log.warn(`Failed to fetch ERC20 token data for ${tokenConfig.contractAddress}`, err);
|
1716
|
+
log.warn(`Failed to fetch ERC20 token data for ${tokenConfig.contractAddress}`, err.shortMessage);
|
1709
1717
|
continue;
|
1710
1718
|
}
|
1711
1719
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@talismn/balances",
|
3
|
-
"version": "0.0.0-pr2075-
|
3
|
+
"version": "0.0.0-pr2075-20250707102950",
|
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
|
39
|
-
"@talismn/
|
40
|
-
"@talismn/
|
41
|
-
"@talismn/sapi": "0.0.0-pr2075-
|
42
|
-
"@talismn/
|
43
|
-
"@talismn/
|
44
|
-
"@talismn/
|
38
|
+
"@talismn/chain-connector": "0.0.0-pr2075-20250707102950",
|
39
|
+
"@talismn/chaindata-provider": "0.0.0-pr2075-20250707102950",
|
40
|
+
"@talismn/chain-connector-evm": "0.0.0-pr2075-20250707102950",
|
41
|
+
"@talismn/sapi": "0.0.0-pr2075-20250707102950",
|
42
|
+
"@talismn/scale": "0.0.0-pr2075-20250707102950",
|
43
|
+
"@talismn/token-rates": "0.0.0-pr2075-20250707102950",
|
44
|
+
"@talismn/util": "0.0.0-pr2075-20250707102950"
|
45
45
|
},
|
46
46
|
"devDependencies": {
|
47
47
|
"@polkadot/api-contract": "16.1.2",
|
@@ -56,8 +56,8 @@
|
|
56
56
|
"jest": "^29.7.0",
|
57
57
|
"ts-jest": "^29.2.5",
|
58
58
|
"typescript": "^5.6.3",
|
59
|
-
"@talismn/
|
60
|
-
"@talismn/
|
59
|
+
"@talismn/eslint-config": "0.0.3",
|
60
|
+
"@talismn/tsconfig": "0.0.2"
|
61
61
|
},
|
62
62
|
"peerDependencies": {
|
63
63
|
"@polkadot/api-contract": "*",
|