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.
33 lines
851 B
33 lines
851 B
#!/usr/bin/env node
|
|
|
|
var program = require('commander');
|
|
var Client = require('../lib/client');
|
|
var common = require('./common');
|
|
|
|
program
|
|
.version('0.0.1')
|
|
.option('-c, --config [file]', 'Wallet config filename')
|
|
.option('-v, --verbose', 'be verbose')
|
|
.usage('[options] <address> <amount> <message>')
|
|
.parse(process.argv);
|
|
|
|
var args = program.args;
|
|
if (!args[0] || !args[1] || !args[2])
|
|
program.help();
|
|
|
|
var address = args[0];
|
|
var amount = args[1];
|
|
var message = args[2];
|
|
|
|
var cli = new Client({
|
|
filename: program.config
|
|
});
|
|
|
|
cli.sendTxProposal({toAddress: address, amount: amount, message:message}, function(err, x) {
|
|
common.die(err);
|
|
console.log(' * Tx created: ID %s [%s] RequiredSignatures:',
|
|
x.id, x.status, x.requiredSignatures);
|
|
|
|
if (program.verbose)
|
|
console.log('* Raw Server Response:\n', x); //TODO
|
|
});
|
|
|