@defisaver/positions-sdk 2.1.5 → 2.1.6

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.
@@ -98,6 +98,7 @@ const getChainLinkPricesForTokens = (tokens, network, client) => __awaiter(void
98
98
  const btcPriceChainlink = new decimal_js_1.default(results[1].result).div(1e8).toString();
99
99
  let offset = 2; // wstETH and weETH has 3 calls, while others have only 1, so we need to keep track. First 2 are static calls for eth and btc prices
100
100
  return noDuplicateTokens.reduce((acc, token, i) => {
101
+ var _a;
101
102
  const assetInfo = (0, tokens_1.getAssetInfoByAddress)(token, network);
102
103
  switch (assetInfo.symbol) {
103
104
  case 'USDA':
@@ -142,7 +143,7 @@ const getChainLinkPricesForTokens = (tokens, network, client) => __awaiter(void
142
143
  }
143
144
  default:
144
145
  // @ts-ignore
145
- if (results[i + offset].result[1]) {
146
+ if ((_a = results[i + offset].result) === null || _a === void 0 ? void 0 : _a[1]) {
146
147
  // @ts-ignore
147
148
  acc[token] = new decimal_js_1.default(results[i + offset].result[1].toString()).div(1e8).toString();
148
149
  }
@@ -92,6 +92,7 @@ const getChainLinkPricesForTokens = (tokens, network, client) => __awaiter(void
92
92
  const btcPriceChainlink = new Dec(results[1].result).div(1e8).toString();
93
93
  let offset = 2; // wstETH and weETH has 3 calls, while others have only 1, so we need to keep track. First 2 are static calls for eth and btc prices
94
94
  return noDuplicateTokens.reduce((acc, token, i) => {
95
+ var _a;
95
96
  const assetInfo = getAssetInfoByAddress(token, network);
96
97
  switch (assetInfo.symbol) {
97
98
  case 'USDA':
@@ -136,7 +137,7 @@ const getChainLinkPricesForTokens = (tokens, network, client) => __awaiter(void
136
137
  }
137
138
  default:
138
139
  // @ts-ignore
139
- if (results[i + offset].result[1]) {
140
+ if ((_a = results[i + offset].result) === null || _a === void 0 ? void 0 : _a[1]) {
140
141
  // @ts-ignore
141
142
  acc[token] = new Dec(results[i + offset].result[1].toString()).div(1e8).toString();
142
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/positions-sdk",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -21,7 +21,7 @@
21
21
  "author": "",
22
22
  "license": "ISC",
23
23
  "dependencies": {
24
- "@defisaver/tokens": "^1.7.1",
24
+ "@defisaver/tokens": "^1.7.5",
25
25
  "@types/lodash": "^4.17.15",
26
26
  "@types/memoizee": "^0.4.12",
27
27
  "decimal.js": "^10.6.0",
@@ -195,7 +195,7 @@ const getChainLinkPricesForTokens = async (
195
195
 
196
196
  default:
197
197
  // @ts-ignore
198
- if (results[i + offset].result[1]) {
198
+ if (results[i + offset].result?.[1]) {
199
199
  // @ts-ignore
200
200
  acc[token] = new Dec(results[i + offset].result[1]!.toString() as string).div(1e8).toString();
201
201
  } else if (results[i + offset].result) {