Repository navigation
feat(agent): add vault headroom, operator cash-in, and stroops end-to-end (#890) - #898
huangji6693-max wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Hi @huangji6693-max, please merge the latest
git fetch upstream
git merge upstream/main
git pushPlease merge rather than rebase or force-push, so review history stays intact. Thanks! |
|
Thanks for the work here, @huangji6693-max, and apologies for the earlier note asking you to merge main: I should have checked eligibility first. DukaPay Wave issues are worked only after applying on the issue through the Wave and being assigned. #890 was never assigned to you, and other contributors applied first, so I'm closing this PR. If you'd like to contribute, please apply on an open Wave issue and wait for assignment before starting. Thanks for understanding. |
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)