@@ -13,35 +13,63 @@ import (
1313 "github.com/rs/zerolog/log"
1414)
1515
16+ // Error represents an API error response
17+ // @Description Error represents an API error response
1618type Error struct {
17- Code int `json:"code"`
18- Message string `json:"message"`
19+ // @Description HTTP status code
20+ Code int `json:"code"`
21+ // @Description Error message
22+ Message string `json:"message"`
23+ // @Description Support ID for tracking the error
1924 SupportId string `json:"support_id"`
2025}
2126
27+ // QueryParams represents the parameters for querying data
28+ // @Description QueryParams represents the parameters for querying data
2229type QueryParams struct {
30+ // @Description Map of filter parameters
2331 FilterParams map [string ]string `schema:"-"`
24- GroupBy string `schema:"group_by"`
25- SortBy string `schema:"sort_by"`
26- SortOrder string `schema:"sort_order"`
27- Page int `schema:"page"`
28- Limit int `schema:"limit"`
29- Aggregates []string `schema:"aggregate"`
32+ // @Description Field to group results by
33+ GroupBy string `schema:"group_by"`
34+ // @Description Field to sort results by
35+ SortBy string `schema:"sort_by"`
36+ // @Description Sort order (asc or desc)
37+ SortOrder string `schema:"sort_order"`
38+ // @Description Page number for pagination
39+ Page int `schema:"page"`
40+ // @Description Number of items per page
41+ Limit int `schema:"limit"`
42+ // @Description List of aggregate functions to apply
43+ Aggregates []string `schema:"aggregate"`
3044}
3145
46+ // Meta represents metadata for a query response
47+ // @Description Meta represents metadata for a query response
3248type Meta struct {
33- ChainId uint64 `json:"chain_id"`
49+ // @Description Chain ID of the blockchain
50+ ChainId uint64 `json:"chain_id"`
51+ // @Description Contract address
3452 ContractAddress string `json:"address"`
35- Signature string `json:"signature"`
36- Page int `json:"page"`
37- Limit int `json:"limit"`
38- TotalItems int `json:"total_items"`
39- TotalPages int `json:"total_pages"`
53+ // @Description Function or event signature
54+ Signature string `json:"signature"`
55+ // @Description Current page number
56+ Page int `json:"page"`
57+ // @Description Number of items per page
58+ Limit int `json:"limit"`
59+ // @Description Total number of items
60+ TotalItems int `json:"total_items"`
61+ // @Description Total number of pages
62+ TotalPages int `json:"total_pages"`
4063}
4164
65+ // QueryResponse represents the response structure for a query
66+ // @Description QueryResponse represents the response structure for a query
4267type QueryResponse struct {
43- Meta Meta `json:"meta"`
44- Data interface {} `json:"data,omitempty"`
68+ // @Description Metadata for the query response
69+ Meta Meta `json:"meta"`
70+ // @Description Query result data
71+ Data interface {} `json:"data,omitempty"`
72+ // @Description Aggregation results
4573 Aggregations map [string ]string `json:"aggregations,omitempty"`
4674}
4775
0 commit comments