forked from coinbase/mesh-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.json
1885 lines (1885 loc) · 73.4 KB
/
api.json
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.2",
"info": {
"version":"1.4.4",
"title":"Rosetta",
"description":"Build Once. Integrate Your Blockchain Everywhere.",
"license": {
"name":"Apache 2.0",
"url":"http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"paths": {
"/network/list": {
"post": {
"summary":"Get List of Available Networks",
"description":"This endpoint returns a list of NetworkIdentifiers that the Rosetta server supports.",
"operationId":"networkList",
"tags": [
"Network"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/MetadataRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/NetworkListResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/network/status": {
"post": {
"summary":"Get Network Status",
"description":"This endpoint returns the current status of the network requested. Any NetworkIdentifier returned by /network/list should be accessible here.",
"operationId":"networkStatus",
"tags": [
"Network"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/NetworkRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/NetworkStatusResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/network/options": {
"post": {
"summary":"Get Network Options",
"description":"This endpoint returns the version information and allowed network-specific types for a NetworkIdentifier. Any NetworkIdentifier returned by /network/list should be accessible here. Because options are retrievable in the context of a NetworkIdentifier, it is possible to define unique options for each network.",
"operationId":"networkOptions",
"tags": [
"Network"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/NetworkRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/NetworkOptionsResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/block": {
"post": {
"summary":"Get a Block",
"description":"Get a block by its Block Identifier. If transactions are returned in the same call to the node as fetching the block, the response should include these transactions in the Block object. If not, an array of Transaction Identifiers should be returned so /block/transaction fetches can be done to get all transaction information. When requesting a block by the hash component of the BlockIdentifier, this request MUST be idempotent: repeated invocations for the same hash-identified block must return the exact same block contents. No such restriction is imposed when requesting a block by height, given that a chain reorg event might cause the specific block at height `n` to be set to a different one.",
"operationId":"block",
"tags": [
"Block"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/BlockRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/BlockResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/block/transaction": {
"post": {
"summary":"Get a Block Transaction",
"description":"Get a transaction in a block by its Transaction Identifier. This endpoint should only be used when querying a node for a block does not return all transactions contained within it. All transactions returned by this endpoint must be appended to any transactions returned by the /block method by consumers of this data. Fetching a transaction by hash is considered an Explorer Method (which is classified under the Future Work section). This method can be used to let consumers to paginate results when the block trasactions count is too big to be returned in a single BlockResponse. Calling this endpoint requires reference to a BlockIdentifier because transaction parsing can change depending on which block contains the transaction. For example, in Bitcoin it is necessary to know which block contains a transaction to determine the destination of fee payments. Without specifying a block identifier, the node would have to infer which block to use (which could change during a re-org). Implementations that require fetching previous transactions to populate the response (ex: Previous UTXOs in Bitcoin) may find it useful to run a cache within the Rosetta server in the /data directory (on a path that does not conflict with the node).",
"operationId":"blockTransaction",
"tags": [
"Block"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/BlockTransactionRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/BlockTransactionResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/mempool": {
"post": {
"summary":"Get All Mempool Transactions",
"description":"Get all Transaction Identifiers in the mempool",
"operationId":"mempool",
"tags": [
"Mempool"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/NetworkRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/MempoolResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/mempool/transaction": {
"post": {
"summary":"Get a Mempool Transaction",
"description":"Get a transaction in the mempool by its Transaction Identifier. This is a separate request than fetching a block transaction (/block/transaction) because some blockchain nodes need to know that a transaction query is for something in the mempool instead of a transaction in a block. Transactions may not be fully parsable until they are in a block (ex: may not be possible to determine the fee to pay before a transaction is executed). On this endpoint, it is ok that returned transactions are only estimates of what may actually be included in a block.",
"operationId":"mempoolTransaction",
"tags": [
"Mempool"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/MempoolTransactionRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/MempoolTransactionResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/account/balance": {
"post": {
"summary":"Get an Account Balance",
"description":"Get an array of all AccountBalances for an AccountIdentifier and the BlockIdentifier at which the balance lookup was performed. The BlockIdentifier must always be returned because some consumers of account balance data need to know specifically at which block the balance was calculated to compare balances they compute from operations with the balance returned by the node. It is important to note that making a balance request for an account without populating the SubAccountIdentifier should not result in the balance of all possible SubAccountIdentifiers being returned. Rather, it should result in the balance pertaining to no SubAccountIdentifiers being returned (sometimes called the liquid balance). To get all balances associated with an account, it may be necessary to perform multiple balance requests with unique AccountIdentifiers. It is also possible to perform a historical balance lookup (if the server supports it) by passing in an optional BlockIdentifier.",
"operationId":"accountBalance",
"tags": [
"Account"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/AccountBalanceRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/AccountBalanceResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/construction/derive": {
"post": {
"summary":"Derive an AccountIdentifier from a PublicKey",
"description":"Derive returns the AccountIdentifier associated with a public key. Blockchains that require an on-chain action to create an account should not implement this method.",
"operationId":"constructionDerive",
"tags": [
"Construction"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionDeriveRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionDeriveResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/construction/preprocess": {
"post": {
"summary":"Create a Request to Fetch Metadata",
"description":"Preprocess is called prior to `/construction/payloads` to construct a request for any metadata that is needed for transaction construction given (i.e. account nonce). The `options` object returned from this endpoint will be sent to the `/construction/metadata` endpoint UNMODIFIED by the caller (in an offline execution environment). If your Construction API implementation has configuration options, they MUST be specified in the `/construction/preprocess` request (in the `metadata` field).",
"operationId":"constructionPreprocess",
"tags": [
"Construction"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionPreprocessRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionPreprocessResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/construction/metadata": {
"post": {
"summary":"Get Metadata for Transaction Construction",
"description":"Get any information required to construct a transaction for a specific network. Metadata returned here could be a recent hash to use, an account sequence number, or even arbitrary chain state. The request used when calling this endpoint is created by calling `/construction/preprocess` in an offline environment. You should NEVER assume that the request sent to this endpoint will be created by the caller or populated with any custom parameters. This must occur in `/construction/preprocess`. It is important to clarify that this endpoint should not pre-construct any transactions for the client (this should happen in `/construction/payloads`). This endpoint is left purposely unstructured because of the wide scope of metadata that could be required.",
"operationId":"constructionMetadata",
"tags": [
"Construction"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionMetadataRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionMetadataResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/construction/payloads": {
"post": {
"summary":"Generate an Unsigned Transaction and Signing Payloads",
"description":"Payloads is called with an array of operations and the response from `/construction/metadata`. It returns an unsigned transaction blob and a collection of payloads that must be signed by particular AccountIdentifiers using a certain SignatureType. The array of operations provided in transaction construction often times can not specify all \"effects\" of a transaction (consider invoked transactions in Ethereum). However, they can deterministically specify the \"intent\" of the transaction, which is sufficient for construction. For this reason, parsing the corresponding transaction in the Data API (when it lands on chain) will contain a superset of whatever operations were provided during construction.",
"operationId":"constructionPayloads",
"tags": [
"Construction"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionPayloadsRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionPayloadsResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/construction/combine": {
"post": {
"summary":"Create Network Transaction from Signatures",
"description":"Combine creates a network-specific transaction from an unsigned transaction and an array of provided signatures. The signed transaction returned from this method will be sent to the `/construction/submit` endpoint by the caller.",
"operationId":"constructionCombine",
"tags": [
"Construction"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionCombineRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionCombineResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/construction/parse": {
"post": {
"summary":"Parse a Transaction",
"description":"Parse is called on both unsigned and signed transactions to understand the intent of the formulated transaction. This is run as a sanity check before signing (after `/construction/payloads`) and before broadcast (after `/construction/combine`). ",
"operationId":"constructionParse",
"tags": [
"Construction"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionParseRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionParseResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/construction/hash": {
"post": {
"summary":"Get the Hash of a Signed Transaction",
"description":"TransactionHash returns the network-specific transaction hash for a signed transaction.",
"operationId":"constructionHash",
"tags": [
"Construction"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionHashRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/TransactionIdentifierResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
},
"/construction/submit": {
"post": {
"summary":"Submit a Signed Transaction",
"description":"Submit a pre-signed transaction to the node. This call should not block on the transaction being included in a block. Rather, it should return immediately with an indication of whether or not the transaction was included in the mempool. The transaction submission response should only return a 200 status if the submitted transaction could be included in the mempool. Otherwise, it should return an error.",
"operationId":"constructionSubmit",
"tags": [
"Construction"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/ConstructionSubmitRequest"
}
}
}
},
"responses": {
"200": {
"description":"Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/TransactionIdentifierResponse"
}
}
}
},
"500": {
"description":"unexpected error",
"content": {
"application/json": {
"schema": {
"$ref":"#/components/schemas/Error"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"NetworkIdentifier": {
"description":"The network_identifier specifies which network a particular object is associated with.",
"type":"object",
"required": [
"blockchain",
"network"
],
"properties": {
"blockchain": {
"type":"string",
"example":"bitcoin"
},
"network": {
"description":"If a blockchain has a specific chain-id or network identifier, it should go in this field. It is up to the client to determine which network-specific identifier is mainnet or testnet.",
"type":"string",
"example":"mainnet"
},
"sub_network_identifier": {
"$ref":"#/components/schemas/SubNetworkIdentifier"
}
}
},
"SubNetworkIdentifier": {
"description":"In blockchains with sharded state, the SubNetworkIdentifier is required to query some object on a specific shard. This identifier is optional for all non-sharded blockchains.",
"type":"object",
"required": [
"network"
],
"properties": {
"network": {
"type":"string",
"example":"shard 1"
},
"metadata": {
"type":"object",
"example": {
"producer":"0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
}
}
}
},
"BlockIdentifier": {
"description":"The block_identifier uniquely identifies a block in a particular network.",
"type":"object",
"required": [
"index",
"hash"
],
"properties": {
"index": {
"description":"This is also known as the block height.",
"type":"integer",
"format":"int64",
"example": 1123941
},
"hash": {
"type":"string",
"example":"0x1f2cc6c5027d2f201a5453ad1119574d2aed23a392654742ac3c78783c071f85"
}
}
},
"PartialBlockIdentifier": {
"type":"object",
"description":"When fetching data by BlockIdentifier, it may be possible to only specify the index or hash. If neither property is specified, it is assumed that the client is making a request at the current block.",
"properties": {
"index": {
"type":"integer",
"format":"int64",
"example": 1123941
},
"hash": {
"type":"string",
"example":"0x1f2cc6c5027d2f201a5453ad1119574d2aed23a392654742ac3c78783c071f85"
}
}
},
"TransactionIdentifier": {
"description":"The transaction_identifier uniquely identifies a transaction in a particular network and block or in the mempool.",
"type":"object",
"required": [
"hash"
],
"properties": {
"hash": {
"description":"Any transactions that are attributable only to a block (ex: a block event) should use the hash of the block as the identifier.",
"type":"string",
"example":"0x2f23fd8cca835af21f3ac375bac601f97ead75f2e79143bdf71fe2c4be043e8f"
}
}
},
"OperationIdentifier": {
"description":"The operation_identifier uniquely identifies an operation within a transaction.",
"type":"object",
"required": [
"index"
],
"properties": {
"index": {
"description":"The operation index is used to ensure each operation has a unique identifier within a transaction. This index is only relative to the transaction and NOT GLOBAL. The operations in each transaction should start from index 0. To clarify, there may not be any notion of an operation index in the blockchain being described.",
"type":"integer",
"format":"int64",
"minimum": 0,
"example": 5
},
"network_index": {
"description":"Some blockchains specify an operation index that is essential for client use. For example, Bitcoin uses a network_index to identify which UTXO was used in a transaction. network_index should not be populated if there is no notion of an operation index in a blockchain (typically most account-based blockchains).",
"type":"integer",
"format":"int64",
"minimum": 0,
"example": 0
}
}
},
"AccountIdentifier": {
"description":"The account_identifier uniquely identifies an account within a network. All fields in the account_identifier are utilized to determine this uniqueness (including the metadata field, if populated).",
"type":"object",
"required": [
"address"
],
"properties": {
"address": {
"description":"The address may be a cryptographic public key (or some encoding of it) or a provided username.",
"type":"string",
"example":"0x3a065000ab4183c6bf581dc1e55a605455fc6d61"
},
"sub_account": {
"$ref":"#/components/schemas/SubAccountIdentifier"
},
"metadata": {
"description":"Blockchains that utilize a username model (where the address is not a derivative of a cryptographic public key) should specify the public key(s) owned by the address in metadata.",
"type":"object"
}
}
},
"SubAccountIdentifier": {
"description":"An account may have state specific to a contract address (ERC-20 token) and/or a stake (delegated balance). The sub_account_identifier should specify which state (if applicable) an account instantiation refers to.",
"type":"object",
"required": [
"address"
],
"properties": {
"address": {
"description":"The SubAccount address may be a cryptographic value or some other identifier (ex: bonded) that uniquely specifies a SubAccount.",
"type":"string",
"example":"0x6b175474e89094c44da98b954eedeac495271d0f"
},
"metadata": {
"description":"If the SubAccount address is not sufficient to uniquely specify a SubAccount, any other identifying information can be stored here. It is important to note that two SubAccounts with identical addresses but differing metadata will not be considered equal by clients.",
"type":"object"
}
}
},
"Block": {
"description":"Blocks contain an array of Transactions that occurred at a particular BlockIdentifier. A hard requirement for blocks returned by Rosetta implementations is that they MUST be _inalterable_: once a client has requested and received a block identified by a specific BlockIndentifier, all future calls for that same BlockIdentifier must return the same block contents.",
"type":"object",
"required": [
"block_identifier",
"parent_block_identifier",
"timestamp",
"transactions"
],
"properties": {
"block_identifier": {
"$ref":"#/components/schemas/BlockIdentifier"
},
"parent_block_identifier": {
"$ref":"#/components/schemas/BlockIdentifier"
},
"timestamp": {
"$ref":"#/components/schemas/Timestamp"
},
"transactions": {
"type":"array",
"items": {
"$ref":"#/components/schemas/Transaction"
}
},
"metadata": {
"type":"object",
"example": {
"transactions_root":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"difficulty":"123891724987128947"
}
}
}
},
"Transaction": {
"description":"Transactions contain an array of Operations that are attributable to the same TransactionIdentifier.",
"type":"object",
"required": [
"transaction_identifier",
"operations"
],
"properties": {
"transaction_identifier": {
"$ref":"#/components/schemas/TransactionIdentifier"
},
"operations": {
"type":"array",
"items": {
"$ref":"#/components/schemas/Operation"
}
},
"metadata": {
"description":"Transactions that are related to other transactions (like a cross-shard transaction) should include the tranaction_identifier of these transactions in the metadata.",
"type":"object",
"example": {
"size": 12378,
"lockTime": 1582272577
}
}
}
},
"Operation": {
"description":"Operations contain all balance-changing information within a transaction. They are always one-sided (only affect 1 AccountIdentifier) and can succeed or fail independently from a Transaction.",
"type":"object",
"required": [
"operation_identifier",
"type",
"status"
],
"properties": {
"operation_identifier": {
"$ref":"#/components/schemas/OperationIdentifier"
},
"related_operations": {
"description":"Restrict referenced related_operations to identifier indexes < the current operation_identifier.index. This ensures there exists a clear DAG-structure of relations. Since operations are one-sided, one could imagine relating operations in a single transfer or linking operations in a call tree.",
"type":"array",
"items": {
"$ref":"#/components/schemas/OperationIdentifier"
},
"example": [
{
"index": 1
},
{
"index": 2
}
]
},
"type": {
"description":"The network-specific type of the operation. Ensure that any type that can be returned here is also specified in the NetworkOptionsResponse. This can be very useful to downstream consumers that parse all block data.",
"type":"string",
"example":"Transfer"
},
"status": {
"description":"The network-specific status of the operation. Status is not defined on the transaction object because blockchains with smart contracts may have transactions that partially apply. Blockchains with atomic transactions (all operations succeed or all operations fail) will have the same status for each operation.",
"type":"string",
"example":"Reverted"
},
"account": {
"$ref":"#/components/schemas/AccountIdentifier"
},
"amount": {
"$ref":"#/components/schemas/Amount"
},
"coin_change": {
"$ref":"#/components/schemas/CoinChange"
},
"metadata": {
"type":"object",
"example": {
"asm":"304502201fd8abb11443f8b1b9a04e0495e0543d05611473a790c8939f089d073f90509a022100f4677825136605d732e2126d09a2d38c20c75946cd9fc239c0497e84c634e3dd01 03301a8259a12e35694cc22ebc45fee635f4993064190f6ce96e7fb19a03bb6be2",
"hex":"48304502201fd8abb11443f8b1b9a04e0495e0543d05611473a790c8939f089d073f90509a022100f4677825136605d732e2126d09a2d38c20c75946cd9fc239c0497e84c634e3dd012103301a8259a12e35694cc22ebc45fee635f4993064190f6ce96e7fb19a03bb6be2"
}
}
}
},
"Amount": {
"description":"Amount is some Value of a Currency. It is considered invalid to specify a Value without a Currency.",
"type":"object",
"required": [
"value",
"currency"
],
"properties": {
"value": {
"description":"Value of the transaction in atomic units represented as an arbitrary-sized signed integer. For example, 1 BTC would be represented by a value of 100000000.",
"type":"string",
"example":"1238089899992"
},
"currency": {
"$ref":"#/components/schemas/Currency"
},
"metadata": {
"type":"object"
}
}
},
"Currency": {
"description":"Currency is composed of a canonical Symbol and Decimals. This Decimals value is used to convert an Amount.Value from atomic units (Satoshis) to standard units (Bitcoins).",
"type":"object",
"required": [
"symbol",
"decimals"
],
"properties": {
"symbol": {
"description":"Canonical symbol associated with a currency.",
"type":"string",
"example":"BTC"
},
"decimals": {
"description":"Number of decimal places in the standard unit representation of the amount. For example, BTC has 8 decimals. Note that it is not possible to represent the value of some currency in atomic units that is not base 10.",
"type":"integer",
"format":"int32",
"minimum": 0,
"example": 8
},
"metadata": {
"description":"Any additional information related to the currency itself. For example, it would be useful to populate this object with the contract address of an ERC-20 token.",
"type":"object",
"example": {