Replace suspended payments with escrow

This commit is contained in:
wilsonianb
2017-03-22 10:29:49 -07:00
parent 68d7864f93
commit 15a0ededc8
55 changed files with 379 additions and 391 deletions

View File

@@ -24,9 +24,9 @@
- [Order](#order) - [Order](#order)
- [Order Cancellation](#order-cancellation) - [Order Cancellation](#order-cancellation)
- [Settings](#settings) - [Settings](#settings)
- [Suspended Payment Creation](#suspended-payment-creation) - [Escrow Creation](#escrow-creation)
- [Suspended Payment Cancellation](#suspended-payment-cancellation) - [Escrow Cancellation](#escrow-cancellation)
- [Suspended Payment Execution](#suspended-payment-execution) - [Escrow Execution](#escrow-execution)
- [API Methods](#api-methods) - [API Methods](#api-methods)
- [connect](#connect) - [connect](#connect)
- [disconnect](#disconnect) - [disconnect](#disconnect)
@@ -50,9 +50,9 @@
- [prepareOrder](#prepareorder) - [prepareOrder](#prepareorder)
- [prepareOrderCancellation](#prepareordercancellation) - [prepareOrderCancellation](#prepareordercancellation)
- [prepareSettings](#preparesettings) - [prepareSettings](#preparesettings)
- [prepareSuspendedPaymentCreation](#preparesuspendedpaymentcreation) - [prepareEscrowCreation](#prepareescrowcreation)
- [prepareSuspendedPaymentCancellation](#preparesuspendedpaymentcancellation) - [prepareEscrowCancellation](#prepareescrowcancellation)
- [prepareSuspendedPaymentExecution](#preparesuspendedpaymentexecution) - [prepareEscrowExecution](#prepareescrowexecution)
- [sign](#sign) - [sign](#sign)
- [combine](#combine) - [combine](#combine)
- [submit](#submit) - [submit](#submit)
@@ -180,9 +180,9 @@ Methods that depend on the state of the Ripple Consensus Ledger are unavailable
* [prepareOrder](#prepareorder) * [prepareOrder](#prepareorder)
* [prepareOrderCancellation](#prepareordercancellation) * [prepareOrderCancellation](#prepareordercancellation)
* [prepareSettings](#preparesettings) * [prepareSettings](#preparesettings)
* [prepareSuspendedPaymentCreation](#preparesuspendedpaymentcreation) * [prepareEscrowCreation](#prepareescrowcreation)
* [prepareSuspendedPaymentCancellation](#preparesuspendedpaymentcancellation) * [prepareEscrowCancellation](#prepareescrowcancellation)
* [prepareSuspendedPaymentExecution](#preparesuspendedpaymentexecution) * [prepareEscrowExecution](#prepareescrowexecution)
* [sign](#sign) * [sign](#sign)
* [generateAddress](#generateaddress) * [generateAddress](#generateaddress)
* [computeLedgerHash](#computeledgerhash) * [computeLedgerHash](#computeledgerhash)
@@ -261,11 +261,11 @@ Type | Description
[orderCancellation](#order-cancellation) | An `orderCancellation` transaction cancels an order in the Ripple Consensus Ledger's order book. [orderCancellation](#order-cancellation) | An `orderCancellation` transaction cancels an order in the Ripple Consensus Ledger's order book.
[trustline](#trustline) | A `trustline` transactions creates or modifies a trust line between two accounts. [trustline](#trustline) | A `trustline` transactions creates or modifies a trust line between two accounts.
[settings](#settings) | A `settings` transaction modifies the settings of an account in the Ripple Consensus Ledger. [settings](#settings) | A `settings` transaction modifies the settings of an account in the Ripple Consensus Ledger.
[suspendedPaymentCreation](#suspended-payment-creation) | A `suspendedPaymentCreation` transaction creates a suspended payment on the ledger, which locks XRP until a cryptographic condition is met or it expires. It is like an escrow service where the Ripple network acts as the escrow agent. [escrowCreation](#escrow-creation) | An `escrowCreation` transaction creates an escrow on the ledger, which locks XRP until a cryptographic condition is met or it expires. It is like an escrow service where the Ripple network acts as the escrow agent.
[suspendedPaymentCancellation](#suspended-payment-cancellation) | A `suspendedPaymentCancellation` transaction unlocks the funds in a suspended payment and sends them back to the creator of the suspended payment, but it will only work after the suspended payment expires. [escrowCancellation](#escrow-cancellation) | An `escrowCancellation` transaction unlocks the funds in an escrow and sends them back to the creator of the escrow, but it will only work after the escrow expires.
[suspendedPaymentExecution](#suspended-payment-execution) | A `suspendedPaymentExecution` transaction unlocks the funds in a suspended payment and sends them to the destination of the suspended payment, but it will only work if the cryptographic condition is provided. [escrowExecution](#escrow-execution) | An `escrowExecution` transaction unlocks the funds in an escrow and sends them to the destination of the escrow, but it will only work if the cryptographic condition is provided.
The three "suspended payment" transaction types are not supported by the production Ripple peer-to-peer network at this time. They are available for testing purposes if you [configure RippleAPI](#boilerplate) to connect to the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) instead. The three "escrow" transaction types are not supported by the production Ripple peer-to-peer network at this time. They are available for testing purposes if you [configure RippleAPI](#boilerplate) to connect to the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) instead.
## Transaction Flow ## Transaction Flow
@@ -277,9 +277,9 @@ Executing a transaction with `RippleAPI` requires the following four steps:
* [prepareOrder](#prepareorder) * [prepareOrder](#prepareorder)
* [prepareOrderCancellation](#prepareordercancellation) * [prepareOrderCancellation](#prepareordercancellation)
* [prepareSettings](#preparesettings) * [prepareSettings](#preparesettings)
* [prepareSuspendedPaymentCreation](#preparesuspendedpaymentcreation) * [prepareEscrowCreation](#prepareescrowcreation)
* [prepareSuspendedPaymentCancellation](#preparesuspendedpaymentcancellation) * [prepareEscrowCancellation](#prepareescrowcancellation)
* [prepareSuspendedPaymentExecution](#preparesuspendedpaymentexecution) * [prepareEscrowExecution](#prepareescrowexecution)
2. [Sign](#sign) - Cryptographically sign the transaction locally and save the [transaction ID](#transaction-id). Signing is how the owner of an account authorizes a transaction to take place. For multisignature transactions, the `signedTransaction` fields returned by `sign` must be collected and passed to the [combine](#combine) method. 2. [Sign](#sign) - Cryptographically sign the transaction locally and save the [transaction ID](#transaction-id). Signing is how the owner of an account authorizes a transaction to take place. For multisignature transactions, the `signedTransaction` fields returned by `sign` must be collected and passed to the [combine](#combine) method.
3. [Submit](#submit) - Submit the transaction to the connected server. 3. [Submit](#submit) - Submit the transaction to the connected server.
4. Verify - Verify that the transaction got validated by querying with [getTransaction](#gettransaction). This is necessary because transactions may fail even if they were successfully submitted. 4. Verify - Verify that the transaction got validated by querying with [getTransaction](#gettransaction). This is necessary because transactions may fail even if they were successfully submitted.
@@ -518,7 +518,7 @@ transferRate | number,null | *Optional* The fee to charge when users transfer t
``` ```
## Suspended Payment Creation ## Escrow Creation
See [Transaction Types](#transaction-types) for a description. See [Transaction Types](#transaction-types) for a description.
@@ -532,9 +532,9 @@ destination | object | Fields pertaining to the destination of the payment.
*destination.* address | [address](#ripple-address) | The address to receive at. *destination.* address | [address](#ripple-address) | The address to receive at.
*destination.* amount | [laxAmount](#amount) | An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with destination.minAmount). *destination.* amount | [laxAmount](#amount) | An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field is exclusive with destination.minAmount).
*destination.* tag | integer | *Optional* An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Ripple account. *destination.* tag | integer | *Optional* An arbitrary unsigned 32-bit integer that identifies a reason for payment or a non-Ripple account.
allowCancelAfter | date-time string | *Optional* If present, the suspended payment may be cancelled after this time. allowCancelAfter | date-time string | *Optional* If present, the escrow may be cancelled after this time.
allowExecuteAfter | date-time string | *Optional* If present, the suspended payment can not be executed before this time. allowExecuteAfter | date-time string | *Optional* If present, the escrow can not be executed before this time.
digest | string | *Optional* If present, proof is required upon execution. condition | string | *Optional* If present, fulfillment is required upon execution.
memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction. memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction.
### Example ### Example
@@ -563,14 +563,14 @@ memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the
``` ```
## Suspended Payment Cancellation ## Escrow Cancellation
See [Transaction Types](#transaction-types) for a description. See [Transaction Types](#transaction-types) for a description.
Name | Type | Description Name | Type | Description
---- | ---- | ----------- ---- | ---- | -----------
owner | [address](#ripple-address) | The address of the owner of the suspended payment to cancel. owner | [address](#ripple-address) | The address of the owner of the escrow to cancel.
suspensionSequence | [sequence](#account-sequence-number) | The [account sequence number](#account-sequence-number) of the [Suspended Payment Creation](#suspended-payment-creation) transaction for the suspended payment to cancel. escrowSequence | [sequence](#account-sequence-number) | The [account sequence number](#account-sequence-number) of the [Escrow Creation](#escrow-creation) transaction for the escrow to cancel.
memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction. memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction.
### Example ### Example
@@ -579,23 +579,22 @@ memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the
```json ```json
{ {
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"suspensionSequence": 1234 "escrowSequence": 1234
} }
``` ```
## Suspended Payment Execution ## Escrow Execution
See [Transaction Types](#transaction-types) for a description. See [Transaction Types](#transaction-types) for a description.
Name | Type | Description Name | Type | Description
---- | ---- | ----------- ---- | ---- | -----------
owner | [address](#ripple-address) | The address of the owner of the suspended payment to execute. owner | [address](#ripple-address) | The address of the owner of the escrow to execute.
suspensionSequence | [sequence](#account-sequence-number) | The [account sequence number](#account-sequence-number) of the [Suspended Payment Creation](#suspended-payment-creation) transaction for the suspended payment to execute. escrowSequence | [sequence](#account-sequence-number) | The [account sequence number](#account-sequence-number) of the [Escrow Creation](#escrow-creation) transaction for the escrow to execute.
digest | string | *Optional* The original `digest` from the suspended payment creation transaction. This is sha256 hash of `proof` string. It is replicated here so that the relatively expensive hashing operation can be delegated to a server without ledger history and the server with ledger history only has to do a quick comparison of the old digest with the new digest. condition | string | *Optional* The original `condition` from the escrow creation transaction. This is sha256 hash of `fulfillment` string. It is replicated here so that the relatively expensive hashing operation can be delegated to a server without ledger history and the server with ledger history only has to do a quick comparison of the old condition with the new condition.
fulfillment | string | *Optional* A value that produces the condition when hashed. It must be 32 charaters long and contain only 8-bit characters.
memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction. memos | [memos](#transaction-memos) | *Optional* Array of memos to attach to the transaction.
method | integer | *Optional* The method for verifying the proof; only method `1` is supported.
proof | string | *Optional* A value that produces the digest when hashed. It must be 32 charaters long and contain only 8-bit characters.
### Example ### Example
@@ -603,10 +602,9 @@ proof | string | *Optional* A value that produces the digest when hashed. It mus
```json ```json
{ {
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"suspensionSequence": 1234, "escrowSequence": 1234,
"method": 1, "condition": "712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D",
"digest": "712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D", "fulfillment": "this must have 32 characters...."
"proof": "this must have 32 characters...."
} }
``` ```
@@ -3132,20 +3130,20 @@ return api.prepareSettings(address, settings)
``` ```
## prepareSuspendedPaymentCreation ## prepareEscrowCreation
`prepareSuspendedPaymentCreation(address: string, suspendedPaymentCreation: Object, instructions: Object): Promise<Object>` `prepareEscrowCreation(address: string, escrowCreation: Object, instructions: Object): Promise<Object>`
Prepare a suspended payment creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit). Prepare an escrow creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
**Caution:** Suspended Payments are currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only. **Caution:** Escrow is currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only.
### Parameters ### Parameters
Name | Type | Description Name | Type | Description
---- | ---- | ----------- ---- | ---- | -----------
address | [address](#ripple-address) | The address of the account that is creating the transaction. address | [address](#ripple-address) | The address of the account that is creating the transaction.
suspendedPaymentCreation | [suspendedPaymentCreation](#suspended-payment-creation) | The specification of the suspended payment creation to prepare. escrowCreation | [escrowCreation](#escrow-creation) | The specification of the escrow creation to prepare.
instructions | [instructions](#transaction-instructions) | *Optional* Instructions for executing the transaction instructions | [instructions](#transaction-instructions) | *Optional* Instructions for executing the transaction
### Return Value ### Return Value
@@ -3168,7 +3166,7 @@ instructions | object | The instructions for how to execute the transaction afte
```javascript ```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59'; const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const suspendedPaymentCreation = { const escrowCreation = {
"source": { "source": {
"address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"maxAmount": { "maxAmount": {
@@ -3187,14 +3185,14 @@ const suspendedPaymentCreation = {
}, },
"allowCancelAfter": "2014-09-24T21:21:50.000Z" "allowCancelAfter": "2014-09-24T21:21:50.000Z"
}; };
return api.prepareSuspendedPaymentCreation(address, suspendedPaymentCreation).then(prepared => return api.prepareEscrowCreation(address, escrowCreation).then(prepared =>
{/* ... */}); {/* ... */});
``` ```
```json ```json
{ {
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"SuspendedPaymentCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"Amount\":{\"value\":\"0.01\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"},\"CancelAfter\":464908910,\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"EscrowCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"Amount\":{\"value\":\"0.01\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"},\"CancelAfter\":464908910,\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,
@@ -3204,20 +3202,20 @@ return api.prepareSuspendedPaymentCreation(address, suspendedPaymentCreation).th
``` ```
## prepareSuspendedPaymentCancellation ## prepareEscrowCancellation
`prepareSuspendedPaymentCancellation(address: string, suspendedPaymentCancellation: Object, instructions: Object): Promise<Object>` `prepareEscrowCancellation(address: string, escrowCancellation: Object, instructions: Object): Promise<Object>`
Prepare a suspended payment cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit). Prepare an escrow cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
**Caution:** Suspended Payments are currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only. **Caution:** Escrow is currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only.
### Parameters ### Parameters
Name | Type | Description Name | Type | Description
---- | ---- | ----------- ---- | ---- | -----------
address | [address](#ripple-address) | The address of the account that is creating the transaction. address | [address](#ripple-address) | The address of the account that is creating the transaction.
suspendedPaymentCancellation | [suspendedPaymentCancellation](#suspended-payment-cancellation) | The specification of the suspended payment cancellation to prepare. escrowCancellation | [escrowCancellation](#escrow-cancellation) | The specification of the escrow cancellation to prepare.
instructions | [instructions](#transaction-instructions) | *Optional* Instructions for executing the transaction instructions | [instructions](#transaction-instructions) | *Optional* Instructions for executing the transaction
### Return Value ### Return Value
@@ -3240,18 +3238,18 @@ instructions | object | The instructions for how to execute the transaction afte
```javascript ```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59'; const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const suspendedPaymentCancellation = { const escrowCancellation = {
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"suspensionSequence": 1234 "escrowSequence": 1234
}; };
return api.prepareSuspendedPaymentCancellation(address, suspendedPaymentCancellation).then(prepared => return api.prepareEscrowCancellation(address, escrowCancellation).then(prepared =>
{/* ... */}); {/* ... */});
``` ```
```json ```json
{ {
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"SuspendedPaymentCancel\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"EscrowCancel\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,
@@ -3261,20 +3259,20 @@ return api.prepareSuspendedPaymentCancellation(address, suspendedPaymentCancella
``` ```
## prepareSuspendedPaymentExecution ## prepareEscrowExecution
`prepareSuspendedPaymentExecution(address: string, suspendedPaymentExecution: Object, instructions: Object): Promise<Object>` `prepareEscrowExecution(address: string, escrowExecution: Object, instructions: Object): Promise<Object>`
Prepare a suspended payment execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit). Prepare an escrow execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
**Caution:** Suspended Payments are currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only. **Caution:** Escrow is currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only.
### Parameters ### Parameters
Name | Type | Description Name | Type | Description
---- | ---- | ----------- ---- | ---- | -----------
address | [address](#ripple-address) | The address of the account that is creating the transaction. address | [address](#ripple-address) | The address of the account that is creating the transaction.
suspendedPaymentExecution | [suspendedPaymentExecution](#suspended-payment-execution) | The specification of the suspended payment execution to prepare. escrowExecution | [escrowExecution](#escrow-execution) | The specification of the escrow execution to prepare.
instructions | [instructions](#transaction-instructions) | *Optional* Instructions for executing the transaction instructions | [instructions](#transaction-instructions) | *Optional* Instructions for executing the transaction
### Return Value ### Return Value
@@ -3297,21 +3295,20 @@ instructions | object | The instructions for how to execute the transaction afte
```javascript ```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59'; const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const suspendedPaymentExecution = { const escrowExecution = {
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"suspensionSequence": 1234, "escrowSequence": 1234,
"method": 1, "condition": "712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D",
"digest": "712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D", "fulfillment": "this must have 32 characters...."
"proof": "this must have 32 characters...."
}; };
return api.prepareSuspendedPaymentExecution(address, suspendedPaymentExecution).then(prepared => return api.prepareEscrowExecution(address, escrowExecution).then(prepared =>
{/* ... */}); {/* ... */});
``` ```
```json ```json
{ {
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"SuspendedPaymentFinish\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Method\":1,\"Digest\":\"712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D\",\"Proof\":\"74686973206D757374206861766520333220636861726163746572732E2E2E2E\",\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"EscrowFinish\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Condition\":\"712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D\",\"Fulfillment\":\"74686973206D757374206861766520333220636861726163746572732E2E2E2E\",\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,

View File

@@ -27,9 +27,9 @@
<% include prepareOrder.md.ejs %> <% include prepareOrder.md.ejs %>
<% include prepareOrderCancellation.md.ejs %> <% include prepareOrderCancellation.md.ejs %>
<% include prepareSettings.md.ejs %> <% include prepareSettings.md.ejs %>
<% include prepareSuspendedPaymentCreation.md.ejs %> <% include prepareEscrowCreation.md.ejs %>
<% include prepareSuspendedPaymentCancellation.md.ejs %> <% include prepareEscrowCancellation.md.ejs %>
<% include prepareSuspendedPaymentExecution.md.ejs %> <% include prepareEscrowExecution.md.ejs %>
<% include sign.md.ejs %> <% include sign.md.ejs %>
<% include combine.md.ejs %> <% include combine.md.ejs %>
<% include submit.md.ejs %> <% include submit.md.ejs %>

View File

@@ -18,9 +18,9 @@ Methods that depend on the state of the Ripple Consensus Ledger are unavailable
* [prepareOrder](#prepareorder) * [prepareOrder](#prepareorder)
* [prepareOrderCancellation](#prepareordercancellation) * [prepareOrderCancellation](#prepareordercancellation)
* [prepareSettings](#preparesettings) * [prepareSettings](#preparesettings)
* [prepareSuspendedPaymentCreation](#preparesuspendedpaymentcreation) * [prepareEscrowCreation](#prepareescrowcreation)
* [prepareSuspendedPaymentCancellation](#preparesuspendedpaymentcancellation) * [prepareEscrowCancellation](#prepareescrowcancellation)
* [prepareSuspendedPaymentExecution](#preparesuspendedpaymentexecution) * [prepareEscrowExecution](#prepareescrowexecution)
* [sign](#sign) * [sign](#sign)
* [generateAddress](#generateaddress) * [generateAddress](#generateaddress)
* [computeLedgerHash](#computeledgerhash) * [computeLedgerHash](#computeledgerhash)

View File

@@ -1,14 +1,14 @@
## prepareSuspendedPaymentCancellation ## prepareEscrowCancellation
`prepareSuspendedPaymentCancellation(address: string, suspendedPaymentCancellation: Object, instructions: Object): Promise<Object>` `prepareEscrowCancellation(address: string, escrowCancellation: Object, instructions: Object): Promise<Object>`
Prepare a suspended payment cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit). Prepare an escrow cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
**Caution:** Suspended Payments are currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only. **Caution:** Escrow is currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only.
### Parameters ### Parameters
<%- renderSchema('input/prepare-suspended-payment-cancellation.json') %> <%- renderSchema('input/prepare-escrow-cancellation.json') %>
### Return Value ### Return Value
@@ -24,9 +24,9 @@ All "prepare*" methods have the same return type.
```javascript ```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59'; const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const suspendedPaymentCancellation = <%- importFile('test/fixtures/requests/prepare-suspended-payment-cancellation.json') %>; const escrowCancellation = <%- importFile('test/fixtures/requests/prepare-escrow-cancellation.json') %>;
return api.prepareSuspendedPaymentCancellation(address, suspendedPaymentCancellation).then(prepared => return api.prepareEscrowCancellation(address, escrowCancellation).then(prepared =>
{/* ... */}); {/* ... */});
``` ```
<%- renderFixture('responses/prepare-suspended-payment-cancellation.json') %> <%- renderFixture('responses/prepare-escrow-cancellation.json') %>

View File

@@ -1,14 +1,14 @@
## prepareSuspendedPaymentCreation ## prepareEscrowCreation
`prepareSuspendedPaymentCreation(address: string, suspendedPaymentCreation: Object, instructions: Object): Promise<Object>` `prepareEscrowCreation(address: string, escrowCreation: Object, instructions: Object): Promise<Object>`
Prepare a suspended payment creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit). Prepare an escrow creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
**Caution:** Suspended Payments are currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only. **Caution:** Escrow is currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only.
### Parameters ### Parameters
<%- renderSchema('input/prepare-suspended-payment-creation.json') %> <%- renderSchema('input/prepare-escrow-creation.json') %>
### Return Value ### Return Value
@@ -24,9 +24,9 @@ All "prepare*" methods have the same return type.
```javascript ```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59'; const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const suspendedPaymentCreation = <%- importFile('test/fixtures/requests/prepare-suspended-payment-creation.json') %>; const escrowCreation = <%- importFile('test/fixtures/requests/prepare-escrow-creation.json') %>;
return api.prepareSuspendedPaymentCreation(address, suspendedPaymentCreation).then(prepared => return api.prepareEscrowCreation(address, escrowCreation).then(prepared =>
{/* ... */}); {/* ... */});
``` ```
<%- renderFixture('responses/prepare-suspended-payment-creation.json') %> <%- renderFixture('responses/prepare-escrow-creation.json') %>

View File

@@ -1,14 +1,14 @@
## prepareSuspendedPaymentExecution ## prepareEscrowExecution
`prepareSuspendedPaymentExecution(address: string, suspendedPaymentExecution: Object, instructions: Object): Promise<Object>` `prepareEscrowExecution(address: string, escrowExecution: Object, instructions: Object): Promise<Object>`
Prepare a suspended payment execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit). Prepare an escrow execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
**Caution:** Suspended Payments are currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only. **Caution:** Escrow is currently available on the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) only.
### Parameters ### Parameters
<%- renderSchema('input/prepare-suspended-payment-execution.json') %> <%- renderSchema('input/prepare-escrow-execution.json') %>
### Return Value ### Return Value
@@ -24,9 +24,9 @@ All "prepare*" methods have the same return type.
```javascript ```javascript
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59'; const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
const suspendedPaymentExecution = <%- importFile('test/fixtures/requests/prepare-suspended-payment-execution.json') %>; const escrowExecution = <%- importFile('test/fixtures/requests/prepare-escrow-execution.json') %>;
return api.prepareSuspendedPaymentExecution(address, suspendedPaymentExecution).then(prepared => return api.prepareEscrowExecution(address, escrowExecution).then(prepared =>
{/* ... */}); {/* ... */});
``` ```
<%- renderFixture('responses/prepare-suspended-payment-execution.json') %> <%- renderFixture('responses/prepare-escrow-execution.json') %>

View File

@@ -52,32 +52,32 @@ See [Transaction Types](#transaction-types) for a description.
<%- renderFixture('requests/prepare-settings.json') %> <%- renderFixture('requests/prepare-settings.json') %>
## Suspended Payment Creation ## Escrow Creation
See [Transaction Types](#transaction-types) for a description. See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/suspended-payment-creation.json') %> <%- renderSchema('specifications/escrow-creation.json') %>
### Example ### Example
<%- renderFixture('requests/prepare-suspended-payment-creation.json') %> <%- renderFixture('requests/prepare-escrow-creation.json') %>
## Suspended Payment Cancellation ## Escrow Cancellation
See [Transaction Types](#transaction-types) for a description. See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/suspended-payment-cancellation.json') %> <%- renderSchema('specifications/escrow-cancellation.json') %>
### Example ### Example
<%- renderFixture('requests/prepare-suspended-payment-cancellation.json') %> <%- renderFixture('requests/prepare-escrow-cancellation.json') %>
## Suspended Payment Execution ## Escrow Execution
See [Transaction Types](#transaction-types) for a description. See [Transaction Types](#transaction-types) for a description.
<%- renderSchema('specifications/suspended-payment-execution.json') %> <%- renderSchema('specifications/escrow-execution.json') %>
### Example ### Example
<%- renderFixture('requests/prepare-suspended-payment-execution.json') %> <%- renderFixture('requests/prepare-escrow-execution.json') %>

View File

@@ -11,11 +11,11 @@ Type | Description
[orderCancellation](#order-cancellation) | An `orderCancellation` transaction cancels an order in the Ripple Consensus Ledger's order book. [orderCancellation](#order-cancellation) | An `orderCancellation` transaction cancels an order in the Ripple Consensus Ledger's order book.
[trustline](#trustline) | A `trustline` transactions creates or modifies a trust line between two accounts. [trustline](#trustline) | A `trustline` transactions creates or modifies a trust line between two accounts.
[settings](#settings) | A `settings` transaction modifies the settings of an account in the Ripple Consensus Ledger. [settings](#settings) | A `settings` transaction modifies the settings of an account in the Ripple Consensus Ledger.
[suspendedPaymentCreation](#suspended-payment-creation) | A `suspendedPaymentCreation` transaction creates a suspended payment on the ledger, which locks XRP until a cryptographic condition is met or it expires. It is like an escrow service where the Ripple network acts as the escrow agent. [escrowCreation](#escrow-creation) | An `escrowCreation` transaction creates an escrow on the ledger, which locks XRP until a cryptographic condition is met or it expires. It is like an escrow service where the Ripple network acts as the escrow agent.
[suspendedPaymentCancellation](#suspended-payment-cancellation) | A `suspendedPaymentCancellation` transaction unlocks the funds in a suspended payment and sends them back to the creator of the suspended payment, but it will only work after the suspended payment expires. [escrowCancellation](#escrow-cancellation) | An `escrowCancellation` transaction unlocks the funds in an escrow and sends them back to the creator of the escrow, but it will only work after the escrow expires.
[suspendedPaymentExecution](#suspended-payment-execution) | A `suspendedPaymentExecution` transaction unlocks the funds in a suspended payment and sends them to the destination of the suspended payment, but it will only work if the cryptographic condition is provided. [escrowExecution](#escrow-execution) | An `escrowExecution` transaction unlocks the funds in an escrow and sends them to the destination of the escrow, but it will only work if the cryptographic condition is provided.
The three "suspended payment" transaction types are not supported by the production Ripple peer-to-peer network at this time. They are available for testing purposes if you [configure RippleAPI](#boilerplate) to connect to the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) instead. The three "escrow" transaction types are not supported by the production Ripple peer-to-peer network at this time. They are available for testing purposes if you [configure RippleAPI](#boilerplate) to connect to the [Ripple Test Net](https://ripple.com/build/ripple-test-net/) instead.
## Transaction Flow ## Transaction Flow
@@ -27,9 +27,9 @@ Executing a transaction with `RippleAPI` requires the following four steps:
* [prepareOrder](#prepareorder) * [prepareOrder](#prepareorder)
* [prepareOrderCancellation](#prepareordercancellation) * [prepareOrderCancellation](#prepareordercancellation)
* [prepareSettings](#preparesettings) * [prepareSettings](#preparesettings)
* [prepareSuspendedPaymentCreation](#preparesuspendedpaymentcreation) * [prepareEscrowCreation](#prepareescrowcreation)
* [prepareSuspendedPaymentCancellation](#preparesuspendedpaymentcancellation) * [prepareEscrowCancellation](#prepareescrowcancellation)
* [prepareSuspendedPaymentExecution](#preparesuspendedpaymentexecution) * [prepareEscrowExecution](#prepareescrowexecution)
2. [Sign](#sign) - Cryptographically sign the transaction locally and save the [transaction ID](#transaction-id). Signing is how the owner of an account authorizes a transaction to take place. For multisignature transactions, the `signedTransaction` fields returned by `sign` must be collected and passed to the [combine](#combine) method. 2. [Sign](#sign) - Cryptographically sign the transaction locally and save the [transaction ID](#transaction-id). Signing is how the owner of an account authorizes a transaction to take place. For multisignature transactions, the `signedTransaction` fields returned by `sign` must be collected and passed to the [combine](#combine) method.
3. [Submit](#submit) - Submit the transaction to the connected server. 3. [Submit](#submit) - Submit the transaction to the connected server.
4. Verify - Verify that the transaction got validated by querying with [getTransaction](#gettransaction). This is necessary because transactions may fail even if they were successfully submitted. 4. Verify - Verify that the transaction got validated by querying with [getTransaction](#gettransaction). This is necessary because transactions may fail even if they were successfully submitted.

View File

@@ -36,12 +36,12 @@ const preparePayment = require('./transaction/payment')
const prepareTrustline = require('./transaction/trustline') const prepareTrustline = require('./transaction/trustline')
const prepareOrder = require('./transaction/order') const prepareOrder = require('./transaction/order')
const prepareOrderCancellation = require('./transaction/ordercancellation') const prepareOrderCancellation = require('./transaction/ordercancellation')
const prepareSuspendedPaymentCreation = const prepareEscrowCreation =
require('./transaction/suspended-payment-creation') require('./transaction/escrow-creation')
const prepareSuspendedPaymentExecution = const prepareEscrowExecution =
require('./transaction/suspended-payment-execution') require('./transaction/escrow-execution')
const prepareSuspendedPaymentCancellation = const prepareEscrowCancellation =
require('./transaction/suspended-payment-cancellation') require('./transaction/escrow-cancellation')
const prepareSettings = require('./transaction/settings') const prepareSettings = require('./transaction/settings')
const sign = require('./transaction/sign') const sign = require('./transaction/sign')
const combine = require('./transaction/combine') const combine = require('./transaction/combine')
@@ -127,9 +127,9 @@ _.assign(RippleAPI.prototype, {
prepareTrustline, prepareTrustline,
prepareOrder, prepareOrder,
prepareOrderCancellation, prepareOrderCancellation,
prepareSuspendedPaymentCreation, prepareEscrowCreation,
prepareSuspendedPaymentExecution, prepareEscrowExecution,
prepareSuspendedPaymentCancellation, prepareEscrowCancellation,
prepareSettings, prepareSettings,
sign, sign,
combine, combine,

View File

@@ -46,11 +46,11 @@ function loadSchemas() {
require('./schemas/objects/settings.json'), require('./schemas/objects/settings.json'),
require('./schemas/specifications/settings.json'), require('./schemas/specifications/settings.json'),
require('./schemas/specifications/payment.json'), require('./schemas/specifications/payment.json'),
require('./schemas/specifications/suspended-payment-cancellation.json'), require('./schemas/specifications/escrow-cancellation.json'),
require('./schemas/specifications/order-cancellation.json'), require('./schemas/specifications/order-cancellation.json'),
require('./schemas/specifications/order.json'), require('./schemas/specifications/order.json'),
require('./schemas/specifications/suspended-payment-execution.json'), require('./schemas/specifications/escrow-execution.json'),
require('./schemas/specifications/suspended-payment-creation.json'), require('./schemas/specifications/escrow-creation.json'),
require('./schemas/specifications/trustline.json'), require('./schemas/specifications/trustline.json'),
require('./schemas/output/sign.json'), require('./schemas/output/sign.json'),
require('./schemas/output/submit.json'), require('./schemas/output/submit.json'),
@@ -88,9 +88,9 @@ function loadSchemas() {
require('./schemas/input/prepare-trustline.json'), require('./schemas/input/prepare-trustline.json'),
require('./schemas/input/prepare-order-cancellation.json'), require('./schemas/input/prepare-order-cancellation.json'),
require('./schemas/input/prepare-settings.json'), require('./schemas/input/prepare-settings.json'),
require('./schemas/input/prepare-suspended-payment-creation.json'), require('./schemas/input/prepare-escrow-creation.json'),
require('./schemas/input/prepare-suspended-payment-cancellation.json'), require('./schemas/input/prepare-escrow-cancellation.json'),
require('./schemas/input/prepare-suspended-payment-execution.json'), require('./schemas/input/prepare-escrow-execution.json'),
require('./schemas/input/compute-ledger-hash.json'), require('./schemas/input/compute-ledger-hash.json'),
require('./schemas/input/sign.json'), require('./schemas/input/sign.json'),
require('./schemas/input/submit.json'), require('./schemas/input/submit.json'),

View File

@@ -1,18 +1,18 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"title": "prepareSuspendedPaymentCancellationParameters", "title": "prepareEscrowCancellationParameters",
"type": "object", "type": "object",
"properties": { "properties": {
"address": { "address": {
"$ref": "address", "$ref": "address",
"description": "The address of the account that is creating the transaction." "description": "The address of the account that is creating the transaction."
}, },
"suspendedPaymentCancellation": { "escrowCancellation": {
"$ref": "suspendedPaymentCancellation", "$ref": "escrowCancellation",
"description": "The specification of the suspended payment cancellation to prepare." "description": "The specification of the escrow cancellation to prepare."
}, },
"instructions": {"$ref": "instructions"} "instructions": {"$ref": "instructions"}
}, },
"additionalProperties": false, "additionalProperties": false,
"required": ["address", "suspendedPaymentCancellation"] "required": ["address", "escrowCancellation"]
} }

View File

@@ -1,18 +1,18 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"title": "prepareSuspendedPaymentCreationParameters", "title": "prepareEscrowCreationParameters",
"type": "object", "type": "object",
"properties": { "properties": {
"address": { "address": {
"$ref": "address", "$ref": "address",
"description": "The address of the account that is creating the transaction." "description": "The address of the account that is creating the transaction."
}, },
"suspendedPaymentCreation": { "escrowCreation": {
"$ref": "suspendedPaymentCreation", "$ref": "escrowCreation",
"description": "The specification of the suspended payment creation to prepare." "description": "The specification of the escrow creation to prepare."
}, },
"instructions": {"$ref": "instructions"} "instructions": {"$ref": "instructions"}
}, },
"additionalProperties": false, "additionalProperties": false,
"required": ["address", "suspendedPaymentCreation"] "required": ["address", "escrowCreation"]
} }

View File

@@ -1,18 +1,18 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"title": "prepareSuspendedPaymentExecutionParameters", "title": "prepareEscrowExecutionParameters",
"type": "object", "type": "object",
"properties": { "properties": {
"address": { "address": {
"$ref": "address", "$ref": "address",
"description": "The address of the account that is creating the transaction." "description": "The address of the account that is creating the transaction."
}, },
"suspendedPaymentExecution": { "escrowExecution": {
"$ref": "suspendedPaymentExecution", "$ref": "escrowExecution",
"description": "The specification of the suspended payment execution to prepare." "description": "The specification of the escrow execution to prepare."
}, },
"instructions": {"$ref": "instructions"} "instructions": {"$ref": "instructions"}
}, },
"additionalProperties": false, "additionalProperties": false,
"required": ["address", "suspendedPaymentExecution"] "required": ["address", "escrowExecution"]
} }

View File

@@ -5,6 +5,6 @@
"description": "The type of the transaction.", "description": "The type of the transaction.",
"type": "string", "type": "string",
"enum": ["payment", "order", "orderCancellation", "trustline", "settings", "enum": ["payment", "order", "orderCancellation", "trustline", "settings",
"suspendedPaymentCreation", "suspendedPaymentCancellation", "escrowCreation", "escrowCancellation",
"suspendedPaymentExecution"] "escrowExecution"]
} }

View File

@@ -59,20 +59,20 @@
}, },
{ {
"properties": { "properties": {
"type": {"enum": ["suspendedPaymentCreation"]}, "type": {"enum": ["escrowCreation"]},
"specification": {"$ref": "suspendedPaymentCreation"} "specification": {"$ref": "escrowCreation"}
} }
}, },
{ {
"properties": { "properties": {
"type": {"enum": ["suspendedPaymentCancellation"]}, "type": {"enum": ["escrowCancellation"]},
"specification": {"$ref": "suspendedPaymentCancellation"} "specification": {"$ref": "escrowCancellation"}
} }
}, },
{ {
"properties": { "properties": {
"type": {"enum": ["suspendedPaymentExecution"]}, "type": {"enum": ["escrowExecution"]},
"specification": {"$ref": "suspendedPaymentExecution"} "specification": {"$ref": "escrowExecution"}
} }
} }
] ]

View File

@@ -1,19 +1,19 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"title": "suspendedPaymentCancellation", "title": "escrowCancellation",
"link": "suspended-payment-cancellation", "link": "escrow-cancellation",
"type": "object", "type": "object",
"properties": { "properties": {
"memos": {"$ref": "memos"}, "memos": {"$ref": "memos"},
"owner": { "owner": {
"$ref": "address", "$ref": "address",
"description": "The address of the owner of the suspended payment to cancel." "description": "The address of the owner of the escrow to cancel."
}, },
"suspensionSequence": { "escrowSequence": {
"$ref": "sequence", "$ref": "sequence",
"description": "The [account sequence number](#account-sequence-number) of the [Suspended Payment Creation](#suspended-payment-creation) transaction for the suspended payment to cancel." "description": "The [account sequence number](#account-sequence-number) of the [Escrow Creation](#escrow-creation) transaction for the escrow to cancel."
} }
}, },
"required": ["owner", "suspensionSequence"], "required": ["owner", "escrowSequence"],
"additionalProperties": false "additionalProperties": false
} }

View File

@@ -1,7 +1,7 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"title": "suspendedPaymentCreation", "title": "escrowCreation",
"link": "suspended-payment-creation", "link": "escrow-creation",
"type": "object", "type": "object",
"properties": { "properties": {
"source": { "source": {
@@ -13,19 +13,19 @@
"description": "Fields pertaining to the destination of the payment." "description": "Fields pertaining to the destination of the payment."
}, },
"memos": {"$ref": "memos"}, "memos": {"$ref": "memos"},
"digest": { "condition": {
"$ref": "hash256", "$ref": "hash256",
"description": "If present, proof is required upon execution." "description": "If present, fulfillment is required upon execution."
}, },
"allowCancelAfter": { "allowCancelAfter": {
"type": "string", "type": "string",
"format": "date-time", "format": "date-time",
"description": "If present, the suspended payment may be cancelled after this time." "description": "If present, the escrow may be cancelled after this time."
}, },
"allowExecuteAfter": { "allowExecuteAfter": {
"type": "string", "type": "string",
"format": "date-time", "format": "date-time",
"description": "If present, the suspended payment can not be executed before this time." "description": "If present, the escrow can not be executed before this time."
} }
}, },
"required": ["source", "destination"], "required": ["source", "destination"],

View File

@@ -1,34 +1,28 @@
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"title": "suspendedPaymentExecution", "title": "escrowExecution",
"link": "suspended-payment-execution", "link": "escrow-execution",
"type": "object", "type": "object",
"properties": { "properties": {
"memos": {"$ref": "memos"}, "memos": {"$ref": "memos"},
"owner": { "owner": {
"$ref": "address", "$ref": "address",
"description": "The address of the owner of the suspended payment to execute." "description": "The address of the owner of the escrow to execute."
}, },
"suspensionSequence": { "escrowSequence": {
"$ref": "sequence", "$ref": "sequence",
"description": "The [account sequence number](#account-sequence-number) of the [Suspended Payment Creation](#suspended-payment-creation) transaction for the suspended payment to execute." "description": "The [account sequence number](#account-sequence-number) of the [Escrow Creation](#escrow-creation) transaction for the escrow to execute."
}, },
"method": { "condition": {
"type": "integer",
"minimum": 0,
"maximum": 255,
"description": "The method for verifying the proof; only method `1` is supported."
},
"digest": {
"$ref": "hash256", "$ref": "hash256",
"description": "The original `digest` from the suspended payment creation transaction. This is sha256 hash of `proof` string. It is replicated here so that the relatively expensive hashing operation can be delegated to a server without ledger history and the server with ledger history only has to do a quick comparison of the old digest with the new digest." "description": "The original `condition` from the escrow creation transaction. This is sha256 hash of `fulfillment` string. It is replicated here so that the relatively expensive hashing operation can be delegated to a server without ledger history and the server with ledger history only has to do a quick comparison of the old condition with the new condition."
}, },
"proof": { "fulfillment": {
"type": "string", "type": "string",
"description": "A value that produces the digest when hashed. It must be 32 charaters long and contain only 8-bit characters.", "description": "A value that produces the condition when hashed. It must be 32 charaters long and contain only 8-bit characters.",
"pattern": "^[\\x00-\\xFF]{32}$" "pattern": "^[\\x00-\\xFF]{32}$"
} }
}, },
"required": ["owner", "suspensionSequence"], "required": ["owner", "escrowSequence"],
"additionalProperties": false "additionalProperties": false
} }

View File

@@ -40,12 +40,12 @@ module.exports = {
_.partial(schemaValidate, 'prepareOrderCancellationParameters'), _.partial(schemaValidate, 'prepareOrderCancellationParameters'),
prepareTrustline: _.partial(schemaValidate, 'prepareTrustlineParameters'), prepareTrustline: _.partial(schemaValidate, 'prepareTrustlineParameters'),
prepareSettings: _.partial(schemaValidate, 'prepareSettingsParameters'), prepareSettings: _.partial(schemaValidate, 'prepareSettingsParameters'),
prepareSuspendedPaymentCreation: _.partial(schemaValidate, prepareEscrowCreation: _.partial(schemaValidate,
'prepareSuspendedPaymentCreationParameters'), 'prepareEscrowCreationParameters'),
prepareSuspendedPaymentCancellation: _.partial(schemaValidate, prepareEscrowCancellation: _.partial(schemaValidate,
'prepareSuspendedPaymentCancellationParameters'), 'prepareEscrowCancellationParameters'),
prepareSuspendedPaymentExecution: _.partial(schemaValidate, prepareEscrowExecution: _.partial(schemaValidate,
'prepareSuspendedPaymentExecutionParameters'), 'prepareEscrowExecutionParameters'),
sign: _.partial(schemaValidate, 'signParameters'), sign: _.partial(schemaValidate, 'signParameters'),
combine: _.partial(schemaValidate, 'combineParameters'), combine: _.partial(schemaValidate, 'combineParameters'),
submit: _.partial(schemaValidate, 'submitParameters'), submit: _.partial(schemaValidate, 'submitParameters'),

View File

@@ -3,14 +3,14 @@
const assert = require('assert') const assert = require('assert')
const utils = require('./utils') const utils = require('./utils')
function parseSuspendedPaymentCancellation(tx: Object): Object { function parseEscrowCancellation(tx: Object): Object {
assert(tx.TransactionType === 'SuspendedPaymentCancel') assert(tx.TransactionType === 'EscrowCancel')
return utils.removeUndefined({ return utils.removeUndefined({
memos: utils.parseMemos(tx), memos: utils.parseMemos(tx),
owner: tx.Owner, owner: tx.Owner,
suspensionSequence: tx.OfferSequence escrowSequence: tx.OfferSequence
}) })
} }
module.exports = parseSuspendedPaymentCancellation module.exports = parseEscrowCancellation

View File

@@ -10,8 +10,8 @@ function removeGenericCounterparty(amount, address) {
_.omit(amount, 'counterparty') : amount _.omit(amount, 'counterparty') : amount
} }
function parseSuspendedPaymentCreation(tx: Object): Object { function parseEscrowCreation(tx: Object): Object {
assert(tx.TransactionType === 'SuspendedPaymentCreate') assert(tx.TransactionType === 'EscrowCreate')
const source = { const source = {
address: tx.Account, address: tx.Account,
@@ -30,10 +30,10 @@ function parseSuspendedPaymentCreation(tx: Object): Object {
source: utils.removeUndefined(source), source: utils.removeUndefined(source),
destination: utils.removeUndefined(destination), destination: utils.removeUndefined(destination),
memos: utils.parseMemos(tx), memos: utils.parseMemos(tx),
digest: tx.Digest, condition: tx.Condition,
allowCancelAfter: utils.parseTimestamp(tx.CancelAfter), allowCancelAfter: utils.parseTimestamp(tx.CancelAfter),
allowExecuteAfter: utils.parseTimestamp(tx.FinishAfter) allowExecuteAfter: utils.parseTimestamp(tx.FinishAfter)
}) })
} }
module.exports = parseSuspendedPaymentCreation module.exports = parseEscrowCreation

View File

@@ -3,17 +3,16 @@
const assert = require('assert') const assert = require('assert')
const utils = require('./utils') const utils = require('./utils')
function parseSuspendedPaymentExecution(tx: Object): Object { function parseEscrowExecution(tx: Object): Object {
assert(tx.TransactionType === 'SuspendedPaymentFinish') assert(tx.TransactionType === 'EscrowFinish')
return utils.removeUndefined({ return utils.removeUndefined({
memos: utils.parseMemos(tx), memos: utils.parseMemos(tx),
owner: tx.Owner, owner: tx.Owner,
suspensionSequence: tx.OfferSequence, escrowSequence: tx.OfferSequence,
method: tx.Method, condition: tx.Condition,
digest: tx.Digest, fulfillment: tx.Fulfillment ? utils.hexToString(tx.Fulfillment) : undefined
proof: tx.Proof ? utils.hexToString(tx.Proof) : undefined
}) })
} }
module.exports = parseSuspendedPaymentExecution module.exports = parseEscrowExecution

View File

@@ -7,10 +7,9 @@ const parseTrustline = require('./trustline')
const parseOrder = require('./order') const parseOrder = require('./order')
const parseOrderCancellation = require('./cancellation') const parseOrderCancellation = require('./cancellation')
const parseSettings = require('./settings') const parseSettings = require('./settings')
const parseSuspendedPaymentCreation = require('./suspended-payment-creation') const parseEscrowCreation = require('./escrow-creation')
const parseSuspendedPaymentExecution = require('./suspended-payment-execution') const parseEscrowExecution = require('./escrow-execution')
const parseSuspendedPaymentCancellation = const parseEscrowCancellation = require('./escrow-cancellation')
require('./suspended-payment-cancellation')
const parseFeeUpdate = require('./fee-update') const parseFeeUpdate = require('./fee-update')
const parseAmendment = require('./amendment') const parseAmendment = require('./amendment')
@@ -22,9 +21,9 @@ function parseTransactionType(type) {
OfferCancel: 'orderCancellation', OfferCancel: 'orderCancellation',
AccountSet: 'settings', AccountSet: 'settings',
SetRegularKey: 'settings', SetRegularKey: 'settings',
SuspendedPaymentCreate: 'suspendedPaymentCreation', EscrowCreate: 'escrowCreation',
SuspendedPaymentFinish: 'suspendedPaymentExecution', EscrowFinish: 'escrowExecution',
SuspendedPaymentCancel: 'suspendedPaymentCancellation', EscrowCancel: 'escrowCancellation',
SignerListSet: 'settings', SignerListSet: 'settings',
SetFee: 'feeUpdate', // pseudo-transaction SetFee: 'feeUpdate', // pseudo-transaction
EnableAmendment: 'amendment' // pseudo-transaction EnableAmendment: 'amendment' // pseudo-transaction
@@ -40,9 +39,9 @@ function parseTransaction(tx: Object): Object {
'order': parseOrder, 'order': parseOrder,
'orderCancellation': parseOrderCancellation, 'orderCancellation': parseOrderCancellation,
'settings': parseSettings, 'settings': parseSettings,
'suspendedPaymentCreation': parseSuspendedPaymentCreation, 'escrowCreation': parseEscrowCreation,
'suspendedPaymentExecution': parseSuspendedPaymentExecution, 'escrowExecution': parseEscrowExecution,
'suspendedPaymentCancellation': parseSuspendedPaymentCancellation, 'escrowCancellation': parseEscrowCancellation,
'feeUpdate': parseFeeUpdate, 'feeUpdate': parseFeeUpdate,
'amendment': parseAmendment 'amendment': parseAmendment
} }

View File

@@ -6,20 +6,20 @@ const validate = utils.common.validate
import type {Instructions, Prepare} from './types.js' import type {Instructions, Prepare} from './types.js'
import type {Memo} from '../common/types.js' import type {Memo} from '../common/types.js'
type SuspendedPaymentCancellation = { type EscrowCancellation = {
owner: string, owner: string,
suspensionSequence: number, escrowSequence: number,
memos?: Array<Memo> memos?: Array<Memo>
} }
function createSuspendedPaymentCancellationTransaction(account: string, function createEscrowCancellationTransaction(account: string,
payment: SuspendedPaymentCancellation payment: EscrowCancellation
): Object { ): Object {
const txJSON: Object = { const txJSON: Object = {
TransactionType: 'SuspendedPaymentCancel', TransactionType: 'EscrowCancel',
Account: account, Account: account,
Owner: payment.owner, Owner: payment.owner,
OfferSequence: payment.suspensionSequence OfferSequence: payment.escrowSequence
} }
if (payment.memos !== undefined) { if (payment.memos !== undefined) {
txJSON.Memos = _.map(payment.memos, utils.convertMemo) txJSON.Memos = _.map(payment.memos, utils.convertMemo)
@@ -27,15 +27,15 @@ function createSuspendedPaymentCancellationTransaction(account: string,
return txJSON return txJSON
} }
function prepareSuspendedPaymentCancellation(address: string, function prepareEscrowCancellation(address: string,
suspendedPaymentCancellation: SuspendedPaymentCancellation, escrowCancellation: EscrowCancellation,
instructions: Instructions = {} instructions: Instructions = {}
): Promise<Prepare> { ): Promise<Prepare> {
validate.prepareSuspendedPaymentCancellation( validate.prepareEscrowCancellation(
{address, suspendedPaymentCancellation, instructions}) {address, escrowCancellation, instructions})
const txJSON = createSuspendedPaymentCancellationTransaction( const txJSON = createEscrowCancellationTransaction(
address, suspendedPaymentCancellation) address, escrowCancellation)
return utils.prepareTransaction(txJSON, this, instructions) return utils.prepareTransaction(txJSON, this, instructions)
} }
module.exports = prepareSuspendedPaymentCancellation module.exports = prepareEscrowCancellation

View File

@@ -6,27 +6,27 @@ const {validate, iso8601ToRippleTime, toRippledAmount} = utils.common
import type {Instructions, Prepare} from './types.js' import type {Instructions, Prepare} from './types.js'
import type {Adjustment, MaxAdjustment, Memo} from '../common/types.js' import type {Adjustment, MaxAdjustment, Memo} from '../common/types.js'
type SuspendedPaymentCreation = { type EscrowCreation = {
source: MaxAdjustment, source: MaxAdjustment,
destination: Adjustment, destination: Adjustment,
memos?: Array<Memo>, memos?: Array<Memo>,
digest?: string, condition?: string,
allowCancelAfter?: string, allowCancelAfter?: string,
allowExecuteAfter?: string allowExecuteAfter?: string
} }
function createSuspendedPaymentCreationTransaction(account: string, function createEscrowCreationTransaction(account: string,
payment: SuspendedPaymentCreation payment: EscrowCreation
): Object { ): Object {
const txJSON: Object = { const txJSON: Object = {
TransactionType: 'SuspendedPaymentCreate', TransactionType: 'EscrowCreate',
Account: account, Account: account,
Destination: payment.destination.address, Destination: payment.destination.address,
Amount: toRippledAmount(payment.destination.amount) Amount: toRippledAmount(payment.destination.amount)
} }
if (payment.digest !== undefined) { if (payment.condition !== undefined) {
txJSON.Digest = payment.digest txJSON.Condition = payment.condition
} }
if (payment.allowCancelAfter !== undefined) { if (payment.allowCancelAfter !== undefined) {
txJSON.CancelAfter = iso8601ToRippleTime(payment.allowCancelAfter) txJSON.CancelAfter = iso8601ToRippleTime(payment.allowCancelAfter)
@@ -43,18 +43,23 @@ function createSuspendedPaymentCreationTransaction(account: string,
if (payment.memos !== undefined) { if (payment.memos !== undefined) {
txJSON.Memos = _.map(payment.memos, utils.convertMemo) txJSON.Memos = _.map(payment.memos, utils.convertMemo)
} }
if (Boolean(payment.allowCancelAfter) && Boolean(payment.allowExecuteAfter) &&
payment.CancelAfter <= payment.FinishAfter) {
throw new ValidationError('"CancelAfter" must be after "FinishAfter" on'
+ ' EscrowCreate.')
}
return txJSON return txJSON
} }
function prepareSuspendedPaymentCreation(address: string, function prepareEscrowCreation(address: string,
suspendedPaymentCreation: SuspendedPaymentCreation, escrowCreation: EscrowCreation,
instructions: Instructions = {} instructions: Instructions = {}
): Promise<Prepare> { ): Promise<Prepare> {
validate.prepareSuspendedPaymentCreation( validate.prepareEscrowCreation(
{address, suspendedPaymentCreation, instructions}) {address, escrowCreation, instructions})
const txJSON = createSuspendedPaymentCreationTransaction( const txJSON = createEscrowCreationTransaction(
address, suspendedPaymentCreation) address, escrowCreation)
return utils.prepareTransaction(txJSON, this, instructions) return utils.prepareTransaction(txJSON, this, instructions)
} }
module.exports = prepareSuspendedPaymentCreation module.exports = prepareEscrowCreation

View File

@@ -6,33 +6,34 @@ const validate = utils.common.validate
import type {Instructions, Prepare} from './types.js' import type {Instructions, Prepare} from './types.js'
import type {Memo} from '../common/types.js' import type {Memo} from '../common/types.js'
type SuspendedPaymentExecution = { type EscrowExecution = {
owner: string, owner: string,
suspensionSequence: number, escrowSequence: number,
memos?: Array<Memo>, memos?: Array<Memo>,
method?: number, condition?: string,
digest?: string, fulfillment?: string
proof?: string
} }
function createSuspendedPaymentExecutionTransaction(account: string, function createEscrowExecutionTransaction(account: string,
payment: SuspendedPaymentExecution payment: EscrowExecution
): Object { ): Object {
const txJSON: Object = { const txJSON: Object = {
TransactionType: 'SuspendedPaymentFinish', TransactionType: 'EscrowFinish',
Account: account, Account: account,
Owner: payment.owner, Owner: payment.owner,
OfferSequence: payment.suspensionSequence OfferSequence: payment.escrowSequence
} }
if (payment.method !== undefined) { if (Boolean(payment.condition) !== Boolean(payment.fulfillment)) {
txJSON.Method = payment.method throw new ValidationError('"condition" and "fulfillment" fields on'
+ ' EscrowFinish must only be specified together.')
} }
if (payment.digest !== undefined) {
txJSON.Digest = payment.digest if (payment.condition !== undefined) {
txJSON.Condition = payment.condition
} }
if (payment.proof !== undefined) { if (payment.fulfillment !== undefined) {
txJSON.Proof = utils.convertStringToHex(payment.proof) txJSON.Fulfillment = utils.convertStringToHex(payment.fulfillment)
} }
if (payment.memos !== undefined) { if (payment.memos !== undefined) {
txJSON.Memos = _.map(payment.memos, utils.convertMemo) txJSON.Memos = _.map(payment.memos, utils.convertMemo)
@@ -40,15 +41,15 @@ function createSuspendedPaymentExecutionTransaction(account: string,
return txJSON return txJSON
} }
function prepareSuspendedPaymentExecution(address: string, function prepareEscrowExecution(address: string,
suspendedPaymentExecution: SuspendedPaymentExecution, escrowExecution: EscrowExecution,
instructions: Instructions = {} instructions: Instructions = {}
): Promise<Prepare> { ): Promise<Prepare> {
validate.prepareSuspendedPaymentExecution( validate.prepareEscrowExecution(
{address, suspendedPaymentExecution, instructions}) {address, escrowExecution, instructions})
const txJSON = createSuspendedPaymentExecutionTransaction( const txJSON = createEscrowExecutionTransaction(
address, suspendedPaymentExecution) address, escrowExecution)
return utils.prepareTransaction(txJSON, this, instructions) return utils.prepareTransaction(txJSON, this, instructions)
} }
module.exports = prepareSuspendedPaymentExecution module.exports = prepareEscrowExecution

View File

@@ -11,7 +11,7 @@ function isImmediateRejection(engineResult: string): boolean {
// transaction and then process it at a later time, for example // transaction and then process it at a later time, for example
// if the required fee changes (this does not occur at the time of // if the required fee changes (this does not occur at the time of
// this writing, but it could change in the future) // this writing, but it could change in the future)
// all other error classes can potentially result in transcation validation // all other error classes can potentially result in transaction validation
return _.startsWith(engineResult, 'tem') return _.startsWith(engineResult, 'tem')
} }

View File

@@ -266,57 +266,57 @@ describe('RippleAPI', function() {
'prepare')); 'prepare'));
}); });
it('prepareSuspendedPaymentCreation', function() { it('prepareEscrowCreation', function() {
const localInstructions = _.defaults({ const localInstructions = _.defaults({
maxFee: '0.000012' maxFee: '0.000012'
}, instructions); }, instructions);
return this.api.prepareSuspendedPaymentCreation( return this.api.prepareEscrowCreation(
address, requests.prepareSuspendedPaymentCreation.normal, address, requests.prepareEscrowCreation.normal,
localInstructions).then( localInstructions).then(
_.partial(checkResult, responses.prepareSuspendedPaymentCreation.normal, _.partial(checkResult, responses.prepareEscrowCreation.normal,
'prepare')); 'prepare'));
}); });
it('prepareSuspendedPaymentCreation full', function() { it('prepareEscrowCreation full', function() {
return this.api.prepareSuspendedPaymentCreation( return this.api.prepareEscrowCreation(
address, requests.prepareSuspendedPaymentCreation.full).then( address, requests.prepareEscrowCreation.full).then(
_.partial(checkResult, responses.prepareSuspendedPaymentCreation.full, _.partial(checkResult, responses.prepareEscrowCreation.full,
'prepare')); 'prepare'));
}); });
it('prepareSuspendedPaymentExecution', function() { it('prepareEscrowExecution', function() {
return this.api.prepareSuspendedPaymentExecution( return this.api.prepareEscrowExecution(
address, address,
requests.prepareSuspendedPaymentExecution.normal, instructions).then( requests.prepareEscrowExecution.normal, instructions).then(
_.partial(checkResult, _.partial(checkResult,
responses.prepareSuspendedPaymentExecution.normal, responses.prepareEscrowExecution.normal,
'prepare')); 'prepare'));
}); });
it('prepareSuspendedPaymentExecution - simple', function() { it('prepareEscrowExecution - simple', function() {
return this.api.prepareSuspendedPaymentExecution( return this.api.prepareEscrowExecution(
address, address,
requests.prepareSuspendedPaymentExecution.simple).then( requests.prepareEscrowExecution.simple).then(
_.partial(checkResult, _.partial(checkResult,
responses.prepareSuspendedPaymentExecution.simple, responses.prepareEscrowExecution.simple,
'prepare')); 'prepare'));
}); });
it('prepareSuspendedPaymentCancellation', function() { it('prepareEscrowCancellation', function() {
return this.api.prepareSuspendedPaymentCancellation( return this.api.prepareEscrowCancellation(
address, address,
requests.prepareSuspendedPaymentCancellation.normal, instructions).then( requests.prepareEscrowCancellation.normal, instructions).then(
_.partial(checkResult, _.partial(checkResult,
responses.prepareSuspendedPaymentCancellation.normal, responses.prepareEscrowCancellation.normal,
'prepare')); 'prepare'));
}); });
it('prepareSuspendedPaymentCancellation with memos', function() { it('prepareEscrowCancellation with memos', function() {
return this.api.prepareSuspendedPaymentCancellation( return this.api.prepareEscrowCancellation(
address, address,
requests.prepareSuspendedPaymentCancellation.memos).then( requests.prepareEscrowCancellation.memos).then(
_.partial(checkResult, _.partial(checkResult,
responses.prepareSuspendedPaymentCancellation.memos, responses.prepareEscrowCancellation.memos,
'prepare')); 'prepare'));
}); });
@@ -336,10 +336,10 @@ describe('RippleAPI', function() {
}, /txJSON must not contain "TxnSignature" or "Signers" properties/); }, /txJSON must not contain "TxnSignature" or "Signers" properties/);
}); });
it('sign - SuspendedPaymentExecution', function() { it('sign - EscrowExecution', function() {
const secret = 'snoPBrXtMeMyMHUVTgbuqAfg1SUTb'; const secret = 'snoPBrXtMeMyMHUVTgbuqAfg1SUTb';
const result = this.api.sign(requests.sign.suspended.txJSON, secret); const result = this.api.sign(requests.sign.escrow.txJSON, secret);
assert.deepEqual(result, responses.sign.suspended); assert.deepEqual(result, responses.sign.escrow);
schemaValidator.schemaValidate('sign', result); schemaValidator.schemaValidate('sign', result);
}); });
@@ -640,34 +640,34 @@ describe('RippleAPI', function() {
}); });
}); });
it('getTransaction - SuspendedPaymentCreation', function() { it('getTransaction - EscrowCreation', function() {
const hash = const hash =
'144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1'; '144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1';
return this.api.getTransaction(hash).then( return this.api.getTransaction(hash).then(
_.partial(checkResult, _.partial(checkResult,
responses.getTransaction.suspendedPaymentCreation, responses.getTransaction.escrowCreation,
'getTransaction')); 'getTransaction'));
}); });
it('getTransaction - SuspendedPaymentCreation iou', function() { it('getTransaction - EscrowCreation iou', function() {
const hash = const hash =
'144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE2'; '144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE2';
return this.api.getTransaction(hash).then( return this.api.getTransaction(hash).then(
_.partial(checkResult, _.partial(checkResult,
responses.getTransaction.SuspendedPaymentCreationIOU, responses.getTransaction.EscrowCreationIOU,
'getTransaction')); 'getTransaction'));
}); });
it('getTransaction - SuspendedPaymentCancellation', function() { it('getTransaction - EscrowCancellation', function() {
const hash = const hash =
'F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22'; 'F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22';
return this.api.getTransaction(hash).then( return this.api.getTransaction(hash).then(
_.partial(checkResult, _.partial(checkResult,
responses.getTransaction.suspendedPaymentCancellation, responses.getTransaction.escrowCancellation,
'getTransaction')); 'getTransaction'));
}); });
it('getTransaction - SuspendedPaymentExecution', function() { it('getTransaction - EscrowExecution', function() {
const options = { const options = {
minLedgerVersion: 10, minLedgerVersion: 10,
maxLedgerVersion: 15 maxLedgerVersion: 15
@@ -676,16 +676,16 @@ describe('RippleAPI', function() {
'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B'; 'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B';
return this.api.getTransaction(hash, options).then( return this.api.getTransaction(hash, options).then(
_.partial(checkResult, _.partial(checkResult,
responses.getTransaction.suspendedPaymentExecution, responses.getTransaction.escrowExecution,
'getTransaction')); 'getTransaction'));
}); });
it('getTransaction - SuspendedPaymentExecution simple', function() { it('getTransaction - EscrowExecution simple', function() {
const hash = const hash =
'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD1369931'; 'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD1369931';
return this.api.getTransaction(hash).then( return this.api.getTransaction(hash).then(
_.partial(checkResult, _.partial(checkResult,
responses.getTransaction.suspendedPaymentExecutionSimple, responses.getTransaction.escrowExecutionSimple,
'getTransaction')); 'getTransaction'));
}); });

View File

@@ -24,17 +24,17 @@ module.exports = {
domain: require('./prepare-settings'), domain: require('./prepare-settings'),
signers: require('./prepare-settings-signers') signers: require('./prepare-settings-signers')
}, },
prepareSuspendedPaymentCreation: { prepareEscrowCreation: {
normal: require('./prepare-suspended-payment-creation'), normal: require('./prepare-escrow-creation'),
full: require('./prepare-suspended-payment-creation-full') full: require('./prepare-escrow-creation-full')
}, },
prepareSuspendedPaymentExecution: { prepareEscrowExecution: {
normal: require('./prepare-suspended-payment-execution'), normal: require('./prepare-escrow-execution'),
simple: require('./prepare-suspended-payment-execution-simple') simple: require('./prepare-escrow-execution-simple')
}, },
prepareSuspendedPaymentCancellation: { prepareEscrowCancellation: {
normal: require('./prepare-suspended-payment-cancellation'), normal: require('./prepare-escrow-cancellation'),
memos: require('./prepare-suspended-payment-cancellation-memos') memos: require('./prepare-escrow-cancellation-memos')
}, },
prepareTrustline: { prepareTrustline: {
simple: require('./prepare-trustline-simple'), simple: require('./prepare-trustline-simple'),
@@ -43,7 +43,7 @@ module.exports = {
}, },
sign: { sign: {
normal: require('./sign'), normal: require('./sign'),
suspended: require('./sign-suspended.json'), escrow: require('./sign-escrow.json'),
signAs: require('./sign-as') signAs: require('./sign-as')
}, },
getPaths: { getPaths: {

View File

@@ -1,6 +1,6 @@
{ {
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"suspensionSequence": 1234, "escrowSequence": 1234,
"memos": [ "memos": [
{ {
"type": "test", "type": "test",

View File

@@ -1,4 +1,4 @@
{ {
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"suspensionSequence": 1234 "escrowSequence": 1234
} }

View File

@@ -17,7 +17,7 @@
}, },
"tag": 2 "tag": 2
}, },
"digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", "condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
"allowExecuteAfter": "2014-09-24T21:21:50.000Z", "allowExecuteAfter": "2014-09-24T21:21:50.000Z",
"memos": [ "memos": [
{ {

View File

@@ -1,6 +1,6 @@
{ {
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"suspensionSequence": 1234, "escrowSequence": 1234,
"memos": [ "memos": [
{ {
"type": "test", "type": "test",

View File

@@ -1,7 +1,6 @@
{ {
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"suspensionSequence": 1234, "escrowSequence": 1234,
"method": 1, "condition": "712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D",
"digest": "712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D", "fulfillment": "this must have 32 characters...."
"proof": "this must have 32 characters...."
} }

View File

@@ -1,5 +1,5 @@
{ {
"txJSON": "{\"TransactionType\":\"EscrowFinish\",\"Account\":\"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\"Owner\":\"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\"OfferSequence\":2,\"Method\":1,\"Digest\":\"712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D\",\"Proof\":\"74686973206D757374206861766520333220636861726163746572732E2E2E2E\",\"Flags\":2147483648,\"LastLedgerSequence\":102,\"Fee\":\"12\",\"Sequence\":1}", "txJSON": "{\"TransactionType\":\"EscrowFinish\",\"Account\":\"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\"Owner\":\"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\"OfferSequence\":2,\"Condition\":\"712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D\",\"Fulfillment\":\"74686973206D757374206861766520333220636861726163746572732E2E2E2E\",\"Flags\":2147483648,\"LastLedgerSequence\":102,\"Fee\":\"12\",\"Sequence\":1}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 1, "sequence": 1,

View File

@@ -1,11 +1,11 @@
{ {
"type": "suspendedPaymentCancellation", "type": "escrowCancellation",
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"sequence": 9, "sequence": 9,
"id": "F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22", "id": "F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22",
"specification": { "specification": {
"owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"suspensionSequence": 7 "escrowSequence": 7
}, },
"outcome": { "outcome": {
"result": "tesSUCCESS", "result": "tesSUCCESS",

View File

@@ -1,5 +1,5 @@
{ {
"type": "suspendedPaymentCreation", "type": "escrowCreation",
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"sequence": 10, "sequence": 10,
"id": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE2", "id": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE2",
@@ -28,7 +28,7 @@
"data": "mema data" "data": "mema data"
} }
], ],
"digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", "condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
"allowCancelAfter": "2015-11-16T06:53:42.000Z", "allowCancelAfter": "2015-11-16T06:53:42.000Z",
"allowExecuteAfter": "2015-11-16T06:47:42.000Z" "allowExecuteAfter": "2015-11-16T06:47:42.000Z"
}, },

View File

@@ -1,5 +1,5 @@
{ {
"type": "suspendedPaymentCreation", "type": "escrowCreation",
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"sequence": 10, "sequence": 10,
"id": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1", "id": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1",
@@ -27,7 +27,7 @@
"data": "mema data" "data": "mema data"
} }
], ],
"digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", "condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
"allowCancelAfter": "2015-11-16T06:53:42.000Z", "allowCancelAfter": "2015-11-16T06:53:42.000Z",
"allowExecuteAfter": "2015-11-16T06:47:42.000Z" "allowExecuteAfter": "2015-11-16T06:47:42.000Z"
}, },

View File

@@ -1,13 +1,12 @@
{ {
"type": "suspendedPaymentExecution", "type": "escrowExecution",
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"sequence": 6, "sequence": 6,
"id": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD1369931", "id": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD1369931",
"specification": { "specification": {
"owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"suspensionSequence": 5, "escrowSequence": 5,
"method": 1, "condition": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1"
"digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1"
}, },
"outcome": { "outcome": {
"result": "tesSUCCESS", "result": "tesSUCCESS",

View File

@@ -1,14 +1,13 @@
{ {
"type": "suspendedPaymentExecution", "type": "escrowExecution",
"address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "address": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"sequence": 6, "sequence": 6,
"id": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B", "id": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B",
"specification": { "specification": {
"owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"suspensionSequence": 5, "escrowSequence": 5,
"method": 1, "condition": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1",
"digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1", "fulfillment": "whateverthis bemusthave 32 chars"
"proof": "whateverthis bemusthave 32 chars"
}, },
"outcome": { "outcome": {
"result": "tesSUCCESS", "result": "tesSUCCESS",

View File

@@ -34,16 +34,16 @@ module.exports = {
trustlineFrozenOff: require('./get-transaction-trust-set-frozen-off.json'), trustlineFrozenOff: require('./get-transaction-trust-set-frozen-off.json'),
trustlineNoQuality: require('./get-transaction-trust-no-quality.json'), trustlineNoQuality: require('./get-transaction-trust-no-quality.json'),
notValidated: require('./get-transaction-not-validated.json'), notValidated: require('./get-transaction-not-validated.json'),
suspendedPaymentCreation: escrowCreation:
require('./get-transaction-suspended-payment-create.json'), require('./get-transaction-escrow-create.json'),
SuspendedPaymentCreationIOU: EscrowCreationIOU:
require('./get-transaction-suspended-payment-create-iou.json'), require('./get-transaction-escrow-create-iou.json'),
suspendedPaymentCancellation: escrowCancellation:
require('./get-transaction-suspended-payment-cancellation.json'), require('./get-transaction-escrow-cancellation.json'),
suspendedPaymentExecution: escrowExecution:
require('./get-transaction-suspended-payment-execution.json'), require('./get-transaction-escrow-execution.json'),
suspendedPaymentExecutionSimple: escrowExecutionSimple:
require('./get-transaction-suspended-payment-execution-simple.json'), require('./get-transaction-escrow-execution-simple.json'),
amendment: require('./get-transaction-amendment.json'), amendment: require('./get-transaction-amendment.json'),
feeUpdate: require('./get-transaction-fee-update.json') feeUpdate: require('./get-transaction-fee-update.json')
}, },
@@ -95,17 +95,17 @@ module.exports = {
noMaxLedgerVersion: require('./prepare-settings-no-maxledgerversion.json'), noMaxLedgerVersion: require('./prepare-settings-no-maxledgerversion.json'),
signers: require('./prepare-settings-signers.json') signers: require('./prepare-settings-signers.json')
}, },
prepareSuspendedPaymentCreation: { prepareEscrowCreation: {
normal: require('./prepare-suspended-payment-creation'), normal: require('./prepare-escrow-creation'),
full: require('./prepare-suspended-payment-creation-full') full: require('./prepare-escrow-creation-full')
}, },
prepareSuspendedPaymentExecution: { prepareEscrowExecution: {
normal: require('./prepare-suspended-payment-execution'), normal: require('./prepare-escrow-execution'),
simple: require('./prepare-suspended-payment-execution-simple') simple: require('./prepare-escrow-execution-simple')
}, },
prepareSuspendedPaymentCancellation: { prepareEscrowCancellation: {
normal: require('./prepare-suspended-payment-cancellation'), normal: require('./prepare-escrow-cancellation'),
memos: require('./prepare-suspended-payment-cancellation-memos') memos: require('./prepare-escrow-cancellation-memos')
}, },
prepareTrustline: { prepareTrustline: {
simple: require('./prepare-trustline-simple.json'), simple: require('./prepare-trustline-simple.json'),
@@ -114,7 +114,7 @@ module.exports = {
}, },
sign: { sign: {
normal: require('./sign.json'), normal: require('./sign.json'),
suspended: require('./sign-suspended.json'), escrow: require('./sign-escrow.json'),
signAs: require('./sign-as') signAs: require('./sign-as')
}, },
combine: { combine: {

View File

@@ -1,5 +1,5 @@
{ {
"txJSON": "{\"TransactionType\":\"SuspendedPaymentCancel\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\",\"MemoFormat\":\"706C61696E2F74657874\"}}],\"Flags\":2147483648,\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"TransactionType\":\"EscrowCancel\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\",\"MemoFormat\":\"706C61696E2F74657874\"}}],\"Flags\":2147483648,\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,

View File

@@ -1,5 +1,5 @@
{ {
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"SuspendedPaymentCancel\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"EscrowCancel\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,

View File

@@ -1,5 +1,5 @@
{ {
"txJSON": "{\"TransactionType\":\"SuspendedPaymentCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"value\":\"0.01\"},\"Digest\":\"8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4\",\"FinishAfter\":464908910,\"SourceTag\":1,\"DestinationTag\":2,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\"}}],\"Flags\":2147483648,\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"TransactionType\":\"EscrowCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"Amount\":{\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\",\"value\":\"0.01\"},\"Condition\":\"8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4\",\"FinishAfter\":464908910,\"SourceTag\":1,\"DestinationTag\":2,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\"}}],\"Flags\":2147483648,\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,

View File

@@ -1,5 +1,5 @@
{ {
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"SuspendedPaymentCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"Amount\":{\"value\":\"0.01\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"},\"CancelAfter\":464908910,\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"EscrowCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Destination\":\"rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo\",\"Amount\":{\"value\":\"0.01\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"},\"CancelAfter\":464908910,\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,

View File

@@ -1,5 +1,5 @@
{ {
"txJSON": "{\"TransactionType\":\"SuspendedPaymentFinish\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\",\"MemoFormat\":\"706C61696E2F74657874\"}}],\"Flags\":2147483648,\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"TransactionType\":\"EscrowFinish\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Memos\":[{\"Memo\":{\"MemoData\":\"7465787465642064617461\",\"MemoType\":\"74657374\",\"MemoFormat\":\"706C61696E2F74657874\"}}],\"Flags\":2147483648,\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,

View File

@@ -1,5 +1,5 @@
{ {
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"SuspendedPaymentFinish\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Method\":1,\"Digest\":\"712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D\",\"Proof\":\"74686973206D757374206861766520333220636861726163746572732E2E2E2E\",\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}", "txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"EscrowFinish\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Owner\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"OfferSequence\":1234,\"Condition\":\"712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D\",\"Fulfillment\":\"74686973206D757374206861766520333220636861726163746572732E2E2E2E\",\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": { "instructions": {
"fee": "0.000012", "fee": "0.000012",
"sequence": 23, "sequence": 23,

View File

@@ -1,4 +1,4 @@
{ {
"signedTransaction": "12000222800000002400000001201900000002201B000000665015712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D68400000000000000C73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100E1DAAD071DC0E556FEC472E0C6CABBAB064901D97FEAD61CA9990DCC17326FFC022051DF3331D340B3E635024D7B9684602EFDEE2D178AAC9E4824722B4DAB6036718114B5F762798A53D543A014CAF8B297CFF8F2F937E88214B5F762798A53D543A014CAF8B297CFF8F2F937E8021001", "signedTransaction": "12000222800000002400000001201900000002201B0000006668400000000000000C73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD0207446304402205CDD40611008680E151EF6C5C70A6DFBF7977DE73800E04F1B6F1FE8688BBE3E022075DB3990E6CBF0BCD990D92FA13E3D3F95510CA2CCBAB92BD2CE288FA6F2F34870102074686973206D757374206861766520333220636861726163746572732E2E2E2E701120712C36933822AD3A3D136C5DF97AA863B69F9CE88B2D6CE6BDD11BFDE290C19D8114B5F762798A53D543A014CAF8B297CFF8F2F937E88214B5F762798A53D543A014CAF8B297CFF8F2F937E8",
"id": "D40E312D9CD2EE8C5940D1D4918E9F5778870CB2FBF1D188061EB21B2E7CF371" "id": "E76178CD799A82BAB6EE83A70DE0060F0BDC8BDE29980F0832D791D8D9D5CACC"
} }

View File

@@ -64,14 +64,14 @@ module.exports = {
LedgerWithoutTime: require('./tx/ledger-without-time.json'), LedgerWithoutTime: require('./tx/ledger-without-time.json'),
NotValidated: require('./tx/not-validated.json'), NotValidated: require('./tx/not-validated.json'),
OfferWithExpiration: require('./tx/order-with-expiration.json'), OfferWithExpiration: require('./tx/order-with-expiration.json'),
SuspendedPaymentCreation: require('./tx/suspended-payment-creation.json'), EscrowCreation: require('./tx/escrow-creation.json'),
SuspendedPaymentCreationIOU: EscrowCreationIOU:
require('./tx/suspended-payment-creation-iou.json'), require('./tx/escrow-creation-iou.json'),
SuspendedPaymentCancellation: EscrowCancellation:
require('./tx/suspended-payment-cancellation.json'), require('./tx/escrow-cancellation.json'),
SuspendedPaymentExecution: require('./tx/suspended-payment-execution.json'), EscrowExecution: require('./tx/escrow-execution.json'),
SuspendedPaymentExecutionSimple: EscrowExecutionSimple:
require('./tx/suspended-payment-execution-simple.json'), require('./tx/escrow-execution-simple.json'),
Unrecognized: require('./tx/unrecognized.json'), Unrecognized: require('./tx/unrecognized.json'),
NoMeta: require('./tx/no-meta.json'), NoMeta: require('./tx/no-meta.json'),
LedgerZero: require('./tx/ledger-zero.json'), LedgerZero: require('./tx/ledger-zero.json'),

View File

@@ -9,7 +9,7 @@
"Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Sequence": 9, "Sequence": 9,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "SuspendedPaymentCancel", "TransactionType": "EscrowCancel",
"TxnSignature": "304502210095453956DB908E99386D12F266F48C225CD48F076773F577A4EF676F265B7A18022041E45BB638E64D92EC7FB9B99BEDE1A0B28C245804999656BDBE6043D97BB4A1", "TxnSignature": "304502210095453956DB908E99386D12F266F48C225CD48F076773F577A4EF676F265B7A18022041E45BB638E64D92EC7FB9B99BEDE1A0B28C245804999656BDBE6043D97BB4A1",
"date": 500964620, "date": 500964620,
"hash": "F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22", "hash": "F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22",
@@ -59,7 +59,7 @@
"PreviousTxnLgrSeq": 12, "PreviousTxnLgrSeq": 12,
"SourceTag": 1 "SourceTag": 1
}, },
"LedgerEntryType": "SuspendedPayment", "LedgerEntryType": "Escrow",
"LedgerIndex": "B366B476EFE3A621C96835A36BFDF83C2A5B0008F0EF4A83D751380F53EFCE71" "LedgerIndex": "B366B476EFE3A621C96835A36BFDF83C2A5B0008F0EF4A83D751380F53EFCE71"
} }
}, },

View File

@@ -6,7 +6,7 @@
"CancelAfter": 500972022, "CancelAfter": 500972022,
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
"DestinationTag": 2, "DestinationTag": 2,
"Digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", "Condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
"Fee": "12", "Fee": "12",
"FinishAfter": 500971662, "FinishAfter": 500971662,
"Flags": 2147483648, "Flags": 2147483648,
@@ -23,7 +23,7 @@
"Sequence": 10, "Sequence": 10,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"SourceTag": 1, "SourceTag": 1,
"TransactionType": "SuspendedPaymentCreate", "TransactionType": "EscrowCreate",
"TxnSignature": "3045022100EA1C5433AFA3F0BAAAF7C4146B032B86A0212EB4E2A3551DE9717651A538AE260220228C9E9FC857EC8143F01C2F959A8F134B285B67D8261B49E57BFF8DF76D2255", "TxnSignature": "3045022100EA1C5433AFA3F0BAAAF7C4146B032B86A0212EB4E2A3551DE9717651A538AE260220228C9E9FC857EC8143F01C2F959A8F134B285B67D8261B49E57BFF8DF76D2255",
"date": 500971380, "date": 500971380,
"hash": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE2", "hash": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE2",
@@ -33,7 +33,7 @@
"AffectedNodes": [ "AffectedNodes": [
{ {
"CreatedNode": { "CreatedNode": {
"LedgerEntryType": "SuspendedPayment", "LedgerEntryType": "Escrow",
"LedgerIndex": "0D7629A23BC20F25C48D9423E2485582255A74B76A25F26EDB46766982E4C2C4", "LedgerIndex": "0D7629A23BC20F25C48D9423E2485582255A74B76A25F26EDB46766982E4C2C4",
"NewFields": { "NewFields": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
@@ -41,7 +41,7 @@
"CancelAfter": 500972022, "CancelAfter": 500972022,
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
"DestinationTag": 2, "DestinationTag": 2,
"Digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", "Condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
"FinishAfter": 500971662, "FinishAfter": 500971662,
"SourceTag": 1 "SourceTag": 1
} }

View File

@@ -6,7 +6,7 @@
"CancelAfter": 500972022, "CancelAfter": 500972022,
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
"DestinationTag": 2, "DestinationTag": 2,
"Digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", "Condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
"Fee": "12", "Fee": "12",
"FinishAfter": 500971662, "FinishAfter": 500971662,
"Flags": 2147483648, "Flags": 2147483648,
@@ -23,7 +23,7 @@
"Sequence": 10, "Sequence": 10,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"SourceTag": 1, "SourceTag": 1,
"TransactionType": "SuspendedPaymentCreate", "TransactionType": "EscrowCreate",
"TxnSignature": "3045022100EA1C5433AFA3F0BAAAF7C4146B032B86A0212EB4E2A3551DE9717651A538AE260220228C9E9FC857EC8143F01C2F959A8F134B285B67D8261B49E57BFF8DF76D2255", "TxnSignature": "3045022100EA1C5433AFA3F0BAAAF7C4146B032B86A0212EB4E2A3551DE9717651A538AE260220228C9E9FC857EC8143F01C2F959A8F134B285B67D8261B49E57BFF8DF76D2255",
"date": 500971380, "date": 500971380,
"hash": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1", "hash": "144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1",
@@ -33,7 +33,7 @@
"AffectedNodes": [ "AffectedNodes": [
{ {
"CreatedNode": { "CreatedNode": {
"LedgerEntryType": "SuspendedPayment", "LedgerEntryType": "Escrow",
"LedgerIndex": "0D7629A23BC20F25C48D9423E2485582255A74B76A25F26EDB46766982E4C2C4", "LedgerIndex": "0D7629A23BC20F25C48D9423E2485582255A74B76A25F26EDB46766982E4C2C4",
"NewFields": { "NewFields": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
@@ -41,7 +41,7 @@
"CancelAfter": 500972022, "CancelAfter": 500972022,
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
"DestinationTag": 2, "DestinationTag": 2,
"Digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4", "Condition": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
"FinishAfter": 500971662, "FinishAfter": 500971662,
"SourceTag": 1 "SourceTag": 1
} }

View File

@@ -2,16 +2,15 @@
"id": 0, "id": 0,
"result": { "result": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1", "Condition": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1",
"Fee": "12", "Fee": "12",
"Flags": 2147483648, "Flags": 2147483648,
"LastLedgerSequence": 113, "LastLedgerSequence": 113,
"Method": 1,
"OfferSequence": 5, "OfferSequence": 5,
"Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Sequence": 6, "Sequence": 6,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "SuspendedPaymentFinish", "TransactionType": "EscrowFinish",
"TxnSignature": "304402204E981802BA2F4C3677E69B26387CC157284D31886CF95B73A8AB3E717FE6A6490220519CD84CA01BA5D7A49809B041929F12D56F32E76FAE73F0FAFF7B5E7B8B110B", "TxnSignature": "304402204E981802BA2F4C3677E69B26387CC157284D31886CF95B73A8AB3E717FE6A6490220519CD84CA01BA5D7A49809B041929F12D56F32E76FAE73F0FAFF7B5E7B8B110B",
"date": 501040060, "date": 501040060,
"hash": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD1369931", "hash": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD1369931",
@@ -65,7 +64,7 @@
"CancelAfter": 501079458, "CancelAfter": 501079458,
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
"DestinationTag": 2, "DestinationTag": 2,
"Digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1", "Condition": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1",
"FinishAfter": 501039918, "FinishAfter": 501039918,
"Flags": 0, "Flags": 0,
"OwnerNode": "0000000000000000", "OwnerNode": "0000000000000000",
@@ -73,7 +72,7 @@
"PreviousTxnLgrSeq": 12, "PreviousTxnLgrSeq": 12,
"SourceTag": 1 "SourceTag": 1
}, },
"LedgerEntryType": "SuspendedPayment", "LedgerEntryType": "Escrow",
"LedgerIndex": "AA7D93BDB975252718205C98792BF8940E3FC6E6972213F451AB5D602E8AD971" "LedgerIndex": "AA7D93BDB975252718205C98792BF8940E3FC6E6972213F451AB5D602E8AD971"
} }
}, },

View File

@@ -2,17 +2,16 @@
"id": 0, "id": 0,
"result": { "result": {
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1", "Condition": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1",
"Fee": "12", "Fee": "12",
"Flags": 2147483648, "Flags": 2147483648,
"LastLedgerSequence": 113, "LastLedgerSequence": 113,
"Method": 1,
"OfferSequence": 5, "OfferSequence": 5,
"Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Owner": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Proof": "7768617465766572746869732062656D75737468617665203332206368617273", "Fulfillment": "7768617465766572746869732062656D75737468617665203332206368617273",
"Sequence": 6, "Sequence": 6,
"SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020",
"TransactionType": "SuspendedPaymentFinish", "TransactionType": "EscrowFinish",
"TxnSignature": "304402204E981802BA2F4C3677E69B26387CC157284D31886CF95B73A8AB3E717FE6A6490220519CD84CA01BA5D7A49809B041929F12D56F32E76FAE73F0FAFF7B5E7B8B110B", "TxnSignature": "304402204E981802BA2F4C3677E69B26387CC157284D31886CF95B73A8AB3E717FE6A6490220519CD84CA01BA5D7A49809B041929F12D56F32E76FAE73F0FAFF7B5E7B8B110B",
"date": 501040060, "date": 501040060,
"hash": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B", "hash": "CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B",
@@ -66,7 +65,7 @@
"CancelAfter": 501079458, "CancelAfter": 501079458,
"Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw", "Destination": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw",
"DestinationTag": 2, "DestinationTag": 2,
"Digest": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1", "Condition": "632F2F3E437AE720C397994A985B5D21FE186DE61523A9CA3E8709CC581671A1",
"FinishAfter": 501039918, "FinishAfter": 501039918,
"Flags": 0, "Flags": 0,
"OwnerNode": "0000000000000000", "OwnerNode": "0000000000000000",
@@ -74,7 +73,7 @@
"PreviousTxnLgrSeq": 12, "PreviousTxnLgrSeq": 12,
"SourceTag": 1 "SourceTag": 1
}, },
"LedgerEntryType": "SuspendedPayment", "LedgerEntryType": "Escrow",
"LedgerIndex": "AA7D93BDB975252718205C98792BF8940E3FC6E6972213F451AB5D602E8AD971" "LedgerIndex": "AA7D93BDB975252718205C98792BF8940E3FC6E6972213F451AB5D602E8AD971"
} }
}, },

View File

@@ -273,22 +273,20 @@ module.exports = function createMockRippled(port) {
conn.send(createResponse(request, fixtures.tx.OfferWithExpiration)); conn.send(createResponse(request, fixtures.tx.OfferWithExpiration));
} else if (request.transaction === } else if (request.transaction ===
'144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1') { '144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE1') {
conn.send(createResponse(request, fixtures.tx.SuspendedPaymentCreation)); conn.send(createResponse(request, fixtures.tx.EscrowCreation));
} else if (request.transaction === } else if (request.transaction ===
'144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE2') { '144F272380BDB4F1BD92329A2178BABB70C20F59042C495E10BF72EBFB408EE2') {
conn.send(createResponse(request, conn.send(createResponse(request, fixtures.tx.EscrowCreationIOU));
fixtures.tx.SuspendedPaymentCreationIOU));
} else if (request.transaction === } else if (request.transaction ===
'F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22') { 'F346E542FFB7A8398C30A87B952668DAB48B7D421094F8B71776DA19775A3B22') {
conn.send(createResponse(request, conn.send(createResponse(request, fixtures.tx.EscrowCancellation));
fixtures.tx.SuspendedPaymentCancellation));
} else if (request.transaction === } else if (request.transaction ===
'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B') { 'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD136993B') {
conn.send(createResponse(request, fixtures.tx.SuspendedPaymentExecution)); conn.send(createResponse(request, fixtures.tx.EscrowExecution));
} else if (request.transaction === } else if (request.transaction ===
'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD1369931') { 'CC5277137B3F25EE8B86259C83CB0EAADE818505E4E9BCBF19B1AC6FD1369931') {
conn.send(createResponse(request, conn.send(createResponse(request,
fixtures.tx.SuspendedPaymentExecutionSimple)); fixtures.tx.EscrowExecutionSimple));
} else if (request.transaction === } else if (request.transaction ===
'AFB3ADF22F3C605E23FAEFAA185F3BD763C4692CAC490D9819D117CD33BFAA11') { 'AFB3ADF22F3C605E23FAEFAA185F3BD763C4692CAC490D9819D117CD33BFAA11') {
conn.send(createResponse(request, fixtures.tx.Unrecognized)); conn.send(createResponse(request, fixtures.tx.Unrecognized));