Repository navigation
feat(agent): add vault headroom, operator cash-in, and stroops end-to-end (#890) - #898
Open
huangji6693-max wants to merge 1 commit into
Open
huangji6693-max wants to merge 1 commit into
huangji6693-max wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
4 tasks
This branch has not been deployed
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 #890
Summary
Completes the follow-up items to #776 for the agent vault screen and backend routes:
frontend/lib/money/format.ts&backend/src/controllers/agentMvpController.ts):parseAmount) and displays collateral, float, max float, and remaining headroom formatted from stroops (formatStroops).amountStroops) or decimal amounts inPOST /api/agents/vault/:actionand invalidates the cached agent dashboard snapshot onPOST /api/agents/submit.backend/src/controllers/agentDashboardController.ts&frontend/src/app/components/agent/AgentVaultActions.tsx):collateralStroops,floatStroops,maxFloatStroops, andheadroomStroops(max_float - float_balance) fromGET /api/agents/dashboard.mint-float) Flow (AgentVaultActions&admin/settlement/page.tsx):mode="operator"onAgentVaultActionsand mounts it on the admin settlement page so the operator can record a cash-in (mint_float) for a chosen agent signed with the admin wallet.backend/src/services/sorobanService.ts&AgentVaultActions.tsx):SolvencyViolated(Error(Contract, #8)) andInsufficientFloat(Error(Contract, #7)) (as well asInsufficientCollateral#6andMinCollateralViolated#11) from Soroban simulation/submission to clear HTTP 400 error responses and user-facing alerts without relying on a frontend-only pre-check.frontend/src/app/[locale]/agent/dashboard/page.tsx):CollateralDeposited,CollateralWithdrawn,FloatMinted,FloatBurned,FloatTransferred,VaultSettled, orHaircutUpdatedevents arrive on/api/events/stream.Verification
cd backend && npm test -- src/__tests__/agentMvp.test.ts(17/17 passing)cd backend && npm run typecheck(0 errors)cd frontend && npm test -- AgentVaultActions.test.tsx(5/5 passing)cd frontend && npm run i18n:validate && npm run typecheck(0 errors)