feat(admin): add admin action history feed #616 - #624
Open
sunnykid-02 wants to merge 1 commit into
Open
Conversation
|
@sunnykid-02 is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@sunnykid-02 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! 🚀 |
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.
Overview
This PR adds the Admin Action History feed for the admin dashboard (issue #616). It provides a chronological list of past
set_admin,set_paused,set_adapter,migrate_adapter,transfer_admin, andaccept_admincalls, each with a summary, timestamp, and a link to the transaction.Related Issue
Closes #616
Changes
📋 Admin Action History Scanner
[ADD]
packages/stellar-sdk-helpers/src/admin-history.ts/operationsforinvoke_host_functionentries whose base64-encodedparameters[0]matches the vault contract ID andparameters[1]matches one of the six admin function names.ScValparameters using@stellar/stellar-sdkXDR parsing.limitandmaxPages.[ADD]
packages/stellar-sdk-helpers/src/admin-history.test.tsdecodeScVal(address, symbol, u64 decoding) andsummarizeAction(all six admin function types).🌐 API Layer
[ADD]
packages/api-core/src/admin-history.tsKNOWN_POOLSand returns paginated admin actions.[ADD]
api/v1/admin/history.tsGET /api/v1/admin/history?vaultId=...s-maxage=30,stale-while-revalidate=120).🎨 Frontend
[ADD]
apps/web/src/components/dashboard/AdminActionHistory.tsx[ADD]
apps/web/src/hooks/useAdminHistory.ts[ADD]
apps/web/src/hooks/useIsAdmin.tsget_adminvia Soroban RPC to determine if the connected wallet is the current vault admin.[MODIFY]
apps/web/src/App.tsxAdminActionHistoryinto the dashboard belowVaultPanel.[MODIFY]
apps/web/src/lib/api.tsgetAdminHistory(vaultId)method.[MODIFY]
apps/web/messages/en.json/fr.json[MODIFY]
packages/stellar-sdk-helpers/src/index.tsadmin-historymodule.Data Source Decision
The vault contract does not emit Soroban events, and redeploying it to add events would change the contract ID and break existing integrations. Instead, Horizon's
/operationsendpoint exposesinvoke_host_functionoperations whose base64-encodedparameters[0]is the target contract address andparameters[1]is the function name. This provides a complete, queryable off-chain history without any contract changes.Verification Results
Acceptance Criteria