mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
Restore previous AMM docs
This commit is contained in:
@@ -7,7 +7,7 @@ labels:
|
||||
- Data Retention
|
||||
---
|
||||
# ledger_entry
|
||||
[[Source]](https://github.com/xrplf/rippled/blob/master/src/ripple/rpc/handlers/LedgerEntry.cpp "Source")
|
||||
[[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.
|
||||
|
||||
@@ -31,6 +31,7 @@ In addition to the general fields above, you must specify *exactly 1* of the fol
|
||||
|
||||
- [`index`](#get-ledger-object-by-id)
|
||||
- [`account_root`](#get-accountroot-object)
|
||||
- [`amm`](#get-amm-object) :not_enabled:
|
||||
- [`directory`](#get-directorynode-object)
|
||||
- [`offer`](#get-offer-object)
|
||||
- [`ripple_state`](#get-ripplestate-object)
|
||||
@@ -144,6 +145,73 @@ rippled json ledger_entry '{ "account_root": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59
|
||||
|
||||
|
||||
|
||||
### Get AMM Object
|
||||
|
||||
_(Automated Market Maker (AMM) functionality is part of the proposed [XLS-30d](https://github.com/XRPLF/XRPL-Standards/discussions/78) extension :not_enabled: to the XRP Ledger protocol. You can use these features on AMM test networks, but there isn't an official amendment and they aren't available on the production Mainnet.)_
|
||||
|
||||
Retrieve an Automated Market-Maker (AMM) object from the ledger. This is similar to [amm_info method][], but the `ledger_entry` version returns only the ledger entry as stored.
|
||||
|
||||
| Field | Type | Description |
|
||||
|:-------------|:-----------------|:----------------------|
|
||||
| `amm` | Object or String | The [AMM](amm.html) to retrieve. If you specify a string, it must be the [object ID](ledger-object-ids.html) of the AMM, as hexadecimal. If you specify an object, it must contain `asset` and `asset2` sub-fields. |
|
||||
| `amm.asset` | Object | One of the two assets in this AMM's pool, as a [currency object without an amount](currency-formats.html#specifying-without-amounts). |
|
||||
| `amm.asset2` | Object | The other of the two assets in this AMM's pool, as a [currency object without an amount](currency-formats.html#specifying-without-amounts). |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 3,
|
||||
"command": "ledger_entry",
|
||||
"amm": {
|
||||
"asset": {
|
||||
"currency": "XRP"
|
||||
},
|
||||
"asset2": {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
}
|
||||
}
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params": [
|
||||
{
|
||||
"amm": {
|
||||
"asset": {
|
||||
"currency": "XRP"
|
||||
},
|
||||
"asset2": {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
}
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```sh
|
||||
rippled json ledger_entry '{ "amm": { "asset": { "currency": "XRP" }, "asset2": { "currency" : "TST", "issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd" } }, "ledger_index": "validated" }'
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html?server=wss%3A%2F%2Famm.devnet.rippletest.net%3A51233%2F#ledger_entry-amm)
|
||||
|
||||
|
||||
|
||||
### 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.
|
||||
@@ -206,9 +274,9 @@ Retrieve an [Offer object](offer.html), which defines an offer to exchange curre
|
||||
|
||||
| Field | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `offer` | Object or String | The [Offer object](offer.html) to retrieve. If a string, interpret as the Offer's [ledger entry ID](ledger-object-ids.html). If an object, requires the sub-fields `account` and `seq` to uniquely identify the offer. |
|
||||
| `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 entry. |
|
||||
| `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 -->
|
||||
|
||||
@@ -564,7 +632,7 @@ rippled json ledger_entry '{ "ticket": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJ
|
||||
|
||||
Return an NFT Page in its raw ledger format.
|
||||
|
||||
| Field | Type | Description |
|
||||
| `Field` | Type | Description |
|
||||
|:------------------------|:---------------------------|:----------------------|
|
||||
| `nft_page` | String | The [object ID](ledger-object-ids.html) of an [NFT Page](nftokenpage.html) to retrieve. |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user