okx-api
Version:
Complete Node.js SDK for OKX's REST APIs and WebSockets, with TypeScript & end-to-end tests
31 lines (30 loc) • 1.13 kB
TypeScript
import { AxiosRequestConfig } from 'axios';
import { RestClientOptions } from '../types/rest/client.js';
export declare const MISSING_CREDENTIALS_ERROR = "Private endpoints require api and secret to be provided in the REST client constructor";
export default abstract class BaseRestClient {
private options;
private baseUrl;
private globalRequestOptions;
private apiKey;
private apiSecret;
private apiPassphrase;
constructor(options?: RestClientOptions, requestOptions?: AxiosRequestConfig);
get(endpoint: string, params?: any): Promise<any>;
post(endpoint: string, params?: any): Promise<any>;
getPrivate(endpoint: string, params?: any): Promise<any>;
postPrivate(endpoint: string, params?: any): Promise<any>;
deletePrivate(endpoint: string, params?: any): Promise<any>;
/**
* Make a HTTP request to a specific endpoint. Private endpoints are automatically signed.
*/
private _call;
private signMessage;
/**
* Sign request
*/
private signRequest;
/**
* Generic handler to parse request exceptions
*/
private parseException;
}