From b131bd413c82cc6ea38c7af6b11f438fed627599 Mon Sep 17 00:00:00 2001 From: Evan Schwartz Date: Tue, 10 Sep 2013 15:12:58 -0700 Subject: [PATCH] updated transaction options --- docs/GUIDES.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/GUIDES.md b/docs/GUIDES.md index f9da39d4..908a35f8 100644 --- a/docs/GUIDES.md +++ b/docs/GUIDES.md @@ -101,7 +101,11 @@ remote.connect(function() { var transaction = remote.transaction(); - transaction.payment(MY_ADDRESS, RECIPIENT, AMOUNT); + transaction.payment({ + from: MY_ADDRESS, + to: RECIPIENT, + amount: AMOUNT + }); transaction.submit(function(err, res) { /* handle submission errors / success */ @@ -136,10 +140,8 @@ var Amount = require('ripple-lib').Amount; var MY_ADDRESS = 'rrrMyAddress'; var MY_SECRET = 'secret'; -// TAKER_PAYS is the amount that the other party will pay you -// TAKER_GETS is the amount you are offering to them -var TAKER_PAYS = Amount.from_human('100XRP'); -var TAKER_GETS = Amount.from_human('1USD'); +var BUY_AMOUNT = Amount.from_human('100XRP'); +var SELL_AMOUNT = Amount.from_human('1USD'); // EXPIRATION must be a Date object, leave undefined to submit offer that won't expire var now = new Date(); @@ -153,7 +155,12 @@ remote.connect(function() { var transaction = remote.transaction(); - transaction.offer_create(MY_ADDRESS, TAKER_PAYS, TAKER_GETS, EXPIRATION); + transaction.offer_create({ + from: MY_ADDRESS, + buy: BUY_AMOUNT, + sell: SELL_AMOUNT, + expiration: EXPIRATION + }); transaction.submit(function(err, res) { /* handle submission errors / success */