Skip to content

Lender: Loan actions #33

@ardier16

Description

@ardier16

Describe the feature

Description:
Implement lender modals for accepting offers, liquidating expired loans, and claiming payouts.

Acceptance Criteria:

  • Accept Offer modal:
    • Display offer details:
      • Borrower collateral (LBTC)
      • Principal (USDT)
      • APR (%)
      • Term (blocks/days)
      • Lender principal covenant hash (display for transparency)
    • "Accept & Supply" button → Build → Sign with Jade → Broadcast
    • Transaction states: pending → success (txid link) → error (retry)
    • Modal closes on success; offer moves to "Active Loans"
  • Liquidation modal (appears when loan expired, block height > expiration):
    • Display loan details:
      • Borrower collateral (LBTC)
      • Current status: "Expired" (red badge)
      • Expiration block + time ago
      • Collateral to claim (LBTC)
    • "Liquidate & Claim Collateral" button → Build → Sign with Jade → Broadcast
    • Transaction states: pending → success (txid link) → error (retry)
    • Modal closes on success
  • Claim modal (appears when loan repaid or liquidated, ready to claim):
    • Display claimable amount:
      • Principal (USDT)
      • Interest earned (USDT)
      • Total to claim (USDT)
    • "Claim" button → Build → Sign with Jade → Broadcast
    • Transaction states: pending → success (txid + amount) → error (retry)
    • Modal closes on success; offer removed from active list
  • Transaction builders called:
    • buildAcceptOfferTx() — lender accepts offer
    • buildLoanLiquidationTx() — liquidate collateral
    • Claim uses same logic as loanRepayment finalization (port if needed)
  • All tx signing via Jade (Pretty #3)
  • Manual test: All three flows work end-to-end on testnet, match Figma

Notes:

  • Flows match Figma: "Accept & Supply", "Liquidate", "Claim"
  • Check offer status before rendering modals (avoid invalid states)
  • Show countdown timer for expiration if loan will expire soon

Metadata

Metadata

Assignees

Labels

webWebsite-related issues

Projects

Status

Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions