Skip to content

feat(admin): add price oracle approved callers panel (#829) - #841

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Seunfunmi-319509:feat/829-oracle-admin-callers
Aug 29, 2026
Merged

feat(admin): add price oracle approved callers panel (#829)#841
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Seunfunmi-319509:feat/829-oracle-admin-callers

Conversation

@Seunfunmi-319509

Copy link
Copy Markdown
Contributor

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

  • New Admin Dashboard routesrc/pages/AdminDashboardPage.tsx registered at /admin/dashboard in src/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.)
  • Oracle Access panelsrc/components/admin/OracleAccessPanel.tsx:
    • Lists approved callers fetched from GET /admin/oracle/callers, each with a Remove button.
    • Add input + Add button that submits via POST /admin/oracle/callers and refreshes the list.
    • Validation: the Add button stays disabled until the input is a valid Stellar contract address (56-char C-prefixed strkey, valid base32 + CRC16-XModem checksum). Invalid input shows inline validation, and duplicates already in the list are rejected.
    • Confirmation dialog before removing a caller (DELETE /admin/oracle/callers/:address).
    • Empty state when no callers are approved, loading skeleton, and load-error/retry state.
  • API layersrc/services/admin.service.ts (AdminService extending BaseApiService) with getOracleCallers, addOracleCaller, removeOracleCaller, plus test-friendly wrapper functions.
  • Hookssrc/hooks/useOracleCallers.ts (useOracleCallers, useAddOracleCaller, useRemoveOracleCaller) with React Query cache invalidation and success/error toasts.
  • Validation utilsrc/utils/stellarAddress.utils.ts implementing proper strkey checksum validation (base32 decode + CRC16-XModem), not just regex length checks.
  • Query keyadmin.oracleCallers added to src/lib/queryKeys.ts.

Acceptance criteria

  • Approved callers listed with Remove button per entry
  • Invalid contract address shows validation error (gated Add button + inline error)
  • Add button submits the new caller and updates the list (invalidates the query)
  • Remove button removes the caller after confirmation
  • Empty state shown when no callers are approved

Testing

  • pnpm lint — passes
  • pnpm 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

  • The issue specifies only GET/POST /admin/oracle/callers. Remove is implemented as DELETE /admin/oracle/callers/:address (RESTful, matches the existing route prefix); the server module isn't in accesslayer-server yet, so the client-side contract is documented here for coordination.
  • The read endpoint is intentionally lenient: it accepts [{ address }], plain string arrays, or a { callers: [...] } envelope so it works regardless of the exact server shape.

Checklist

)

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
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit 07ef7df into accesslayerorg:dev Aug 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a price oracle approved callers panel on the admin dashboard to manage external contract integrations

2 participants