bitget-api 3.1.10 → 3.2.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.
- package/dist/cjs/rest-client-v2.d.ts +53 -6
- package/dist/cjs/rest-client-v2.js +54 -0
- package/dist/cjs/rest-client-v2.js.map +1 -1
- package/dist/cjs/rest-client-v3.d.ts +33 -3
- package/dist/cjs/rest-client-v3.js +36 -0
- package/dist/cjs/rest-client-v3.js.map +1 -1
- package/dist/cjs/types/request/v2/broker.d.ts +4 -0
- package/dist/cjs/types/request/v2/common.d.ts +3 -0
- package/dist/cjs/types/request/v2/futures.d.ts +24 -0
- package/dist/cjs/types/request/v2/instloan.d.ts +22 -0
- package/dist/cjs/types/request/v2/instloan.js +3 -0
- package/dist/cjs/types/request/v2/instloan.js.map +1 -0
- package/dist/cjs/types/request/v2/spot.d.ts +3 -0
- package/dist/cjs/types/request/v3/account.d.ts +42 -4
- package/dist/cjs/types/request/v3/trade.d.ts +11 -4
- package/dist/cjs/types/response/v2/futures.d.ts +7 -0
- package/dist/cjs/types/response/v2/instloan.d.ts +56 -0
- package/dist/cjs/types/response/v2/instloan.js +3 -0
- package/dist/cjs/types/response/v2/instloan.js.map +1 -0
- package/dist/cjs/types/response/v2/spot.d.ts +7 -0
- package/dist/cjs/types/response/v3/account.d.ts +33 -0
- package/dist/cjs/types/response/v3/public.d.ts +16 -1
- package/dist/cjs/types/websockets/ws-general.d.ts +1 -1
- package/dist/mjs/rest-client-v2.d.ts +53 -6
- package/dist/mjs/rest-client-v2.js +54 -0
- package/dist/mjs/rest-client-v2.js.map +1 -1
- package/dist/mjs/rest-client-v3.d.ts +33 -3
- package/dist/mjs/rest-client-v3.js +36 -0
- package/dist/mjs/rest-client-v3.js.map +1 -1
- package/dist/mjs/types/request/v2/broker.d.ts +4 -0
- package/dist/mjs/types/request/v2/common.d.ts +3 -0
- package/dist/mjs/types/request/v2/futures.d.ts +24 -0
- package/dist/mjs/types/request/v2/instloan.d.ts +22 -0
- package/dist/mjs/types/request/v2/instloan.js +2 -0
- package/dist/mjs/types/request/v2/instloan.js.map +1 -0
- package/dist/mjs/types/request/v2/spot.d.ts +3 -0
- package/dist/mjs/types/request/v3/account.d.ts +42 -4
- package/dist/mjs/types/request/v3/trade.d.ts +11 -4
- package/dist/mjs/types/response/v2/futures.d.ts +7 -0
- package/dist/mjs/types/response/v2/instloan.d.ts +56 -0
- package/dist/mjs/types/response/v2/instloan.js +2 -0
- package/dist/mjs/types/response/v2/instloan.js.map +1 -0
- package/dist/mjs/types/response/v2/spot.d.ts +7 -0
- package/dist/mjs/types/response/v3/account.d.ts +33 -0
- package/dist/mjs/types/response/v3/public.d.ts +16 -1
- package/dist/mjs/types/websockets/ws-general.d.ts +1 -1
- package/package.json +6 -5
|
@@ -80,8 +80,8 @@ export interface GetSubAccountListRequestV3 {
|
|
|
80
80
|
}
|
|
81
81
|
export interface TransferRequestV3 {
|
|
82
82
|
clientOid?: string;
|
|
83
|
-
fromType: 'spot' | 'p2p' | '
|
|
84
|
-
toType: 'spot' | 'p2p' | '
|
|
83
|
+
fromType: 'spot' | 'p2p' | 'coin_futures' | 'usdt_futures' | 'usdc_futures' | 'crossed_margin' | 'isolated_margin' | 'uta';
|
|
84
|
+
toType: 'spot' | 'p2p' | 'coin_futures' | 'usdt_futures' | 'usdc_futures' | 'crossed_margin' | 'isolated_margin' | 'uta';
|
|
85
85
|
amount: string;
|
|
86
86
|
coin: string;
|
|
87
87
|
symbol?: string;
|
|
@@ -89,8 +89,8 @@ export interface TransferRequestV3 {
|
|
|
89
89
|
allowBorrow?: 'yes' | 'no';
|
|
90
90
|
}
|
|
91
91
|
export interface GetTransferableCoinsRequestV3 {
|
|
92
|
-
fromType: 'spot' | 'p2p' | '
|
|
93
|
-
toType: 'spot' | 'p2p' | '
|
|
92
|
+
fromType: 'spot' | 'p2p' | 'coin_futures' | 'usdt_futures' | 'usdc_futures' | 'crossed_margin' | 'isolated_margin' | 'uta';
|
|
93
|
+
toType: 'spot' | 'p2p' | 'coin_futures' | 'usdt_futures' | 'usdc_futures' | 'crossed_margin' | 'isolated_margin' | 'uta';
|
|
94
94
|
}
|
|
95
95
|
export interface GetSubTransferRecordsRequestV3 {
|
|
96
96
|
subUid?: string;
|
|
@@ -238,3 +238,41 @@ export interface SetMarginRequestV3 {
|
|
|
238
238
|
export interface GetMaxWithdrawalRequestV3 {
|
|
239
239
|
coin: string;
|
|
240
240
|
}
|
|
241
|
+
export interface GetRealityOrderBookRequestV3 {
|
|
242
|
+
symbol: string;
|
|
243
|
+
}
|
|
244
|
+
export interface GetRealityFillsRequestV3 {
|
|
245
|
+
symbol: string;
|
|
246
|
+
limit?: string;
|
|
247
|
+
}
|
|
248
|
+
export interface SubMasterTransferRequestV3 {
|
|
249
|
+
fromType: 'spot' | 'uta';
|
|
250
|
+
toType: 'spot' | 'p2p' | 'uta';
|
|
251
|
+
amount: string;
|
|
252
|
+
coin: string;
|
|
253
|
+
clientOid?: string;
|
|
254
|
+
}
|
|
255
|
+
export interface CreateAgentSubAccountRequestV3 {
|
|
256
|
+
username: string;
|
|
257
|
+
passphrase: string;
|
|
258
|
+
note?: string;
|
|
259
|
+
}
|
|
260
|
+
export interface MovePositionItemRequestV3 {
|
|
261
|
+
symbol: string;
|
|
262
|
+
side: 'buy' | 'sell';
|
|
263
|
+
qty: string;
|
|
264
|
+
}
|
|
265
|
+
export interface MovePositionsRequestV3 {
|
|
266
|
+
fromUid: string;
|
|
267
|
+
toUid: string;
|
|
268
|
+
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
|
|
269
|
+
positionList: MovePositionItemRequestV3[];
|
|
270
|
+
}
|
|
271
|
+
export interface GetMovePositionHistoryRequestV3 {
|
|
272
|
+
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
|
|
273
|
+
symbol?: string;
|
|
274
|
+
startTime?: string;
|
|
275
|
+
endTime?: string;
|
|
276
|
+
cursor?: string;
|
|
277
|
+
limit?: string;
|
|
278
|
+
}
|
|
@@ -23,6 +23,7 @@ export interface CloseAllPositionsRequestV3 {
|
|
|
23
23
|
export interface CancelOrderRequestV3 {
|
|
24
24
|
orderId?: string;
|
|
25
25
|
clientOid?: string;
|
|
26
|
+
category?: 'SPOT' | 'MARGIN' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
|
|
26
27
|
}
|
|
27
28
|
export interface GetMaxOpenAvailableRequestV3 {
|
|
28
29
|
category: 'SPOT' | 'MARGIN' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
|
|
@@ -37,6 +38,7 @@ export interface GetOrderInfoRequestV3 {
|
|
|
37
38
|
clientOid?: string;
|
|
38
39
|
}
|
|
39
40
|
export interface GetFillsRequestV3 {
|
|
41
|
+
category?: 'SPOT' | 'MARGIN' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
|
|
40
42
|
orderId?: string;
|
|
41
43
|
startTime?: string;
|
|
42
44
|
endTime?: string;
|
|
@@ -53,6 +55,7 @@ export interface GetUnfilledOrdersRequestV3 {
|
|
|
53
55
|
}
|
|
54
56
|
export interface GetHistoryOrdersRequestV3 {
|
|
55
57
|
category: 'SPOT' | 'MARGIN' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
|
|
58
|
+
symbol?: string;
|
|
56
59
|
startTime?: string;
|
|
57
60
|
endTime?: string;
|
|
58
61
|
limit?: string;
|
|
@@ -128,10 +131,14 @@ export interface PlaceOrderRequestV3 {
|
|
|
128
131
|
/** Futures only. Defaults to crossed */
|
|
129
132
|
marginMode?: FuturesMarginModeV3;
|
|
130
133
|
stpMode?: 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
tpTriggerBy?: 'market' | 'mark';
|
|
135
|
+
slTriggerBy?: 'market' | 'mark';
|
|
136
|
+
takeProfit?: string;
|
|
137
|
+
stopLoss?: string;
|
|
138
|
+
tpOrderType?: 'limit' | 'market';
|
|
139
|
+
slOrderType?: 'limit' | 'market';
|
|
140
|
+
tpLimitPrice?: string;
|
|
141
|
+
slLimitPrice?: string;
|
|
135
142
|
}
|
|
136
143
|
export interface CountdownCancelAllRequestV3 {
|
|
137
144
|
countdown: string;
|
|
@@ -289,6 +289,13 @@ export interface FuturesPositionV2 {
|
|
|
289
289
|
autoMargin: string;
|
|
290
290
|
cTime: string;
|
|
291
291
|
}
|
|
292
|
+
export interface FuturesPositionAdlRankV2 {
|
|
293
|
+
symbol: string;
|
|
294
|
+
marginCoin: string;
|
|
295
|
+
adlRank: string;
|
|
296
|
+
rank: string;
|
|
297
|
+
holdSide: string;
|
|
298
|
+
}
|
|
292
299
|
export interface FuturesHistoryPositionV2 {
|
|
293
300
|
positionId: string;
|
|
294
301
|
marginCoin: string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface InstLoanProductInfoV2 {
|
|
2
|
+
productId: string;
|
|
3
|
+
leverage: string;
|
|
4
|
+
transferLine: string;
|
|
5
|
+
spotBuyLine: string;
|
|
6
|
+
liquidationLine: string;
|
|
7
|
+
stopLiquidationLine: string;
|
|
8
|
+
}
|
|
9
|
+
export interface InstLoanSymbolsV2 {
|
|
10
|
+
productId: string;
|
|
11
|
+
spotSymbols: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface InstLoanRepaidHistoryItemV2 {
|
|
14
|
+
repayOrderId: string;
|
|
15
|
+
businessType: string;
|
|
16
|
+
repayType: string;
|
|
17
|
+
repaidTime: string;
|
|
18
|
+
coin: string;
|
|
19
|
+
repaidAmount: string;
|
|
20
|
+
repaidInterest: string;
|
|
21
|
+
}
|
|
22
|
+
export interface InstLoanOrderV2 {
|
|
23
|
+
orderId: string;
|
|
24
|
+
orderProductId: string;
|
|
25
|
+
uid: string;
|
|
26
|
+
loanTime: string;
|
|
27
|
+
loanCoin: string;
|
|
28
|
+
loanAmount: string;
|
|
29
|
+
unpaidAmount: string;
|
|
30
|
+
unpaidInterest: string;
|
|
31
|
+
repaidAmount: string;
|
|
32
|
+
repaidInterest: string;
|
|
33
|
+
status: string;
|
|
34
|
+
}
|
|
35
|
+
export interface InstLoanCoinInfoV2 {
|
|
36
|
+
coin: string;
|
|
37
|
+
convertRatio: string;
|
|
38
|
+
maxConvertValue: string;
|
|
39
|
+
}
|
|
40
|
+
export interface InstLoanLTVConvertV2 {
|
|
41
|
+
ltv: string;
|
|
42
|
+
subAccountUids: string[];
|
|
43
|
+
unpaidUsdtAmount: string;
|
|
44
|
+
usdtBalance: string;
|
|
45
|
+
unpaidInfo: {
|
|
46
|
+
coin: string;
|
|
47
|
+
unpaidQty: string;
|
|
48
|
+
unpaidInterest: string;
|
|
49
|
+
}[];
|
|
50
|
+
balanceInfo: {
|
|
51
|
+
coin: string;
|
|
52
|
+
price: string;
|
|
53
|
+
amount: string;
|
|
54
|
+
convertedUsdtAmount: string;
|
|
55
|
+
}[];
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instloan.js","sourceRoot":"","sources":["../../../../../src/types/response/v2/instloan.ts"],"names":[],"mappings":""}
|
|
@@ -73,6 +73,13 @@ export interface SpotTickerV2 {
|
|
|
73
73
|
changeUtc24h: string;
|
|
74
74
|
change24h: string;
|
|
75
75
|
}
|
|
76
|
+
export interface SpotCallAuctionV2 {
|
|
77
|
+
stage: string;
|
|
78
|
+
stageEndTime: string;
|
|
79
|
+
estOpeningPrice: string | null;
|
|
80
|
+
matchedVolume: string | null;
|
|
81
|
+
auctionEndTime: string;
|
|
82
|
+
}
|
|
76
83
|
export interface SpotMergeDepthV2 {
|
|
77
84
|
asks: [string, string][];
|
|
78
85
|
bids: [string, string][];
|
|
@@ -139,6 +139,14 @@ export interface CreateSubAccountResponseV3 {
|
|
|
139
139
|
createdTime: string;
|
|
140
140
|
updatedTime: string;
|
|
141
141
|
}
|
|
142
|
+
export interface CreateAgentSubAccountResponseV3 {
|
|
143
|
+
username: string;
|
|
144
|
+
subUid: string;
|
|
145
|
+
apiKey: string;
|
|
146
|
+
secret: string;
|
|
147
|
+
note: string;
|
|
148
|
+
createdTime: string;
|
|
149
|
+
}
|
|
142
150
|
export interface SubAccountV3 {
|
|
143
151
|
subUid: string;
|
|
144
152
|
username: string;
|
|
@@ -295,3 +303,28 @@ export interface MaxWithdrawalV3 {
|
|
|
295
303
|
utaMaxWithdrawal: string;
|
|
296
304
|
totalMaxWithdrawal: string;
|
|
297
305
|
}
|
|
306
|
+
export interface MovePositionOrderResultV3 {
|
|
307
|
+
orderId: string;
|
|
308
|
+
clientOid: string;
|
|
309
|
+
code: string;
|
|
310
|
+
msg: string;
|
|
311
|
+
}
|
|
312
|
+
export interface MovePositionsResponseV3 {
|
|
313
|
+
closePosition: MovePositionOrderResultV3[];
|
|
314
|
+
openPosition: MovePositionOrderResultV3[];
|
|
315
|
+
}
|
|
316
|
+
export interface MovePositionHistoryV3 {
|
|
317
|
+
category: string;
|
|
318
|
+
fromUid: string;
|
|
319
|
+
toUid: string;
|
|
320
|
+
orderId: string;
|
|
321
|
+
openExecId: string;
|
|
322
|
+
closeExecId: string;
|
|
323
|
+
symbol: string;
|
|
324
|
+
posSide: 'long' | 'short';
|
|
325
|
+
qty: string;
|
|
326
|
+
price: string;
|
|
327
|
+
status: 'processing' | 'completed' | 'failed';
|
|
328
|
+
createdTime: string;
|
|
329
|
+
updatedTime: string;
|
|
330
|
+
}
|
|
@@ -112,6 +112,7 @@ export interface InstrumentV3 {
|
|
|
112
112
|
limitOpenTime: string;
|
|
113
113
|
maintainTime: string;
|
|
114
114
|
areaSymbol?: string;
|
|
115
|
+
isRwa?: 'YES' | 'NO';
|
|
115
116
|
/** yes = Reality stock token, no = non-Reality stock token */
|
|
116
117
|
isReality?: 'yes' | 'no';
|
|
117
118
|
makerFeeRate?: string;
|
|
@@ -119,7 +120,8 @@ export interface InstrumentV3 {
|
|
|
119
120
|
openCostUpRatio?: string;
|
|
120
121
|
priceMultiplier?: string;
|
|
121
122
|
quantityMultiplier?: string;
|
|
122
|
-
|
|
123
|
+
type?: 'perpetual' | 'delivery';
|
|
124
|
+
symbolType?: 'crypto' | 'metal' | 'stock' | 'commodity';
|
|
123
125
|
maxPositionNum?: string;
|
|
124
126
|
deliveryTime?: string;
|
|
125
127
|
deliveryStartTime?: string;
|
|
@@ -178,6 +180,19 @@ export interface OrderBookV3 {
|
|
|
178
180
|
b: string[][];
|
|
179
181
|
ts: string;
|
|
180
182
|
}
|
|
183
|
+
export interface RealityOrderBookV3 {
|
|
184
|
+
symbol: string;
|
|
185
|
+
a: string[][];
|
|
186
|
+
b: string[][];
|
|
187
|
+
ts: string;
|
|
188
|
+
}
|
|
189
|
+
export interface RealityFillV3 {
|
|
190
|
+
execId: string;
|
|
191
|
+
price: string;
|
|
192
|
+
size: string;
|
|
193
|
+
side: 'buy' | 'sell';
|
|
194
|
+
ts: string;
|
|
195
|
+
}
|
|
181
196
|
export interface TickerV3 {
|
|
182
197
|
category: 'SPOT' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
|
|
183
198
|
symbol: string;
|
|
@@ -95,7 +95,7 @@ export interface WSClientConfigurableOptions {
|
|
|
95
95
|
wsOptions?: {
|
|
96
96
|
protocols?: string[];
|
|
97
97
|
agent?: any;
|
|
98
|
-
} & Partial<WebSocket.ClientOptions | ClientRequestArgs
|
|
98
|
+
} & (Omit<Partial<WebSocket.ClientOptions>, 'agent'> | Omit<Partial<ClientRequestArgs>, 'agent'>);
|
|
99
99
|
wsUrl?: string;
|
|
100
100
|
/**
|
|
101
101
|
* Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitget-api",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Complete Node.js & JavaScript SDK for Bitget V1-V3 REST APIs & WebSockets, with TypeScript & end-to-end tests.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"build:clean": "npm run clean && npm run build",
|
|
13
13
|
"build:watch": "npm run clean && tsc --watch",
|
|
14
14
|
"pack": "webpack --config webpack/webpack.config.cjs",
|
|
15
|
-
"lint": "eslint src",
|
|
15
|
+
"lint": "eslint src && npm run lint:apidoc",
|
|
16
|
+
"lint:apidoc": "prettier --check \"examples/apidoc/**/*.js\"",
|
|
17
|
+
"format:apidoc": "prettier --write \"examples/apidoc/**/*.js\"",
|
|
16
18
|
"prepublish": "npm run build:clean",
|
|
17
19
|
"betapublish": "npm publish --tag beta"
|
|
18
20
|
},
|
|
@@ -34,14 +36,14 @@
|
|
|
34
36
|
"author": "Tiago Siebler (https://siebly.io)",
|
|
35
37
|
"contributors": [],
|
|
36
38
|
"dependencies": {
|
|
39
|
+
"@types/ws": "^8.18.1",
|
|
37
40
|
"axios": "^1.13.2",
|
|
38
41
|
"isomorphic-ws": "^5.0.0",
|
|
39
|
-
"ws": "
|
|
42
|
+
"ws": "8.21.1"
|
|
40
43
|
},
|
|
41
44
|
"devDependencies": {
|
|
42
45
|
"@types/jest": "^29.0.3",
|
|
43
46
|
"@types/node": "^22.10.2",
|
|
44
|
-
"@types/ws": "^8.18.1",
|
|
45
47
|
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
46
48
|
"@typescript-eslint/parser": "^8.18.0",
|
|
47
49
|
"eslint": "^8.24.0",
|
|
@@ -56,7 +58,6 @@
|
|
|
56
58
|
"source-map-loader": "^4.0.0",
|
|
57
59
|
"ts-loader": "^9.5.4",
|
|
58
60
|
"webpack": "^5.74.0",
|
|
59
|
-
"webpack-bundle-analyzer": "^5.1.1",
|
|
60
61
|
"webpack-cli": "^4.10.0"
|
|
61
62
|
},
|
|
62
63
|
"keywords": [
|