mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 19:55:54 +00:00
Rename API method categories
This commit is contained in:
@@ -0,0 +1,212 @@
|
||||
---
|
||||
html: ledger.html # Watch carefully for clashes w/ this filename
|
||||
parent: ledger-methods.html
|
||||
blurb: 公開レジャーに関する情報を取得します。
|
||||
label:
|
||||
- ブロックチェーン
|
||||
---
|
||||
# ledger
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerHandler.cpp "Source")
|
||||
|
||||
公開レジャーに関する情報を取得します。
|
||||
|
||||
## 要求フォーマット
|
||||
要求フォーマットの例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id":14,
|
||||
"command":"ledger",
|
||||
"ledger_index":"validated",
|
||||
"full": false,
|
||||
"accounts": false,
|
||||
"transactions": false,
|
||||
"expand": false,
|
||||
"owner_funds": false
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method":"ledger",
|
||||
"params":[
|
||||
{
|
||||
"ledger_index":"validated",
|
||||
"accounts": false,
|
||||
"full": false,
|
||||
"transactions": false,
|
||||
"expand": false,
|
||||
"owner_funds": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*コマンドライン*
|
||||
|
||||
```sh
|
||||
#Syntax: ledger ledger_index|ledger_hash [full|tx]
|
||||
# "full" is equivalent to "full": true
|
||||
# "tx" is equivalent to "transactions": true
|
||||
rippled ledger current
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[試してみる >](websocket-api-tool.html#ledger)
|
||||
|
||||
要求には以下のパラメーターを含めることができます。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:---------------|:---------------------------|:-------------------------------|
|
||||
| `ledger_hash` | 文字列 | _(省略可)_ 使用するレジャーバージョンの20バイトの16進文字列。([レジャーの指定][]を参照してください) |
|
||||
| `ledger_index` | 文字列または符号なし整数 | _(省略可)_ 使用するレジャーのシーケンス番号、またはレジャーを自動的に選択するためのショートカット文字列。([レジャーの指定][]を参照してください) |
|
||||
| `full` | ブール値 | _(省略可)_ **管理者が必要。** `true`の場合、レジャー全体に関するすべての情報が返されます。レジャーバージョンを指定しない場合は無視されます。デフォルトでは`false`です。(これは`transactions`、`accounts`、および`expand`を有効にする操作と同等です。) **注意:** 数百メガバイトのオーダーについて、非常に大量のデータが返されます。 |
|
||||
| `accounts` | ブール値 | _(省略可)_ **管理者が必要。** `true`の場合、レジャーのアカウントに関する情報が返されます。レジャーバージョンを指定しない場合は無視されます。デフォルトでは`false`です。**注意:** 非常に大量のデータが返されます。 |
|
||||
| `transactions` | ブール値 | _(省略可)_ `true`の場合、指定されたレジャーバージョンのトランザクションに関する情報が返されます。デフォルトでは`false`です。レジャーバージョンを指定しない場合は無視されます。 |
|
||||
| `expand` | ブール値 | _(省略可)_ ハッシュのみではなく、トランザクション/アカウントの完全な情報がJSONフォーマットで提供されます。デフォルトでは`false`です。トランザクション、アカウント、またはその両方を要求しない場合は無視されます。 |
|
||||
| `owner_funds` | ブール値 | _(省略可)_ `true`の場合、応答のOfferCreateトランザクションのメタデータに`owner_funds`フィールドが含まれます。デフォルトでは`false`です。トランザクションが含まれておらず、`expand`がtrueではない場合には無視されます。 |
|
||||
| `binary` | ブール値 | _(省略可)_ `true`で、かつ`transactions`と`expand`が両方とも`true`の場合、JSONフォーマットではなくバイナリフォーマット(16進文字列)でトランザクション情報が返されます。[新規: rippled 0.28.0][] |
|
||||
| `queue` | ブール値 | _(省略可)_ `true`で、かつコマンドが`current`レジャーを要求している場合、[キューに入れらているトランザクション](transaction-cost.html#キューに入れられたトランザクション)の配列が結果に含まれます。
|
||||
|
||||
`ledger`フィールドは廃止予定であり、今後予告なしに削除される可能性があります。
|
||||
|
||||
## 応答フォーマット
|
||||
|
||||
処理が成功した応答の例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id":4,
|
||||
"status":"success",
|
||||
"type":"response",
|
||||
"result":{
|
||||
"ledger":{
|
||||
"accepted": true,
|
||||
"account_hash":"FD2709F6C07284C3EE85EDE32AC452D9013A89D9B9E781D67D9784457E86A9BB",
|
||||
"close_flags":0,
|
||||
"close_time":508541181,
|
||||
"close_time_human":"2016-Feb-11 21:26:21",
|
||||
"close_time_resolution":10,
|
||||
"closed": true,
|
||||
"hash":"F1433E9D15F33E746B8820DEEE4879F48181704364E459332561DF8E52E4EB7E",
|
||||
"ledger_hash":"F1433E9D15F33E746B8820DEEE4879F48181704364E459332561DF8E52E4EB7E",
|
||||
"ledger_index":"18851530",
|
||||
"parent_close_time":508541180,
|
||||
"parent_hash":"8300B70AA5A865961DED7DAC5B88047028762D5946ECA887D09D32DE442E2305",
|
||||
"seqNum":"18851530",
|
||||
"totalCoins":"99998102799411646",
|
||||
"total_coins":"99998102799411646",
|
||||
"transaction_hash":"E0DB0471A1D198611E1C050ADA4AE74EEB38CEC26E0550663E0FCB1364212A3B"
|
||||
},
|
||||
"ledger_hash":"F1433E9D15F33E746B8820DEEE4879F48181704364E459332561DF8E52E4EB7E",
|
||||
"ledger_index":18851530,
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result":{
|
||||
"ledger":{
|
||||
"accepted": true,
|
||||
"account_hash":"B089E7CD4F5167249951611AAEC863D4BF84FF098500E9CB50561F1A89EED825",
|
||||
"close_flags":0,
|
||||
"close_time":508541222,
|
||||
"close_time_human":"2016-Feb-11 21:27:02",
|
||||
"close_time_resolution":10,
|
||||
"closed": true,
|
||||
"hash":"85E6D422F1A3AE0BEA315C4F09CD0B45022312A4BBF0D308246E901536B61157",
|
||||
"ledger_hash":"85E6D422F1A3AE0BEA315C4F09CD0B45022312A4BBF0D308246E901536B61157",
|
||||
"ledger_index":"18851543",
|
||||
"parent_close_time":508541221,
|
||||
"parent_hash":"C382DB117F2D5AAECFBFB43EA509F8E56D6E1D1297CE00C0D02A3EE695ABB78F",
|
||||
"seqNum":"18851543",
|
||||
"totalCoins":"99998102795090646",
|
||||
"total_coins":"99998102795090646",
|
||||
"transaction_hash":"BEC71A3CAD11BFC4E4013CD109F220E0850E9A3808B15FAA6DAE4D898970EFAF"
|
||||
},
|
||||
"ledger_hash":"85E6D422F1A3AE0BEA315C4F09CD0B45022312A4BBF0D308246E901536B61157",
|
||||
"ledger_index":18851543,
|
||||
"status":"success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
応答は[標準フォーマット][]に従っており、正常に完了した場合は結果にレジャーに関する情報を表す次のフィールドが含まれています。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:-------------------------------|:--------|:----------------------------------|
|
||||
| `ledger` | オブジェクト | このレジャーの完全なヘッダーデータ。 |
|
||||
| `ledger.account_hash` | 文字列 | このレジャーのすべてのアカウント状態情報のハッシュ(16進数) |
|
||||
| `ledger.accountState` | 配列 | (要求されていない場合は省略)このレジャーのすべての[アカウント状態情報](ledger-data-formats.html)。 |
|
||||
| `ledger.close_flags` | 整数 | このレジャーの閉鎖に関連するフラグのビットマップ。現在、レジャーでは1つのフラグだけが`close_flags`として定義されています(**sLCF_NoConsensusTime**(値1))。このフラグが有効な場合、レジャーの正確な閉鎖時刻についてバリデータの間で意見が対立しましたが、作成しているレジャーは同一のものであるため、バリデータは閉鎖時刻について「合意をしないことに合意する」とした上でコンセンサスを宣言しました。この場合、コンセンサスレジャーの`close_time`の値は直前のバージョンの閉鎖時刻の1秒後です。(この場合、正式な閉鎖時刻がありませんが、実際の閉鎖時刻はおそらく指定されている`close_time`の3~6秒後です。) |
|
||||
| `ledger.close_time` | 整数 | レジャーが閉鎖された時刻([Rippleエポック以降の経過秒数][]) |
|
||||
| `ledger.close_time_human` | 文字列 | 人間が読めるフォーマットでのこのレジャーが閉鎖された時刻 |
|
||||
| `ledger.close_time_resolution` | 整数 | レジャー閉鎖時刻はこの秒数の範囲内で丸めらます。 |
|
||||
| `ledger.closed` | ブール値 | このレジャーが閉鎖されているかどうか。 |
|
||||
| `ledger.ledger_hash` | 文字列 | レジャー全体の一意の識別用ハッシュ。 |
|
||||
| `ledger.ledger_index` | 文字列 | このレジャーの[レジャーインデックス][]。整数を引用符で囲んだ形式で示されます。 |
|
||||
| `ledger.parent_close_time` | 整数 | 前のレジャーが閉鎖された時刻。 |
|
||||
| `ledger.parent_hash` | 文字列 | このレジャーの直前のレジャーの一意の識別用ハッシュ。 |
|
||||
| `ledger.total_coins` | 文字列 | ネットワークのXRPの合計(drop数)。整数を引用符で囲んだ形式で示されます。(トランザクションコストによりXRPが消却されると、この値は減少します。) |
|
||||
| `ledger.transaction_hash` | 文字列 | このレジャーに記録されているトランザクション情報のハッシュ(16進数) |
|
||||
| `ledger.transactions` | 配列 | (要求されていない場合は省略)このレジャーバージョンで適用されたトランザクション。デフォルトでは、メンバーはトランザクションの識別用[ハッシュ][]文字列です。要求で`expand`がtrueとして指定されている場合は、メンバーはJSONフォーマットまたはバイナリフォーマットでのトランザクションの完全な表現です。フォーマットは、要求で`binary`がtrueとして指定されていたかどうかに応じて決まります。 |
|
||||
| `ledger_hash` | 文字列 | レジャー全体の一意の識別用ハッシュ。 |
|
||||
| `ledger_index` | 数値 | このレジャーの[レジャーインデックス][]。 |
|
||||
| `queue_data` | 配列 | (`queue`パラメーターで要求されている場合を除いて省略)キューに入れられたトランザクションをキューと同じ順序で記述するオブジェクトの配列。要求で`expand`がtrueに指定されている場合は、メンバーにはJSONフォーマットまたはバイナリフォーマットでのトランザクションの完全な表現が含まれています。フォーマットは、要求で`binary`がtrueとして指定されていたかどうかによって決まります。[FeeEscalation Amendment][]が必要です。[新規: rippled 0.70.0][] |
|
||||
|
||||
以下のフィールドは廃止予定であり、今後予告なしに削除される可能性があります。`accepted`、`hash`(代わりに`ledger_hash`を使用)、`seqNum`(代わりに`ledger_index`を使用)、`totalCoins`(代わりに`total_coins`を使用)。
|
||||
|
||||
`queue_data`配列の各メンバーは、キュー内の1つのトランザクションを表します。このオブジェクトの一部フィールドは、まだ計算されていないために省略されることがあります。このオブジェクトのフィールドを次に示します。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|:--------------------|:-----------------|:------------------------------------|
|
||||
| `account` | 文字列 | このキューに入れられたトランザクションの送信者の[アドレス][]。 |
|
||||
| `tx` | 文字列またはオブジェクト | デフォルトでは、これはトランザクションの[識別用ハッシュ](basic-data-types.html#ハッシュ)を含む文字列です。トランザクションがバイナリフォーマットで展開されている場合、これは`tx_blob`が唯一のフィールドであるオブジェクトであり、バイナリー形式のトランザクションが10進文字列として含まれています。トランザクションがJSONフォーマットで展開されている場合、これは`hash`フィールドにトランザクションの識別用ハッシュが指定されている[トランザクションオブジェクト](transaction-formats.html)を含むオブジェクトです。 |
|
||||
| `retries_remaining` | 数値 | このトランザクションの再試行可能回数。この回数を超えるとトランザクションが除外されます。 |
|
||||
| `preflight_result` | 文字列 | 初期トランザクションチェックの一時的な結果。これは常に`tesSUCCESS`です。 |
|
||||
| `last_result` | 文字列 | _(省略される場合があります)_[再試行可能な (`ter`) の結果](ter-codes.html)を取得した後でこのトランザクションがキューに残っている場合、これは取得した正確な`ter`結果コードです。 |
|
||||
| `auth_change` | ブール値 | _(省略される場合があります)_ このトランザクションがこのアドレスの[トランザクション承認方法](transaction-basics.html#トランザクションの承認)を変更するかどうかを示します。 |
|
||||
| `fee` | 文字列 | _(省略される場合があります)_ このトランザクションの[トランザクションコスト](transaction-cost.html)([XRPのdrop数][])。 |
|
||||
| `fee_level` | 文字列 | _(省略される場合があります)_ このタイプのトランザクションの最少コストと比較した、このトランザクションのトランザクションコスト([手数料レベル][])。 |
|
||||
| `max_spend_drops` | 文字列 | _(省略される場合があります)_ このトランザクションで送信または消却できる[XRP、drop単位][]の最高額。 |
|
||||
|
||||
要求に`"owner_funds": true`が指定されておりトランザクションが展開されている場合、応答には、各[OfferCreateトランザクション][]の`metaData`オブジェクトの`owner_funds`フィールドが含まれています。このフィールドの目的は、新しい検証済みレジャーごとに[オファーの資金化ステータス](offers.html#オファーのライフサイクル)を容易に追跡できるようにすることです。このフィールドの定義は、[オーダーブックサブスクリプションストリーム](subscribe.html#オーダーブックストリーム)でのこのフィールドのバージョンとはわずかに異なります。
|
||||
|
||||
| `Field` | 値 | 説明 |
|
||||
|:--------------|:-------|:----------------------------------------------------|
|
||||
| `owner_funds` | 文字列 | このレジャーのすべてのトランザクションの実行後に、このOfferCreateトランザクションを送信する`Account`が保有する`TakerGets`通貨の額。この通貨額が[凍結](freezes.html)されているかどうかはチェックされません。 |
|
||||
|
||||
## 考えられるエラー
|
||||
|
||||
* [汎用エラータイプ][]のすべて。
|
||||
* `invalidParams` - 1つ以上のフィールドの指定が正しくないか、1つ以上の必須フィールドが指定されていません。
|
||||
* `lgrNotFound` - `ledger_hash`または`ledger_index`で指定したレジャーが存在しないか、存在してはいるもののサーバーが保有していません。
|
||||
* `noPermission` - `full`または`accounts`をtrueとして指定したが、管理者としてサーバーに接続していない場合(通常、管理者はローカルポートで接続する必要があります)。
|
||||
|
||||
|
||||
<!-- TODO: we should add this fee levels link to rippled-api-links.md. server_state.md is also including this as a one-off.-->
|
||||
[手数料レベル]: transaction-cost.html#手数料レベル
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -0,0 +1,245 @@
|
||||
---
|
||||
html: ledger.html # Watch carefully for clashes w/ this filename
|
||||
parent: ledger-methods.html
|
||||
blurb: Get info about a ledger version.
|
||||
labels:
|
||||
- Blockchain
|
||||
---
|
||||
# ledger
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerHandler.cpp "Source")
|
||||
|
||||
Retrieve information about the public [ledger](ledgers.html).
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 14,
|
||||
"command": "ledger",
|
||||
"ledger_index": "validated",
|
||||
"full": false,
|
||||
"accounts": false,
|
||||
"transactions": false,
|
||||
"expand": false,
|
||||
"owner_funds": false
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger",
|
||||
"params": [
|
||||
{
|
||||
"ledger_index": "validated",
|
||||
"accounts": false,
|
||||
"full": false,
|
||||
"transactions": false,
|
||||
"expand": false,
|
||||
"owner_funds": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```
|
||||
#Syntax: ledger ledger_index|ledger_hash [full|tx]
|
||||
# "full" is equivalent to "full": true
|
||||
# "tx" is equivalent to "transactions": true
|
||||
rippled ledger validated
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger)
|
||||
|
||||
The request can contain the following parameters:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:---------------------------|:-------------------------------|
|
||||
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]). |
|
||||
| `ledger_index` | String or Unsigned Integer | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
|
||||
| `full` | Boolean | _(Optional)_ **Admin required** If `true`, return full information on the entire ledger. Ignored if you did not specify a ledger version. Defaults to `false`. (Equivalent to enabling `transactions`, `accounts`, and `expand`.) **Caution:** This is a very large amount of data -- on the order of several hundred megabytes! |
|
||||
| `accounts` | Boolean | _(Optional)_ **Admin required.** If `true`, return information on accounts in the ledger. Ignored if you did not specify a ledger version. Defaults to `false`. **Caution:** This returns a very large amount of data! |
|
||||
| `transactions` | Boolean | _(Optional)_ If `true`, return information on transactions in the specified ledger version. Defaults to `false`. Ignored if you did not specify a ledger version. |
|
||||
| `expand` | Boolean | _(Optional)_ Provide full JSON-formatted information for transaction/account information instead of only hashes. Defaults to `false`. Ignored unless you request transactions, accounts, or both. |
|
||||
| `owner_funds` | Boolean | _(Optional)_ If `true`, include `owner_funds` field in the metadata of OfferCreate transactions in the response. Defaults to `false`. Ignored unless transactions are included and `expand` is true. |
|
||||
| `binary` | Boolean | _(Optional)_ If `true`, and `transactions` and `expand` are both also `true`, return transaction information in binary format (hexadecimal string) instead of JSON format. [New in: rippled 0.28.0][] |
|
||||
| `queue` | Boolean | _(Optional)_ If `true`, and the command is requesting the `current` ledger, includes an array of [queued transactions](transaction-cost.html#queued-transactions) in the results.
|
||||
|
||||
The `ledger` field is deprecated and may be removed without further notice.
|
||||
|
||||
## Response Format
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 14,
|
||||
"result": {
|
||||
"ledger": {
|
||||
"accepted": true,
|
||||
"account_hash": "53BD4650A024E27DEB52DBB6A52EDB26528B987EC61C895C48D1EB44CEDD9AD3",
|
||||
"close_flags": 0,
|
||||
"close_time": 638329241,
|
||||
"close_time_human": "2020-Mar-24 01:40:41.000000000 UTC",
|
||||
"close_time_resolution": 10,
|
||||
"closed": true,
|
||||
"hash": "1723099E269C77C4BDE86C83FA6415D71CF20AA5CB4A94E5C388ED97123FB55B",
|
||||
"ledger_hash": "1723099E269C77C4BDE86C83FA6415D71CF20AA5CB4A94E5C388ED97123FB55B",
|
||||
"ledger_index": "54300932",
|
||||
"parent_close_time": 638329240,
|
||||
"parent_hash": "DF68B3BCABD31097634BABF0BDC87932D43D26E458BFEEFD36ADF2B3D94998C0",
|
||||
"seqNum": "54300932",
|
||||
"totalCoins": "99991024049648900",
|
||||
"total_coins": "99991024049648900",
|
||||
"transaction_hash": "50B3A8FE2C5620E43AA57564209AEDFEA3E868CFA2F6E4AB4B9E55A7A62AAF7B"
|
||||
},
|
||||
"ledger_hash": "1723099E269C77C4BDE86C83FA6415D71CF20AA5CB4A94E5C388ED97123FB55B",
|
||||
"ledger_index": 54300932,
|
||||
"validated": true
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"ledger": {
|
||||
"accepted": true,
|
||||
"account_hash": "B258A8BB4743FB74CBBD6E9F67E4A56C4432EA09E5805E4CC2DA26F2DBE8F3D1",
|
||||
"close_flags": 0,
|
||||
"close_time": 638329271,
|
||||
"close_time_human": "2020-Mar-24 01:41:11.000000000 UTC",
|
||||
"close_time_resolution": 10,
|
||||
"closed": true,
|
||||
"hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A",
|
||||
"ledger_hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A",
|
||||
"ledger_index": "54300940",
|
||||
"parent_close_time": 638329270,
|
||||
"parent_hash": "AE996778246BC81F85D5AF051241DAA577C23BCA04C034A7074F93700194520D",
|
||||
"seqNum": "54300940",
|
||||
"totalCoins": "99991024049618156",
|
||||
"total_coins": "99991024049618156",
|
||||
"transaction_hash": "FC6FFCB71B2527DDD630EE5409D38913B4D4C026AA6C3B14A3E9D4ED45CFE30D"
|
||||
},
|
||||
"ledger_hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A",
|
||||
"ledger_index": 54300940,
|
||||
"status": "success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2020-Mar-24 01:42:42.622264591 UTC HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"ledger" : {
|
||||
"accepted" : true,
|
||||
"account_hash" : "6B3101BE8F1431C5AC5B43D9731F1F3A747D24B3BEF89B687F0F3039E10EB65A",
|
||||
"close_flags" : 0,
|
||||
"close_time" : 638329360,
|
||||
"close_time_human" : "2020-Mar-24 01:42:40.000000000 UTC",
|
||||
"close_time_resolution" : 10,
|
||||
"closed" : true,
|
||||
"hash" : "C88A0EEC0E785A4C3E99F2A8B8EE0D7BDF3DE6C786C39B1B01547F6DAE5A4B7F",
|
||||
"ledger_hash" : "C88A0EEC0E785A4C3E99F2A8B8EE0D7BDF3DE6C786C39B1B01547F6DAE5A4B7F",
|
||||
"ledger_index" : "54300962",
|
||||
"parent_close_time" : 638329352,
|
||||
"parent_hash" : "96D2D70DC540BA4614A00C77FCFDED20E7D58AF3238E36655C38C407A56982A3",
|
||||
"seqNum" : "54300962",
|
||||
"totalCoins" : "99991024049218063",
|
||||
"total_coins" : "99991024049218063",
|
||||
"transaction_hash" : "47AC79011652D2A56AE04D3DD618C60A6669E3F94308C803554E890D2BD94481"
|
||||
},
|
||||
"ledger_hash" : "C88A0EEC0E785A4C3E99F2A8B8EE0D7BDF3DE6C786C39B1B01547F6DAE5A4B7F",
|
||||
"ledger_index" : 54300962,
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
The response follows the [standard format][], with a successful result containing information about the ledger, including the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:-------------------------------|:--------|:----------------------------------|
|
||||
| `ledger` | Object | The complete header data of this ledger. |
|
||||
| `ledger.account_hash` | String | Hash of all account state information in this ledger, as hex |
|
||||
| `ledger.accountState` | Array | (Omitted unless requested) All the [account-state information](ledger-data-formats.html) in this ledger. |
|
||||
| `ledger.close_flags` | Integer | A bit-map of flags relating to the closing of this ledger. Currently, the ledger has only one flag defined for `close_flags`: **`sLCF_NoConsensusTime`** (value 1). If this flag is enabled, it means that validators were in conflict regarding the correct close time for the ledger, but build otherwise the same ledger, so they declared consensus while "agreeing to disagree" on the close time. In this case, the consensus ledger contains a `close_time` that is 1 second after that of the previous ledger. (In this case, there is no official close time, but the actual real-world close time is probably 3-6 seconds later than the specified `close_time`.) |
|
||||
| `ledger.close_time` | Integer | The time this ledger was closed, in [seconds since the Ripple Epoch][] |
|
||||
| `ledger.close_time_human` | String | The time this ledger was closed, in human-readable format. Always uses the UTC time zone. [Updated in: rippled 1.5.0][] |
|
||||
| `ledger.close_time_resolution` | Integer | Ledger close times are rounded to within this many seconds. |
|
||||
| `ledger.closed` | Boolean | Whether or not this ledger has been closed |
|
||||
| `ledger.ledger_hash` | String | Unique identifying hash of the entire ledger. |
|
||||
| `ledger.ledger_index` | String | The [Ledger Index][] of this ledger, as a quoted integer |
|
||||
| `ledger.parent_close_time` | Integer | The time at which the previous ledger was closed. |
|
||||
| `ledger.parent_hash` | String | Unique identifying hash of the ledger that came immediately before this one. |
|
||||
| `ledger.total_coins` | String | Total number of XRP drops in the network, as a quoted integer. (This decreases as transaction costs destroy XRP.) |
|
||||
| `ledger.transaction_hash` | String | Hash of the transaction information included in this ledger, as hex |
|
||||
| `ledger.transactions` | Array | (Omitted unless requested) Transactions applied in this ledger version. By default, members are the transactions' identifying [Hash][] strings. If the request specified `expand` as true, members are full representations of the transactions instead, in either JSON or binary depending on whether the request specified `binary` as true. |
|
||||
| `ledger_hash` | String | Unique identifying hash of the entire ledger. |
|
||||
| `ledger_index` | Number | The [Ledger Index][] of this ledger. |
|
||||
| `validated` | Boolean | _(May be omitted)_ If `true`, this is a validated ledger version. If omitted or set to `false`, this ledger's data is not final. |
|
||||
| `queue_data` | Array | _(Omitted unless requested with the `queue` parameter)_ Array of objects describing queued transactions, in the same order as the queue. If the request specified `expand` as true, members contain full representations of the transactions, in either JSON or binary depending on whether the request specified `binary` as true. Added by the [FeeEscalation amendment][]. [New in: rippled 0.70.0][] |
|
||||
|
||||
The following fields are deprecated and may be removed without further notice: `accepted`, `hash` (use `ledger_hash` instead), `seqNum` (use `ledger_index` instead), `totalCoins` (use `total_coins` instead).
|
||||
|
||||
Each member of the `queue_data` array represents one transaction in the queue. Some fields of this object may be omitted because they have not yet been calculated. The fields of this object are as follows:
|
||||
|
||||
| Field | Value | Description |
|
||||
|:--------------------|:-----------------|:------------------------------------|
|
||||
| `account` | String | The [Address][] of the sender for this queued transaction. |
|
||||
| `tx` | String or Object | By default, this is a String containing the [identifying hash](basic-data-types.html#hashes) of the transaction. If transactions are expanded in binary format, this is an object whose only field is `tx_blob`, containing the binary form of the transaction as a decimal string. If transactions are expanded in JSON format, this is an object containing the [transaction object](transaction-formats.html) including the transaction's identifying hash in the `hash` field. |
|
||||
| `retries_remaining` | Number | How many times this transaction can be retried before being dropped. |
|
||||
| `preflight_result` | String | The tentative result from preliminary transaction checking. This is always `tesSUCCESS`. |
|
||||
| `last_result` | String | _(May be omitted)_ If this transaction was left in the queue after getting a [retriable (`ter`) result](ter-codes.html), this is the exact `ter` result code it got. |
|
||||
| `auth_change` | Boolean | _(May be omitted)_ Whether this transaction changes this address's [ways of authorizing transactions](transaction-basics.html#authorizing-transactions). |
|
||||
| `fee` | String | _(May be omitted)_ The [Transaction Cost](transaction-cost.html) of this transaction, in [drops of XRP][]. |
|
||||
| `fee_level` | String | _(May be omitted)_ The transaction cost of this transaction, relative to the minimum cost for this type of transaction, in [fee levels][]. |
|
||||
| `max_spend_drops` | String | _(May be omitted)_ The maximum amount of [XRP, in drops][], this transaction could potentially send or destroy. |
|
||||
|
||||
If the request specified `"owner_funds": true` and expanded transactions, the response has a field `owner_funds` in the `metaData` object of each [OfferCreate transaction][]. The purpose of this field is to make it easier to track the [funding status of offers](offers.html#lifecycle-of-an-offer) with each new validated ledger. This field is defined slightly differently than the version of this field in [Order Book subscription streams](subscribe.html#order-book-streams):
|
||||
|
||||
| `Field` | Value | Description |
|
||||
|:--------------|:-------|:----------------------------------------------------|
|
||||
| `owner_funds` | String | Numeric amount of the `TakerGets` currency that the `Account` sending this OfferCreate transaction has after the execution of all transactions in this ledger. This does not check whether the currency amount is [frozen](freezes.html). |
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
* `lgrNotFound` - The ledger specified by the `ledger_hash` or `ledger_index` does not exist, or it does exist but the server does not have it.
|
||||
* `noPermission` - If you specified `full` or `accounts` as true, but are not connected to the server as an admin (usually, admin requires connecting on a local port).
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -0,0 +1,99 @@
|
||||
---
|
||||
html: ledger_closed.html
|
||||
parent: ledger-methods.html
|
||||
blurb: 最新の閉鎖済みレジャーの一意のIDを返します。
|
||||
label:
|
||||
- ブロックチェーン
|
||||
---
|
||||
# ledger_closed
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerClosed.cpp "Source")
|
||||
|
||||
`ledger_closed`メソッドは、最新の決済済みレジャーの一意のIDを返します。(このレジャーは必ずしも検証済みで変更不可能ではありません。)
|
||||
|
||||
## 要求フォーマット
|
||||
要求フォーマットの例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 2,
|
||||
"command": "ledger_closed"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_closed",
|
||||
"params": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*コマンドライン*
|
||||
|
||||
```
|
||||
#Syntax: ledger_closed
|
||||
rippled ledger_closed
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[試してみる >](websocket-api-tool.html#ledger_closed)
|
||||
|
||||
このメソッドはパラメーターを受け入れません。
|
||||
|
||||
## 応答フォーマット
|
||||
処理が成功した応答の例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02",
|
||||
"ledger_index": 6643099
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"ledger_hash": "8B5A0C5F6B198254A6E411AF55C29EE40AA86251D2E78DD0BB17647047FA9C24",
|
||||
"ledger_index": 8696231,
|
||||
"status": "success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
この応答は[標準フォーマット][]に従っており、正常に完了した場合は結果に次のフィールドが含まれます。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:---------------|:-----------------|:-----------------------------------------|
|
||||
| `ledger_hash` | 文字列 | このレジャーバージョンの一意の[ハッシュ][](16進数)。 |
|
||||
| `ledger_index` | 符号なし整数 | このレジャーバージョンの[レジャーインデックス][]。 |
|
||||
|
||||
## 考えられるエラー
|
||||
|
||||
* いずれかの[汎用エラータイプ][]。
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -0,0 +1,111 @@
|
||||
---
|
||||
html: ledger_closed.html
|
||||
parent: ledger-methods.html
|
||||
blurb: Get the latest closed ledger version.
|
||||
labels:
|
||||
- Blockchain
|
||||
---
|
||||
# ledger_closed
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerClosed.cpp "Source")
|
||||
|
||||
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:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 2,
|
||||
"command": "ledger_closed"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_closed",
|
||||
"params": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
#Syntax: ledger_closed
|
||||
rippled ledger_closed
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_closed)
|
||||
|
||||
This method accepts no parameters.
|
||||
|
||||
## Response Format
|
||||
An example of a successful response:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02",
|
||||
"ledger_index": 6643099
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"ledger_hash": "8B5A0C5F6B198254A6E411AF55C29EE40AA86251D2E78DD0BB17647047FA9C24",
|
||||
"ledger_index": 8696231,
|
||||
"status": "success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{
|
||||
"result" : {
|
||||
"ledger_hash" : "6F5D3B97F1CAA8440AFCED3CA10FB9DC6472F64DEBC2EFAE7CAE7FC0123F32DA",
|
||||
"ledger_index" : 56843991,
|
||||
"status" : "success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
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][].
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -0,0 +1,100 @@
|
||||
---
|
||||
html: ledger_current.html
|
||||
parent: ledger-methods.html
|
||||
blurb: 現在進行中のレジャーの一意のIDを返します。
|
||||
label:
|
||||
- ブロックチェーン
|
||||
---
|
||||
# ledger_current
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerCurrent.cpp "Source")
|
||||
|
||||
`ledger_current`メソッドは、現在進行中のレジャーの一意のIDを返します。このコマンドで返されるレジャーは確定されたものではないため、このコマンドは主にテストに有用です。
|
||||
|
||||
## 要求フォーマット
|
||||
|
||||
要求フォーマットの例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id":2,
|
||||
"command":"ledger_current"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method":"ledger_current",
|
||||
"params":[
|
||||
{}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*コマンドライン*
|
||||
|
||||
```sh
|
||||
#Syntax: ledger_current
|
||||
rippled ledger_current
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[試してみる >](websocket-api-tool.html#ledger_current)
|
||||
|
||||
この要求にはパラメーターは含まれていません。
|
||||
|
||||
|
||||
## 応答フォーマット
|
||||
処理が成功した応答の例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id":2,
|
||||
"status":"success",
|
||||
"type":"response",
|
||||
"result":{
|
||||
"ledger_current_index":6643240
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result":{
|
||||
"ledger_current_index":8696233,
|
||||
"status":"success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
応答は[標準フォーマット][]に従っており、正常に完了した場合は結果に次のフィールドが含まれています。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:-----------------------|:-----------------|:-------------------------------|
|
||||
| `ledger_current_index` | 符号なし整数 | このレジャーのシーケンス番号 |
|
||||
|
||||
現行レジャーのハッシュは、レジャーの内容とともに常に変化するため、`ledger_hash`フィールドはありません。
|
||||
|
||||
## 考えられるエラー
|
||||
|
||||
* [汎用エラータイプ][]のすべて。
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -0,0 +1,111 @@
|
||||
---
|
||||
html: ledger_current.html
|
||||
parent: ledger-methods.html
|
||||
blurb: Get the current working ledger version.
|
||||
labels:
|
||||
- Blockchain
|
||||
---
|
||||
# ledger_current
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerCurrent.cpp "Source")
|
||||
|
||||
The `ledger_current` method returns the unique identifiers of the current in-progress [ledger](ledgers.html). This command is mostly useful for testing, because the ledger returned is still in flux.
|
||||
|
||||
## Request Format
|
||||
|
||||
An example of the request format:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 2,
|
||||
"command": "ledger_current"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_current",
|
||||
"params": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
#Syntax: ledger_current
|
||||
rippled ledger_current
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_current)
|
||||
|
||||
The request contains no parameters.
|
||||
|
||||
|
||||
## Response Format
|
||||
An example of a successful response:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 2,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"ledger_current_index": 6643240
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"ledger_current_index": 8696233,
|
||||
"status": "success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{
|
||||
"result" : {
|
||||
"ledger_current_index" : 56844050,
|
||||
"status" : "success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following field:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:-----------------------|:------------------------------------|:--------------|
|
||||
| `ledger_current_index` | Unsigned Integer - [Ledger Index][] | The ledger index of this ledger version. |
|
||||
|
||||
A `ledger_hash` field is not provided, because the hash of the current ledger is constantly changing along with its contents.
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -0,0 +1,270 @@
|
||||
---
|
||||
html: ledger_data.html
|
||||
parent: ledger-methods.html
|
||||
blurb: 指定されたレジャーの内容を取得します。
|
||||
label:
|
||||
- ブロックチェーン
|
||||
- データ保持
|
||||
---
|
||||
# ledger_data
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerData.cpp "Source")
|
||||
|
||||
`ledger_data`メソッドは指定されたレジャーの内容を取得します。1つのレジャーバージョンの内容全体を取得するため、複数のコールを繰り返し実行できます。
|
||||
|
||||
## 要求フォーマット
|
||||
要求フォーマットの例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id":2,
|
||||
"ledger_hash":"842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"command":"ledger_data",
|
||||
"limit":5,
|
||||
"binary": true
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method":"ledger_data",
|
||||
"params":[
|
||||
{
|
||||
"binary": true,
|
||||
"ledger_hash":"842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"limit":5
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
**注記:**`ledger_data`のコマンドライン構文はありません。代わりに[jsonメソッド][]を使用してコマンドラインからこのメソッドにアクセスできます。
|
||||
|
||||
要求には以下のフィールドが含まれます。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:---------------|:-------------------------------------------|:---------------|
|
||||
| `id` | (任意) | (WebSocketのみ)応答が遅延して順不同になる場合にこの要求を他の要求と区別するためのID。 |
|
||||
| `ledger_hash` | 文字列 | _(省略可)_ 使用するレジャーバージョンの20バイトの16進文字列。([レジャーの指定][]を参照してください) |
|
||||
| `ledger_index` | 文字列または符号なし整数 | _(省略可)_ 使用するレジャーのシーケンス番号、またはレジャーを自動的に選択するためのショートカット文字列。([レジャーの指定][]を参照してください) |
|
||||
| `binary` | ブール値 | (省略可、デフォルトではfalseです)trueに設定すると、レジャーオブジェクトがJSONではなくハッシュされた16進文字列として返されます。 |
|
||||
| `limit` | 整数 | (省略可、デフォルト値は可変)取得するレジャーオブジェクトの数を制限します。サーバーはこの値に従う必要はありません。 |
|
||||
| `marker` | [マーカー][] | 以前にページネーションされた応答の値。その応答を停止した箇所からデータの取得を再開します。 |
|
||||
|
||||
`ledger`フィールドは廃止予定であり、今後予告なしに削除される可能性があります。
|
||||
|
||||
## 応答フォーマット
|
||||
|
||||
処理が成功した応答の例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket (binary:true)*
|
||||
|
||||
```json
|
||||
{
|
||||
"id":2,
|
||||
"result":{
|
||||
"ledger_hash":"842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"ledger_index":"6885842",
|
||||
"marker":"0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||||
"state":[
|
||||
{
|
||||
"data":"11006122000000002400000001250062FEA42D0000000055C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA0466240000000354540208114C909F42250CFE8F12A7A1A0DFBD3CBD20F32CD79",
|
||||
"index":"00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||||
},
|
||||
{
|
||||
"data":"11006F22000000002400000003250035788533000000000000000034000000000000000055555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F501071633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C6800064D4838D7EA4C68000000000000000000000000000425443000000000035DD7DF146893456296BF4061FBE68735D28F3286540000000000F42408114A4B8F5F7B644AEDC3447F9459C132EEB016A133B",
|
||||
"index":"000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||||
},
|
||||
{
|
||||
"data":"11006F2200020000240000000A250067395C33000000000000000034000000000000000055A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C5010DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C00064D554C88B43EFA00000000000000000000000000055534400000000000A20B3C85F482532A9578DBB3950B85CA06594D165400000B59B9F780081148366FB9ACD2A0FD822E31112D2EB6F98C317C2C1",
|
||||
"index":"0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||||
},
|
||||
{
|
||||
"data":"1100612200000000240000000125003E742F2D0000000055286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21624000000306DC42008114225BAB89C4A4B94624BB069D6DB3C819F934991C",
|
||||
"index":"0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||||
},
|
||||
{
|
||||
"data":"110072220002000025000B65783700000000000000003800000000000000005587591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D03756280000000000000000000000000000000000000004254430000000000000000000000000000000000000000000000000166800000000000000000000000000000000000000042544300000000000A20B3C85F482532A9578DBB3950B85CA06594D167D4C38D7EA4C680000000000000000000000000004254430000000000C795FDF8A637BCAAEDAD1C434033506236C82A2D",
|
||||
"index":"000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status":"success",
|
||||
"type":"response"
|
||||
}
|
||||
```
|
||||
|
||||
*WebSocket (binary:false)*
|
||||
|
||||
```json
|
||||
{
|
||||
"id":2,
|
||||
"result":{
|
||||
"ledger_hash":"842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"ledger_index":"6885842",
|
||||
"marker":"0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||||
"state":[
|
||||
{
|
||||
"Account":"rKKzk9ghA2iuy3imqMXUHJqdRPMtNDGf4c",
|
||||
"Balance":"893730848",
|
||||
"Flags":0,
|
||||
"LedgerEntryType":"AccountRoot",
|
||||
"OwnerCount":0,
|
||||
"PreviousTxnID":"C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA046",
|
||||
"PreviousTxnLgrSeq":6487716,
|
||||
"Sequence":1,
|
||||
"index":"00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||||
},
|
||||
{
|
||||
"Account":"rGryPmNWFognBgMtr9k4quqPbbEcCrhNmD",
|
||||
"BookDirectory":"71633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C68000",
|
||||
"BookNode":"0000000000000000",
|
||||
"Flags":0,
|
||||
"LedgerEntryType":"Offer",
|
||||
"OwnerNode":"0000000000000000",
|
||||
"PreviousTxnID":"555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F",
|
||||
"PreviousTxnLgrSeq":3504261,
|
||||
"Sequence":3,
|
||||
"TakerGets":"1000000",
|
||||
"TakerPays":{
|
||||
"currency":"BTC",
|
||||
"issuer":"rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
|
||||
"value":"1"
|
||||
},
|
||||
"index":"000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||||
},
|
||||
{
|
||||
"Account":"rUy8tW38MW9ma7kSjRgB2GHtTkQAFRyrN8",
|
||||
"BookDirectory":"DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C000",
|
||||
"BookNode":"0000000000000000",
|
||||
"Flags":131072,
|
||||
"LedgerEntryType":"Offer",
|
||||
"OwnerNode":"0000000000000000",
|
||||
"PreviousTxnID":"A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C",
|
||||
"PreviousTxnLgrSeq":6764892,
|
||||
"Sequence":10,
|
||||
"TakerGets":"780000000000",
|
||||
"TakerPays":{
|
||||
"currency":"USD",
|
||||
"issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value":"5850"
|
||||
},
|
||||
"index":"0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||||
},
|
||||
{
|
||||
"Account":"rh3C81VfNDhhWPQWCU8ZGgknvdgNUvRtM9",
|
||||
"Balance":"13000000000",
|
||||
"Flags":0,
|
||||
"LedgerEntryType":"AccountRoot",
|
||||
"OwnerCount":0,
|
||||
"PreviousTxnID":"286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21",
|
||||
"PreviousTxnLgrSeq":4092975,
|
||||
"Sequence":1,
|
||||
"index":"0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||||
},
|
||||
{
|
||||
"Balance":{
|
||||
"currency":"BTC",
|
||||
"issuer":"rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value":"0"
|
||||
},
|
||||
"Flags":131072,
|
||||
"HighLimit":{
|
||||
"currency":"BTC",
|
||||
"issuer":"rKUK9omZqVEnraCipKNFb5q4tuNTeqEDZS",
|
||||
"value":"10"
|
||||
},
|
||||
"HighNode":"0000000000000000",
|
||||
"LedgerEntryType":"RippleState",
|
||||
"LowLimit":{
|
||||
"currency":"BTC",
|
||||
"issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value":"0"
|
||||
},
|
||||
"LowNode":"0000000000000000",
|
||||
"PreviousTxnID":"87591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D0375",
|
||||
"PreviousTxnLgrSeq":746872,
|
||||
"index":"000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status":"success",
|
||||
"type":"response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC (binary:true)*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result":{
|
||||
"ledger_hash":"842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"ledger_index":"6885842",
|
||||
"marker":"0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||||
"state":[
|
||||
{
|
||||
"data":"11006122000000002400000001250062FEA42D0000000055C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA0466240000000354540208114C909F42250CFE8F12A7A1A0DFBD3CBD20F32CD79",
|
||||
"index":"00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||||
},
|
||||
{
|
||||
"data":"11006F22000000002400000003250035788533000000000000000034000000000000000055555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F501071633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C6800064D4838D7EA4C68000000000000000000000000000425443000000000035DD7DF146893456296BF4061FBE68735D28F3286540000000000F42408114A4B8F5F7B644AEDC3447F9459C132EEB016A133B",
|
||||
"index":"000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||||
},
|
||||
{
|
||||
"data":"11006F2200020000240000000A250067395C33000000000000000034000000000000000055A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C5010DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C00064D554C88B43EFA00000000000000000000000000055534400000000000A20B3C85F482532A9578DBB3950B85CA06594D165400000B59B9F780081148366FB9ACD2A0FD822E31112D2EB6F98C317C2C1",
|
||||
"index":"0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||||
},
|
||||
{
|
||||
"data":"1100612200000000240000000125003E742F2D0000000055286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21624000000306DC42008114225BAB89C4A4B94624BB069D6DB3C819F934991C",
|
||||
"index":"0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||||
},
|
||||
{
|
||||
"data":"110072220002000025000B65783700000000000000003800000000000000005587591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D03756280000000000000000000000000000000000000004254430000000000000000000000000000000000000000000000000166800000000000000000000000000000000000000042544300000000000A20B3C85F482532A9578DBB3950B85CA06594D167D4C38D7EA4C680000000000000000000000000004254430000000000C795FDF8A637BCAAEDAD1C434033506236C82A2D",
|
||||
"index":"000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||||
}
|
||||
],
|
||||
"status":"success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
この応答は[標準フォーマット][]に従っており、正常に完了した場合は結果に次のフィールドが含まれます。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:---------------|:-------------------------------------------|:---------------|
|
||||
| `ledger_index` | 符号なし整数 | このレジャーのシーケンス番号 |
|
||||
| `ledger_hash` | 文字列 | レジャー全体の一意の識別用ハッシュ。 |
|
||||
| `state` | 配列 | ツリーのデータが含まれているJSONオブジェクトの配列。以下のように定義されています。 |
|
||||
| `marker` | [マーカー][] | 応答がページネーションされていることを示す、サーバーが定義した値。この値を次のコールに渡して、このコールで終わった箇所から再開します。 |
|
||||
|
||||
`state`配列の各オブジェクトのフォーマットは、要求で`binary`がtrueに設定されているかどうかによって異なります。各`state`オブジェクトには以下のフィールドが含まれます。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:--------------------|:----------|:-------------------------------------------|
|
||||
| `data` | 文字列 | (`"binary":true`の場合にのみ含まれる)要求されたデータの16進表現。 |
|
||||
| `LedgerEntryType` | 文字列 | (`"binary":false`の場合にのみ含まれる)このオブジェクトが表すレジャーオブジェクトの型を示す文字列。詳細なリストについては[レジャーデータフォーマット](ledger-data-formats.html)を参照してください。 |
|
||||
| (追加のフィールド) | (各種) | (`"binary":false`の場合にのみ含まれる)このオブジェクトを記述する追加フィールド。オブジェクトのLedgerEntryTypeに応じて異なります。 |
|
||||
| `index` | 文字列 | このレジャーエントリの一意のID(16進数) |
|
||||
|
||||
## 考えられるエラー
|
||||
|
||||
* [汎用エラータイプ][]のすべて。
|
||||
* `invalidParams` - 1つ以上のフィールドの指定が正しくないか、1つ以上の必須フィールドが指定されていません。
|
||||
* `lgrNotFound` - `ledger_hash`または`ledger_index`で指定したレジャーが存在しないか、存在してはいるもののサーバーが保有していません。
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -0,0 +1,271 @@
|
||||
---
|
||||
html: ledger_data.html
|
||||
parent: ledger-methods.html
|
||||
blurb: Get the raw contents of a ledger version.
|
||||
labels:
|
||||
- Blockchain
|
||||
- Data Retention
|
||||
---
|
||||
# ledger_data
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerData.cpp "Source")
|
||||
|
||||
The `ledger_data` method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version.
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
{% include '_snippets/no-cli-syntax.md' %}
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 2,
|
||||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"command": "ledger_data",
|
||||
"limit": 5,
|
||||
"binary": true
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_data",
|
||||
"params": [
|
||||
{
|
||||
"binary": true,
|
||||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"limit": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
A request can include the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:-------------------------------------------|:---------------|
|
||||
| `id` | (Arbitrary) | (WebSocket only) Any identifier to separate this request from others in case the responses are delayed or out of order. |
|
||||
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
|
||||
| `ledger_index` | String or Unsigned Integer | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
|
||||
| `binary` | Boolean | (Optional, defaults to False) If set to true, return ledger objects as hashed hex strings instead of JSON. |
|
||||
| `limit` | Integer | (Optional, default varies) Limit the number of ledger objects to retrieve. The server is not required to honor this value. |
|
||||
| `marker` | [Marker][] | Value from a previous paginated response. Resume retrieving data where that response left off. |
|
||||
|
||||
The `ledger` field is deprecated and may be removed without further notice.
|
||||
|
||||
## Response Format
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket (binary:true)*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 2,
|
||||
"result": {
|
||||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"ledger_index": "6885842",
|
||||
"marker": "0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||||
"state": [
|
||||
{
|
||||
"data": "11006122000000002400000001250062FEA42D0000000055C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA0466240000000354540208114C909F42250CFE8F12A7A1A0DFBD3CBD20F32CD79",
|
||||
"index": "00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||||
},
|
||||
{
|
||||
"data": "11006F22000000002400000003250035788533000000000000000034000000000000000055555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F501071633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C6800064D4838D7EA4C68000000000000000000000000000425443000000000035DD7DF146893456296BF4061FBE68735D28F3286540000000000F42408114A4B8F5F7B644AEDC3447F9459C132EEB016A133B",
|
||||
"index": "000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||||
},
|
||||
{
|
||||
"data": "11006F2200020000240000000A250067395C33000000000000000034000000000000000055A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C5010DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C00064D554C88B43EFA00000000000000000000000000055534400000000000A20B3C85F482532A9578DBB3950B85CA06594D165400000B59B9F780081148366FB9ACD2A0FD822E31112D2EB6F98C317C2C1",
|
||||
"index": "0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||||
},
|
||||
{
|
||||
"data": "1100612200000000240000000125003E742F2D0000000055286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21624000000306DC42008114225BAB89C4A4B94624BB069D6DB3C819F934991C",
|
||||
"index": "0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||||
},
|
||||
{
|
||||
"data": "110072220002000025000B65783700000000000000003800000000000000005587591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D03756280000000000000000000000000000000000000004254430000000000000000000000000000000000000000000000000166800000000000000000000000000000000000000042544300000000000A20B3C85F482532A9578DBB3950B85CA06594D167D4C38D7EA4C680000000000000000000000000004254430000000000C795FDF8A637BCAAEDAD1C434033506236C82A2D",
|
||||
"index": "000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*WebSocket (binary:false)*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 2,
|
||||
"result": {
|
||||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"ledger_index": "6885842",
|
||||
"marker": "0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||||
"state": [
|
||||
{
|
||||
"Account": "rKKzk9ghA2iuy3imqMXUHJqdRPMtNDGf4c",
|
||||
"Balance": "893730848",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"OwnerCount": 0,
|
||||
"PreviousTxnID": "C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA046",
|
||||
"PreviousTxnLgrSeq": 6487716,
|
||||
"Sequence": 1,
|
||||
"index": "00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||||
},
|
||||
{
|
||||
"Account": "rGryPmNWFognBgMtr9k4quqPbbEcCrhNmD",
|
||||
"BookDirectory": "71633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C68000",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F",
|
||||
"PreviousTxnLgrSeq": 3504261,
|
||||
"Sequence": 3,
|
||||
"TakerGets": "1000000",
|
||||
"TakerPays": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
|
||||
"value": "1"
|
||||
},
|
||||
"index": "000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||||
},
|
||||
{
|
||||
"Account": "rUy8tW38MW9ma7kSjRgB2GHtTkQAFRyrN8",
|
||||
"BookDirectory": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C000",
|
||||
"BookNode": "0000000000000000",
|
||||
"Flags": 131072,
|
||||
"LedgerEntryType": "Offer",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C",
|
||||
"PreviousTxnLgrSeq": 6764892,
|
||||
"Sequence": 10,
|
||||
"TakerGets": "780000000000",
|
||||
"TakerPays": {
|
||||
"currency": "USD",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "5850"
|
||||
},
|
||||
"index": "0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||||
},
|
||||
{
|
||||
"Account": "rh3C81VfNDhhWPQWCU8ZGgknvdgNUvRtM9",
|
||||
"Balance": "13000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"OwnerCount": 0,
|
||||
"PreviousTxnID": "286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21",
|
||||
"PreviousTxnLgrSeq": 4092975,
|
||||
"Sequence": 1,
|
||||
"index": "0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 131072,
|
||||
"HighLimit": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rKUK9omZqVEnraCipKNFb5q4tuNTeqEDZS",
|
||||
"value": "10"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "BTC",
|
||||
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID": "87591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D0375",
|
||||
"PreviousTxnLgrSeq": 746872,
|
||||
"index": "000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC (binary:true)*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
|
||||
"ledger_index": "6885842",
|
||||
"marker": "0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF",
|
||||
"state": [
|
||||
{
|
||||
"data": "11006122000000002400000001250062FEA42D0000000055C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA0466240000000354540208114C909F42250CFE8F12A7A1A0DFBD3CBD20F32CD79",
|
||||
"index": "00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F"
|
||||
},
|
||||
{
|
||||
"data": "11006F22000000002400000003250035788533000000000000000034000000000000000055555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F501071633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C6800064D4838D7EA4C68000000000000000000000000000425443000000000035DD7DF146893456296BF4061FBE68735D28F3286540000000000F42408114A4B8F5F7B644AEDC3447F9459C132EEB016A133B",
|
||||
"index": "000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5"
|
||||
},
|
||||
{
|
||||
"data": "11006F2200020000240000000A250067395C33000000000000000034000000000000000055A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C5010DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C00064D554C88B43EFA00000000000000000000000000055534400000000000A20B3C85F482532A9578DBB3950B85CA06594D165400000B59B9F780081148366FB9ACD2A0FD822E31112D2EB6F98C317C2C1",
|
||||
"index": "0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7"
|
||||
},
|
||||
{
|
||||
"data": "1100612200000000240000000125003E742F2D0000000055286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21624000000306DC42008114225BAB89C4A4B94624BB069D6DB3C819F934991C",
|
||||
"index": "0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23"
|
||||
},
|
||||
{
|
||||
"data": "110072220002000025000B65783700000000000000003800000000000000005587591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D03756280000000000000000000000000000000000000004254430000000000000000000000000000000000000000000000000166800000000000000000000000000000000000000042544300000000000A20B3C85F482532A9578DBB3950B85CA06594D167D4C38D7EA4C680000000000000000000000000004254430000000000C795FDF8A637BCAAEDAD1C434033506236C82A2D",
|
||||
"index": "000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58"
|
||||
}
|
||||
],
|
||||
"status": "success"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:------------------------------------|:----------------------|
|
||||
| `ledger_index` | Unsigned Integer - [Ledger Index][] | The ledger index of this ledger version. |
|
||||
| `ledger_hash` | String - [Hash][] | Unique identifying hash of this ledger version. |
|
||||
| `state` | Array | Array of JSON objects containing data from the ledger's state tree, as defined below. |
|
||||
| `marker` | [Marker][] | Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. |
|
||||
|
||||
The format of each object in the `state` array depends on whether `binary` was set to true or not in the request. Each `state` object may include the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:--------------------|:----------|:-------------------------------------------|
|
||||
| `data` | String | _(Only included if `"binary":true`)_ Hex representation of the requested data |
|
||||
| `LedgerEntryType` | String | _(Only included if `"binary":false`)_ String indicating what type of ledger object this object represents. See [ledger object types](ledger-object-types.html) for the full list. |
|
||||
| (Additional fields) | (Various) | _(Only included if `"binary":false`)_ Additional fields describing this object, depending on which [ledger object type](ledger-object-types.html) it is. |
|
||||
| `index` | String | Unique identifier for this ledger entry, as hex. |
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][]
|
||||
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
* `lgrNotFound` - The ledger specified by the `ledger_hash` or `ledger_index` does not exist, or it does exist but the server does not have it.
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -0,0 +1,183 @@
|
||||
---
|
||||
html: ledger_entry.html
|
||||
parent: ledger-methods.html
|
||||
blurb: XRP Ledgerの1つのレジャーオブジェクトを生フォーマットで返します。
|
||||
label:
|
||||
- ブロックチェーン
|
||||
- データ保持
|
||||
---
|
||||
# ledger_entry
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerEntry.cpp "Source")
|
||||
|
||||
`ledger_entry`メソッドは、XRP Ledgerの1つのレジャーオブジェクトを生フォーマットで返します。取得可能な各種オブジェクトについては、[レジャーフォーマット][]を参照してください。
|
||||
|
||||
**注記:** このメソッドのコマンドラインバージョンはありません。代わりに[jsonメソッド][]を使用してコマンドラインからこのメソッドにアクセスできます。
|
||||
|
||||
## 要求フォーマット
|
||||
|
||||
要求フォーマットの例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 3,
|
||||
"command": "ledger_entry",
|
||||
"type": "account_root",
|
||||
"account_root": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [
|
||||
{
|
||||
"account_root": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"ledger_index": "validated",
|
||||
"type": "account_root"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[試してみる >](websocket-api-tool.html#ledger_entry)
|
||||
|
||||
このメソッドでは各種データを取得できます。取得するアイテムのタイプを選択するには、当該のパラメーターを渡します。具体的には、以下のフィールドのいずれか1つを指定します。
|
||||
|
||||
1. `index` - 一意のIDを指定して任意のタイプのレジャーオブジェクトを取得します。
|
||||
2. `account_root` - [AccountRootオブジェクト](accountroot.html)を取得します。これは[account_infoメソッド][]とほぼ同等です。
|
||||
3. `directory` - 他のレジャーオブジェクトのリストが含まれている[DirectoryNode](directorynode.html)を取得します。
|
||||
4. `offer` - 通貨取引オファーを定義する[Offerオブジェクト](offer.html)を取得します。
|
||||
5. `ripple_state` - 2つのアカウント間の(XRP以外の)通貨の残高を追跡する[RippleStateオブジェクト](ripplestate.html)を取得します。
|
||||
6. `check` - 受取人が現金化できる支払いである[Checkオブジェクト](check.html)を取得します。[新規: rippled 1.0.0][]
|
||||
7. `escrow` - 特定の時刻または条件に一致するまでXRPを保有する[Escrowオブジェクト](escrow-object.html)を取得します。[新規: rippled 1.0.0][]
|
||||
8. `payment_channel` - 非同期支払いのためにXRPを保有する[PayChannelオブジェクト](paychannel.html)を取得します。[新規: rippled 1.0.0][]
|
||||
9. `deposit_preauth` - [Deposit Authorization](depositauth.html)を必要とするアカウントへの支払いの事前承認を追跡する[DepositPreauthオブジェクト](depositpreauth-object.html)を取得します。[新規: rippled 1.1.0][]
|
||||
|
||||
上記のアイテムを複数指定すると、サーバーはそのうちの1つのみを取得します。どのアイテムが取得されるかは未定義です。
|
||||
|
||||
このメソッドで認識されるすべてのパラメーターのリストを次に示します。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `index` | 文字列 | _(省略可)_ レジャーから取得する1つのオブジェクトの[オブジェクトID](ledger-object-ids.html)を指定します。 |
|
||||
| `account_root` | 文字列 - [アドレス][] | _(省略可)_ 取得する[AccountRootオブジェクト](accountroot.html)を指定します。 |
|
||||
| `check` | 文字列 | _(省略可)_ レジャーから取得する[Checkオブジェクト](check.html)の[オブジェクトID](ledger-object-ids.html)を指定します。 |
|
||||
| `deposit_preauth` | オブジェクトまたは文字列 | _(省略可)_ 取得する[DepositPreauthオブジェクト](depositpreauth-object.html)を指定します。文字列の場合はDepositPreauthオブジェクトの[オブジェクトID](ledger-object-ids.html)(16進数)である必要があります。オブジェクトの場合は`owner`および`authorized`サブフィールドが必要です。 |
|
||||
| `deposit_preauth.owner` | 文字列 - [アドレス][] | _(`deposit_preauth`がオブジェクトとして指定されている場合に必須)_ 事前承認を提供したアカウント。 |
|
||||
| `deposit_preauth.authorized` | 文字列 - [アドレス][] | _(`deposit_preauth`がオブジェクトとして指定されている場合に必須)_ 事前承認を受けたアカウント。 |
|
||||
| `directory` | オブジェクトまたは文字列 | _(省略可)_ 取得する[DirectoryNode](directorynode.html)を指定します。文字列の場合はディレクトリーの[オブジェクトID](ledger-object-ids.html)(16進数)である必要があります。オブジェクトの場合はサブフィールドとして`dir_root`または`owner`のいずれかが必要です。また必要に応じて`sub_index`サブフィールドを指定できます。 |
|
||||
| `directory.sub_index` | 符号なし整数 | _(省略可)_ 指定されている場合は、[DirectoryNode](directorynode.html)の後のページにジャンプします。 |
|
||||
| `directory.dir_root` | 文字列 | _(`directory`がオブジェクトとして指定されており、`directory.owner`が指定されていない場合に必須)_ 取得するディレクトリーを識別する一意のインデックス(16進数)。 |
|
||||
| `directory.owner` | 文字列 | _(`directory`がオブジェクトとして指定されており、`directory.dir_root`が指定されていない場合に必須)_ このディレクトリーに関連付けられているアカウントの一意のアドレス。 |
|
||||
| `escrow` | オブジェクトまたは文字列 | _(省略可)_ 取得する[Escrowオブジェクト](escrow-object.html)を指定します。文字列の場合はEscrowの[オブジェクトID](ledger-object-ids.html)(16進数)である必要があります。オブジェクトの場合は`owner`および`seq`サブフィールドが必要です。 |
|
||||
| `escrow.owner` | 文字列 - [アドレス][] | _(`escrow`がオブジェクトとして指定されている場合に必須)_ Escrowオブジェクトの所有者(送金元)。 |
|
||||
| `escrow.seq` | 符号なし整数 | _(`escrow`がオブジェクトとして指定されている場合に必須)_ Escrowオブジェクトを作成したトランザクションのシーケンス番号。 |
|
||||
| `offer` | オブジェクトまたは文字列 | _(省略可)_ 取得する[Offer オブジェクト](offer.html)を指定します。文字列の場合はOfferの[一意のインデックス](ledgers.html#ツリーの形式)として解釈されます。オブジェクトの場合は、オファーを一意に識別するためサブフィールド`account`と`seq`が必要です。 |
|
||||
| `offer.account` | 文字列 - [アドレス][] | _(`offer`が指定されている場合に必須)_ オファーを出したアカウント。 |
|
||||
| `offer.seq` | 符号なし整数 | _(`offer`が指定されている場合に必須)_ Offerオブジェクトを作成したトランザクションのシーケンス番号。 |
|
||||
| `payment_channel` | 文字列 | _(省略可)_ 取得する[PayChannel オブジェクト](paychannel.html)の[オブジェクトID](ledger-object-ids.html)を指定します。 |
|
||||
| `ripple_state` | オブジェクト | _(省略可)_ 取得するRippleState(トラストライン)オブジェクトを指定するオブジェクト。取得するRippleStateエントリを一意に指定するため、`accounts`および`currency`サブフィールドが必要です。 |
|
||||
| `ripple_state.accounts` | 配列 | _(`ripple_state`が指定されている場合に必須)_ アカウントの[アドレス][]からなる長さ2の配列。この[RippleStateオブジェクト](ripplestate.html)によりリンクされる2つのアカウントを定義します。 |
|
||||
| `ripple_state.currency` | 文字列 | _(`ripple_state`が指定されている場合に必須)_ 取得する[RippleStateオブジェクト](ripplestate.html)の[通貨コード][]。 | |
|
||||
| `binary` | ブール値 | _(省略可)_ trueの場合、要求したレジャーオブジェクトの内容が16進文字列として返されます。それ以外の場合はデータがJSONフォーマットで返されます。デフォルトは`false`です。[更新: rippled 1.2.0][] |
|
||||
| `ledger_hash` | 文字列 | _(省略可)_ 使用するレジャーバージョンの20バイトの16進文字列。([レジャーの指定][]を参照してください) |
|
||||
| `ledger_index` | 文字列または符号なし整数 | _(省略可)_ 使用するレジャーの[レジャーインデックス][]、またはレジャーを自動的に選択するためのショートカット文字列。([レジャーの指定][]を参照してください) |
|
||||
|
||||
`generator`パラメーターと`ledger`パラメーターは廃止予定であり、今後予告なしに削除される可能性があります。
|
||||
|
||||
## 応答フォーマット
|
||||
|
||||
処理が成功した応答の例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 3,
|
||||
"result": {
|
||||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05",
|
||||
"ledger_index": 6889347,
|
||||
"node": {
|
||||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"Balance": "27389517749",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"OwnerCount": 18,
|
||||
"PreviousTxnID": "B6B410172C0B65575D89E464AF5B99937CC568822929ABF87DA75CBD11911932",
|
||||
"PreviousTxnLgrSeq": 6592159,
|
||||
"Sequence": 1400,
|
||||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
|
||||
}
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05",
|
||||
"ledger_index": 8696234,
|
||||
"node": {
|
||||
"Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"Balance": "13176802787",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"OwnerCount": 17,
|
||||
"PreviousTxnID": "E5D0235A236F7CD162C1AB87A0325056AE61CFC63D92D1494AB5D826AAD0CDCA",
|
||||
"PreviousTxnLgrSeq": 8554742,
|
||||
"Sequence": 1406,
|
||||
"index": "4F83A2CF7E70F77F79A307E6A472BFC2585B806A70833CCD1C26105BAE0D6E05"
|
||||
},
|
||||
"status": "success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
この応答は[標準フォーマット][]に従っており、正常に完了した場合は結果に次のフィールドが含まれます。
|
||||
|
||||
| `Field` | 型 | 説明 |
|
||||
|:---------------|:-----------------|:-----------------------------------------|
|
||||
| `index` | 文字列 | この[レジャーオブジェクト](ledger-object-types.html)の一意のID。 |
|
||||
| `ledger_index` | 符号なし整数 | このデータの取得時に使用されたレジャーの[レジャーインデックス][]。 |
|
||||
| `node` | オブジェクト | _(`"binary": true`が指定されている場合は省略)_[レジャーフォーマット][]に基づく、このレジャーオブジェクトのデータが含まれているオブジェクト。 |
|
||||
| `node_binary` | 文字列 | _(`"binary":true`が指定されていない場合は省略可)_ レジャーオブジェクトの[バイナリー表現](serialization.html)(16進数)。 |
|
||||
|
||||
## 考えられるエラー
|
||||
|
||||
* いずれかの[汎用エラータイプ][]。
|
||||
* `deprecatedFeature` - 削除されたフィールド(`generator`など)が要求に指定されていました。
|
||||
* `entryNotFound` - 要求されたレジャーオブジェクトはレジャーに存在しません。
|
||||
* `invalidParams` - 1つ以上のフィールドの指定が正しくないか、1つ以上の必須フィールドが指定されていません。
|
||||
* `lgrNotFound` - `ledger_hash`または`ledger_index`で指定したレジャーが存在しないか、存在してはいるもののサーバーが保有していません。
|
||||
* `malformedAddress` - 要求の[アドレス][]フィールドが誤って指定されています。
|
||||
* `malformedCurrency` - 要求の[通貨コード][]フィールドが誤って指定されています。
|
||||
* `malformedOwner` - 要求の`escrow.owner`サブフィールドが誤って指定されています。
|
||||
* `malformedRequest` - 要求にフィールドが無効な組み合わせで指定されているか、1つ以上のフィールドの型が誤っています。
|
||||
* `unknownOption` - 要求に指定されたフィールドが、予期される要求フォーマットのいずれにも一致していません。
|
||||
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -0,0 +1,699 @@
|
||||
---
|
||||
html: ledger_entry.html
|
||||
parent: ledger-methods.html
|
||||
blurb: Get one element from a ledger version.
|
||||
labels:
|
||||
- Blockchain
|
||||
- Data Retention
|
||||
---
|
||||
# ledger_entry
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/LedgerEntry.cpp "Source")
|
||||
|
||||
The `ledger_entry` method returns a single ledger object from the XRP Ledger in its raw format. See [ledger format][] for information on the different types of objects you can retrieve.
|
||||
|
||||
## Request Format
|
||||
|
||||
This method can retrieve several different types of data. You can select which type of item to retrieve by passing the appropriate parameters, comprised of the general and type-specific fields listed below, and following the standard [request formatting](request-formatting.html). (For example, a WebSocket request always has the `command` field and optionally an `id` field, and a JSON-RPC request uses the `method` and `params` fields.)
|
||||
|
||||
{% include '_snippets/no-cli-syntax.md' %}
|
||||
|
||||
### General Fields
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `binary` | Boolean | _(Optional)_ If `true`, return the requested ledger object's contents as a hex string in the XRP Ledger's [binary format](serialization.html). Otherwise, return data in JSON format. The default is `false`. [Updated in: rippled 1.2.0][] |
|
||||
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
|
||||
| `ledger_index` | String or Unsigned Integer | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string (e.g. "validated" or "closed" or "current") to choose a ledger automatically. (See [Specifying Ledgers][]) |
|
||||
|
||||
The `generator` and `ledger` parameters are deprecated and may be removed without further notice.
|
||||
|
||||
In addition to the general fields above, you must specify *exactly 1* of the following fields to indicate what type of object to retrieve, along with its sub-fields as appropriate. The valid fields are:
|
||||
|
||||
- [`index`](#get-ledger-object-by-id)
|
||||
- [`account_root`](#get-accountroot-object)
|
||||
- [`directory`](#get-directorynode-object)
|
||||
- [`offer`](#get-offer-object)
|
||||
- [`ripple_state`](#get-ripplestate-object)
|
||||
- [`check`](#get-check-object)
|
||||
- [`escrow`](#get-escrow-object)
|
||||
- [`payment_channel`](#get-paychannel-object)
|
||||
- [`deposit_preauth`](#get-depositpreauth-object)
|
||||
- [`ticket`](#get-ticket-object)
|
||||
|
||||
**Caution:** If you specify more than 1 of these type-specific fields in a request, the server retrieves results for only 1 of them. It is not defined which one the server chooses, so you should avoid doing this.
|
||||
|
||||
|
||||
### Get Ledger Object by ID
|
||||
|
||||
Retrieve any type of ledger object by its unique ID.
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:--------|:-------|:----------------------------------------------------------|
|
||||
| `index` | String | The [object ID](ledger-object-ids.html) of a single object to retrieve from the ledger, as a 64-character (256-bit) hexadecimal string. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "ledger_entry",
|
||||
"index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [
|
||||
{
|
||||
"index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4", "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-by-object-id)
|
||||
|
||||
> **Tip:** You can use this type of request to get any singleton object, if it exists in the ledger data, because its ID is always the same. For example:
|
||||
>
|
||||
> - [`Amendments`](amendments-object.html) - `7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4`
|
||||
> - [`FeeSettings`](feesettings.html) - `4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A651`
|
||||
> - [Recent History `LedgerHashes`](ledgerhashes.html) - `B4979A36CDC7F3D3D5C31A4EAE2AC7D7209DDA877588B9AFC66799692AB0D66B`
|
||||
> - [`NegativeUNL`](negativeunl.html) - `2E8A59AA9D3B5B186B0B9E0F62E6C02587CA74A4D778938E957B6357D364B244`
|
||||
|
||||
|
||||
|
||||
### Get AccountRoot Object
|
||||
|
||||
Retrieve an [AccountRoot object](accountroot.html) by its address. This is roughly equivalent to the [account_info method][].
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `account_root` | String - [Address][] | The classic address of the [AccountRoot object](accountroot.html) to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_accountroot",
|
||||
"command": "ledger_entry",
|
||||
"account_root": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [
|
||||
{
|
||||
"account_root": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "account_root": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-accountroot)
|
||||
|
||||
|
||||
|
||||
|
||||
### Get DirectoryNode Object
|
||||
|
||||
Retrieve a [DirectoryNode](directorynode.html), which contains a list of other ledger objects. Can be provided as string (object ID of the Directory) or as an object.
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `directory` | Object or String | The [DirectoryNode](directorynode.html) to retrieve. If a string, must be the [object ID](ledger-object-ids.html) of the directory, as hexadecimal. If an object, requires either `dir_root` or `owner` as a sub-field, plus optionally a `sub_index` sub-field. |
|
||||
| `directory.sub_index` | Unsigned Integer | _(Optional)_ If provided, jumps to a later "page" of the [DirectoryNode](directorynode.html). |
|
||||
| `directory.dir_root` | String | _(Optional)_ Unique index identifying the directory to retrieve, as a hex string. |
|
||||
| `directory.owner` | String | _(Optional)_ Unique address of the account associated with this directory. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 3,
|
||||
"command": "ledger_entry",
|
||||
"directory": {
|
||||
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"sub_index": 0
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [
|
||||
{
|
||||
"directory": {
|
||||
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"sub_index": 0
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "directory": { "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "sub_index": 0 }, "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-directorynode)
|
||||
|
||||
|
||||
|
||||
### Get Offer Object
|
||||
|
||||
Retrieve an [Offer object](offer.html), which defines an offer to exchange currency. Can be provided as string (unique index of the Offer) or as an object.
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `offer` | Object or String | The [Offer object](offer.html) to retrieve. If a string, interpret as the [unique object ID](ledgers.html#tree-format) to the Offer. If an object, requires the sub-fields `account` and `seq` to uniquely identify the offer. |
|
||||
| `offer.account` | String - [Address][] | _(Required if `offer` is specified as an object)_ The account that placed the offer. |
|
||||
| `offer.seq` | Unsigned Integer | _(Required if `offer` is specified as an object)_ The [Sequence Number][] of the transaction that created the Offer object. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_offer",
|
||||
"command": "ledger_entry",
|
||||
"offer": {
|
||||
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"seq": 359
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [
|
||||
{
|
||||
"offer": {
|
||||
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"seq": 359
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "offer": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "seq": 359}, "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-offer)
|
||||
|
||||
|
||||
|
||||
### Get RippleState Object
|
||||
|
||||
Retrieve a [RippleState object](ripplestate.html), which tracks a (non-XRP) currency balance between two accounts.
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `ripple_state` | Object | Object specifying the RippleState (trust line) object to retrieve. The `accounts` and `currency` sub-fields are required to uniquely specify the RippleState entry to retrieve. |
|
||||
| `ripple_state.accounts` | Array | _(Required if `ripple_state` is specified)_ 2-length array of account [Address][]es, defining the two accounts linked by this [RippleState object](ripplestate.html). |
|
||||
| `ripple_state.currency` | String | _(Required if `ripple_state` is specified)_ [Currency Code][] of the [RippleState object](ripplestate.html) to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_ripplestate",
|
||||
"command": "ledger_entry",
|
||||
"ripple_state": {
|
||||
"accounts": [
|
||||
"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
|
||||
],
|
||||
"currency": "USD"
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [{
|
||||
"ripple_state": {
|
||||
"accounts": [
|
||||
"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
|
||||
],
|
||||
"currency": "USD"
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "ripple_state": { "accounts": ["rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"], "currency": "USD"}, "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-ripplestate)
|
||||
|
||||
|
||||
|
||||
### Get Check Object
|
||||
|
||||
Retrieve a [Check object](check.html), which is a potential payment that can be cashed by its recipient. [New in: rippled 1.0.0][]
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:--------|:-------|:----------------------------------------------------------|
|
||||
| `check` | String | The [object ID](ledger-object-ids.html) of a [Check object](check.html) to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_check",
|
||||
"command": "ledger_entry",
|
||||
"check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [{
|
||||
"check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB",
|
||||
"ledger_index": "validated"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB", "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-check)
|
||||
|
||||
|
||||
|
||||
### Get Escrow Object
|
||||
|
||||
Retrieve an [Escrow object](escrow-object.html), which holds XRP until a specific time or condition is met. Can be provided as string (object ID of the Escrow) or as an object. [New in: rippled 1.0.0][]
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `escrow` | Object or String | The [Escrow object](escrow-object.html) to retrieve. If a string, must be the [object ID](ledger-object-ids.html) of the Escrow, as hexadecimal. If an object, requires `owner` and `seq` sub-fields. |
|
||||
| `escrow.owner` | String - [Address][] | _(Required if `escrow` is specified as an object)_ The owner (sender) of the Escrow object. |
|
||||
| `escrow.seq` | Unsigned Integer | _(Required if `escrow` is specified as an object)_ The [Sequence Number][] of the transaction that created the Escrow object. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_escrow",
|
||||
"command": "ledger_entry",
|
||||
"escrow": {
|
||||
"owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK",
|
||||
"seq": 126
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [{
|
||||
"escrow": {
|
||||
"account": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK",
|
||||
"seq": 126
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "escrow": { "account": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK", "seq": 126 }, "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-escrow)
|
||||
|
||||
|
||||
|
||||
### Get PayChannel Object
|
||||
|
||||
Retrieve a [PayChannel object](paychannel.html), which holds XRP for asynchronous payments. [New in: rippled 1.0.0][]
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------|:-------|:------------------------------------------------|
|
||||
| `payment_channel` | String | The [object ID](ledger-object-ids.html) of a [PayChannel object](paychannel.html) to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_paychannel",
|
||||
"command": "ledger_entry",
|
||||
"payment_channel": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [{
|
||||
"payment_channel": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
|
||||
"ledger_index": "validated"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "payment_channel": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7", "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-paychannel)
|
||||
|
||||
|
||||
### Get DepositPreauth Object
|
||||
|
||||
Retrieve a [DepositPreauth object](depositpreauth-object.html), which tracks preauthorization for payments to accounts requiring [Deposit Authorization](depositauth.html). Can be provided as string (object ID of the DepositPreauth) or as an object. [New in: rippled 1.1.0][]
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:-----------------------------|:---------------------|:-----------------------|
|
||||
| `deposit_preauth` | Object or String | Specify a [DepositPreauth object](depositpreauth-object.html) to retrieve. If a string, must be the [object ID](ledger-object-ids.html) of the DepositPreauth object, as hexadecimal. If an object, requires `owner` and `authorized` sub-fields. |
|
||||
| `deposit_preauth.owner` | String - [Address][] | _(Required if `deposit_preauth` is specified as an object)_ The account that provided the preauthorization. |
|
||||
| `deposit_preauth.authorized` | String - [Address][] | _(Required if `deposit_preauth` is specified as an object)_ The account that received the preauthorization. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_deposit_preauth",
|
||||
"command": "ledger_entry",
|
||||
"deposit_preauth": {
|
||||
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"authorized": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [{
|
||||
"deposit_preauth": {
|
||||
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"authorized": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "deposit_preauth": { "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "authorized": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX" }, "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-depositpreauth)
|
||||
|
||||
|
||||
### Get Ticket Object
|
||||
|
||||
Retrieve a [Ticket object](ticket.html), which represents a [sequence number][] set aside for future use. Can be provided as string (object ID of the Ticket) or as an object. _(Added by the [TicketBatch amendment][])_
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `ticket` | Object or String | The [Ticket object](ticket.html) to retrieve. If a string, must be the [object ID](ledger-object-ids.html) of the Ticket, as hexadecimal. If an object, the `owner` and `ticket_sequence` sub-fields are required to uniquely specify the Ticket entry. |
|
||||
| `ticket.owner` | String - [Address][] | _(Required if `ticket` is specified as an object)_ The owner of the Ticket object. |
|
||||
| `ticket.ticket_sequence` | Unsigned Integer | _(Required if `ticket` is specified as an object)_ The Ticket Sequence number of the Ticket entry to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_ticket",
|
||||
"command": "ledger_entry",
|
||||
"ticket": {
|
||||
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"ticket_sequence": 23
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [{
|
||||
"ticket": {
|
||||
"owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"ticket_sequence": 23
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "ticket": { "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "ticket_sequence: 23 }, "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!-- TODO: enable if/when Tickets are available on Mainnet
|
||||
[Try it! >](websocket-api-tool.html#ledger_entry-ticket)
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Response Format
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:-----------------|:-----------------------------------------|
|
||||
| `index` | String | The unique ID of this [ledger object](ledger-object-types.html). |
|
||||
| `ledger_index` | Unsigned Integer | The [ledger index][] of the ledger that was used when retrieving this data. |
|
||||
| `node` | Object | _(Omitted if `"binary": true` specified.)_ Object containing the data of this ledger object, according to the [ledger format][]. |
|
||||
| `node_binary` | String | _(Omitted unless `"binary":true` specified)_ The [binary representation](serialization.html) of the ledger object, as hexadecimal. |
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "example_get_accountroot",
|
||||
"result": {
|
||||
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
|
||||
"ledger_hash": "31850E8E48E76D1064651DF39DF4E9542E8C90A9A9B629F4DE339EB3FA74F726",
|
||||
"ledger_index": 61966146,
|
||||
"node": {
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"AccountTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
|
||||
"Balance": "424021949",
|
||||
"Domain": "6D64756F31332E636F6D",
|
||||
"EmailHash": "98B4375E1D753E5B91627516F6D70977",
|
||||
"Flags": 9568256,
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"MessageKey": "0000000000000000000000070000000300",
|
||||
"OwnerCount": 12,
|
||||
"PreviousTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
|
||||
"PreviousTxnLgrSeq": 61965653,
|
||||
"RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ",
|
||||
"Sequence": 385,
|
||||
"TransferRate": 4294967295,
|
||||
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8"
|
||||
},
|
||||
"validated": true
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
|
||||
"ledger_hash": "395946243EA36C5092AE58AF729D2875F659812409810A63096AC006C73E656E",
|
||||
"ledger_index": 61966165,
|
||||
"node": {
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"AccountTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
|
||||
"Balance": "424021949",
|
||||
"Domain": "6D64756F31332E636F6D",
|
||||
"EmailHash": "98B4375E1D753E5B91627516F6D70977",
|
||||
"Flags": 9568256,
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"MessageKey": "0000000000000000000000070000000300",
|
||||
"OwnerCount": 12,
|
||||
"PreviousTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
|
||||
"PreviousTxnLgrSeq": 61965653,
|
||||
"RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ",
|
||||
"Sequence": 385,
|
||||
"TransferRate": 4294967295,
|
||||
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8"
|
||||
},
|
||||
"status": "success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
|
||||
"ledger_hash": "395946243EA36C5092AE58AF729D2875F659812409810A63096AC006C73E656E",
|
||||
"ledger_index": 61966165,
|
||||
"node": {
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"AccountTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
|
||||
"Balance": "424021949",
|
||||
"Domain": "6D64756F31332E636F6D",
|
||||
"EmailHash": "98B4375E1D753E5B91627516F6D70977",
|
||||
"Flags": 9568256,
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"MessageKey": "0000000000000000000000070000000300",
|
||||
"OwnerCount": 12,
|
||||
"PreviousTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
|
||||
"PreviousTxnLgrSeq": 61965653,
|
||||
"RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ",
|
||||
"Sequence": 385,
|
||||
"TransferRate": 4294967295,
|
||||
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8"
|
||||
},
|
||||
"status": "success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
* `deprecatedFeature` - The request specified a removed field, such as `generator`.
|
||||
* `entryNotFound` - The requested ledger object does not exist in the ledger.
|
||||
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
* `lgrNotFound` - The ledger specified by the `ledger_hash` or `ledger_index` does not exist, or it does exist but the server does not have it.
|
||||
* `malformedAddress` - The request improperly specified an [Address][] field.
|
||||
* `malformedCurrency` - The request improperly specified a [Currency Code][] field.
|
||||
* `malformedOwner` - The request improperly specified the `escrow.owner` sub-field.
|
||||
* `malformedRequest` - The request provided an invalid combination of fields, or provided the wrong type for one or more fields.
|
||||
* `unknownOption` - The fields provided in the request did not match any of the expected request formats.
|
||||
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
Reference in New Issue
Block a user