bybit-api 3.10.30 → 4.0.0-beta.1

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.
Files changed (146) hide show
  1. package/README.md +301 -178
  2. package/lib/index.d.ts +0 -11
  3. package/lib/index.js +0 -11
  4. package/lib/index.js.map +1 -1
  5. package/lib/rest-client-v5.d.ts +1 -1
  6. package/lib/rest-client-v5.js +1 -1
  7. package/lib/spot-client-v3.d.ts +8 -81
  8. package/lib/spot-client-v3.js +7 -172
  9. package/lib/spot-client-v3.js.map +1 -1
  10. package/lib/types/index.d.ts +1 -2
  11. package/lib/types/index.js +1 -2
  12. package/lib/types/index.js.map +1 -1
  13. package/lib/types/request/index.d.ts +0 -1
  14. package/lib/types/request/index.js +0 -1
  15. package/lib/types/request/index.js.map +1 -1
  16. package/lib/types/request/v5-account.d.ts +1 -1
  17. package/lib/types/request/v5-asset.d.ts +1 -1
  18. package/lib/types/request/v5-market.d.ts +1 -1
  19. package/lib/types/request/v5-position.d.ts +1 -1
  20. package/lib/types/request/v5-pre-upgrade.d.ts +1 -1
  21. package/lib/types/request/v5-spot-leverage-token.d.ts +1 -1
  22. package/lib/types/request/v5-trade.d.ts +1 -1
  23. package/lib/types/request/v5-user.d.ts +1 -1
  24. package/lib/types/response/v5-account.d.ts +1 -1
  25. package/lib/types/response/v5-asset.d.ts +1 -1
  26. package/lib/types/response/v5-market.d.ts +1 -1
  27. package/lib/types/response/v5-position.d.ts +1 -1
  28. package/lib/types/response/v5-spot-leverage-token.d.ts +1 -1
  29. package/lib/types/response/v5-trade.d.ts +1 -1
  30. package/lib/types/response/v5-user.d.ts +1 -1
  31. package/lib/types/{request/spot.js → shared-v5.js} +1 -1
  32. package/lib/types/shared-v5.js.map +1 -0
  33. package/lib/types/shared.d.ts +1 -19
  34. package/lib/types/websockets/index.d.ts +3 -0
  35. package/lib/types/websockets/index.js +20 -0
  36. package/lib/types/websockets/index.js.map +1 -0
  37. package/lib/types/websockets/ws-api.d.ts +73 -0
  38. package/lib/types/websockets/ws-api.js +10 -0
  39. package/lib/types/websockets/ws-api.js.map +1 -0
  40. package/lib/types/websockets/ws-confirmations.d.ts +13 -0
  41. package/lib/types/{websocket.events.js → websockets/ws-confirmations.js} +1 -1
  42. package/lib/types/websockets/ws-confirmations.js.map +1 -0
  43. package/lib/types/{websocket.events.d.ts → websockets/ws-events.d.ts} +9 -3
  44. package/lib/types/websockets/ws-events.js +11 -0
  45. package/lib/types/websockets/ws-events.js.map +1 -0
  46. package/lib/types/{websockets.d.ts → websockets/ws-general.d.ts} +35 -10
  47. package/lib/types/{v5-shared.js → websockets/ws-general.js} +1 -1
  48. package/lib/types/websockets/ws-general.js.map +1 -0
  49. package/lib/util/BaseRestClient.d.ts +1 -1
  50. package/lib/util/BaseRestClient.js +15 -39
  51. package/lib/util/BaseRestClient.js.map +1 -1
  52. package/lib/util/BaseWSClient.d.ts +221 -0
  53. package/lib/util/BaseWSClient.js +733 -0
  54. package/lib/util/BaseWSClient.js.map +1 -0
  55. package/lib/util/index.d.ts +1 -2
  56. package/lib/util/index.js +1 -2
  57. package/lib/util/index.js.map +1 -1
  58. package/lib/util/logger.d.ts +2 -5
  59. package/lib/util/logger.js +3 -12
  60. package/lib/util/logger.js.map +1 -1
  61. package/lib/util/requestUtils.d.ts +7 -10
  62. package/lib/util/requestUtils.js +6 -33
  63. package/lib/util/requestUtils.js.map +1 -1
  64. package/lib/util/typeGuards.d.ts +7 -1
  65. package/lib/util/typeGuards.js +41 -5
  66. package/lib/util/typeGuards.js.map +1 -1
  67. package/lib/util/webCryptoAPI.d.ts +10 -0
  68. package/lib/util/webCryptoAPI.js +69 -0
  69. package/lib/util/webCryptoAPI.js.map +1 -0
  70. package/lib/util/websockets/WsStore.d.ts +71 -0
  71. package/lib/util/websockets/WsStore.js +269 -0
  72. package/lib/util/websockets/WsStore.js.map +1 -0
  73. package/lib/util/websockets/WsStore.types.d.ts +50 -0
  74. package/lib/util/websockets/WsStore.types.js +14 -0
  75. package/lib/util/websockets/WsStore.types.js.map +1 -0
  76. package/lib/util/websockets/index.d.ts +3 -0
  77. package/lib/util/websockets/index.js +20 -0
  78. package/lib/util/websockets/index.js.map +1 -0
  79. package/lib/util/websockets/websocket-util.d.ts +92 -0
  80. package/lib/util/websockets/websocket-util.js +280 -0
  81. package/lib/util/websockets/websocket-util.js.map +1 -0
  82. package/lib/websocket-client.d.ts +107 -114
  83. package/lib/websocket-client.js +427 -716
  84. package/lib/websocket-client.js.map +1 -1
  85. package/package.json +4 -4
  86. package/lib/account-asset-client-v3.d.ts +0 -87
  87. package/lib/account-asset-client-v3.js +0 -154
  88. package/lib/account-asset-client-v3.js.map +0 -1
  89. package/lib/account-asset-client.d.ts +0 -46
  90. package/lib/account-asset-client.js +0 -108
  91. package/lib/account-asset-client.js.map +0 -1
  92. package/lib/contract-client.d.ts +0 -136
  93. package/lib/contract-client.js +0 -251
  94. package/lib/contract-client.js.map +0 -1
  95. package/lib/copy-trading-client.d.ts +0 -60
  96. package/lib/copy-trading-client.js +0 -114
  97. package/lib/copy-trading-client.js.map +0 -1
  98. package/lib/inverse-client.d.ts +0 -104
  99. package/lib/inverse-client.js +0 -213
  100. package/lib/inverse-client.js.map +0 -1
  101. package/lib/inverse-futures-client.d.ts +0 -217
  102. package/lib/inverse-futures-client.js +0 -224
  103. package/lib/inverse-futures-client.js.map +0 -1
  104. package/lib/linear-client.d.ts +0 -112
  105. package/lib/linear-client.js +0 -225
  106. package/lib/linear-client.js.map +0 -1
  107. package/lib/spot-client.d.ts +0 -46
  108. package/lib/spot-client.js +0 -131
  109. package/lib/spot-client.js.map +0 -1
  110. package/lib/types/request/spot.d.ts +0 -79
  111. package/lib/types/request/spot.js.map +0 -1
  112. package/lib/types/v5-shared.js.map +0 -1
  113. package/lib/types/websocket.events.js.map +0 -1
  114. package/lib/types/websockets.js +0 -3
  115. package/lib/types/websockets.js.map +0 -1
  116. package/lib/types/ws-events/failed-topic-subscription-confirmation.d.ts +0 -4
  117. package/lib/types/ws-events/failed-topic-subscription-confirmation.js +0 -3
  118. package/lib/types/ws-events/failed-topic-subscription-confirmation.js.map +0 -1
  119. package/lib/types/ws-events/succeeded-topic-subscription-confirmation.d.ts +0 -4
  120. package/lib/types/ws-events/succeeded-topic-subscription-confirmation.js +0 -3
  121. package/lib/types/ws-events/succeeded-topic-subscription-confirmation.js.map +0 -1
  122. package/lib/types/ws-events/topic-subscription-confirmation.d.ts +0 -7
  123. package/lib/types/ws-events/topic-subscription-confirmation.js +0 -3
  124. package/lib/types/ws-events/topic-subscription-confirmation.js.map +0 -1
  125. package/lib/unified-margin-client.d.ts +0 -140
  126. package/lib/unified-margin-client.js +0 -270
  127. package/lib/unified-margin-client.js.map +0 -1
  128. package/lib/usdc-option-client.d.ts +0 -110
  129. package/lib/usdc-option-client.js +0 -196
  130. package/lib/usdc-option-client.js.map +0 -1
  131. package/lib/usdc-perpetual-client.d.ts +0 -97
  132. package/lib/usdc-perpetual-client.js +0 -191
  133. package/lib/usdc-perpetual-client.js.map +0 -1
  134. package/lib/util/WsStore.d.ts +0 -57
  135. package/lib/util/WsStore.js +0 -97
  136. package/lib/util/WsStore.js.map +0 -1
  137. package/lib/util/browser-support.d.ts +0 -1
  138. package/lib/util/browser-support.js +0 -26
  139. package/lib/util/browser-support.js.map +0 -1
  140. package/lib/util/node-support.d.ts +0 -2
  141. package/lib/util/node-support.js +0 -21
  142. package/lib/util/node-support.js.map +0 -1
  143. package/lib/util/websocket-util.d.ts +0 -68
  144. package/lib/util/websocket-util.js +0 -506
  145. package/lib/util/websocket-util.js.map +0 -1
  146. /package/lib/types/{v5-shared.d.ts → shared-v5.d.ts} +0 -0
@@ -1,131 +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.SpotClient = void 0;
16
- const BaseRestClient_1 = __importDefault(require("./util/BaseRestClient"));
17
- const requestUtils_1 = require("./util/requestUtils");
18
- /**
19
- * REST API client for Spot APIs (v1)
20
- *
21
- * @deprecated WARNING: V1/V2 private endpoints (Rest API & Websocket Stream) for mainnet
22
- * will be switched off gradually from 30 Oct 2023 UTC, so they are not promised a stability.
23
- * Please note that you are at your own risk of using old endpoints going forward, and please move to V5 ASAP.
24
- */
25
- class SpotClient extends BaseRestClient_1.default {
26
- getClientType() {
27
- return requestUtils_1.REST_CLIENT_TYPE_ENUM.spot;
28
- }
29
- fetchServerTime() {
30
- return this.getServerTime();
31
- }
32
- getServerTime() {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- const res = yield this.get('/spot/v1/time');
35
- return res.result.serverTime;
36
- });
37
- }
38
- /**
39
- *
40
- * Market Data Endpoints
41
- *
42
- **/
43
- getSymbols() {
44
- return this.get('/spot/v1/symbols');
45
- }
46
- getOrderBook(symbol, limit) {
47
- return this.get('/spot/quote/v1/depth', {
48
- symbol,
49
- limit,
50
- });
51
- }
52
- getMergedOrderBook(symbol, scale, limit) {
53
- return this.get('/spot/quote/v1/depth/merged', {
54
- symbol,
55
- scale,
56
- limit,
57
- });
58
- }
59
- getTrades(symbol, limit) {
60
- return this.get('/spot/quote/v1/trades', {
61
- symbol,
62
- limit,
63
- });
64
- }
65
- getCandles(symbol, interval, limit, startTime, endTime) {
66
- return this.get('/spot/quote/v1/kline', {
67
- symbol,
68
- interval,
69
- limit,
70
- startTime,
71
- endTime,
72
- });
73
- }
74
- get24hrTicker(symbol) {
75
- return this.get('/spot/quote/v1/ticker/24hr', { symbol });
76
- }
77
- getLastTradedPrice(symbol) {
78
- return this.get('/spot/quote/v1/ticker/price', { symbol });
79
- }
80
- getBestBidAskPrice(symbol) {
81
- return this.get('/spot/quote/v1/ticker/book_ticker', { symbol });
82
- }
83
- /**
84
- * Account Data Endpoints
85
- */
86
- submitOrder(params) {
87
- return this.postPrivate('/spot/v1/order', params);
88
- }
89
- getOrder(params) {
90
- return this.getPrivate('/spot/v1/order', params);
91
- }
92
- cancelOrder(params) {
93
- return this.deletePrivate('/spot/v1/order', params);
94
- }
95
- cancelOrderBatch(params) {
96
- const orderTypes = params.orderTypes
97
- ? params.orderTypes.join(',')
98
- : undefined;
99
- return this.deletePrivate('/spot/order/batch-cancel', Object.assign(Object.assign({}, params), { orderTypes }));
100
- }
101
- getOpenOrders(symbol, orderId, limit) {
102
- return this.getPrivate('/spot/v1/open-orders', {
103
- symbol,
104
- orderId,
105
- limit,
106
- });
107
- }
108
- getPastOrders(symbol, orderId, limit) {
109
- return this.getPrivate('/spot/v1/history-orders', {
110
- symbol,
111
- orderId,
112
- limit,
113
- });
114
- }
115
- getMyTrades(symbol, limit, fromId, toId) {
116
- return this.getPrivate('/spot/v1/myTrades', {
117
- symbol,
118
- limit,
119
- fromId,
120
- toId,
121
- });
122
- }
123
- /**
124
- * Wallet Data Endpoints
125
- */
126
- getBalances() {
127
- return this.getPrivate('/spot/v1/account');
128
- }
129
- }
130
- exports.SpotClient = SpotClient;
131
- //# sourceMappingURL=spot-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spot-client.js","sourceRoot":"","sources":["../src/spot-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYA,2EAAmD;AACnD,sDAA4D;AAE5D;;;;;;GAMG;AACH,MAAa,UAAW,SAAQ,wBAAc;IAC5C,aAAa;QACX,OAAO,oCAAqB,CAAC,IAAI,CAAC;IACpC,CAAC;IA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;IAC7C,CAAC;CACF;AAhKD,gCAgKC"}
@@ -1,79 +0,0 @@
1
- import { OrderSide, numberInString } from '../shared';
2
- export type OrderTypeSpot = 'LIMIT' | 'MARKET' | 'LIMIT_MAKER';
3
- export type OrderTimeInForce = 'GTC' | 'FOK' | 'IOC';
4
- export interface NewSpotOrder {
5
- symbol: string;
6
- qty: number;
7
- side: OrderSide;
8
- type: OrderTypeSpot;
9
- timeInForce?: OrderTimeInForce;
10
- price?: number;
11
- orderLinkId?: string;
12
- }
13
- export interface NewSpotOrderV3 {
14
- symbol: string;
15
- orderQty: string;
16
- side: OrderSide;
17
- orderType: OrderTypeSpot;
18
- timeInForce?: OrderTimeInForce;
19
- orderPrice?: string;
20
- orderLinkId?: string;
21
- orderCategory?: 0 | 1;
22
- triggerPrice?: string;
23
- }
24
- export interface SpotCancelOrderBatchRequest {
25
- symbol: string;
26
- side?: OrderSide;
27
- orderTypes: OrderTypeSpot[];
28
- orderCategory?: 0 | 1;
29
- }
30
- export interface SpotOrderQueryById {
31
- orderId?: string;
32
- orderLinkId?: string;
33
- orderCategory?: 0 | 1;
34
- }
35
- export interface SpotSymbolInfo {
36
- name: string;
37
- alias: string;
38
- baseCurrency: string;
39
- quoteCurrency: string;
40
- basePrecision: numberInString;
41
- quotePrecision: numberInString;
42
- minTradeQuantity: numberInString;
43
- minTradeAmount: numberInString;
44
- minPricePrecision: numberInString;
45
- maxTradeQuantity: numberInString;
46
- maxTradeAmount: numberInString;
47
- category: numberInString;
48
- }
49
- export interface SpotMyTradesRequest {
50
- symbol?: string;
51
- orderId?: string;
52
- limit?: string;
53
- startTime?: number;
54
- endTime?: number;
55
- fromTradeId?: string;
56
- toTradeId?: string;
57
- }
58
- export interface SpotLeveragedTokenPRHistoryRequest {
59
- ltCode?: string;
60
- orderId?: string;
61
- startTime?: number;
62
- endTime?: number;
63
- limit?: number;
64
- orderType?: 1 | 2;
65
- serialNo?: string;
66
- }
67
- export interface SpotCrossMarginBorrowingInfoRequest {
68
- startTime?: number;
69
- endTime?: number;
70
- coin?: string;
71
- status?: 0 | 1 | 2;
72
- limit?: number;
73
- }
74
- export interface SpotCrossMarginRepaymentHistoryRequest {
75
- startTime?: number;
76
- endTime?: number;
77
- coin?: string;
78
- limit?: number;
79
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"spot.js","sourceRoot":"","sources":["../../../src/types/request/spot.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v5-shared.js","sourceRoot":"","sources":["../../src/types/v5-shared.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"websocket.events.js","sourceRoot":"","sources":["../../src/types/websocket.events.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=websockets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"websockets.js","sourceRoot":"","sources":["../../src/types/websockets.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- import { WebsocketTopicSubscriptionConfirmationEvent } from './topic-subscription-confirmation';
2
- export interface WebsocketFailedTopicSubscriptionConfirmationEvent extends WebsocketTopicSubscriptionConfirmationEvent {
3
- success: false;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=failed-topic-subscription-confirmation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"failed-topic-subscription-confirmation.js","sourceRoot":"","sources":["../../../src/types/ws-events/failed-topic-subscription-confirmation.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- import { WebsocketTopicSubscriptionConfirmationEvent } from './topic-subscription-confirmation';
2
- export interface WebsocketSucceededTopicSubscriptionConfirmationEvent extends WebsocketTopicSubscriptionConfirmationEvent {
3
- success: true;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=succeeded-topic-subscription-confirmation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"succeeded-topic-subscription-confirmation.js","sourceRoot":"","sources":["../../../src/types/ws-events/succeeded-topic-subscription-confirmation.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- export interface WebsocketTopicSubscriptionConfirmationEvent {
2
- op: 'subscribe';
3
- req_id: string;
4
- conn_id: string;
5
- ret_msg: string;
6
- success: boolean;
7
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=topic-subscription-confirmation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"topic-subscription-confirmation.js","sourceRoot":"","sources":["../../../src/types/ws-events/topic-subscription-confirmation.ts"],"names":[],"mappings":""}
@@ -1,140 +0,0 @@
1
- import { APIResponseV3, APIResponseWithTime, InternalTransferRequest, UM7DayTradingHistoryRequest, UMActiveOrdersRequest, UMBatchOrder, UMBatchOrderCancel, UMBatchOrderReplace, UMBorrowHistoryRequest, UMCancelAllOrdersRequest, UMCancelOrderRequest, UMCandlesRequest, UMCategory, UMExchangeCoinsRequest, UMFundingRateHistoryRequest, UMHistoricOrder, UMHistoricOrdersRequest, UMInstrumentInfo, UMInstrumentInfoRequest, UMModifyOrderRequest, UMOpenInterestRequest, UMOptionDeliveryPriceRequest, UMOptionsSettlementHistoryRequest, UMOrderRequest, UMPaginatedResult, UMPerpSettlementHistoryRequest, UMPositionsRequest, UMPublicTradesRequest, UMSetTPSLRequest, UMTransactionLogRequest } from './types';
2
- import BaseRestClient from './util/BaseRestClient';
3
- /**
4
- * REST API client for Derivatives V3 unified margin APIs
5
- * @deprecated WARNING
6
- * These endpoints are being switched off gradually and are expected to be completely turned off by the end of 2024.
7
- * They may stop working at any point before then.
8
- * Please update your code as soon as possible to use the V5 APIs instead.
9
- */
10
- export declare class UnifiedMarginClient extends BaseRestClient {
11
- getClientType(): "v3";
12
- fetchServerTime(): Promise<number>;
13
- /**
14
- *
15
- * Market Data Endpoints
16
- *
17
- */
18
- /** Query order book info. Each side has a depth of 25 orders. */
19
- getOrderBook(symbol: string, category: string, limit?: number): Promise<APIResponseV3<any>>;
20
- /** Get candles/klines */
21
- getCandles(params: UMCandlesRequest): Promise<APIResponseV3<any>>;
22
- /** Get a symbol price/statistics ticker */
23
- getSymbolTicker(category: UMCategory, symbol?: string): Promise<APIResponseV3<any>>;
24
- /** Get trading rules per symbol/contract, incl price/amount/value/leverage filters */
25
- getInstrumentInfo(params: UMInstrumentInfoRequest): Promise<APIResponseV3<UMPaginatedResult<UMInstrumentInfo>>>;
26
- /** Query mark price kline (like getCandles() but for mark price). */
27
- getMarkPriceCandles(params: UMCandlesRequest): Promise<APIResponseV3<any>>;
28
- /** Query Index Price Kline */
29
- getIndexPriceCandles(params: UMCandlesRequest): Promise<APIResponseV3<any>>;
30
- /**
31
- * The funding rate is generated every 8 hours at 00:00 UTC, 08:00 UTC and 16:00 UTC.
32
- * For example, if a request is sent at 12:00 UTC, the funding rate generated earlier that day at 08:00 UTC will be sent.
33
- */
34
- getFundingRateHistory(params: UMFundingRateHistoryRequest): Promise<APIResponseV3<any>>;
35
- /** Get Risk Limit */
36
- getRiskLimit(category: UMCategory, symbol: string): Promise<APIResponseV3<any>>;
37
- /** Get option delivery price */
38
- getOptionDeliveryPrice(params: UMOptionDeliveryPriceRequest): Promise<APIResponseV3<any>>;
39
- /** Get recent trades */
40
- getTrades(params: UMPublicTradesRequest): Promise<APIResponseV3<any>>;
41
- /**
42
- * Gets the total amount of unsettled contracts.
43
- * In other words, the total number of contracts held in open positions.
44
- */
45
- getOpenInterest(params: UMOpenInterestRequest): Promise<APIResponseV3<any>>;
46
- /**
47
- *
48
- * Unified Margin Account Endpoints
49
- *
50
- */
51
- /** -> Order API */
52
- /** Place an order */
53
- submitOrder(params: UMOrderRequest): Promise<APIResponseV3<any>>;
54
- /** Active order parameters (such as quantity, price) and stop order parameters cannot be modified in one request at the same time. Please request modification separately. */
55
- modifyOrder(params: UMModifyOrderRequest): Promise<APIResponseV3<any>>;
56
- /** Cancel order */
57
- cancelOrder(params: UMCancelOrderRequest): Promise<APIResponseV3<any>>;
58
- /** Query Open Orders */
59
- getActiveOrders(params: UMActiveOrdersRequest): Promise<APIResponseV3<any>>;
60
- /** Query order history. As order creation/cancellation is asynchronous, the data returned from the interface may be delayed. To access order information in real-time, call getActiveOrders() */
61
- getHistoricOrders(params: UMHistoricOrdersRequest): Promise<APIResponseV3<UMPaginatedResult<UMHistoricOrder>>>;
62
- /**
63
- * This API provides the batch order mode under the unified margin account.
64
- * Max 10 per request
65
- */
66
- batchSubmitOrders(category: UMCategory, orders: UMBatchOrder[]): Promise<APIResponseV3<any>>;
67
- /**
68
- * This interface can modify the open order information in batches.
69
- * Currently, it is not supported to modify the conditional order information.
70
- * Please note that only unfilled or partial filled orders can be modified.
71
- * If both futures and options orders are in one request, only the orders matching the category will be operated according to the category type
72
- */
73
- batchReplaceOrders(category: UMCategory, orders: UMBatchOrderReplace[]): Promise<APIResponseV3<any>>;
74
- /**
75
- * This API provides batch cancellation under the unified margin account.
76
- * Order cancellation of futures and options cannot be canceled in one request at the same time.
77
- * If both futures and options orders are in one request, only the orders matching the category will be operated according to the category type.
78
- */
79
- batchCancelOrders(category: UMCategory, orders: UMBatchOrderCancel[]): Promise<APIResponseV3<any>>;
80
- /**
81
- * This API provides the cancellation of all open orders under the unified margin account.
82
- * Order cancellation of futures and options cannot be canceled in one request at the same time.
83
- * If both futures and options orders are in one request, only the orders matching the category will be operated according to the category type.
84
- */
85
- cancelAllOrders(params: UMCancelAllOrdersRequest): Promise<APIResponseV3<any>>;
86
- /** -> Positions API */
87
- /**
88
- * Query my positions real-time. Accessing personal list of positions.
89
- * Users can access their position holding information through this interface, such as the number of position holdings and wallet balance.
90
- */
91
- getPositions(params: UMPositionsRequest): Promise<APIResponseV3<any>>;
92
- /** Leverage setting. */
93
- setLeverage(category: UMCategory, symbol: string, buyLeverage: number, sellLeverage: number): Promise<APIResponseV3<any>>;
94
- /**
95
- * Switching the TP/SL mode to the cross margin mode or selected positions.
96
- * When you set the TP/SL mode on the selected positions, the quantity of take-profit or stop-loss orders can be smaller than the position size. Please use Trading-Stop endpoint.
97
- */
98
- setTPSLMode(category: UMCategory, symbol: string, tpSlMode: 1 | 0): Promise<APIResponseV3<any>>;
99
- /** Set risk limit */
100
- setRiskLimit(category: UMCategory, symbol: string, riskId: number, positionIdx: number): Promise<APIResponseV3<any>>;
101
- /**
102
- * Set position TP/SL and trailing stop.
103
- * Pass the following parameters, then the system will create conditional orders.
104
- * If the position is closed, the system will cancel these orders, and adjust the position size.
105
- */
106
- setTPSL(params: UMSetTPSLRequest): Promise<APIResponseV3<any>>;
107
- /**
108
- * Access the user's filled history, ranked by time in descending order.
109
- * There might be multiple filled histories for an order.
110
- */
111
- get7DayTradingHistory(params: UM7DayTradingHistoryRequest): Promise<APIResponseV3<any>>;
112
- /** Query the settlement history, ranked by time in descending order. */
113
- getOptionsSettlementHistory(params: UMOptionsSettlementHistoryRequest): Promise<APIResponseV3<any>>;
114
- /** Query session settlement records, only for USDC perpetual */
115
- getUSDCPerpetualSettlementHistory(params: UMPerpSettlementHistoryRequest): Promise<APIResponseV3<any>>;
116
- /** -> Account API */
117
- /** Query wallet balance */
118
- getBalances(coin?: string): Promise<APIResponseV3<any>>;
119
- /**
120
- * Upgrade to unified margin account.
121
- * WARNING: This is currently not reversable!
122
- */
123
- upgradeToUnifiedMargin(): Promise<APIResponseV3<any>>;
124
- /** Query trading history */
125
- getTransactionLog(params: UMTransactionLogRequest): Promise<APIResponseV3<any>>;
126
- /** Fund transfer between accounts (v2) */
127
- transferFunds(params: InternalTransferRequest): Promise<APIResponseV3<any>>;
128
- /** Exchange Coins */
129
- getCoinExchangeHistory(params?: UMExchangeCoinsRequest): Promise<APIResponseV3<any>>;
130
- /** Get Borrow History */
131
- getBorrowHistory(params?: UMBorrowHistoryRequest): Promise<APIResponseV3<any>>;
132
- /** Get Borrow Rate */
133
- getBorrowRate(currency?: string): Promise<APIResponseV3<any>>;
134
- /**
135
- *
136
- * API Data Endpoints
137
- *
138
- */
139
- getServerTime(): Promise<APIResponseWithTime>;
140
- }