Copy/style edits to Offer page

Clean up a couple style things I noticed while reviewing #1741
This commit is contained in:
Rome Reginelli
2023-02-22 13:34:39 -08:00
committed by GitHub
parent 705bc79e48
commit b95df1115a

View File

@@ -8,11 +8,10 @@ labels:
# Offer
[[Source]](https://github.com/ripple/rippled/blob/5d2d88209f1732a0f8d592012094e345cbe3e675/src/ripple/protocol/impl/LedgerFormats.cpp#L57 "Source")
The `Offer` object type describes an offer to exchange currencies, more traditionally known as an _order_, in the XRP Ledger's distributed exchange. An [OfferCreate transaction][] only creates an `Offer` object in the ledger when the offer cannot be fully executed immediately by consuming other offers already in the ledger.
The `Offer` ledger entry describes an [Offer](offers.html) to exchange currencies in the XRP Ledger's [decentralized exchange](decentralized-exchange.html). (In finance, this is more traditionally known as an _order_.) An [OfferCreate transaction][] only creates an `Offer` entry in the ledger when the Offer cannot be fully executed immediately by consuming other Offers already in the ledger.
An offer can become unfunded through other activities in the network, while remaining in the ledger. However, `rippled` automatically prunes any unfunded offers it happens across in the course of transaction processing (and _only_ transaction processing, because the ledger state must only be changed by transactions).
An Offer can become unfunded through other activities in the network, while remaining in the ledger. When processing transactions, the network automatically prunes any unfunded Offers that those transactions come across. (Otherwise, unfunded Offers remain, because _only_ transactions can change the ledger state.)
For more information, see [Offers](offers.html).
## Example {{currentpage.name}} JSON
@@ -43,18 +42,18 @@ An `Offer` object has the following fields:
| Name | JSON Type | [Internal Type][] | Required? | Description |
|:--------------------|:-----------------|:------------------|:----------|:------------|
| `Account` | String | AccountID | Yes | The address of the account that owns this offer. |
| `BookDirectory` | String | Hash256 | Yes | The ID of the [Offer Directory](directorynode.html) that links to this offer. |
| `Account` | String | AccountID | Yes | The address of the account that owns this Offer. |
| `BookDirectory` | String | Hash256 | Yes | The ID of the [Offer Directory](directorynode.html) that links to this Offer. |
| `BookNode` | String | UInt64 | Yes | A hint indicating which page of the offer directory links to this object, in case the directory consists of multiple pages. |
| `Expiration` | Number | UInt32 | No | Indicates the time after which this offer is considered unfunded. See [Specifying Time][] for details. |
| `Expiration` | Number | UInt32 | No | Indicates the time after which this Offer is considered unfunded. See [Specifying Time][] for details. |
| `Flags` | Number | UInt32 | Yes | A bit-map of boolean flags enabled for this offer. |
| `LedgerEntryType` | String | UInt16 | Yes | The value `0x006F`, mapped to the string `Offer`, indicates that this object describes an order to trade currency. |
| `LedgerEntryType` | String | UInt16 | Yes | The value `0x006F`, mapped to the string `Offer`, indicates that this object describes an Offer. |
| `OwnerNode` | String | UInt64 | Yes | A hint indicating which page of the owner directory links to this object, in case the directory consists of multiple pages. **Note:** The offer does not contain a direct link to the owner directory containing it, since that value can be derived from the `Account`. |
| `PreviousTxnID` | String | Hash256 | Yes | The identifying hash of the transaction that most recently modified this object. |
| `PreviousTxnLgrSeq` | Number | UInt32 | Yes | The [index of the ledger][Ledger Index] that contains the transaction that most recently modified this object. |
| `Sequence` | Number | UInt32 | Yes | The `Sequence` value of the [OfferCreate][] transaction that created this `Offer` object. Used in combination with the `Account` to identify this Offer. |
| `TakerPays` | String or Object | Amount | Yes | The remaining amount and type of currency requested by the offer creator. |
| `TakerGets` | String or Object | Amount | Yes | The remaining amount and type of currency being provided by the offer creator. |
| `TakerPays` | String or Object | Amount | Yes | The remaining amount and type of currency requested by the Offer creator. |
| `TakerGets` | String or Object | Amount | Yes | The remaining amount and type of currency being provided by the Offer creator. |
## Offer Flags
@@ -64,16 +63,17 @@ There are several options which can be either enabled or disabled when an [Offer
| Flag Name | Hex Value | Decimal Value | Corresponding [OfferCreate Flag](offercreate.html#offercreate-flags) | Description |
|--------------|--------------|---------------|-------------|------------------------|
| `lsfPassive` | `0x00010000` | 65536 | `tfPassive` | The object was placed as a passive offer. This has no effect on the object in the ledger. |
| `lsfSell` | `0x00020000` | 131072 | `tfSell` | The object was placed as a sell offer. This has no effect on the object in the ledger (because `tfSell` only matters if you get a better rate than you asked for, which cannot happen after the object enters the ledger). |
| `lsfPassive` | `0x00010000` | 65536 | `tfPassive` | The object was placed as a passive Offer. This has no effect on the object in the ledger. |
| `lsfSell` | `0x00020000` | 131072 | `tfSell` | The object was placed as a sell Offer. This has no effect on the object in the ledger (because `tfSell` only matters if you get a better rate than you asked for, which cannot happen after the object enters the ledger). |
## Offer ID Format
The ID of an `Offer` object is the [SHA-512Half][] of the following values, concatenated in order:
* The Offer space key (`0x006F`)
* The AccountID of the account placing the offer
* The Sequence number of the [OfferCreate transaction][] that created the offer
* The AccountID of the account placing the Offer
* The Sequence number of the [OfferCreate transaction][] that created the Offer.
If the OfferCreate transaction used a [Ticket](tickets.html), use the `TicketSequence` value instead.
<!--{# common link defs #}-->