From 665bd4b1de1b5a272ddc287d148c6a2f1635c8cf Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Mon, 3 Dec 2012 14:28:27 -0800 Subject: [PATCH] Added set_issuer. --- src/js/amount.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/js/amount.js b/src/js/amount.js index 5bda5ddae0..2426338a9e 100644 --- a/src/js/amount.js +++ b/src/js/amount.js @@ -404,6 +404,16 @@ Amount.prototype.set_currency = function(c) { return this; }; +Amount.prototype.set_issuer = function (issuer) { + if (issuer instanceof UInt160) { + issuer.copyTo(this._issuer); + } else { + this._issuer.parse_json(issuer); + } + + return this; +}; + // Only checks the value. Not the currency and issuer. Amount.prototype.is_valid = function() { return !isNaN(this._value);