add express endpoint for sending tx

This commit is contained in:
Ivan Socolsky 2015-11-26 15:18:48 -03:00
parent 092c3ff37e
commit 0a5e144f93
1 changed files with 11 additions and 0 deletions

View File

@ -369,6 +369,17 @@ ExpressApp.prototype.start = function(opts, cb) {
}); });
}); });
router.post('/v1/txproposals/:id/send/', function(req, res) {
getServerWithAuth(req, res, function(server) {
req.body.txProposalId = req.params['id'];
server.sendTx(req.body, function(err, txp) {
if (err) return returnError(err, res, req);
res.json(txp);
res.end();
});
});
});
// TODO Check HTTP verb and URL name // TODO Check HTTP verb and URL name
router.post('/v1/txproposals/:id/broadcast/', function(req, res) { router.post('/v1/txproposals/:id/broadcast/', function(req, res) {
getServerWithAuth(req, res, function(server) { getServerWithAuth(req, res, function(server) {