cleaning unnecessary optionals
This commit is contained in:
@@ -18,7 +18,7 @@ export class InverseClient extends SharedEndpoints {
|
|||||||
constructor(
|
constructor(
|
||||||
key?: string | undefined,
|
key?: string | undefined,
|
||||||
secret?: string | undefined,
|
secret?: string | undefined,
|
||||||
useLivenet?: boolean,
|
useLivenet: boolean = false,
|
||||||
restClientOptions: RestClientOptions = {},
|
restClientOptions: RestClientOptions = {},
|
||||||
requestOptions: AxiosRequestConfig = {}
|
requestOptions: AxiosRequestConfig = {}
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export class LinearClient extends SharedEndpoints {
|
|||||||
constructor(
|
constructor(
|
||||||
key?: string | undefined,
|
key?: string | undefined,
|
||||||
secret?: string | undefined,
|
secret?: string | undefined,
|
||||||
useLivenet?: boolean,
|
useLivenet: boolean = false,
|
||||||
restClientOptions: RestClientOptions = {},
|
restClientOptions: RestClientOptions = {},
|
||||||
requestOptions: AxiosRequestConfig = {}
|
requestOptions: AxiosRequestConfig = {}
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ export function serializeParams(params: object = {}, strict_validation = false):
|
|||||||
.join('&');
|
.join('&');
|
||||||
};
|
};
|
||||||
|
|
||||||
export function getRestBaseUrl(useLivenet?: boolean, restInverseOptions?: RestClientOptions) {
|
export function getRestBaseUrl(useLivenet: boolean, restInverseOptions: RestClientOptions) {
|
||||||
const baseUrlsInverse = {
|
const baseUrlsInverse = {
|
||||||
livenet: 'https://api.bybit.com',
|
livenet: 'https://api.bybit.com',
|
||||||
testnet: 'https://api-testnet.bybit.com'
|
testnet: 'https://api-testnet.bybit.com'
|
||||||
};
|
};
|
||||||
|
|
||||||
if (restInverseOptions?.baseUrl) {
|
if (restInverseOptions.baseUrl) {
|
||||||
return restInverseOptions.baseUrl;
|
return restInverseOptions.baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ export default class RequestUtil {
|
|||||||
this.secret = secret;
|
this.secret = secret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: type check that endpoint never starts with forward slash??
|
|
||||||
get(endpoint: string, params?: any): GenericAPIResponse {
|
get(endpoint: string, params?: any): GenericAPIResponse {
|
||||||
return this._call('GET', endpoint, params);
|
return this._call('GET', endpoint, params);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user