-
Notifications
You must be signed in to change notification settings - Fork 6
/
swagger.yaml
705 lines (661 loc) · 28.3 KB
/
swagger.yaml
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
openapi: 3.0.0
info:
title: Namada Undexer REST API
version: 4.0.0
description: "API for accessing Namada blockchain data via Undexer."
contact:
email: [email protected]
url: "https://github.com/hackbg/undexer"
servers:
- url: "https://undexer.hack.bg/v4/"
paths:
/:
get:
summary: Get blockchain status information
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/Overview'}}}}
/status:
get:
summary: Get current status of the blockchain
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/Status'}}}}
/search:
get:
summary: Search by string
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/SearchResults'}}}}
/blocks:
get:
summary: Get blocks with optional pagination
parameters:
- {name: limit, in: query, required: false, schema: {type: integer, minimum: 1, maximum: 100}, description: "Number of blocks to return per page (default 25)" }
- {name: before, in: query, required: false, schema: {type: string}, description: "Retrieve blocks before the specified block ID (default 0)" }
- {name: after, in: query, required: false, schema: {type: string}, description: "Retrieve blocks after the specified block ID (default 0)" }
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/BlocksList'}}}}
/block:
get:
summary: Get block information by height and/or hash
parameters:
- {name: height, in: query, required: false, schema: {type: integer}, description: "The height of the block" }
- {name: hash, in: query, required: false, schema: {type: string}, description: "The hash of the block"}
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/BlockDetails'}}}}
'404': {description: "Block not found"}
/txs:
get:
summary: Get paginated list of transactions
parameters:
- {name: limit, in: query, required: false, schema: {type: integer}, description: "Number of transactions to return" }
- {name: offset, in: query, required: false, schema: {type: integer}, description: "Offset for pagination" }
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/TransactionsList'}}}}
/tx/{hash}:
get:
summary: Retrieve transaction details by transaction hash
parameters:
- name: hash
in: path
required: true
schema: {type: string}
description: Transaction hash identifier
responses:
'404': {description: "Not found"}
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/TransactionDetail'}}}}
/validators/states:
get:
summary: Retrieve validator states
description: Returns the current consensus and jailed states of validators.
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/ValidatorsStates'}}}}
/validators:
get:
summary: Get paginated list of validators, optionally filtered by state
parameters:
- {name: state, in: query, required: true, schema: {type: string, enum: [BelowThreshold, BelowCapacity, Jailed, Consensus, Inactive]}, description: "State of the validators"}
- {name: limit, in: query, required: false, schema: {type: integer}, description: "Number of validators to return"}
- {name: offset, in: query, required: false, schema: {type: integer}, description: "Offset for pagination"}
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/ValidatorsList'}}}}
/validator:
get:
summary: Get validator by public key
parameters:
- {name: publicKey, in: query, required: true, schema: {type: string}, description: "The hash of the validator" }
- {name: uptime, in: query, required: false, schema: {type: number}, description: "Count uptime over past X blocks" }
responses:
'404': {description: "Not found"}
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/ValidatorDetails'}}}}
/proposals:
get:
summary: Get paginated list of proposals
parameters:
- {name: limit, in: query, required: false, schema: {type: integer}, description: "Number of proposals to return"}
- {name: offset, in: query, required: false, schema: {type: integer}, description: "Offset for pagination"}
- {name: orderBy, in: query, required: false, schema: {type: string, enum: [id, status, result, proposalType]}, description: "Field to order by"}
- {name: orderDirection, in: query, required: false, schema: {type: string, enum: [ASC, DESC]}, description: "Direction to order by"}
- {name: proposalType, in: query, required: false, schema: {type: string, enum: [pgf_steward, pgf_payment, default]}, description: "Type of proposals to return"}
- {name: status, in: query, required: false, schema: {type: string, enum: [upcoming, ongoing, finished]}, description: "Status of proposals to return"}
- {name: result, in: query, required: false, schema: {type: string, enum: [passed, rejected]}, description: "Result of proposals to return"}
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/ProposalsList'}}}}
/proposals/stats:
get:
summary: Get count of proposals by status, result and total count
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/ProposalsStats'}}}}
/proposal/{id}:
get:
summary: Get governance proposal information by id
parameters:
- {name: id, in: path, required: true, schema: {type: string}, description: "The id of the proposal"}
responses:
'404': {description: "Not found"}
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/ProposalDetail'}}}}
/proposal/votes/{proposalId}:
get:
summary: Get all votes by proposal id
parameters:
- {name: proposalId, in: path, required: true, schema: {type: string}, description: "The id of the proposal" }
responses:
'404': {description: "Not found"}
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/VotesPage'}}}}
/transfers:
get:
summary: Get transfers from address
parameters:
- {name: from, in: query, schema: {type: string}, description: "Sender"}
- {name: to, in: query, schema: {type: string}, description: "Receiver"}
- {name: by, in: query, schema: {type: string}, description: "Sender or receiver"}
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/TransferList'}}}}
/epoch:
get:
summary: Get current epoch information
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/EpochInfo'}}}}
/total-staked:
get:
summary: Get total staked amount
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/TotalStaked'}}}}
/parameters/staking:
get:
summary: Get staking parameters
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/PoSParams'}}}}
/parameters/governance:
get:
summary: Get governance parameters
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/GovParams'}}}}
/parameters/pgf:
get:
summary: Get PGF parameters
responses:
'200': {content:{application/json:{schema:{$ref:'#/components/schemas/PGFParams'}}}}
components:
schemas:
Status:
type: object
properties:
timestamp: {type: string, format: date-time}
totalBlocks: {type: integer}
oldestBlock: {type: integer}
latestBlock: {type: integer}
totalTransactions: {type: integer}
totalValidators: {type: integer}
totalProposals: {type: integer}
totalVotes: {type: integer}
Overview:
type: object
properties:
timestamp: {type: string, format: date-time}
totalBlocks: {type: integer}
oldestBlock: {type: integer}
latestBlock: {type: integer}
latestBlocks:
type: array
items:
type: object
properties:
blockHeight: {type: integer}
blockHash: {type: string}
blockTime: {type: string, format: date-time}
totalTransactions: {type: integer}
latestTransactions:
type: array
items:
type: object
properties:
blockHeight: {type: integer}
blockHash: {type: string}
blockTime: {type: string, format: date-time}
txHash: {type: string}
txTime: {type: string, format: date-time}
txContentType: {type: string}
totalValidators: {type: integer}
topValidators:
type: array
items:
type: object
properties:
address: {type: string}
publicKey: {type: string}
votingPower: {type: integer, nullable: true}
proposerPriority: {type: integer, nullable: true}
namadaAddress: {type: string}
metadata:
type: object
properties:
email: {type: string}
avatar: {type: string, nullable: true}
website: {type: string, nullable: true}
description: {type: string, nullable: true}
discordHandle: {type: string, nullable: true}
commission:
type: object
properties:
epoch: {type: string}
commissionRate: {type: string}
maxCommissionChangePerEpoch: {type: string}
stake: {type: string}
state:
type: object
properties:
epoch: {type: string}
state: {type: string}
createdAt: {type: string, format: date-time}
updatedAt: {type: string, format: date-time}
totalProposals: {type: integer}
totalVotes: {type: integer}
SearchResults:
type: object
properties:
blocks: {type: array}
transactions: {type: array}
proposals: {type: array}
BlocksList:
type: object
properties:
totalBlocks:
type: integer
description: Total number of blocks matching the query parameters
latestBlock:
type: integer
description: Height of the latest block in the returned list
oldestBlock:
type: integer
description: Height of the oldest block in the returned list
count:
type: integer
description: Number of blocks returned in this response
blocks:
type: array
items:
type: object
properties:
blockHeight:
type: integer
description: Height of the block
blockHash:
type: string
description: Hash of the block
blockTime:
type: string
format: date-time
description: Time when the block was created
transactionCount:
type: integer
description: Number of transactions in the block
BlockDetails:
type: object
properties:
blockHeight: {type: integer}
blockHash: {type: string}
blockTime: {type: string, format: date-time}
transactionCount: {type: integer}
proposer:
type: object
properties:
namadaAddress: {type: string}
publicKey: {type: string}
consensusAddress: {type: string}
metadata:
type: object
properties:
name: {type: string}
email: {type: string}
avatar: {type: string}
website: {type: string}
description: {type: string}
discordHandle: {type: string}
signers:
type: array
items:
type: object
properties:
namadaAddress: {type: string}
publicKey: {type: string}
consensusAddress: {type: string}
metadata:
type: object
properties:
name: {type: string}
email: {type: string}
avatar: {type: string}
website: {type: string}
description: {type: string}
discordHandle: {type: string}
transactions:
type: array
items:
type: object
properties:
chainId: {type: string}
blockHash: {type: string}
blockHeight: {type: integer}
blockTime: {type: string, format: date-time}
txHash: {type: string}
txTime: {type: string, format: date-time}
txData:
type: object
properties:
id: {type: string}
data:
type: object
properties:
type:
type: object
properties:
Wrapper:
type: object
properties:
pk:
type: object
properties:
pk: {type: string}
type: {type: string}
fee:
type: object
properties:
token: {type: string}
amountPerGasUnit: {type: string}
payer: {type: string}
feeToken: {type: string}
gasLimit: {type: string}
multiplier: {type: string}
gasLimitMultiplier: {type: string}
feeAmountPerGasUnit: {type: string}
TransactionsList:
type: object
properties:
count:
type: integer
description: Total count of transactions
transactions:
type: array
items:
type: object
properties:
txHash: {type: string}
date: {type: string, format: date-time}
TransactionDetail:
type: object
properties:
chainId:
type: string
description: Identifier of the blockchain network
blockHash:
type: string
description: Hash of the block containing this transaction
blockHeight:
type: integer
description: Height of the block containing this transaction
blockTime:
type: string
format: date-time
description: Time when the block containing this transaction was created
txHash:
type: string
description: Hash identifier of the transaction
txTime:
type: string
format: date-time
description: Time when the transaction was executed
txData:
type: object
properties:
id:
type: string
description: Identifier of the transaction data
data:
type: object
properties:
type:
type: object
properties:
Wrapper:
type: object
properties:
pk:
type: object
properties:
pk:
type: string
description: Public key associated with the transaction
type:
type: string
description: Public key type
fee:
type: object
properties:
token:
type: string
description: Token used for transaction fee
amountPerGasUnit:
type: string
description: Amount per gas unit for the transaction fee
payer:
type: string
description: Payer of the transaction fee
feeToken:
type: string
description: Token used for transaction fee
gasLimit:
type: string
description: Gas limit for the transaction
multiplier:
type: string
description: Multiplier associated with the transaction
gasLimitMultiplier:
type: string
description: Gas limit multiplier associated with the transaction
feeAmountPerGasUnit:
type: string
description: Fee amount per gas unit associated with the transaction
batch:
type: array
items:
type: object
properties:
hash:
type: string
description: Hash associated with the batch
codeHash:
type: string
description: Code hash associated with the batch
dataHash:
type: string
description: Data hash associated with the batch
memoHash:
type: string
description: Memo hash associated with the batch
atomic:
type: boolean
description: Boolean indicating if the transaction is atomic
chainId:
type: string
description: Identifier of the blockchain network
content:
type: object
properties:
data:
type: object
properties:
address:
type: string
description: Address associated with the content
threshold:
type: integer
description: Threshold associated with the content
publicKeys:
type: array
items:
type: string
description: Public keys associated with the content
description: Content data associated with the transaction
type:
type: string
description: Type associated with the content
sections:
type: array
items:
type: object
properties:
tag:
type: string
description: Tag associated with the section
code:
type: string
description: Code associated with the section
salt:
type: string
description: Salt associated with the section
type:
type: string
description: Type associated with the section
description: Sections associated with the transaction
timestamp:
type: string
description: Timestamp associated with the transaction
expiration:
type: string
description: Expiration associated with the transaction
description: Data associated with the transaction
description: Transaction data associated with the transaction
ProposalsList:
type: object
properties:
count: {type:integer}
proposals:
type: array
items:
type: object
properties:
id: {type: integer}
content: {type: object}
metadata: {type: object}
result: {type: object}
ProposalsStats:
type: object
properties:
all: {type:integer}
ongoing: {type:integer}
upcoming: {type:integer}
finished: {type:integer}
passed: {type:integer}
rejected: {type:integer}
ProposalDetail:
type: object
properties:
id: {type: integer}
content: {type: object}
metadata: {type: object}
result: {type: object}
VotesPage:
type: object
properties:
count: {type: integer}
votes:
type: array
items:
type: object
properties:
data:
type: object
properties:
data: {type: string}
delegator: {type: string}
validator: {type: string}
TransferList:
type: object
properties:
transfers:
type: array
items:
type: object
properties:
from: {type: string}
to: {type: string}
amount: {type: integer}
date: {type: string, format: date-time}
EpochInfo:
type: object
properties:
timestamp: {type: string}
epoch: {type: string}
firstBlock: {type: string}
minNumOfBlocks: {type: string}
minDuration: {type: string}
TotalStaked:
type: object
properties:
timestamp: {type: string}
totalStaked: {type: string}
PoSParams:
type: object
properties:
maxValidatorSlots: {type: string}
pipelineLen: {type: string}
unbondingLen: {type: string}
tmVotesPerToken: {type: string}
blockProposerReward: {type: string}
blockVoteReward: {type: string}
maxInflationRate: {type: string}
targetStakedRatio: {type: string}
duplicateVoteMinSlashRate: {type: string}
lightClientAttackMinSlashRate: {type: string}
cubicSlashingWindowLength: {type: string}
validatorStakeThreshold: {type: string}
livenessWindowCheck: {type: string}
livenessThreshold: {type: string}
rewardsGainP: {type: string}
rewardsGainD: {type: string}
maxProposalPeriod: {type: string}
GovParams:
type: object
properties:
minProposalFund: {type: string}
maxProposalCodeSize: {type: string}
minProposalVotingPeriod: {type: string}
maxProposalPeriod: {type: string}
maxProposalContentSize: {type: string}
minProposalGraceEpochs: {type: string}
PGFParams:
type: object
properties:
stewards: {type: object}
pgfInflationRate: {type: string}
stewardsInflationRate: {type: string}
ValidatorsStates:
type: object
properties:
Consensus:
type: integer
description: Number of validators in consensus
Jailed:
type: integer
description: Number of validators currently jailed
BelowThreshold:
type: integer
description: Number of validators currently below threshold
BelowCapacity:
type: integer
description: Number of validators currently below capacity
Inactive:
type: integer
description: Number of validators currently inactive
ValidatorsList:
type: object
properties:
count: {type: integer, description: "Total count of validators"}
validators:
type: array
items:
type: object
properties:
publicKey: {type: string}
address: {type: string}
namadaAddress: {type: string}
votingPower: {type: string}
proposerPriority: {type: string}
metadata: {type: object}
commission: {type: object}
stake: {type: string}
state: {type: object}
ValidatorDetails:
type: object
properties:
publicKey: {type: string}
address: {type: string}
namadaAddress: {type: string}
votingPower: {type: string}
proposerPriority: {type: string}
metadata: {type: object}
commission: {type: object}
stake: {type: string}
state: {type: object}
uptime: {type: integer}
currentHeight: {type: integer}
countedBlocks: {type: integer}