@stake-dao/reader 0.5.21 → 0.5.22
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.
|
@@ -5,9 +5,14 @@ const getPendleApiData = async () => {
|
|
|
5
5
|
let pendleApiData;
|
|
6
6
|
let pendleStrats = [];
|
|
7
7
|
do {
|
|
8
|
-
pendleApiData = await
|
|
8
|
+
pendleApiData = await fetch(URL(totalFetched)).then((res) => res.json());
|
|
9
9
|
totalFetched += LIMIT;
|
|
10
|
-
|
|
10
|
+
if (pendleApiData.error) {
|
|
11
|
+
console.error(`${pendleApiData.error} - ${pendleApiData.message.toString()}`);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
pendleStrats = pendleStrats.concat(pendleApiData.results);
|
|
15
|
+
}
|
|
11
16
|
} while (pendleApiData.total > totalFetched);
|
|
12
17
|
return pendleStrats;
|
|
13
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPendleApiData.js","sourceRoot":"","sources":["../../../../src/strategies/pendle/getPendleApiData.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,GAAG,CAAA;AACjB,MAAM,GAAG,GAAG,CAAC,OAAe,CAAC,EAAE,EAAE,CAC/B,yDAAyD,KAAK,oBAAoB,IAAI,EAAE,CAAA;AAE1F,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;IAClC,IAAI,YAAY,GAAG,CAAC,CAAA;IACpB,IAAI,aAAkB,CAAA;IACtB,IAAI,YAAY,GAAU,EAAE,CAAA;IAE5B,GAAG,CAAC;QACF,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"getPendleApiData.js","sourceRoot":"","sources":["../../../../src/strategies/pendle/getPendleApiData.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,GAAG,CAAA;AACjB,MAAM,GAAG,GAAG,CAAC,OAAe,CAAC,EAAE,EAAE,CAC/B,yDAAyD,KAAK,oBAAoB,IAAI,EAAE,CAAA;AAE1F,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;IAClC,IAAI,YAAY,GAAG,CAAC,CAAA;IACpB,IAAI,aAAkB,CAAA;IACtB,IAAI,YAAY,GAAU,EAAE,CAAA;IAE5B,GAAG,CAAC;QACF,aAAa,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;QACxE,YAAY,IAAI,KAAK,CAAA;QAErB,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;YACxB,OAAO,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,MAAM,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QAC/E,CAAC;aAAM,CAAC;YACN,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QAC3D,CAAC;IACH,CAAC,QAAQ,aAAa,CAAC,KAAK,GAAG,YAAY,EAAC;IAE5C,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPendleApiData.d.ts","sourceRoot":"","sources":["../../../../src/strategies/pendle/getPendleApiData.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"getPendleApiData.d.ts","sourceRoot":"","sources":["../../../../src/strategies/pendle/getPendleApiData.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,gBAAgB,sBAiBrB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -8,10 +8,14 @@ const getPendleApiData = async () => {
|
|
|
8
8
|
let pendleStrats: any[] = []
|
|
9
9
|
|
|
10
10
|
do {
|
|
11
|
-
pendleApiData = await
|
|
11
|
+
pendleApiData = await fetch(URL(totalFetched)).then((res) => res.json())
|
|
12
12
|
totalFetched += LIMIT
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
if (pendleApiData.error) {
|
|
15
|
+
console.error(`${pendleApiData.error} - ${pendleApiData.message.toString()}`)
|
|
16
|
+
} else {
|
|
17
|
+
pendleStrats = pendleStrats.concat(pendleApiData.results)
|
|
18
|
+
}
|
|
15
19
|
} while (pendleApiData.total > totalFetched)
|
|
16
20
|
|
|
17
21
|
return pendleStrats
|