Elements blockchain parser. Save all peg in/out i the database.

This commit is contained in:
softsimon
2021-09-18 13:37:25 +04:00
parent 641d2ad028
commit aa39bbd091
7 changed files with 162 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ import blocks from './api/blocks';
import loadingIndicators from './api/loading-indicators';
import { Common } from './api/common';
import bitcoinClient from './api/bitcoin/bitcoin-client';
import elementsParser from './api/liquid/elements-parser';
class Routes {
constructor() {}
@@ -754,6 +755,15 @@ class Routes {
res.status(500).send(e instanceof Error ? e.message : e);
}
}
public async $getElementsPegsByMonth(req: Request, res: Response) {
try {
const pegs = await elementsParser.$getPegDataByMonth();
res.json(pegs);
} catch (e) {
res.status(500).send(e instanceof Error ? e.message : e);
}
}
}
export default new Routes();