diff --git a/bin/cli b/bin/cli index 2f7f651f..fd02a081 100755 --- a/bin/cli +++ b/bin/cli @@ -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); }); diff --git a/lib/http/server.js b/lib/http/server.js index 6497d47a..c64fc0e0 100644 --- a/lib/http/server.js +++ b/lib/http/server.js @@ -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 = [];