diff --git a/solend-sdk/package.json b/solend-sdk/package.json index a50f465b..3b74f8cc 100644 --- a/solend-sdk/package.json +++ b/solend-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@solendprotocol/solend-sdk", - "version": "0.13.33", + "version": "0.13.35", "private": true, "main": "src/index.ts", "module": "src/index.ts", diff --git a/solend-sdk/src/core/actions.ts b/solend-sdk/src/core/actions.ts index 9647e39f..d60ba836 100644 --- a/solend-sdk/src/core/actions.ts +++ b/solend-sdk/src/core/actions.ts @@ -1403,6 +1403,16 @@ export class SolendActionCore { this.borrowReserves, this.programId ); + + this.depositReserves = this.depositReserves.filter((reserve) => { + const deposit = this.obligationAccountInfo?.deposits.find((d) => d.depositReserve.toBase58() === reserve.toBase58()); + return deposit?.depositedAmount.gt(new BN(0)); + }); + this.borrowReserves = this.borrowReserves.filter((reserve) => { + const borrow = this.obligationAccountInfo?.borrows.find((b) => b.borrowReserve.toBase58() === reserve.toBase58()); + return borrow?.borrowedAmountWads.gt(new BN(0)); + }); + if (this.debug) console.log("adding refresh obligation ix to setup txn"); this.setupIxs.push(refreshObligationIx); }