http: add watchOnly options.

This commit is contained in:
Christopher Jeffrey 2016-10-04 17:06:56 -07:00
parent 49ee93f472
commit 5e1b56363b
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 15 additions and 0 deletions

View File

@ -53,6 +53,11 @@ CLI.prototype.createWallet = co(function* createWallet() {
if (this.config.passphrase)
options.passphrase = this.config.passphrase;
if (this.config.watch) {
options.watchOnly = true;
options.accountKey = this.config.watch;
}
wallet = yield this.client.createWallet(options);
this.log(wallet);
});

View File

@ -280,6 +280,16 @@ HTTPServer.prototype._init = function _init() {
}
}
if (params.watchOnly != null) {
assert(typeof params.watchOnly === 'boolean', 'watchOnly must be a boolean.');
options.watchOnly = params.watchOnly;
}
if (params.accountKey) {
assert(typeof params.accountKey === 'string', 'accountKey must be a string.');
options.accountKey = params.accountKey;
}
if (params.outputs) {
assert(Array.isArray(params.outputs), 'Outputs must be an array.');
options.outputs = [];