ccxt 4.5.5 → 4.5.7
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 +4 -4
- package/dist/ccxt.browser.min.js +15 -15
- package/dist/cjs/ccxt.js +6 -6
- package/dist/cjs/src/abstract/toobit.js +11 -0
- package/dist/cjs/src/abstract/tradeogre.js +1 -1
- package/dist/cjs/src/apex.js +2 -2
- package/dist/cjs/src/backpack.js +1 -1
- package/dist/cjs/src/base/Exchange.js +129 -2
- package/dist/cjs/src/bigone.js +4 -4
- package/dist/cjs/src/binance.js +82 -20
- package/dist/cjs/src/bingx.js +5 -2
- package/dist/cjs/src/bitbank.js +1 -0
- package/dist/cjs/src/bitbns.js +1 -0
- package/dist/cjs/src/bitflyer.js +1 -0
- package/dist/cjs/src/bitget.js +16 -9
- package/dist/cjs/src/bithumb.js +1 -0
- package/dist/cjs/src/bitso.js +1 -0
- package/dist/cjs/src/bitvavo.js +26 -40
- package/dist/cjs/src/blockchaincom.js +1 -0
- package/dist/cjs/src/btcalpha.js +1 -0
- package/dist/cjs/src/btcbox.js +1 -0
- package/dist/cjs/src/btcmarkets.js +1 -0
- package/dist/cjs/src/btcturk.js +1 -0
- package/dist/cjs/src/bybit.js +186 -127
- package/dist/cjs/src/coinsph.js +4 -1
- package/dist/cjs/src/cryptocom.js +6 -3
- package/dist/cjs/src/deribit.js +3 -2
- package/dist/cjs/src/digifinex.js +1 -1
- package/dist/cjs/src/gate.js +9 -13
- package/dist/cjs/src/gemini.js +5 -5
- package/dist/cjs/src/htx.js +11 -1
- package/dist/cjs/src/hyperliquid.js +3 -0
- package/dist/cjs/src/independentreserve.js +1 -0
- package/dist/cjs/src/indodax.js +17 -6
- package/dist/cjs/src/kraken.js +31 -8
- package/dist/cjs/src/krakenfutures.js +1 -0
- package/dist/cjs/src/kucoin.js +1 -2
- package/dist/cjs/src/luno.js +4 -1
- package/dist/cjs/src/mercado.js +1 -0
- package/dist/cjs/src/mexc.js +84 -37
- package/dist/cjs/src/novadax.js +1 -0
- package/dist/cjs/src/oceanex.js +1 -0
- package/dist/cjs/src/okcoin.js +4 -1
- package/dist/cjs/src/okx.js +52 -8
- package/dist/cjs/src/phemex.js +1 -1
- package/dist/cjs/src/pro/apex.js +8 -4
- package/dist/cjs/src/pro/backpack.js +7 -5
- package/dist/cjs/src/pro/binance.js +150 -19
- package/dist/cjs/src/pro/bingx.js +206 -220
- package/dist/cjs/src/pro/bitget.js +332 -76
- package/dist/cjs/src/pro/cex.js +1 -0
- package/dist/cjs/src/pro/htx.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +1 -0
- package/dist/cjs/src/pro/mexc.js +23 -23
- package/dist/cjs/src/pro/okx.js +46 -10
- package/dist/cjs/src/pro/toobit.js +1163 -0
- package/dist/cjs/src/pro/tradeogre.js +1 -1
- package/dist/cjs/src/toobit.js +2999 -0
- package/dist/cjs/src/tradeogre.js +1 -1
- package/dist/cjs/src/upbit.js +1 -0
- package/dist/cjs/src/wavesexchange.js +1 -0
- package/dist/cjs/src/yobit.js +1 -0
- package/dist/cjs/src/zaif.js +1 -0
- package/dist/cjs/src/zonda.js +1 -0
- package/js/ccxt.d.ts +8 -8
- package/js/ccxt.js +6 -6
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/abstract/myokx.d.ts +1 -0
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/abstract/okxus.d.ts +1 -0
- package/js/src/abstract/toobit.d.ts +66 -0
- package/js/src/apex.js +2 -2
- package/js/src/backpack.js +1 -1
- package/js/src/base/Exchange.d.ts +9 -0
- package/js/src/base/Exchange.js +129 -2
- package/js/src/bigone.js +4 -4
- package/js/src/binance.d.ts +9 -0
- package/js/src/binance.js +82 -20
- package/js/src/bingx.js +5 -2
- package/js/src/bitbank.js +1 -0
- package/js/src/bitbns.js +1 -0
- package/js/src/bitflyer.js +1 -0
- package/js/src/bitget.js +16 -9
- package/js/src/bithumb.js +1 -0
- package/js/src/bitso.js +1 -0
- package/js/src/bitvavo.d.ts +0 -2
- package/js/src/bitvavo.js +27 -41
- package/js/src/blockchaincom.js +1 -0
- package/js/src/btcalpha.js +1 -0
- package/js/src/btcbox.js +1 -0
- package/js/src/btcmarkets.js +1 -0
- package/js/src/btcturk.js +1 -0
- package/js/src/bybit.d.ts +8 -0
- package/js/src/bybit.js +186 -127
- package/js/src/coinsph.js +4 -1
- package/js/src/cryptocom.js +6 -3
- package/js/src/deribit.js +3 -2
- package/js/src/digifinex.js +1 -1
- package/js/src/gate.d.ts +2 -2
- package/js/src/gate.js +9 -13
- package/js/src/gemini.js +5 -5
- package/js/src/htx.js +11 -1
- package/js/src/hyperliquid.js +3 -0
- package/js/src/independentreserve.js +1 -0
- package/js/src/indodax.js +17 -6
- package/js/src/kraken.d.ts +2 -2
- package/js/src/kraken.js +31 -8
- package/js/src/krakenfutures.js +1 -0
- package/js/src/kucoin.js +1 -2
- package/js/src/luno.js +4 -1
- package/js/src/mercado.js +1 -0
- package/js/src/mexc.d.ts +4 -1
- package/js/src/mexc.js +84 -37
- package/js/src/novadax.js +1 -0
- package/js/src/oceanex.js +1 -0
- package/js/src/okcoin.js +4 -1
- package/js/src/okx.js +52 -8
- package/js/src/phemex.js +1 -1
- package/js/src/pro/apex.js +8 -4
- package/js/src/pro/backpack.d.ts +1 -1
- package/js/src/pro/backpack.js +7 -5
- package/js/src/pro/binance.d.ts +24 -0
- package/js/src/pro/binance.js +150 -19
- package/js/src/pro/bingx.d.ts +53 -33
- package/js/src/pro/bingx.js +207 -221
- package/js/src/pro/bitget.d.ts +6 -0
- package/js/src/pro/bitget.js +332 -76
- package/js/src/pro/cex.js +1 -0
- package/js/src/pro/htx.js +1 -1
- package/js/src/pro/independentreserve.js +1 -0
- package/js/src/pro/mexc.js +23 -23
- package/js/src/pro/okx.d.ts +7 -1
- package/js/src/pro/okx.js +46 -10
- package/js/src/pro/toobit.d.ts +174 -0
- package/js/src/pro/toobit.js +1162 -0
- package/js/src/toobit.d.ts +456 -0
- package/js/src/toobit.js +2992 -0
- package/js/src/upbit.js +1 -0
- package/js/src/wavesexchange.js +1 -0
- package/js/src/yobit.js +1 -0
- package/js/src/zaif.js +1 -0
- package/js/src/zonda.js +1 -0
- package/package.json +1 -1
- package/dist/373.ccxt.browser.js +0 -7630
- package/dist/373.ccxt.browser.min.js +0 -1
- package/js/src/abstract/tradeogre.d.ts +0 -21
- package/js/src/pro/tradeogre.d.ts +0 -49
- package/js/src/pro/tradeogre.js +0 -278
- package/js/src/tradeogre.d.ts +0 -149
- package/js/src/tradeogre.js +0 -872
- /package/js/src/abstract/{tradeogre.js → toobit.js} +0 -0
|
@@ -513,7 +513,7 @@ class bitget extends bitget$1["default"] {
|
|
|
513
513
|
args['topic'] = 'kline';
|
|
514
514
|
args['symbol'] = market['id'];
|
|
515
515
|
args['interval'] = interval;
|
|
516
|
-
params
|
|
516
|
+
params = this.extend(params, { 'uta': true });
|
|
517
517
|
messageHash = 'kline:' + symbol;
|
|
518
518
|
}
|
|
519
519
|
else {
|
|
@@ -557,7 +557,7 @@ class bitget extends bitget$1["default"] {
|
|
|
557
557
|
if (uta) {
|
|
558
558
|
channel = 'kline';
|
|
559
559
|
market['id'];
|
|
560
|
-
params
|
|
560
|
+
params = this.extend(params, { 'uta': true });
|
|
561
561
|
params['interval'] = interval;
|
|
562
562
|
messageHash = channel + symbol;
|
|
563
563
|
}
|
|
@@ -754,7 +754,7 @@ class bitget extends bitget$1["default"] {
|
|
|
754
754
|
args['topic'] = channel;
|
|
755
755
|
args['symbol'] = market['id'];
|
|
756
756
|
args['interval'] = this.safeString(params, 'interval', '1m');
|
|
757
|
-
params
|
|
757
|
+
params = this.extend(params, { 'uta': true });
|
|
758
758
|
params = this.omit(params, 'interval');
|
|
759
759
|
}
|
|
760
760
|
else {
|
|
@@ -1003,7 +1003,7 @@ class bitget extends bitget$1["default"] {
|
|
|
1003
1003
|
messageHashes.push('trade:' + symbol);
|
|
1004
1004
|
}
|
|
1005
1005
|
if (uta) {
|
|
1006
|
-
params
|
|
1006
|
+
params = this.extend(params, { 'uta': true });
|
|
1007
1007
|
}
|
|
1008
1008
|
const trades = await this.watchPublicMultiple(messageHashes, topics, params);
|
|
1009
1009
|
if (this.newUpdates) {
|
|
@@ -1237,11 +1237,13 @@ class bitget extends bitget$1["default"] {
|
|
|
1237
1237
|
* @name bitget#watchPositions
|
|
1238
1238
|
* @description watch all open positions
|
|
1239
1239
|
* @see https://www.bitget.com/api-doc/contract/websocket/private/Positions-Channel
|
|
1240
|
+
* @see https://www.bitget.com/api-doc/uta/websocket/private/Positions-Channel
|
|
1240
1241
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1241
1242
|
* @param {int} [since] the earliest time in ms to fetch positions for
|
|
1242
1243
|
* @param {int} [limit] the maximum number of positions to retrieve
|
|
1243
1244
|
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1244
1245
|
* @param {string} [params.instType] one of 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES', default is 'USDT-FUTURES'
|
|
1246
|
+
* @param {boolean} [params.uta] set to true for the unified trading account (uta), defaults to false
|
|
1245
1247
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1246
1248
|
*/
|
|
1247
1249
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1250,17 +1252,29 @@ class bitget extends bitget$1["default"] {
|
|
|
1250
1252
|
let messageHash = '';
|
|
1251
1253
|
const subscriptionHash = 'positions';
|
|
1252
1254
|
let instType = 'USDT-FUTURES';
|
|
1255
|
+
let uta = undefined;
|
|
1256
|
+
[uta, params] = this.handleOptionAndParams(params, 'watchPositions', 'uta', false);
|
|
1253
1257
|
symbols = this.marketSymbols(symbols);
|
|
1254
1258
|
if (!this.isEmpty(symbols)) {
|
|
1255
1259
|
market = this.getMarketFromSymbols(symbols);
|
|
1256
|
-
[instType, params] = this.getInstType(market,
|
|
1260
|
+
[instType, params] = this.getInstType(market, uta, params);
|
|
1261
|
+
}
|
|
1262
|
+
if (uta) {
|
|
1263
|
+
instType = 'UTA';
|
|
1257
1264
|
}
|
|
1258
1265
|
messageHash = instType + ':positions' + messageHash;
|
|
1259
1266
|
const args = {
|
|
1260
1267
|
'instType': instType,
|
|
1261
|
-
'channel': 'positions',
|
|
1262
|
-
'instId': 'default',
|
|
1263
1268
|
};
|
|
1269
|
+
const topicOrChannel = uta ? 'topic' : 'channel';
|
|
1270
|
+
const channel = uta ? 'position' : 'positions';
|
|
1271
|
+
args[topicOrChannel] = channel;
|
|
1272
|
+
if (!uta) {
|
|
1273
|
+
args['instId'] = 'default';
|
|
1274
|
+
}
|
|
1275
|
+
else {
|
|
1276
|
+
params = this.extend(params, { 'uta': true });
|
|
1277
|
+
}
|
|
1264
1278
|
const newPositions = await this.watchPrivate(messageHash, subscriptionHash, args, params);
|
|
1265
1279
|
if (this.newUpdates) {
|
|
1266
1280
|
return newPositions;
|
|
@@ -1305,7 +1319,46 @@ class bitget extends bitget$1["default"] {
|
|
|
1305
1319
|
// "ts": 1701913043767
|
|
1306
1320
|
// }
|
|
1307
1321
|
//
|
|
1308
|
-
|
|
1322
|
+
// uta
|
|
1323
|
+
//
|
|
1324
|
+
// {
|
|
1325
|
+
// "data": [
|
|
1326
|
+
// {
|
|
1327
|
+
// "symbol": "BTCUSDT",
|
|
1328
|
+
// "leverage": "20",
|
|
1329
|
+
// "openFeeTotal": "",
|
|
1330
|
+
// "mmr": "",
|
|
1331
|
+
// "breakEvenPrice": "",
|
|
1332
|
+
// "available": "0",
|
|
1333
|
+
// "liqPrice": "",
|
|
1334
|
+
// "marginMode": "crossed",
|
|
1335
|
+
// "unrealisedPnl": "0",
|
|
1336
|
+
// "markPrice": "94987.1",
|
|
1337
|
+
// "createdTime": "1736378720620",
|
|
1338
|
+
// "avgPrice": "0",
|
|
1339
|
+
// "totalFundingFee": "0",
|
|
1340
|
+
// "updatedTime": "1736378720620",
|
|
1341
|
+
// "marginCoin": "USDT",
|
|
1342
|
+
// "frozen": "0",
|
|
1343
|
+
// "profitRate": "",
|
|
1344
|
+
// "closeFeeTotal": "",
|
|
1345
|
+
// "marginSize": "0",
|
|
1346
|
+
// "curRealisedPnl": "0",
|
|
1347
|
+
// "size": "0",
|
|
1348
|
+
// "positionStatus": "ended",
|
|
1349
|
+
// "posSide": "long",
|
|
1350
|
+
// "holdMode": "hedge_mode"
|
|
1351
|
+
// }
|
|
1352
|
+
// ],
|
|
1353
|
+
// "arg": {
|
|
1354
|
+
// "instType": "UTA",
|
|
1355
|
+
// "topic": "position"
|
|
1356
|
+
// },
|
|
1357
|
+
// "action": "snapshot",
|
|
1358
|
+
// "ts": 1730711666652
|
|
1359
|
+
// }
|
|
1360
|
+
//
|
|
1361
|
+
const arg = this.safeDict(message, 'arg', {});
|
|
1309
1362
|
const instType = this.safeString(arg, 'instType', '');
|
|
1310
1363
|
if (this.positions === undefined) {
|
|
1311
1364
|
this.positions = {};
|
|
@@ -1315,11 +1368,11 @@ class bitget extends bitget$1["default"] {
|
|
|
1315
1368
|
this.positions[instType] = new Cache.ArrayCacheBySymbolBySide();
|
|
1316
1369
|
}
|
|
1317
1370
|
const cache = this.positions[instType];
|
|
1318
|
-
const rawPositions = this.
|
|
1371
|
+
const rawPositions = this.safeList(message, 'data', []);
|
|
1319
1372
|
const newPositions = [];
|
|
1320
1373
|
for (let i = 0; i < rawPositions.length; i++) {
|
|
1321
1374
|
const rawPosition = rawPositions[i];
|
|
1322
|
-
const marketId = this.
|
|
1375
|
+
const marketId = this.safeString2(rawPosition, 'instId', 'symbol');
|
|
1323
1376
|
const market = this.safeMarket(marketId, undefined, undefined, 'contract');
|
|
1324
1377
|
const position = this.parseWsPosition(rawPosition, market);
|
|
1325
1378
|
newPositions.push(position);
|
|
@@ -1364,16 +1417,45 @@ class bitget extends bitget$1["default"] {
|
|
|
1364
1417
|
// "autoMargin": "off"
|
|
1365
1418
|
// }
|
|
1366
1419
|
//
|
|
1367
|
-
|
|
1420
|
+
// uta
|
|
1421
|
+
//
|
|
1422
|
+
// {
|
|
1423
|
+
// "symbol": "BTCUSDT",
|
|
1424
|
+
// "leverage": "20",
|
|
1425
|
+
// "openFeeTotal": "",
|
|
1426
|
+
// "mmr": "",
|
|
1427
|
+
// "breakEvenPrice": "",
|
|
1428
|
+
// "available": "0",
|
|
1429
|
+
// "liqPrice": "",
|
|
1430
|
+
// "marginMode": "crossed",
|
|
1431
|
+
// "unrealisedPnl": "0",
|
|
1432
|
+
// "markPrice": "94987.1",
|
|
1433
|
+
// "createdTime": "1736378720620",
|
|
1434
|
+
// "avgPrice": "0",
|
|
1435
|
+
// "totalFundingFee": "0",
|
|
1436
|
+
// "updatedTime": "1736378720620",
|
|
1437
|
+
// "marginCoin": "USDT",
|
|
1438
|
+
// "frozen": "0",
|
|
1439
|
+
// "profitRate": "",
|
|
1440
|
+
// "closeFeeTotal": "",
|
|
1441
|
+
// "marginSize": "0",
|
|
1442
|
+
// "curRealisedPnl": "0",
|
|
1443
|
+
// "size": "0",
|
|
1444
|
+
// "positionStatus": "ended",
|
|
1445
|
+
// "posSide": "long",
|
|
1446
|
+
// "holdMode": "hedge_mode"
|
|
1447
|
+
// }
|
|
1448
|
+
//
|
|
1449
|
+
const marketId = this.safeString2(position, 'instId', 'symbol');
|
|
1368
1450
|
const marginModeId = this.safeString(position, 'marginMode');
|
|
1369
1451
|
const marginMode = this.getSupportedMapping(marginModeId, {
|
|
1370
1452
|
'crossed': 'cross',
|
|
1371
1453
|
'isolated': 'isolated',
|
|
1372
1454
|
});
|
|
1373
|
-
const hedgedId = this.
|
|
1455
|
+
const hedgedId = this.safeString2(position, 'posMode', 'holdMode');
|
|
1374
1456
|
const hedged = (hedgedId === 'hedge_mode') ? true : false;
|
|
1375
|
-
const timestamp = this.
|
|
1376
|
-
const percentageDecimal = this.
|
|
1457
|
+
const timestamp = this.safeIntegerN(position, ['updatedTime', 'uTime', 'cTime', 'createdTime']);
|
|
1458
|
+
const percentageDecimal = this.safeString2(position, 'unrealizedPLR', 'profitRate');
|
|
1377
1459
|
const percentage = Precise["default"].stringMul(percentageDecimal, '100');
|
|
1378
1460
|
let contractSize = undefined;
|
|
1379
1461
|
if (market !== undefined) {
|
|
@@ -1385,21 +1467,21 @@ class bitget extends bitget$1["default"] {
|
|
|
1385
1467
|
'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
|
|
1386
1468
|
'notional': undefined,
|
|
1387
1469
|
'marginMode': marginMode,
|
|
1388
|
-
'liquidationPrice': this.
|
|
1389
|
-
'entryPrice': this.
|
|
1390
|
-
'unrealizedPnl': this.
|
|
1470
|
+
'liquidationPrice': this.safeNumber2(position, 'liquidationPrice', 'liqPrice'),
|
|
1471
|
+
'entryPrice': this.safeNumber2(position, 'openPriceAvg', 'avgPrice'),
|
|
1472
|
+
'unrealizedPnl': this.safeNumber2(position, 'unrealizedPL', 'unrealisedPnl'),
|
|
1391
1473
|
'percentage': this.parseNumber(percentage),
|
|
1392
|
-
'contracts': this.
|
|
1474
|
+
'contracts': this.safeNumber2(position, 'total', 'size'),
|
|
1393
1475
|
'contractSize': contractSize,
|
|
1394
|
-
'markPrice':
|
|
1395
|
-
'side': this.
|
|
1476
|
+
'markPrice': this.safeNumber(position, 'markPrice'),
|
|
1477
|
+
'side': this.safeString2(position, 'holdSide', 'posSide'),
|
|
1396
1478
|
'hedged': hedged,
|
|
1397
1479
|
'timestamp': timestamp,
|
|
1398
1480
|
'datetime': this.iso8601(timestamp),
|
|
1399
1481
|
'maintenanceMargin': undefined,
|
|
1400
|
-
'maintenanceMarginPercentage': this.
|
|
1401
|
-
'collateral':
|
|
1402
|
-
'initialMargin':
|
|
1482
|
+
'maintenanceMarginPercentage': this.safeNumber2(position, 'keepMarginRate', 'mmr'),
|
|
1483
|
+
'collateral': this.safeNumber(position, 'available'),
|
|
1484
|
+
'initialMargin': this.safeNumber(position, 'marginSize'),
|
|
1403
1485
|
'initialMarginPercentage': undefined,
|
|
1404
1486
|
'leverage': this.safeNumber(position, 'leverage'),
|
|
1405
1487
|
'marginRatio': this.safeNumber(position, 'marginRate'),
|
|
@@ -1414,6 +1496,7 @@ class bitget extends bitget$1["default"] {
|
|
|
1414
1496
|
* @see https://www.bitget.com/api-doc/contract/websocket/private/Plan-Order-Channel
|
|
1415
1497
|
* @see https://www.bitget.com/api-doc/margin/cross/websocket/private/Cross-Orders
|
|
1416
1498
|
* @see https://www.bitget.com/api-doc/margin/isolated/websocket/private/Isolate-Orders
|
|
1499
|
+
* @see https://www.bitget.com/api-doc/uta/websocket/private/Order-Channel
|
|
1417
1500
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1418
1501
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1419
1502
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1422,6 +1505,7 @@ class bitget extends bitget$1["default"] {
|
|
|
1422
1505
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for watching spot margin orders]
|
|
1423
1506
|
* @param {string} [params.type] 'spot', 'swap'
|
|
1424
1507
|
* @param {string} [params.subType] 'linear', 'inverse'
|
|
1508
|
+
* @param {boolean} [params.uta] set to true for the unified trading account (uta), defaults to false
|
|
1425
1509
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1426
1510
|
*/
|
|
1427
1511
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1438,6 +1522,8 @@ class bitget extends bitget$1["default"] {
|
|
|
1438
1522
|
marketId = market['id'];
|
|
1439
1523
|
messageHash = messageHash + ':' + symbol;
|
|
1440
1524
|
}
|
|
1525
|
+
let uta = undefined;
|
|
1526
|
+
[uta, params] = this.handleOptionAndParams(params, 'watchOrders', 'uta', false);
|
|
1441
1527
|
const productType = this.safeString(params, 'productType');
|
|
1442
1528
|
let type = undefined;
|
|
1443
1529
|
[type, params] = this.handleMarketTypeAndParams('watchOrders', market, params);
|
|
@@ -1463,7 +1549,7 @@ class bitget extends bitget$1["default"] {
|
|
|
1463
1549
|
instType = 'SPOT';
|
|
1464
1550
|
}
|
|
1465
1551
|
else {
|
|
1466
|
-
[instType, params] = this.getInstType(market,
|
|
1552
|
+
[instType, params] = this.getInstType(market, uta, params);
|
|
1467
1553
|
}
|
|
1468
1554
|
if (type === 'spot' && (symbol !== undefined)) {
|
|
1469
1555
|
subscriptionHash = subscriptionHash + ':' + symbol;
|
|
@@ -1485,12 +1571,22 @@ class bitget extends bitget$1["default"] {
|
|
|
1485
1571
|
channel = 'orders-crossed';
|
|
1486
1572
|
}
|
|
1487
1573
|
}
|
|
1574
|
+
if (uta) {
|
|
1575
|
+
instType = 'UTA';
|
|
1576
|
+
channel = 'order';
|
|
1577
|
+
}
|
|
1488
1578
|
subscriptionHash = subscriptionHash + ':' + instType;
|
|
1489
1579
|
const args = {
|
|
1490
1580
|
'instType': instType,
|
|
1491
|
-
'channel': channel,
|
|
1492
|
-
'instId': instId,
|
|
1493
1581
|
};
|
|
1582
|
+
const topicOrChannel = uta ? 'topic' : 'channel';
|
|
1583
|
+
args[topicOrChannel] = channel;
|
|
1584
|
+
if (!uta) {
|
|
1585
|
+
args['instId'] = instId;
|
|
1586
|
+
}
|
|
1587
|
+
else {
|
|
1588
|
+
params = this.extend(params, { 'uta': true });
|
|
1589
|
+
}
|
|
1494
1590
|
const orders = await this.watchPrivate(messageHash, subscriptionHash, args, params);
|
|
1495
1591
|
if (this.newUpdates) {
|
|
1496
1592
|
limit = orders.getLimit(symbol, limit);
|
|
@@ -1532,24 +1628,73 @@ class bitget extends bitget$1["default"] {
|
|
|
1532
1628
|
// "ts": 1701923982497
|
|
1533
1629
|
// }
|
|
1534
1630
|
//
|
|
1631
|
+
// uta
|
|
1632
|
+
//
|
|
1633
|
+
// {
|
|
1634
|
+
// "action": "snapshot",
|
|
1635
|
+
// "arg": {
|
|
1636
|
+
// "instType": "UTA",
|
|
1637
|
+
// "topic": "order"
|
|
1638
|
+
// },
|
|
1639
|
+
// "data": [
|
|
1640
|
+
// {
|
|
1641
|
+
// "category": "usdt-futures",
|
|
1642
|
+
// "symbol": "BTCUSDT",
|
|
1643
|
+
// "orderId": "xxx",
|
|
1644
|
+
// "clientOid": "xxx",
|
|
1645
|
+
// "price": "",
|
|
1646
|
+
// "qty": "0.001",
|
|
1647
|
+
// "amount": "1000",
|
|
1648
|
+
// "holdMode": "hedge_mode",
|
|
1649
|
+
// "holdSide": "long",
|
|
1650
|
+
// "tradeSide": "open",
|
|
1651
|
+
// "orderType": "market",
|
|
1652
|
+
// "timeInForce": "gtc",
|
|
1653
|
+
// "side": "buy",
|
|
1654
|
+
// "marginMode": "crossed",
|
|
1655
|
+
// "marginCoin": "USDT",
|
|
1656
|
+
// "reduceOnly": "no",
|
|
1657
|
+
// "cumExecQty": "0.001",
|
|
1658
|
+
// "cumExecValue": "83.1315",
|
|
1659
|
+
// "avgPrice": "83131.5",
|
|
1660
|
+
// "totalProfit": "0",
|
|
1661
|
+
// "orderStatus": "filled",
|
|
1662
|
+
// "cancelReason": "",
|
|
1663
|
+
// "leverage": "20",
|
|
1664
|
+
// "feeDetail": [
|
|
1665
|
+
// {
|
|
1666
|
+
// "feeCoin": "USDT",
|
|
1667
|
+
// "fee": "0.0332526"
|
|
1668
|
+
// }
|
|
1669
|
+
// ],
|
|
1670
|
+
// "createdTime": "1742367838101",
|
|
1671
|
+
// "updatedTime": "1742367838115",
|
|
1672
|
+
// "stpMode": "none"
|
|
1673
|
+
// }
|
|
1674
|
+
// ],
|
|
1675
|
+
// "ts": 1742367838124
|
|
1676
|
+
// }
|
|
1677
|
+
//
|
|
1535
1678
|
const arg = this.safeDict(message, 'arg', {});
|
|
1536
|
-
const channel = this.
|
|
1537
|
-
const instType = this.
|
|
1679
|
+
const channel = this.safeString2(arg, 'channel', 'topic');
|
|
1680
|
+
const instType = this.safeStringLower(arg, 'instType');
|
|
1538
1681
|
const argInstId = this.safeString(arg, 'instId');
|
|
1539
1682
|
let marketType = undefined;
|
|
1540
|
-
if (instType === '
|
|
1683
|
+
if (instType === 'spot') {
|
|
1541
1684
|
marketType = 'spot';
|
|
1542
1685
|
}
|
|
1543
|
-
else if (instType === '
|
|
1686
|
+
else if (instType === 'margin') {
|
|
1544
1687
|
marketType = 'spot';
|
|
1545
1688
|
}
|
|
1546
1689
|
else {
|
|
1547
1690
|
marketType = 'contract';
|
|
1548
1691
|
}
|
|
1549
|
-
const
|
|
1550
|
-
const
|
|
1551
|
-
const
|
|
1552
|
-
const
|
|
1692
|
+
const data = this.safeList(message, 'data', []);
|
|
1693
|
+
const first = this.safeDict(data, 0, {});
|
|
1694
|
+
const category = this.safeStringLower(first, 'category', instType);
|
|
1695
|
+
const isLinearSwap = (category === 'usdt-futures');
|
|
1696
|
+
const isInverseSwap = (category === 'coin-futures');
|
|
1697
|
+
const isUSDCFutures = (category === 'usdc-futures');
|
|
1553
1698
|
if (this.orders === undefined) {
|
|
1554
1699
|
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
|
1555
1700
|
this.orders = new Cache.ArrayCacheBySymbolById(limit);
|
|
@@ -1561,7 +1706,7 @@ class bitget extends bitget$1["default"] {
|
|
|
1561
1706
|
const marketSymbols = {};
|
|
1562
1707
|
for (let i = 0; i < data.length; i++) {
|
|
1563
1708
|
const order = data[i];
|
|
1564
|
-
const marketId = this.
|
|
1709
|
+
const marketId = this.safeString2(order, 'instId', 'symbol', argInstId);
|
|
1565
1710
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
1566
1711
|
const parsed = this.parseWsOrder(order, market);
|
|
1567
1712
|
stored.append(parsed);
|
|
@@ -1709,13 +1854,57 @@ class bitget extends bitget$1["default"] {
|
|
|
1709
1854
|
// orderId: "1183419084588060673",
|
|
1710
1855
|
// }
|
|
1711
1856
|
//
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1857
|
+
// uta
|
|
1858
|
+
//
|
|
1859
|
+
// {
|
|
1860
|
+
// "category": "usdt-futures",
|
|
1861
|
+
// "symbol": "BTCUSDT",
|
|
1862
|
+
// "orderId": "xxx",
|
|
1863
|
+
// "clientOid": "xxx",
|
|
1864
|
+
// "price": "",
|
|
1865
|
+
// "qty": "0.001",
|
|
1866
|
+
// "amount": "1000",
|
|
1867
|
+
// "holdMode": "hedge_mode",
|
|
1868
|
+
// "holdSide": "long",
|
|
1869
|
+
// "tradeSide": "open",
|
|
1870
|
+
// "orderType": "market",
|
|
1871
|
+
// "timeInForce": "gtc",
|
|
1872
|
+
// "side": "buy",
|
|
1873
|
+
// "marginMode": "crossed",
|
|
1874
|
+
// "marginCoin": "USDT",
|
|
1875
|
+
// "reduceOnly": "no",
|
|
1876
|
+
// "cumExecQty": "0.001",
|
|
1877
|
+
// "cumExecValue": "83.1315",
|
|
1878
|
+
// "avgPrice": "83131.5",
|
|
1879
|
+
// "totalProfit": "0",
|
|
1880
|
+
// "orderStatus": "filled",
|
|
1881
|
+
// "cancelReason": "",
|
|
1882
|
+
// "leverage": "20",
|
|
1883
|
+
// "feeDetail": [
|
|
1884
|
+
// {
|
|
1885
|
+
// "feeCoin": "USDT",
|
|
1886
|
+
// "fee": "0.0332526"
|
|
1887
|
+
// }
|
|
1888
|
+
// ],
|
|
1889
|
+
// "createdTime": "1742367838101",
|
|
1890
|
+
// "updatedTime": "1742367838115",
|
|
1891
|
+
// "stpMode": "none"
|
|
1892
|
+
// }
|
|
1893
|
+
//
|
|
1894
|
+
let isSpot = !('posMode' in order);
|
|
1895
|
+
let isMargin = ('loanType' in order);
|
|
1896
|
+
const category = this.safeStringLower(order, 'category');
|
|
1897
|
+
if (category === 'spot') {
|
|
1898
|
+
isSpot = true;
|
|
1899
|
+
}
|
|
1900
|
+
if (category === 'margin') {
|
|
1901
|
+
isMargin = true;
|
|
1902
|
+
}
|
|
1903
|
+
const marketId = this.safeString2(order, 'instId', 'symbol');
|
|
1715
1904
|
market = this.safeMarket(marketId, market);
|
|
1716
|
-
const timestamp = this.
|
|
1905
|
+
const timestamp = this.safeInteger2(order, 'cTime', 'createdTime');
|
|
1717
1906
|
const symbol = market['symbol'];
|
|
1718
|
-
const rawStatus = this.
|
|
1907
|
+
const rawStatus = this.safeString2(order, 'status', 'orderStatus');
|
|
1719
1908
|
const orderFee = this.safeValue(order, 'feeDetail', []);
|
|
1720
1909
|
const fee = this.safeValue(orderFee, 0);
|
|
1721
1910
|
const feeAmount = this.safeString(fee, 'fee');
|
|
@@ -1737,23 +1926,23 @@ class bitget extends bitget$1["default"] {
|
|
|
1737
1926
|
// for spot trigger order, limit price is this
|
|
1738
1927
|
price = this.safeNumber(order, 'executePrice');
|
|
1739
1928
|
}
|
|
1740
|
-
const avgPrice = this.omitZero(this.
|
|
1929
|
+
const avgPrice = this.omitZero(this.safeStringLowerN(order, ['priceAvg', 'fillPrice', 'avgPrice']));
|
|
1741
1930
|
const side = this.safeString(order, 'side');
|
|
1742
1931
|
const type = this.safeString(order, 'orderType');
|
|
1743
|
-
const accBaseVolume = this.omitZero(this.
|
|
1744
|
-
const newSizeValue = this.omitZero(this.
|
|
1932
|
+
const accBaseVolume = this.omitZero(this.safeString2(order, 'accBaseVolume', 'cumExecQty'));
|
|
1933
|
+
const newSizeValue = this.omitZero(this.safeString2(order, 'newSize', 'cumExecValue'));
|
|
1745
1934
|
const isMarketOrder = (type === 'market');
|
|
1746
1935
|
const isBuy = (side === 'buy');
|
|
1747
1936
|
let totalAmount = undefined;
|
|
1748
1937
|
let filledAmount = undefined;
|
|
1749
1938
|
let cost = undefined;
|
|
1750
1939
|
let remaining = undefined;
|
|
1751
|
-
let totalFilled = this.
|
|
1940
|
+
let totalFilled = this.safeString2(order, 'accBaseVolume', 'cumExecQty');
|
|
1752
1941
|
if (isSpot) {
|
|
1753
1942
|
if (isMargin) {
|
|
1754
|
-
totalAmount = this.
|
|
1755
|
-
totalFilled = this.
|
|
1756
|
-
cost = this.
|
|
1943
|
+
totalAmount = this.safeString2(order, 'baseSize', 'qty');
|
|
1944
|
+
totalFilled = this.safeString2(order, 'baseVolume', 'cumExecQty');
|
|
1945
|
+
cost = this.safeString2(order, 'fillTotalAmount', 'cumExecValue');
|
|
1757
1946
|
}
|
|
1758
1947
|
else {
|
|
1759
1948
|
const partialFillAmount = this.safeString(order, 'baseVolume');
|
|
@@ -1774,16 +1963,16 @@ class bitget extends bitget$1["default"] {
|
|
|
1774
1963
|
}
|
|
1775
1964
|
}
|
|
1776
1965
|
else {
|
|
1777
|
-
totalAmount = this.
|
|
1966
|
+
totalAmount = this.safeString2(order, 'newSize', 'qty');
|
|
1778
1967
|
// we don't have cost for limit order
|
|
1779
1968
|
}
|
|
1780
1969
|
}
|
|
1781
1970
|
}
|
|
1782
1971
|
else {
|
|
1783
1972
|
// baseVolume should not be used for "amount" for contracts !
|
|
1784
|
-
filledAmount = this.
|
|
1785
|
-
totalAmount = this.
|
|
1786
|
-
cost = this.
|
|
1973
|
+
filledAmount = this.safeString2(order, 'baseVolume', 'cumExecQty');
|
|
1974
|
+
totalAmount = this.safeString2(order, 'size', 'qty');
|
|
1975
|
+
cost = this.safeString2(order, 'fillNotionalUsd', 'cumExecValue');
|
|
1787
1976
|
}
|
|
1788
1977
|
remaining = Precise["default"].stringSub(totalAmount, totalFilled);
|
|
1789
1978
|
return this.safeOrder({
|
|
@@ -1793,9 +1982,9 @@ class bitget extends bitget$1["default"] {
|
|
|
1793
1982
|
'clientOrderId': this.safeString(order, 'clientOid'),
|
|
1794
1983
|
'timestamp': timestamp,
|
|
1795
1984
|
'datetime': this.iso8601(timestamp),
|
|
1796
|
-
'lastTradeTimestamp': this.
|
|
1985
|
+
'lastTradeTimestamp': this.safeInteger2(order, 'uTime', 'updatedTime'),
|
|
1797
1986
|
'type': type,
|
|
1798
|
-
'timeInForce': this.
|
|
1987
|
+
'timeInForce': this.safeStringUpper2(order, 'force', 'timeInForce'),
|
|
1799
1988
|
'postOnly': undefined,
|
|
1800
1989
|
'side': side,
|
|
1801
1990
|
'price': price,
|
|
@@ -1866,7 +2055,7 @@ class bitget extends bitget$1["default"] {
|
|
|
1866
2055
|
args['instId'] = 'default';
|
|
1867
2056
|
}
|
|
1868
2057
|
else {
|
|
1869
|
-
params
|
|
2058
|
+
params = this.extend(params, { 'uta': true });
|
|
1870
2059
|
}
|
|
1871
2060
|
const trades = await this.watchPrivate(messageHash, subscriptionHash, args, params);
|
|
1872
2061
|
if (this.newUpdates) {
|
|
@@ -2010,13 +2199,17 @@ class bitget extends bitget$1["default"] {
|
|
|
2010
2199
|
* @see https://www.bitget.com/api-doc/contract/websocket/private/Account-Channel
|
|
2011
2200
|
* @see https://www.bitget.com/api-doc/margin/cross/websocket/private/Margin-Cross-Account-Assets
|
|
2012
2201
|
* @see https://www.bitget.com/api-doc/margin/isolated/websocket/private/Margin-isolated-account-assets
|
|
2202
|
+
* @see https://www.bitget.com/api-doc/uta/websocket/private/Account-Channel
|
|
2013
2203
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2014
2204
|
* @param {str} [params.type] spot or contract if not provided this.options['defaultType'] is used
|
|
2015
2205
|
* @param {string} [params.instType] one of 'SPOT', 'MARGIN', 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
|
|
2016
2206
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for watching spot margin balances
|
|
2207
|
+
* @param {boolean} [params.uta] set to true for the unified trading account (uta), defaults to false
|
|
2017
2208
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
2018
2209
|
*/
|
|
2019
2210
|
async watchBalance(params = {}) {
|
|
2211
|
+
let uta = undefined;
|
|
2212
|
+
[uta, params] = this.handleOptionAndParams(params, 'watchBalance', 'uta', false);
|
|
2020
2213
|
let type = undefined;
|
|
2021
2214
|
[type, params] = this.handleMarketTypeAndParams('watchBalance', undefined, params);
|
|
2022
2215
|
let marginMode = undefined;
|
|
@@ -2028,22 +2221,33 @@ class bitget extends bitget$1["default"] {
|
|
|
2028
2221
|
}
|
|
2029
2222
|
else if (marginMode !== undefined) {
|
|
2030
2223
|
instType = 'MARGIN';
|
|
2031
|
-
if (
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2224
|
+
if (!uta) {
|
|
2225
|
+
if (marginMode === 'isolated') {
|
|
2226
|
+
channel = 'account-isolated';
|
|
2227
|
+
}
|
|
2228
|
+
else {
|
|
2229
|
+
channel = 'account-crossed';
|
|
2230
|
+
}
|
|
2036
2231
|
}
|
|
2037
2232
|
}
|
|
2038
|
-
else {
|
|
2233
|
+
else if (!uta) {
|
|
2039
2234
|
instType = 'SPOT';
|
|
2040
2235
|
}
|
|
2041
2236
|
[instType, params] = this.handleOptionAndParams(params, 'watchBalance', 'instType', instType);
|
|
2237
|
+
if (uta) {
|
|
2238
|
+
instType = 'UTA';
|
|
2239
|
+
}
|
|
2042
2240
|
const args = {
|
|
2043
2241
|
'instType': instType,
|
|
2044
|
-
'channel': channel,
|
|
2045
|
-
'coin': 'default',
|
|
2046
2242
|
};
|
|
2243
|
+
const topicOrChannel = uta ? 'topic' : 'channel';
|
|
2244
|
+
args[topicOrChannel] = channel;
|
|
2245
|
+
if (!uta) {
|
|
2246
|
+
args['coin'] = 'default';
|
|
2247
|
+
}
|
|
2248
|
+
else {
|
|
2249
|
+
params = this.extend(params, { 'uta': true });
|
|
2250
|
+
}
|
|
2047
2251
|
const messageHash = 'balance:' + instType.toLowerCase();
|
|
2048
2252
|
return await this.watchPrivate(messageHash, messageHash, args, params);
|
|
2049
2253
|
}
|
|
@@ -2106,26 +2310,76 @@ class bitget extends bitget$1["default"] {
|
|
|
2106
2310
|
// "ts": 1701933110544
|
|
2107
2311
|
// }
|
|
2108
2312
|
//
|
|
2313
|
+
// uta
|
|
2314
|
+
//
|
|
2315
|
+
// {
|
|
2316
|
+
// "data": [{
|
|
2317
|
+
// "unrealisedPnL": "-10116.55",
|
|
2318
|
+
// "totalEquity": "4976919.05",
|
|
2319
|
+
// "positionMgnRatio": "0",
|
|
2320
|
+
// "mmr": "408.08",
|
|
2321
|
+
// "effEquity": "4847952.35",
|
|
2322
|
+
// "imr": "17795.97",
|
|
2323
|
+
// "mgnRatio": "0",
|
|
2324
|
+
// "coin": [{
|
|
2325
|
+
// "debts": "0",
|
|
2326
|
+
// "balance": "0.9992",
|
|
2327
|
+
// "available": "0.9992",
|
|
2328
|
+
// "borrow": "0",
|
|
2329
|
+
// "locked": "0",
|
|
2330
|
+
// "equity": "0.9992",
|
|
2331
|
+
// "coin": "ETH",
|
|
2332
|
+
// "usdValue": "2488.667472"
|
|
2333
|
+
// }]
|
|
2334
|
+
// }],
|
|
2335
|
+
// "arg": {
|
|
2336
|
+
// "instType": "UTA",
|
|
2337
|
+
// "topic": "account"
|
|
2338
|
+
// },
|
|
2339
|
+
// "action": "snapshot",
|
|
2340
|
+
// "ts": 1740546523244
|
|
2341
|
+
// }
|
|
2342
|
+
//
|
|
2343
|
+
const arg = this.safeDict(message, 'arg', {});
|
|
2344
|
+
const instType = this.safeStringLower(arg, 'instType');
|
|
2109
2345
|
const data = this.safeValue(message, 'data', []);
|
|
2110
2346
|
for (let i = 0; i < data.length; i++) {
|
|
2111
2347
|
const rawBalance = data[i];
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2348
|
+
if (instType === 'uta') {
|
|
2349
|
+
const coins = this.safeList(rawBalance, 'coin', []);
|
|
2350
|
+
for (let j = 0; j < coins.length; j++) {
|
|
2351
|
+
const entry = coins[j];
|
|
2352
|
+
const currencyId = this.safeString(entry, 'coin');
|
|
2353
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
2354
|
+
const account = (code in this.balance) ? this.balance[code] : this.account();
|
|
2355
|
+
const borrow = this.safeString(entry, 'borrow');
|
|
2356
|
+
const debts = this.safeString(entry, 'debts');
|
|
2357
|
+
if ((borrow !== undefined) || (debts !== undefined)) {
|
|
2358
|
+
account['debt'] = Precise["default"].stringAdd(borrow, debts);
|
|
2359
|
+
}
|
|
2360
|
+
account['free'] = this.safeString(entry, 'available');
|
|
2361
|
+
account['used'] = this.safeString(entry, 'locked');
|
|
2362
|
+
account['total'] = this.safeString(entry, 'balance');
|
|
2363
|
+
this.balance[code] = account;
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
else {
|
|
2367
|
+
const currencyId = this.safeString2(rawBalance, 'coin', 'marginCoin');
|
|
2368
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
2369
|
+
const account = (code in this.balance) ? this.balance[code] : this.account();
|
|
2370
|
+
const borrow = this.safeString(rawBalance, 'borrow');
|
|
2371
|
+
if (borrow !== undefined) {
|
|
2372
|
+
const interest = this.safeString(rawBalance, 'interest');
|
|
2373
|
+
account['debt'] = Precise["default"].stringAdd(borrow, interest);
|
|
2374
|
+
}
|
|
2375
|
+
const freeQuery = ('maxTransferOut' in rawBalance) ? 'maxTransferOut' : 'available';
|
|
2376
|
+
account['free'] = this.safeString(rawBalance, freeQuery);
|
|
2377
|
+
account['total'] = this.safeString(rawBalance, 'equity');
|
|
2378
|
+
account['used'] = this.safeString(rawBalance, 'frozen');
|
|
2379
|
+
this.balance[code] = account;
|
|
2119
2380
|
}
|
|
2120
|
-
const freeQuery = ('maxTransferOut' in rawBalance) ? 'maxTransferOut' : 'available';
|
|
2121
|
-
account['free'] = this.safeString(rawBalance, freeQuery);
|
|
2122
|
-
account['total'] = this.safeString(rawBalance, 'equity');
|
|
2123
|
-
account['used'] = this.safeString(rawBalance, 'frozen');
|
|
2124
|
-
this.balance[code] = account;
|
|
2125
2381
|
}
|
|
2126
2382
|
this.balance = this.safeBalance(this.balance);
|
|
2127
|
-
const arg = this.safeValue(message, 'arg');
|
|
2128
|
-
const instType = this.safeStringLower(arg, 'instType');
|
|
2129
2383
|
const messageHash = 'balance:' + instType;
|
|
2130
2384
|
client.resolve(this.balance, messageHash);
|
|
2131
2385
|
}
|
|
@@ -2425,12 +2679,14 @@ class bitget extends bitget$1["default"] {
|
|
|
2425
2679
|
'trade': this.handleTrades,
|
|
2426
2680
|
'publicTrade': this.handleTrades,
|
|
2427
2681
|
'fill': this.handleMyTrades,
|
|
2682
|
+
'order': this.handleOrder,
|
|
2428
2683
|
'orders': this.handleOrder,
|
|
2429
2684
|
'ordersAlgo': this.handleOrder,
|
|
2430
2685
|
'orders-algo': this.handleOrder,
|
|
2431
2686
|
'orders-crossed': this.handleOrder,
|
|
2432
2687
|
'orders-isolated': this.handleOrder,
|
|
2433
2688
|
'account': this.handleBalance,
|
|
2689
|
+
'position': this.handlePositions,
|
|
2434
2690
|
'positions': this.handlePositions,
|
|
2435
2691
|
'account-isolated': this.handleBalance,
|
|
2436
2692
|
'account-crossed': this.handleBalance,
|