Add difficulty adjustment endpoints methods.
This commit is contained in:
16
src/app/bitcoin/difficulty.ts
Normal file
16
src/app/bitcoin/difficulty.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { AxiosInstance } from 'axios';
|
||||
import {
|
||||
Adjustment,
|
||||
DifficultyInstance,
|
||||
} from '../../interfaces/bitcoin/difficulty';
|
||||
|
||||
export const useDifficulty = (api: AxiosInstance): DifficultyInstance => {
|
||||
const getDifficultyAdjustment = async () => {
|
||||
const { data } = await api.get<Adjustment>(`/difficulty-adjustment`);
|
||||
return data;
|
||||
};
|
||||
|
||||
return {
|
||||
getDifficultyAdjustment,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user