You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor API handlers and implement storage queries (#43)
# API Enhancements and Storage Integration
## Changes
- Renamed `Aggregate` to `Aggregates` in `QueryParams` struct
- Updated route handler names for better clarity:
- `GetTransactionsWithContract` to `GetTransactionsByContract`
- `GetEventsWithContract` to `GetLogsByContract`
- `GetTransactionsWithContractAndSignature` to `GetTransactionsByContractAndSignature`
- `GetEventsWithContractAndSignature` to `GetLogsByContractAndSignature`
- Implemented `handleLogsRequest` and `handleTransactionsRequest` functions to centralize logic
- Integrated storage layer with API handlers:
- Added `getMainStorage` function to create storage connector
- Updated `GetLogs` and `GetTransactions` methods to use storage queries
- Enhanced `QueryFilter` struct with additional fields for filtering and aggregation
- Modified `ClickHouseConnector` methods to remove block number filtering and prepare for more flexible querying
- Renamed `newConnector` to `NewConnector` and made it public
## TODO
- Implement total items count and total pages count in API responses
- Add aggregations, filters, and grouping to log queries in ClickHouse connector
0 commit comments