From f5988fd66e9b512dfbd1cd4b0a4b99141a8e02d0 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sat, 3 Nov 2012 04:14:09 -0700 Subject: [PATCH] JS: Add support for setting transfer fee. --- js/remote.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/js/remote.js b/js/remote.js index 9e0b4fed..0d6459d0 100644 --- a/js/remote.js +++ b/js/remote.js @@ -1042,6 +1042,13 @@ Transaction.prototype.send_max = function (send_max) { return this; } +// --> rate: In billionths. +Transaction.prototype.transfer_rate = function (rate) { + this.transaction.TransferRate = Number(rate); + + return this; +} + // Add flags to a transaction. // --> flags: undefined, _flag_, or [ _flags_ ] Transaction.prototype.set_flags = function (flags) { @@ -1081,14 +1088,15 @@ Transaction.prototype._account_secret = function (account) { return this.remote.config.accounts[account] ? this.remote.config.accounts[account].secret : undefined; }; -// .wallet_locator() -// .message_key() -// .domain() -// .transfer_rate() -// .publish() +// Options: +// .domain() NYI +// .message_key() NYI +// .transfer_rate() +// .wallet_locator() NYI Transaction.prototype.account_set = function (src) { this.secret = this._account_secret(src); this.transaction.TransactionType = 'AccountSet'; + this.transaction.Account = UInt160.json_rewrite(src); return this; };