Refactor acceleration tracking

This commit is contained in:
Mononaut committed 2023-07-26 15:08:33 +09:00
1 parent aa24f6a84d
commit c246db1cf9
4 files changed
+79 -39

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { query } from '../../utils/axios-query';
import config from '../../config';
export interface Acceleration {
txid: string,
feeDelta: number,
}
class AccelerationApi {
public async fetchAccelerations$(): Promise<Acceleration[]> {
if (config.MEMPOOL_SERVICES.ACCELERATIONS) {
const response = await query(`${config.MEMPOOL_SERVICES.API}/accelerations`);
return (response as Acceleration[]) || [];
} else {
return [];
}
}
}
export default new AccelerationApi();