Refactor acceleration tracking
This commit is contained in:
20
backend/src/api/services/acceleration.ts
Normal file
20
backend/src/api/services/acceleration.ts
Normal 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();
|
||||
Reference in New Issue
Block a user