Skip to content

feat(invoices): yield vesting viewer, limit orders, threshold badge, default resolution - #506

Merged
TS-mfon merged 2 commits into
StellarState:devfrom
jajafwangshak86-ops:feature/479-480-481-483-invoice-enhancements
Oct 19, 2026
Merged

TS-mfon merged 2 commits into
StellarState:devfrom
jajafwangshak86-ops:feature/479-480-481-483-invoice-enhancements

Conversation

@jajafwangshak86-ops

Copy link
Copy Markdown
Contributor

Summary

Resolves four Stellar Wave issues in a single cohesive PR, all touching the invoice/investor surface.

Changes

#479 — Yield vesting schedule viewer (investor portfolio)

  • YieldVestingSection component: per-invoice cards listing every yield tranche with its release date, amount, and a Claim button enabled only after the release timestamp passes
  • Claim All button that batches all currently unlocked tranches into a single transaction
  • Real-time countdown shown on locked tranches
  • useYieldVesting hook with fetchYieldVesting, claimYieldTranche, claimAllYieldTranches API functions added to lib/api/index.ts
  • Mounted below the existing VestingProgressWidget in InvestorPortfolio

#480 — Limit order UI for secondary market buy orders

  • LimitOrderPanel: fraction amount + max-price-per-fraction inputs, order summary showing total escrowed, Place Order button
  • Active orders list with per-order Cancel button (optimistic removal)
  • SecondaryMarketTabsPanel: wraps existing Buy Now listings and the new Limit Order tab; mounted on funded invoice detail pages
  • useLimitOrders hook with placeLimitOrder, cancelLimitOrder, fetchActiveLimitOrders API functions

#481 — Funding threshold progress indicator

  • FundingThresholdWarningBadge: amber badge rendered on invoice cards and the detail page when the funding window closes within 24 h and the minimum threshold is not yet met; uses pure shouldShowThresholdWarning helper
  • FundingFailedCard: replaces the progress bar on rejected invoices where the threshold was missed — shows raised amount, threshold, gap, and refund status
  • Both integrated into InvoiceCard (marketplace grid) and InvoiceDetailView

#483 — Default resolution status page

  • DefaultResolutionView: replaces the normal invoice detail header for status === "defaulted" invoices; shows declaration date, collateral forfeited, total recovery distributed, distribution status, and a dispute/contact external link
  • Per-holder recovery table with the connected wallet's row highlighted and its recovery amount called out separately
  • Graceful pending state when recovery distribution is still in progress
  • PositionCard now links defaulted positions to the invoice detail page ("View default resolution →")
  • InvoiceStatusBadge extended with a "defaulted" entry
  • Invoice.status and InvestmentPosition.status unions extended with "defaulted"

Files changed

File Change
lib/api/index.ts New API types and functions for all four issues
lib/portfolio.ts Added "defaulted" to InvestmentPosition.status
hooks/useYieldVesting.ts New — yield vesting data + mutation hooks
hooks/useLimitOrders.ts New — limit order hooks with optimistic cancel
components/invoices/FundingThresholdWarningBadge.tsx New
components/invoices/FundingFailedCard.tsx New
components/invoices/LimitOrderPanel.tsx New
components/invoices/SecondaryMarketTabsPanel.tsx New
components/invoices/DefaultResolutionView.tsx New
components/dashboard/YieldVestingSection.tsx New
components/invoices/InvoiceDetailView.tsx Integrated all four features; fixed duplicate CompareToggleButton import
components/invoices/InvoiceStatusBadge.tsx Added defaulted status config
components/marketplace/invoice-card.tsx Added threshold warning badge; removed duplicate import
components/dashboard/InvestorPortfolio.tsx Mounted YieldVestingSection
components/dashboard/PositionCard.tsx Link defaulted positions to detail page

Closes #479
Closes #480
Closes #481
Closes #483

…default resolution

Closes StellarState#479 — Add yield vesting schedule viewer on investor portfolio page
- YieldVestingSection component with per-invoice tranche cards
- Claim per-tranche and Claim All (batch) buttons
- Real-time countdown to locked tranche release
- useYieldVesting hook + fetchYieldVesting / claimYieldTranche / claimAllYieldTranches API calls
- Mounted below VestingProgressWidget in InvestorPortfolio

Closes StellarState#480 — Build limit order placement UI for secondary market buy orders
- LimitOrderPanel: fraction amount + max price inputs, order summary with escrowed total
- Active orders list with optimistic-cancel
- SecondaryMarketTabsPanel: Buy Now / Limit Order tab switcher on invoice detail
- useLimitOrders hook + placeLimitOrder / cancelLimitOrder / fetchActiveLimitOrders API calls
- Panel appears on funded invoice detail pages

Closes StellarState#481 — Add funding threshold progress indicator to invoice cards and detail
- FundingThresholdWarningBadge: amber badge when threshold unmet and window closes within 24h
- FundingFailedCard: replaces progress bar for rejected invoices that missed threshold
- Badge added to InvoiceCard and InvoiceDetailView; FundingFailedCard in InvoiceDetailView
- shouldShowThresholdWarning pure helper for direct testing
- fetchFundingThresholdDetail API stub added

Closes StellarState#483 — Add default resolution status page for defaulted invoices
- DefaultResolutionView: default banner (declaration date, collateral forfeited, recovery distributed)
- Per-holder recovery table with connected-wallet highlight
- Dispute/contact external link
- Graceful pending state when recovery distribution is in progress
- InvoiceDetailView renders DefaultResolutionView instead of normal header for 'defaulted' invoices
- PositionCard links defaulted positions to their invoice detail page
- Added 'defaulted' to Invoice.status union, InvestmentPosition.status, and InvoiceStatusBadge
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@jajafwangshak86-ops Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@TS-mfon
TS-mfon merged commit 8b9b603 into StellarState:dev Oct 19, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants