feat: RWA asset lifecycle status model, badge, and timeline UI - #174
Merged
El-swaggerito merged 2 commits intoJul 29, 2026
Merged
Conversation
- Add pure lifecycle state machine (src/lib/assetLifecycle.ts): active, paused, matured, redeemed, defaulted, with fail-closed transition validation (rejects same-state, out-of-terminal-state, and state-skipping transitions) - Add AssetLifecycleBadge (small badge, matches ComplianceBadge/ TransferEligibilityBadge conventions) and AssetLifecycleTimeline (full status UI: current state, history, optional admin action buttons) - Extend PortfolioAsset with optional lifecycleStatus field (additive, non-breaking) and wire it through fixtures/portfolio.ts and AssetCard - Deliberately omit lifecycleStatus on the existing 'data unavailable' fixture asset to exercise the no-default-assumed edge case - Add 21 unit tests for the state machine and 6 component tests for the timeline UI; full suite passes with zero regressions - Document the model, state diagram, edge cases, and known limitations (lifecycle state does not yet gate transfer eligibility or minting; no admin page wires the action buttons to a real mutation) in docs/asset-lifecycle-status.md, linked from README.md and docs/README.md Closes #30
Contributor
| \nThis PR is currently blocked by merge conflicts.\n\nPlease update the branch with the latest main branch and resolve the conflicts before it can be merged. |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #30
Summary
Adds a typed lifecycle state machine for already-minted RWA assets
(active/paused/matured/redeemed/defaulted) with fail-closed transition
validation, a badge + full status/timeline UI, and integration into the
existing portfolio view.
Changes
src/lib/assetLifecycle.ts— pure state machine: valid transitions,terminal-state detection, transition validation with clear rejection
reasons for every invalid case
src/features/assets/components/AssetLifecycleBadge.tsx— small badge,same conventions as the existing ComplianceBadge/TransferEligibilityBadge
src/features/assets/components/AssetLifecycleTimeline.tsx— full statusUI: current state, detail copy, ordered history, optional admin action
buttons (read-only by default)
src/lib/aegis/types.ts— adds optionallifecycleStatusfield toPortfolioAsset(additive, non-breaking)src/fixtures/portfolio.ts— populates 3 lifecycle states acrossexisting assets; deliberately omits it on the asset that already has
isDataAvailable: falsesrc/features/assets/components/AssetCard.tsx— renders the badge whenpresent
docs/asset-lifecycle-status.md— state diagram, edge cases, compliancewording notes, known limitations
README.md/docs/README.md— links to the new docTesting
assetLifecycle.test.ts)AssetLifecycleTimeline.test.tsx)tsc --noEmitandnext lintcleanKnown limitations (documented in the doc)
that would need to flow through the existing
eligibility.tsassetPausedinput. Intentionally left as a follow-up to keep this PRfocused.
AssetLifecycleTimeline's action buttonsto a real mutation — the component supports it via the
onTransitionprop, but nothing calls it yet.