Commit d532f55
authored
feat: include token type to response (#172)
### TL;DR
Added `token_type` field to the `HolderModel` struct and included it in the serialization function.
We need it to properly detect token types for NFTs handlers, specifically for further metadata resolutions.
### What changed?
- Added a new `TokenType` field to the `HolderModel` struct with JSON tag `token_type` and ClickHouse tag `token_type`
- Updated the `serializeHolder` function to populate the new `TokenType` field from the `holder.TokenType` value
### How to test?
1. Make a request to an endpoint that returns token holder data
2. Verify that the response now includes the `token_type` field in the JSON output
3. Check that the value matches the expected token type for the given token
### Why make this change?
This change enhances the token holder API response by including the token type information, which allows clients to distinguish between different token standards (e.g., ERC-20, ERC-721, ERC-1155) without having to make additional queries. This provides more complete information about tokens in a single response.1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | | - | |
81 | | - | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| 144 | + | |
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
| |||
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
223 | | - | |
224 | | - | |
| 226 | + | |
| 227 | + | |
225 | 228 | | |
226 | 229 | | |
227 | 230 | | |
| |||
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| 292 | + | |
289 | 293 | | |
290 | 294 | | |
0 commit comments