Skip to content

Commit 2d047d1

Browse files
authored
Merge pull request #2955 from XRPLF/fix_ledger_entry_mpt
Fix ledger_entry formatting issues
2 parents c3b4b2f + a7b1877 commit 2d047d1

File tree

1 file changed

+47
-150
lines changed
  • docs/references/http-websocket-apis/public-api-methods/ledger-methods

1 file changed

+47
-150
lines changed

docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry.md

Lines changed: 47 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -883,135 +883,19 @@ rippled json ledger_entry '{ "nft_page": "255DD86DDF59D778081A06D02701E9B2C9F4F0
883883

884884
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-nft-page)
885885

886-
## Response Format
887-
888-
The response follows the [standard format][], with a successful result containing the following fields:
889-
890-
| Field | Type | Description |
891-
|:---------------|:-----------------|:-----------------------------------------|
892-
| `index` | String | The unique ID of this [ledger entry](../../../protocol/ledger-data/ledger-entry-types/index.md). |
893-
| `ledger_index` | Unsigned Integer | The [ledger index][] of the ledger that was used when retrieving this data. |
894-
| `node` | Object | _(Omitted if `"binary": true` specified.)_ Object containing the data of this ledger entry, according to the [ledger format][]. |
895-
| `node_binary` | String | _(Omitted unless `"binary":true` specified)_ The [binary representation](../../../protocol/binary-format.md) of the ledger object, as hexadecimal. |
896-
| `deleted_ledger_index` | String | _(Clio server only, returned if `include_deleted` parameter is set.)_ The [ledger index][] where the ledger entry object was deleted. |
897-
898-
An example of a successful response:
899-
900-
{% tabs %}
901-
902-
{% tab label="WebSocket" %}
903-
```json
904-
{
905-
"id": "example_get_accountroot",
906-
"result": {
907-
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
908-
"ledger_hash": "31850E8E48E76D1064651DF39DF4E9542E8C90A9A9B629F4DE339EB3FA74F726",
909-
"ledger_index": 61966146,
910-
"node": {
911-
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
912-
"AccountTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
913-
"Balance": "424021949",
914-
"Domain": "6D64756F31332E636F6D",
915-
"EmailHash": "98B4375E1D753E5B91627516F6D70977",
916-
"Flags": 9568256,
917-
"LedgerEntryType": "AccountRoot",
918-
"MessageKey": "0000000000000000000000070000000300",
919-
"OwnerCount": 12,
920-
"PreviousTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
921-
"PreviousTxnLgrSeq": 61965653,
922-
"RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ",
923-
"Sequence": 385,
924-
"TransferRate": 4294967295,
925-
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8"
926-
},
927-
"validated": true
928-
},
929-
"status": "success",
930-
"type": "response"
931-
}
932-
```
933-
{% /tab %}
934-
935-
{% tab label="JSON-RPC" %}
936-
```json
937-
200 OK
938-
939-
{
940-
"result": {
941-
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
942-
"ledger_hash": "395946243EA36C5092AE58AF729D2875F659812409810A63096AC006C73E656E",
943-
"ledger_index": 61966165,
944-
"node": {
945-
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
946-
"AccountTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
947-
"Balance": "424021949",
948-
"Domain": "6D64756F31332E636F6D",
949-
"EmailHash": "98B4375E1D753E5B91627516F6D70977",
950-
"Flags": 9568256,
951-
"LedgerEntryType": "AccountRoot",
952-
"MessageKey": "0000000000000000000000070000000300",
953-
"OwnerCount": 12,
954-
"PreviousTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
955-
"PreviousTxnLgrSeq": 61965653,
956-
"RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ",
957-
"Sequence": 385,
958-
"TransferRate": 4294967295,
959-
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8"
960-
},
961-
"status": "success",
962-
"validated": true
963-
}
964-
}
965-
```
966-
{% /tab %}
967-
968-
{% tab label="Commandline" %}
969-
```json
970-
{
971-
"result": {
972-
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
973-
"ledger_hash": "395946243EA36C5092AE58AF729D2875F659812409810A63096AC006C73E656E",
974-
"ledger_index": 61966165,
975-
"node": {
976-
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
977-
"AccountTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
978-
"Balance": "424021949",
979-
"Domain": "6D64756F31332E636F6D",
980-
"EmailHash": "98B4375E1D753E5B91627516F6D70977",
981-
"Flags": 9568256,
982-
"LedgerEntryType": "AccountRoot",
983-
"MessageKey": "0000000000000000000000070000000300",
984-
"OwnerCount": 12,
985-
"PreviousTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
986-
"PreviousTxnLgrSeq": 61965653,
987-
"RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ",
988-
"Sequence": 385,
989-
"TransferRate": 4294967295,
990-
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8"
991-
},
992-
"status": "success",
993-
"validated": true
994-
}
995-
}
996-
```
997-
{% /tab %}
998-
999-
{% /tabs %}
1000-
1001886
### Get MPT Issuance Object
1002887

1003888
_(Requires the [MPToken amendment][] {% not-enabled /%})_
1004889

1005890
Return an `MPTokenIssuance` object.
1006891

1007-
| Field | Type | Description |
1008-
|:------------------------|:---------------------------|:----------------------|
1009-
| `mpt_issuance` | String | The 192-bit `MPTokenIssuanceID` that's associated with the MPTokenIssuance. |
1010-
1011-
<!-- MULTICODE_BLOCK_START -->
892+
| Field | Type | Description |
893+
|:---------------|:-------|:----------------------|
894+
| `mpt_issuance` | String | The 192-bit `MPTokenIssuanceID` that's associated with the MPTokenIssuance, as hexadecimal. |
1012895

1013-
*WebSocket*
896+
{% tabs %}
1014897

898+
{% tab label="WebSocket" %}
1015899
```json
1016900
{
1017901
"id": "example_get_mpt_issuance",
@@ -1020,9 +904,9 @@ Return an `MPTokenIssuance` object.
1020904
"ledger_index": "validated"
1021905
}
1022906
```
907+
{% /tab %}
1023908

1024-
*JSON-RPC*
1025-
909+
{% tab label="JSON-RPC" %}
1026910
```json
1027911
{
1028912
"method": "ledger_entry",
@@ -1032,41 +916,47 @@ Return an `MPTokenIssuance` object.
1032916
}]
1033917
}
1034918
```
1035-
*Commandline*
919+
{% /tab %}
1036920

921+
{% tab label="Commandline" %}
1037922
```sh
1038923
rippled json ledger_entry '{ "mpt_issuance": "000004C463C52827307480341125DA0577DEFC38405B0E3E", "ledger_index": "validated" }'
1039924
```
925+
{% /tab %}
926+
{% /tabs %}
1040927

928+
<!-- TODO: add try-it for MPT issuance
1041929
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-mpt_issuance)
930+
-->
1042931

1043932
### Get MPToken Object
1044933

1045934
_(Requires the [MPToken amendment][] {% not-enabled /%})_
1046935

1047936
Return an `MPToken` object.
1048937

1049-
| Field | Type | Description |
1050-
|:------------------------|:---------------------------|:----------------------|
1051-
| `mptoken` | ️Object or String | If a string, interpret as ledger entry ID of the MPToken to retrieve. If an object, requires the sub-fields account and mpt_issuance_id to unique identify the MPToken. |
1052-
| mptoken.mpt_issuance_id | ️String | (Required if the `MPToken` is specified as an object) The 192-bit MPTokenIssuanceID that's associated with the MPTokenIssuance. |
1053-
| mptoken.account ️ | String | (Required if the `MPToken` is specified as an object) The account that owns the MPToken. |
1054-
1055-
<!-- MULTICODE_BLOCK_START -->
938+
| Field | Type | Description |
939+
|:--------------------------|:-----------------|:------------|
940+
| `mptoken` | ️Object or String | If a string, interpret as ledger entry ID of the MPToken to retrieve. If an object, requires the sub-fields `account` and `mpt_issuance_id` to uniquely identify the MPToken. |
941+
| `mptoken.mpt_issuance_id` | String | (Required if the `MPToken` is specified as an object) The 192-bit MPTokenIssuanceID that's associated with the MPTokenIssuance. |
942+
| `mptoken.account`| String | (Required if the `MPToken` is specified as an object) The account that owns the MPToken. |
1056943

1057-
*WebSocket*
944+
{% tabs %}
1058945

946+
{% tab label="WebSocket" %}
1059947
```json
1060948
{
1061949
"id": "example_get_mpt_issuance",
1062950
"command": "ledger_entry",
1063-
"mpt_issuance_id": "000002DFA4D893CFBC4DC6AE877EB585F90A3B47528B958D",
1064-
"account":"r33kves44ksufkHSGg3M6GPPAsoVHEN8C1"
951+
"mptoken": {
952+
"mpt_issuance_id": "000002DFA4D893CFBC4DC6AE877EB585F90A3B47528B958D",
953+
"account":"r33kves44ksufkHSGg3M6GPPAsoVHEN8C1"
954+
}
1065955
}
1066956
```
957+
{% /tab %}
1067958

1068-
*JSON-RPC*
1069-
959+
{% tab label="JSON-RPC" %}
1070960
```json
1071961
{
1072962
"method": "ledger_entry",
@@ -1080,13 +970,19 @@ Return an `MPToken` object.
1080970
]
1081971
}
1082972
```
1083-
*Commandline*
973+
{% /tab %}
1084974

975+
{% tab label="Commandline" %}
1085976
```sh
1086-
rippled json ledger_entry '{ "mpt_issuance_id": "000002DFA4D893CFBC4DC6AE877EB585F90A3B47528B958D", "account":"r33kves44ksufkHSGg3M6GPPAsoVHEN8C1"}'
977+
rippled json ledger_entry '{ "mptoken": {"mpt_issuance_id": "000002DFA4D893CFBC4DC6AE877EB585F90A3B47528B958D", "account":"r33kves44ksufkHSGg3M6GPPAsoVHEN8C1"} }'
1087978
```
1088-
<!-- MULTICODE_BLOCK_END -->
1089-
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-mptissuance)
979+
{% /tab %}
980+
{% /tabs %}
981+
982+
<!-- TODO: make a try-it link for MPT object
983+
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-mptoken)
984+
-->
985+
1090986

1091987
## Response Format
1092988

@@ -1095,16 +991,16 @@ The response follows the [standard format][], with a successful result containin
1095991
| Field | Type | Description |
1096992
|:---------------|:-----------------|:-----------------------------------------|
1097993
| `index` | String | The unique ID of this [ledger entry](../../../protocol/ledger-data/ledger-entry-types/index.md). |
1098-
| `ledger_index` | Unsigned Integer | The [ledger index](../../../protocol/data-types/basic-data-types.md#ledger-index) of the ledger that was used when retrieving this data. |
1099-
| `node` | Object | _(Omitted if `"binary": true` specified.)_ Object containing the data of this ledger entry, according to the [ledger format](../../../protocol/ledger-data/ledger-entry-types/index.md). |
994+
| `ledger_index` | Unsigned Integer | The [ledger index][] of the ledger that was used when retrieving this data. |
995+
| `node` | Object | _(Omitted if `"binary": true` specified.)_ Object containing the data of this ledger entry, according to the [ledger format][]. |
1100996
| `node_binary` | String | _(Omitted unless `"binary":true` specified)_ The [binary representation](../../../protocol/binary-format.md) of the ledger object, as hexadecimal. |
997+
| `deleted_ledger_index` | String | _(Clio server only, returned if `include_deleted` parameter is set.)_ The [ledger index][] where the ledger entry object was deleted. |
1101998

1102999
An example of a successful response:
11031000

1104-
<!-- MULTICODE_BLOCK_START -->
1105-
1106-
*WebSocket*
1001+
{% tabs %}
11071002

1003+
{% tab label="WebSocket" %}
11081004
```json
11091005
{
11101006
"id": "example_get_accountroot",
@@ -1135,9 +1031,9 @@ An example of a successful response:
11351031
"type": "response"
11361032
}
11371033
```
1034+
{% /tab %}
11381035

1139-
*JSON-RPC*
1140-
1036+
{% tab label="JSON-RPC" %}
11411037
```json
11421038
200 OK
11431039

@@ -1168,9 +1064,9 @@ An example of a successful response:
11681064
}
11691065
}
11701066
```
1067+
{% /tab %}
11711068

1172-
*Commandline*
1173-
1069+
{% tab label="Commandline" %}
11741070
```json
11751071
{
11761072
"result": {
@@ -1199,8 +1095,9 @@ An example of a successful response:
11991095
}
12001096
}
12011097
```
1098+
{% /tab %}
12021099

1203-
<!-- MULTICODE_BLOCK_END -->
1100+
{% /tabs %}
12041101

12051102

12061103
## Possible Errors

0 commit comments

Comments
 (0)