Prerequisites
Before you begin, ensure that you’ve:- Installed the App Kit SDK and an adapter
- Opened a loan whose owner matches the connected wallet
Check loan state
CallgetLoans with a wallet address and blockchain to fetch a page of the
wallet’s loans (up to 100 per call), along with each loan’s collateral, debt,
health factor, band, LTV, and liquidation price. Pass the returned
pagination.pageAfter cursor back to fetch the next page.
If you already have a loanId, call kit.borrow.getPosition({ loanId }) to
read that specific loan. It returns the same shape, except the owner field is
named wallet instead of walletAddress.
TypeScript
Loan looks like:
Subscribe to health updates
Register a webhook to receive updates when a loan enters a different health band.Register a webhook
CallregisterWebhook with the loan’s loanId and your webhookUrl. The
connected wallet must equal the loan’s persisted owner.
TypeScript
Unregister a webhook
OmitwebhookUrl (or pass null) to remove a loan’s current webhook.
TypeScript