Skip to content

feat(activity): add CSV and JSON exports#140

Open
Hallab7 wants to merge 1 commit into
wraith-protocol:developfrom
Hallab7:feat/activity-export-csv-json
Open

feat(activity): add CSV and JSON exports#140
Hallab7 wants to merge 1 commit into
wraith-protocol:developfrom
Hallab7:feat/activity-export-csv-json

Conversation

@Hallab7

@Hallab7 Hallab7 commented Jul 26, 2026

Copy link
Copy Markdown

Activity export (CSV / JSON)

Summary

Adds client-side CSV and JSON exports for Stellar activity.

Exports use the exact wallet, type, and status-filtered entries currently shown
on the Activity page. This gives users a spreadsheet-friendly format for
accounting and a schema-backed JSON format for programmatic replay.

What changed

  • Added a new /activity page and navigation entry
  • Added CSV and JSON export controls
  • Export buttons operate on the current filtered view only
  • Added RFC 4180-compatible CSV serialization
  • Added a UTF-8 BOM to CSV downloads for reliable non-ASCII text handling in
    desktop Excel
  • Added CSV formula-injection protection for memo values beginning with:
    • =
    • +
    • -
    • @
  • Added src/schema/activity.json using JSON Schema draft 2020-12
  • Added strict schema-validation and CSV-safety unit tests

CSV format

The CSV export contains these columns:

timestamp,id,chain,wallet,kind,direction,status,amount,token,recipient,memo

Compatibility details:

  • Uses CRLF line endings
  • Quotes fields containing commas, quotes, or line breaks
  • Escapes embedded quotes according to RFC 4180
  • Downloads as UTF-8 with a BOM
  • Defaults Stellar token labels to XLM when an activity entry does not include
    an explicit token
  • Prefixes dangerous memo values with an apostrophe so spreadsheet applications
    treat them as text rather than formulas

JSON format

JSON exports preserve the filtered ActivityEntry[] data without transforming
timestamps or metadata, making the output suitable for replay and programmatic
processing.

The shipped schema validates:

  • Required activity identifiers and timestamps
  • Supported activity kinds
  • Direction and status enums
  • Optional amount, token, recipient, and metadata fields
  • Rejection of undeclared top-level activity properties

User flow

  1. Connect a Stellar wallet
  2. Open Activity
  3. Select optional type and status filters
  4. Choose Export CSV or Export JSON
  5. Receive a dated file containing only the displayed filtered entries

Export controls are disabled when the filtered view is empty.

Verification

  • CSV-injection coverage for =, +, -, and @ memo prefixes
  • CSV commas, quotes, and line breaks are escaped correctly
  • JSON output validates against src/schema/activity.json with strict Ajv
  • Exporter tests pass: 6/6
  • TypeScript check passes
  • Production Vite build passes
  • Prettier and git diff --check pass
  • /activity and its compiled module are served successfully by the Vite
    dev server

Scope

The feature is entirely client-side. It adds no backend, API keys, network
requests, or server-side storage.

closes #100

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@Hallab7 is attempting to deploy a commit to the truthixify's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

@truthixify

Copy link
Copy Markdown
Contributor

Conflicts against develop from the recent batch. Rebase all three of your open demo PRs (140/141/142) together, force-push each.

@Hallab7
Hallab7 force-pushed the feat/activity-export-csv-json branch from 3840dc9 to 497ab88 Compare July 26, 2026 13:53
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.

Activity export (CSV / JSON)

2 participants