JS: Add support for setting transfer fee.

This commit is contained in:
Arthur Britto
2012-11-03 04:14:09 -07:00
committed by Stefan Thomas
parent 8fbc2cf883
commit f5988fd66e

View File

@@ -1042,6 +1042,13 @@ Transaction.prototype.send_max = function (send_max) {
return this; return this;
} }
// --> rate: In billionths.
Transaction.prototype.transfer_rate = function (rate) {
this.transaction.TransferRate = Number(rate);
return this;
}
// Add flags to a transaction. // Add flags to a transaction.
// --> flags: undefined, _flag_, or [ _flags_ ] // --> flags: undefined, _flag_, or [ _flags_ ]
Transaction.prototype.set_flags = function (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; return this.remote.config.accounts[account] ? this.remote.config.accounts[account].secret : undefined;
}; };
// .wallet_locator() // Options:
// .message_key() // .domain() NYI
// .domain() // .message_key() NYI
// .transfer_rate() // .transfer_rate()
// .publish() // .wallet_locator() NYI
Transaction.prototype.account_set = function (src) { Transaction.prototype.account_set = function (src) {
this.secret = this._account_secret(src); this.secret = this._account_secret(src);
this.transaction.TransactionType = 'AccountSet'; this.transaction.TransactionType = 'AccountSet';
this.transaction.Account = UInt160.json_rewrite(src);
return this; return this;
}; };