Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
298 lines (298 loc) · 9.74 KB
/
Copy pathopenapi.yaml
File metadata and controls
298 lines (298 loc) · 9.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
openapi: 3.0.3
info:
title: Assay API
version: 1.0.0
description: Stellar asset trap scanner API contract.
paths:
/api/v1/scan:
get:
summary: Scan an asset
parameters:
- name: asset
in: query
required: true
schema:
type: string
description: Asset code and issuer (e.g. USDC-GA5Z...)
- name: holder
in: query
required: false
schema:
type: string
description: Optional holder address to check trustline / balance state
responses:
'200':
description: Successful scan report. May indicate degraded state via header.
headers:
X-Assay-Undetermined:
schema:
type: string
enum: ["true"]
description: Present and set to "true" if the scan was degraded by a source outage.
content:
application/json:
schema:
type: object
properties:
severity:
type: string
accountability:
type: string
undetermined:
type: boolean
undetermined_checks:
type: array
items:
type: string
findings:
type: array
items:
type: object
'400':
description: >-
Invalid request parameters, or an asset identifier naming the
network's native asset (native/XLM), which has no issuer and no
authorization flags and is therefore never scanned or attested.
'404':
description: Asset not found on the ledger.
'502':
description: Upstream scan failure.
/api/v1/history:
get:
summary: Read an asset's recorded observations and derived transitions
description: >-
Reads what GET /api/v1/scan recorded; it never scans. An asset with no
observations is a successful empty result with state "missing", never
a 404.
parameters:
- name: asset
in: query
required: true
schema:
type: string
description: Asset code and issuer (e.g. USDC-GA5Z...)
responses:
'200':
description: History in time order, oldest first.
content:
application/json:
schema:
type: object
required: [asset, state, count, observations, transitions, retention]
properties:
asset:
type: object
properties:
code:
type: string
issuer:
type: string
state:
type: string
enum: [valid, unknown, missing]
reason:
type: string
description: Present when state is not valid.
count:
type: integer
observations:
type: array
items:
type: object
transitions:
type: array
items:
type: object
latest_at:
type: string
format: date-time
latest_age_secs:
type: integer
retention:
type: integer
'400':
description: Missing or invalid asset, or the network's native asset.
/api/v1/exposure:
get:
summary: List trustlines held by an account with per-asset severity and trustline finding
description: >-
Bounded and paginated: one request runs up to `limit` full scans
(default 10, maximum 50). Results are per asset; there is no
aggregate portfolio score. Each asset carries its own undetermined
flag and undetermined_checks.
parameters:
- name: account
in: query
required: true
schema:
type: string
description: Holder's account address (G...)
- name: limit
in: query
required: false
schema:
type: integer
default: 10
maximum: 50
minimum: 1
description: Page size; values above the maximum are clamped to it.
- name: cursor
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
description: Index of the first trustline to return for the next page.
responses:
'200':
description: One page of per-asset exposure results.
content:
application/json:
schema:
type: object
required: [account, total, limit, count, assets]
properties:
account:
type: string
total:
type: integer
description: Credit trustlines on the account (whole listing, not this page).
limit:
type: integer
description: Page size actually applied.
count:
type: integer
next_cursor:
type: integer
description: Cursor for the next page; absent on the last page.
assets:
type: array
items:
type: object
properties:
asset:
type: object
properties:
code:
type: string
issuer:
type: string
severity:
type: string
enum: [clear, low, medium, high, critical, unevaluated]
undetermined:
type: boolean
undetermined_checks:
type: array
items:
type: string
finding:
type: object
description: Holder-trustline finding; absent when that asset's scan failed.
reason:
type: string
description: Why this asset's scan failed; present only when finding is absent.
'400':
description: Missing or invalid account, limit, or cursor.
'404':
description: Account not found on the ledger.
'429':
description: Rate limited. Retry-After header gives seconds to wait.
'502':
description: The account's trustline list could not be fetched.
/metrics:
get:
summary: Scan outcome and per-source failure counters
description: Counters accumulated since process start.
responses:
'200':
description: A snapshot of the counters.
content:
application/json:
schema:
type: object
properties:
scan_outcomes:
type: object
additionalProperties:
type: integer
source_failures:
type: object
additionalProperties:
type: integer
/healthz:
get:
summary: Liveness check
description: Reports only that the process is up; it checks no upstream.
responses:
'200':
description: The process is running.
content:
text/plain:
schema:
type: string
example: ok
/readyz:
get:
summary: Per-upstream readiness check
description: >-
The HTTP status tracks the body's status: 200 ready; 503 degraded,
unavailable, or unknown. No failing probe reports ready.
responses:
'200':
description: Every checkable upstream is reachable.
content:
application/json:
schema:
$ref: '#/components/schemas/Readiness'
'503':
description: Degraded, unavailable, or unknown; see status and upstreams.
content:
application/json:
schema:
$ref: '#/components/schemas/Readiness'
/:
get:
summary: Serve the single-file UI
responses:
'200':
description: The embedded HTML page.
content:
text/html:
schema:
type: string
components:
schemas:
Readiness:
type: object
required: [status, checked_at, age_secs, upstreams]
properties:
status:
type: string
enum: [ready, degraded, unavailable, unknown]
reason:
type: string
description: Present when status is not ready.
checked_at:
type: string
format: date-time
age_secs:
type: integer
upstreams:
type: array
items:
type: object
required: [name, kind, reachable, probe_url]
properties:
name:
type: string
kind:
type: string
enum: [horizon, consumed]
reachable:
type: boolean
probe_error:
type: string
probe_url:
type: string