-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.yaml
More file actions
1382 lines (1374 loc) · 65.7 KB
/
swagger.yaml
File metadata and controls
1382 lines (1374 loc) · 65.7 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
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
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: DB Sync API
version: 1.0.0
description: APIs for cardano DB Sync
paths:
/api/stake-address:
get:
summary: Retrieve stake address information
description: Get the latest stake registration and deregistration for a given stake address.
tags:
- Stake
parameters:
- name: address
in: query
required: true
description: The stake address in hexadecimal or Bech32 format.
schema:
type: string
responses:
'200':
description: Successful response with stake address data.
content:
application/json:
schema:
type: object
properties:
registration:
type: object
nullable: true
properties:
epoch_no:
type: integer
description: Epoch number.
slot_no:
type: integer
description: Slot number.
block_no:
type: integer
description: Slot Number.
time:
type: string
description: Time of transaction.
tx_hash:
type: string
description: Transaction hash.
deregistration:
type: object
nullable: true
properties:
epoch_no:
type: integer
description: Epoch number.
slot_no:
type: integer
description: Slot number.
block_no:
type: integer
description: Slot Number.
time:
type: string
description: Time of transaction.
tx_hash:
type: string
description: Transaction hash.
'400':
description: Bad Request. The request is missing required parameters or has invalid data.
'404':
description: Not Found. The stake address does not exist in the database.
'500':
description: Internal Server Error. An unexpected error occurred while processing the request.
/api/delegation:
get:
summary: Get latest delegation information
description: Fetches the latest delegation and pool delegation details for the given address.
tags:
- Stake
operationId: getDelegation
parameters:
- name: address
in: query
required: true
description: Bech32 or hex-encoded address to query.
schema:
type: string
example: 'stake_test1ur34vgj0kk338wlfsdf7fnxs9uukh24047lc2wfmm0mgptgq7849c'
responses:
'200':
description: Successful response with delegation and pool information.
content:
application/json:
schema:
type: object
properties:
drep:
type: array
items:
type: object
properties:
drep_id:
type: string
description: The view of the DRep.
epoch_no:
type: integer
description: The epoch number of the delegation.
slot_no:
type: integer
description: The slot number of the delegation.
block_no:
type: integer
description: The block number.
time:
type: string
format: date-time
description: The time of the block.
tx_hash:
type: string
description: The transaction hash.
pool:
type: array
items:
type: object
properties:
pool_id:
type: string
description: The view of the pool.
epoch_no:
type: integer
description: The epoch number of the delegation.
slot_no:
type: integer
description: The slot number.
block_no:
type: integer
description: The block number.
time:
type: string
format: date-time
description: The time of the block.
tx_hash:
type: string
description: The transaction hash.
'400':
description: Bad request. The `address` query parameter is missing or invalid.
'500':
description: Internal server error.
/api/drep/{id}/live-delegators:
get:
summary: Get live delegators for a DRep
description: Fetch the list of live delegators associated with the specified DRep ID.
tags:
- DRep Delegation
parameters:
- name: id
in: path
required: true
description: The DRep ID in hex or Bech32 format.
schema:
type: string
example: 'drep15fy2nszna039pdregpryhzahnwcr2rred4nx2qaec7k07nvcq26'
- in: query
name: page
schema:
type: number
default: 1
required: false
- in: query
name: size
schema:
type: number
default: 10
required: false
- name: balance
in: query
required: false
description: The live balance of the delegator.
schema:
type: boolean
example: false
responses:
'200':
description: A list of active delegators.
content:
application/json:
schema:
type: array
items:
type: object
properties:
delegatorStake:
type: string
description: The stake address of the delegator.
balance:
type: object
properties:
utxoBalance:
type: string
description: The UTXO balance of the delegator.
rewardBalance:
type: string
description: The reward balance of the delegator.
rewardRestBalance:
type: string
description: The reward rest balance of the delegator.
delegatedAt:
type: object
properties:
txId:
type: string
description: The transaction ID of the delegation.
epochNo:
type: integer
description: The epoch number of the delegation.
time:
type: string
format: date-time
description: The time of the delegation.
'400':
description: Invalid DRep ID.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Provide a valid Drep ID
'500':
description: Internal server error.
/api/drep/{id}/active-delegators:
get:
summary: Get active delegators for a DRep
description: Fetch the list of active delegators associated with the specified DRep ID.
tags:
- DRep Delegation
parameters:
- name: id
in: path
required: true
description: The DRep ID in hex or Bech32 format.
schema:
type: string
example: 'drep15fy2nszna039pdregpryhzahnwcr2rred4nx2qaec7k07nvcq26'
- in: query
name: page
schema:
type: number
default: 1
required: false
- in: query
name: size
schema:
type: number
default: 10
required: false
- name: balance
in: query
required: false
description: The active balance of the delegator.
schema:
type: boolean
example: false
responses:
'200':
description: A list of active delegators.
content:
application/json:
schema:
type: array
items:
type: object
properties:
delegatorStake:
type: string
description: The stake address of the delegator.
balance:
type: object
properties:
utxoBalance:
type: string
description: The UTXO balance of the delegator.
rewardBalance:
type: string
description: The reward balance of the delegator.
rewardRestBalance:
type: string
description: The reward rest balance of the delegator.
delegatedAt:
type: object
properties:
txId:
type: string
description: The transaction ID of the delegation.
epochNo:
type: integer
description: The epoch number of the delegation.
time:
type: string
format: date-time
description: The time of the delegation.
'400':
description: Invalid DRep ID.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Provide a valid Drep ID
'500':
description: Internal server error.
/api/drep/{id}/stats/live:
get:
summary: Fetch live delegation stats for a Drep
description: Retrieves live delegation stats for a given Drep ID.
tags:
- DRep Delegation
parameters:
- name: id
in: path
required: true
description: The Drep ID (either in hexadecimal or Bech32 format).
schema:
type: string
example: 'drep15fy2nszna039pdregpryhzahnwcr2rred4nx2qaec7k07nvcq26'
responses:
'200':
description: Successfully fetched active delegation data
content:
application/json:
schema:
type: object
properties:
liveDelegators:
type: integer
example: 17
liveVotingPower:
type: string
example: '20027234084683'
influence:
type: string
example: '19.9043%'
voted:
type: integer
example: 17
notVoted:
type: integer
example: 300
'400':
description: Bad Request - Invalid Drep ID
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: 'Provide a valid Drep ID'
'500':
description: Internal Server Error
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: 'An unexpected error occurred'
/api/drep/{id}:
get:
summary: Get DRep details
description: Fetches DRep details including registration status, metadata, voting power, and transaction hashes for the provided address.
tags:
- DRep Information
operationId: getDrepDetails
parameters:
- name: id
in: path
required: true
description: Hex-encoded address or Bech32 address of DRep .
schema:
type: string
example: 'drep15fy2nszna039pdregpryhzahnwcr2rred4nx2qaec7k07nvcq26'
responses:
'200':
description: Successful response with DRep and SoleVoter details.
content:
application/json:
schema:
type: object
properties:
hasScript:
type: boolean
description: whether the drep has script or not
isRegisteredAsDRep:
type: boolean
description: Whether the address is currently registered as a DRep.
wasRegisteredAsDRep:
type: boolean
description: Whether the address was previously registered as a DRep.
isRegisteredAsSoleVoter:
type: boolean
description: Whether the address is currently registered as a Sole Voter.
wasRegisteredAsSoleVoter:
type: boolean
description: Whether the address was previously registered as a Sole Voter.
deposit:
type: integer
description: The current deposit value.
url:
type: string
description: The metadata URL.
dataHash:
type: string
description: Hash of the metadata.
votingPower:
type: integer
description: The current voting power.
dRepRegisterTxHash:
type: string
description: Transaction hash for DRep registration.
dRepRetireTxHash:
type: string
description: Transaction hash for DRep retirement.
soleVoterRegisterTxHash:
type: string
description: Transaction hash for Sole Voter registration.
soleVoterRetireTxHash:
type: string
description: Transaction hash for Sole Voter retirement.
'400':
description: Bad Request. Address is invalid or missing.
'500':
description: Internal Server Error. Something went wrong with the query or database.
/api/drep/{id}/vote:
get:
summary: Get voting details by DRep ID
description: Retrieve voting details for a specific DRep ID.
tags:
- DRep Information
parameters:
- name: id
in: path
required: true
description: Hex-encoded address or Bech32 address of DRep .
schema:
type: string
example: 'drep15fy2nszna039pdregpryhzahnwcr2rred4nx2qaec7k07nvcq26'
- in: query
name: page
schema:
type: number
default: 1
required: false
- in: query
name: size
schema:
type: number
default: 10
required: false
responses:
'200':
description: Successfully retrieved voting details of given Drep
content:
application/json:
schema:
type: object
properties:
govActionId:
type: string
description: Unique identifier for the government action, combining hash and index.
example: '8af0c0c97f532ebd72df62cf798ac19fc2ec952d411ece7de89#0'
title:
type: string
nullable: true
description: Title of the government action.
example: 'Example Title'
voteType:
type: string
description: Type of vote.
example: 'Abstain'
voteAnchorUrl:
type: string
format: uri
description: URL of the vote anchor.
example: 'https://example.com/aMBitupUUJucUCAg9sxVyHe4jjk41dzst9J'
voteAnchorHash:
type: string
description: Hash of the vote anchor data.
example: 'd6086a79267ab5fb7b56c8ab77f1e0dff2c3'
epochNo:
type: integer
description: Epoch number associated with the government action.
example: 762
time:
type: string
format: date-time
description: Timestamp of the action.
example: '2024-11-25T07:23:50'
voteTxHash:
type: string
description: Transaction hash of the vote.
example: '8d09be316ced784c1dd5bbcf7dccc0d63ea8de44b6e'
govActionType:
type: string
description: Type of government action.
example: 'NoConfidence'
'404':
description: DRep ID not found
'500':
description: Internal server error
/api/drep/{id}/delegation:
get:
summary: Get delegation details by DRep ID
description: Retrieve delegation details for a specific DRep ID.
tags:
- DRep Delegation
parameters:
- name: id
in: path
required: true
description: Hex-encoded address or Bech32 address of DRep.
schema:
type: string
example: 'drep15fy2nszna039pdregpryhzahnwcr2rred4nx2qaec7k07nvcq26'
- in: query
name: page
schema:
type: number
default: 1
required: false
- in: query
name: size
schema:
type: number
default: 10
required: false
responses:
'200':
description: A list of stake delegations.
content:
application/json:
schema:
type: array
items:
stakeAddress:
type: string
example: 'stake_test17pmm4fm6aahntj59y7p2xkmhkppp2yc3qlejgln997dcy4scqeut3'
action:
type: string
example: 'joined'
txId:
type: string
example: '08e5daeb18137efd8ad3ddbda6347f490a3efa8f839da3e2a18836ba0ff1bba8'
epochNo:
type: integer
example: 818
time:
type: string
example: '2025-01-20T08:35:02'
'404':
description: DRep ID not found
'500':
description: Internal server error
/api/drep/{id}/registration:
get:
summary: Get registration details by DRep ID
description: Retrieve registration details for a specific DRep ID.
tags:
- DRep Information
parameters:
- name: id
in: path
required: true
description: Hex-encoded address or Bech32 address of DRep .
schema:
type: string
example: 'drep15fy2nszna039pdregpryhzahnwcr2rred4nx2qaec7k07nvcq26'
- in: query
name: page
schema:
type: number
default: 1
required: false
- in: query
name: size
schema:
type: number
default: 10
required: false
responses:
'200':
description: Successfully retrieved voting details of given Drep
content:
application/json:
schema:
type: object
properties:
url:
type: string
example: 'https://xyz.com/drep-id/data/main/preview/test'
deposit:
type: integer
nullable: true
example: null
drepName:
type: string
example: 'name'
time:
type: string
format: date-time
example: '2024-12-12T08:11:03.000Z'
'404':
description: DRep ID not found
'500':
description: Internal server error
/api/address/balance:
get:
summary: Get faucet balance for a given address
description: Retrieves the balance for a specified stake address.
tags:
- Address
parameters:
- in: query
name: address
schema:
type: string
required: true
description: The stake address in hex format to query the balance.
responses:
'200':
description: The faucet balance for the given address
content:
application/json:
schema:
type: integer
description: The balance in lovelace (smallest unit of ADA)
example: 1000000000
'400':
description: Invalid address provided
'500':
description: Internal server error
/api/blockchain/epoch:
get:
summary: Get epoch number, start time, end time and duration
description: Get epoch number, start time, end time and duration
tags:
- Blockchain
parameters:
- in: query
name: limit
schema:
type: string
default: 5
required: false
description: The information of the last 'n' epochs.
responses:
'200':
description: epoch details
content:
application/json:
schema:
type: array
items:
type: object
properties:
epoch:
type: integer
description: Epoch number
example: 836
duration:
type: string
description: Epoch duration in milliseconds (as a string)
example: '22170000'
startTime:
type: string
format: date-time
description: Start time in ISO 8601 format
example: '2025-02-07T00:00:01.000Z'
endTime:
type: string
format: date-time
description: End time in ISO 8601 format
example: '2025-02-07T06:09:31.000Z'
'400':
description: Invalid address provided
'500':
description: Internal server error
/api/blockchain/block:
get:
summary: Get block details of a specific block number or get a list of details of latest 'n' blocks (default 5)
description: Get block details of a specific block number or get a list of details of latest 'n' blocks (default 5)
tags:
- Blockchain
parameters:
- in: query
name: block_no
schema:
type: integer
required: false
description: specify block number to get the details of
- in: query
name: limit
schema:
type: integer
required: false
description: number of latest block details
responses:
'200':
description: block details
'500':
description: Internal server error
/api/blockchain/epoch/params:
get:
summary: Get protocol parameters of specific epoch if specified. Else, get latest protocol parameters
description: Get protocol parameters of specific epoch if specified. Else, get latest protocol parameters
tags:
- Blockchain
parameters:
- in: query
name: epoch_no
schema:
type: integer
required: false
description: get protocol parameters of specified epoch.
responses:
'200':
description: protocol parameters
'400':
description: Invalid address provided
'500':
description: Internal server error
/api/blockchain/gov-state/committee:
get:
summary: Get Committee Gov-State
description: Get details regarding committee members, quorum, their expiration and previous gov action id
tags:
- Blockchain
responses:
'200':
description: gov state
'500':
description: Internal server error
/api/drep:
get:
summary: Fetch DRep list
description: Fetches the drep list.
tags:
- DRep Information
parameters:
- in: query
name: page
schema:
type: number
default: 1
required: false
- in: query
name: sort
schema:
type: string
enum: [VotingPower, RegistrationDate]
- in: query
name: status
schema:
type: string
enum: [Active, Inactive, Retired]
- in: query
name: size
schema:
type: number
default: 10
required: false
- in: query
name: search
description: Search by dRepId, dRepView or dRep Name
schema:
type: string
default: ''
required: false
responses:
200:
description: 'A paginated list of DRep details.'
content:
application/json:
schema:
type: 'object'
properties:
items:
type: 'array'
items:
type: 'object'
properties:
drepId:
type: 'string'
example: 'string'
description: 'DRep ID in hexadecimal format.'
view:
type: 'string'
example: 'string'
description: "DRep's view identifier."
url:
type: 'string'
format: 'uri'
example: 'string'
description: "URL to the DRep's metadata."
metadataHash:
type: 'string'
example: 'string'
description: 'Hash of the metadata.'
deposit:
type: 'integer'
format: 'int64'
example: 0
description: 'Deposit amount.'
votingPower:
type: 'integer'
format: 'int64'
example: 0
description: "DRep's amount."
active:
type: 'boolean'
example: false
description: 'Indicates if the DRep is active.'
latestTxHash:
type: 'string'
example: 'string'
description: 'Hash of the latest transaction.'
latestRegistrationDate:
type: 'string'
format: 'date-time'
example: '0000-00-00T00:00:00'
description: 'Date and time of the latest registration.'
page:
type: 'integer'
example: 0
description: 'Current page number.'
size:
type: 'integer'
example: 0
description: 'Number of items returned per page.'
total:
type: 'integer'
example: 0
description: 'Total number of items'
'400':
description: Invalid address provided
'500':
description: Internal server error
/api/governance/live-stake:
get:
summary: Get Total Live Stake
tags:
- Governance
responses:
200:
description: Successfully retrieved total live stake
content:
application/json:
schema:
type: string
example: '1000000000000'
500:
description: Internal server error
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: 'Internal Server Error'
/api/governance/active-stake:
get:
summary: Get Total Active Stake
tags:
- Governance
responses:
200:
description: Successfully retrieved total live stake
content:
application/json:
schema:
type: string
example: '1000000000000'
500:
description: Internal server error
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: 'Internal Server Error'
/api/proposal:
get:
summary: Fetch Proposal list
description: Fetches the Proposal list.
tags:
- Gov Action
parameters:
- in: query
name: vote_count
schema:
type: boolean
default: false
required: false
- in: query
name: page
schema:
type: number
default: 1
required: false
- in: query
name: size
schema:
type: number
default: 10
required: false
- in: query
name: sort
schema:
type: string
enum: ['Newly Created', 'Soon to Expire', 'Highest Yes Count']
- in: query
name: state
schema:
type: string
enum: ['Live', 'Expired', 'Ratified', 'Enacted', 'Dropped']
- in: query
name: type
schema:
type: array
items:
type: string
enum:
- ParameterChange
- HardForkInitiation
- TreasuryWithdrawals
- NoConfidence
- NewCommittee
- NewConstitution
- InfoAction
description: Filter by one or more action types.
explode: true
- in: query
name: proposal
description: Search by proposal id
schema:
type: string
default: ''
required: false
responses:
200:
description: 'A paginated list of Proposal details.'
content:
application/json:
schema:
type: 'object'
properties:
items:
type: 'array'
items:
type: 'object'
properties:
id:
type: integer
example: 418
txHash:
type: string
example: ''
index:
type: integer
example: 0
type:
type: string
example: ''
details:
type: object
additionalProperties: true
example: {}
expiryDate:
type: string
format: date-time
example: '2024-10-08T07:25:57.226978'
expiryEpochNon:
type: integer
example: 481
createdDate:
type: string
format: date-time