Transaction view.
This commit is contained in:
@@ -268,6 +268,7 @@ class MempoolSpace {
|
||||
this.app
|
||||
.get(config.API_ENDPOINT + 'explorer/blocks', routes.getBlocks)
|
||||
.get(config.API_ENDPOINT + 'explorer/blocks/:height', routes.getBlocks)
|
||||
.get(config.API_ENDPOINT + 'explorer/tx/:id', routes.getRawTransaction)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,15 @@ class Routes {
|
||||
res.status(500).send(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
public async getRawTransaction(req, res) {
|
||||
try {
|
||||
const result = await bitcoinApi.getRawTransaction(req.params.id);
|
||||
res.send(result);
|
||||
} catch (e) {
|
||||
res.status(500).send(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default new Routes();
|
||||
|
||||
Reference in New Issue
Block a user