Skip to content

Commit

Permalink
feat: added util to create empty loan for simulate (#98)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefano Faieta <[email protected]>
  • Loading branch information
gidonkatten and stefanofa authored Jul 12, 2024
1 parent aa4f8c3 commit fb85a71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-kids-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@folks-finance/xchain-sdk": patch
---

added util to create empty loan for simulate
4 changes: 4 additions & 0 deletions src/xchain/modules/folks-loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,10 @@ export const util = {
return FolksHubLoan.getUserLoansInfo(userLoansMap, poolsInfo, loanTypesInfo, oraclePrices);
},

emptyLoanForSimulate(accountId: AccountId, loanType: LoanTypeId): LoanManagerUserLoan {
return [accountId, loanType, [], [], [], []];
},

simulateLoanChanges(loan: LoanManagerUserLoan, changes: Array<LoanChange>): LoanManagerUserLoan {
return FolksHubLoan.simulateLoanChanges(loan, changes);
},
Expand Down

0 comments on commit fb85a71

Please sign in to comment.