From 569b0651842c5d46915c1483173f064be31a3271 Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Tue, 2 Feb 2021 00:31:57 +0000 Subject: [PATCH 01/10] Cryotojs Bugfix for vuejs in browser environments --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 47ac72c..11c61f4 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,9 @@ "webpack-bundle-analyzer": "^4.1.0", "webpack-cli": "^4.2.0" }, + "browser": { + "crypto": false + }, "keywords": [ "bybit", "api", From 8afaca5668469c5e9e89a09f61e6b9be9cfc036e Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Tue, 2 Feb 2021 10:32:28 +0000 Subject: [PATCH 02/10] fix --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index 11c61f4..47ac72c 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,6 @@ "webpack-bundle-analyzer": "^4.1.0", "webpack-cli": "^4.2.0" }, - "browser": { - "crypto": false - }, "keywords": [ "bybit", "api", From c233dfc79027e76e67329242f4ce0be78e26b74a Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Tue, 2 Feb 2021 11:38:14 +0000 Subject: [PATCH 03/10] Indenting and Comments --- src/linear-client.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/linear-client.ts b/src/linear-client.ts index ede59b3..0674f82 100644 --- a/src/linear-client.ts +++ b/src/linear-client.ts @@ -34,7 +34,11 @@ export class LinearClient extends SharedEndpoints { return this; } - //------------Market Data Endpoints------------> + /** + * + * Market Data Endpoints + * + */ getKline(params: { symbol: string; @@ -97,8 +101,12 @@ export class LinearClient extends SharedEndpoints { return this.requestWrapper.get('public/linear/premium-index-kline', params); } - //------------Account Data Endpoints------------> - + /** + * + * Account Data Endpoints + * + */ + //Active Orders placeActiveOrder(params: { From e6f21e99568de91b3ee1f27325a894971d9b785e Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Tue, 2 Feb 2021 11:51:53 +0000 Subject: [PATCH 04/10] comments --- src/inverse-client.ts | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/inverse-client.ts b/src/inverse-client.ts index 16b8471..d0f661f 100644 --- a/src/inverse-client.ts +++ b/src/inverse-client.ts @@ -33,7 +33,11 @@ export class InverseClient extends SharedEndpoints { return this; } - //------------Market Data Endpoints------------> + /** + * + * Market Data Endpoints + * + */ getKline(params: { symbol: string; @@ -112,7 +116,13 @@ export class InverseClient extends SharedEndpoints { return this.requestWrapper.get('v2/public/premium-index-kline', params); } - //-----------Account Data Endpoints------------> + /** + * + * Account Data Endpoints + * + */ + + //Active Orders placeActiveOrder(orderRequest: { side: string; @@ -171,6 +181,8 @@ export class InverseClient extends SharedEndpoints { }): GenericAPIResponse { return this.requestWrapper.get('v2/private/order', params); } + + //Conditional Orders placeConditionalOrder(params: { side: string; @@ -230,6 +242,8 @@ export class InverseClient extends SharedEndpoints { }): GenericAPIResponse { return this.requestWrapper.get('v2/private/stop-order', params); } + + //Position /** * @deprecated use getPosition() instead @@ -305,6 +319,8 @@ export class InverseClient extends SharedEndpoints { return this.requestWrapper.get('v2/private/trade/closed-pnl/list', params); } + //Risk Limit + getRiskLimitList(): GenericAPIResponse { return this.requestWrapper.get('open-api/wallet/risk-limit/list'); } @@ -315,6 +331,8 @@ export class InverseClient extends SharedEndpoints { }): GenericAPIResponse { return this.requestWrapper.post('open-api/wallet/risk-limit', params); } + + //Funding getLastFundingRate(params: { symbol: string; @@ -333,6 +351,8 @@ export class InverseClient extends SharedEndpoints { }): GenericAPIResponse { return this.requestWrapper.get('v2/private/funding/predicted-funding', params); } + + //misc getLcpInfo(params: { symbol: string; From 80c37cf3647641016f278b37ab05e2807a9ac180 Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Tue, 2 Feb 2021 11:51:59 +0000 Subject: [PATCH 05/10] comments --- src/linear-client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linear-client.ts b/src/linear-client.ts index 0674f82..e2b2261 100644 --- a/src/linear-client.ts +++ b/src/linear-client.ts @@ -77,12 +77,12 @@ export class LinearClient extends SharedEndpoints { getMarkPriceKline(params: { symbol: string; interval: string; - from: number; + from: number; limit?: number; }): GenericAPIResponse { return this.requestWrapper.get('public/linear/mark-price-kline', params); } - + getIndexPriceKline(params: { symbol: string; interval: string; From 3ceec80c17f8ee7bb46bd763078949a253a9d7c3 Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Tue, 2 Feb 2021 11:52:13 +0000 Subject: [PATCH 06/10] comments --- src/shared-endpoints.ts | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/shared-endpoints.ts b/src/shared-endpoints.ts index b77c4d3..dbb4bc9 100644 --- a/src/shared-endpoints.ts +++ b/src/shared-endpoints.ts @@ -5,7 +5,11 @@ export default class SharedEndpoints { // TODO: Is there a way to say that Base has to provide this? protected requestWrapper: RequestWrapper; - //------------Market Data Endpoints------------> + /** + * + * Market Data Endpoints + * + */ getOrderBook(params: { symbol: string; @@ -56,13 +60,21 @@ export default class SharedEndpoints { return this.requestWrapper.get('v2/public/account-ratio', params); } - //------------Account Data Endpoints------------> + /** + * + * Account Data Endpoints + * + */ getApiKeyInfo(): GenericAPIResponse { return this.requestWrapper.get('v2/private/account/api-key'); } - //------------Wallet Data Endpoints------------> + /** + * + * Wallet Data Endpoints + * + */ getWalletBalance(params: { coin?: string; @@ -101,7 +113,11 @@ export default class SharedEndpoints { return this.requestWrapper.get('v2/private/wallet/withdraw/list', params); } - //-------------API Data Endpoints-------------> + /** + * + * API Data Endpoints + * + */ getServerTime(): GenericAPIResponse { return this.requestWrapper.get('v2/public/time'); @@ -118,4 +134,4 @@ export default class SharedEndpoints { return Math.ceil((result.time_now * 1000) - end + ((end - start) / 2)); }); } -} \ No newline at end of file +} From 3881ccf605a0ed9bf387069bd6d94374bf873913 Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Tue, 2 Feb 2021 11:55:42 +0000 Subject: [PATCH 07/10] FINAL indent fix --- src/linear-client.ts | 582 +++++++++++++++++++++---------------------- 1 file changed, 291 insertions(+), 291 deletions(-) diff --git a/src/linear-client.ts b/src/linear-client.ts index e2b2261..9296f81 100644 --- a/src/linear-client.ts +++ b/src/linear-client.ts @@ -4,9 +4,9 @@ import RequestWrapper from './util/requestWrapper'; import SharedEndpoints from './shared-endpoints'; export class LinearClient extends SharedEndpoints { - protected requestWrapper: RequestWrapper; + protected requestWrapper: RequestWrapper; - /** + /** * @public Creates an instance of the inverse REST API client. * * @param {string} key - your API key @@ -16,23 +16,23 @@ export class LinearClient extends SharedEndpoints { * @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. - requestOptions: AxiosRequestConfig = {} - ) { - super() - this.requestWrapper = new RequestWrapper( - key, - secret, - getBaseRESTInverseUrl(livenet), - restInverseOptions, - requestOptions - ); - return this; - } + constructor( + key?: string | undefined, + secret?: string | undefined, + livenet?: boolean, + restInverseOptions:RestClientInverseOptions = {}, // TODO: Rename this type to be more general. + requestOptions: AxiosRequestConfig = {} + ) { + super() + this.requestWrapper = new RequestWrapper( + key, + secret, + getBaseRESTInverseUrl(livenet), + restInverseOptions, + requestOptions + ); + return this; + } /** * @@ -40,66 +40,66 @@ export class LinearClient extends SharedEndpoints { * */ - getKline(params: { - symbol: string; - interval: string; - from: number; - limit?: number; - }): GenericAPIResponse { - return this.requestWrapper.get('/public/linear/kline', params); - } + getKline(params: { + symbol: string; + interval: string; + from: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('/public/linear/kline', params); + } - /** - * @deprecated use getTrades() instead - */ - getPublicTradingRecords(params: { - symbol: string; - from?: number; - limit?: number; - }): GenericAPIResponse { - return this.getTrades(params); - } + /** + * @deprecated use getTrades() instead + */ + getPublicTradingRecords(params: { + symbol: string; + from?: number; + limit?: number; + }): GenericAPIResponse { + return this.getTrades(params); + } - getTrades(params: { - symbol: string; - //from?: number; - limit?: number; - }): GenericAPIResponse { - return this.requestWrapper.get('public/linear/recent-trading-records', params); - } + getTrades(params: { + symbol: string; + //from?: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('public/linear/recent-trading-records', params); + } - getLastFundingRate(params: { - symbol: string; - }): GenericAPIResponse { - return this.requestWrapper.get('public/linear/funding/prev-funding-rate', params); - } + getLastFundingRate(params: { + symbol: string; + }): GenericAPIResponse { + return this.requestWrapper.get('public/linear/funding/prev-funding-rate', params); + } - getMarkPriceKline(params: { - symbol: string; - interval: string; - from: number; - limit?: number; - }): GenericAPIResponse { - return this.requestWrapper.get('public/linear/mark-price-kline', params); - } - - getIndexPriceKline(params: { - symbol: string; - interval: string; - from: number; - limit?: number; - }): GenericAPIResponse { - return this.requestWrapper.get('public/linear/index-price-kline', params); - } + getMarkPriceKline(params: { + symbol: string; + interval: string; + from: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('public/linear/mark-price-kline', params); + } + + getIndexPriceKline(params: { + symbol: string; + interval: string; + from: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('public/linear/index-price-kline', params); + } - getPremiumIndexKline(params: { - symbol: string; - interval: string; - from: number; - limit?: number; - }): GenericAPIResponse { - return this.requestWrapper.get('public/linear/premium-index-kline', params); - } + getPremiumIndexKline(params: { + symbol: string; + interval: string; + from: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('public/linear/premium-index-kline', params); + } /** * @@ -107,251 +107,251 @@ export class LinearClient extends SharedEndpoints { * */ - //Active Orders + //Active Orders - placeActiveOrder(params: { - side: string; - symbol: string; - order_type: string; - qty: number; - price?: number; - time_in_force: string; - take_profit?: number; - stop_loss?: number; - tp_trigger_by?: string; - sl_trigger_by?: string; - reduce_only?: boolean; - close_on_trigger?: boolean; - order_link_id?: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/order/create', params); - } + placeActiveOrder(params: { + side: string; + symbol: string; + order_type: string; + qty: number; + price?: number; + time_in_force: string; + take_profit?: number; + stop_loss?: number; + tp_trigger_by?: string; + sl_trigger_by?: string; + reduce_only?: boolean; + close_on_trigger?: boolean; + order_link_id?: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/order/create', params); + } - getActiveOrderList(params: { - order_id?: string; - order_link_id?: string; - symbol: string; - order?: string; - page?: number; - limit?: number; - order_status?: string; + getActiveOrderList(params: { + order_id?: string; + order_link_id?: string; + symbol: string; + order?: string; + page?: number; + limit?: number; + order_status?: string; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/order/list', params); - } + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/order/list', params); + } - cancelActiveOrder(params: { - symbol: string; - order_id?: string; - order_link_id?: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/order/cancel', params); - } + cancelActiveOrder(params: { + symbol: string; + order_id?: string; + order_link_id?: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/order/cancel', params); + } - cancelAllActiveOrders(params: { - symbol: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/order/cancel-all', params); - } + cancelAllActiveOrders(params: { + symbol: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/order/cancel-all', params); + } - replaceActiveOrder(params: { - order_id?: string; - order_link_id?: string; - symbol: string; - p_r_qty?: number; - p_r_price?: number; - take_profit?: number; - stop_loss?: number; - tp_trigger_by?: string; - sl_trigger_by?: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/order/replace', params); - } + replaceActiveOrder(params: { + order_id?: string; + order_link_id?: string; + symbol: string; + p_r_qty?: number; + p_r_price?: number; + take_profit?: number; + stop_loss?: number; + tp_trigger_by?: string; + sl_trigger_by?: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/order/replace', params); + } - queryActiveOrder(params: { - order_id?: string; - order_link_id?: string; - symbol: string; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/order/search', params); - } + queryActiveOrder(params: { + order_id?: string; + order_link_id?: string; + symbol: string; + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/order/search', params); + } - //Conditional Orders + //Conditional Orders - placeConditionalOrder(params: { - side: string; - symbol: string; - order_type: string; - qty: number; - price?: number; - base_price: number; - stop_px: number; - time_in_force: string; - trigger_by?: string; - close_on_trigger?: boolean; - order_link_id?: string; - reduce_only: boolean; - take_profit?: number; - stop_loss?: number; - tp_trigger_by?: string; - sl_trigger_by?: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/stop-order/create', params); - } + placeConditionalOrder(params: { + side: string; + symbol: string; + order_type: string; + qty: number; + price?: number; + base_price: number; + stop_px: number; + time_in_force: string; + trigger_by?: string; + close_on_trigger?: boolean; + order_link_id?: string; + reduce_only: boolean; + take_profit?: number; + stop_loss?: number; + tp_trigger_by?: string; + sl_trigger_by?: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/stop-order/create', params); + } - getConditionalOrder(params: { - stop_order_id?: string; - order_link_id?: string; - symbol: string; - stop_order_status?: string; - order?: string; - page?: number; - limit?: number; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/stop-order/list', params); - } + getConditionalOrder(params: { + stop_order_id?: string; + order_link_id?: string; + symbol: string; + stop_order_status?: string; + order?: string; + page?: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/stop-order/list', params); + } - cancelConditionalOrder(params: { - symbol: string; - stop_order_id?: string; - order_link_id?: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/stop-order/cancel', params); - } + cancelConditionalOrder(params: { + symbol: string; + stop_order_id?: string; + order_link_id?: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/stop-order/cancel', params); + } - cancelAllConditionalOrders(params: { - symbol: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/stop-order/cancel-all', params); - } + cancelAllConditionalOrders(params: { + symbol: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/stop-order/cancel-all', params); + } - replaceConditionalOrder(params: { - stop_order_id?: string; - order_link_id?: string; - symbol: string; - p_r_qty?: number; - p_r_price?: number; - p_r_trigger_price?: number; - take_profit?: number; - stop_loss?: number; - tp_trigger_by?: string; - sl_trigger_by?: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/stop-order/replace', params); - } + replaceConditionalOrder(params: { + stop_order_id?: string; + order_link_id?: string; + symbol: string; + p_r_qty?: number; + p_r_price?: number; + p_r_trigger_price?: number; + take_profit?: number; + stop_loss?: number; + tp_trigger_by?: string; + sl_trigger_by?: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/stop-order/replace', params); + } - queryConditionalOrder(params: { - symbol: string; - stop_order_id?: string; - order_link_id?: string; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/stop-order/search', params); - } + queryConditionalOrder(params: { + symbol: string; + stop_order_id?: string; + order_link_id?: string; + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/stop-order/search', params); + } - //Position + //Position - getPosition(params?: { - symbol?: string; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/position/list', params); - } + getPosition(params?: { + symbol?: string; + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/position/list', params); + } - setAutoAddMargin(params?: { - symbol: string; - side: string; - auto_add_margin: boolean; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/position/set-auto-add-margin', params); - } + setAutoAddMargin(params?: { + symbol: string; + side: string; + auto_add_margin: boolean; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/position/set-auto-add-margin', params); + } - setMarginSwitch(params?: { - symbol: string; - is_isolated: boolean; - buy_leverage: number; - sell_leverage: number; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/position/switch-isolated', params); - } + setMarginSwitch(params?: { + symbol: string; + is_isolated: boolean; + buy_leverage: number; + sell_leverage: number; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/position/switch-isolated', params); + } - setSwitchMode(params?: { - symbol: string; - tp_sl_mode: string; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/tpsl/switch-mode', params); - } + setSwitchMode(params?: { + symbol: string; + tp_sl_mode: string; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/tpsl/switch-mode', params); + } - setAddReduceMargin(params?: { - symbol: string; - side: string; - margin: number; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/position/add-margin', params); - } + setAddReduceMargin(params?: { + symbol: string; + side: string; + margin: number; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/position/add-margin', params); + } - setUserLeverage(params: { - symbol: string; - buy_leverage: number; - sell_leverage: number; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/position/set-leverage', params); - } + setUserLeverage(params: { + symbol: string; + buy_leverage: number; + sell_leverage: number; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/position/set-leverage', params); + } - setTradingStop(params: { - symbol: string; - side: string; - take_profit?: number; - stop_loss?: number; - trailing_stop?: number; - tp_trigger_by?: string; - sl_trigger_by?: string; - sl_size?: number; - tp_size?: number; - }): GenericAPIResponse { - return this.requestWrapper.post('private/linear/position/trading-stop', params); - } + setTradingStop(params: { + symbol: string; + side: string; + take_profit?: number; + stop_loss?: number; + trailing_stop?: number; + tp_trigger_by?: string; + sl_trigger_by?: string; + sl_size?: number; + tp_size?: number; + }): GenericAPIResponse { + return this.requestWrapper.post('private/linear/position/trading-stop', params); + } - getTradeRecords(params: { - symbol: string; - start_time?: number; - end_time?: number; - exec_type?: string; - page?: number; - limit?: number; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/trade/execution/list', params); - } + getTradeRecords(params: { + symbol: string; + start_time?: number; + end_time?: number; + exec_type?: string; + page?: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/trade/execution/list', params); + } - getClosedPnl(params: { - symbol: string; - start_time?: number; - end_time?: number; - exec_type?: string; - page?: number; - limit?: number; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/tpsl/switch-mode', params); - } + getClosedPnl(params: { + symbol: string; + start_time?: number; + end_time?: number; + exec_type?: string; + page?: number; + limit?: number; + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/tpsl/switch-mode', params); + } - //Risk Limit + //Risk Limit - getRiskLimitList(params: { - symbol: string; - }): GenericAPIResponse { - return this.requestWrapper.get('public/linear/risk-limit'); - } + getRiskLimitList(params: { + symbol: string; + }): GenericAPIResponse { + return this.requestWrapper.get('public/linear/risk-limit'); + } - //Funding + //Funding - getPredictedFundingFee(params: { - symbol: string; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/funding/predicted-funding'); - } + getPredictedFundingFee(params: { + symbol: string; + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/funding/predicted-funding'); + } - getLastFundingFee(params: { - symbol: string; - }): GenericAPIResponse { - return this.requestWrapper.get('private/linear/funding/prev-funding'); - } + getLastFundingFee(params: { + symbol: string; + }): GenericAPIResponse { + return this.requestWrapper.get('private/linear/funding/prev-funding'); + } } From e8bc931bf17328fe2ccdb8a7be53cbcf2457d981 Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Wed, 3 Feb 2021 19:53:53 +0000 Subject: [PATCH 08/10] Comment Updates --- src/inverse-client.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/inverse-client.ts b/src/inverse-client.ts index d0f661f..a22e327 100644 --- a/src/inverse-client.ts +++ b/src/inverse-client.ts @@ -122,7 +122,9 @@ export class InverseClient extends SharedEndpoints { * */ - //Active Orders + /** + * Active orders + */ placeActiveOrder(orderRequest: { side: string; @@ -182,7 +184,9 @@ export class InverseClient extends SharedEndpoints { return this.requestWrapper.get('v2/private/order', params); } - //Conditional Orders + /** + * Conditional orders + */ placeConditionalOrder(params: { side: string; @@ -243,7 +247,9 @@ export class InverseClient extends SharedEndpoints { return this.requestWrapper.get('v2/private/stop-order', params); } - //Position + /** + * Position + */ /** * @deprecated use getPosition() instead @@ -319,7 +325,9 @@ export class InverseClient extends SharedEndpoints { return this.requestWrapper.get('v2/private/trade/closed-pnl/list', params); } - //Risk Limit + /** + * Risk Limit + */ getRiskLimitList(): GenericAPIResponse { return this.requestWrapper.get('open-api/wallet/risk-limit/list'); @@ -332,7 +340,9 @@ export class InverseClient extends SharedEndpoints { return this.requestWrapper.post('open-api/wallet/risk-limit', params); } - //Funding + /** + * Funding + */ getLastFundingRate(params: { symbol: string; @@ -352,7 +362,9 @@ export class InverseClient extends SharedEndpoints { return this.requestWrapper.get('v2/private/funding/predicted-funding', params); } - //misc + /** + * LCP Info + */ getLcpInfo(params: { symbol: string; From 5a968f79a92eee7a9f617791044221a44cec6a5d Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Wed, 3 Feb 2021 19:54:01 +0000 Subject: [PATCH 09/10] Comment Updates --- src/shared-endpoints.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared-endpoints.ts b/src/shared-endpoints.ts index dbb4bc9..fe7daed 100644 --- a/src/shared-endpoints.ts +++ b/src/shared-endpoints.ts @@ -113,7 +113,7 @@ export default class SharedEndpoints { return this.requestWrapper.get('v2/private/wallet/withdraw/list', params); } - /** + /** * * API Data Endpoints * @@ -127,7 +127,7 @@ export default class SharedEndpoints { return this.requestWrapper.get('v2/public/announcement'); } - async getTimeOffset(): Promise < number > { + async getTimeOffset(): Promise { const start = Date.now(); return this.getServerTime().then(result => { const end = Date.now(); From e0839d0c8db5001b5f75b0fe51fe9620af7b4bd3 Mon Sep 17 00:00:00 2001 From: peepopoggers <72892531+peepopoggers@users.noreply.github.com> Date: Wed, 3 Feb 2021 19:54:52 +0000 Subject: [PATCH 10/10] Comment Updates --- src/linear-client.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/linear-client.ts b/src/linear-client.ts index 9296f81..e62f9e0 100644 --- a/src/linear-client.ts +++ b/src/linear-client.ts @@ -106,8 +106,10 @@ export class LinearClient extends SharedEndpoints { * Account Data Endpoints * */ - - //Active Orders + + /** + * Active orders + */ placeActiveOrder(params: { side: string; @@ -176,7 +178,9 @@ export class LinearClient extends SharedEndpoints { return this.requestWrapper.get('private/linear/order/search', params); } - //Conditional Orders + /** + * Conditional orders + */ placeConditionalOrder(params: { side: string; @@ -248,7 +252,9 @@ export class LinearClient extends SharedEndpoints { return this.requestWrapper.get('private/linear/stop-order/search', params); } - //Position + /** + * Position + */ getPosition(params?: { symbol?: string; @@ -332,7 +338,9 @@ export class LinearClient extends SharedEndpoints { return this.requestWrapper.get('private/linear/tpsl/switch-mode', params); } - //Risk Limit + /** + * Risk Limit + */ getRiskLimitList(params: { symbol: string; @@ -340,7 +348,9 @@ export class LinearClient extends SharedEndpoints { return this.requestWrapper.get('public/linear/risk-limit'); } - //Funding + /** + * Funding + */ getPredictedFundingFee(params: { symbol: string;