Skip to content

feat: add wallet activity feed endpoint (#424)#438

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Nanle-code:feat/wallet-activity-feed-424
Jun 23, 2026
Merged

feat: add wallet activity feed endpoint (#424)#438
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
Nanle-code:feat/wallet-activity-feed-424

Conversation

@Nanle-code

Copy link
Copy Markdown
Contributor

Closes #424

Acceptance Criteria ✅ All Met

  1. Returns all buy and sell events for the wallet in reverse chronological order

    • ✅ Service filters for KEY_BOUGHT and KEY_SOLD activity types
    • ✅ Ordered by createdAt: 'desc' (most recent first)
  2. Each event includes the price and fee at the time of the trade

    • ✅ Response includes price_at_trade, fee_paid, and ledger_sequence from stored payload
    • ✅ Not current price - historical data from indexed events
  3. type=buy or type=sell filter returns only matching events

    • ✅ Query param type mapped to internal ActivityType enum
    • ✅ Service filters accordingly when provided
  4. creator_id filter returns only trades for that creator

    • ✅ Query param creator_id added to where clause
    • ✅ Filters by creatorId when provided
  5. Returns empty array (not 404) for a valid wallet with no activity

    • ✅ Service returns [[], 0] when no rows found
    • ✅ Controller returns 200 with empty items array
    • ✅ Test verifies this behavior
  6. Returns 400 for a malformed Stellar address

    • ✅ Uses StellarAddressSchema for validation
    • ✅ Returns 400 with validation error on invalid format
    • ✅ Test covers malformed address case
  7. Pagination works correctly across large trade histories

    • ✅ Uses offset/limit pagination with Prisma
    • ✅ Returns proper metadata (limit, offset, total, hasMore)
    • ✅ Tests verify pagination behavior
  8. Integration test covers: mixed history, type filter, creator filter, empty wallet

    • ✅ All 13 integration tests passing
    • ✅ Covers mixed history, type filters, creator filter, empty wallet, malformed address, pagination, and error handling

- Add GET /wallets/:address/activity endpoint for full trade history
- Returns paginated list of trade events with type, creator info, amount, price, fee, ledger sequence, and timestamp
- Supports type filter (buy|sell) and creator_id filter
- Default sort is most recent first (reverse chronological)
- Returns 400 for malformed Stellar addresses
- Returns empty array (not 404) for wallets with no activity
- Includes comprehensive integration tests covering all acceptance criteria
- Route registered at /api/v1/wallets/:address/activity
- Updated API inventory documentation
@Chucks1093 Chucks1093 merged commit cca30ac into accesslayerorg:main Jun 23, 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 wallet activity feed endpoint for full trade history across all creators

2 participants