@sonarwatch/portfolio-plugins 0.11.141 → 0.11.142
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/plugins/auxexchange/aptosLpJob.js +21 -20
- package/src/plugins/auxexchange/aptosLpJob.js.map +1 -1
- package/src/plugins/liquidswap/aptosLpJob.js +4 -36
- package/src/plugins/liquidswap/aptosLpJob.js.map +1 -1
- package/src/plugins/sushiswap/index.js +1 -1
- package/src/plugins/sushiswap/index.js.map +1 -1
- package/src/utils/misc/getTokensPricesMap.d.ts +4 -0
- package/src/utils/misc/getTokensPricesMap.js +4 -0
- package/src/utils/misc/getTokensPricesMap.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.142](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.141...plugins-0.11.142) (2024-03-22)
|
6
|
+
|
7
|
+
|
8
|
+
|
5
9
|
## [0.11.141](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.140...plugins-0.11.141) (2024-03-21)
|
6
10
|
|
7
11
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.142",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.142"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -17,12 +17,11 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
17
17
|
const aptos_1 = require("../../utils/aptos");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const constants_1 = require("./constants");
|
20
|
-
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
21
20
|
const getDecimalsForToken_1 = require("../../utils/misc/getDecimalsForToken");
|
22
21
|
const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
|
23
22
|
const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
|
24
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
-
var _a, _b, _c;
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
26
25
|
const client = (0, clients_1.getClientAptos)();
|
27
26
|
const resources = yield (0, aptos_1.getAccountResources)(client, constants_1.programAddress);
|
28
27
|
if (!resources)
|
@@ -31,51 +30,52 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
30
|
resources.forEach((resource) => {
|
32
31
|
resourcesByType.set(resource.type, resource);
|
33
32
|
});
|
34
|
-
const
|
33
|
+
const tokenPrices = yield cache.getTokenPricesAsMap(resources
|
35
34
|
.map((resource) => {
|
36
35
|
const { keys } = (0, aptos_1.parseTypeString)(resource.type);
|
37
36
|
return keys ? keys.map((key) => key.type) : [];
|
38
37
|
})
|
39
|
-
.flat(), portfolio_core_1.NetworkId.aptos
|
38
|
+
.flat(), portfolio_core_1.NetworkId.aptos);
|
39
|
+
const lpSources = [];
|
40
40
|
for (let i = 0; i < resources.length; i++) {
|
41
41
|
const resource = resources[i];
|
42
42
|
if (!resource.type.startsWith(constants_1.lpCoinInfoTypePrefix))
|
43
43
|
continue;
|
44
|
-
const lpType = (0, aptos_1.
|
44
|
+
const lpType = (_b = (_a = (0, aptos_1.parseTypeString)(resource.type).keys) === null || _a === void 0 ? void 0 : _a.at(0)) === null || _b === void 0 ? void 0 : _b.type;
|
45
|
+
if (!lpType)
|
46
|
+
continue;
|
45
47
|
const lpInfoData = resource.data;
|
46
|
-
const lpSupplyString = (
|
48
|
+
const lpSupplyString = (_e = (_d = (_c = lpInfoData.supply) === null || _c === void 0 ? void 0 : _c.vec[0]) === null || _d === void 0 ? void 0 : _d.integer.vec[0]) === null || _e === void 0 ? void 0 : _e.value;
|
47
49
|
if (!lpSupplyString)
|
48
50
|
continue;
|
49
51
|
const lpDecimals = lpInfoData.decimals;
|
50
52
|
const lpSupply = new bignumber_js_1.default(lpSupplyString);
|
51
53
|
if (lpSupply.isZero())
|
52
54
|
continue;
|
53
|
-
const
|
54
|
-
const
|
55
|
-
const typeX =
|
56
|
-
const typeY =
|
55
|
+
const parsedLpType = (0, aptos_1.parseTypeString)(lpType);
|
56
|
+
const poolId = (_f = parsedLpType.keys) === null || _f === void 0 ? void 0 : _f.map((t) => t.type).join(', ');
|
57
|
+
const typeX = (_h = (_g = parsedLpType.keys) === null || _g === void 0 ? void 0 : _g.at(0)) === null || _h === void 0 ? void 0 : _h.type;
|
58
|
+
const typeY = (_k = (_j = parsedLpType.keys) === null || _j === void 0 ? void 0 : _j.at(1)) === null || _k === void 0 ? void 0 : _k.type;
|
59
|
+
if (!typeX || !typeY || !poolId)
|
60
|
+
continue;
|
57
61
|
const poolResource = resourcesByType.get(`${constants_1.programAddress}::amm::Pool<${poolId}>`);
|
58
62
|
if (!poolResource)
|
59
63
|
throw new Error(`Failed to get poolResource: ${lpType}`);
|
60
|
-
if (!typeX)
|
61
|
-
throw new Error(`Failed to get typeX: ${lpType}`);
|
62
|
-
if (!typeY)
|
63
|
-
throw new Error(`Failed to get typeY: ${lpType}`);
|
64
64
|
const tokenPairData = poolResource.data;
|
65
65
|
const [tokenPriceX, tokenPriceY] = [
|
66
|
-
|
67
|
-
|
66
|
+
tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(typeX, portfolio_core_1.NetworkId.aptos)),
|
67
|
+
tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(typeY, portfolio_core_1.NetworkId.aptos)),
|
68
68
|
];
|
69
69
|
const [decimalsX, decimalsY] = yield Promise.all([
|
70
70
|
(0, getDecimalsForToken_1.getDecimalsForToken)(cache, typeX, portfolio_core_1.NetworkId.aptos),
|
71
71
|
(0, getDecimalsForToken_1.getDecimalsForToken)(cache, typeY, portfolio_core_1.NetworkId.aptos),
|
72
72
|
]);
|
73
|
+
if (!decimalsX || !decimalsY)
|
74
|
+
continue;
|
73
75
|
const [reserveAmountRawX, reserveAmountRawY] = [
|
74
76
|
new bignumber_js_1.default(tokenPairData.x_reserve.value),
|
75
77
|
new bignumber_js_1.default(tokenPairData.y_reserve.value),
|
76
78
|
];
|
77
|
-
if (!decimalsX || !decimalsY)
|
78
|
-
continue;
|
79
79
|
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpType, portfolio_core_1.NetworkId.aptos, {
|
80
80
|
address: typeX,
|
81
81
|
decimals: decimalsX,
|
@@ -88,7 +88,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
88
|
tokenPrice: tokenPriceY,
|
89
89
|
});
|
90
90
|
if (underlyingSource)
|
91
|
-
|
91
|
+
lpSources.push(underlyingSource);
|
92
92
|
if (!tokenPriceX || !tokenPriceY)
|
93
93
|
continue;
|
94
94
|
const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
|
@@ -109,8 +109,9 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
109
109
|
reserveAmountRaw: reserveAmountRawY,
|
110
110
|
},
|
111
111
|
], '');
|
112
|
-
|
112
|
+
lpSources.push(lpSource);
|
113
113
|
}
|
114
|
+
yield cache.setTokenPriceSources(lpSources);
|
114
115
|
});
|
115
116
|
const job = {
|
116
117
|
id: `${constants_1.platformId}-aptos-lp`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/auxexchange/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+
|
1
|
+
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/auxexchange/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,6CAK2B;AAC3B,iDAAqD;AACrD,2CAA+E;AAC/E,8EAA2E;AAC3E,6GAAqF;AACrF,+FAAuE;AAOvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAmB,EAAC,MAAM,EAAE,0BAAc,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,MAAM,eAAe,GAAuC,IAAI,GAAG,EAAE,CAAC;IACtE,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7B,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACjD,SAAS;SACN,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,uBAAe,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,CAAC,CAAC;SACD,IAAI,EAAE,EACT,0BAAS,CAAC,KAAK,CAChB,CAAC;IAEF,MAAM,SAAS,GAAuB,EAAE,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,C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,KAAK;YACd,QAAQ,EAAE,SAAS;YACnB,gBAAgB,EAAE,iBAAiB;YACnC,UAAU,EAAE,WAAW;SACxB,CACF,CAAC;QACF,IAAI,gBAAgB;YAAE,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAEvD,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW;YAAE,SAAS;QAC3C,MAAM,QAAQ,GAAG,IAAA,6BAAmB,EAClC,0BAAS,CAAC,KAAK,EACf,MAAM,EACN,sBAAU,EACV;YACE,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,QAAQ;SACpB,EACD;YACE;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;YACD;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;SACF,EACD,EAAE,CACH,CAAC;QACF,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -17,9 +17,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
17
17
|
const aptos_1 = require("../../utils/aptos");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const constants_1 = require("./constants");
|
20
|
-
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
21
20
|
const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
|
22
|
-
const runInBatch_1 = __importDefault(require("../../utils/misc/runInBatch"));
|
23
21
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
22
|
var _a, _b, _c;
|
25
23
|
const client = (0, clients_1.getClientAptos)();
|
@@ -59,8 +57,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
57
|
}
|
60
58
|
resourcesByType.set(resource.type, resource);
|
61
59
|
});
|
62
|
-
const
|
63
|
-
// const decimalsByToken: Map<string, number> = new Map();
|
60
|
+
const tokenPrices = yield cache.getTokenPricesAsMap(tokens, portfolio_core_1.NetworkId.aptos);
|
64
61
|
const sources = [];
|
65
62
|
for (let i = 0; i < lpsCoinInfo.length; i++) {
|
66
63
|
const lpInfoResource = lpsCoinInfo[i];
|
@@ -83,42 +80,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
83
80
|
liquidityPoolData.coin_y_reserve.value === '0')
|
84
81
|
continue;
|
85
82
|
const [tokenPriceX, tokenPriceY] = [
|
86
|
-
|
87
|
-
|
83
|
+
tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(typeX, portfolio_core_1.NetworkId.aptos)),
|
84
|
+
tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(typeY, portfolio_core_1.NetworkId.aptos)),
|
88
85
|
];
|
89
86
|
const [reserveAmountRawX, reserveAmountRawY] = [
|
90
87
|
new bignumber_js_1.default(liquidityPoolData.coin_x_reserve.value),
|
91
88
|
new bignumber_js_1.default(liquidityPoolData.coin_y_reserve.value),
|
92
89
|
];
|
93
|
-
// const cachedDecimalsX = decimalsByToken.get(typeX);
|
94
|
-
// const cachedDecimalsY = decimalsByToken.get(typeY);
|
95
|
-
// const decimalsX =
|
96
|
-
// cachedDecimalsX ||
|
97
|
-
// (await getDecimalsForToken(cache, typeX, NetworkId.aptos));
|
98
|
-
// const decimalsY =
|
99
|
-
// cachedDecimalsY ||
|
100
|
-
// (await getDecimalsForToken(cache, typeY, NetworkId.aptos));
|
101
|
-
// if (!decimalsX || !decimalsY) continue;
|
102
|
-
// if (!cachedDecimalsX) decimalsByToken.set(typeX, decimalsX);
|
103
|
-
// if (!cachedDecimalsY) decimalsByToken.set(typeY, decimalsY);
|
104
|
-
// const underlyingSource = getLpUnderlyingTokenSource(
|
105
|
-
// lpType,
|
106
|
-
// platformId,
|
107
|
-
// NetworkId.aptos,
|
108
|
-
// {
|
109
|
-
// address: typeX,
|
110
|
-
// decimals: decimalsX,
|
111
|
-
// reserveAmountRaw: reserveAmountRawX,
|
112
|
-
// tokenPrice: tokenPriceX,
|
113
|
-
// },
|
114
|
-
// {
|
115
|
-
// address: typeY,
|
116
|
-
// decimals: decimalsY,
|
117
|
-
// reserveAmountRaw: reserveAmountRawY,
|
118
|
-
// tokenPrice: tokenPriceY,
|
119
|
-
// }
|
120
|
-
// );
|
121
|
-
// if (underlyingSource) sources.push(underlyingSource);
|
122
90
|
if (!tokenPriceX || !tokenPriceY)
|
123
91
|
continue;
|
124
92
|
const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
|
@@ -141,7 +109,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
141
109
|
], undefined);
|
142
110
|
sources.push(lpSource);
|
143
111
|
}
|
144
|
-
yield
|
112
|
+
yield cache.setTokenPriceSources(sources);
|
145
113
|
});
|
146
114
|
const job = {
|
147
115
|
id: `${constants_1.platformId}-aptos-lp`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquidswap/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+
|
1
|
+
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liqu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BAAS,CAAC,KAAK,EACf,MAAM,EACN,sBAAU,EACV;YACE,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,QAAQ;SACpB,EACD;YACE;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;YACD;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;SACF,EACD,SAAS,CACV,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -21,7 +21,7 @@ exports.fetchers = [
|
|
21
21
|
(0, getPositionsV2Fetcher_1.default)(portfolio_core_1.NetworkId.ethereum, constants_1.platform.id, 'v2'),
|
22
22
|
(0, getPositionsV2Fetcher_1.default)(portfolio_core_1.NetworkId.polygon, constants_1.platform.id, 'v2'),
|
23
23
|
(0, getPositionsV2Fetcher_1.default)(portfolio_core_1.NetworkId.avalanche, constants_1.platform.id, 'v2'),
|
24
|
-
|
24
|
+
// getPositionsV2Fetcher(NetworkId.bnb, platform.id, 'v2'),
|
25
25
|
// getUniV3PositionsFetcher(
|
26
26
|
// {
|
27
27
|
// networkId: NetworkId.ethereum,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sushiswap/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAiE;AAGjE,2CAMqB;AACrB,4EAAoD;AACpD,gGAAwE;AACxE,gEAA6C;AAEhC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU;IACzB,kBAAa;IACb,IAAA,qBAAW,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,8BAAkB,CAAC;IACtE,IAAA,qBAAW,EAAC,0BAAS,CAAC,OAAO,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,6BAAiB,CAAC;IACpE,IAAA,qBAAW,EAAC,0BAAS,CAAC,SAAS,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,+BAAmB,CAAC;IACxE,IAAA,qBAAW,EAAC,0BAAS,CAAC,GAAG,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,yBAAa,CAAC;CAC7D,CAAC;AACW,QAAA,QAAQ,GAAc;IACjC,IAAA,+BAAqB,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAC5D,IAAA,+BAAqB,EAAC,0BAAS,CAAC,OAAO,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAC3D,IAAA,+BAAqB,EAAC,0BAAS,CAAC,SAAS,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAC7D,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sushiswap/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAiE;AAGjE,2CAMqB;AACrB,4EAAoD;AACpD,gGAAwE;AACxE,gEAA6C;AAEhC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU;IACzB,kBAAa;IACb,IAAA,qBAAW,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,8BAAkB,CAAC;IACtE,IAAA,qBAAW,EAAC,0BAAS,CAAC,OAAO,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,6BAAiB,CAAC;IACpE,IAAA,qBAAW,EAAC,0BAAS,CAAC,SAAS,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,+BAAmB,CAAC;IACxE,IAAA,qBAAW,EAAC,0BAAS,CAAC,GAAG,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,yBAAa,CAAC;CAC7D,CAAC;AACW,QAAA,QAAQ,GAAc;IACjC,IAAA,+BAAqB,EAAC,0BAAS,CAAC,QAAQ,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAC5D,IAAA,+BAAqB,EAAC,0BAAS,CAAC,OAAO,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAC3D,IAAA,+BAAqB,EAAC,0BAAS,CAAC,SAAS,EAAE,oBAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAC7D,2DAA2D;IAC3D,4BAA4B;IAC5B,MAAM;IACN,qCAAqC;IACrC,6DAA6D;IAC7D,qEAAqE;IACrE,OAAO;IACP,iBAAiB;IACjB,SAAS;IACT,KAAK;CACN,CAAC"}
|
@@ -1,3 +1,7 @@
|
|
1
1
|
import { NetworkIdType, TokenPrice } from '@sonarwatch/portfolio-core';
|
2
2
|
import { Cache } from '../../Cache';
|
3
|
+
/**
|
4
|
+
* @deprecated
|
5
|
+
* This function has been deprecated. Use the cache.getTokenPricesAsMap() instead.
|
6
|
+
*/
|
3
7
|
export default function getTokenPricesMap(tokensAddresses: string[], networkId: NetworkIdType, cache: Cache): Promise<Map<string, TokenPrice>>;
|
@@ -13,6 +13,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const runInBatch_1 = __importDefault(require("./runInBatch"));
|
16
|
+
/**
|
17
|
+
* @deprecated
|
18
|
+
* This function has been deprecated. Use the cache.getTokenPricesAsMap() instead.
|
19
|
+
*/
|
16
20
|
function getTokenPricesMap(tokensAddresses, networkId, cache) {
|
17
21
|
return __awaiter(this, void 0, void 0, function* () {
|
18
22
|
const tokensGroups = [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getTokensPricesMap.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getTokensPricesMap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,8DAAsC;AAEtC,SAA8B,iBAAiB,CAC7C,eAAyB,EACzB,SAAwB,EACxB,KAAY;;QAEZ,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;YACpD,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,cAAc,GAA4B,IAAI,GAAG,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,IAAA,oBAAU,EAC1B,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAC1E,CAAC;QACF,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YAChB,IAAI,CAAC,CAAC,MAAM,KAAK,UAAU;gBAAE,OAAO;YACpC,IAAI,CAAC,CAAC,CAAC,KAAK;gBAAE,OAAO;YACrB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;gBAC7B,IAAI,UAAU;oBAAE,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACrE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,cAAc,CAAC;IACxB,CAAC;CAAA;AArBD,oCAqBC"}
|
1
|
+
{"version":3,"file":"getTokensPricesMap.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getTokensPricesMap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,8DAAsC;AAEtC;;;GAGG;AACH,SAA8B,iBAAiB,CAC7C,eAAyB,EACzB,SAAwB,EACxB,KAAY;;QAEZ,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;YACpD,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,cAAc,GAA4B,IAAI,GAAG,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,IAAA,oBAAU,EAC1B,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAC1E,CAAC;QACF,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YAChB,IAAI,CAAC,CAAC,MAAM,KAAK,UAAU;gBAAE,OAAO;YACpC,IAAI,CAAC,CAAC,CAAC,KAAK;gBAAE,OAAO;YACrB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;gBAC7B,IAAI,UAAU;oBAAE,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACrE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,cAAc,CAAC;IACxB,CAAC;CAAA;AArBD,oCAqBC"}
|