From be78db1563f8a07c171d6ef666ea7f661374fecd Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sat, 15 Jun 2013 22:26:18 -0700 Subject: [PATCH] Add optional cancel support to offer_create. --- src/js/ripple/transaction.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/ripple/transaction.js b/src/js/ripple/transaction.js index 3d8a08a1..6b2531ff 100644 --- a/src/js/ripple/transaction.js +++ b/src/js/ripple/transaction.js @@ -588,8 +588,9 @@ Transaction.prototype.offer_cancel = function (src, sequence) { // Options: // .set_flags() -// --> expiration : Date or Number -Transaction.prototype.offer_create = function (src, taker_pays, taker_gets, expiration) { +// --> expiration : if not undefined, Date or Number +// --> cancel_sequence : if not undefined, Sequence +Transaction.prototype.offer_create = function (src, taker_pays, taker_gets, expiration, cancel_sequence) { this._secret = this._account_secret(src); this.tx_json.TransactionType = 'OfferCreate'; this.tx_json.Account = UInt160.json_rewrite(src); @@ -605,6 +606,9 @@ Transaction.prototype.offer_create = function (src, taker_pays, taker_gets, expi ? expiration.getTime() : Number(expiration); + if (cancel_sequence) + this.tx_json.OfferSequence = Number(cancel_sequence); + return this; };