updated escrow tut & samples - look up by receiver

This commit is contained in:
Jennifer Hasegawa
2017-12-01 10:45:20 -08:00
parent 59db76aee7
commit 2ed6295722
5 changed files with 134 additions and 26 deletions

View File

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

View File

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

View File

@@ -0,0 +1,39 @@
{
"id":5,
"result":{
"account":"rLpLGbSaUwEp6RgLCkjBGTHupfKJMkUjiw",
"account_objects":[
{
"Account":"r9yALWi9X6Hz2pQxeXcDbBazvsqEBsukgG",
"Amount":"2500",
"Destination":"rLpLGbSaUwEp6RgLCkjBGTHupfKJMkUjiw",
"DestinationNode":"0000000000000000",
"FinishAfter":570672000,
"Flags":0,
"LedgerEntryType":"Escrow",
"OwnerNode":"0000000000000000",
"PreviousTxnID":"F403A36E7A05898C68ADF5DC788FC69AF15C34DD84B6AB5345A34320D2BB5489",
"PreviousTxnLgrSeq":4570102,
"index":"07CFC2B7D9B7E8484B39403D00A851E2FD556CEE410EB682D1E9C912CF4ED6FB"
},
{
"Account":"rnYL8VxgjkasX9NgM5SeMwgnykpRLw2u2v",
"Amount":"2500",
"Destination":"rLpLGbSaUwEp6RgLCkjBGTHupfKJMkUjiw",
"DestinationNode":"0000000000000000",
"FinishAfter":570672000,
"Flags":0,
"LedgerEntryType":"Escrow",
"OwnerNode":"0000000000000000",
"PreviousTxnID":"2FD4FBF8A4BC65936C2DF1259FAA28BD79E4E0FA89612495B006E9BA7FB28971",
"PreviousTxnLgrSeq":4570913,
"index":"098ECEC65981434E549FC2A47620BBC1CFB9AA8D7DA385538C019B3DFE534B88"
}
],
"ledger_hash":"AF0DB9E937976ECEE2215D9B77C21076A3E1045836102AB682864EF2F8030A22",
"ledger_index":4571007,
"validated":true
},
"status":"success",
"type":"response"
}

View File

@@ -1,26 +1,48 @@
{
"id": 5,
"status": "success",
"type": "response",
"result": {
"account": "rEhw9vD98ZrkY4tZPvkZst5H18RysqFdaB",
"account_objects": [
{
"Account": "rEhw9vD98ZrkY4tZPvkZst5H18RysqFdaB",
"Amount": "100000",
"CancelAfter": 556927412,
"Condition": "A0258020E24D9E1473D4DF774F6D8E089067282034E4FA7ECACA2AD2E547953B2C113CBD810120",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"account": "r9yALWi9X6Hz2pQxeXcDbBazvsqEBsukgG",
"account_objects": [{
"Account": "r9yALWi9X6Hz2pQxeXcDbBazvsqEBsukgG",
"Amount": "2500",
"Destination": "rLpLGbSaUwEp6RgLCkjBGTHupfKJMkUjiw",
"DestinationNode": "0000000000000000",
"FinishAfter": 570672000,
"Flags": 0,
"LedgerEntryType": "Escrow",
"OwnerNode": "0000000000000000",
"PreviousTxnID": "E22D1F6EB006CAD35E0DBD3B4F3748427055E4C143EBE95AA6603823AEEAD324",
"PreviousTxnLgrSeq": 1772019,
"index": "E2CF730A31FD419382350C9DBD8DB7CD775BA5AA9B97A9BE9AB07304AA217A75"
}
],
"ledger_hash": "F2ABEA175F4AB871845B01CB51E4324DBA2C2553EC34448D4AB1EB0A3F2D8EFB",
"ledger_index": 1772020,
"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",
"Destination": "rLpLGbSaUwEp6RgLCkjBGTHupfKJMkUjiw",
"DestinationNode": "0000000000000000",
"FinishAfter": 570672000,
"Flags": 0,
"LedgerEntryType": "Escrow",
"OwnerNode": "0000000000000000",
"PreviousTxnID": "E6F60C460D768E4C833C14B89168929AAA538374BE5720B9112530AE04E651A5",
"PreviousTxnLgrSeq": 4570975,
"index": "4720F356A6F6A0C3A62D3E3AD72DF05AF45458D3124998D2BFE1CB085E55E302"
}],
"ledger_hash": "007E15650382AC1B1482FF245FC52080C5379E278A92169C50BAD3608A16123E",
"ledger_index": 4570985,
"validated": true
}
},
"status": "success",
"type": "response"
}

View File

@@ -5,7 +5,7 @@ The XRP Ledger supports held payments, or _escrows_, that can be executed only a
- [Send a time-held escrow](#send-a-time-held-escrow)
- [Send a conditionally-held escrow](#send-a-conditionally-held-escrow)
- [Cancel an expired escrow](#cancel-an-expired-escrow)
- [Look up escrows by sender](#look-up-escrows-by-sender)
- [Look up escrows](#look-up-escrows)
<!-- {# Doesn't work yet:- Look up escrows by destination #}-->
@@ -511,9 +511,19 @@ _Websocket_
In the above example, `r3wN3v2vTUkr5qd6daqDc2xE4LSysdVjkT` is the sender of the escrow, and the increase in `Balance` from 99999**8**9990 drops to 99999**9**9990 drops represents the return of the escrowed 10,000 drops of XRP (0.01 XRP).
## Look up escrows by sender
**Tip:** If you don't know what `OfferSequence` to use in the [EscrowFinish transaction][] to execute an escrow, use the [`tx` method](reference-rippled.html) to look up the transaction that created the escrow, using the identifying hash of the transaction in the Escrow's `PreviousTxnID` field. Use the `Sequence` value of that transaction as the `OfferSequence` value when finishing the escrow.
All pending escrows are stored in the ledger as [Escrow objects](reference-ledger-format.html#escrow). You can look up escrow nodes owned by your address using the [`account_objects` method](reference-rippled.html#account-objects).
## Look up escrows
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.
###Look up escrows by sender
You can use the [`account_objects`](reference-rippled.html#account-objects) method to look up escrows by sender.
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.
Request:
@@ -539,6 +549,36 @@ _Websocket_
<!-- MULTICODE_BLOCK_END -->
**Tip:** If you don't know what `OfferSequence` to use in the [EscrowFinish transaction][] to execute an escrow, use the [`tx` method](reference-rippled.html) to look up the transaction that created the escrow, using the identifying hash of the transaction in the Escrow's `PreviousTxnID` field. Use the `Sequence` value of that transaction as the `OfferSequence` value when finishing the escrow.
###Look up escrows by receiver
You can use the [`account_objects`](reference-rippled.html#account-objects) method to look up escrows 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.
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.
Request:
<!-- MULTICODE_BLOCK_START -->
_Websocket_
```json
{% include 'code_samples/escrow/websocket/account_objects-request-receiver.json' %}
```
<!-- MULTICODE_BLOCK_END -->
Response:
<!-- MULTICODE_BLOCK_START -->
_Websocket_
```json
{% include 'code_samples/escrow/websocket/account_objects-response-receiver.json' %}
```
<!-- MULTICODE_BLOCK_END -->
{% include 'snippets/tx-type-links.md' %}