@curvefi/llamalend-api 2.0.20 → 2.0.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.
@@ -1082,10 +1082,6 @@
1082
1082
  "name": "_for",
1083
1083
  "type": "address"
1084
1084
  },
1085
- {
1086
- "name": "_caller",
1087
- "type": "address"
1088
- },
1089
1085
  {
1090
1086
  "name": "_shrink",
1091
1087
  "type": "bool"
@@ -174,11 +174,12 @@ export class StatsBaseModule {
174
174
  }
175
175
  statsFutureRates(dReserves_1, dDebt_1) {
176
176
  return __awaiter(this, arguments, void 0, function* (dReserves, dDebt, useAPI = true) {
177
+ const isGetter = false;
177
178
  const _dReserves = parseUnits(dReserves, this.market.borrowed_token.decimals);
178
179
  const _dDebt = parseUnits(dDebt, this.market.borrowed_token.decimals);
179
180
  const _rate = yield this._getFutureRate(_dReserves, _dDebt);
180
- const debt = Number(yield this.statsTotalDebt()) + Number(dDebt);
181
- const cap = Number((yield this.statsCapAndAvailable(true, useAPI)).totalAssets) + Number(dReserves);
181
+ const debt = Number(yield this.statsTotalDebt(isGetter, useAPI)) + Number(dDebt);
182
+ const cap = Number((yield this.statsCapAndAvailable(isGetter, useAPI)).totalAssets) + Number(dReserves);
182
183
  return computeRatesFromRate(_rate, debt, cap);
183
184
  });
184
185
  }
@@ -71,7 +71,7 @@ export class LoanV2Module extends LoanBaseModule {
71
71
  address = _getAddress.call(this.llamalend, address);
72
72
  const _debt = parseUnits(debt);
73
73
  const contract = this.llamalend.contracts[this.market.addresses.controller].contract;
74
- const _health = yield contract.repay_health_preview(0, _debt, address, address, shrink, full, this.llamalend.constantOptions);
74
+ const _health = yield contract.repay_health_preview(0, _debt, address, shrink, full, this.llamalend.constantOptions);
75
75
  return formatUnits(_health * BigInt(100));
76
76
  });
77
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/llamalend-api",
3
- "version": "2.0.20",
3
+ "version": "2.0.22",
4
4
  "description": "JavaScript library for Curve Lending",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",
@@ -1082,10 +1082,6 @@
1082
1082
  "name": "_for",
1083
1083
  "type": "address"
1084
1084
  },
1085
- {
1086
- "name": "_caller",
1087
- "type": "address"
1088
- },
1089
1085
  {
1090
1086
  "name": "_shrink",
1091
1087
  "type": "bool"
@@ -130,11 +130,12 @@ export class StatsBaseModule {
130
130
  }
131
131
 
132
132
  public async statsFutureRates(dReserves: TAmount, dDebt: TAmount, useAPI = true): Promise<{borrowApr: string, lendApr: string, borrowApy: string, lendApy: string}> {
133
+ const isGetter = false;
133
134
  const _dReserves = parseUnits(dReserves, this.market.borrowed_token.decimals);
134
135
  const _dDebt = parseUnits(dDebt, this.market.borrowed_token.decimals);
135
136
  const _rate = await this._getFutureRate(_dReserves, _dDebt);
136
- const debt = Number(await this.statsTotalDebt()) + Number(dDebt);
137
- const cap = Number((await this.statsCapAndAvailable(true, useAPI)).totalAssets) + Number(dReserves);
137
+ const debt = Number(await this.statsTotalDebt(isGetter, useAPI)) + Number(dDebt);
138
+ const cap = Number((await this.statsCapAndAvailable(isGetter, useAPI)).totalAssets) + Number(dReserves);
138
139
  return computeRatesFromRate(_rate, debt, cap);
139
140
  }
140
141
 
@@ -67,7 +67,7 @@ export class LoanV2Module extends LoanBaseModule implements ILoanV2 {
67
67
  const _debt = parseUnits(debt);
68
68
 
69
69
  const contract = this.llamalend.contracts[this.market.addresses.controller].contract;
70
- const _health = await contract.repay_health_preview(0, _debt, address, address, shrink, full, this.llamalend.constantOptions) as bigint;
70
+ const _health = await contract.repay_health_preview(0, _debt, address, shrink, full, this.llamalend.constantOptions) as bigint;
71
71
 
72
72
  return formatUnits(_health * BigInt(100));
73
73
  }