JS Add support for SourceTag and Destination tag.

This commit is contained in:
Arthur Britto
2013-01-09 16:21:57 -08:00
parent e0a49f875a
commit 9b6ee7fc88

View File

@@ -1381,6 +1381,15 @@ Transaction.prototype.build_path = function (build) {
return this;
}
// tag should be undefined or a 32 bit integer.
// YYY Add range checking for tag.
Transaction.prototype.destination_tag = function (tag) {
if (undefined !== tag)
this.tx_json.DestinationTag = tag;
return this;
}
Transaction._path_rewrite = function (path) {
var path_new = [];
@@ -1432,6 +1441,15 @@ Transaction.prototype.send_max = function (send_max) {
return this;
}
// tag should be undefined or a 32 bit integer.
// YYY Add range checking for tag.
Transaction.prototype.source_tag = function (tag) {
if (undefined !== tag)
this.tx_json.SourceTag = tag;
return this;
}
// --> rate: In billionths.
Transaction.prototype.transfer_rate = function (rate) {
this.tx_json.TransferRate = Number(rate);
@@ -1561,10 +1579,12 @@ Transaction.prototype.password_set = function (src, authorized_key, generator, p
// Options:
// .paths()
// .build_path()
// .destination_tag()
// .path_add()
// .secret()
// .send_max()
// .set_flags()
// .source_tag()
Transaction.prototype.payment = function (src, dst, deliver_amount) {
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'Payment';