feat(admin): add price oracle approved callers panel (#829) - #841
Merged
Chucks1093 merged 1 commit intoAug 29, 2026
Merged
Conversation
) Add an Oracle Access panel to the admin dashboard so admins can manage the external contract addresses permitted to call the AccessLayer price oracle. - New admin dashboard route at /admin/dashboard hosting the panel - GET /admin/oracle/callers lists approved callers with a Remove button per entry - Add input + button submits a new caller via POST /admin/oracle/callers - Strict Stellar contract address validation (56-char C-prefixed strkey, base32 + CRC16-XModem checksum) gates the Add button and shows inline validation errors - Confirmation dialog before removing a caller (DELETE /admin/oracle/callers/:address) - Empty, loading skeleton, and load-error/retry states included - Unit tests for the validator, admin service, and panel
|
@Seunfunmi-319509 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.
Summary
Closes #829
Adds an Oracle Access panel to a new Admin Dashboard (
/admin/dashboard) so admins can manage the external contract addresses permitted to call the AccessLayer price oracle. Previously this list had no admin UI.What's included
src/pages/AdminDashboardPage.tsxregistered at/admin/dashboardinsrc/routes.tsx. (No admin dashboard existed in the client yet, so this PR introduces the page and the Oracle Access section as its first panel.)src/components/admin/OracleAccessPanel.tsx:GET /admin/oracle/callers, each with a Remove button.POST /admin/oracle/callersand refreshes the list.C-prefixed strkey, valid base32 + CRC16-XModem checksum). Invalid input shows inline validation, and duplicates already in the list are rejected.DELETE /admin/oracle/callers/:address).src/services/admin.service.ts(AdminServiceextendingBaseApiService) withgetOracleCallers,addOracleCaller,removeOracleCaller, plus test-friendly wrapper functions.src/hooks/useOracleCallers.ts(useOracleCallers,useAddOracleCaller,useRemoveOracleCaller) with React Query cache invalidation and success/error toasts.src/utils/stellarAddress.utils.tsimplementing proper strkey checksum validation (base32 decode + CRC16-XModem), not just regex length checks.admin.oracleCallersadded tosrc/lib/queryKeys.ts.Acceptance criteria
Testing
pnpm lint— passespnpm build— passes (tsc -b && vite build)New unit tests (33 assertions, all passing):
src/utils/__tests__/stellarAddress.utils.test.ts— valid/invalid/checksum-tampered/lowercase/format cases.src/services/__tests__/admin.service.test.ts— GET normalization, POST/DELETE payloads, error mapping.src/components/admin/__tests__/OracleAccessPanel.test.tsx— listing, empty state, loading, validation gating, add flow, remove-after-confirmation, cancel.Notes / assumptions
GET/POST /admin/oracle/callers. Remove is implemented asDELETE /admin/oracle/callers/:address(RESTful, matches the existing route prefix); the server module isn't inaccesslayer-serveryet, so the client-side contract is documented here for coordination.[{ address }], plain string arrays, or a{ callers: [...] }envelope so it works regardless of the exact server shape.Checklist