mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 20:25:51 +00:00
Catch AMM refs up to date
This commit is contained in:
@@ -9,7 +9,7 @@ labels:
|
||||
# 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.
|
||||
The `ledger_entry` method returns a single ledger entry from the XRP Ledger in its raw format. See [ledger format][] for information on the different types of entries you can retrieve.
|
||||
|
||||
## Request Format
|
||||
|
||||
@@ -21,13 +21,13 @@ This method can retrieve several different types of data. You can select which t
|
||||
|
||||
| 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][] |
|
||||
| `binary` | Boolean | _(Optional)_ If `true`, return the requested ledger entry'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:
|
||||
In addition to the general fields above, you must specify *exactly 1* of the following fields to indicate what type of entry to retrieve, along with its sub-fields as appropriate. The valid fields are:
|
||||
|
||||
- [`index`](#get-ledger-object-by-id)
|
||||
- [`account_root`](#get-accountroot-object)
|
||||
@@ -51,7 +51,7 @@ 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. |
|
||||
| `index` | String | The [ledger entry ID](ledger-object-ids.html) of a single entry to retrieve from the ledger, as a 64-character (256-bit) hexadecimal string. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -89,7 +89,7 @@ rippled json ledger_entry '{ "index": "7DB0788C020F02780A673DC74757F23823FA3014C
|
||||
|
||||
[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:
|
||||
> **Tip:** You can use this type of request to get any singleton ledger entry, 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`
|
||||
@@ -100,11 +100,11 @@ rippled json ledger_entry '{ "index": "7DB0788C020F02780A673DC74757F23823FA3014C
|
||||
|
||||
### Get AccountRoot Object
|
||||
|
||||
Retrieve an [AccountRoot object](accountroot.html) by its address. This is roughly equivalent to the [account_info method][].
|
||||
Retrieve an [AccountRoot entry](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. |
|
||||
| `account_root` | String - [Address][] | The classic address of the [AccountRoot entry](accountroot.html) to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -147,7 +147,7 @@ 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.)_
|
||||
_(Requires the [AMM amendment][] :not_enabled:)_
|
||||
|
||||
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.
|
||||
|
||||
@@ -270,13 +270,13 @@ rippled json ledger_entry '{ "directory": { "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwu
|
||||
|
||||
### 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.
|
||||
Retrieve an [Offer entry](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` | Object or String | If a string, interpret as [ledger entry ID](ledger-object-ids.html) of the Offer to retrieve. 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. |
|
||||
| `offer.seq` | Unsigned Integer | _(Required if `offer` is specified as an object)_ The [Sequence Number][] of the transaction that created the Offer entry. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -325,13 +325,13 @@ rippled json ledger_entry '{ "offer": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJY
|
||||
|
||||
### Get RippleState Object
|
||||
|
||||
Retrieve a [RippleState object](ripplestate.html), which tracks a (non-XRP) currency balance between two accounts.
|
||||
Retrieve a [RippleState entry][], 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. |
|
||||
| `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 entry. |
|
||||
| `ripple_state.currency` | String | _(Required if `ripple_state` is specified)_ [Currency Code][] of the RippleState entry to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -384,11 +384,11 @@ rippled json ledger_entry '{ "ripple_state": { "accounts": ["rf1BiGeXwwQoi8Z2ueF
|
||||
|
||||
### 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][]
|
||||
Retrieve a [Check entry](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. |
|
||||
| `check` | String | The [object ID](ledger-object-ids.html) of a [Check entry](check.html) to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -429,11 +429,11 @@ rippled json ledger_entry '{ "check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D79
|
||||
|
||||
### 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][]
|
||||
Retrieve an [Escrow entry](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` | Object or String | The Escrow 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. |
|
||||
|
||||
@@ -482,11 +482,11 @@ rippled json ledger_entry '{ "escrow": { "owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9
|
||||
|
||||
### Get PayChannel Object
|
||||
|
||||
Retrieve a [PayChannel object](paychannel.html), which holds XRP for asynchronous payments. [New in: rippled 1.0.0][]
|
||||
Retrieve a [PayChannel entry](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. |
|
||||
| `payment_channel` | String | The [object ID](ledger-object-ids.html) of the PayChannel to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -526,11 +526,11 @@ rippled json ledger_entry '{ "payment_channel": "C7F634794B79DB40E87179A9D1BF05D
|
||||
|
||||
### 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][]
|
||||
Retrieve a [DepositPreauth entry](depositpreauth-object.html), which tracks preauthorization for payments to accounts requiring [Deposit Authorization](depositauth.html). [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` | Object or String | Specify the DepositPreauth to retrieve. If a string, must be the [ledger entry ID](ledger-object-ids.html) of the DepositPreauth entry, 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. |
|
||||
|
||||
@@ -578,13 +578,13 @@ rippled json ledger_entry '{ "deposit_preauth": { "owner": "rf1BiGeXwwQoi8Z2ueFY
|
||||
|
||||
### 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][])_
|
||||
Retrieve a [Ticket entry](ticket.html), which represents a [sequence number][] set aside for future use. _(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 `account` and `ticket_seq` sub-fields are required to uniquely specify the Ticket entry. |
|
||||
| `ticket.account` | String - [Address][] | _(Required if `ticket` is specified as an object)_ The owner of the Ticket object. |
|
||||
| `ticket.ticket_seq` | Number | _(Required if `ticket` is specified as an object)_ The Ticket Sequence number of the Ticket entry to retrieve. |
|
||||
| `ticket` | Object or String | The Ticket to retrieve. If a string, must be the [ledger entry ID](ledger-object-ids.html) of the Ticket, as hexadecimal. If an object, the `account` and `ticket_seq` sub-fields are required to uniquely specify the Ticket entry. |
|
||||
| `ticket.account` | String - [Address][] | _(Required if `ticket` is specified as an object)_ The owner of the Ticket. |
|
||||
| `ticket.ticket_seq` | Number | _(Required if `ticket` is specified as an object)_ The Ticket Sequence number of the Ticket to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -632,9 +632,9 @@ 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. |
|
||||
| `nft_page` | String | The [ledger entry ID](ledger-object-ids.html) of an [NFT Page](nftokenpage.html) to retrieve. |
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -677,9 +677,9 @@ The response follows the [standard format][], with a successful result containin
|
||||
|
||||
| Field | Type | Description |
|
||||
|:---------------|:-----------------|:-----------------------------------------|
|
||||
| `index` | String | The unique ID of this [ledger object](ledger-object-types.html). |
|
||||
| `index` | String | The unique ID of this [ledger entry](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` | Object | _(Omitted if `"binary": true` specified.)_ Object containing the data of this ledger entry, 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:
|
||||
@@ -790,7 +790,7 @@ An example of a successful response:
|
||||
|
||||
* 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.
|
||||
* `entryNotFound` - The requested ledger entry 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.
|
||||
|
||||
@@ -62,11 +62,14 @@ An example of the request format:
|
||||
|
||||
The request includes the following parameters:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------|:-----------------|:-----------------------------------|
|
||||
| `asset` | Object or String | One of the assets of the AMM to look up, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts][Currency Amount]. For XRP, you can specify as the string `XRP` instead of as an object. |
|
||||
| `asset2` | Object or String | The other of the assets of the AMM, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts][Currency Amount]. |
|
||||
| `Field` | Type | Required? | Description |
|
||||
|:--------------|:-----------------|:----------|-------------|
|
||||
| `account` | String - [Address][] | No | Show only LP Tokens held by this liquidity provider. |
|
||||
| `amm_account` | String - [Address][] | No | The address of the AMM's special special AccountRoot. (This is the `issuer` of the AMM's LP Tokens.) |
|
||||
| `asset` | Object or String | No | One of the assets of the AMM to look up, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts][Currency Amount]. For XRP, you can specify as the string `XRP` instead of as an object. |
|
||||
| `asset2` | Object or String | No | The other of the assets of the AMM, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts][Currency Amount]. |
|
||||
|
||||
You must specify _either_ `amm_account` or both `asset` and `asset2`.
|
||||
|
||||
### Response Format
|
||||
|
||||
@@ -210,7 +213,7 @@ The `amm` field is an object describing the current status of an Automated Marke
|
||||
| `asset_frozen` | Boolean | _(Omitted for XRP)_ If `true`, the `amount` currency is currently [frozen](freezes.html). |
|
||||
| `asset2_frozen` | Boolean | _(Omitted for XRP)_ If `true`, the `amount2` currency is currently [frozen](freezes.html). |
|
||||
| `auction_slot` | Object | _(May be omitted)_ An [Auction Slot Object](#auction-slot-object) describing the current auction slot holder, if there is one. |
|
||||
| `lp_token` | [Currency Amount][] | The total amount of this AMM's LP Tokens outstanding. |
|
||||
| `lp_token` | [Currency Amount][] | The total amount of this AMM's LP Tokens outstanding. If the request specified a liquidity provider in the `account` field, instead, this is the amount of this AMM's LP Tokens held by that liquidity provider. |
|
||||
| `trading_fee` | Number | The AMM's current trading fee, in units of 1/100,000; a value of 1 is equivalent to a 0.001% fee. |
|
||||
| `vote_slots` | Array | _(May be omitted)_ The current votes for the AMM's trading fee, as [Vote Slot Objects](#vote-slot-objects). |
|
||||
|
||||
@@ -243,7 +246,7 @@ Each entry in the `vote_slots` array represents one liquidity provider's vote to
|
||||
### Possible Errors
|
||||
|
||||
- Any of the [universal error types][].
|
||||
- `actNotFound` - The AMM for this asset pair does not exist, or an issuing account specified in the request does not exist.
|
||||
- `actNotFound` - The AMM for this asset pair does not exist, or an account specified in the request does not exist.
|
||||
- `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user