@curvefi/llamalend-api 2.0.23 → 2.0.24

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.
package/lib/llamalend.js CHANGED
@@ -34,7 +34,6 @@ import { LLAMMAS } from "./constants/llammas.js";
34
34
  import { L2Networks } from "./constants/L2Networks.js";
35
35
  import { createCall, handleMultiCallResponse } from "./utils.js";
36
36
  import { _getMarketsData, _getCrvUsdMarketsData } from "./external-api.js";
37
- import { extractDecimals } from "./constants/utils.js";
38
37
  import { fetchOneWayMarketsByBlockchain, fetchOneWayMarketsByAPI } from "./lendMarkets/fetch/fetchLendMarkets.js";
39
38
  import { fetchMintMarketsByBlockchain, fetchMintMarketsByAPI } from "./mintMarkets/fetch/fetchMintMarkets.js";
40
39
  const memoizeByAddress = (factory) => {
@@ -313,7 +312,12 @@ class Llamalend {
313
312
  this.setContract(this.constants.ALIASES.gauge_factory, GaugeFactorySidechainABI);
314
313
  }
315
314
  }
316
- this.constants.DECIMALS = Object.assign(Object.assign({}, extractDecimals(this.constants.LLAMMAS)), { [this.crvUsdAddress]: 18, [this.constants.ALIASES.crv]: 18, [this.constants.ALIASES.crvUSD]: 18, [this.constants.ALIASES.st_crvUSD]: 18 });
315
+ this.constants.DECIMALS = {
316
+ [this.crvUsdAddress]: 18,
317
+ [this.constants.ALIASES.crv]: 18,
318
+ [this.constants.ALIASES.crvUSD]: 18,
319
+ [this.constants.ALIASES.st_crvUSD]: 18,
320
+ };
317
321
  if (L2Networks.includes(this.chainId)) {
318
322
  // eslint-disable-next-line @typescript-eslint/no-this-alias
319
323
  const lendingInstance = this;
@@ -14,6 +14,7 @@ import controllerABI from "../../constants/abis/crvUSD/controller.json" with { t
14
14
  import controllerV2ABI from "../../constants/abis/crvUSD/controller_v2.json";
15
15
  import FactoryABI from "../../constants/abis/crvUSD/Factory.json" with { type: 'json' };
16
16
  import MonetaryPolicy2ABI from "../../constants/abis/crvUSD/MonetaryPolicy2.json" with { type: 'json' };
17
+ import { extractDecimals } from "../../constants/utils.js";
17
18
  export const fetchMintMarketsByAPI = (llamalend) => __awaiter(void 0, void 0, void 0, function* () {
18
19
  if (llamalend.chainId !== 1)
19
20
  return;
@@ -62,6 +63,7 @@ export const fetchMintMarketsByAPI = (llamalend) => __awaiter(void 0, void 0, vo
62
63
  index: N1 + i,
63
64
  };
64
65
  }
66
+ llamalend.constants.DECIMALS = Object.assign(Object.assign({}, llamalend.constants.DECIMALS), extractDecimals(llamalend.constants.LLAMMAS));
65
67
  });
66
68
  export const fetchMintMarketsByBlockchain = (llamalend) => __awaiter(void 0, void 0, void 0, function* () {
67
69
  if (llamalend.chainId !== 1)
@@ -132,4 +134,5 @@ export const fetchMintMarketsByBlockchain = (llamalend) => __awaiter(void 0, voi
132
134
  index: N1 + i,
133
135
  };
134
136
  }
137
+ llamalend.constants.DECIMALS = Object.assign(Object.assign({}, llamalend.constants.DECIMALS), extractDecimals(llamalend.constants.LLAMMAS));
135
138
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/llamalend-api",
3
- "version": "2.0.23",
3
+ "version": "2.0.24",
4
4
  "description": "JavaScript library for Curve Lending",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",
package/src/llamalend.ts CHANGED
@@ -48,7 +48,6 @@ import {LLAMMAS} from "./constants/llammas.js";
48
48
  import {L2Networks} from "./constants/L2Networks.js";
49
49
  import {createCall, handleMultiCallResponse} from "./utils.js";
50
50
  import {_getMarketsData, _getCrvUsdMarketsData} from "./external-api.js";
51
- import {extractDecimals} from "./constants/utils.js";
52
51
  import {MintMarketTemplate} from "./mintMarkets";
53
52
  import {LendMarketTemplate} from "./lendMarkets";
54
53
  import {fetchOneWayMarketsByBlockchain, fetchOneWayMarketsByAPI} from "./lendMarkets/fetch/fetchLendMarkets.js";
@@ -310,7 +309,6 @@ class Llamalend implements ILlamalend {
310
309
 
311
310
 
312
311
  this.constants.DECIMALS = {
313
- ...extractDecimals(this.constants.LLAMMAS),
314
312
  [this.crvUsdAddress]: 18,
315
313
  [this.constants.ALIASES.crv]: 18,
316
314
  [this.constants.ALIASES.crvUSD]: 18,
@@ -6,6 +6,7 @@ import controllerABI from "../../constants/abis/crvUSD/controller.json" with {ty
6
6
  import controllerV2ABI from "../../constants/abis/crvUSD/controller_v2.json";
7
7
  import FactoryABI from "../../constants/abis/crvUSD/Factory.json" with {type: 'json'};
8
8
  import MonetaryPolicy2ABI from "../../constants/abis/crvUSD/MonetaryPolicy2.json" with {type: 'json'};
9
+ import {extractDecimals} from "../../constants/utils.js";
9
10
 
10
11
  export const fetchMintMarketsByAPI = async (llamalend: Llamalend): Promise<void> => {
11
12
  if (llamalend.chainId !== 1) return;
@@ -60,6 +61,8 @@ export const fetchMintMarketsByAPI = async (llamalend: Llamalend): Promise<void>
60
61
  index: N1 + i,
61
62
  };
62
63
  }
64
+
65
+ llamalend.constants.DECIMALS = {...llamalend.constants.DECIMALS, ...extractDecimals(llamalend.constants.LLAMMAS)}
63
66
  };
64
67
 
65
68
  export const fetchMintMarketsByBlockchain = async (llamalend: Llamalend): Promise<void> => {
@@ -143,4 +146,6 @@ export const fetchMintMarketsByBlockchain = async (llamalend: Llamalend): Promis
143
146
  index: N1 + i,
144
147
  };
145
148
  }
149
+
150
+ llamalend.constants.DECIMALS = {...llamalend.constants.DECIMALS, ...extractDecimals(llamalend.constants.LLAMMAS)}
146
151
  };