-
Notifications
You must be signed in to change notification settings - Fork 1
/
swagger.yaml
15651 lines (14468 loc) · 590 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
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
swagger: '2.0'
info:
title: Babylon - gRPC Gateway docs
description: A REST interface for state queries
version: 1.0.0
servers:
- url: http://api.testnet.babylonlabs.io/
description: Test Server
tags:
- name: BTCCheckpoint
description: The REST API for the BTC Checkpoint RPC Gateway module.
- name: BTCLightClient
description: The REST API for the BTC Light Client RPC Gateway module.
- name: Epoching
description: The REST API for the Epoching RPC Gateway module.
- name: Checkpointing
description: The REST API for the Checkpointing RPC Gateway module.
- name: ZoneConcierge
description: The REST API for the Zone Concierge RPC Gateway module.
paths:
/babylon/btccheckpoint/v1:
get:
summary: BtcCheckpointsInfo
description: >-
BtcCheckpointsInfo returns checkpoint info for a range of epochs
operationId: BtcCheckpointsInfo
tags:
- BTCCheckpoint
x-codeSamples:
- lang: 'cURL'
label: 'cURL'
source: |
curl --request GET \
--url 'http://api.testnet.babylonlabs.io/api/babylon/btccheckpoint/v1?start_epoch=babylond12345&end_epoch=babylond6789&pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
info_list:
type: array
items:
type: object
properties:
epoch_number:
type: string
format: uint64
title: epoch number of this checkpoint
example: '115'
earliest_btc_block_number:
type: string
format: uint64
example: '775253'
title: >-
height of earliest BTC block that includes this
checkpoint
earliest_btc_block_hash:
type: string
format: byte
example: 'fPDeiqchjmGLeDW2sWZVAUsAUJkx0AEAAAAAAAAAAAA='
title: hash of earliest BTC block that includes this checkpoint
vigilante_address_list:
type: array
items:
type: object
properties:
submitter:
type: string
format: byte
example: 'Zq3rFgfbY2UXHCj5PsILBQXev+E='
description: >-
TODO: this could probably be better typed
Address of the checkpoint submitter, extracted
from the checkpoint itself.
reporter:
type: string
format: byte
example: 'NzTm1XLg234H6RTTQiqAx2Auxq8='
title: >-
Address of the reporter which reported the
submissions, calculated from
submission message MsgInsertBTCSpvProof itself
title: list of vigilantes' addresses
pagination:
title: pagination defines the pagination in the response
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total
was set, its value is undefined otherwise
description: >-
PageResponse is to be embedded in gRPC response messages where
the
corresponding request message has used PageRequest.
message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
title: >-
QueryBtcCheckpointsInfoResponse is response type for the
Query/BtcCheckpointsInfo RPC method
'400':
description: 'Missing one or more of the required parameters: start_epoch/end_epoch/offset/limit/count_total/reverse.'
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 3
message:
type: string
example: 'strconv.ParseUint: parsing \"\": invalid syntax'
details:
type: array
example: []
'404':
description: Not Found - Incorrect base_url parameter.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Not Found
status:
type: integer
example: 404
'500':
description: If the start_epoch parameter number is larger than the end_epoch parameter number.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 2
message:
type: string
example: 'StartEpoch (1234567) should not be larger than EndEpoch (235678)'
details:
type: array
parameters:
- name: start_epoch
in: query
required: false
type: string
format: uint64
- name: end_epoch
in: query
required: false
type: string
format: uint64
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.
It is less efficient than using key. Only one of offset or key
should
be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.
If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include
a count of the total number of items available for pagination in
UIs.
count_total is only respected when offset is used. It is ignored
when key
is set.
in: query
required: false
type: boolean
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending order.
Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
/babylon/btccheckpoint/v1/params:
get:
summary: params
description: Parameters queries the parameters of the module.
operationId: BtcCheckpointParams
tags:
- BTCCheckpoint
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
params:
description: params holds all the parameters of this module.
type: object
properties:
btc_confirmation_depth:
type: string
format: uint64
example: '6'
title: >-
btc_confirmation_depth is the confirmation depth in BTC.
A block is considered irreversible only when it is at
least k-deep in BTC
(k in research paper)
checkpoint_finalization_timeout:
type: string
format: uint64
example: '100'
title: >-
checkpoint_finalization_timeout is the maximum time window
(measured in BTC blocks) between a checkpoint
- being submitted to BTC, and
- being reported back to BBN
If a checkpoint has not been reported back within w BTC
blocks, then BBN has dishonest majority and is stalling
checkpoints
(w in research paper)
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
'404':
description: Not Found - Incorrect base_url parameter.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Not Found
status:
type: integer
example: 404
/babylon/btccheckpoint/v1/{epoch_num}:
get:
summary: BtcCheckpointInfo
description: >-
BtcCheckpointInfo returns checkpoint info for a given epoch
operationId: BtcCheckpointInfo
tags:
- BTCCheckpoint
x-codeSamples:
- lang: 'cURL'
label: 'cURL'
source: |
curl --request GET \
--url 'http://api.testnet.babylonlabs.io/api/babylon/btccheckpoint/v1/127778958'\
--header 'accept: application/json' \
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
info:
type: object
properties:
epoch_number:
type: string
format: uint64
example: '115'
title: epoch number of this checkpoint
earliest_btc_block_number:
type: string
format: uint64
example: '775253'
title: height of earliest BTC block that includes this checkpoint
earliest_btc_block_hash:
type: string
format: byte
example: "fPDeiqchjmGLeDW2sWZVAUsAUJkx0AEAAAAAAAAAAAA="
title: hash of earliest BTC block that includes this checkpoint
vigilante_address_list:
type: array
items:
type: object
properties:
submitter:
type: string
format: byte
example: "Zq3rFgfbY2UXHCj5PsILBQXev+E="
description: >-
TODO: this could probably be better typed
Address of the checkpoint submitter, extracted from
the checkpoint itself.
reporter:
type: string
format: byte
example: "NzTm1XLg234H6RTTQiqAx2Auxq8="
title: >-
Address of the reporter which reported the
submissions, calculated from
submission message MsgInsertBTCSpvProof itself
title: list of vigilantes' addresses
title: >-
QueryBtcCheckpointInfoResponse is response type for the
Query/BtcCheckpointInfo RPC method
'400':
description: The epoch_num parameter is filled with an incorrect value format.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 3
message:
type: string
example: 'type mismatch, parameter: epoch_num, error: strconv.ParseUint: parsing \"babylonddev123\": invalid syntax'
details:
type: array
'404':
description: Not Found - Incorrect base_url parameter.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Not Found
status:
type: integer
example: 404
'500':
description: The epoch_num is correct and filled with the epoch_num that has not yet submitted.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 2
message:
type: string
example: 'checkpoint for given epoch not yet submitted'
details:
type: array
'501':
description: Empty epoch_num parameter value.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 12
message:
type: string
example: 'Not Implemented'
details:
type: array
parameters:
- name: epoch_num
description: >-
Number of epoch for which the earliest checkpointing btc height is
requested
in: path
required: true
type: string
format: uint64
/babylon/btccheckpoint/v1/{epoch_num}/submissions:
get:
summary: submissions
operationId: EpochSubmissions
tags:
- BTCCheckpoint
x-codeSamples:
- lang: 'cURL'
label: 'cURL'
source: |
curl --request GET \
--url 'http://api.testnet.babylonlabs.io/api/babylon/btccheckpoint/v1/127778958/submissions?&pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
keys:
type: array
items:
type: object
properties:
key:
type: array
items:
type: object
properties:
index:
type: integer
format: int64
hash:
type: string
format: byte
example: '00000000000000000002f03a87a968d5acb5dcba6a6fc30f88b4ff0a606067ff'
title: >-
Each provided OP_RETURN transaction can be idendtified
by hash of block in
which transaction was included and transaction index
in the block
title: >-
Checkpoint can be composed from multiple transactions, so to
identify whole
submission we need list of transaction keys.
Each submission can generally be identified by this list of
(txIdx, blockHash)
tuples.
Note: this could possibly be optimized as if transactions
were in one block
they would have the same block hash and different indexes,
but each blockhash
is only 33 (1 byte for prefix encoding and 32 byte hash),
so there should
be other strong arguments for this optimization
description: All submissions saved during an epoch.
pagination:
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total
was set, its value is undefined otherwise
description: >-
PageResponse is to be embedded in gRPC response messages where
the
corresponding request message has used PageRequest.
message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
'400':
description: 'Missing one or more of the required parameters: start_epoch/end_epoch/offset/limit/count_total/reverse.'
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 3
message:
type: string
example: 'strconv.ParseUint: parsing \"\": invalid syntax'
details:
type: array
example: []
'404':
description: Not Found - Incorrect base_url parameter.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Not Found
status:
type: integer
example: 404
parameters:
- name: epoch_num
description: Number of epoch for which submissions are requested
in: path
required: true
type: string
format: uint64
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.
It is less efficient than using key. Only one of offset or key
should
be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.
If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include
a count of the total number of items available for pagination in
UIs.
count_total is only respected when offset is used. It is ignored
when key
is set.
in: query
required: false
type: boolean
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending order.
Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
/babylon/btclightclient/v1/baseheader:
get:
summary: baseheader
operationId: BaseHeader
tags:
- BTCLightClient
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
header:
type: object
properties:
header:
type: string
format: byte
example: 00a0de299f62932875d8c8875778145a45770a2d03e0bd5dfc57020000000000000000007b0e60ce7287d210e9ee90269204380da52d882ece6039bc175ddc70b17e5dca3d16dc6320270717cb4e65d5
hash:
type: string
format: byte
example: 0000000000000000000622d71e81bf6139bf942f467070bb63d7abfc8a5d6afc
height:
type: string
format: uint64
example: '774766'
work:
type: string
format: byte
example: '169013589908578097467284'
'404':
description: Not Found
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Not Found
status:
type: integer
example: 404
/babylon/btclightclient/v1/contains:
get:
summary: contains
description: Contains checks whether a hash is maintained by the module.
operationId: Contains
tags:
- BTCLightClient
x-codeSamples:
- lang: 'cURL'
label: 'cURL'
source: |
curl --request GET \
--url 'http://api.testnet.babylonlabs.io/api/babylon/btclightclient/v1/contains?hash=qwrrasf345df'\
--header 'accept: application/json' \
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
contains:
type: boolean
example: false
description: >-
QueryContainsResponse is response type for the Query/Contains RPC
method.
'400':
description: Incorrect hash parameter.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 3
message:
type: string
example: 'illegal base64 data at input byte 4'
details:
type: array
'404':
description: Not Found - Incorrect base_url parameter.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Not Found
status:
type: integer
example: 404
'500':
description: Incorrect hash value length.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 13
message:
type: string
example: 'grpc: error unmarshalling request: invalid header hash length)'
details:
type: array
parameters:
- name: hash
in: query
required: false
type: string
format: byte
/babylon/btclightclient/v1/containsBytes:
get:
summary: containsBytes
description: |-
ContainsBytes is a temporary method that
checks whether a hash is maintained by the module.
See discussion at https://github.com/babylonlabs-io/babylon/pull/132
for more details.
operationId: ContainsBytes
tags:
- BTCLightClient
x-codeSamples:
- lang: 'cURL'
label: 'cURL'
source: |
curl --request GET \
--url 'http://api.testnet.babylonlabs.io/api/babylon/btclightclient/v1/containsBytes?hash=babylond345d32f'\
--header 'accept: application/json' \
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
contains:
type: boolean
description: >-
QueryContainsResponse is response type for the temporary
Query/ContainsBytes RPC method.
'400':
description: Incorrect hash parameter.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 3
message:
type: string
example: 'illegal base64 data at input byte 4'
details:
type: array
'404':
description: Not Found - Incorrect base_url parameter.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Not Found
status:
type: integer
example: 404
'500':
description: Incorrect hash value length.
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 13
message:
type: string
example: 'grpc: error unmarshalling request: invalid header hash length)'
details:
type: array
parameters:
- name: hash
in: query
required: false
type: string
format: byte
/babylon/btclightclient/v1/hashes:
get:
summary: hashes
description: Hashes retrieves the hashes maintained by the module.
operationId: Hashes
tags:
- BTCLightClient
x-codeSamples:
- lang: 'cURL'
label: 'cURL'
source: |
curl --request GET \
--url 'http://api.testnet.babylonlabs.io/api/babylon/btclightclient/v1/hashes?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
hashes:
type: array
items:
type: string
format: byte
example: 00000000000000000002f03a87a968d5acb5dcba6a6fc30f88b4ff0a606067ff
pagination:
type: object
properties:
next_key:
type: string
format: byte
example: "/rYA2+XfjvvRJfZecHvmyEBTYe+RNAMAAAAAAAAAAAA="
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
example: '479'
title: >-
total is total number of results available if
PageRequest.count_total
was set, its value is undefined otherwise
description: >-
PageResponse is to be embedded in gRPC response messages where
the
corresponding request message has used PageRequest.
message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
description: >-
QueryHashesResponse is response type for the Query/Hashes RPC
method.
'400':
description: 'Missing one or more of the required parameters: start_epoch/end_epoch/offset/limit/count_total/reverse.'
content:
application/json:
schema:
type: object
properties:
code:
type: integer
example: 3
message:
type: string
example: 'strconv.ParseUint: parsing \"\": invalid syntax'
details:
type: array
example: []
'404':
description: Not Found - Incorrect base_url.
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Not Found
status:
type: integer
example: 404
parameters:
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.
It is less efficient than using key. Only one of offset or key
should
be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.
If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include
a count of the total number of items available for pagination in
UIs.
count_total is only respected when offset is used. It is ignored
when key
is set.
in: query
required: false
type: boolean
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending order.
Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
/babylon/btclightclient/v1/mainchain:
get:
summary: mainchain
description: MainChain returns the canonical chain
operationId: MainChain
tags:
- BTCLightClient
x-codeSamples:
- lang: 'cURL'
label: 'cURL'
source: |
curl --request GET \
--url 'http://api.testnet.babylonlabs.io/api/babylon/btclightclient/v1/mainchain?pagination.key=2&pagination.offset=1&pagination.limit=10&pagination.count_total=true&pagination.reverse=true'\
--header 'accept: application/json' \
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
properties:
headers:
type: array
items:
type: object
properties:
header:
type: string