Skip to content

Borrower: Loan management #31

@ardier16

Description

@ardier16

Describe the feature

Description:
Implement borrower flows for repaying loans and canceling pending offers.

Acceptance Criteria:

  • Active loans list (from useOffersByBorrowerPubkey filtered by status):
    • Display borrower's active and pending loans
    • Click to open action modals
  • Repayment modal:
    • Display loan details:
      • Collateral amount (LBTC) with asset icon
      • Principal amount (USDT)
      • Interest amount (USDT)
      • APR (%)
      • Expiration block height + "Term Left" countdown
      • Current block height (from useBlockHeight)
    • Repay amount input (auto-fills principal + interest, editable)
    • "Repay Loan" button → Build → Sign with Jade → Broadcast
    • Transaction states: pending → success (txid link) → error (retry)
    • Modal closes on success
  • Cancel Offer modal:
    • Confirmation dialog: "Are you sure you want to cancel this offer?"
    • Show offer details (collateral, amount, APR)
    • "Confirm Cancel" button → Build → Sign with Jade → Broadcast
    • Transaction states: pending → success → error (retry)
    • Modal closes on success
  • Transaction builders called:
    • buildLoanRepaymentTx() — repay loan
    • buildPreLockCancellationTx() — cancel offer
  • All tx signing via Jade (Jade wallet integration #24)
  • Manual test: Repay and cancel flows work on testnet

Notes:

  • Flows match Figma: "Repay Loan Flow" and "Cancel Borrow Offer Flow"
  • Show error message if loan expired (can't repay)
  • Post-repayment, lender can claim; show success message

Metadata

Metadata

Assignees

Labels

webWebsite-related issues
No fields configured for Feature.

Projects

Status

Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions