add GET /txnotes/:txid endpoint

This commit is contained in:
Ivan Socolsky 2016-06-01 08:44:42 -03:00
parent ef08845b82
commit 5bba254ff0
No known key found for this signature in database
GPG Key ID: FAECE6A05FAA4F56
1 changed files with 12 additions and 0 deletions

View File

@ -514,6 +514,18 @@ ExpressApp.prototype.start = function(opts, cb) {
});
});
router.get('/v1/txnotes/:txid', function(req, res) {
getServerWithAuth(req, res, function(server) {
var opts = {
txid: req.params['txid'],
};
server.getTxNote(opts, function(err, note) {
if (err) return returnError(err, res, req);
res.json(note);
});
});
});
router.put('/v1/txnotes/:txid/', function(req, res) {
req.body.txid = req.params['txid'];
getServerWithAuth(req, res, function(server) {