mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-03 16:56:41 +00:00
Add optional cancel support to offer_create.
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user