@polygonlabs/staker-pool-allocations-schemas 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/MIGRATION.md +5 -0
  2. package/dist/allocation-history.d.ts +30 -0
  3. package/dist/allocation-history.d.ts.map +1 -0
  4. package/dist/allocation-history.js +29 -0
  5. package/dist/allocation-history.js.map +1 -0
  6. package/dist/allocation.d.ts +31 -0
  7. package/dist/allocation.d.ts.map +1 -0
  8. package/dist/allocation.js +40 -0
  9. package/dist/allocation.js.map +1 -0
  10. package/dist/codegen.d.ts +6 -0
  11. package/dist/codegen.d.ts.map +1 -0
  12. package/dist/codegen.js +32 -0
  13. package/dist/codegen.js.map +1 -0
  14. package/dist/common.d.ts +19 -0
  15. package/dist/common.d.ts.map +1 -0
  16. package/dist/common.js +63 -0
  17. package/dist/common.js.map +1 -0
  18. package/dist/distribution.d.ts +60 -0
  19. package/dist/distribution.d.ts.map +1 -0
  20. package/dist/distribution.js +43 -0
  21. package/dist/distribution.js.map +1 -0
  22. package/dist/error.d.ts +10 -0
  23. package/dist/error.d.ts.map +1 -0
  24. package/dist/error.js +15 -0
  25. package/dist/error.js.map +1 -0
  26. package/dist/index.d.ts +13 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +17 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/management.d.ts +80 -0
  31. package/dist/management.d.ts.map +1 -0
  32. package/dist/management.js +126 -0
  33. package/dist/management.js.map +1 -0
  34. package/dist/proof.d.ts +10 -0
  35. package/dist/proof.d.ts.map +1 -0
  36. package/dist/proof.js +25 -0
  37. package/dist/proof.js.map +1 -0
  38. package/dist/registry-management.d.ts +525 -0
  39. package/dist/registry-management.d.ts.map +1 -0
  40. package/dist/registry-management.js +33 -0
  41. package/dist/registry-management.js.map +1 -0
  42. package/dist/registry-public.d.ts +1323 -0
  43. package/dist/registry-public.d.ts.map +1 -0
  44. package/dist/registry-public.js +31 -0
  45. package/dist/registry-public.js.map +1 -0
  46. package/dist/routes-management/distributions.d.ts +137 -0
  47. package/dist/routes-management/distributions.d.ts.map +1 -0
  48. package/dist/routes-management/distributions.js +72 -0
  49. package/dist/routes-management/distributions.js.map +1 -0
  50. package/dist/routes-management/excluded-addresses.d.ts +132 -0
  51. package/dist/routes-management/excluded-addresses.d.ts.map +1 -0
  52. package/dist/routes-management/excluded-addresses.js +84 -0
  53. package/dist/routes-management/excluded-addresses.js.map +1 -0
  54. package/dist/routes-management/operational.d.ts +48 -0
  55. package/dist/routes-management/operational.d.ts.map +1 -0
  56. package/dist/routes-management/operational.js +47 -0
  57. package/dist/routes-management/operational.js.map +1 -0
  58. package/dist/routes-public/addresses.d.ts +79 -0
  59. package/dist/routes-public/addresses.d.ts.map +1 -0
  60. package/dist/routes-public/addresses.js +45 -0
  61. package/dist/routes-public/addresses.js.map +1 -0
  62. package/dist/routes-public/allocations.d.ts +155 -0
  63. package/dist/routes-public/allocations.d.ts.map +1 -0
  64. package/dist/routes-public/allocations.js +81 -0
  65. package/dist/routes-public/allocations.js.map +1 -0
  66. package/dist/routes-public/distributions.d.ts +123 -0
  67. package/dist/routes-public/distributions.d.ts.map +1 -0
  68. package/dist/routes-public/distributions.js +55 -0
  69. package/dist/routes-public/distributions.js.map +1 -0
  70. package/dist/routes-public/operational.d.ts +46 -0
  71. package/dist/routes-public/operational.d.ts.map +1 -0
  72. package/dist/routes-public/operational.js +36 -0
  73. package/dist/routes-public/operational.js.map +1 -0
  74. package/dist/routes-public/proofs.d.ts +50 -0
  75. package/dist/routes-public/proofs.d.ts.map +1 -0
  76. package/dist/routes-public/proofs.js +34 -0
  77. package/dist/routes-public/proofs.js.map +1 -0
  78. package/dist/routes-public/wire.d.ts +60 -0
  79. package/dist/routes-public/wire.d.ts.map +1 -0
  80. package/dist/routes-public/wire.js +62 -0
  81. package/dist/routes-public/wire.js.map +1 -0
  82. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  83. package/dist/unclaimed-proofs.d.ts +20 -0
  84. package/dist/unclaimed-proofs.d.ts.map +1 -0
  85. package/dist/unclaimed-proofs.js +22 -0
  86. package/dist/unclaimed-proofs.js.map +1 -0
  87. package/dist/zod.d.ts +3 -0
  88. package/dist/zod.d.ts.map +1 -0
  89. package/dist/zod.js +8 -0
  90. package/dist/zod.js.map +1 -0
  91. package/openapi.json +1215 -0
  92. package/package.json +49 -0
  93. package/src/allocation-history.ts +35 -0
  94. package/src/allocation.ts +51 -0
  95. package/src/codegen.ts +50 -0
  96. package/src/common.ts +76 -0
  97. package/src/distribution.ts +52 -0
  98. package/src/error.ts +17 -0
  99. package/src/index.ts +16 -0
  100. package/src/management.ts +158 -0
  101. package/src/proof.ts +27 -0
  102. package/src/registry-management.ts +36 -0
  103. package/src/registry-public.ts +33 -0
  104. package/src/routes-management/distributions.ts +87 -0
  105. package/src/routes-management/excluded-addresses.ts +103 -0
  106. package/src/routes-management/operational.ts +60 -0
  107. package/src/routes-public/addresses.ts +58 -0
  108. package/src/routes-public/allocations.ts +104 -0
  109. package/src/routes-public/distributions.ts +69 -0
  110. package/src/routes-public/operational.ts +55 -0
  111. package/src/routes-public/proofs.ts +46 -0
  112. package/src/routes-public/wire.ts +74 -0
  113. package/src/unclaimed-proofs.ts +27 -0
  114. package/src/zod.ts +9 -0
package/openapi.json ADDED
@@ -0,0 +1,1215 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "staker-pool-allocations",
5
+ "version": "0.0.0",
6
+ "description": "Public REST API for the PIP-85 staker fee pool monthly merkle distributions. Read-only: distribution metadata, per-address allocations, claim history, and on-demand merkle proofs."
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "/"
11
+ }
12
+ ],
13
+ "components": {
14
+ "schemas": {
15
+ "OperationalStatus": {
16
+ "type": "object",
17
+ "properties": {
18
+ "status": {
19
+ "type": "string",
20
+ "enum": [
21
+ "ok"
22
+ ]
23
+ }
24
+ },
25
+ "required": [
26
+ "status"
27
+ ]
28
+ },
29
+ "ErrorResponse": {
30
+ "type": "object",
31
+ "properties": {
32
+ "error": {
33
+ "type": "boolean",
34
+ "enum": [
35
+ true
36
+ ]
37
+ },
38
+ "message": {
39
+ "type": "string"
40
+ },
41
+ "info": {
42
+ "type": "object",
43
+ "additionalProperties": {
44
+ "nullable": true
45
+ }
46
+ }
47
+ },
48
+ "required": [
49
+ "error",
50
+ "message"
51
+ ],
52
+ "description": "Standard error response shape from `@polygonlabs/express`'s `createErrorHandler`. `info` is present when the underlying `HTTPError` carries structured info (e.g. validation failures, domain-specific context); absent for plain errors and most non-validation HTTPErrors."
53
+ },
54
+ "DistributionListResponse": {
55
+ "type": "object",
56
+ "properties": {
57
+ "items": {
58
+ "type": "array",
59
+ "items": {
60
+ "$ref": "#/components/schemas/DistributionSummary"
61
+ }
62
+ },
63
+ "nextCursor": {
64
+ "type": "string",
65
+ "nullable": true
66
+ }
67
+ },
68
+ "required": [
69
+ "items",
70
+ "nextCursor"
71
+ ]
72
+ },
73
+ "DistributionSummary": {
74
+ "type": "object",
75
+ "properties": {
76
+ "distributionId": {
77
+ "type": "string",
78
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
79
+ "example": "2026-04"
80
+ },
81
+ "status": {
82
+ "type": "string",
83
+ "enum": [
84
+ "pending",
85
+ "running",
86
+ "completed",
87
+ "failed"
88
+ ],
89
+ "example": "completed"
90
+ },
91
+ "startPoSBlock": {
92
+ "type": "string",
93
+ "pattern": "^[0-9]+$",
94
+ "example": "1234567890000000000"
95
+ },
96
+ "endPoSBlock": {
97
+ "type": "string",
98
+ "pattern": "^[0-9]+$",
99
+ "example": "1234567890000000000"
100
+ },
101
+ "merkleRoot": {
102
+ "type": "string",
103
+ "nullable": true,
104
+ "pattern": "^0x[0-9a-fA-F]{64}$",
105
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
106
+ },
107
+ "totalAllocated": {
108
+ "type": "string",
109
+ "nullable": true,
110
+ "pattern": "^[0-9]+$",
111
+ "example": "1234567890000000000"
112
+ },
113
+ "completedAt": {
114
+ "type": "string",
115
+ "nullable": true,
116
+ "format": "date-time"
117
+ }
118
+ },
119
+ "required": [
120
+ "distributionId",
121
+ "status",
122
+ "startPoSBlock",
123
+ "endPoSBlock",
124
+ "merkleRoot",
125
+ "totalAllocated",
126
+ "completedAt"
127
+ ]
128
+ },
129
+ "DistributionDetail": {
130
+ "allOf": [
131
+ {
132
+ "$ref": "#/components/schemas/DistributionSummary"
133
+ },
134
+ {
135
+ "type": "object",
136
+ "properties": {
137
+ "checkpointCount": {
138
+ "type": "integer",
139
+ "minimum": 0
140
+ },
141
+ "polUsdPrice": {
142
+ "type": "string",
143
+ "nullable": true,
144
+ "pattern": "^[0-9]+(\\.[0-9]{1,6})?$",
145
+ "example": "0.423100"
146
+ },
147
+ "maxClaimableUsdThreshold": {
148
+ "type": "string",
149
+ "nullable": true,
150
+ "pattern": "^[0-9]+(\\.[0-9]{1,6})?$",
151
+ "example": "0.423100"
152
+ },
153
+ "inputsHash": {
154
+ "type": "string",
155
+ "nullable": true,
156
+ "pattern": "^0x[0-9a-fA-F]{64}$",
157
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
158
+ },
159
+ "posStakingSubgraphBlock": {
160
+ "type": "string",
161
+ "nullable": true,
162
+ "pattern": "^[0-9]+$",
163
+ "example": "1234567890000000000"
164
+ },
165
+ "posStakingSubgraphHash": {
166
+ "type": "string",
167
+ "nullable": true,
168
+ "pattern": "^0x[0-9a-fA-F]{64}$",
169
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
170
+ },
171
+ "posCheckpointsSubgraphBlock": {
172
+ "type": "string",
173
+ "nullable": true,
174
+ "pattern": "^[0-9]+$",
175
+ "example": "1234567890000000000"
176
+ },
177
+ "posCheckpointsSubgraphHash": {
178
+ "type": "string",
179
+ "nullable": true,
180
+ "pattern": "^0x[0-9a-fA-F]{64}$",
181
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
182
+ },
183
+ "posPriorityFeesSubgraphBlock": {
184
+ "type": "string",
185
+ "nullable": true,
186
+ "pattern": "^[0-9]+$",
187
+ "example": "1234567890000000000"
188
+ },
189
+ "posPriorityFeesSubgraphHash": {
190
+ "type": "string",
191
+ "nullable": true,
192
+ "pattern": "^0x[0-9a-fA-F]{64}$",
193
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
194
+ }
195
+ },
196
+ "required": [
197
+ "checkpointCount",
198
+ "polUsdPrice",
199
+ "maxClaimableUsdThreshold",
200
+ "inputsHash",
201
+ "posStakingSubgraphBlock",
202
+ "posStakingSubgraphHash",
203
+ "posCheckpointsSubgraphBlock",
204
+ "posCheckpointsSubgraphHash",
205
+ "posPriorityFeesSubgraphBlock",
206
+ "posPriorityFeesSubgraphHash"
207
+ ]
208
+ }
209
+ ]
210
+ },
211
+ "ValidationErrorResponse": {
212
+ "type": "object",
213
+ "properties": {
214
+ "error": {
215
+ "type": "boolean",
216
+ "enum": [
217
+ true
218
+ ]
219
+ },
220
+ "message": {
221
+ "type": "string"
222
+ },
223
+ "info": {
224
+ "$ref": "#/components/schemas/ValidationErrorInfo"
225
+ }
226
+ },
227
+ "required": [
228
+ "error",
229
+ "message",
230
+ "info"
231
+ ],
232
+ "description": "Narrowed `ErrorResponse` for 400s emitted by the registry-driven router when request validation fails. `info` is non-optional and carries the section-keyed `ValidationErrorInfo` shape."
233
+ },
234
+ "ValidationErrorInfo": {
235
+ "type": "object",
236
+ "properties": {
237
+ "params": {
238
+ "$ref": "#/components/schemas/ZodErrorTree"
239
+ },
240
+ "query": {
241
+ "$ref": "#/components/schemas/ZodErrorTree"
242
+ },
243
+ "body": {
244
+ "$ref": "#/components/schemas/ZodErrorTree"
245
+ },
246
+ "headers": {
247
+ "$ref": "#/components/schemas/ZodErrorTree"
248
+ }
249
+ },
250
+ "description": "Section-keyed map of request validation failures. Only sections that failed appear; each value is the `z.treeifyError` tree for that section. Clients can wire e.g. `info.body.properties.label.errors[0]` directly into field-level UI feedback rather than walking a flat issue list."
251
+ },
252
+ "ZodErrorTree": {
253
+ "type": "object",
254
+ "properties": {
255
+ "errors": {
256
+ "type": "array",
257
+ "items": {
258
+ "type": "string"
259
+ }
260
+ },
261
+ "properties": {
262
+ "type": "object",
263
+ "additionalProperties": {
264
+ "$ref": "#/components/schemas/ZodErrorTree"
265
+ }
266
+ },
267
+ "items": {
268
+ "type": "array",
269
+ "items": {
270
+ "$ref": "#/components/schemas/ZodErrorTree"
271
+ }
272
+ }
273
+ },
274
+ "required": [
275
+ "errors"
276
+ ],
277
+ "description": "Recursive Zod validation error tree (the output of `z.treeifyError`). `errors` carries the messages at this node; `properties` keys nested object errors by field name; `items` indexes nested array errors."
278
+ },
279
+ "AllocationListResponse": {
280
+ "type": "object",
281
+ "properties": {
282
+ "items": {
283
+ "type": "array",
284
+ "items": {
285
+ "$ref": "#/components/schemas/AllocationRow"
286
+ }
287
+ },
288
+ "nextCursor": {
289
+ "type": "string",
290
+ "nullable": true
291
+ }
292
+ },
293
+ "required": [
294
+ "items",
295
+ "nextCursor"
296
+ ]
297
+ },
298
+ "AllocationRow": {
299
+ "type": "object",
300
+ "properties": {
301
+ "address": {
302
+ "type": "string",
303
+ "pattern": "^0x[0-9a-f]{40}$",
304
+ "example": "0xabc0000000000000000000000000000000000001"
305
+ },
306
+ "amount": {
307
+ "type": "string",
308
+ "pattern": "^[0-9]+$",
309
+ "example": "1234567890000000000"
310
+ },
311
+ "leafIndex": {
312
+ "type": "integer",
313
+ "nullable": true,
314
+ "minimum": 0
315
+ }
316
+ },
317
+ "required": [
318
+ "address",
319
+ "amount",
320
+ "leafIndex"
321
+ ]
322
+ },
323
+ "ExcludedAllocationsResponse": {
324
+ "type": "object",
325
+ "properties": {
326
+ "items": {
327
+ "type": "array",
328
+ "items": {
329
+ "$ref": "#/components/schemas/ExcludedAllocationRow"
330
+ }
331
+ },
332
+ "total": {
333
+ "type": "integer",
334
+ "minimum": 0
335
+ },
336
+ "totalAmount": {
337
+ "type": "string",
338
+ "pattern": "^[0-9]+$",
339
+ "example": "1234567890000000000"
340
+ }
341
+ },
342
+ "required": [
343
+ "items",
344
+ "total",
345
+ "totalAmount"
346
+ ]
347
+ },
348
+ "ExcludedAllocationRow": {
349
+ "type": "object",
350
+ "properties": {
351
+ "address": {
352
+ "type": "string",
353
+ "pattern": "^0x[0-9a-f]{40}$",
354
+ "example": "0xabc0000000000000000000000000000000000001"
355
+ },
356
+ "amount": {
357
+ "type": "string",
358
+ "pattern": "^[0-9]+$",
359
+ "example": "1234567890000000000"
360
+ }
361
+ },
362
+ "required": [
363
+ "address",
364
+ "amount"
365
+ ]
366
+ },
367
+ "AllocationHistoryResponse": {
368
+ "type": "object",
369
+ "properties": {
370
+ "items": {
371
+ "type": "array",
372
+ "items": {
373
+ "$ref": "#/components/schemas/AllocationHistoryRow"
374
+ }
375
+ }
376
+ },
377
+ "required": [
378
+ "items"
379
+ ]
380
+ },
381
+ "AllocationHistoryRow": {
382
+ "type": "object",
383
+ "properties": {
384
+ "distributionId": {
385
+ "type": "string",
386
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
387
+ "example": "2026-04"
388
+ },
389
+ "address": {
390
+ "type": "string",
391
+ "pattern": "^0x[0-9a-f]{40}$",
392
+ "example": "0xabc0000000000000000000000000000000000001"
393
+ },
394
+ "amount": {
395
+ "type": "string",
396
+ "pattern": "^[0-9]+$",
397
+ "example": "1234567890000000000"
398
+ },
399
+ "leafIndex": {
400
+ "type": "integer",
401
+ "nullable": true,
402
+ "minimum": 0
403
+ },
404
+ "merkleRoot": {
405
+ "type": "string",
406
+ "pattern": "^0x[0-9a-fA-F]{64}$",
407
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
408
+ },
409
+ "completedAt": {
410
+ "type": "string",
411
+ "format": "date-time"
412
+ },
413
+ "status": {
414
+ "type": "string",
415
+ "enum": [
416
+ "claimed",
417
+ "unclaimed"
418
+ ],
419
+ "description": "Derived live at request time by diffing the address's allocations against the pos-staker-pool-claims subgraph. Never persisted (spec D10)."
420
+ }
421
+ },
422
+ "required": [
423
+ "distributionId",
424
+ "address",
425
+ "amount",
426
+ "leafIndex",
427
+ "merkleRoot",
428
+ "completedAt",
429
+ "status"
430
+ ]
431
+ },
432
+ "UnclaimedProofsResponse": {
433
+ "type": "object",
434
+ "properties": {
435
+ "items": {
436
+ "type": "array",
437
+ "items": {
438
+ "$ref": "#/components/schemas/UnclaimedProofBatch"
439
+ }
440
+ }
441
+ },
442
+ "required": [
443
+ "items"
444
+ ]
445
+ },
446
+ "UnclaimedProofBatch": {
447
+ "type": "object",
448
+ "properties": {
449
+ "distributionId": {
450
+ "type": "string",
451
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
452
+ "example": "2026-04"
453
+ },
454
+ "merkleRoot": {
455
+ "type": "string",
456
+ "pattern": "^0x[0-9a-fA-F]{64}$",
457
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
458
+ },
459
+ "amount": {
460
+ "type": "string",
461
+ "pattern": "^[0-9]+$",
462
+ "example": "1234567890000000000"
463
+ },
464
+ "leafIndex": {
465
+ "type": "integer",
466
+ "minimum": 0
467
+ },
468
+ "proof": {
469
+ "type": "array",
470
+ "items": {
471
+ "type": "string",
472
+ "pattern": "^0x[0-9a-fA-F]{64}$",
473
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
474
+ }
475
+ }
476
+ },
477
+ "required": [
478
+ "distributionId",
479
+ "merkleRoot",
480
+ "amount",
481
+ "leafIndex",
482
+ "proof"
483
+ ]
484
+ },
485
+ "ProofResponse": {
486
+ "type": "object",
487
+ "properties": {
488
+ "merkleRoot": {
489
+ "type": "string",
490
+ "pattern": "^0x[0-9a-fA-F]{64}$",
491
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
492
+ "description": "Distribution merkle root — same value as `DistributionDetail.merkleRoot`."
493
+ },
494
+ "address": {
495
+ "type": "string",
496
+ "pattern": "^0x[0-9a-f]{40}$",
497
+ "example": "0xabc0000000000000000000000000000000000001"
498
+ },
499
+ "amount": {
500
+ "type": "string",
501
+ "pattern": "^[0-9]+$",
502
+ "example": "1234567890000000000"
503
+ },
504
+ "leafIndex": {
505
+ "type": "integer",
506
+ "minimum": 0,
507
+ "description": "Index of this leaf in the canonical (lowercased-address-sorted) tree."
508
+ },
509
+ "proof": {
510
+ "type": "array",
511
+ "items": {
512
+ "type": "string",
513
+ "pattern": "^0x[0-9a-fA-F]{64}$",
514
+ "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
515
+ },
516
+ "description": "Sibling-hash array. Pass straight to the claimer contract."
517
+ }
518
+ },
519
+ "required": [
520
+ "merkleRoot",
521
+ "address",
522
+ "amount",
523
+ "leafIndex",
524
+ "proof"
525
+ ]
526
+ }
527
+ },
528
+ "parameters": {}
529
+ },
530
+ "paths": {
531
+ "/health-check": {
532
+ "get": {
533
+ "operationId": "getHealthCheck",
534
+ "summary": "Liveness check (K8s probe)",
535
+ "responses": {
536
+ "200": {
537
+ "description": "Service is alive.",
538
+ "content": {
539
+ "application/json": {
540
+ "schema": {
541
+ "$ref": "#/components/schemas/OperationalStatus"
542
+ }
543
+ }
544
+ }
545
+ },
546
+ "500": {
547
+ "description": "Internal server error.",
548
+ "content": {
549
+ "application/json": {
550
+ "schema": {
551
+ "$ref": "#/components/schemas/ErrorResponse"
552
+ }
553
+ }
554
+ }
555
+ }
556
+ }
557
+ }
558
+ },
559
+ "/readiness": {
560
+ "get": {
561
+ "operationId": "getReadiness",
562
+ "summary": "Readiness check",
563
+ "description": "Distinguishes \"fully ready\" from \"partially degraded but still serving\". Currently a 200 stub — the real DB + subgraph reachability probe is outstanding work.",
564
+ "responses": {
565
+ "200": {
566
+ "description": "Service is ready.",
567
+ "content": {
568
+ "application/json": {
569
+ "schema": {
570
+ "$ref": "#/components/schemas/OperationalStatus"
571
+ }
572
+ }
573
+ }
574
+ },
575
+ "500": {
576
+ "description": "Internal server error.",
577
+ "content": {
578
+ "application/json": {
579
+ "schema": {
580
+ "$ref": "#/components/schemas/ErrorResponse"
581
+ }
582
+ }
583
+ }
584
+ }
585
+ }
586
+ }
587
+ },
588
+ "/v1/{network}/distributions": {
589
+ "get": {
590
+ "operationId": "listDistributions",
591
+ "summary": "List completed distributions",
592
+ "description": "Paginated list of completed distributions, oldest first by id (e.g. `2026-04`). Non-completed rows are not surfaced on the public API.",
593
+ "parameters": [
594
+ {
595
+ "schema": {
596
+ "type": "string",
597
+ "enum": [
598
+ "mainnet",
599
+ "amoy"
600
+ ],
601
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
602
+ "example": "mainnet"
603
+ },
604
+ "required": true,
605
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
606
+ "name": "network",
607
+ "in": "path"
608
+ },
609
+ {
610
+ "schema": {
611
+ "type": "string",
612
+ "minLength": 1
613
+ },
614
+ "required": false,
615
+ "name": "cursor",
616
+ "in": "query"
617
+ },
618
+ {
619
+ "schema": {
620
+ "type": "integer",
621
+ "minimum": 1,
622
+ "maximum": 100,
623
+ "default": 50
624
+ },
625
+ "required": false,
626
+ "name": "limit",
627
+ "in": "query"
628
+ }
629
+ ],
630
+ "responses": {
631
+ "200": {
632
+ "description": "Page of distribution summaries.",
633
+ "content": {
634
+ "application/json": {
635
+ "schema": {
636
+ "$ref": "#/components/schemas/DistributionListResponse"
637
+ }
638
+ }
639
+ }
640
+ },
641
+ "400": {
642
+ "description": "Invalid pagination cursor (`info.code: \"INVALID_CURSOR\"`) or request failed schema validation.",
643
+ "content": {
644
+ "application/json": {
645
+ "schema": {
646
+ "$ref": "#/components/schemas/ErrorResponse"
647
+ }
648
+ }
649
+ }
650
+ },
651
+ "500": {
652
+ "description": "Internal server error.",
653
+ "content": {
654
+ "application/json": {
655
+ "schema": {
656
+ "$ref": "#/components/schemas/ErrorResponse"
657
+ }
658
+ }
659
+ }
660
+ }
661
+ }
662
+ }
663
+ },
664
+ "/v1/{network}/distributions/{distributionId}": {
665
+ "get": {
666
+ "operationId": "getDistribution",
667
+ "summary": "Get a single completed distribution",
668
+ "parameters": [
669
+ {
670
+ "schema": {
671
+ "type": "string",
672
+ "enum": [
673
+ "mainnet",
674
+ "amoy"
675
+ ],
676
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
677
+ "example": "mainnet"
678
+ },
679
+ "required": true,
680
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
681
+ "name": "network",
682
+ "in": "path"
683
+ },
684
+ {
685
+ "schema": {
686
+ "type": "string",
687
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
688
+ "example": "2026-04"
689
+ },
690
+ "required": true,
691
+ "name": "distributionId",
692
+ "in": "path"
693
+ }
694
+ ],
695
+ "responses": {
696
+ "200": {
697
+ "description": "Distribution detail.",
698
+ "content": {
699
+ "application/json": {
700
+ "schema": {
701
+ "$ref": "#/components/schemas/DistributionDetail"
702
+ }
703
+ }
704
+ }
705
+ },
706
+ "400": {
707
+ "description": "Request failed schema validation.",
708
+ "content": {
709
+ "application/json": {
710
+ "schema": {
711
+ "$ref": "#/components/schemas/ValidationErrorResponse"
712
+ }
713
+ }
714
+ }
715
+ },
716
+ "404": {
717
+ "description": "Distribution not found or not yet completed.",
718
+ "content": {
719
+ "application/json": {
720
+ "schema": {
721
+ "$ref": "#/components/schemas/ErrorResponse"
722
+ }
723
+ }
724
+ }
725
+ },
726
+ "500": {
727
+ "description": "Internal server error.",
728
+ "content": {
729
+ "application/json": {
730
+ "schema": {
731
+ "$ref": "#/components/schemas/ErrorResponse"
732
+ }
733
+ }
734
+ }
735
+ }
736
+ }
737
+ }
738
+ },
739
+ "/v1/{network}/distributions/{distributionId}/allocations": {
740
+ "get": {
741
+ "operationId": "listAllocations",
742
+ "summary": "List allocations for a completed distribution",
743
+ "description": "Paginated by `leafIndex` ascending.",
744
+ "parameters": [
745
+ {
746
+ "schema": {
747
+ "type": "string",
748
+ "enum": [
749
+ "mainnet",
750
+ "amoy"
751
+ ],
752
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
753
+ "example": "mainnet"
754
+ },
755
+ "required": true,
756
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
757
+ "name": "network",
758
+ "in": "path"
759
+ },
760
+ {
761
+ "schema": {
762
+ "type": "string",
763
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
764
+ "example": "2026-04"
765
+ },
766
+ "required": true,
767
+ "name": "distributionId",
768
+ "in": "path"
769
+ },
770
+ {
771
+ "schema": {
772
+ "type": "string",
773
+ "minLength": 1
774
+ },
775
+ "required": false,
776
+ "name": "cursor",
777
+ "in": "query"
778
+ },
779
+ {
780
+ "schema": {
781
+ "type": "integer",
782
+ "minimum": 1,
783
+ "maximum": 100,
784
+ "default": 50
785
+ },
786
+ "required": false,
787
+ "name": "limit",
788
+ "in": "query"
789
+ }
790
+ ],
791
+ "responses": {
792
+ "200": {
793
+ "description": "Page of allocation rows.",
794
+ "content": {
795
+ "application/json": {
796
+ "schema": {
797
+ "$ref": "#/components/schemas/AllocationListResponse"
798
+ }
799
+ }
800
+ }
801
+ },
802
+ "400": {
803
+ "description": "Invalid pagination cursor (`info.code: \"INVALID_CURSOR\"`) or request failed schema validation.",
804
+ "content": {
805
+ "application/json": {
806
+ "schema": {
807
+ "$ref": "#/components/schemas/ErrorResponse"
808
+ }
809
+ }
810
+ }
811
+ },
812
+ "404": {
813
+ "description": "Distribution not found or not yet completed.",
814
+ "content": {
815
+ "application/json": {
816
+ "schema": {
817
+ "$ref": "#/components/schemas/ErrorResponse"
818
+ }
819
+ }
820
+ }
821
+ },
822
+ "500": {
823
+ "description": "Internal server error.",
824
+ "content": {
825
+ "application/json": {
826
+ "schema": {
827
+ "$ref": "#/components/schemas/ErrorResponse"
828
+ }
829
+ }
830
+ }
831
+ }
832
+ }
833
+ }
834
+ },
835
+ "/v1/{network}/distributions/{distributionId}/excluded-allocations": {
836
+ "get": {
837
+ "operationId": "listExcludedAllocations",
838
+ "summary": "List off-chain (merkle-excluded) allocations for a distribution",
839
+ "description": "Recipients allocated but excluded from the merkle tree (excluded addresses) — not claimable on-chain, settled manually. Not paginated (small bounded set). `totalAmount` equals the distribution `total_allocated - claimable_total`.",
840
+ "parameters": [
841
+ {
842
+ "schema": {
843
+ "type": "string",
844
+ "enum": [
845
+ "mainnet",
846
+ "amoy"
847
+ ],
848
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
849
+ "example": "mainnet"
850
+ },
851
+ "required": true,
852
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
853
+ "name": "network",
854
+ "in": "path"
855
+ },
856
+ {
857
+ "schema": {
858
+ "type": "string",
859
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
860
+ "example": "2026-04"
861
+ },
862
+ "required": true,
863
+ "name": "distributionId",
864
+ "in": "path"
865
+ }
866
+ ],
867
+ "responses": {
868
+ "200": {
869
+ "description": "The off-chain allocation set.",
870
+ "content": {
871
+ "application/json": {
872
+ "schema": {
873
+ "$ref": "#/components/schemas/ExcludedAllocationsResponse"
874
+ }
875
+ }
876
+ }
877
+ },
878
+ "400": {
879
+ "description": "Request failed schema validation.",
880
+ "content": {
881
+ "application/json": {
882
+ "schema": {
883
+ "$ref": "#/components/schemas/ValidationErrorResponse"
884
+ }
885
+ }
886
+ }
887
+ },
888
+ "404": {
889
+ "description": "Distribution not found or not yet completed.",
890
+ "content": {
891
+ "application/json": {
892
+ "schema": {
893
+ "$ref": "#/components/schemas/ErrorResponse"
894
+ }
895
+ }
896
+ }
897
+ },
898
+ "500": {
899
+ "description": "Internal server error.",
900
+ "content": {
901
+ "application/json": {
902
+ "schema": {
903
+ "$ref": "#/components/schemas/ErrorResponse"
904
+ }
905
+ }
906
+ }
907
+ }
908
+ }
909
+ }
910
+ },
911
+ "/v1/{network}/distributions/{distributionId}/allocations/{address}": {
912
+ "get": {
913
+ "operationId": "getAllocation",
914
+ "summary": "Get a single address allocation in a distribution",
915
+ "parameters": [
916
+ {
917
+ "schema": {
918
+ "type": "string",
919
+ "enum": [
920
+ "mainnet",
921
+ "amoy"
922
+ ],
923
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
924
+ "example": "mainnet"
925
+ },
926
+ "required": true,
927
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
928
+ "name": "network",
929
+ "in": "path"
930
+ },
931
+ {
932
+ "schema": {
933
+ "type": "string",
934
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
935
+ "example": "2026-04"
936
+ },
937
+ "required": true,
938
+ "name": "distributionId",
939
+ "in": "path"
940
+ },
941
+ {
942
+ "schema": {
943
+ "type": "string",
944
+ "pattern": "^0x[0-9a-fA-F]{40}$",
945
+ "example": "0xabc0000000000000000000000000000000000001"
946
+ },
947
+ "required": true,
948
+ "name": "address",
949
+ "in": "path"
950
+ }
951
+ ],
952
+ "responses": {
953
+ "200": {
954
+ "description": "Allocation row.",
955
+ "content": {
956
+ "application/json": {
957
+ "schema": {
958
+ "$ref": "#/components/schemas/AllocationRow"
959
+ }
960
+ }
961
+ }
962
+ },
963
+ "400": {
964
+ "description": "Request failed schema validation.",
965
+ "content": {
966
+ "application/json": {
967
+ "schema": {
968
+ "$ref": "#/components/schemas/ValidationErrorResponse"
969
+ }
970
+ }
971
+ }
972
+ },
973
+ "404": {
974
+ "description": "Distribution or allocation not found.",
975
+ "content": {
976
+ "application/json": {
977
+ "schema": {
978
+ "$ref": "#/components/schemas/ErrorResponse"
979
+ }
980
+ }
981
+ }
982
+ },
983
+ "500": {
984
+ "description": "Internal server error.",
985
+ "content": {
986
+ "application/json": {
987
+ "schema": {
988
+ "$ref": "#/components/schemas/ErrorResponse"
989
+ }
990
+ }
991
+ }
992
+ }
993
+ }
994
+ }
995
+ },
996
+ "/v1/{network}/addresses/{address}/allocations": {
997
+ "get": {
998
+ "operationId": "getAddressAllocationHistory",
999
+ "summary": "Per-address cross-distribution allocation history with live claim status",
1000
+ "description": "Returns every allocation row for the given address across all completed distributions on the network, enriched with `status: \"claimed\" | \"unclaimed\"` derived live at request time by querying the pos-staker-pool-claims subgraph (spec §3.6, D10). Empty array if the address never qualified.",
1001
+ "parameters": [
1002
+ {
1003
+ "schema": {
1004
+ "type": "string",
1005
+ "enum": [
1006
+ "mainnet",
1007
+ "amoy"
1008
+ ],
1009
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
1010
+ "example": "mainnet"
1011
+ },
1012
+ "required": true,
1013
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
1014
+ "name": "network",
1015
+ "in": "path"
1016
+ },
1017
+ {
1018
+ "schema": {
1019
+ "type": "string",
1020
+ "pattern": "^0x[0-9a-fA-F]{40}$",
1021
+ "example": "0xabc0000000000000000000000000000000000001"
1022
+ },
1023
+ "required": true,
1024
+ "name": "address",
1025
+ "in": "path"
1026
+ }
1027
+ ],
1028
+ "responses": {
1029
+ "200": {
1030
+ "description": "History rows ordered most-recently-completed first.",
1031
+ "content": {
1032
+ "application/json": {
1033
+ "schema": {
1034
+ "$ref": "#/components/schemas/AllocationHistoryResponse"
1035
+ }
1036
+ }
1037
+ }
1038
+ },
1039
+ "400": {
1040
+ "description": "Request failed schema validation.",
1041
+ "content": {
1042
+ "application/json": {
1043
+ "schema": {
1044
+ "$ref": "#/components/schemas/ValidationErrorResponse"
1045
+ }
1046
+ }
1047
+ }
1048
+ },
1049
+ "500": {
1050
+ "description": "Internal server error.",
1051
+ "content": {
1052
+ "application/json": {
1053
+ "schema": {
1054
+ "$ref": "#/components/schemas/ErrorResponse"
1055
+ }
1056
+ }
1057
+ }
1058
+ }
1059
+ }
1060
+ }
1061
+ },
1062
+ "/v1/{network}/addresses/{address}/unclaimed-proofs": {
1063
+ "get": {
1064
+ "operationId": "getUnclaimedProofs",
1065
+ "summary": "Per-address unclaimed-proofs array — the primary claim-flow UI endpoint",
1066
+ "description": "Returns the address's outstanding allocations with merkle proofs ready to submit to the claimer contract in one batched transaction. Proof generation is on demand from the persisted leaves (spec D9); the in-memory tree cache absorbs repeat calls for the same distribution. Empty array if every allocation has been claimed (or the address has none).",
1067
+ "parameters": [
1068
+ {
1069
+ "schema": {
1070
+ "type": "string",
1071
+ "enum": [
1072
+ "mainnet",
1073
+ "amoy"
1074
+ ],
1075
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
1076
+ "example": "mainnet"
1077
+ },
1078
+ "required": true,
1079
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
1080
+ "name": "network",
1081
+ "in": "path"
1082
+ },
1083
+ {
1084
+ "schema": {
1085
+ "type": "string",
1086
+ "pattern": "^0x[0-9a-fA-F]{40}$",
1087
+ "example": "0xabc0000000000000000000000000000000000001"
1088
+ },
1089
+ "required": true,
1090
+ "name": "address",
1091
+ "in": "path"
1092
+ }
1093
+ ],
1094
+ "responses": {
1095
+ "200": {
1096
+ "description": "Batch of unclaimed-proof entries ordered oldest-distribution first.",
1097
+ "content": {
1098
+ "application/json": {
1099
+ "schema": {
1100
+ "$ref": "#/components/schemas/UnclaimedProofsResponse"
1101
+ }
1102
+ }
1103
+ }
1104
+ },
1105
+ "400": {
1106
+ "description": "Request failed schema validation.",
1107
+ "content": {
1108
+ "application/json": {
1109
+ "schema": {
1110
+ "$ref": "#/components/schemas/ValidationErrorResponse"
1111
+ }
1112
+ }
1113
+ }
1114
+ },
1115
+ "500": {
1116
+ "description": "Internal server error.",
1117
+ "content": {
1118
+ "application/json": {
1119
+ "schema": {
1120
+ "$ref": "#/components/schemas/ErrorResponse"
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+ }
1126
+ }
1127
+ },
1128
+ "/v1/{network}/distributions/{distributionId}/allocations/{address}/proof": {
1129
+ "get": {
1130
+ "operationId": "getProof",
1131
+ "summary": "Get the merkle proof for a single allocation",
1132
+ "description": "Rebuilds (or cache-hits) the merkle tree from the persisted allocations table and extracts the proof for the requested address. The returned tuple `(merkleRoot, address, amount, leafIndex, proof)` can be passed straight to a Solidity verifier built around the same `[address, uint256]` leaf encoding.",
1133
+ "parameters": [
1134
+ {
1135
+ "schema": {
1136
+ "type": "string",
1137
+ "enum": [
1138
+ "mainnet",
1139
+ "amoy"
1140
+ ],
1141
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
1142
+ "example": "mainnet"
1143
+ },
1144
+ "required": true,
1145
+ "description": "Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.",
1146
+ "name": "network",
1147
+ "in": "path"
1148
+ },
1149
+ {
1150
+ "schema": {
1151
+ "type": "string",
1152
+ "pattern": "^[0-9]{4}-[0-9]{2}$",
1153
+ "example": "2026-04"
1154
+ },
1155
+ "required": true,
1156
+ "name": "distributionId",
1157
+ "in": "path"
1158
+ },
1159
+ {
1160
+ "schema": {
1161
+ "type": "string",
1162
+ "pattern": "^0x[0-9a-fA-F]{40}$",
1163
+ "example": "0xabc0000000000000000000000000000000000001"
1164
+ },
1165
+ "required": true,
1166
+ "name": "address",
1167
+ "in": "path"
1168
+ }
1169
+ ],
1170
+ "responses": {
1171
+ "200": {
1172
+ "description": "Proof bundle ready to submit to the claimer contract.",
1173
+ "content": {
1174
+ "application/json": {
1175
+ "schema": {
1176
+ "$ref": "#/components/schemas/ProofResponse"
1177
+ }
1178
+ }
1179
+ }
1180
+ },
1181
+ "400": {
1182
+ "description": "Request failed schema validation.",
1183
+ "content": {
1184
+ "application/json": {
1185
+ "schema": {
1186
+ "$ref": "#/components/schemas/ValidationErrorResponse"
1187
+ }
1188
+ }
1189
+ }
1190
+ },
1191
+ "404": {
1192
+ "description": "Distribution not found, not yet completed, address has no allocation, or the allocation is excluded from the tree (settled off-chain).",
1193
+ "content": {
1194
+ "application/json": {
1195
+ "schema": {
1196
+ "$ref": "#/components/schemas/ErrorResponse"
1197
+ }
1198
+ }
1199
+ }
1200
+ },
1201
+ "500": {
1202
+ "description": "Internal server error.",
1203
+ "content": {
1204
+ "application/json": {
1205
+ "schema": {
1206
+ "$ref": "#/components/schemas/ErrorResponse"
1207
+ }
1208
+ }
1209
+ }
1210
+ }
1211
+ }
1212
+ }
1213
+ }
1214
+ }
1215
+ }