bybit-api 3.10.30 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +301 -178
- package/lib/index.d.ts +0 -11
- package/lib/index.js +0 -11
- package/lib/index.js.map +1 -1
- package/lib/rest-client-v5.d.ts +1 -1
- package/lib/rest-client-v5.js +1 -1
- package/lib/spot-client-v3.d.ts +8 -81
- package/lib/spot-client-v3.js +7 -172
- package/lib/spot-client-v3.js.map +1 -1
- package/lib/types/index.d.ts +1 -2
- package/lib/types/index.js +1 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/request/index.d.ts +0 -1
- package/lib/types/request/index.js +0 -1
- package/lib/types/request/index.js.map +1 -1
- package/lib/types/request/v5-account.d.ts +1 -1
- package/lib/types/request/v5-asset.d.ts +1 -1
- package/lib/types/request/v5-market.d.ts +1 -1
- package/lib/types/request/v5-position.d.ts +1 -1
- package/lib/types/request/v5-pre-upgrade.d.ts +1 -1
- package/lib/types/request/v5-spot-leverage-token.d.ts +1 -1
- package/lib/types/request/v5-trade.d.ts +1 -1
- package/lib/types/request/v5-user.d.ts +1 -1
- package/lib/types/response/v5-account.d.ts +1 -1
- package/lib/types/response/v5-asset.d.ts +1 -1
- package/lib/types/response/v5-market.d.ts +1 -1
- package/lib/types/response/v5-position.d.ts +1 -1
- package/lib/types/response/v5-spot-leverage-token.d.ts +1 -1
- package/lib/types/response/v5-trade.d.ts +1 -1
- package/lib/types/response/v5-user.d.ts +1 -1
- package/lib/types/{request/spot.js → shared-v5.js} +1 -1
- package/lib/types/shared-v5.js.map +1 -0
- package/lib/types/shared.d.ts +1 -19
- package/lib/types/websockets/index.d.ts +3 -0
- package/lib/types/websockets/index.js +20 -0
- package/lib/types/websockets/index.js.map +1 -0
- package/lib/types/websockets/ws-api.d.ts +73 -0
- package/lib/types/websockets/ws-api.js +10 -0
- package/lib/types/websockets/ws-api.js.map +1 -0
- package/lib/types/websockets/ws-confirmations.d.ts +13 -0
- package/lib/types/{websocket.events.js → websockets/ws-confirmations.js} +1 -1
- package/lib/types/websockets/ws-confirmations.js.map +1 -0
- package/lib/types/{websocket.events.d.ts → websockets/ws-events.d.ts} +9 -3
- package/lib/types/websockets/ws-events.js +11 -0
- package/lib/types/websockets/ws-events.js.map +1 -0
- package/lib/types/{websockets.d.ts → websockets/ws-general.d.ts} +35 -10
- package/lib/types/{v5-shared.js → websockets/ws-general.js} +1 -1
- package/lib/types/websockets/ws-general.js.map +1 -0
- package/lib/util/BaseRestClient.d.ts +1 -1
- package/lib/util/BaseRestClient.js +15 -39
- package/lib/util/BaseRestClient.js.map +1 -1
- package/lib/util/BaseWSClient.d.ts +221 -0
- package/lib/util/BaseWSClient.js +733 -0
- package/lib/util/BaseWSClient.js.map +1 -0
- package/lib/util/index.d.ts +1 -2
- package/lib/util/index.js +1 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/logger.d.ts +2 -5
- package/lib/util/logger.js +3 -12
- package/lib/util/logger.js.map +1 -1
- package/lib/util/requestUtils.d.ts +7 -10
- package/lib/util/requestUtils.js +6 -33
- package/lib/util/requestUtils.js.map +1 -1
- package/lib/util/typeGuards.d.ts +7 -1
- package/lib/util/typeGuards.js +41 -5
- package/lib/util/typeGuards.js.map +1 -1
- package/lib/util/webCryptoAPI.d.ts +10 -0
- package/lib/util/webCryptoAPI.js +69 -0
- package/lib/util/webCryptoAPI.js.map +1 -0
- package/lib/util/websockets/WsStore.d.ts +71 -0
- package/lib/util/websockets/WsStore.js +269 -0
- package/lib/util/websockets/WsStore.js.map +1 -0
- package/lib/util/websockets/WsStore.types.d.ts +50 -0
- package/lib/util/websockets/WsStore.types.js +14 -0
- package/lib/util/websockets/WsStore.types.js.map +1 -0
- package/lib/util/websockets/index.d.ts +3 -0
- package/lib/util/websockets/index.js +20 -0
- package/lib/util/websockets/index.js.map +1 -0
- package/lib/util/websockets/websocket-util.d.ts +92 -0
- package/lib/util/websockets/websocket-util.js +280 -0
- package/lib/util/websockets/websocket-util.js.map +1 -0
- package/lib/websocket-client.d.ts +107 -114
- package/lib/websocket-client.js +422 -716
- package/lib/websocket-client.js.map +1 -1
- package/package.json +4 -4
- package/lib/account-asset-client-v3.d.ts +0 -87
- package/lib/account-asset-client-v3.js +0 -154
- package/lib/account-asset-client-v3.js.map +0 -1
- package/lib/account-asset-client.d.ts +0 -46
- package/lib/account-asset-client.js +0 -108
- package/lib/account-asset-client.js.map +0 -1
- package/lib/contract-client.d.ts +0 -136
- package/lib/contract-client.js +0 -251
- package/lib/contract-client.js.map +0 -1
- package/lib/copy-trading-client.d.ts +0 -60
- package/lib/copy-trading-client.js +0 -114
- package/lib/copy-trading-client.js.map +0 -1
- package/lib/inverse-client.d.ts +0 -104
- package/lib/inverse-client.js +0 -213
- package/lib/inverse-client.js.map +0 -1
- package/lib/inverse-futures-client.d.ts +0 -217
- package/lib/inverse-futures-client.js +0 -224
- package/lib/inverse-futures-client.js.map +0 -1
- package/lib/linear-client.d.ts +0 -112
- package/lib/linear-client.js +0 -225
- package/lib/linear-client.js.map +0 -1
- package/lib/spot-client.d.ts +0 -46
- package/lib/spot-client.js +0 -131
- package/lib/spot-client.js.map +0 -1
- package/lib/types/request/spot.d.ts +0 -79
- package/lib/types/request/spot.js.map +0 -1
- package/lib/types/v5-shared.js.map +0 -1
- package/lib/types/websocket.events.js.map +0 -1
- package/lib/types/websockets.js +0 -3
- package/lib/types/websockets.js.map +0 -1
- package/lib/types/ws-events/failed-topic-subscription-confirmation.d.ts +0 -4
- package/lib/types/ws-events/failed-topic-subscription-confirmation.js +0 -3
- package/lib/types/ws-events/failed-topic-subscription-confirmation.js.map +0 -1
- package/lib/types/ws-events/succeeded-topic-subscription-confirmation.d.ts +0 -4
- package/lib/types/ws-events/succeeded-topic-subscription-confirmation.js +0 -3
- package/lib/types/ws-events/succeeded-topic-subscription-confirmation.js.map +0 -1
- package/lib/types/ws-events/topic-subscription-confirmation.d.ts +0 -7
- package/lib/types/ws-events/topic-subscription-confirmation.js +0 -3
- package/lib/types/ws-events/topic-subscription-confirmation.js.map +0 -1
- package/lib/unified-margin-client.d.ts +0 -140
- package/lib/unified-margin-client.js +0 -270
- package/lib/unified-margin-client.js.map +0 -1
- package/lib/usdc-option-client.d.ts +0 -110
- package/lib/usdc-option-client.js +0 -196
- package/lib/usdc-option-client.js.map +0 -1
- package/lib/usdc-perpetual-client.d.ts +0 -97
- package/lib/usdc-perpetual-client.js +0 -191
- package/lib/usdc-perpetual-client.js.map +0 -1
- package/lib/util/WsStore.d.ts +0 -57
- package/lib/util/WsStore.js +0 -97
- package/lib/util/WsStore.js.map +0 -1
- package/lib/util/browser-support.d.ts +0 -1
- package/lib/util/browser-support.js +0 -26
- package/lib/util/browser-support.js.map +0 -1
- package/lib/util/node-support.d.ts +0 -2
- package/lib/util/node-support.js +0 -21
- package/lib/util/node-support.js.map +0 -1
- package/lib/util/websocket-util.d.ts +0 -68
- package/lib/util/websocket-util.js +0 -506
- package/lib/util/websocket-util.js.map +0 -1
- /package/lib/types/{v5-shared.d.ts → shared-v5.d.ts} +0 -0
package/lib/inverse-client.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { APIResponseWithTime, AssetExchangeRecordsReq, CoinParam, InverseActiveConditionalOrderRequest, InverseActiveOrdersRequest, InverseCancelConditionalOrderRequest, InverseCancelOrderRequest, InverseChangePositionMarginRequest, InverseConditionalOrderRequest, InverseGetClosedPnlRequest, InverseGetOrderRequest, InverseGetTradeRecordsRequest, InverseOrderRequest, InverseReplaceConditionalOrderRequest, InverseReplaceOrderRequest, InverseSetLeverageRequest, InverseSetMarginTypeRequest, InverseSetSlTpPositionModeRequest, InverseSetTradingStopRequest, SymbolInfo, SymbolIntervalFromLimitParam, SymbolLimitParam, SymbolParam, SymbolPeriodLimitParam, WalletFundRecordsReq, WithdrawRecordsReq } from './types';
|
|
2
|
-
import BaseRestClient from './util/BaseRestClient';
|
|
3
|
-
/**
|
|
4
|
-
* REST API client for Inverse Perpetual Futures APIs (v2)
|
|
5
|
-
*
|
|
6
|
-
* @deprecated WARNING: V1/V2 private endpoints (Rest API & Websocket Stream) for mainnet
|
|
7
|
-
* will be switched off gradually from 30 Oct 2023 UTC, so they are not promised a stability.
|
|
8
|
-
* Please note that you are at your own risk of using old endpoints going forward, and please move to V5 ASAP.
|
|
9
|
-
*/
|
|
10
|
-
export declare class InverseClient extends BaseRestClient {
|
|
11
|
-
getClientType(): "inverse";
|
|
12
|
-
fetchServerTime(): Promise<number>;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* Market Data Endpoints
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
getOrderBook(params: SymbolParam): Promise<APIResponseWithTime<any[]>>;
|
|
19
|
-
getKline(params: SymbolIntervalFromLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
20
|
-
/**
|
|
21
|
-
* Get latest information for symbol
|
|
22
|
-
*/
|
|
23
|
-
getTickers(params?: Partial<SymbolParam>): Promise<APIResponseWithTime<any[]>>;
|
|
24
|
-
getTrades(params: SymbolLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
25
|
-
getSymbols(): Promise<APIResponseWithTime<SymbolInfo[]>>;
|
|
26
|
-
getMarkPriceKline(params: SymbolIntervalFromLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
27
|
-
getIndexPriceKline(params: SymbolIntervalFromLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
28
|
-
getPremiumIndexKline(params: SymbolIntervalFromLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* Market Data : Advanced
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
getOpenInterest(params: SymbolPeriodLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
35
|
-
getLatestBigDeal(params: SymbolLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
36
|
-
getLongShortRatio(params: SymbolPeriodLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* Account Data Endpoints
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
getApiKeyInfo(): Promise<APIResponseWithTime<any>>;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* Wallet Data Endpoints
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
getWalletBalance(params?: Partial<CoinParam>): Promise<APIResponseWithTime<any>>;
|
|
49
|
-
getWalletFundRecords(params?: WalletFundRecordsReq): Promise<APIResponseWithTime<any>>;
|
|
50
|
-
getWithdrawRecords(params?: WithdrawRecordsReq): Promise<APIResponseWithTime<any>>;
|
|
51
|
-
getAssetExchangeRecords(params?: AssetExchangeRecordsReq): Promise<APIResponseWithTime<any>>;
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* API Data Endpoints
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
getServerTime(): Promise<APIResponseWithTime<{}>>;
|
|
58
|
-
getApiAnnouncements(): Promise<APIResponseWithTime<any[]>>;
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* Account Data Endpoints
|
|
62
|
-
*
|
|
63
|
-
*/
|
|
64
|
-
/**
|
|
65
|
-
* Active orders
|
|
66
|
-
*/
|
|
67
|
-
placeActiveOrder(orderRequest: InverseOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
68
|
-
getActiveOrderList(params: InverseActiveOrdersRequest): Promise<APIResponseWithTime<any>>;
|
|
69
|
-
cancelActiveOrder(params: InverseCancelOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
70
|
-
cancelAllActiveOrders(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
71
|
-
replaceActiveOrder(params: InverseReplaceOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
72
|
-
queryActiveOrder(params: InverseGetOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
73
|
-
/**
|
|
74
|
-
* Conditional orders
|
|
75
|
-
*/
|
|
76
|
-
placeConditionalOrder(params: InverseConditionalOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
77
|
-
/** get conditional order list. This may see delays, use queryConditionalOrder() for real-time queries */
|
|
78
|
-
getConditionalOrder(params: InverseActiveConditionalOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
79
|
-
cancelConditionalOrder(params: InverseCancelConditionalOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
80
|
-
cancelAllConditionalOrders(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
81
|
-
replaceConditionalOrder(params: InverseReplaceConditionalOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
82
|
-
queryConditionalOrder(params: InverseGetOrderRequest): Promise<APIResponseWithTime<any>>;
|
|
83
|
-
/**
|
|
84
|
-
* Position
|
|
85
|
-
*/
|
|
86
|
-
getPosition(params?: Partial<SymbolParam>): Promise<APIResponseWithTime<any>>;
|
|
87
|
-
changePositionMargin(params: InverseChangePositionMarginRequest): Promise<APIResponseWithTime<any>>;
|
|
88
|
-
setTradingStop(params: InverseSetTradingStopRequest): Promise<APIResponseWithTime<any>>;
|
|
89
|
-
setUserLeverage(params: InverseSetLeverageRequest): Promise<APIResponseWithTime<any>>;
|
|
90
|
-
getTradeRecords(params: InverseGetTradeRecordsRequest): Promise<APIResponseWithTime<any>>;
|
|
91
|
-
getClosedPnl(params: InverseGetClosedPnlRequest): Promise<APIResponseWithTime<any>>;
|
|
92
|
-
setSlTpPositionMode(params: InverseSetSlTpPositionModeRequest): Promise<APIResponseWithTime<any>>;
|
|
93
|
-
setMarginType(params: InverseSetMarginTypeRequest): Promise<APIResponseWithTime<any>>;
|
|
94
|
-
/**
|
|
95
|
-
* Funding
|
|
96
|
-
*/
|
|
97
|
-
getLastFundingRate(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
98
|
-
getMyLastFundingFee(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
99
|
-
getPredictedFunding(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
100
|
-
/**
|
|
101
|
-
* LCP Info
|
|
102
|
-
*/
|
|
103
|
-
getLcpInfo(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
104
|
-
}
|
package/lib/inverse-client.js
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.InverseClient = void 0;
|
|
16
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
17
|
-
const util_1 = require("./util");
|
|
18
|
-
const BaseRestClient_1 = __importDefault(require("./util/BaseRestClient"));
|
|
19
|
-
/**
|
|
20
|
-
* REST API client for Inverse Perpetual Futures APIs (v2)
|
|
21
|
-
*
|
|
22
|
-
* @deprecated WARNING: V1/V2 private endpoints (Rest API & Websocket Stream) for mainnet
|
|
23
|
-
* will be switched off gradually from 30 Oct 2023 UTC, so they are not promised a stability.
|
|
24
|
-
* Please note that you are at your own risk of using old endpoints going forward, and please move to V5 ASAP.
|
|
25
|
-
*/
|
|
26
|
-
class InverseClient extends BaseRestClient_1.default {
|
|
27
|
-
getClientType() {
|
|
28
|
-
return util_1.REST_CLIENT_TYPE_ENUM.inverse;
|
|
29
|
-
}
|
|
30
|
-
fetchServerTime() {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const res = yield this.getServerTime();
|
|
33
|
-
return Number(res.time_now);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* Market Data Endpoints
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
getOrderBook(params) {
|
|
42
|
-
return this.get('v2/public/orderBook/L2', params);
|
|
43
|
-
}
|
|
44
|
-
getKline(params) {
|
|
45
|
-
return this.get('v2/public/kline/list', params);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get latest information for symbol
|
|
49
|
-
*/
|
|
50
|
-
getTickers(params) {
|
|
51
|
-
return this.get('v2/public/tickers', params);
|
|
52
|
-
}
|
|
53
|
-
getTrades(params) {
|
|
54
|
-
return this.get('v2/public/trading-records', params);
|
|
55
|
-
}
|
|
56
|
-
getSymbols() {
|
|
57
|
-
return this.get('v2/public/symbols');
|
|
58
|
-
}
|
|
59
|
-
getMarkPriceKline(params) {
|
|
60
|
-
return this.get('v2/public/mark-price-kline', params);
|
|
61
|
-
}
|
|
62
|
-
getIndexPriceKline(params) {
|
|
63
|
-
return this.get('v2/public/index-price-kline', params);
|
|
64
|
-
}
|
|
65
|
-
getPremiumIndexKline(params) {
|
|
66
|
-
return this.get('v2/public/premium-index-kline', params);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
*
|
|
70
|
-
* Market Data : Advanced
|
|
71
|
-
*
|
|
72
|
-
*/
|
|
73
|
-
getOpenInterest(params) {
|
|
74
|
-
return this.get('v2/public/open-interest', params);
|
|
75
|
-
}
|
|
76
|
-
getLatestBigDeal(params) {
|
|
77
|
-
return this.get('v2/public/big-deal', params);
|
|
78
|
-
}
|
|
79
|
-
getLongShortRatio(params) {
|
|
80
|
-
return this.get('v2/public/account-ratio', params);
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
* Account Data Endpoints
|
|
85
|
-
*
|
|
86
|
-
*/
|
|
87
|
-
getApiKeyInfo() {
|
|
88
|
-
return this.getPrivate('v2/private/account/api-key');
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* Wallet Data Endpoints
|
|
93
|
-
*
|
|
94
|
-
*/
|
|
95
|
-
getWalletBalance(params) {
|
|
96
|
-
return this.getPrivate('v2/private/wallet/balance', params);
|
|
97
|
-
}
|
|
98
|
-
getWalletFundRecords(params) {
|
|
99
|
-
return this.getPrivate('v2/private/wallet/fund/records', params);
|
|
100
|
-
}
|
|
101
|
-
getWithdrawRecords(params) {
|
|
102
|
-
return this.getPrivate('v2/private/wallet/withdraw/list', params);
|
|
103
|
-
}
|
|
104
|
-
getAssetExchangeRecords(params) {
|
|
105
|
-
return this.getPrivate('v2/private/exchange-order/list', params);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
* API Data Endpoints
|
|
110
|
-
*
|
|
111
|
-
*/
|
|
112
|
-
getServerTime() {
|
|
113
|
-
return this.get('v2/public/time');
|
|
114
|
-
}
|
|
115
|
-
getApiAnnouncements() {
|
|
116
|
-
return this.get('v2/public/announcement');
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
*
|
|
120
|
-
* Account Data Endpoints
|
|
121
|
-
*
|
|
122
|
-
*/
|
|
123
|
-
/**
|
|
124
|
-
* Active orders
|
|
125
|
-
*/
|
|
126
|
-
placeActiveOrder(orderRequest) {
|
|
127
|
-
return this.postPrivate('v2/private/order/create', orderRequest);
|
|
128
|
-
}
|
|
129
|
-
getActiveOrderList(params) {
|
|
130
|
-
return this.getPrivate('v2/private/order/list', params);
|
|
131
|
-
}
|
|
132
|
-
cancelActiveOrder(params) {
|
|
133
|
-
return this.postPrivate('v2/private/order/cancel', params);
|
|
134
|
-
}
|
|
135
|
-
cancelAllActiveOrders(params) {
|
|
136
|
-
return this.postPrivate('v2/private/order/cancelAll', params);
|
|
137
|
-
}
|
|
138
|
-
replaceActiveOrder(params) {
|
|
139
|
-
return this.postPrivate('v2/private/order/replace', params);
|
|
140
|
-
}
|
|
141
|
-
queryActiveOrder(params) {
|
|
142
|
-
return this.getPrivate('v2/private/order', params);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Conditional orders
|
|
146
|
-
*/
|
|
147
|
-
placeConditionalOrder(params) {
|
|
148
|
-
return this.postPrivate('v2/private/stop-order/create', params);
|
|
149
|
-
}
|
|
150
|
-
/** get conditional order list. This may see delays, use queryConditionalOrder() for real-time queries */
|
|
151
|
-
getConditionalOrder(params) {
|
|
152
|
-
return this.getPrivate('v2/private/stop-order/list', params);
|
|
153
|
-
}
|
|
154
|
-
cancelConditionalOrder(params) {
|
|
155
|
-
return this.postPrivate('v2/private/stop-order/cancel', params);
|
|
156
|
-
}
|
|
157
|
-
cancelAllConditionalOrders(params) {
|
|
158
|
-
return this.postPrivate('v2/private/stop-order/cancelAll', params);
|
|
159
|
-
}
|
|
160
|
-
replaceConditionalOrder(params) {
|
|
161
|
-
return this.postPrivate('v2/private/stop-order/replace', params);
|
|
162
|
-
}
|
|
163
|
-
queryConditionalOrder(params) {
|
|
164
|
-
return this.getPrivate('v2/private/stop-order', params);
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Position
|
|
168
|
-
*/
|
|
169
|
-
getPosition(params) {
|
|
170
|
-
return this.getPrivate('v2/private/position/list', params);
|
|
171
|
-
}
|
|
172
|
-
changePositionMargin(params) {
|
|
173
|
-
return this.postPrivate('position/change-position-margin', params);
|
|
174
|
-
}
|
|
175
|
-
setTradingStop(params) {
|
|
176
|
-
return this.postPrivate('v2/private/position/trading-stop', params);
|
|
177
|
-
}
|
|
178
|
-
setUserLeverage(params) {
|
|
179
|
-
return this.postPrivate('v2/private/position/leverage/save', params);
|
|
180
|
-
}
|
|
181
|
-
getTradeRecords(params) {
|
|
182
|
-
return this.getPrivate('v2/private/execution/list', params);
|
|
183
|
-
}
|
|
184
|
-
getClosedPnl(params) {
|
|
185
|
-
return this.getPrivate('v2/private/trade/closed-pnl/list', params);
|
|
186
|
-
}
|
|
187
|
-
setSlTpPositionMode(params) {
|
|
188
|
-
return this.postPrivate('v2/private/tpsl/switch-mode', params);
|
|
189
|
-
}
|
|
190
|
-
setMarginType(params) {
|
|
191
|
-
return this.postPrivate('v2/private/position/switch-isolated', params);
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Funding
|
|
195
|
-
*/
|
|
196
|
-
getLastFundingRate(params) {
|
|
197
|
-
return this.get('v2/public/funding/prev-funding-rate', params);
|
|
198
|
-
}
|
|
199
|
-
getMyLastFundingFee(params) {
|
|
200
|
-
return this.getPrivate('v2/private/funding/prev-funding', params);
|
|
201
|
-
}
|
|
202
|
-
getPredictedFunding(params) {
|
|
203
|
-
return this.getPrivate('v2/private/funding/predicted-funding', params);
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* LCP Info
|
|
207
|
-
*/
|
|
208
|
-
getLcpInfo(params) {
|
|
209
|
-
return this.getPrivate('v2/private/account/lcp', params);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
exports.InverseClient = InverseClient;
|
|
213
|
-
//# sourceMappingURL=inverse-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inverse-client.js","sourceRoot":"","sources":["../src/inverse-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,iCAA+C;AA6B/C,2EAAmD;AAEnD;;;;;;GAMG;AACH,MAAa,aAAc,SAAQ,wBAAc;IAC/C,aAAa;QACX,OAAO,4BAAqB,CAAC,OAAO,CAAC;IACvC,CAAC;IAEK,eAAe;;YACnB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YACvC,OAAO,M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I,CAAC,WAAW,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED,eAAe,CACb,MAAqC;QAErC,OAAO,IAAI,CAAC,UAAU,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED,YAAY,CACV,MAAkC;QAElC,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;IAED,mBAAmB,CACjB,MAAyC;QAEzC,OAAO,IAAI,CAAC,WAAW,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAED,aAAa,CACX,MAAmC;QAEnC,OAAO,IAAI,CAAC,WAAW,CAAC,qCAAqC,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IAEH,kBAAkB,CAAC,MAAmB;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,qCAAqC,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAED,mBAAmB,CAAC,MAAmB;QACrC,OAAO,IAAI,CAAC,UAAU,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;IAED,mBAAmB,CAAC,MAAmB;QACrC,OAAO,IAAI,CAAC,UAAU,CAAC,sCAAsC,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IAEH,UAAU,CAAC,MAAmB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF;AA7SD,sCA6SC"}
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { APIResponseWithTime, AssetExchangeRecordsReq, CoinParam, SymbolInfo, SymbolIntervalFromLimitParam, SymbolLimitParam, SymbolParam, SymbolPeriodLimitParam, WalletFundRecordsReq, WithdrawRecordsReq } from './types/shared';
|
|
2
|
-
import BaseRestClient from './util/BaseRestClient';
|
|
3
|
-
/**
|
|
4
|
-
* REST API client for Inverse Futures APIs (e.g. quarterly futures) (v2)
|
|
5
|
-
*
|
|
6
|
-
* @deprecated WARNING: V1/V2 private endpoints (Rest API & Websocket Stream) for mainnet
|
|
7
|
-
* will be switched off gradually from 30 Oct 2023 UTC, so they are not promised a stability.
|
|
8
|
-
* Please note that you are at your own risk of using old endpoints going forward, and please move to V5 ASAP.
|
|
9
|
-
*/
|
|
10
|
-
export declare class InverseFuturesClient extends BaseRestClient {
|
|
11
|
-
getClientType(): "inverseFutures";
|
|
12
|
-
fetchServerTime(): Promise<number>;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* Market Data Endpoints
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
getOrderBook(params: SymbolParam): Promise<APIResponseWithTime<any[]>>;
|
|
19
|
-
getKline(params: SymbolIntervalFromLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
20
|
-
/**
|
|
21
|
-
* Get latest information for symbol
|
|
22
|
-
*/
|
|
23
|
-
getTickers(params?: Partial<SymbolParam>): Promise<APIResponseWithTime<any[]>>;
|
|
24
|
-
/**
|
|
25
|
-
* Public trading records
|
|
26
|
-
*/
|
|
27
|
-
getTrades(params: SymbolLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
28
|
-
getSymbols(): Promise<APIResponseWithTime<SymbolInfo[]>>;
|
|
29
|
-
getMarkPriceKline(params: SymbolIntervalFromLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
30
|
-
getIndexPriceKline(params: SymbolIntervalFromLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
31
|
-
getPremiumIndexKline(params: SymbolIntervalFromLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* Market Data : Advanced
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
getOpenInterest(params: SymbolPeriodLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
38
|
-
getLatestBigDeal(params: SymbolLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
39
|
-
getLongShortRatio(params: SymbolPeriodLimitParam): Promise<APIResponseWithTime<any[]>>;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* Account Data Endpoints
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
getApiKeyInfo(): Promise<APIResponseWithTime<any>>;
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* Wallet Data Endpoints
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
getWalletBalance(params?: Partial<CoinParam>): Promise<APIResponseWithTime<any>>;
|
|
52
|
-
getWalletFundRecords(params?: WalletFundRecordsReq): Promise<APIResponseWithTime<any>>;
|
|
53
|
-
getWithdrawRecords(params?: WithdrawRecordsReq): Promise<APIResponseWithTime<any>>;
|
|
54
|
-
getAssetExchangeRecords(params?: AssetExchangeRecordsReq): Promise<APIResponseWithTime<any>>;
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* API Data Endpoints
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
getServerTime(): Promise<APIResponseWithTime<{}>>;
|
|
61
|
-
getApiAnnouncements(): Promise<APIResponseWithTime<any>>;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* Account Data Endpoints
|
|
65
|
-
*
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* Active orders
|
|
69
|
-
*/
|
|
70
|
-
placeActiveOrder(orderRequest: {
|
|
71
|
-
side: string;
|
|
72
|
-
symbol: string;
|
|
73
|
-
order_type: string;
|
|
74
|
-
qty: number;
|
|
75
|
-
price?: number;
|
|
76
|
-
time_in_force: string;
|
|
77
|
-
take_profit?: number;
|
|
78
|
-
stop_loss?: number;
|
|
79
|
-
reduce_only?: boolean;
|
|
80
|
-
close_on_trigger?: boolean;
|
|
81
|
-
order_link_id?: string;
|
|
82
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
83
|
-
getActiveOrderList(params: {
|
|
84
|
-
symbol: string;
|
|
85
|
-
order_status?: string;
|
|
86
|
-
direction?: string;
|
|
87
|
-
limit?: number;
|
|
88
|
-
cursor?: string;
|
|
89
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
90
|
-
cancelActiveOrder(params: {
|
|
91
|
-
symbol: string;
|
|
92
|
-
order_id?: string;
|
|
93
|
-
order_link_id?: string;
|
|
94
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
95
|
-
cancelAllActiveOrders(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
96
|
-
replaceActiveOrder(params: {
|
|
97
|
-
order_id?: string;
|
|
98
|
-
order_link_id?: string;
|
|
99
|
-
symbol: string;
|
|
100
|
-
p_r_qty?: string;
|
|
101
|
-
p_r_price?: string;
|
|
102
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
103
|
-
queryActiveOrder(params: {
|
|
104
|
-
order_id?: string;
|
|
105
|
-
order_link_id?: string;
|
|
106
|
-
symbol: string;
|
|
107
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
108
|
-
/**
|
|
109
|
-
* Conditional orders
|
|
110
|
-
*/
|
|
111
|
-
placeConditionalOrder(params: {
|
|
112
|
-
side: string;
|
|
113
|
-
symbol: string;
|
|
114
|
-
order_type: string;
|
|
115
|
-
qty: string;
|
|
116
|
-
price?: string;
|
|
117
|
-
base_price: string;
|
|
118
|
-
stop_px: string;
|
|
119
|
-
time_in_force: string;
|
|
120
|
-
trigger_by?: string;
|
|
121
|
-
close_on_trigger?: boolean;
|
|
122
|
-
order_link_id?: string;
|
|
123
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
124
|
-
getConditionalOrder(params: {
|
|
125
|
-
symbol: string;
|
|
126
|
-
stop_order_status?: string;
|
|
127
|
-
direction?: string;
|
|
128
|
-
limit?: number;
|
|
129
|
-
cursor?: string;
|
|
130
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
131
|
-
cancelConditionalOrder(params: {
|
|
132
|
-
symbol: string;
|
|
133
|
-
stop_order_id?: string;
|
|
134
|
-
order_link_id?: string;
|
|
135
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
136
|
-
cancelAllConditionalOrders(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
137
|
-
replaceConditionalOrder(params: {
|
|
138
|
-
stop_order_id?: string;
|
|
139
|
-
order_link_id?: string;
|
|
140
|
-
symbol: string;
|
|
141
|
-
p_r_qty?: number;
|
|
142
|
-
p_r_price?: string;
|
|
143
|
-
p_r_trigger_price?: string;
|
|
144
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
145
|
-
queryConditionalOrder(params: {
|
|
146
|
-
symbol: string;
|
|
147
|
-
stop_order_id?: string;
|
|
148
|
-
order_link_id?: string;
|
|
149
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
150
|
-
/**
|
|
151
|
-
* Position
|
|
152
|
-
*/
|
|
153
|
-
/**
|
|
154
|
-
* Get position list
|
|
155
|
-
*/
|
|
156
|
-
getPosition(params?: Partial<SymbolParam>): Promise<APIResponseWithTime<any>>;
|
|
157
|
-
changePositionMargin(params: {
|
|
158
|
-
symbol: string;
|
|
159
|
-
margin: string;
|
|
160
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
161
|
-
setTradingStop(params: {
|
|
162
|
-
symbol: string;
|
|
163
|
-
take_profit?: number;
|
|
164
|
-
stop_loss?: number;
|
|
165
|
-
trailing_stop?: number;
|
|
166
|
-
tp_trigger_by?: string;
|
|
167
|
-
sl_trigger_by?: string;
|
|
168
|
-
new_trailing_active?: number;
|
|
169
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
170
|
-
setUserLeverage(params: {
|
|
171
|
-
symbol: string;
|
|
172
|
-
buy_leverage: number;
|
|
173
|
-
sell_leverage: number;
|
|
174
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
175
|
-
/**
|
|
176
|
-
* Position mode switch
|
|
177
|
-
*/
|
|
178
|
-
setPositionMode(params: {
|
|
179
|
-
symbol: string;
|
|
180
|
-
mode: number;
|
|
181
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
182
|
-
/**
|
|
183
|
-
* Cross/Isolated margin switch. Must set leverage value when switching.
|
|
184
|
-
*/
|
|
185
|
-
setMarginType(params: {
|
|
186
|
-
symbol: string;
|
|
187
|
-
is_isolated: boolean;
|
|
188
|
-
buy_leverage: number;
|
|
189
|
-
sell_leverage: number;
|
|
190
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
191
|
-
getTradeRecords(params: {
|
|
192
|
-
order_id?: string;
|
|
193
|
-
symbol: string;
|
|
194
|
-
start_time?: number;
|
|
195
|
-
page?: number;
|
|
196
|
-
limit?: number;
|
|
197
|
-
order?: string;
|
|
198
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
199
|
-
getClosedPnl(params: {
|
|
200
|
-
symbol: string;
|
|
201
|
-
start_time?: number;
|
|
202
|
-
end_time?: number;
|
|
203
|
-
exec_type?: string;
|
|
204
|
-
page?: number;
|
|
205
|
-
limit?: number;
|
|
206
|
-
}): Promise<APIResponseWithTime<any>>;
|
|
207
|
-
/**
|
|
208
|
-
* Funding
|
|
209
|
-
*/
|
|
210
|
-
getLastFundingRate(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
211
|
-
getMyLastFundingFee(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
212
|
-
getPredictedFunding(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
213
|
-
/**
|
|
214
|
-
* LCP Info
|
|
215
|
-
*/
|
|
216
|
-
getLcpInfo(params: SymbolParam): Promise<APIResponseWithTime<any>>;
|
|
217
|
-
}
|