Added set_issuer.

This commit is contained in:
Stefan Thomas
2012-12-03 14:28:27 -08:00
parent b80bd17295
commit 665bd4b1de

View File

@@ -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);