Ledger format: Check (still need JSON ex.)

This commit is contained in:
mDuo13
2018-01-22 14:11:19 -08:00
parent 93c9811e30
commit 102b30a25e
3 changed files with 43 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ The `AccountRoot` object has the following fields:
|-----------------|-----------|---------------|-------------| |-----------------|-----------|---------------|-------------|
| `LedgerEntryType` | String | UInt16 | The value `0x0061`, mapped to the string `AccountRoot`, indicates that this object is an AccountRoot object. | | `LedgerEntryType` | String | UInt16 | The value `0x0061`, mapped to the string `AccountRoot`, indicates that this object is an AccountRoot object. |
| `Account` | String | AccountID | The identifying address of this account, such as rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn. | | `Account` | String | AccountID | The identifying address of this account, such as rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn. |
| [Flags](#accountroot-flags) | Number | UInt32 | A bit-map of boolean flags enabled for this account. | | [`Flags`](#accountroot-flags) | Number | UInt32 | A bit-map of boolean flags enabled for this account. |
| `Sequence` | Number | UInt32 | The sequence number of the next valid transaction for this account. (Each account starts with Sequence = 1 and increases each time a transaction is made.) | | `Sequence` | Number | UInt32 | The sequence number of the next valid transaction for this account. (Each account starts with Sequence = 1 and increases each time a transaction is made.) |
| `Balance` | String | Amount | The account's current [XRP balance in drops][XRP, in drops], represented as a string. | | `Balance` | String | Amount | The account's current [XRP balance in drops][XRP, in drops], represented as a string. |
| `OwnerCount` | Number | UInt32 | The number of objects this account owns in the ledger, which contributes to its owner reserve. | | `OwnerCount` | Number | UInt32 | The number of objects this account owns in the ledger, which contributes to its owner reserve. |

View File

@@ -0,0 +1,39 @@
## Check
[[Source]<br>](https://github.com/ripple/rippled/blob/develop/src/ripple/protocol/impl/LedgerFormats.cpp#L158 "Source")
A `Check` object describes a check, a potential pull payment, waiting to be cashed. (The potential payment has already been approved by its sender.) Example `Check` object:
```json
{
TODO
}
```
A `Check` object has the following fields:
| Field | JSON Type | [Internal Type][] | Description |
|:--------------------|:-----------------|:------------------|:----------------|
| `LedgerEntryType` | String | UInt16 | The value `0x0043`, mapped to the string `Check`, indicates that this object is a Check object. |
| `Account` | String | Account | The sender of the Check. Cashing the Check debits this address's balance. |
| `Destination` | String | Account | The intended recipient of the Check. Only this address can cash the Check, using a [CheckCash transaction][]. |
| `Flags` | Number | UInt32 | No flags are defined for Checks, so this value is always `0`. |
| `SendMax` | String or Object | Amount | The maximum amount of currency this Check can debit the sender. If the Check is successfully cashed, the destination is credited in the same currency for up to this amount. |
| `Sequence` | Number | UInt32 | The sequence number of the [CheckCreate transaction][] that created this check. |
| `OwnerNode` | String | UInt64 | A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages. **Note:** The object does not contain a direct link to the owner directory containing it, since that value can be derived from the `Account`. |
| `DestinationNode` | String | UInt64 | _(Optional)_ A hint indicating which page of the destination's owner directory links to this object, in case the directory consists of multiple pages. |
| `Expiration` | Number | UInt32 | (Optional) Indicates the time after which this Check is considered expired. See [Specifying Time](reference-rippled.html#specifying-time) for details. |
| `InvoiceID` | String | Hash256 | _(Optional)_ Arbitrary 256-bit hash provided by the sender as a specific reason or identifier for this Check. |
| `SourceTag` | Number | UInt32 | _(Optional)_ An arbitrary tag to further specify the source for this Check, such as a hosted recipient at the sender's address. |
| `DestinationTag` | Number | UInt32 | _(Optional)_ An arbitrary tag to further specify the destination for this Check, such as a hosted recipient at the destination address. |
| `PreviousTxnID` | String | Hash256 | The identifying hash of the transaction that most recently modified this object. |
| `PreviousTxnLgrSeq` | Number | UInt32 | The [index of the ledger](#ledger-index) that contains the transaction that most recently modified this object. |
### Check ID Format
[[Source]<br>](https://github.com/ripple/rippled/blob/develop/src/ripple/protocol/impl/Indexes.cpp#L193-L200 "Source")
The ID of a `Check` object is the [SHA-512Half](#sha512half) of the following values put together:
* The Escrow space key (`0x0043`)
* The AccountID of the sender of the [CheckCreate transaction][] that created the `Check` object
* The Sequence number of the [CheckCreate transaction][] that created the `Check` object

View File

@@ -70,6 +70,7 @@ There are several different kinds of objects that can appear in the ledger's sta
* [**AccountRoot** - The settings, XRP balance, and other metadata for one account.](#accountroot) * [**AccountRoot** - The settings, XRP balance, and other metadata for one account.](#accountroot)
* [**Amendments** - Singleton object with status of enabled and pending amendments.](#amendments) * [**Amendments** - Singleton object with status of enabled and pending amendments.](#amendments)
* [**Check** - A potential pull payment authorized by its sender](#check)
* [**DirectoryNode** - Contains links to other objects.](#directorynode) * [**DirectoryNode** - Contains links to other objects.](#directorynode)
* [**Escrow** - Contains XRP held for a conditional payment.](#escrow) * [**Escrow** - Contains XRP held for a conditional payment.](#escrow)
* [**FeeSettings** - Singleton object with consensus-approved base transaction cost and reserve requirements.](#feesettings) * [**FeeSettings** - Singleton object with consensus-approved base transaction cost and reserve requirements.](#feesettings)
@@ -85,6 +86,8 @@ Each ledger object consists of several fields. In the peer protocol that `ripple
{% include 'ledger-objects/amendments.md' %} {% include 'ledger-objects/amendments.md' %}
{% include 'ledger-objects/check.md' %}
{% include 'ledger-objects/directorynode.md' %} {% include 'ledger-objects/directorynode.md' %}
{% include 'ledger-objects/escrow.md' %} {% include 'ledger-objects/escrow.md' %}