@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.
- package/dist/classes/action.js +3 -3
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/market.js +1 -1
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/obligation.d.ts +1 -1
- package/dist/classes/obligation.js +4 -4
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/reserve.d.ts +7 -13
- package/dist/classes/reserve.js +16 -28
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/shared.d.ts +0 -2
- package/dist/classes/shared.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_calcs.js +1 -1
- package/dist/lending_operations/repay_with_collateral_calcs.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.js +2 -2
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/leverage/operations.js +2 -2
- package/dist/leverage/operations.js.map +1 -1
- package/package.json +1 -1
package/dist/classes/action.js
CHANGED
|
@@ -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
|
|
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)
|