Updated Comments for a clieaner look.

I also removed the three line comments in some endpoints as per request.
This commit is contained in:
CryptoCompiler
2021-01-22 15:51:58 +00:00
committed by GitHub
parent eb536d6b68
commit 0d6532df23

View File

@@ -33,11 +33,7 @@ export class InverseClient extends SharedEndpoints {
return this; return this;
} }
/** //------------Market Data Endpoints------------>
*
* Market Data Endpoints
*
*/
getKline(params: { getKline(params: {
symbol: string; symbol: string;
@@ -117,11 +113,7 @@ export class InverseClient extends SharedEndpoints {
return this.requestWrapper.get('v2/public/account-ratio', params); return this.requestWrapper.get('v2/public/account-ratio', params);
} }
/** //-----------Account Data Endpoints------------>
*
* Account Data Endpoints
*
*/
placeActiveOrder(orderRequest: { placeActiveOrder(orderRequest: {
side: string; side: string;
@@ -136,9 +128,6 @@ export class InverseClient extends SharedEndpoints {
close_on_trigger?: boolean; close_on_trigger?: boolean;
order_link_id?: string; order_link_id?: string;
}): GenericAPIResponse { }): GenericAPIResponse {
// if (orderRequest.order_type === 'Limit' && !orderRequest.price) {
// throw new Error('Price required for limit orders');
// }
return this.requestWrapper.post('v2/private/order/create', orderRequest); return this.requestWrapper.post('v2/private/order/create', orderRequest);
} }
@@ -157,9 +146,6 @@ export class InverseClient extends SharedEndpoints {
order_id?: string; order_id?: string;
order_link_id?: string; order_link_id?: string;
}): GenericAPIResponse { }): GenericAPIResponse {
// if (!params.order_id && !params.order_link_id) {
// throw new Error('Parameter order_id OR order_link_id is required');
// }
return this.requestWrapper.post('v2/private/order/cancel', params); return this.requestWrapper.post('v2/private/order/cancel', params);
} }
@@ -176,9 +162,6 @@ export class InverseClient extends SharedEndpoints {
p_r_qty?: string; p_r_qty?: string;
p_r_price?: string; p_r_price?: string;
}): GenericAPIResponse { }): GenericAPIResponse {
// if (!params.order_id && !params.order_link_id) {
// throw new Error('Parameter order_id OR order_link_id is required');
// }
return this.requestWrapper.post('v2/private/order/replace', params); return this.requestWrapper.post('v2/private/order/replace', params);
} }
@@ -187,9 +170,6 @@ export class InverseClient extends SharedEndpoints {
order_link_id?: string; order_link_id?: string;
symbol: string; symbol: string;
}): GenericAPIResponse { }): GenericAPIResponse {
// if (!params.order_id && !params.order_link_id) {
// throw new Error('Parameter order_id OR order_link_id is required');
// }
return this.requestWrapper.get('v2/private/order', params); return this.requestWrapper.get('v2/private/order', params);
} }
@@ -206,9 +186,6 @@ export class InverseClient extends SharedEndpoints {
close_on_trigger?: boolean; close_on_trigger?: boolean;
order_link_id?: string; order_link_id?: string;
}): GenericAPIResponse { }): GenericAPIResponse {
// if (params.order_type === 'Limit' && !params.price) {
// throw new Error('Parameter price is required for limit orders');
// }
return this.requestWrapper.post('v2/private/stop-order/create', params); return this.requestWrapper.post('v2/private/stop-order/create', params);
} }
@@ -227,9 +204,6 @@ export class InverseClient extends SharedEndpoints {
stop_order_id?: string; stop_order_id?: string;
order_link_id?: string; order_link_id?: string;
}): GenericAPIResponse { }): GenericAPIResponse {
// if (!params.stop_order_id && !params.order_link_id) {
// throw new Error('Parameter stop_order_id OR order_link_id is required');
// }
return this.requestWrapper.post('v2/private/stop-order/cancel', params); return this.requestWrapper.post('v2/private/stop-order/cancel', params);
} }
@@ -247,9 +221,6 @@ export class InverseClient extends SharedEndpoints {
p_r_price?: string; p_r_price?: string;
p_r_trigger_price?: string; p_r_trigger_price?: string;
}): GenericAPIResponse { }): GenericAPIResponse {
// if (!params.stop_order_id && !params.order_link_id) {
// throw new Error('Parameter stop_order_id OR order_link_id is required');
// }
return this.requestWrapper.post('v2/private/stop-order/replace', params); return this.requestWrapper.post('v2/private/stop-order/replace', params);
} }
@@ -258,9 +229,6 @@ export class InverseClient extends SharedEndpoints {
stop_order_id?: string; stop_order_id?: string;
order_link_id?: string; order_link_id?: string;
}): GenericAPIResponse { }): GenericAPIResponse {
// if (!params.stop_order_id && !params.order_link_id) {
// throw new Error('Parameter stop_order_id OR order_link_id is required');
// }
return this.requestWrapper.get('v2/private/stop-order', params); return this.requestWrapper.get('v2/private/stop-order', params);
} }
@@ -373,7 +341,6 @@ export class InverseClient extends SharedEndpoints {
return this.requestWrapper.get('v2/private/account/lcp', params); return this.requestWrapper.get('v2/private/account/lcp', params);
} }
async getTimeOffset(): Promise<number> { async getTimeOffset(): Promise<number> {
const start = Date.now(); const start = Date.now();
return this.getServerTime().then(result => { return this.getServerTime().then(result => {