@talismn/token-rates 3.0.9 → 3.0.11
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.
|
@@ -205,7 +205,13 @@ async function fetchTokenRates(tokens, currencyIds = ALL_CURRENCY_IDS, config =
|
|
|
205
205
|
|
|
206
206
|
// insert TOKEN<>TAO rate (calculated based on TAO<>USD rate and TOKEN<>USD rate) into each TOKEN
|
|
207
207
|
const taoIndex = currencyIds.indexOf("tao");
|
|
208
|
-
rawTokenRates.forEach(rates => {
|
|
208
|
+
rawTokenRates.forEach((rates, i) => {
|
|
209
|
+
// hardcoded rate for TAO<>TAO
|
|
210
|
+
if (i === effectiveTaoIndex) {
|
|
211
|
+
rates?.splice(taoIndex, 0, [1, null, null]);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
|
|
209
215
|
// get TOKEN<>USD rate
|
|
210
216
|
const tokenUsdRate = rates?.[effectiveUsdIndex]?.[0];
|
|
211
217
|
// calculate TOKEN<>TAO rate
|
|
@@ -205,7 +205,13 @@ async function fetchTokenRates(tokens, currencyIds = ALL_CURRENCY_IDS, config =
|
|
|
205
205
|
|
|
206
206
|
// insert TOKEN<>TAO rate (calculated based on TAO<>USD rate and TOKEN<>USD rate) into each TOKEN
|
|
207
207
|
const taoIndex = currencyIds.indexOf("tao");
|
|
208
|
-
rawTokenRates.forEach(rates => {
|
|
208
|
+
rawTokenRates.forEach((rates, i) => {
|
|
209
|
+
// hardcoded rate for TAO<>TAO
|
|
210
|
+
if (i === effectiveTaoIndex) {
|
|
211
|
+
rates?.splice(taoIndex, 0, [1, null, null]);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
|
|
209
215
|
// get TOKEN<>USD rate
|
|
210
216
|
const tokenUsdRate = rates?.[effectiveUsdIndex]?.[0];
|
|
211
217
|
// calculate TOKEN<>TAO rate
|
|
@@ -203,7 +203,13 @@ async function fetchTokenRates(tokens, currencyIds = ALL_CURRENCY_IDS, config =
|
|
|
203
203
|
|
|
204
204
|
// insert TOKEN<>TAO rate (calculated based on TAO<>USD rate and TOKEN<>USD rate) into each TOKEN
|
|
205
205
|
const taoIndex = currencyIds.indexOf("tao");
|
|
206
|
-
rawTokenRates.forEach(rates => {
|
|
206
|
+
rawTokenRates.forEach((rates, i) => {
|
|
207
|
+
// hardcoded rate for TAO<>TAO
|
|
208
|
+
if (i === effectiveTaoIndex) {
|
|
209
|
+
rates?.splice(taoIndex, 0, [1, null, null]);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
207
213
|
// get TOKEN<>USD rate
|
|
208
214
|
const tokenUsdRate = rates?.[effectiveUsdIndex]?.[0];
|
|
209
215
|
// calculate TOKEN<>TAO rate
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talismn/token-rates",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.11",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"node": ">=20"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@talismn/chaindata-provider": "1.
|
|
24
|
+
"@talismn/chaindata-provider": "1.3.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/jest": "^29.5.14",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"jest": "^29.7.0",
|
|
30
30
|
"ts-jest": "^29.2.5",
|
|
31
31
|
"typescript": "^5.6.3",
|
|
32
|
-
"@talismn/
|
|
33
|
-
"@talismn/
|
|
32
|
+
"@talismn/eslint-config": "0.0.3",
|
|
33
|
+
"@talismn/tsconfig": "0.0.3"
|
|
34
34
|
},
|
|
35
35
|
"eslintConfig": {
|
|
36
36
|
"root": true,
|