Merge branch 'master' of github.com:peepopoggers/bybit-api into masterp
This commit is contained in:
@@ -33,7 +33,11 @@ export class InverseClient extends SharedEndpoints {
|
||||
return this;
|
||||
}
|
||||
|
||||
//------------Market Data Endpoints------------>
|
||||
/**
|
||||
*
|
||||
* Market Data Endpoints
|
||||
*
|
||||
*/
|
||||
|
||||
getKline(params: {
|
||||
symbol: string;
|
||||
@@ -112,7 +116,15 @@ 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;
|
||||
@@ -172,6 +184,10 @@ export class InverseClient extends SharedEndpoints {
|
||||
return this.requestWrapper.get('v2/private/order', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditional orders
|
||||
*/
|
||||
|
||||
placeConditionalOrder(params: {
|
||||
side: string;
|
||||
symbol: string;
|
||||
@@ -232,6 +248,10 @@ export class InverseClient extends SharedEndpoints {
|
||||
}
|
||||
|
||||
/**
|
||||
* Position
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated use getPosition() instead
|
||||
*/
|
||||
getUserLeverage(): GenericAPIResponse {
|
||||
@@ -305,6 +325,10 @@ 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');
|
||||
}
|
||||
@@ -316,6 +340,10 @@ export class InverseClient extends SharedEndpoints {
|
||||
return this.requestWrapper.post('open-api/wallet/risk-limit', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Funding
|
||||
*/
|
||||
|
||||
getLastFundingRate(params: {
|
||||
symbol: string;
|
||||
}): GenericAPIResponse {
|
||||
@@ -334,6 +362,10 @@ export class InverseClient extends SharedEndpoints {
|
||||
return this.requestWrapper.get('v2/private/funding/predicted-funding', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* LCP Info
|
||||
*/
|
||||
|
||||
getLcpInfo(params: {
|
||||
symbol: string;
|
||||
}): GenericAPIResponse {
|
||||
|
||||
@@ -34,7 +34,11 @@ export class LinearClient extends SharedEndpoints {
|
||||
return this;
|
||||
}
|
||||
|
||||
//------------Market Data Endpoints------------>
|
||||
/**
|
||||
*
|
||||
* Market Data Endpoints
|
||||
*
|
||||
*/
|
||||
|
||||
getKline(params: {
|
||||
symbol: string;
|
||||
@@ -97,9 +101,15 @@ export class LinearClient extends SharedEndpoints {
|
||||
return this.requestWrapper.get('public/linear/premium-index-kline', params);
|
||||
}
|
||||
|
||||
//------------Account Data Endpoints------------>
|
||||
/**
|
||||
*
|
||||
* Account Data Endpoints
|
||||
*
|
||||
*/
|
||||
|
||||
//Active Orders
|
||||
/**
|
||||
* Active orders
|
||||
*/
|
||||
|
||||
placeActiveOrder(params: {
|
||||
side: string;
|
||||
@@ -168,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;
|
||||
@@ -240,7 +252,9 @@ export class LinearClient extends SharedEndpoints {
|
||||
return this.requestWrapper.get('private/linear/stop-order/search', params);
|
||||
}
|
||||
|
||||
//Position
|
||||
/**
|
||||
* Position
|
||||
*/
|
||||
|
||||
getPosition(params?: {
|
||||
symbol?: string;
|
||||
@@ -324,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;
|
||||
@@ -332,7 +348,9 @@ export class LinearClient extends SharedEndpoints {
|
||||
return this.requestWrapper.get('public/linear/risk-limit');
|
||||
}
|
||||
|
||||
//Funding
|
||||
/**
|
||||
* Funding
|
||||
*/
|
||||
|
||||
getPredictedFundingFee(params: {
|
||||
symbol: string;
|
||||
|
||||
@@ -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');
|
||||
@@ -111,7 +127,7 @@ export default class SharedEndpoints {
|
||||
return this.requestWrapper.get('v2/public/announcement');
|
||||
}
|
||||
|
||||
async getTimeOffset(): Promise < number > {
|
||||
async getTimeOffset(): Promise<number> {
|
||||
const start = Date.now();
|
||||
return this.getServerTime().then(result => {
|
||||
const end = Date.now();
|
||||
|
||||
Reference in New Issue
Block a user