Refactor acceleration tracking

This commit is contained in:
Mononaut
2023-05-30 19:35:39 -04:00
parent aa24f6a84d
commit c246db1cf9
4 changed files with 79 additions and 39 deletions

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();