Projected blocks API.
This commit is contained in:
parent
76f8af9048
commit
32623988ab
@ -251,6 +251,7 @@ class MempoolSpace {
|
|||||||
.get(config.API_ENDPOINT + 'transactions/height/:id', routes.$getgetTransactionsForBlock)
|
.get(config.API_ENDPOINT + 'transactions/height/:id', routes.$getgetTransactionsForBlock)
|
||||||
.get(config.API_ENDPOINT + 'transactions/projected/:id', routes.getgetTransactionsForProjectedBlock)
|
.get(config.API_ENDPOINT + 'transactions/projected/:id', routes.getgetTransactionsForProjectedBlock)
|
||||||
.get(config.API_ENDPOINT + 'fees/recommended', routes.getRecommendedFees)
|
.get(config.API_ENDPOINT + 'fees/recommended', routes.getRecommendedFees)
|
||||||
|
.get(config.API_ENDPOINT + 'fees/projected-blocks', routes.getProjectedBlocks)
|
||||||
.get(config.API_ENDPOINT + 'statistics/2h', routes.get2HStatistics)
|
.get(config.API_ENDPOINT + 'statistics/2h', routes.get2HStatistics)
|
||||||
.get(config.API_ENDPOINT + 'statistics/24h', routes.get24HStatistics)
|
.get(config.API_ENDPOINT + 'statistics/24h', routes.get24HStatistics)
|
||||||
.get(config.API_ENDPOINT + 'statistics/1w', routes.get1WHStatistics)
|
.get(config.API_ENDPOINT + 'statistics/1w', routes.get1WHStatistics)
|
||||||
|
@ -53,6 +53,19 @@ class Routes {
|
|||||||
res.status(500).send(e.message);
|
res.status(500).send(e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getProjectedBlocks(req, res) {
|
||||||
|
try {
|
||||||
|
let txId: string | undefined;
|
||||||
|
if (req.params.txId && /^[a-fA-F0-9]{64}$/.test(req.param.txId)) {
|
||||||
|
txId = req.params.txId;
|
||||||
|
}
|
||||||
|
const result = await projectedBlocks.getProjectedBlocks(txId, 6);
|
||||||
|
res.send(result);
|
||||||
|
} catch (e) {
|
||||||
|
res.status(500).send(e.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new Routes();
|
export default new Routes();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user