Updated doc & samples to address Rome's feedback.

This commit is contained in:
Jennifer Hasegawa
2017-12-01 15:34:20 -08:00
parent 2ed6295722
commit fb1b247b78
3 changed files with 65 additions and 44 deletions

View File

@@ -1,7 +1,7 @@
{ {
"id": 5, "id": 5,
"command": "account_objects", "command": "account_objects",
"account": "r9yALWi9X6Hz2pQxeXcDbBazvsqEBsukgG", "account": "rfztBskAVszuS3s5Kq7zDS74QtHrw893fm",
"ledger_index": "validated", "ledger_index": "validated",
"type": "escrow" "type": "escrow"
} }

View File

@@ -1,46 +1,58 @@
{ {
"id": 5, "id": 5,
"result": { "result": {
"account": "r9yALWi9X6Hz2pQxeXcDbBazvsqEBsukgG", "account": "rfztBskAVszuS3s5Kq7zDS74QtHrw893fm",
"account_objects": [{ "account_objects": [{
"Account": "r9yALWi9X6Hz2pQxeXcDbBazvsqEBsukgG", "Account": "rafD3taonqdnVpaxCCT6sjnScZUeFGf1JG",
"Amount": "2500",
"Destination": "rLpLGbSaUwEp6RgLCkjBGTHupfKJMkUjiw",
"DestinationNode": "0000000000000000",
"FinishAfter": 570672000,
"Flags": 0,
"LedgerEntryType": "Escrow",
"OwnerNode": "0000000000000000",
"PreviousTxnID": "F403A36E7A05898C68ADF5DC788FC69AF15C34DD84B6AB5345A34320D2BB5489",
"PreviousTxnLgrSeq": 4570102,
"index": "07CFC2B7D9B7E8484B39403D00A851E2FD556CEE410EB682D1E9C912CF4ED6FB"
}, {
"Account": "r9yALWi9X6Hz2pQxeXcDbBazvsqEBsukgG",
"Amount": "2500",
"Destination": "rLwsbsEHu3yWn6FBEfXz6B7iwZmxMeY9H7",
"DestinationNode": "0000000000000000",
"FinishAfter": 570672000,
"Flags": 0,
"LedgerEntryType": "Escrow",
"OwnerNode": "0000000000000000",
"PreviousTxnID": "56780536AC1B85029143634416434CAE374213732FDBB284574F2CD8B826A868",
"PreviousTxnLgrSeq": 4570083,
"index": "250AF3071E37089C920832BBF56E66BAA0940F698F48418A9D65D9970C555EE9"
}, {
"Account": "r9yALWi9X6Hz2pQxeXcDbBazvsqEBsukgG",
"Amount": "250", "Amount": "250",
"Destination": "rLpLGbSaUwEp6RgLCkjBGTHupfKJMkUjiw", "Destination": "rfztBskAVszuS3s5Kq7zDS74QtHrw893fm",
"DestinationNode": "0000000000000000", "DestinationNode": "0000000000000000",
"FinishAfter": 570672000, "FinishAfter": 570672000,
"Flags": 0, "Flags": 0,
"LedgerEntryType": "Escrow", "LedgerEntryType": "Escrow",
"OwnerNode": "0000000000000000", "OwnerNode": "0000000000000000",
"PreviousTxnID": "E6F60C460D768E4C833C14B89168929AAA538374BE5720B9112530AE04E651A5", "PreviousTxnID": "A0951691DF3BCBEEB3108F2229A702D078BBBF848268BC601E59B68A2E390AAC",
"PreviousTxnLgrSeq": 4570975, "PreviousTxnLgrSeq": 4602906,
"index": "4720F356A6F6A0C3A62D3E3AD72DF05AF45458D3124998D2BFE1CB085E55E302" "index": "2BF3226ACCA8FF7ACB7201F20A701F51D8666A2FA2FBFBE6A05C9161F9228A18"
}, {
"Account": "rfztBskAVszuS3s5Kq7zDS74QtHrw893fm",
"Amount": "250",
"Destination": "r9gyNNzhMtfwZara61u3ycfMLdkTpKJZHX",
"DestinationNode": "0000000000000000",
"FinishAfter": 570672000,
"Flags": 0,
"LedgerEntryType": "Escrow",
"OwnerNode": "0000000000000000",
"PreviousTxnID": "463D5A3CF09F4890B8471027F80414B3B438E6907425B71DC324D7118E90A107",
"PreviousTxnLgrSeq": 4603003,
"index": "35462CDC28AD830B29D101E8307AF5B6BFBC262F1BDCCA7EB45D1CA3F8B44F53"
}, {
"Account": "r9gyNNzhMtfwZara61u3ycfMLdkTpKJZHX",
"Amount": "250",
"Destination": "rfztBskAVszuS3s5Kq7zDS74QtHrw893fm",
"DestinationNode": "0000000000000000",
"FinishAfter": 570672000,
"Flags": 0,
"LedgerEntryType": "Escrow",
"OwnerNode": "0000000000000000",
"PreviousTxnID": "08C9B20AC9EB191238038A108CC4CBBC0243672484B466FB42DED0A7DF6A31A1",
"PreviousTxnLgrSeq": 4602954,
"index": "A7B0983A1B53D92278E21499064A4F8BBE08CB8D14DB6BBBA8F688AB1D3FDA45"
}, {
"Account": "rfztBskAVszuS3s5Kq7zDS74QtHrw893fm",
"Amount": "250",
"Destination": "rafD3taonqdnVpaxCCT6sjnScZUeFGf1JG",
"DestinationNode": "0000000000000000",
"FinishAfter": 570672000,
"Flags": 0,
"LedgerEntryType": "Escrow",
"OwnerNode": "0000000000000000",
"PreviousTxnID": "F4778F528AB3CB945BDB88036EF9FE6C0E899F1629D9E51129E3B93CD488395A",
"PreviousTxnLgrSeq": 4602977,
"index": "F99A4DDADDDF623908C9A048170AB107AFF78684AB8F3110E9F00BBBC606ABD2"
}], }],
"ledger_hash": "007E15650382AC1B1482FF245FC52080C5379E278A92169C50BAD3608A16123E", "ledger_hash": "1D4850035F175CA6F1CD5CE3B53C01AA83E4F086C13085E4FBC1EEFCCB345A9B",
"ledger_index": 4570985, "ledger_index": 4603176,
"validated": true "validated": true
}, },
"status": "success", "status": "success",

View File

@@ -6,7 +6,6 @@ The XRP Ledger supports held payments, or _escrows_, that can be executed only a
- [Send a conditionally-held escrow](#send-a-conditionally-held-escrow) - [Send a conditionally-held escrow](#send-a-conditionally-held-escrow)
- [Cancel an expired escrow](#cancel-an-expired-escrow) - [Cancel an expired escrow](#cancel-an-expired-escrow)
- [Look up escrows](#look-up-escrows) - [Look up escrows](#look-up-escrows)
<!-- {# Doesn't work yet:- Look up escrows by destination #}-->
## Send a Time-Held Escrow ## Send a Time-Held Escrow
@@ -517,13 +516,13 @@ In the above example, `r3wN3v2vTUkr5qd6daqDc2xE4LSysdVjkT` is the sender of the
All pending escrows are stored in the ledger as [Escrow objects](reference-ledger-format.html#escrow). All pending escrows are stored in the ledger as [Escrow objects](reference-ledger-format.html#escrow).
You can look up escrow nodes by [sender](#look-up-escrows-by-sender) or [receiver](#look-up-escrows-by-receiver) using the [`account_objects`](reference-rippled.html#account-objects) method. You can look up escrow objects by the [sender's address](#look-up-escrows-by-sender-address) or the [receiver's address](#look-up-escrows-by-receiver-address) using the [`account_objects`](reference-rippled.html#account-objects) method.
###Look up escrows by sender ###Look up escrows by sender address
You can use the [`account_objects`](reference-rippled.html#account-objects) method to look up escrows by sender. You can use the [`account_objects`](reference-rippled.html#account-objects) method to look up escrow objects by sender address.
The following examples illustrate an escrow lookup by sender. Note that the `account` in the request is the sender `Account` of the escrow `account_objects` returned in the response. Let's say that you want to look up all pending escrow objects with a sender address of `rfztBskAVszuS3s5Kq7zDS74QtHrw893fm`. You can do this using the following example request, where the sender address is the `account` value.
Request: Request:
@@ -537,6 +536,11 @@ _Websocket_
<!-- MULTICODE_BLOCK_END --> <!-- MULTICODE_BLOCK_END -->
The response will look something like the following example. Note that the response includes all pending escrow objects with `rfztBskAVszuS3s5Kq7zDS74QtHrw893fm` as the sender or receiver address, where the sender address is the `Account` value and the receiver address is the `Destination` value.
In this case, the second and fourth escrow objects have `rfztBskAVszuS3s5Kq7zDS74QtHrw893fm` as their sender address (`Account`) value and are what we are looking for.
Response: Response:
<!-- MULTICODE_BLOCK_START --> <!-- MULTICODE_BLOCK_START -->
@@ -549,13 +553,13 @@ _Websocket_
<!-- MULTICODE_BLOCK_END --> <!-- MULTICODE_BLOCK_END -->
###Look up escrows by receiver ###Look up escrows by receiver address
You can use the [`account_objects`](reference-rippled.html#account-objects) method to look up escrows by receiver address. You can use the [`account_objects`](reference-rippled.html#account-objects) method to look up escrow objects by receiver address.
Look up by receiver is possible for only pending escrows created after [fix1523](concept-amendments.html#fix1523) was enabled for rippled 0.80.0 on 2017-11-14. You can only look up pending escrow objects by receiver address if those escrows were created after the [fix1523 amendment](concept-amendments.html#fix1523) was enabled on 2017-11-14.
The following examples illustrate an escrow lookup by receiver. Note that the `account` in the request is the receiver `Destination` of the escrow `account_objects` returned in the response. Let's say that you want to look up all pending escrow objects with a receiver address of `rfztBskAVszuS3s5Kq7zDS74QtHrw893fm`. You can do this using the following example request, where the receiver address is the `account` value.
Request: Request:
@@ -564,11 +568,16 @@ Request:
_Websocket_ _Websocket_
```json ```json
{% include 'code_samples/escrow/websocket/account_objects-request-receiver.json' %} {% include 'code_samples/escrow/websocket/account_objects-request-sender.json' %}
``` ```
<!-- MULTICODE_BLOCK_END --> <!-- MULTICODE_BLOCK_END -->
The response will look something like the following example. Note that the response includes all pending escrow objects with `rfztBskAVszuS3s5Kq7zDS74QtHrw893fm` as the receiver or sender address, where the receiver address is the `Destination` value and the sender address is the `Account` value.
In this case, the first and third escrow objects have `rfztBskAVszuS3s5Kq7zDS74QtHrw893fm` as their receiver address (`Destination`) value and are what we are looking for.
Response: Response:
<!-- MULTICODE_BLOCK_START --> <!-- MULTICODE_BLOCK_START -->
@@ -576,7 +585,7 @@ Response:
_Websocket_ _Websocket_
```json ```json
{% include 'code_samples/escrow/websocket/account_objects-response-receiver.json' %} {% include 'code_samples/escrow/websocket/account_objects-response-sender.json' %}
``` ```
<!-- MULTICODE_BLOCK_END --> <!-- MULTICODE_BLOCK_END -->