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.

42 lines
881 B

10 years ago
#!/usr/bin/env node
10 years ago
var _ = require('lodash');
10 years ago
var program = require('commander');
var ClientLib = require('../lib/client');
10 years ago
var common = require('./common');
program
10 years ago
.version('0.0.1')
.option('-c,--config [file]', 'Wallet config filename')
.option('-v,--verbose', 'be verbose')
.usage('[options] <txpid>')
.parse(process.argv);
10 years ago
var args = program.args;
10 years ago
if (!args[0])
10 years ago
program.help();
10 years ago
var txpid = args[0];
10 years ago
10 years ago
var cli = new ClientLib({
filename: program.config
10 years ago
});
10 years ago
cli.getTxProposals({}, function(err, txps) {
10 years ago
common.die(err);
10 years ago
10 years ago
if (program.verbose)
10 years ago
console.log('* Raw Server Response:\n', txps); //TODO
10 years ago
10 years ago
var txp = common.findOneTxProposal(txps, txpid);
10 years ago
10 years ago
cli.signTxProposal(txp, function(err, tx) {
10 years ago
common.die(err);
if (program.verbose)
10 years ago
console.log('* Raw Server Response:\n', tx); //TODO
10 years ago
console.log('Transaction signed.');
});
10 years ago
});