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.
31 lines
902 B
31 lines
902 B
#!/usr/bin/env node
|
|
|
|
var _ = require('lodash');
|
|
var program = require('commander');
|
|
var ClientLib = require('../lib/client');
|
|
var utils = require('./cli-utils');
|
|
|
|
program
|
|
.version('0.0.1')
|
|
.option('-c, --config [file]', 'Wallet config filename')
|
|
.option('-t, --testnet', 'Create a Testnet Wallet', String)
|
|
.usage('[options] <walletName> <m-n> [copayerName]')
|
|
.parse(process.argv);
|
|
|
|
var args = program.args;
|
|
if (!args[0])
|
|
program.help();
|
|
|
|
var walletName = args[0];
|
|
var copayerName = args[2] || process.env.USER;
|
|
var network = program.testnet ? 'testnet' : 'livenet';
|
|
|
|
var mn = utils.parseMN(args[1]);
|
|
|
|
var client = utils.getClient(program);
|
|
client.createWallet(walletName, copayerName, mn[0], mn[1], network, function(err, secret) {
|
|
utils.die(err);
|
|
console.log(' * ' + _.capitalize(network) + ' Wallet Created.');
|
|
if (secret)
|
|
console.log(' - Secret to share:\n\t' + secret);
|
|
});
|
|
|