mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 19:55:54 +00:00
For better URLs, the content folder has been renamed 'docs' and all other files have been moved up a level. Also, non-docs images have been moved to the static folder at the top level where they belong. Many relative paths had to be fixed to make this work.
2.2 KiB
2.2 KiB
html, parent, seo, labels
| html | parent | seo | labels | |||
|---|---|---|---|---|---|---|
| ledger_closed.html | ledger-methods.html |
|
|
ledger_closed
The ledger_closed method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)
Request Format
An example of the request format:
{% tabs %}
{% tab label="WebSocket" %}
{
"id": 2,
"command": "ledger_closed"
}
{% /tab %}
{% tab label="JSON-RPC" %}
{
"method": "ledger_closed",
"params": [
{}
]
}
{% /tab %}
{% tab label="Commandline" %}
#Syntax: ledger_closed
rippled ledger_closed
{% /tab %}
{% /tabs %}
This method accepts no parameters.
Response Format
An example of a successful response:
{% tabs %}
{% tab label="WebSocket" %}
{
"id": 1,
"status": "success",
"type": "response",
"result": {
"ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02",
"ledger_index": 6643099
}
}
{% /tab %}
{% tab label="JSON-RPC" %}
200 OK
{
"result": {
"ledger_hash": "8B5A0C5F6B198254A6E411AF55C29EE40AA86251D2E78DD0BB17647047FA9C24",
"ledger_index": 8696231,
"status": "success"
}
}
{% /tab %}
{% tab label="Commandline" %}
{
"result" : {
"ledger_hash" : "6F5D3B97F1CAA8440AFCED3CA10FB9DC6472F64DEBC2EFAE7CAE7FC0123F32DA",
"ledger_index" : 56843991,
"status" : "success"
}
}
{% /tab %}
{% /tabs %}
The response follows the [standard format][], with a successful result containing the following fields:
Field |
Type | Description |
|---|---|---|
ledger_hash |
String | The unique [Hash][] of this ledger version, in hexadecimal. |
ledger_index |
Unsigned Integer | The [ledger index][] of this ledger version. |
Possible Errors
- Any of the [universal error types][].
{% raw-partial file="/docs/_snippets/common-links.md" /%}