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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------Market Data Endpoints------------>
|
/**
|
||||||
|
*
|
||||||
|
* Market Data Endpoints
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
getKline(params: {
|
getKline(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
@@ -112,7 +116,15 @@ export class InverseClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('v2/public/premium-index-kline', params);
|
return this.requestWrapper.get('v2/public/premium-index-kline', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------Account Data Endpoints------------>
|
/**
|
||||||
|
*
|
||||||
|
* Account Data Endpoints
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Active orders
|
||||||
|
*/
|
||||||
|
|
||||||
placeActiveOrder(orderRequest: {
|
placeActiveOrder(orderRequest: {
|
||||||
side: string;
|
side: string;
|
||||||
@@ -172,6 +184,10 @@ export class InverseClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('v2/private/order', params);
|
return this.requestWrapper.get('v2/private/order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Conditional orders
|
||||||
|
*/
|
||||||
|
|
||||||
placeConditionalOrder(params: {
|
placeConditionalOrder(params: {
|
||||||
side: string;
|
side: string;
|
||||||
symbol: string;
|
symbol: string;
|
||||||
@@ -232,6 +248,10 @@ export class InverseClient extends SharedEndpoints {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Position
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
* @deprecated use getPosition() instead
|
* @deprecated use getPosition() instead
|
||||||
*/
|
*/
|
||||||
getUserLeverage(): GenericAPIResponse {
|
getUserLeverage(): GenericAPIResponse {
|
||||||
@@ -305,6 +325,10 @@ export class InverseClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('v2/private/trade/closed-pnl/list', params);
|
return this.requestWrapper.get('v2/private/trade/closed-pnl/list', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Risk Limit
|
||||||
|
*/
|
||||||
|
|
||||||
getRiskLimitList(): GenericAPIResponse {
|
getRiskLimitList(): GenericAPIResponse {
|
||||||
return this.requestWrapper.get('open-api/wallet/risk-limit/list');
|
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);
|
return this.requestWrapper.post('open-api/wallet/risk-limit', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Funding
|
||||||
|
*/
|
||||||
|
|
||||||
getLastFundingRate(params: {
|
getLastFundingRate(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
}): GenericAPIResponse {
|
}): GenericAPIResponse {
|
||||||
@@ -334,6 +362,10 @@ export class InverseClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('v2/private/funding/predicted-funding', params);
|
return this.requestWrapper.get('v2/private/funding/predicted-funding', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LCP Info
|
||||||
|
*/
|
||||||
|
|
||||||
getLcpInfo(params: {
|
getLcpInfo(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
}): GenericAPIResponse {
|
}): GenericAPIResponse {
|
||||||
|
|||||||
@@ -34,7 +34,11 @@ export class LinearClient extends SharedEndpoints {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------Market Data Endpoints------------>
|
/**
|
||||||
|
*
|
||||||
|
* Market Data Endpoints
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
getKline(params: {
|
getKline(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
@@ -97,9 +101,15 @@ export class LinearClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('public/linear/premium-index-kline', params);
|
return this.requestWrapper.get('public/linear/premium-index-kline', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------Account Data Endpoints------------>
|
/**
|
||||||
|
*
|
||||||
|
* Account Data Endpoints
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
//Active Orders
|
/**
|
||||||
|
* Active orders
|
||||||
|
*/
|
||||||
|
|
||||||
placeActiveOrder(params: {
|
placeActiveOrder(params: {
|
||||||
side: string;
|
side: string;
|
||||||
@@ -168,7 +178,9 @@ export class LinearClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('private/linear/order/search', params);
|
return this.requestWrapper.get('private/linear/order/search', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Conditional Orders
|
/**
|
||||||
|
* Conditional orders
|
||||||
|
*/
|
||||||
|
|
||||||
placeConditionalOrder(params: {
|
placeConditionalOrder(params: {
|
||||||
side: string;
|
side: string;
|
||||||
@@ -240,7 +252,9 @@ export class LinearClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('private/linear/stop-order/search', params);
|
return this.requestWrapper.get('private/linear/stop-order/search', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Position
|
/**
|
||||||
|
* Position
|
||||||
|
*/
|
||||||
|
|
||||||
getPosition(params?: {
|
getPosition(params?: {
|
||||||
symbol?: string;
|
symbol?: string;
|
||||||
@@ -324,7 +338,9 @@ export class LinearClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('private/linear/tpsl/switch-mode', params);
|
return this.requestWrapper.get('private/linear/tpsl/switch-mode', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Risk Limit
|
/**
|
||||||
|
* Risk Limit
|
||||||
|
*/
|
||||||
|
|
||||||
getRiskLimitList(params: {
|
getRiskLimitList(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
@@ -332,7 +348,9 @@ export class LinearClient extends SharedEndpoints {
|
|||||||
return this.requestWrapper.get('public/linear/risk-limit');
|
return this.requestWrapper.get('public/linear/risk-limit');
|
||||||
}
|
}
|
||||||
|
|
||||||
//Funding
|
/**
|
||||||
|
* Funding
|
||||||
|
*/
|
||||||
|
|
||||||
getPredictedFundingFee(params: {
|
getPredictedFundingFee(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ export default class SharedEndpoints {
|
|||||||
// TODO: Is there a way to say that Base has to provide this?
|
// TODO: Is there a way to say that Base has to provide this?
|
||||||
protected requestWrapper: RequestWrapper;
|
protected requestWrapper: RequestWrapper;
|
||||||
|
|
||||||
//------------Market Data Endpoints------------>
|
/**
|
||||||
|
*
|
||||||
|
* Market Data Endpoints
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
getOrderBook(params: {
|
getOrderBook(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
@@ -56,13 +60,21 @@ export default class 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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
getApiKeyInfo(): GenericAPIResponse {
|
getApiKeyInfo(): GenericAPIResponse {
|
||||||
return this.requestWrapper.get('v2/private/account/api-key');
|
return this.requestWrapper.get('v2/private/account/api-key');
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------Wallet Data Endpoints------------>
|
/**
|
||||||
|
*
|
||||||
|
* Wallet Data Endpoints
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
getWalletBalance(params: {
|
getWalletBalance(params: {
|
||||||
coin?: string;
|
coin?: string;
|
||||||
@@ -101,7 +113,11 @@ export default class SharedEndpoints {
|
|||||||
return this.requestWrapper.get('v2/private/wallet/withdraw/list', params);
|
return this.requestWrapper.get('v2/private/wallet/withdraw/list', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------API Data Endpoints------------->
|
/**
|
||||||
|
*
|
||||||
|
* API Data Endpoints
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
getServerTime(): GenericAPIResponse {
|
getServerTime(): GenericAPIResponse {
|
||||||
return this.requestWrapper.get('v2/public/time');
|
return this.requestWrapper.get('v2/public/time');
|
||||||
@@ -111,7 +127,7 @@ export default class SharedEndpoints {
|
|||||||
return this.requestWrapper.get('v2/public/announcement');
|
return this.requestWrapper.get('v2/public/announcement');
|
||||||
}
|
}
|
||||||
|
|
||||||
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 => {
|
||||||
const end = Date.now();
|
const end = Date.now();
|
||||||
|
|||||||
Reference in New Issue
Block a user