rename rest client options to be more generic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createHmac } from 'crypto';
|
||||
|
||||
export interface RestClientInverseOptions {
|
||||
export interface RestClientOptions {
|
||||
// override the max size of the request window (in ms)
|
||||
recv_window?: number;
|
||||
|
||||
@@ -42,7 +42,7 @@ export function serializeParams(params: object = {}, strict_validation = false):
|
||||
.join('&');
|
||||
};
|
||||
|
||||
export function getBaseRESTInverseUrl(useLivenet?: boolean, restInverseOptions?: RestClientInverseOptions) {
|
||||
export function getRestBaseUrl(useLivenet?: boolean, restInverseOptions?: RestClientOptions) {
|
||||
const baseUrlsInverse = {
|
||||
livenet: 'https://api.bybit.com',
|
||||
testnet: 'https://api-testnet.bybit.com'
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import axios, { AxiosRequestConfig, AxiosResponse, Method } from 'axios';
|
||||
|
||||
import { signMessage, serializeParams, RestClientInverseOptions, GenericAPIResponse, isPublicEndpoint } from './requestUtils';
|
||||
import { signMessage, serializeParams, RestClientOptions, GenericAPIResponse, isPublicEndpoint } from './requestUtils';
|
||||
|
||||
export default class RequestUtil {
|
||||
private timeOffset: number | null;
|
||||
private syncTimePromise: null | Promise<any>;
|
||||
private options: RestClientInverseOptions;
|
||||
private options: RestClientOptions;
|
||||
private baseUrl: string;
|
||||
private globalRequestOptions: AxiosRequestConfig;
|
||||
private key: string | undefined;
|
||||
@@ -15,7 +15,7 @@ export default class RequestUtil {
|
||||
key: string | undefined,
|
||||
secret: string | undefined,
|
||||
baseUrl: string,
|
||||
options: RestClientInverseOptions = {},
|
||||
options: RestClientOptions = {},
|
||||
requestOptions: AxiosRequestConfig = {}
|
||||
) {
|
||||
this.timeOffset = null;
|
||||
|
||||
Reference in New Issue
Block a user