Description
Build the REST API for querying blockchain transaction history with rich filtering.
This feeds the TransactionHistoryPage component in the web frontend.
Endpoints
GET /api/v1/transactions — List transactions with filters
- Query params:
source_account, destination_account, asset_code,
start_date, end_date, min_amount, max_amount, operation_type,
successful, page, page_size
GET /api/v1/transactions/{hash} — Get single transaction by hash
GET /api/v1/transactions/stats — Aggregated stats (total volume, count by asset, etc.)
Implementation Details
- Use SQLAlchemy filtering with parameterized queries
- Indexes on:
(source_account, timestamp), (destination_account, timestamp), hash
- Response schema matches
BlockchainTransaction / TransactionHistoryResponse in web/src/lib/types.ts
Acceptance Criteria
- All filter parameters work correctly
- Compound filters (e.g., source + date range) are efficient
- Missing optional filters default to no filtering
- Transaction stats return correctly aggregated data
Labels
enhancement, api
Description
Build the REST API for querying blockchain transaction history with rich filtering.
This feeds the
TransactionHistoryPagecomponent in the web frontend.Endpoints
GET /api/v1/transactions— List transactions with filterssource_account,destination_account,asset_code,start_date,end_date,min_amount,max_amount,operation_type,successful,page,page_sizeGET /api/v1/transactions/{hash}— Get single transaction by hashGET /api/v1/transactions/stats— Aggregated stats (total volume, count by asset, etc.)Implementation Details
(source_account, timestamp),(destination_account, timestamp),hashBlockchainTransaction/TransactionHistoryResponseinweb/src/lib/types.tsAcceptance Criteria
Labels
enhancement,api