* - Refactoring code. - Refactoring folder structure. - Adding apiEndpoint and websocketEndpoint to Mempool config. - Adding brownserify feature. - Adding MIT LICENSE * - Changing package.json information. - Reorganizing README.md information. - Default export for CommonJs and ES6 Modules. - Changing default variable to mempoolJS. - Organizing the API and WS providers. - Splitting websocket connection types: client and server. * Change version to 2.2.0. Reorder keywords in alphabetical order.
22 lines
559 B
TypeScript
22 lines
559 B
TypeScript
import { AxiosInstance } from 'axios';
|
|
import { FeesRecommended, FeesMempoolBlocks, FeeInstance } from '../interfaces';
|
|
|
|
export const useFees = (api: AxiosInstance): FeeInstance => {
|
|
const getFeesRecommended = async () => {
|
|
const { data } = await api.get<FeesRecommended>(`/v1/fees/recommended`);
|
|
return data;
|
|
};
|
|
|
|
const getFeesMempoolBlocks = async () => {
|
|
const { data } = await api.get<FeesMempoolBlocks[]>(
|
|
`/v1/fees/mempool-blocks`
|
|
);
|
|
return data;
|
|
};
|
|
|
|
return {
|
|
getFeesRecommended,
|
|
getFeesMempoolBlocks,
|
|
};
|
|
};
|