Back to Contract Explorer

SmartLoanViewFacet

view

Read-only functions to inspect loan health, balances, supported assets, and staked positions. These functions do not modify state and can be called without gas.

Functions (5)

Usage Example

typescript
const [totalValue, totalDebt, assets] = await Promise.all([
  client.readContract({
    address: loanAddress,
    abi: viewFacetAbi,
    functionName: "getTotalValue",
  }),
  client.readContract({
    address: loanAddress,
    abi: viewFacetAbi,
    functionName: "getDebt",
  }),
  client.readContract({
    address: loanAddress,
    abi: viewFacetAbi,
    functionName: "getAllOwnedAssets",
  }),
]);

console.log("Total Value:", formatEther(totalValue));
console.log("Total Debt:", formatEther(totalDebt));
console.log("Assets:", assets);