nowpayments-api-typescript
Version:
Nowpayments typescript API wrapper
28 lines (22 loc) • 702 B
text/typescript
import ApiConnection from './../utils/api-connection';
import { IGetMinimumPaymentAmount, IError } from './../interfaces';
export interface GetMinimumPaymentAmountResponse {
currency_from: string;
currency_to: string;
min_amount: number;
}
export interface GetMinimumPaymentAmount extends IGetMinimumPaymentAmount {
apiKey: string;
}
const getMinimumPaymentAmount = async ({
apiKey,
currency_from,
currency_to,
}: GetMinimumPaymentAmount): Promise<
GetMinimumPaymentAmountResponse | IError
> => {
const api = new ApiConnection({ apiKey });
const { data } = await api.get('/min-amount', { currency_from, currency_to });
return data;
};
export default getMinimumPaymentAmount;