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
### TL;DR
Added event decoding functionality for Ethereum logs, enabling the parsing and interpretation of indexed and non-indexed event parameters.
### What changed?
- Added `ConstructEventABI` function to parse event signatures into ABI format
- Implemented log decoding functionality to handle both indexed and non-indexed event parameters
- Created new `DecodedLog` and `DecodedLogData` structures to represent decoded event data
- Enhanced log handlers to support automatic event decoding when a signature is provided
- Added support for converting various data types (bytes, numerics) to hexadecimal format
### How to test?
1. Make a GET request to `/{chainId}/events/{contract}/{signature}` with a valid event signature
2. Verify that the response includes decoded event data with:
- Event name and signature
- Indexed parameters properly decoded
- Non-indexed parameters converted to appropriate formats
- All byte and numeric values properly converted to hex
### Why make this change?
To improve the readability and usability of event log data by automatically decoding raw event parameters into their proper types and formats. This makes it easier for developers to work with and understand event data without having to manually decode the raw logs.
Copy file name to clipboardExpand all lines: docs/docs.go
+203-9Lines changed: 203 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,7 @@ const docTemplate = `{
77
77
},
78
78
{
79
79
"type": "integer",
80
+
"default": 5,
80
81
"description": "Number of items per page",
81
82
"name": "limit",
82
83
"in": "query"
@@ -200,6 +201,7 @@ const docTemplate = `{
200
201
},
201
202
{
202
203
"type": "integer",
204
+
"default": 5,
203
205
"description": "Number of items per page",
204
206
"name": "limit",
205
207
"in": "query"
@@ -265,7 +267,7 @@ const docTemplate = `{
265
267
"BasicAuth": []
266
268
}
267
269
],
268
-
"description": "Retrieve logs for a specific contract and event signature",
270
+
"description": "Retrieve logs for a specific contract and event signature. When a valid event signature is provided, the response includes decoded log data with both indexed and non-indexed parameters.",
"description": "Retrieve transactions for a specific contract and signature (Not implemented yet)",
642
+
"description": "Retrieve transactions for a specific contract and signature. When a valid function signature is provided, the response includes decoded transaction data with function inputs.",
0 commit comments