Repository navigation
Expand file tree
/
Copy pathstellar-rpc.openrpc.json
More file actions
2453 lines (2453 loc) · 260 KB
/
Copy pathstellar-rpc.openrpc.json
File metadata and controls
2453 lines (2453 loc) · 260 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
{
"openrpc": "1.2.6",
"info": {
"title": "Stellar RPC",
"description": "Stellar-RPC allows you to communicate directly with Soroban via a JSON RPC interface.",
"termsOfService": "https://stellar.org/terms-of-service",
"contact": {
"name": "Stellar Development Foundation",
"url": "https://stellar.org/connect",
"email": "hello@stellar.org"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "27.1.1"
},
"servers": [
{
"name": "Testnet",
"url": "https://soroban-testnet.stellar.org:443",
"summary": "Publicly available RPC server maintained by SDF, operating on the Testnet test network.",
"description": "Testnet is meant to be a stable network that runs a production (or near-production) version of the Stellar network."
},
{
"name": "Futurenet",
"url": "https://rpc-futurenet.stellar.org:443",
"summary": "Publicly available RPC server maintained by SDF, operating on the Futurenet test network.",
"description": "Futurenet is meant to be a bleeding-edge, experimental network that runs an early, test version of the Stellar network."
}
],
"methods": [
{
"name": "getEvents",
"summary": "returns contract events",
"description": "Clients can request a filtered list of events emitted by a given ledger range.\n\nStellar-RPC retains a bounded, ledger-denominated history of recent transactions and events, configured by a single history-retention-window setting with a stock default of 120960 ledgers (about 7 days, depending on ledger cadence); requests are served from within that retained range. The effective window and the ledgers currently available can be inspected via the getHealth method (ledgerRetentionWindow, oldestLedger, latestLedger).\n\nNote, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to \"ingest\" events into their own database for querying and serving.\n\nIf making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received.",
"externalDocs": {
"url": "https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getEvents"
},
"paramStructure": "by-name",
"params": [
{
"name": "startLedger",
"summary": "ledger to begin searching from",
"description": "Ledger sequence number to start fetching responses from (inclusive). This method will return an error if `startLedger` is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. If a cursor is included in the request, `startLedger` must be omitted.",
"required": false,
"schema": {
"title": "ledgerSequence",
"description": "Sequence number of the ledger.",
"type": "number"
}
},
{
"name": "endLedger",
"summary": "ledger represents the end of search window",
"description": "Ledger sequence number represents the end of search window (exclusive). If a cursor is included in the request, `endLedger` must be omitted.",
"required": false,
"schema": {
"title": "ledgerSequence",
"description": "Sequence number of the ledger.",
"type": "number"
}
},
{
"name": "filters",
"summary": "filters to narrow events search",
"description": "List of filters for the returned events. Events matching any of the filters are included. To match a filter, an event must match both a contractId and a topic. Maximum 5 filters are allowed per request.",
"schema": {
"type": "array",
"maxItems": 5,
"items": {
"type": "object",
"required": [],
"properties": {
"type": {
"title": "type",
"type": "string",
"description": "Filter events by type. If omitted, all event types are included.",
"enum": [
"system",
"contract"
]
},
"contractIds": {
"title": "contractIds",
"type": "array",
"description": "List of contract IDs to query for events. If omitted, return events for all contracts. Maximum 5 contract IDs are allowed per request.",
"maxItems": 5,
"items": {
"title": "contractId",
"description": "A StrKey representation of a contract address (`C...`). ([SEP-23](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0023.md#specification)).",
"type": "string"
}
},
"topics": {
"title": "topics",
"type": "array",
"description": "A list of topic filters. Each filter is itself an array of one to four `SegmentMatcher` elements (see below). If omitted, query for all events. If multiple filters are specified, events will be included if they match any of the filters.",
"maxItems": 5,
"items": {
"type": "array",
"description": "A `TopicFilter` is `SegmentMatcher[]`\n\n- The list can be 1-4 `SegmentMatchers` long.",
"minItems": 1,
"maxItems": 4,
"items": {
"title": "SegmentMatcher",
"type": "string",
"description": "A `SegmentMatcher` is one of the following:\n\n- For an exact segment match, a string containing a base64-encoded ScVal\n\n- The string \"*\" functions as a wildcard that matches exactly one segment.\n\n- The string \"**\" matches zero or more segments and is used to match events with variable topic lengths. It can only appear as the final segment and does not count towards the 4-segment limit.\n\n"
}
}
}
}
}
},
"required": false
},
{
"name": "pagination",
"summary": "pagination options",
"description": "Pagination in stellar-rpc is similar to pagination in Horizon. See [Pagination](https://developers.stellar.org/docs/data/rpc/api-reference/structure/pagination).",
"required": false,
"schema": {
"type": "object",
"required": [],
"properties": {
"cursor": {
"type": "string",
"description": "An opaque string which acts as a paging token. To obtain the next page of results occurring after a given response set this value to the `cursor` field of the response."
},
"limit": {
"type": "number",
"description": "The maximum number of records returned. The limit for getEvents can range from 1 to 10000 - an upper limit that is hardcoded in Stellar-RPC for performance reasons. If this argument isn't designated, it defaults to 100."
}
}
}
},
{
"name": "xdrFormat",
"summary": "chooses a response format for XDR fields: 'json' or 'base64'",
"required": false,
"description": "Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.",
"schema": {
"title": "xdrFormat",
"type": "string",
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
"result": {
"name": "getEventsResult",
"schema": {
"type": "object",
"properties": {
"latestLedger": {
"title": "latestLedger",
"description": "The sequence number of the latest ledger known to Stellar RPC at the time it handled the request.",
"type": "number"
},
"oldestLedger": {
"title": "oldestLedger",
"description": "The sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request.",
"type": "number"
},
"latestLedgerCloseTime": {
"type": "string",
"description": "The unix timestamp (as a string) of the close time of the latest ledger known to Stellar RPC when it handled the request."
},
"oldestLedgerCloseTime": {
"type": "string",
"description": "The unix timestamp (as a string) of the close time of the oldest ledger kept in history by Stellar RPC when it handled the request."
},
"events": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"title": "type",
"description": "The type of event emission.",
"type": "string",
"enum": [
"contract",
"system"
]
},
"ledger": {
"title": "ledgerSequence",
"description": "Sequence number of the ledger in which this event was emitted.",
"type": "number"
},
"ledgerClosedAt": {
"type": "string",
"description": "[ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp of the ledger closing time"
},
"contractId": {
"title": "contractId",
"description": "StrKey representation of the contract address that emitted this event.",
"type": "string"
},
"id": {
"description": "Unique identifier for this event, based on the [TOID](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0035.md#specification) format. It combines a 19-character TOID and a 10-character, zero-padded event index, separated by a hyphen. \n\n- For example: `0000000000000123456-0000000001`",
"type": "string"
},
"transactionIndex": {
"description": "The index of the transaction within the ledger this event occurred in.",
"type": "number"
},
"operationIndex": {
"description": "The index of the operation within the transaction this event occurred in.",
"type": "number"
},
"topic": {
"type": "array",
"description": "The [ScVal](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-contract.x#L214)s containing the topics this event was emitted with (as a base64 string).",
"minItems": 1,
"maxItems": 4,
"items": {
"title": "SegmentMatcher",
"type": "string",
"description": "A `SegmentMatcher` is one of the following:\n\n- For an exact segment match, a string containing a base64-encoded ScVal\n\n- The string \"*\" functions as a wildcard that matches exactly one segment.\n\n- The string \"**\" matches zero or more segments and is used to match events with variable topic lengths. It can only appear as the final segment and does not count towards the 4-segment limit.\n\n"
}
},
"value": {
"description": "The data emitted by the event (an [ScVal](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-contract.x#L214), serialized as a base64 string).",
"type": "string"
},
"txHash": {
"title": "hash",
"type": "string",
"minLength": 64,
"maxLength": 64,
"pattern": "^[a-f\\d]{64}$",
"description": "The transaction which triggered this event."
}
}
}
},
"cursor": {
"title": "cursor",
"type": "string",
"description": "A token which can be included in a subsequent request to obtain the next page of results."
}
}
}
},
"examples": [
{
"name": "Native XLM Transfer Events",
"description": "Example request to the `getEvents` method, filtering for `transfer` events for native Lumens and limiting the number of returned events to 2.",
"params": [
{
"name": "startLedger",
"value": 199616
},
{
"name": "filters",
"value": [
{
"type": "contract",
"contractIds": [
"CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC"
],
"topics": [
[
"AAAADwAAAAh0cmFuc2Zlcg==",
"*",
"*",
"**"
]
]
}
]
},
{
"name": "pagination",
"value": {
"limit": 2
}
}
],
"result": {
"name": "getEventsResult",
"value": {
"events": [
{
"type": "contract",
"ledger": 3727845,
"ledgerClosedAt": "2026-07-21T18:01:10Z",
"contractId": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC",
"id": "0016010972359577600-0000000001",
"transactionIndex": 5,
"operationIndex": 0,
"topic": [
"AAAADwAAAAh0cmFuc2Zlcg==",
"AAAAEgAAAAAAAAAAjnWZyariB+Ah9OPGy5WJe1t2Ks3gKsKGYsy7vmpJRIY=",
"AAAAEgAAAAGu/2GlTlA4D83fxvERV0mWvvsyBPo+xfk3Guav6IgNZQ==",
"AAAADgAAAAZuYXRpdmUAAA=="
],
"value": "AAAACgAAAAAAAAAAAAAAALLQXgA=",
"txHash": "a5c9247b77eb04c0d857934a2e988c408167976c8acbdf3d8acf64c44deb3beb"
},
{
"type": "contract",
"ledger": 3727845,
"ledgerClosedAt": "2026-07-21T18:01:10Z",
"contractId": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC",
"id": "0016010972359577600-0000000008",
"transactionIndex": 5,
"operationIndex": 0,
"topic": [
"AAAADwAAAAh0cmFuc2Zlcg==",
"AAAAEgAAAAFvWqehdOlYvvTHeLuVC7C5mabRfoyKnCxxAOeeSzHCbQ==",
"AAAAEgAAAAEX55xp/WiwvNIMhmNvj+HN+OoYTpPk1xsJ+iKUVLmQLg==",
"AAAADgAAAAZuYXRpdmUAAA=="
],
"value": "AAAACgAAAAAAAAAAAAAAAAKJZY8=",
"txHash": "a5c9247b77eb04c0d857934a2e988c408167976c8acbdf3d8acf64c44deb3beb"
}
],
"latestLedger": 3730843,
"oldestLedger": 3609884,
"latestLedgerCloseTime": "1784671886",
"oldestLedgerCloseTime": "1784066056",
"cursor": "0016010972359577600-0000000008"
}
}
},
{
"name": "All Events",
"description": "Example request to the `getEvents` method, filtering for all events of all types for any and all contracts.",
"params": [
{
"name": "startLedger",
"value": 199616
},
{
"name": "pagination",
"value": {
"limit": 2
}
}
],
"result": {
"name": "getEventsResult",
"value": {
"events": [
{
"type": "contract",
"ledger": 3729796,
"ledgerClosedAt": "2026-07-21T20:44:01Z",
"contractId": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC",
"id": "0016019351840751616-0000000000",
"transactionIndex": 0,
"operationIndex": 0,
"topic": [
"AAAADwAAAANmZWUA",
"AAAAEgAAAAAAAAAAA+0oimKONzC713z+Cl8orRHR8/s0JY+JMothA0fY7bY="
],
"value": "AAAACgAAAAAAAAAAAAAAAAAAAGQ=",
"txHash": "dd2f693c5d874ed09f2de0a4edbc453a0a74fe3e44a40e8a4017bd47a1708ffd"
},
{
"type": "contract",
"ledger": 3729796,
"ledgerClosedAt": "2026-07-21T20:44:01Z",
"contractId": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC",
"id": "0016019351840751616-0000000001",
"transactionIndex": 0,
"operationIndex": 0,
"topic": [
"AAAADwAAAANmZWUA",
"AAAAEgAAAAAAAAAAHvWJXEUjo0G/RW4K3B2oCbR8OHbnLlCyfD3iKAnjKPY="
],
"value": "AAAACgAAAAAAAAAAAAAAAAAAASw=",
"txHash": "3fcd635d285c5b3a4d9b65a10f6c70c11132d8fafd32e82fea79103eb1a05924"
}
],
"latestLedger": 3730797,
"oldestLedger": 3609838,
"latestLedgerCloseTime": "1784671655",
"oldestLedgerCloseTime": "1784065826",
"cursor": "0016019351840751616-0000000001"
}
}
}
]
},
{
"name": "getFeeStats",
"summary": "returns statistics about charged inclusion fees",
"description": "Statistics for charged inclusion fees. The inclusion fee statistics are calculated from the inclusion fees that were paid for the transactions to be included onto the ledger. For Soroban transactions and Stellar transactions, they each have their own inclusion fees and own surge pricing. Inclusion fees are used to prevent spam and prioritize transactions during network traffic surge.",
"externalDocs": {
"url": "https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getFeeStats"
},
"paramStructure": "by-name",
"params": [],
"result": {
"name": "getFeeStatsResult",
"schema": {
"type": "object",
"properties": {
"sorobanInclusionFee": {
"type": "object",
"description": "Inclusion fee distribution statistics for Soroban transactions",
"properties": {
"max": {
"description": "Maximum fee",
"type": "string"
},
"min": {
"description": "Minimum fee",
"type": "string"
},
"mode": {
"description": "Fee value which occurs the most often",
"type": "string"
},
"p10": {
"description": "10th nearest-rank fee percentile",
"type": "string"
},
"p20": {
"description": "20th nearest-rank fee percentile",
"type": "string"
},
"p30": {
"description": "30th nearest-rank fee percentile",
"type": "string"
},
"p40": {
"description": "40th nearest-rank fee percentile",
"type": "string"
},
"p50": {
"description": "50th nearest-rank fee percentile",
"type": "string"
},
"p60": {
"description": "60th nearest-rank fee percentile",
"type": "string"
},
"p70": {
"description": "70th nearest-rank fee percentile",
"type": "string"
},
"p80": {
"description": "80th nearest-rank fee percentile",
"type": "string"
},
"p90": {
"description": "90th nearest-rank fee percentile.",
"type": "string"
},
"p95": {
"description": "95th nearest-rank fee percentile.",
"type": "string"
},
"p99": {
"description": "99th nearest-rank fee percentile",
"type": "string"
},
"transactionCount": {
"description": "How many transactions are part of the distribution",
"type": "string"
},
"ledgerCount": {
"description": "How many consecutive ledgers form the distribution",
"type": "number"
}
}
},
"inclusionFee": {
"type": "object",
"description": "Fee distribution statistics for Stellar (i.e. non-Soroban) transactions. Statistics are normalized per operation.",
"properties": {
"max": {
"description": "Maximum fee",
"type": "string"
},
"min": {
"description": "Minimum fee",
"type": "string"
},
"mode": {
"description": "Fee value which occurs the most often",
"type": "string"
},
"p10": {
"description": "10th nearest-rank fee percentile",
"type": "string"
},
"p20": {
"description": "20th nearest-rank fee percentile",
"type": "string"
},
"p30": {
"description": "30th nearest-rank fee percentile",
"type": "string"
},
"p40": {
"description": "40th nearest-rank fee percentile",
"type": "string"
},
"p50": {
"description": "50th nearest-rank fee percentile",
"type": "string"
},
"p60": {
"description": "60th nearest-rank fee percentile",
"type": "string"
},
"p70": {
"description": "70th nearest-rank fee percentile",
"type": "string"
},
"p80": {
"description": "80th nearest-rank fee percentile",
"type": "string"
},
"p90": {
"description": "90th nearest-rank fee percentile.",
"type": "string"
},
"p95": {
"description": "95th nearest-rank fee percentile.",
"type": "string"
},
"p99": {
"description": "99th nearest-rank fee percentile",
"type": "string"
},
"transactionCount": {
"description": "How many transactions are part of the distribution",
"type": "string"
},
"ledgerCount": {
"description": "How many consecutive ledgers form the distribution",
"type": "number"
}
}
},
"latestLedger": {
"title": "latestLedger",
"description": "The sequence number of the latest ledger known to Stellar RPC at the time it handled the request.",
"type": "number"
}
}
}
},
"examples": [
{
"name": "Statistics about charged transaction fees.",
"description": "Example request to the `getFeeStats` method",
"params": [],
"result": {
"name": "getFeeStatsResult",
"value": {
"sorobanInclusionFee": {
"max": "200",
"min": "100",
"mode": "100",
"p10": "100",
"p20": "100",
"p30": "100",
"p40": "100",
"p50": "100",
"p60": "100",
"p70": "100",
"p80": "100",
"p90": "200",
"p95": "200",
"p99": "200",
"transactionCount": "371",
"ledgerCount": 50
},
"inclusionFee": {
"max": "133",
"min": "100",
"mode": "100",
"p10": "100",
"p20": "100",
"p30": "100",
"p40": "100",
"p50": "100",
"p60": "100",
"p70": "100",
"p80": "100",
"p90": "100",
"p95": "100",
"p99": "133",
"transactionCount": "28",
"ledgerCount": 10
},
"latestLedger": 3730870
}
}
}
]
},
{
"name": "getHealth",
"summary": "returns node health",
"description": "General node health check.",
"externalDocs": {
"url": "https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getHealth"
},
"paramStructure": "by-name",
"params": [],
"result": {
"name": "getHealthResult",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "\"healthy\""
},
"latestLedger": {
"type": "number",
"description": "Most recent known ledger sequence"
},
"latestLedgerCloseTime": {
"type": "string",
"description": "The unix timestamp (as a string) of the close time of the most recent known ledger"
},
"oldestLedger": {
"type": "number",
"description": "Oldest ledger sequence kept in history"
},
"oldestLedgerCloseTime": {
"type": "string",
"description": "The unix timestamp (as a string) of the close time of the oldest ledger kept in history"
},
"ledgerRetentionWindow": {
"type": "number",
"description": "Maximum retention window configured. A full window state can be determined via: ledgerRetentionWindow = latestLedger - oldestLedger + 1"
}
}
}
},
"examples": [
{
"name": "Current node health",
"description": "Example request to the `getHealth` method",
"params": [],
"result": {
"name": "getHealthResult",
"value": {
"status": "healthy",
"latestLedger": 3730763,
"latestLedgerCloseTime": "1784671485",
"oldestLedger": 3609804,
"oldestLedgerCloseTime": "1784065656",
"ledgerRetentionWindow": 120960
}
}
}
]
},
{
"name": "getLatestLedger",
"summary": "returns latest known ledger",
"description": "For finding out the current latest known ledger of this node. This is a subset of the ledger info from Horizon.",
"externalDocs": {
"url": "https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getLatestLedger"
},
"paramStructure": "by-name",
"params": [],
"result": {
"name": "getLatestLedgerResponse",
"schema": {
"type": "object",
"properties": {
"id": {
"title": "id",
"type": "string",
"minLength": 64,
"maxLength": 64,
"pattern": "^[a-f\\d]{64}$",
"description": "Hash identifier of the latest ledger (as a hex-encoded string) known to Stellar RPC at the time it handled the request."
},
"protocolVersion": {
"title": "protocolVersion",
"type": "number",
"description": "Stellar Core protocol version associated with the latest ledger."
},
"sequence": {
"title": "latestLedger",
"description": "The sequence number of the latest ledger known to Stellar RPC at the time it handled the request.",
"type": "number"
},
"closeTime": {
"title": "closeTime",
"description": "The timestamp at which the latest ledger was closed.",
"type": "string"
},
"headerXdr": {
"title": "headerXdr",
"type": "string",
"description": "The [LedgerHeader](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-ledger.x#L74) structure for this ledger (base64-encoded string)."
},
"metadataXdr": {
"title": "metadataXdr",
"type": "string",
"description": "The [LedgerCloseMeta](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-ledger.x#L539) union for this ledger (base64-encoded string)."
}
}
}
},
"examples": [
{
"name": "Details of the Current Ledger",
"description": "Example request to the `getLatestLedger` method.",
"params": [],
"result": {
"name": "getLatestLedgerResult",
"value": {
"id": "0a00a9cf845f7af7cff09c66f8ae6480e9971e6e2c7fa4afd8d6266ee13c987b",
"protocolVersion": 27,
"sequence": 3730795,
"closeTime": "1784671645",
"headerXdr": "CgCpz4RfevfP8Jxm+K5kgOmXHm4sf6Sv2NYmbuE8mHsAAAAbPDCnSG7CFV5/XNDJYU2mvuu7CWlGNETvjzmCB0C50X5Gm4bj+oLrMFjstd6bh+ahjUzOP//fanfkb6k4aruZ5AAAAABqX+2dAAAAAAAAAAEAAAAAtV0Qsrt9KE7VwDpHpeG1kMkPV4NVRxzEUHu+ggTSPIsAAABAcQoxoLTb8SJEAvsbXAetyT2GQeK8HMiN7z2TO4fX56R5roEd2xX5m2ii+FFlVQVErhT4KyxzN/hrbI+v2+9sCzMpCKVWHZKHWvI6d7MnLM0IZhhLZm9Cn43fPxlU5GgZVltQFYhVosSJDb2y8JpoHXePt07R4yONinsPVmZOHtwAOO1rDeC2s6dkAAAAAAO/vpEtPgAAAAAAAAAAAAX17QAAAGQATEtAAAAAyLgswiH76a8cJSTERunnOprBVOsw45eBswHJBh7QOH2GLf4GYAUflwJZdUz+pzyE1xTDFw9wViEEzJVHfgfPMfVBLqU1/WkTSpJrvCDw5YFOwWdTeyV4aQPW1Rg9Gm2gczzsqyuzzw6m/Ea/p4qmm6HSB3cImxjm7GK6fewJsfUzAAAAAAAAAAA=",
"metadataXdr": "AAAAAgAAAAAKAKnPhF9698/wnGb4rmSA6Zcebix/pK/Y1iZu4TyYewAAABs8MKdIbsIVXn9c0MlhTaa+67sJaUY0RO+POYIHQLnRfkabhuP6guswWOy13puH5qGNTM4//99qd+RvqThqu5nkAAAAAGpf7Z0AAAAAAAAAAQAAAAC1XRCyu30oTtXAOkel4bWQyQ9Xg1VHHMRQe76CBNI8iwAAAEBxCjGgtNvxIkQC+xtcB63JPYZB4rwcyI3vPZM7…(truncated for brevity; the full base64 LedgerCloseMeta is large)"
}
}
}
]
},
{
"name": "getLedgerEntries",
"summary": "returns ledger entries",
"description": "For reading the current value of ledger entries directly.\n\nThis method enables querying live ledger state: accounts, trustlines, offers, data, claimable balances, and liquidity pools. It also provides direct access to inspect a contract's current state, its code, or any other ledger entry. This serves as a primary method to access your contract data which may not be available via events or `simulateTransaction`.\n\nTo fetch contract wasm byte-code, use the ContractCode ledger entry key.",
"externalDocs": {
"url": "https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getLedgerEntries"
},
"paramStructure": "by-name",
"params": [
{
"name": "keys",
"summary": "array of ledger keys",
"description": "Array containing the keys of the ledger entries you wish to retrieve. (an array of serialized base64 strings)",
"required": true,
"schema": {
"description": "An array of LedgerKeys. The maximum number of ledger keys accepted is 200.",
"type": "array",
"items": {
"type": "string",
"description": "The [LedgerKey](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-ledger-entries.x#L600) union corresponding to an existing ledger entry you want to retrieve (base64-encoded string)."
}
}
},
{
"name": "xdrFormat",
"summary": "chooses a response format for XDR fields: 'json' or 'base64'",
"required": false,
"description": "Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.",
"schema": {
"title": "xdrFormat",
"type": "string",
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
"result": {
"name": "getLedgerEntriesResult",
"schema": {
"type": "object",
"required": [
"latestLedger"
],
"properties": {
"latestLedger": {
"title": "latestLedger",
"description": "The sequence number of the latest ledger known to Stellar RPC at the time it handled the request.",
"type": "number"
},
"entries": {
"type": "array",
"description": "Array of objects containing all found ledger entries",
"items": {
"type": "object",
"description": "Object containing information about an existing ledger entry.",
"properties": {
"key": {
"type": "string",
"description": "The [LedgerKey](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-ledger-entries.x#L600) corresponding to the ledger entry (base64 string)."
},
"xdr": {
"type": "string",
"description": "The key's current [LedgerEntryData](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-ledger-entries.x#L564) value (base64 string)."
},
"lastModifiedLedgerSeq": {
"title": "ledgerSequence",
"description": "The ledger sequence number of the last time this entry was updated.",
"type": "number"
},
"liveUntilLedgerSeq": {
"title": "ledgerSequence",
"description": "The ledger sequence number of the ledger that the entry will be live until. May be zero if the entry is no longer live.",
"type": "number"
}
}
}
}
}
}
},
"examples": [
{
"name": "Retrieve a Contract's Counter Entry for an Address",
"description": "Example request to the `getNetwork` method for a `Counter(Address)` ledger entry.",
"params": [
{
"name": "keys",
"summary": "ledger key for an address' counter entry",
"description": "A ledger key that will request a ledger entry defined using a tuple variant enum in a contract: `Counter(Address)`",
"value": [
"AAAABgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAABAAAAABAAAAAgAAAA8AAAAHQ291bnRlcgAAAAASAAAAAAAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAAE="
]
}
],
"result": {
"name": "getLedgerEntriesResult",
"value": {
"entries": [
{
"key": "AAAAB+qfy4GuVKKfazvyk4R9P9fpo2n9HICsr+xqvVcTF+DC",
"xdr": "AAAABgAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAQAAAAAQAAAAIAAAAPAAAAB0NvdW50ZXIAAAAAEgAAAAAAAAAAIOHWwMbBgBiAnwRt4k9nChmEOoSuLCVs2eqK9Qub+hgAAAABAAAAAwAAAAw=",
"lastModifiedLedgerSeq": 2552504
}
],
"latestLedger": 2552990
}
}
},
{
"name": "Retrieve a Token's Balance Entry for Contract",
"description": "Example request to the `getNetwork` method for a SAC balance ledger entry belonging to a contract.",
"params": [
{
"name": "keys",
"summary": "ledger key for a contract's native XLM balance",
"description": "A ledger key that will request a ledger entry corresponding to a contract's balance on the native XLM Stellar Asset Contract.",
"value": [
"AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAABAAAAABAAAAAgAAAA8AAAAHQmFsYW5jZQAAAAASAAAAAcwD/nT9D7Dc2LxRdab+2vEUF8B+XoN7mQW21oxPT8ALAAAAAQ=="
]
}
],
"result": {
"name": "getLedgerEntriesResult",
"value": {
"entries": [
{
"key": "AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAABAAAAABAAAAAgAAAA8AAAAHQmFsYW5jZQAAAAASAAAAAcwD/nT9D7Dc2LxRdab+2vEUF8B+XoN7mQW21oxPT8ALAAAAAQ==",
"xdr": "AAAABgAAAAAAAAAB15KLcsJwPM/q9+uf9O9NUEpVqLl5/JtFDqLIQrTRzmEAAAAQAAAAAQAAAAIAAAAPAAAAB0JhbGFuY2UAAAAAEgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAAAEAAAARAAAAAQAAAAMAAAAPAAAABmFtb3VudAAAAAAACgAAAAAAAAAAAAAAAB3NZQAAAAAPAAAACmF1dGhvcml6ZWQAAAAAAAAAAAABAAAADwAAAAhjbGF3YmFjawAAAAAAAAAA",
"lastModifiedLedgerSeq": 2553612
}
],
"latestLedger": 2553713
}
}
},
{
"name": "Retrieve Multiple Ledger Entries from Different Contracts.",
"description": "Example request to the `getNetwork` method for a `Counter(Address)` ledger entry and a SAC balance ledger entry.",
"params": [
{
"name": "keys",
"summary": "ledger keys for multiple ledger entries",
"description": "Two ledger keys: One for a counter entry, and one for a contract's native XLM balance.",
"value": [
"AAAABgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAABAAAAABAAAAAgAAAA8AAAAHQ291bnRlcgAAAAASAAAAAAAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAAE=",
"AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAABAAAAABAAAAAgAAAA8AAAAHQmFsYW5jZQAAAAASAAAAAcwD/nT9D7Dc2LxRdab+2vEUF8B+XoN7mQW21oxPT8ALAAAAAQ=="
]
}
],
"result": {
"name": "getLedgerEntriesResult",
"value": {
"entries": [
{
"key": "AAAABgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAABAAAAABAAAAAgAAAA8AAAAHQ291bnRlcgAAAAASAAAAAAAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAAE=",
"xdr": "AAAABgAAAAAAAAAB15KLcsJwPM/q9+uf9O9NUEpVqLl5/JtFDqLIQrTRzmEAAAAQAAAAAQAAAAIAAAAPAAAAB0JhbGFuY2UAAAAAEgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAAAEAAAARAAAAAQAAAAMAAAAPAAAABmFtb3VudAAAAAAACgAAAAAAAAAAAAAAAB3NZQAAAAAPAAAACmF1dGhvcml6ZWQAAAAAAAAAAAABAAAADwAAAAhjbGF3YmFjawAAAAAAAAAA",
"lastModifiedLedgerSeq": 2553612
},
{
"key": "AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAABAAAAABAAAAAgAAAA8AAAAHQmFsYW5jZQAAAAASAAAAAcwD/nT9D7Dc2LxRdab+2vEUF8B+XoN7mQW21oxPT8ALAAAAAQ==",
"xdr": "AAAABgAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAQAAAAAQAAAAIAAAAPAAAAB0NvdW50ZXIAAAAAEgAAAAAAAAAAIOHWwMbBgBiAnwRt4k9nChmEOoSuLCVs2eqK9Qub+hgAAAABAAAAAwAAAAw=",
"lastModifiedLedgerSeq": 2552504
}
],
"latestLedger": 2553767
}
}
}
]
},
{
"name": "getLedgers",
"summary": "returns a list of ledgers with their details",
"description": "The `getLedgers` method returns a detailed list of ledgers starting from the user specified starting point that you can paginate as long as the pages fall within the history retention of their corresponding RPC provider.",
"externalDocs": {
"url": "https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getLedgers"
},
"paramStructure": "by-name",
"params": [
{
"name": "startLedger",
"summary": "ledger to begin searching from",
"description": "Ledger sequence number to start fetching responses from (inclusive). This method will return an error if `startLedger` is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. If a cursor is included in the request, `startLedger` must be omitted.",
"required": false,
"schema": {
"title": "ledgerSequence",
"description": "Sequence number of the ledger.",
"type": "number"
}
},
{
"name": "pagination",
"summary": "pagination options",
"description": "Pagination in stellar-rpc is similar to pagination in Horizon. See [Pagination](https://developers.stellar.org/docs/data/rpc/api-reference/structure/pagination).",
"required": false,
"schema": {
"type": "object",
"required": [],
"properties": {
"cursor": {
"type": "string",
"description": "An opaque string which acts as a paging token. To obtain the next page of results occurring after a given response set this value to the `cursor` field of the response."
},
"limit": {
"type": "number",
"description": "The maximum number of records returned. The limit for getLedgers can range from 1 to 200 - an upper limit that is hardcoded in Stellar-RPC for performance reasons. If this argument isn't designated, it defaults to 50."
}
}
}
},
{
"name": "xdrFormat",
"summary": "chooses a response format for XDR fields: 'json' or 'base64'",
"required": false,
"description": "Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.",
"schema": {
"title": "xdrFormat",
"type": "string",
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
"result": {
"name": "getLedgersResult",
"schema": {
"type": "object",
"properties": {
"ledgers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"hash": {
"type": "string",
"description": "The hash of the ledger header which was included in the chain"
},
"sequence": {
"title": "ledgerSequence",
"description": "The sequence number of the ledger (sometimes called the 'block height').",
"type": "number"
},
"ledgerCloseTime": {
"type": "string",
"description": "The unix timestamp (as a string) at which the ledger was closed."
},
"headerXdr": {
"type": "string",
"description": "The [LedgerHeaderHistoryEntry](https://github.com/stellar/stellar-xdr/blob/v26.0/Stellar-ledger.x#L277) structure for this ledger (base64-encoded string)."
},
"metadataXdr": {
"type": "string",
"description": "The [LedgerCloseMeta](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-ledger.x#L539) union for this ledger (base64-encoded string)."
}
}
}
},
"latestLedger": {
"title": "latestLedger",
"description": "The sequence number of the latest ledger known to Stellar RPC at the time it handled the request.",
"type": "number"
},
"latestLedgerCloseTime": {
"title": "latestLedgerCloseTime",
"description": "The unix timestamp of the close time of the latest ledger known to Stellar RPC at the time it handled the request.",
"type": "number"
},
"oldestLedger": {
"title": "oldestLedger",
"description": "The sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request.",
"type": "number"
},
"oldestLedgerCloseTime": {
"title": "oldestLedgerCloseTime",