Skip to content

feat: combined activity endpoint GET /transfers/address/:address #1

@Miracle656

Description

@Miracle656

Problem

The wallet (and any client) currently needs to make two separate requests — /transfers/incoming/:address and /transfers/outgoing/:address — then merge and sort the results client-side. This doubles the request count and pushes sorting logic onto every consumer.

Proposed solution

Add a new endpoint:

GET /transfers/address/:address

Returns both incoming and outgoing transfers in a single response, sorted by ledger descending.

Response shape:

{
  "total": 42,
  "limit": 50,
  "offset": 0,
  "transfers": [
    {
      "id": 1,
      "eventType": "transfer",
      "direction": "incoming",
      "fromAddress": "G...",
      "toAddress": "C...",
      "amount": "100000000",
      "ledger": 1794688,
      "ledgerClosedAt": "2025-01-01T00:00:00Z",
      "txHash": "abc123",
      "contractId": "C..."
    }
  ]
}

A direction field ("incoming" | "outgoing") should be added to each record so clients can still distinguish direction.

Supports all existing query params: contractId, fromLedger, toLedger, limit, offset.

Acceptance criteria

  • GET /transfers/address/:address returns merged results sorted by ledger desc
  • Each record includes a direction field
  • Existing /incoming and /outgoing endpoints unchanged
  • Pagination works correctly across the merged set

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions