UNPKG

@ninerealms/midgard-client

Version:
39 lines 1.41 kB
import BigNumber from 'bignumber.js'; import * as nodeFetch from 'node-fetch'; import { FetchConfig } from './config'; export declare type Type = 'swap' | 'addLiquidity'; export declare type Status = 'success' | 'available' | 'staged' | 'suspended'; export declare type IntervalKey = '5min' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; export interface PaginationRequest { limit: string | number; offset: string | number; } export interface IntervalResponse { startTime: string; endTime: string; } export interface Interval { startTime: Date; endTime: Date; } export declare const rawToInterval: (target: IntervalResponse) => Interval; export interface IntervalRequest { interval?: IntervalKey; count?: number | BigNumber; to?: number | string; from?: number | string; } export interface FetchInputs { body?: object | null; path: string; base?: string; method?: string; headers?: nodeFetch.HeaderInit; options?: object; } export declare const serverSaysJSON: (res: nodeFetch.Response) => boolean; export declare const toDate: (value: string) => Date; export declare const toBigNumber: (value: string, base?: number) => BigNumber; export declare const baseFetch: (config: FetchConfig) => <T>(options: FetchInputs) => Promise<T>; export declare const fetch: <T>(options: FetchInputs) => Promise<T>; //# sourceMappingURL=utils.d.ts.map