@kamino-finance/klend-sdk 2.13.6 → 2.13.8

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.
@@ -154,7 +154,7 @@ class KaminoAction {
154
154
  static buildRequestElevationGroupTxns(kaminoMarket_1, payer_1, obligation_2, elevationGroup_1) {
155
155
  return __awaiter(this, arguments, void 0, function* (kaminoMarket, payer, obligation, elevationGroup, extraComputeBudget = 1000000, // if > 0 then adds the ixn
156
156
  currentSlot = 0) {
157
- const firstReserve = obligation.state.deposits[0].depositReserve;
157
+ const firstReserve = obligation.state.deposits.find((x) => !x.depositReserve.equals(web3_js_1.PublicKey.default)).depositReserve;
158
158
  const firstKaminoReserve = kaminoMarket.getReserveByAddress(firstReserve);
159
159
  if (!firstKaminoReserve) {
160
160
  throw new Error(`Reserve ${firstReserve.toBase58()} not found`);
@@ -928,7 +928,7 @@ class KaminoAction {
928
928
  throw Error(`Unable to find obligation borrow to repay for ${this.obligation.state.owner.toBase58()}`);
929
929
  }
930
930
  const cumulativeBorrowRateObligation = obligation_1.KaminoObligation.getCumulativeBorrowRate(borrow);
931
- const cumulativeBorrowRateReserve = this.reserve.getEstimatedCumulativeBorrowRate(this.currentSlot);
931
+ const cumulativeBorrowRateReserve = this.reserve.getEstimatedCumulativeBorrowRate(this.currentSlot, this.kaminoMarket.state.referralFeeBps);
932
932
  const fullRepay = obligation_1.KaminoObligation.getBorrowAmount(borrow)
933
933
  .mul(cumulativeBorrowRateReserve)
934
934
  .div(cumulativeBorrowRateObligation);
@@ -1535,7 +1535,7 @@ class KaminoAction {
1535
1535
  throw Error(`Unable to find obligation borrow to repay for ${this.obligation.state.owner.toBase58()}`);
1536
1536
  }
1537
1537
  const cumulativeBorrowRateObligation = obligation_1.KaminoObligation.getCumulativeBorrowRate(borrow);
1538
- const cumulativeBorrowRateReserve = this.reserve.getEstimatedCumulativeBorrowRate(this.currentSlot);
1538
+ const cumulativeBorrowRateReserve = this.reserve.getEstimatedCumulativeBorrowRate(this.currentSlot, this.kaminoMarket.state.referralFeeBps);
1539
1539
  // TODO: shouldn't this calc be added to all other stuff as well?
1540
1540
  safeRepay = new bn_js_1.default(Math.floor(obligation_1.KaminoObligation.getBorrowAmount(borrow)
1541
1541
  .mul(cumulativeBorrowRateReserve)