rename rest client options to be more generic
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { AxiosRequestConfig } from 'axios';
|
||||
import { GenericAPIResponse, getBaseRESTInverseUrl, RestClientInverseOptions } from './util/requestUtils';
|
||||
import { GenericAPIResponse, getRestBaseUrl, RestClientOptions } from './util/requestUtils';
|
||||
import RequestWrapper from './util/requestWrapper';
|
||||
import SharedEndpoints from './shared-endpoints';
|
||||
|
||||
@@ -11,23 +11,22 @@ export class LinearClient extends SharedEndpoints {
|
||||
*
|
||||
* @param {string} key - your API key
|
||||
* @param {string} secret - your API secret
|
||||
* @param {boolean} [livenet=false]
|
||||
* @param {RestClientInverseOptions} [restInverseOptions={}] options to configure REST API connectivity
|
||||
* @param {boolean} [useLivenet=false]
|
||||
* @param {RestClientOptions} [restInverseOptions={}] options to configure REST API connectivity
|
||||
* @param {AxiosRequestConfig} [requestOptions={}] HTTP networking options for axios
|
||||
*/
|
||||
|
||||
constructor(
|
||||
key?: string | undefined,
|
||||
secret?: string | undefined,
|
||||
livenet?: boolean,
|
||||
restInverseOptions:RestClientInverseOptions = {}, // TODO: Rename this type to be more general.
|
||||
useLivenet?: boolean,
|
||||
restInverseOptions: RestClientOptions = {},
|
||||
requestOptions: AxiosRequestConfig = {}
|
||||
) {
|
||||
super()
|
||||
this.requestWrapper = new RequestWrapper(
|
||||
key,
|
||||
secret,
|
||||
getBaseRESTInverseUrl(livenet),
|
||||
getRestBaseUrl(useLivenet),
|
||||
restInverseOptions,
|
||||
requestOptions
|
||||
);
|
||||
@@ -46,7 +45,7 @@ export class LinearClient extends SharedEndpoints {
|
||||
from: number;
|
||||
limit?: number;
|
||||
}): GenericAPIResponse {
|
||||
return this.requestWrapper.get('/public/linear/kline', params);
|
||||
return this.requestWrapper.get('public/linear/kline', params);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +81,7 @@ export class LinearClient extends SharedEndpoints {
|
||||
}): GenericAPIResponse {
|
||||
return this.requestWrapper.get('public/linear/mark-price-kline', params);
|
||||
}
|
||||
|
||||
|
||||
getIndexPriceKline(params: {
|
||||
symbol: string;
|
||||
interval: string;
|
||||
|
||||
Reference in New Issue
Block a user