You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
858 B
30 lines
858 B
#!/usr/bin/env node
|
|
|
|
var program = require('commander');
|
|
var qr = require('qr-image');
|
|
|
|
var Client = require('../lib/client');
|
|
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);
|
|
|
|
var args = program.args;
|
|
var client = utils.getClient(program);
|
|
|
|
client.export(function(err, x) {
|
|
utils.die(err);
|
|
if (program.qr) {
|
|
var filename = program.config + '.svg';
|
|
var qr_svg = qr.image(x, { type: 'svg' });
|
|
qr_svg.pipe(require('fs').createWriteStream(filename));
|
|
console.log('Wallet Critical Data: exported to ' + filename);
|
|
} else {
|
|
console.log('Wallet Critical Data:\n', x);
|
|
}
|
|
});
|
|
|