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
convert decoded big numbers to strings in api response (#193)
### TL;DR
Added support for converting big numbers to strings in decoded transaction and log data.
### What changed?
- Added a new utility function `ConvertBigNumbersToString` that recursively converts `*big.Int` and `big.Int` values to strings
- Updated the `Serialize` method for `DecodedLog` to convert big numbers to strings in both indexed and non-indexed parameters
- Updated the `Serialize` method for `DecodedTransaction` to convert big numbers to strings in decoded inputs
- Removed unused `StripPayload` function and related helper functions
### How to test?
1. Create a transaction or log that contains big numbers in its decoded data
2. Call the `Serialize` method on the decoded transaction or log
3. Verify that the big numbers are properly converted to strings in the output
### Why make this change?
Big numbers in decoded transaction and log data need to be converted to strings to ensure they can be properly serialized to JSON without precision loss. This is especially important for large numbers that exceed the range of standard JSON number types.
0 commit comments