diff --git a/content/ripplerest_api.md b/content/ripplerest_api.md
index 12474ab58d..6a8ef5293b 100644
--- a/content/ripplerest_api.md
+++ b/content/ripplerest_api.md
@@ -22,10 +22,12 @@ We recommend Ripple-REST for users just getting started with Ripple, since it pr
* [Get Payment History - `GET /v1/accounts/{:address}/payments`](#get-payment-history)
#### Orders ####
+
* [Place Order - `POST /v1/accounts/{:address}/orders`](#place-order)
* [Cancel Order - `DELETE /v1/accounts/{:address}/orders/{:sequence}`](#cancel-order)
* [Get Account Orders - `GET /v1/accounts/{:address}/orders`](#get-account-orders)
* [Get Order Book - `GET /v1/accounts/{:address}/order_book/{:base}/{:counter}`](#get-order-book)
+* [Get Order Transaction - `GET /v1/accounts{:address}/orders/{:hash}`](#get-order)
#### Trustlines ####
@@ -239,22 +241,6 @@ openssl x509 -req -days 730 -in /etc/ssl/server.csr -signkey /etc/ssl/private/se
### Keeping the service running ###
-To make sure that the Ripple-REST process remains active even if it crashes for some reason, use the [`forever`](https://www.npmjs.org/package/forever) Node module. Install `forever` using `sudo npm install -g forever`.
-
-Here is an example of running `ripple-rest` using `forever`:
-
-```
-forever start \
- --pidFile /var/run/ripple-rest/ripple-rest.pid \
- --sourceDir /opt/ripple-rest \
- -a -o /var/log/ripple-rest/ripple-rest.log \
- -e /var/log/ripple-rest/ripple-rest.err \
- -l /var/log/ripple-rest/ripple-rest.for \
- server.js
-```
-
-### Monitoring the service ###
-
Monitor `ripple-rest` using [`monit`](http://mmonit.com/monit/). On Ubuntu you can install `monit` using `sudo apt-get install monit`.
Here is an example of a monit script that will restart the server if:
@@ -276,7 +262,6 @@ check process ripple-rest with pidfile /var/run/ripple-rest/ripple-rest.pid
-
# Formatting Conventions #
The `ripple-rest` API conforms to the following general behavior for [RESTful API](http://en.wikipedia.org/wiki/Representational_state_transfer):
@@ -452,7 +437,7 @@ The fields of a Payment object are defined as follows:
Submitted transactions can have additional fields reflecting the current status and outcome of the transaction, including:
-[[Source]
](https://github.com/ripple/ripple-rest/blob/master/api/payments.js#L346 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/59ea02d634ac4a308db2ba21781efbc02f5ccf53/lib/tx-to-rest-converter.js#L25 "Source")
| Field | Type | Description |
|-------|------|-------------|
@@ -511,6 +496,18 @@ An order object describes an offer to exchange two currencies. Order objects are
| immediate\_or\_cancel | Boolean | Whether the order should be [immediate or cancel](transactions.html#offercreate-flags). |
| fill\_or\_kill | Boolean | Whether the order should be [fill or kill](transactions.html#offercreate-flags). |
+## Order Change Objects ##
+
+An order change object describes the changes to to a Ripple account's open order due to a transaction.
+
+| Field | Value | Description |
+|-------|-------|-------------|
+| type | String (`buy` or `sell`) | Whether the order is to buy or sell. |
+| taker\_pays | String ([Amount Object](#amount_object)) | The `value` of the amount is expressed as the difference between the final amount and original amount. |
+| taker\_gets | String ([Amount Object](#amount_object)) | The `value` of the amount is expressed as the difference between the final amount and original amount. |
+| sequence | Number | The sequence number of the transaction that created the order. Used in combination with account to uniquely identify the order. |
+| status | String(`created`, `closed`, `canceled`, `open`) | The status of the order on the ledger. An order that is partially filled has the status `open`. |
+
## Bid Objects ##
@@ -601,7 +598,7 @@ The second step is [making a payment](#payments) of XRP to the new account addre
## Get Account Balances ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/master/api/balances.js#L9 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/a268d7058b9bf20d48a1b61d86093756e5274512/api/balances.js#L34 "Source")
Retrieve the current balances for the given Ripple account.
@@ -732,7 +729,7 @@ The response contains a `settings` object, with the following fields:
## Update Account Settings ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/master/api/settings.js#L97 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/a268d7058b9bf20d48a1b61d86093756e5274512/api/settings.js#L135 "Source")
Modify the existing settings for an account.
@@ -828,9 +825,8 @@ The response is a JSON object containing the following fields:
`ripple-rest` provides access to `ripple-lib`'s robust transaction submission processes. This means that it will set the fee, manage the transaction sequence numbers, sign the transaction with your secret, and resubmit the transaction up to 10 times if `rippled` reports an initial error that can be solved automatically.
-
## Prepare Payment ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/master/api/payments.js#L538 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/a268d7058b9bf20d48a1b61d86093756e5274512/api/payments.js#L484 "Source")
Get quotes for possible ways to make a particular payment.
@@ -921,7 +917,7 @@ __NOTE:__ This command may be quite slow. If the command times out, please try i
## Submit Payment ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/master/api/payments.js#L43 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/a268d7058b9bf20d48a1b61d86093756e5274512/api/payments.js#L52 "Source")
Submit a payment object to be processed and executed.
@@ -960,6 +956,7 @@ POST /v1/accounts/{address}/payments?validated=true
}
}
```
+
[Try it! >](rest-api-tool.html#submit-payment)
@@ -1017,7 +1014,7 @@ The response can take two formats, depending on the `validated` query parameter:
## Confirm Payment ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/master/api/payments.js#L232 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/a268d7058b9bf20d48a1b61d86093756e5274512/api/payments.js#L270 "Source")
Retrieve the details of a payment, including the current state of the transaction and the result of transaction processing.
@@ -1099,7 +1096,7 @@ Processing a payment can take several seconds to complete, depending on the [con
## Get Payment History ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/master/api/payments.js#L460 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/a268d7058b9bf20d48a1b61d86093756e5274512/api/payments.js#L394 "Source")
Retrieve a selection of payments that affected the specified account.
@@ -1140,389 +1137,83 @@ Optionally, you can also include the following query parameters:
"success": true,
"payments": [
{
- "client_resource_id": "",
"payment": {
- "source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
+ "source_account": "rBvktWhzs4MQDaFYScsqPCB5YufRDXwKDC",
"source_tag": "",
"source_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
+ "value": "1166313.057",
+ "currency": "JPY",
+ "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"
},
"source_slippage": "0",
- "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
+ "destination_account": "rBvktWhzs4MQDaFYScsqPCB5YufRDXwKDC",
"destination_tag": "",
"destination_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "invoice_id": "",
- "paths": "[]",
- "no_direct_ripple": false,
- "partial_payment": false,
- "direction": "outgoing",
- "state": "validated",
- "result": "tesSUCCESS",
- "ledger": "9018940",
- "hash": "FED24FB85E5682E5FD03D2FFA047E1CE9F284671BCD82007C64B3FE735DD69B0",
- "timestamp": "2014-09-23T19:20:20.000Z",
- "fee": "0.000012",
- "source_balance_changes": [
- {
- "value": "-0.000012",
- "currency": "XRP",
- "issuer": ""
- },
- {
- "value": "-1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
- }
- ],
- "destination_balance_changes": [
- {
- "value": "1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
- }
- ]
- }
- },
- {
- "client_resource_id": "",
- "payment": {
- "source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "source_tag": "",
- "source_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "source_slippage": "0",
- "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
- "destination_tag": "",
- "destination_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "invoice_id": "",
- "paths": "[]",
- "no_direct_ripple": false,
- "partial_payment": false,
- "direction": "outgoing",
- "state": "validated",
- "result": "tesSUCCESS",
- "ledger": "9018905",
- "hash": "63BCCAFA0D6D56B2F914B5933D7FABCD25925450F0675179E836D12DFA530C28",
- "timestamp": "2014-09-23T19:17:30.000Z",
- "fee": "0.000012",
- "source_balance_changes": [
- {
- "value": "-0.000012",
- "currency": "XRP",
- "issuer": ""
- },
- {
- "value": "-1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
- }
- ],
- "destination_balance_changes": [
- {
- "value": "1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
- }
- ]
- }
- },
- {
- "client_resource_id": "",
- "payment": {
- "source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "source_tag": "",
- "source_amount": {
- "value": "0.00001",
- "currency": "XRP",
- "issuer": ""
- },
- "source_slippage": "0",
- "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
- "destination_tag": "",
- "destination_amount": {
- "currency": "USD",
- "issuer": "rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc",
- "value": "0.01"
- },
- "invoice_id": "",
- "paths": "[]",
- "no_direct_ripple": false,
- "partial_payment": true,
- "direction": "outgoing",
- "state": "validated",
- "result": "tesSUCCESS",
- "ledger": "8924146",
- "hash": "9D591B18EDDD34F0B6CF4223A2940AEA2C3CC778925BABF289E0011CD8FA056E",
- "timestamp": "2014-09-17T21:47:00.000Z",
- "fee": "0.00001",
- "source_balance_changes": [
- {
- "value": "-0.00002",
- "currency": "XRP",
- "issuer": ""
- }
- ],
- "destination_balance_changes": [
- {
- "value": "5.08e-8",
- "currency": "USD",
- "issuer": "rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc"
- }
- ]
- }
- },
- {
- "client_resource_id": "",
- "payment": {
- "source_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
- "source_tag": "",
- "source_amount": {
- "value": "1",
- "currency": "XRP",
- "issuer": ""
- },
- "source_slippage": "0",
- "destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "destination_tag": "",
- "destination_amount": {
- "value": "1",
+ "value": "600000",
"currency": "XRP",
"issuer": ""
},
"invoice_id": "",
- "paths": "[]",
+ "paths": "[[{\"currency\":\"XRP\",\"type\":16,\"type_hex\":\"0000000000000010\"}]]",
"no_direct_ripple": false,
"partial_payment": false,
- "direction": "incoming",
- "state": "validated",
+ "direction": "passthrough",
"result": "tesSUCCESS",
- "ledger": "8889845",
- "hash": "8496C20AEB453803CB80474B59AB1E8FAA26725561EFF5AF41BD588B325AFBA8",
- "timestamp": "2014-09-15T20:01:40.000Z",
- "fee": "0.000012",
+ "timestamp": "2015-02-06T03:59:30.000Z",
+ "fee": "0.012",
"source_balance_changes": [
{
- "value": "-1.000012",
- "currency": "XRP",
- "issuer": ""
- }
- ],
- "destination_balance_changes": [
- {
- "value": "1",
- "currency": "XRP",
- "issuer": ""
- }
- ]
- }
- },
- {
- "client_resource_id": "",
- "payment": {
- "source_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
- "source_tag": "",
- "source_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "source_slippage": "0",
- "destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "destination_tag": "",
- "destination_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "invoice_id": "",
- "paths": "[]",
- "no_direct_ripple": false,
- "partial_payment": false,
- "direction": "incoming",
- "state": "validated",
- "result": "tesSUCCESS",
- "ledger": "8889826",
- "hash": "4C9FA63D9F87AFC7E1BBD7F2644A1D4BD7537E833B1A945E27E5EC19F3B4B271",
- "timestamp": "2014-09-15T20:00:10.000Z",
- "fee": "0.000012",
- "source_balance_changes": [
- {
- "value": "-0.000012",
- "currency": "XRP",
- "issuer": ""
+ "currency": "JPY",
+ "value": "-1164533.852420654",
+ "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"
},
{
- "value": "-1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
- }
- ],
- "destination_balance_changes": [
- {
- "value": "1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
- }
- ]
- }
- },
- {
- "client_resource_id": "",
- "payment": {
- "source_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
- "source_tag": "",
- "source_amount": {
- "value": "30",
- "currency": "XRP",
- "issuer": ""
- },
- "source_slippage": "0",
- "destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "destination_tag": "",
- "destination_amount": {
- "value": "30",
- "currency": "XRP",
- "issuer": ""
- },
- "invoice_id": "",
- "paths": "[]",
- "no_direct_ripple": false,
- "partial_payment": false,
- "direction": "incoming",
- "state": "validated",
- "result": "tesSUCCESS",
- "ledger": "8889256",
- "hash": "72549F0CB04C8C5F30F64256A4EBDE577B1943382AE44347F05FF70590FF7CCB",
- "timestamp": "2014-09-15T19:14:50.000Z",
- "fee": "0.000012",
- "source_balance_changes": [
- {
- "value": "-30.000012",
"currency": "XRP",
+ "value": "599999.988",
"issuer": ""
}
],
"destination_balance_changes": [
{
- "value": "30",
- "currency": "XRP",
- "issuer": ""
- }
- ]
- }
- },
- {
- "client_resource_id": "",
- "payment": {
- "source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "source_tag": "",
- "source_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "source_slippage": "0",
- "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
- "destination_tag": "",
- "destination_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "invoice_id": "",
- "paths": "[]",
- "no_direct_ripple": false,
- "partial_payment": false,
- "direction": "outgoing",
- "state": "validated",
- "result": "tesSUCCESS",
- "ledger": "8803725",
- "hash": "6A6E503211A32F7AB92FE747A8AD2759A1E597055CB8961F0B2FEDE3A53975AB",
- "timestamp": "2014-09-10T23:22:20.000Z",
- "fee": "0.000015",
- "source_balance_changes": [
- {
- "value": "-0.000015",
- "currency": "XRP",
- "issuer": ""
+ "currency": "JPY",
+ "value": "-1164533.852420654",
+ "issuer": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"
},
{
- "value": "-1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
- }
- ],
- "destination_balance_changes": [
- {
- "value": "1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
- }
- ]
- }
- },
- {
- "client_resource_id": "",
- "payment": {
- "source_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "source_tag": "",
- "source_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "source_slippage": "0",
- "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
- "destination_tag": "",
- "destination_amount": {
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
- "value": "1"
- },
- "invoice_id": "",
- "paths": "[]",
- "no_direct_ripple": false,
- "partial_payment": false,
- "direction": "outgoing",
- "state": "validated",
- "result": "tesSUCCESS",
- "ledger": "8711125",
- "hash": "82230B9D489370504B39BC2CE46216176CAC9E752E5C1774A8CBEC9FBB819208",
- "timestamp": "2014-09-05T19:59:50.000Z",
- "fee": "0.00001",
- "source_balance_changes": [
- {
- "value": "-0.00001",
"currency": "XRP",
+ "value": "599999.988",
"issuer": ""
- },
- {
- "value": "-1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
}
],
- "destination_balance_changes": [
+ "order_changes": [
{
- "value": "1",
- "currency": "USD",
- "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
+ "taker_pays": {
+ "currency": "JPY",
+ "counterparty": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN",
+ "value": "-67605.3"
+ },
+ "taker_gets": {
+ "currency": "XRP",
+ "counterparty": "",
+ "value": "-34300"
+ },
+ "sequence": 3751,
+ "status": "closed"
+ }
+ ],
+ "memos": [
+ {
+ "MemoType": "636C69656E74",
+ "MemoFormat": "7274312E332E31",
+ "parsed_memo_type": "client",
+ "parsed_memo_format": "rt1.3.1"
}
]
- }
+ },
+ "client_resource_id": "",
+ "hash": "E485D1E18D946ACD410AD79F51E2C57E887CC206286E6CE0A1CA80FC75C24643",
+ "ledger": "11547185",
+ "state": "validated"
}
]
}
@@ -1530,13 +1221,20 @@ Optionally, you can also include the following query parameters:
If the length of the `payments` array is equal to `results_per_page`, then there may be more results. To get them, increment the `page` query paramter and run the request again.
-*Note:* It is not more efficient to specify more filter values, because Ripple-REST has to retrieve the full list of payments from the `rippled` before it can filter them.
+The `payment` objects include additional transactional metadata:
+| Field | Type | Description |
+|-------|------|-------------|
+| source_balance_changes | Amount | The balance changes of the Ripple address that submitted the payment |
+| destination_balance_changes | Amount | The balance changes of the Ripple address that received the payment |
+| order_changes | Order | The changes in the orders of the perspective account |
+
+*Note:* It is not more efficient to specify more filter values, because Ripple-REST has to retrieve the full list of payments from the `rippled` before it can filter them.
# ORDERS #
## Place Order ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/develop/api/orders.js#L110 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/59ea02d634ac4a308db2ba21781efbc02f5ccf53/api/orders.js#L161 "Source")
(New in [Ripple-REST v1.3.2](https://github.com/ripple/ripple-rest/releases/tag/1.3.2-rc4))
@@ -1619,8 +1317,7 @@ __DO NOT SUBMIT YOUR SECRET TO AN UNTRUSTED REST API SERVER__ -- The secret key
```
## Cancel Order ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/develop/api/orders.js#L243 "Source")
-(New in [Ripple-REST v1.3.2](https://github.com/ripple/ripple-rest/releases/tag/1.3.2-rc4))
+[[Source]
](https://github.com/ripple/ripple-rest/blob/59ea02d634ac4a308db2ba21781efbc02f5ccf53/api/orders.js#L250 "Source")
Deletes a previous order to exchange currencies.
@@ -1680,11 +1377,9 @@ __DO NOT SUBMIT YOUR SECRET TO AN UNTRUSTED REST API SERVER__ -- The secret key
```
## Get Account Orders ##
-[[Source]
](https://github.com/ripple/ripple-rest/blob/develop/api/orders.js#L20 "Source")
+[[Source]
](https://github.com/ripple/ripple-rest/blob/59ea02d634ac4a308db2ba21781efbc02f5ccf53/api/orders.js#L38 "Source")
-(New in [Ripple-REST v1.3.2](https://github.com/ripple/ripple-rest/releases/tag/1.3.2-rc4))
-
-Retrieves all currency-exchange orders associated with the Ripple address.
+Retrieves all open currency-exchange orders associated with the Ripple address.