2021-07-23 17:37:28 -03:00
|
|
|
import { AxiosInstance } from 'axios';
|
|
|
|
|
import {
|
|
|
|
|
Adjustment,
|
|
|
|
|
DifficultyInstance,
|
|
|
|
|
} from '../../interfaces/bitcoin/difficulty';
|
|
|
|
|
|
|
|
|
|
export const useDifficulty = (api: AxiosInstance): DifficultyInstance => {
|
|
|
|
|
const getDifficultyAdjustment = async () => {
|
2021-08-04 08:09:29 -03:00
|
|
|
const { data } = await api.get<Adjustment>(`/v1/difficulty-adjustment`);
|
2021-07-23 17:37:28 -03:00
|
|
|
return data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
getDifficultyAdjustment,
|
|
|
|
|
};
|
|
|
|
|
};
|