-
Notifications
You must be signed in to change notification settings - Fork 2
/
rosetta-spec-api.yaml
1638 lines (1595 loc) · 59.1 KB
/
rosetta-spec-api.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
# Copyright 2020 Coinbase, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
openapi: 3.0.2
info:
version: 1.4.13
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's 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'
/account/coins:
post:
summary: Get an Account's Unspent Coins
description: |
Get an array of all unspent coins for an AccountIdentifier and the
BlockIdentifier at which the lookup was performed. If your implementation
does not support coins (i.e. it is for an account-based blockchain),
you do not need to implement this endpoint. If you implementation does
support coins (i.e. it is fro a UTXO-based blockchain), you MUST
also complete the `/account/balance` endpoint.
It is important to note that making a coins request for an account
without populating the SubAccountIdentifier should not result in the
coins of all possible SubAccountIdentifiers being returned. Rather,
it should result in the coins pertaining to no SubAccountIdentifiers
being returned. To get all coins associated with an account, it may be
necessary to perform multiple coin requests with unique AccountIdentifiers.
Optionally, an implementation may choose to support updating an AccountIdentifier's
unspent coins based on the contents of the mempool. Note, using this functionality
breaks any guarantee of idempotency.
operationId: accountCoins
tags:
- Account
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AccountCoinsRequest'
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: '#/components/schemas/AccountCoinsResponse'
'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'
/call:
post:
summary: Make a Network-Specific Procedure Call
description: |
Call invokes an arbitrary, network-specific procedure call with network-specific
parameters. The guidance for what this endpoint should or could do is
purposely left vague. In Ethereum, this could be used to invoke `eth_call`
to implement an entire Rosetta API interface for some smart contract that
is not parsed by the implementation creator (like a DEX). This endpoint
could also be used to provide access to data that does not map
to any Rosetta models instead of requiring an integrator to use some
network-specific SDK and call some network-specific endpoint (like surfacing
staking parameters).
Call is NOT a replacement for implementing Rosetta API endpoints or mapping
network-specific data to Rosetta models. Rather, it enables developers to build
additional Rosetta API interfaces for things they care about without introducing
complexity into a base-level Rosetta implementation. Simply put, imagine
that the average integrator will use layered Rosetta API implementations
that each surfaces unique data.
operationId: call
tags:
- Call
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CallRequest'
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: '#/components/schemas/CallResponse'
'500':
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/events/blocks:
post:
summary: |
[INDEXER] Get a range of BlockEvents
description: |
`/events/blocks` allows the caller to query a sequence
of BlockEvents indicating which blocks were added and
removed from storage to reach the current state.
Following BlockEvents allows lightweight clients to update
their state without needing to implement their own syncing
logic (like finding the common parent in a reorg).
`/events/blocks` is considered an "indexer" endpoint
and Rosetta implementations are not required to complete it
to adhere to the Rosetta spec. However, any Rosetta "indexer"
MUST support this endpoint.
operationId: eventsBlocks
tags:
- Events
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EventsBlocksRequest'
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: '#/components/schemas/EventsBlocksResponse'
'500':
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/search/transactions:
post:
summary: |
[INDEXER] Search for Transactions
description: |
`/search/transactions` allows the caller to search for
transactions that meet certain conditions. Some conditions
include matching a transaction hash, containing an
operation with a certain status, or containing an operation
that affects a certain account.
`/search/transactions` is considered an "indexer" endpoint
and Rosetta implementations are not required to complete it
to adhere to the Rosetta spec. However, any Rosetta "indexer"
MUST support this endpoint.
operationId: searchTransactions
tags:
- Search
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SearchTransactionsRequest'
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: '#/components/schemas/SearchTransactionsResponse'
'500':
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
# Identifiers
NetworkIdentifier:
$ref: 'models/NetworkIdentifier.yaml'
SubNetworkIdentifier:
$ref: 'models/SubNetworkIdentifier.yaml'
BlockIdentifier:
$ref: 'models/BlockIdentifier.yaml'
PartialBlockIdentifier:
$ref: 'models/PartialBlockIdentifier.yaml'
TransactionIdentifier:
$ref: 'models/TransactionIdentifier.yaml'
OperationIdentifier:
$ref: 'models/OperationIdentifier.yaml'
AccountIdentifier:
$ref: 'models/AccountIdentifier.yaml'
SubAccountIdentifier:
$ref: 'models/SubAccountIdentifier.yaml'
# Models
Block:
$ref: 'models/Block.yaml'
Transaction:
$ref: 'models/Transaction.yaml'
Operation:
$ref: 'models/Operation.yaml'
Amount:
$ref: 'models/Amount.yaml'
Currency:
$ref: 'models/Currency.yaml'
SyncStatus:
$ref: 'models/SyncStatus.yaml'
Peer:
$ref: 'models/Peer.yaml'
Version:
$ref: 'models/Version.yaml'
Allow:
$ref: 'models/Allow.yaml'
OperationStatus:
$ref: 'models/OperationStatus.yaml'
Timestamp:
$ref: 'models/Timestamp.yaml'
PublicKey:
$ref: 'models/PublicKey.yaml'
CurveType:
$ref: 'models/CurveType.yaml'
SigningPayload:
$ref: 'models/SigningPayload.yaml'
Signature:
$ref: 'models/Signature.yaml'
SignatureType:
$ref: 'models/SignatureType.yaml'
CoinAction:
$ref: 'models/CoinAction.yaml'
CoinIdentifier:
$ref: 'models/CoinIdentifier.yaml'
CoinChange:
$ref: 'models/CoinChange.yaml'
Coin:
$ref: 'models/Coin.yaml'
BalanceExemption:
$ref: 'models/BalanceExemption.yaml'
ExemptionType:
$ref: 'models/ExemptionType.yaml'
BlockEvent:
$ref: 'models/BlockEvent.yaml'
BlockEventType:
$ref: 'models/BlockEventType.yaml'
Operator:
$ref: 'models/Operator.yaml'
BlockTransaction:
$ref: 'models/BlockTransaction.yaml'
RelatedTransaction:
$ref: 'models/RelatedTransaction.yaml'
Direction:
$ref: 'models/Direction.yaml'
Case:
$ref: 'models/Case.yaml'
# Request/Responses
AccountBalanceRequest:
description: |
An AccountBalanceRequest is utilized to make a balance request
on the /account/balance endpoint. If the block_identifier is populated,
a historical balance query should be performed.
type: object
required:
- network_identifier
- account_identifier
properties:
network_identifier:
$ref: '#/components/schemas/NetworkIdentifier'
account_identifier:
$ref: '#/components/schemas/AccountIdentifier'
block_identifier:
$ref: '#/components/schemas/PartialBlockIdentifier'
currencies:
type: array
description: |
In some cases, the caller may not want to retrieve all available
balances for an AccountIdentifier. If the currencies field
is populated, only balances for the specified currencies
will be returned. If not populated, all available balances
will be returned.
items:
$ref: '#/components/schemas/Currency'
AccountBalanceResponse:
description: |
An AccountBalanceResponse is returned on the /account/balance endpoint.
If an account has a balance for each AccountIdentifier describing it
(ex: an ERC-20 token balance on a few smart contracts), an account
balance request must be made with each AccountIdentifier.
The `coins` field was removed and replaced by by `/account/coins` in `v1.4.7`.
type: object
required:
- block_identifier
- balances
properties:
block_identifier:
$ref: '#/components/schemas/BlockIdentifier'
balances:
type: array
description: |
A single account may have a balance in multiple currencies.
items:
$ref: '#/components/schemas/Amount'
metadata:
description: |
Account-based blockchains that utilize a nonce or sequence number
should include that number in the metadata. This number could be
unique to the identifier or global across the account address.
type: object
example:
sequence_number: 23
AccountCoinsRequest:
description: |
AccountCoinsRequest is utilized to make a request on the /account/coins
endpoint.
type: object
required:
- network_identifier
- account_identifier
- include_mempool
properties:
network_identifier:
$ref: '#/components/schemas/NetworkIdentifier'
account_identifier:
$ref: '#/components/schemas/AccountIdentifier'
include_mempool:
type: boolean
description: |
Include state from the mempool when looking up an account's
unspent coins. Note, using this functionality
breaks any guarantee of idempotency.
currencies:
type: array
description: |
In some cases, the caller may not want to retrieve coins for all
currencies for an AccountIdentifier. If the currencies field
is populated, only coins for the specified currencies
will be returned. If not populated, all unspent coins
will be returned.
items:
$ref: '#/components/schemas/Currency'
AccountCoinsResponse:
description: |
AccountCoinsResponse is returned on the /account/coins endpoint and includes
all unspent Coins owned by an AccountIdentifier.
type: object
required:
- block_identifier
- coins
properties:
block_identifier:
$ref: '#/components/schemas/BlockIdentifier'
coins:
type: array
description: |
If a blockchain is UTXO-based, all unspent Coins owned by an account_identifier
should be returned alongside the balance. It is highly recommended to
populate this field so that users of the Rosetta API implementation
don't need to maintain their own indexer to track their UTXOs.
items:
$ref: '#/components/schemas/Coin'
metadata:
description: |
Account-based blockchains that utilize a nonce or sequence number
should include that number in the metadata. This number could be
unique to the identifier or global across the account address.
type: object
example:
sequence_number: 23
BlockRequest:
description: |
A BlockRequest is utilized to make a block request on the
/block endpoint.
type: object
required:
- network_identifier
- block_identifier
properties:
network_identifier:
$ref: '#/components/schemas/NetworkIdentifier'
block_identifier:
$ref: '#/components/schemas/PartialBlockIdentifier'
BlockResponse:
description: |
A BlockResponse includes a fully-populated block or a partially-populated
block with a list of other transactions to fetch (other_transactions).
As a result of the consensus algorithm of some blockchains, blocks
can be omitted (i.e. certain block indices can be skipped). If a query
for one of these omitted indices is made, the response should not include
a `Block` object.
It is VERY important to note that blocks MUST still form a canonical,
connected chain of blocks where each block has a unique index. In other words,
the `PartialBlockIdentifier` of a block after an omitted block should
reference the last non-omitted block.
type: object
properties:
block:
$ref: '#/components/schemas/Block'
other_transactions:
description: |
Some blockchains may require additional transactions to be fetched
that weren't returned in the block response
(ex: block only returns transaction hashes). For blockchains with a
lot of transactions in each block, this
can be very useful as consumers can concurrently fetch all
transactions returned.
type: array
items:
$ref: '#/components/schemas/TransactionIdentifier'
BlockTransactionRequest:
description: |
A BlockTransactionRequest is used to fetch a Transaction included in a
block that is not returned in a BlockResponse.
type: object
required:
- network_identifier
- block_identifier
- transaction_identifier
properties:
network_identifier:
$ref: '#/components/schemas/NetworkIdentifier'
block_identifier:
$ref: '#/components/schemas/BlockIdentifier'
transaction_identifier:
$ref: '#/components/schemas/TransactionIdentifier'
BlockTransactionResponse:
description: |
A BlockTransactionResponse contains information about a block transaction.
type: object
required:
- transaction
properties:
transaction:
$ref: '#/components/schemas/Transaction'
MempoolResponse:
description: |
A MempoolResponse contains all transaction identifiers in the mempool
for a particular network_identifier.
type: object
required:
- transaction_identifiers
properties:
transaction_identifiers: