commit
3e197c5fb8
|
@ -25,6 +25,7 @@ A Multisig HD Wallet Service, with minimun server trust.
|
|||
|
||||
# Sets default file to use
|
||||
export BIT_FILE=pete.dat
|
||||
export BIT_HOST=http://pepe.com/bws
|
||||
./bit address
|
||||
[1bitcoinaddress]
|
||||
./bit balance
|
||||
|
|
|
@ -17,6 +17,7 @@ program
|
|||
.command('rm <txpId>', 'remove a transaction proposal')
|
||||
.command('export', 'export wallet critical data')
|
||||
.command('import', 'import wallet critical data')
|
||||
.command('confirm', 'show copayer\'s data for confirmation')
|
||||
.parse(process.argv);
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ var utils = require('./cli-utils');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c, --config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.option('-v, --verbose', 'be verbose')
|
||||
.parse(process.argv);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ var Client = require('../lib/client');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c, --config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.option('-v, --verbose', 'be verbose')
|
||||
.parse(process.argv);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ var utils = require('./cli-utils');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c, --config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.option('-v, --verbose', 'be verbose')
|
||||
.parse(process.argv);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ var utils = require('./cli-utils');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c,--config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.option('-v,--verbose', 'be verbose')
|
||||
.usage('[options] <txpid>')
|
||||
.parse(process.argv);
|
||||
|
|
|
@ -8,6 +8,7 @@ var utils = require('./cli-utils');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c, --config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.option('-t, --testnet', 'Create a Testnet Wallet', String)
|
||||
.usage('[options] <walletName> <m-n> [copayerName]')
|
||||
.parse(process.argv);
|
||||
|
|
|
@ -9,6 +9,7 @@ var utils = require('./cli-utils');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c, --config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.option('-v, --verbose', 'be verbose')
|
||||
.option('-q, --qr')
|
||||
.parse(process.argv);
|
||||
|
|
|
@ -7,6 +7,7 @@ var utils = require('./cli-utils');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c, --config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.usage('[options] <secret> [copayerName]')
|
||||
.parse(process.argv);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ program
|
|||
.version('0.0.1')
|
||||
.option('-c,--config [file]', 'Wallet config filename')
|
||||
.option('-v,--verbose', 'be verbose')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.usage('[options] <txpid> [reason]')
|
||||
.parse(process.argv);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ program
|
|||
.version('0.0.1')
|
||||
.option('-c,--config [file]', 'Wallet config filename')
|
||||
.option('-v,--verbose', 'be verbose')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.usage('[options] <txpid>')
|
||||
.parse(process.argv);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ var utils = require('./cli-utils');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c, --config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.option('-v, --verbose', 'be verbose')
|
||||
.usage('[options] <address> <amount> <message>')
|
||||
.parse(process.argv);
|
||||
|
|
|
@ -8,6 +8,7 @@ program
|
|||
.version('0.0.1')
|
||||
.option('-c,--config [file]', 'Wallet config filename')
|
||||
.option('-v,--verbose', 'be verbose')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.usage('[options] <txpid>')
|
||||
.parse(process.argv);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ var utils = require('./cli-utils');
|
|||
program
|
||||
.version('0.0.1')
|
||||
.option('-c, --config [file]', 'Wallet config filename')
|
||||
.option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api')
|
||||
.option('-v, --verbose', 'be verbose')
|
||||
.parse(process.argv);
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ Utils.getClient = function(args) {
|
|||
});
|
||||
return new Client({
|
||||
storage: storage,
|
||||
baseUrl: args.host || process.env['BIT_HOST'],
|
||||
verbose: args.verbose
|
||||
});
|
||||
}
|
||||
|
|
|
@ -23,10 +23,6 @@ function _createProposalOpts(opts, signingKey) {
|
|||
return opts;
|
||||
};
|
||||
|
||||
function _getUrl(path) {
|
||||
return BASE_URL + path;
|
||||
};
|
||||
|
||||
function _parseError(body) {
|
||||
if (_.isString(body)) {
|
||||
try {
|
||||
|
@ -58,6 +54,7 @@ function API(opts) {
|
|||
this.storage = opts.storage;
|
||||
this.verbose = !!opts.verbose;
|
||||
this.request = request || opts.request;
|
||||
this.baseUrl = opts.baseUrl || BASE_URL;
|
||||
if (this.verbose) {
|
||||
log.level = 'debug';
|
||||
}
|
||||
|
@ -112,7 +109,7 @@ API.prototype._doRequest = function(method, url, args, data, cb) {
|
|||
if (data.signingPrivKey)
|
||||
reqSignature = _signRequest(method, url, args, data.signingPrivKey);
|
||||
|
||||
var absUrl = _getUrl(url);
|
||||
var absUrl = this.baseUrl + url;
|
||||
var args = {
|
||||
headers: {
|
||||
'x-identity': data.copayerId,
|
||||
|
|
Loading…
Reference in New Issue