Skip to content

Commit 992621d

Browse files
Add warnings field to token-info, collectibles, and defi-positions endpoints (#145)
Extends the unsupported chain ID warnings (introduced in #136 for balances) to the remaining EVM endpoints. When users request data for unsupported chain IDs, the API now returns a warnings array with: - code: UNSUPPORTED_CHAIN_IDS - message: Human-readable description - chain_ids: List of unsupported chain IDs - docs_url: Link to supported chains documentation This provides consistent behavior across all EVM endpoints.
1 parent c84c95a commit 992621d

3 files changed

Lines changed: 117 additions & 0 deletions

File tree

evm/openapi/collectibles.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,38 @@
182182
"is_spam"
183183
]
184184
},
185+
"Warning": {
186+
"type": "object",
187+
"required": [
188+
"code",
189+
"message"
190+
],
191+
"properties": {
192+
"code": {
193+
"type": "string",
194+
"description": "Warning code identifier",
195+
"example": "UNSUPPORTED_CHAIN_IDS"
196+
},
197+
"message": {
198+
"type": "string",
199+
"description": "Human-readable warning message",
200+
"example": "Some chain_ids are not supported."
201+
},
202+
"chain_ids": {
203+
"type": "array",
204+
"items": {
205+
"type": "integer",
206+
"format": "int64"
207+
},
208+
"description": "List of chain IDs that triggered this warning (for chain-related warnings)"
209+
},
210+
"docs_url": {
211+
"type": "string",
212+
"description": "URL to documentation with more information about the warning",
213+
"example": "https://docs.sim.dune.com/evm/supported-chains"
214+
}
215+
}
216+
},
185217
"CollectiblesResponse": {
186218
"type": "object",
187219
"properties": {
@@ -197,6 +229,13 @@
197229
},
198230
"description": "A list of collectible entries."
199231
},
232+
"warnings": {
233+
"type": "array",
234+
"items": {
235+
"$ref": "#/components/schemas/Warning"
236+
},
237+
"description": "Array of warnings that occurred during request processing. Warnings indicate non-fatal issues (e.g., unsupported chain IDs) where the request can still be partially fulfilled."
238+
},
200239
"next_offset": {
201240
"type": "string",
202241
"description": "Use this value as the `offset` in your next request to continue pagination. Not included when there are no more entries."

evm/openapi/defi-positions.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,38 @@
11031103
}
11041104
}
11051105
},
1106+
"Warning": {
1107+
"type": "object",
1108+
"required": [
1109+
"code",
1110+
"message"
1111+
],
1112+
"properties": {
1113+
"code": {
1114+
"type": "string",
1115+
"description": "Warning code identifier",
1116+
"example": "UNSUPPORTED_CHAIN_IDS"
1117+
},
1118+
"message": {
1119+
"type": "string",
1120+
"description": "Human-readable warning message",
1121+
"example": "Some chain_ids are not supported."
1122+
},
1123+
"chain_ids": {
1124+
"type": "array",
1125+
"items": {
1126+
"type": "integer",
1127+
"format": "int64"
1128+
},
1129+
"description": "List of chain IDs that triggered this warning (for chain-related warnings)"
1130+
},
1131+
"docs_url": {
1132+
"type": "string",
1133+
"description": "URL to documentation with more information about the warning",
1134+
"example": "https://docs.sim.dune.com/evm/supported-chains"
1135+
}
1136+
}
1137+
},
11061138
"DefiPositionsResponse": {
11071139
"type": "object",
11081140
"required": ["positions"],
@@ -1119,6 +1151,13 @@
11191151
"$ref": "#/components/schemas/DefiAggregations"
11201152
}
11211153
]
1154+
},
1155+
"warnings": {
1156+
"type": "array",
1157+
"items": {
1158+
"$ref": "#/components/schemas/Warning"
1159+
},
1160+
"description": "Array of warnings that occurred during request processing. Warnings indicate non-fatal issues (e.g., unsupported chain IDs) where the request can still be partially fulfilled."
11221161
}
11231162
}
11241163
}

evm/openapi/token-info.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,38 @@
200200
}
201201
}
202202
},
203+
"Warning": {
204+
"type": "object",
205+
"required": [
206+
"code",
207+
"message"
208+
],
209+
"properties": {
210+
"code": {
211+
"type": "string",
212+
"description": "Warning code identifier",
213+
"example": "UNSUPPORTED_CHAIN_IDS"
214+
},
215+
"message": {
216+
"type": "string",
217+
"description": "Human-readable warning message",
218+
"example": "Some chain_ids are not supported."
219+
},
220+
"chain_ids": {
221+
"type": "array",
222+
"items": {
223+
"type": "integer",
224+
"format": "int64"
225+
},
226+
"description": "List of chain IDs that triggered this warning (for chain-related warnings)"
227+
},
228+
"docs_url": {
229+
"type": "string",
230+
"description": "URL to documentation with more information about the warning",
231+
"example": "https://docs.sim.dune.com/evm/supported-chains"
232+
}
233+
}
234+
},
203235
"TokensResponse": {
204236
"type": "object",
205237
"required": [
@@ -218,6 +250,13 @@
218250
},
219251
"description": "Array of token information across different chains"
220252
},
253+
"warnings": {
254+
"type": "array",
255+
"items": {
256+
"$ref": "#/components/schemas/Warning"
257+
},
258+
"description": "Array of warnings that occurred during request processing. Warnings indicate non-fatal issues (e.g., unsupported chain IDs) where the request can still be partially fulfilled."
259+
},
221260
"next_offset": {
222261
"type": "string",
223262
"description": "Pagination cursor for the next page of results"

0 commit comments

Comments
 (0)