Skip to content

feat(dashboard/yield): add audit log list + Freighter wallet integrat… - #669

Merged
ONEONUORA merged 2 commits into
Fracverse:masterfrom
Ceejaytech25:feat/yield-vault-audit-freighter-integration
Jul 28, 2026
Merged

feat(dashboard/yield): add audit log list + Freighter wallet integrat…#669
ONEONUORA merged 2 commits into
Fracverse:masterfrom
Ceejaytech25:feat/yield-vault-audit-freighter-integration

Conversation

@Ceejaytech25

Copy link
Copy Markdown
Contributor

Summary

Implements two related issues on the Yield Vault admin panel in a single branch:


Changes

dashboard/lib/freighter.ts (new file)

A dedicated helper module for @stellar/freighter-api browser wallet workflows:

  • detectFreighter() — detects extension installation, connection status, active public key, and network on mount; SSR-safe (catches import failures gracefully)
  • connectFreighter() — calls requestAccess() and returns updated wallet state
  • signWithFreighter(xdr, networkPassphrase) — wraps signTransaction() and normalises the error surface
  • truncateKey(key, head, tail) — utility to shorten Stellar public keys for display (e.g. GABCD…WXYZ)
  • FreighterWalletState interface + DEFAULT_WALLET_STATE constant for predictable initial UI state

dashboard/app/dashboard/yield/page.tsx (modified)

Freighter Wallet Integration (#597)

  • Auto-detects wallet on mount via detectFreighter(); no manual polling
  • WalletBadge component rendered in the page header showing one of three states:
    • ⚠️ Not installed → inline install prompt + link to freighter.app
    • 🔘 Installed but not connected → status label
    • 🟢 Connected → truncated public key + active network name
  • Wallet Connection Card in the Config tab:
    • Install banner with external install link when extension is absent
    • "Connect Freighter" button triggers connectFreighter() with loading spinner
    • Connected state shows the full public key and network in a green card
  • Admin Address field auto-populated from the connected wallet's public key; "Use connected wallet address" shortcut when they diverge
  • Submit button disabled and labelled "Connect wallet to sign" until a wallet is connected
  • signAndSubmit uses signWithFreighter() from the new helper; clear, user-facing error messages for missing extension and disconnected states

Audit Log List (#598)

  • Summary stats bar (4 cards): Total Events · Total Deposits · Total Withdrawals · Yield Accrued
  • Search input — filters across txHash, address, action, and blockHeight
  • Action dropdown — All / Deposit / Withdraw / Yield Accrual / Config
  • Date-range pickers — From / To with "Clear filters" shortcut when any filter is active
  • Sortable columns — Timestamp, Address, Action, Volume; directional arrow indicators; resets page on sort change
  • Expandable rows — click any row to reveal: full tx hash, full Stellar address, block height, network fee (XLM), and raw UTC timestamp
  • Colour-coded action badges with dot indicators: emerald (deposit), amber (withdraw), indigo (yield_accrual), slate (config)
  • Pagination — 6 records per page; numbered page buttons + Prev / Next controls
  • Timestamps shown in two lines: human date + HH:mm:ss for full precision
  • YieldTx type extended with address, blockHeight, and fee fields; action type updated to include yield_accrual

Files Changed

File Status
dashboard/lib/freighter.ts Added
dashboard/app/dashboard/yield/page.tsx Modified

Acceptance Criteria

Criterion Status
Display transactions with timestamp details and addresses
Support search filtering
Search and filter query integrations (action, date range)
Detect wallet installation
Request transaction signatures on admin actions
Uses @stellar/freighter-api package implementations

Notes

  • Audit data is currently wired to mock fixtures (MOCK_TXS). Replace with a real API call to /admin/vault/audit (or equivalent) once the endpoint is available — the filter/sort/pagination logic is fully data-source agnostic.
  • The signing XDR is a placeholder (btoa(JSON.stringify({...}))) until the backend provides the actual unsigned transaction envelope for set_vault_params.
  • Tested on Testnet passphrase (Test SDF Network ; September 2015); update NETWORK_PASSPHRASE constant for Mainnet.

Closes #597
Closes #598
Closes #596
Closes #594

…ion (Fracverse#597, Fracverse#598)

Issue Fracverse#598 — Detailed ledger audit logs for yield vaults:
- Display all vault events (deposit, withdraw, yield_accrual, config)
  with full timestamp, address, tx hash, block height and network fee
- Summary stats bar: total events, deposit volume, withdrawal volume,
  yield accrued
- Search filtering across tx hash, address, action, and block height
- Action-type dropdown filter (deposit / withdraw / yield_accrual / config)
- Date-range filters (from / to) with clear-all shortcut
- Sortable columns (timestamp, address, action, volume)
- Expandable rows showing full addresses and complete tx hashes
- Paginated results (6 per page) with prev/next + numbered controls

Issue Fracverse#597 — Freighter wallet integration on yield admin panel:
- New dashboard/lib/freighter.ts helper module:
  detectFreighter(), connectFreighter(), signWithFreighter(), truncateKey()
- Auto-detect wallet on mount; display live WalletBadge in page header
- Install prompt + external link when extension is not found
- Connect button triggers requestAccess() and updates wallet state
- Connected address displayed in full, auto-filled into Admin Address field
- Signing flow gated behind wallet connection with clear error messages
- signAndSubmit() uses signWithFreighter() from new helper instead of
  inline dynamic import
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Ceejaytech25 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

@Ceejaytech25

Copy link
Copy Markdown
Contributor Author

@ONEONUORA , pls review PR

@ONEONUORA ONEONUORA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @Ceejaytech25

@ONEONUORA
ONEONUORA merged commit c744074 into Fracverse:master Jul 28, 2026
10 checks 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

2 participants