From b6a17dcffeb8d5c81cab38e36746f9e445f866d4 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Sat, 6 Mar 2021 17:17:13 +0000 Subject: [PATCH] cleaning unnecessary optionals --- src/inverse-client.ts | 2 +- src/linear-client.ts | 2 +- src/util/requestUtils.ts | 4 ++-- src/util/requestWrapper.ts | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/inverse-client.ts b/src/inverse-client.ts index 2a1779e..f35eec8 100644 --- a/src/inverse-client.ts +++ b/src/inverse-client.ts @@ -18,7 +18,7 @@ export class InverseClient extends SharedEndpoints { constructor( key?: string | undefined, secret?: string | undefined, - useLivenet?: boolean, + useLivenet: boolean = false, restClientOptions: RestClientOptions = {}, requestOptions: AxiosRequestConfig = {} ) { diff --git a/src/linear-client.ts b/src/linear-client.ts index 4c11411..9efc57c 100644 --- a/src/linear-client.ts +++ b/src/linear-client.ts @@ -18,7 +18,7 @@ export class LinearClient extends SharedEndpoints { constructor( key?: string | undefined, secret?: string | undefined, - useLivenet?: boolean, + useLivenet: boolean = false, restClientOptions: RestClientOptions = {}, requestOptions: AxiosRequestConfig = {} ) { diff --git a/src/util/requestUtils.ts b/src/util/requestUtils.ts index 903a7a2..a54086c 100644 --- a/src/util/requestUtils.ts +++ b/src/util/requestUtils.ts @@ -42,13 +42,13 @@ export function serializeParams(params: object = {}, strict_validation = false): .join('&'); }; -export function getRestBaseUrl(useLivenet?: boolean, restInverseOptions?: RestClientOptions) { +export function getRestBaseUrl(useLivenet: boolean, restInverseOptions: RestClientOptions) { const baseUrlsInverse = { livenet: 'https://api.bybit.com', testnet: 'https://api-testnet.bybit.com' }; - if (restInverseOptions?.baseUrl) { + if (restInverseOptions.baseUrl) { return restInverseOptions.baseUrl; } diff --git a/src/util/requestWrapper.ts b/src/util/requestWrapper.ts index e19f8f3..e618bc6 100644 --- a/src/util/requestWrapper.ts +++ b/src/util/requestWrapper.ts @@ -55,7 +55,6 @@ export default class RequestUtil { this.secret = secret; } - // TODO: type check that endpoint never starts with forward slash?? get(endpoint: string, params?: any): GenericAPIResponse { return this._call('GET', endpoint, params); }