Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 74cacd5

Browse files
committedNov 20, 2014
[DOC] update offer example
1 parent bb79cf2 commit 74cacd5

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed
 

‎docs/GUIDES.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This file provides step-by-step walkthroughs for some of the most common usages
6363

6464
##Sending rippled API requests
6565

66-
`Remote` contains functions for constructing a `Request` object.
66+
`Remote` contains functions for constructing a `Request` object.
6767

6868
A `Request` is an `EventEmitter` so you can listen for success or failure events -- or, instead, you can provide a callback.
6969

@@ -124,29 +124,29 @@ See the [wiki](https://ripple.com/wiki/JSON_Messages#subscribe) for details on s
124124
'ledger',
125125
'transactions'
126126
];
127-
127+
128128
var request = remote.requestSubscribe(streams);
129-
129+
130130
request.on('error', function(error) {
131131
console.log('request error: ', error);
132132
});
133-
134-
133+
134+
135135
// the `ledger_closed` and `transaction` will come in on the remote
136136
// since the request for subscribe is finalized after the success return
137137
// the streaming events will still come in, but not on the initial request
138138
remote.on('ledger_closed', function(ledger) {
139139
console.log('ledger_closed: ', JSON.stringify(ledger, null, 2));
140140
});
141-
141+
142142
remote.on('transaction', function(transaction) {
143143
console.log('transaction: ', JSON.stringify(transaction, null, 2));
144144
});
145-
145+
146146
remote.on('error', function(error) {
147147
console.log('remote error: ', error);
148148
});
149-
149+
150150
// fire the request
151151
request.request();
152152
});
@@ -160,7 +160,7 @@ See the [wiki](https://ripple.com/wiki/JSON_Messages#subscribe) for details on s
160160
Submitting a payment transaction to the Ripple network involves connecting to a `Remote`, creating a transaction, signing it with the user's secret, and submitting it to the `rippled` server. Note that the `Amount` module is used to convert human-readable amounts like '1XRP' or '10.50USD' to the type of Amount object used by the Ripple network.
161161

162162
```js
163-
/* Loading ripple-lib Remote and Amount modules in Node.js */
163+
/* Loading ripple-lib Remote and Amount modules in Node.js */
164164
var Remote = require('ripple-lib').Remote;
165165
var Amount = require('ripple-lib').Amount;
166166

@@ -179,8 +179,8 @@ remote.connect(function() {
179179
remote.setSecret(MY_ADDRESS, MY_SECRET);
180180

181181
var transaction = remote.createTransaction('Payment', {
182-
account: MY_ADDRESS,
183-
destination: RECIPIENT,
182+
account: MY_ADDRESS,
183+
destination: RECIPIENT,
184184
amount: AMOUNT
185185
});
186186

@@ -201,12 +201,12 @@ Since the fee required for a transaction may change between the time when the or
201201
The [`max_fee`](REFERENCE.md#1-remote-options) option can be used to avoid submitting a transaction to a server that is charging unreasonably high fees.
202202

203203

204-
##4. Submitting a trade offer to the network
204+
##Submitting a trade offer to the network
205205

206-
Submitting a trade offer to the network is similar to submitting a payment transaction. Here is an example for a trade that expires in 24 hours where you are offering to sell 1 USD in exchange for 100 XRP:
206+
Submitting a trade offer to the network is similar to submitting a payment transaction. Here is an example offering to sell 1 USD in exchange for 100 XRP:
207207

208208
```js
209-
/* Loading ripple-lib Remote and Amount modules in Node.js */
209+
/* Loading ripple-lib Remote and Amount modules in Node.js */
210210
var Remote = require('ripple-lib').Remote;
211211
var Amount = require('ripple-lib').Amount;
212212

@@ -225,7 +225,7 @@ remote.connect(function() {
225225

226226
var transaction = remote.createTransaction('OfferCreate', {
227227
account: MY_ADDRESS,
228-
taker_pays: '1',
228+
taker_pays: '100',
229229
taker_gets: '1/USD/' + GATEWAY
230230
});
231231

0 commit comments

Comments
 (0)
Please sign in to comment.