ccxt 4.2.54 → 4.2.56
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 +3 -3
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +161 -87
- package/dist/ccxt.browser.min.js +6 -6
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bingx.js +3 -1
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/gate.js +6 -2
- package/dist/cjs/src/okx.js +17 -1
- package/dist/cjs/src/pro/bitget.js +69 -73
- package/dist/cjs/src/pro/bybit.js +19 -5
- package/dist/cjs/src/pro/currencycom.js +2 -1
- package/dist/cjs/src/pro/kraken.js +1 -1
- package/dist/cjs/src/upbit.js +1 -1
- package/dist/cjs/src/woo.js +41 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/gate.d.ts +13 -9
- package/js/src/abstract/gateio.d.ts +13 -9
- package/js/src/abstract/woo.d.ts +9 -0
- package/js/src/base/Exchange.d.ts +1 -1
- package/js/src/base/types.d.ts +2 -2
- package/js/src/bingx.d.ts +4 -4
- package/js/src/bingx.js +3 -1
- package/js/src/bybit.js +1 -1
- package/js/src/gate.js +6 -2
- package/js/src/okx.js +17 -1
- package/js/src/pro/bitget.d.ts +0 -1
- package/js/src/pro/bitget.js +69 -73
- package/js/src/pro/bybit.js +19 -5
- package/js/src/pro/currencycom.js +2 -1
- package/js/src/pro/kraken.js +1 -1
- package/js/src/upbit.js +1 -1
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +41 -0
- package/package.json +1 -1
- package/skip-tests.json +28 -163
package/dist/cjs/ccxt.js
CHANGED
|
@@ -176,7 +176,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
176
176
|
|
|
177
177
|
//-----------------------------------------------------------------------------
|
|
178
178
|
// this is updated by vss.js when building
|
|
179
|
-
const version = '4.2.
|
|
179
|
+
const version = '4.2.56';
|
|
180
180
|
Exchange["default"].ccxtVersion = version;
|
|
181
181
|
const exchanges = {
|
|
182
182
|
'ace': ace,
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -1399,7 +1399,9 @@ class bingx extends bingx$1 {
|
|
|
1399
1399
|
if (symbols !== undefined) {
|
|
1400
1400
|
symbols = this.marketSymbols(symbols);
|
|
1401
1401
|
const firstSymbol = this.safeString(symbols, 0);
|
|
1402
|
-
|
|
1402
|
+
if (firstSymbol !== undefined) {
|
|
1403
|
+
market = this.market(firstSymbol);
|
|
1404
|
+
}
|
|
1403
1405
|
}
|
|
1404
1406
|
let type = undefined;
|
|
1405
1407
|
[type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -78,6 +78,7 @@ class bybit extends bybit$1 {
|
|
|
78
78
|
'fetchIsolatedBorrowRate': false,
|
|
79
79
|
'fetchIsolatedBorrowRates': false,
|
|
80
80
|
'fetchLedger': true,
|
|
81
|
+
'fetchLeverage': true,
|
|
81
82
|
'fetchMarketLeverageTiers': true,
|
|
82
83
|
'fetchMarkets': true,
|
|
83
84
|
'fetchMarkOHLCV': true,
|
|
@@ -108,7 +109,6 @@ class bybit extends bybit$1 {
|
|
|
108
109
|
'fetchUnderlyingAssets': false,
|
|
109
110
|
'fetchVolatilityHistory': true,
|
|
110
111
|
'fetchWithdrawals': true,
|
|
111
|
-
'fetchLeverage': true,
|
|
112
112
|
'repayCrossMargin': true,
|
|
113
113
|
'setLeverage': true,
|
|
114
114
|
'setMarginMode': true,
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -45,7 +45,7 @@ class gate extends gate$1 {
|
|
|
45
45
|
'spot': 'https://api.gateio.ws/api/v4',
|
|
46
46
|
'options': 'https://api.gateio.ws/api/v4',
|
|
47
47
|
'subAccounts': 'https://api.gateio.ws/api/v4',
|
|
48
|
-
'
|
|
48
|
+
'unified': 'https://api.gateio.ws/api/v4',
|
|
49
49
|
'rebate': 'https://api.gateio.ws/api/v4',
|
|
50
50
|
'earn': 'https://api.gateio.ws/api/v4',
|
|
51
51
|
'account': 'https://api.gateio.ws/api/v4',
|
|
@@ -268,11 +268,14 @@ class gate extends gate$1 {
|
|
|
268
268
|
'saved_address': 1,
|
|
269
269
|
'fee': 1,
|
|
270
270
|
'total_balance': 2.5,
|
|
271
|
+
'small_balance': 1,
|
|
272
|
+
'small_balance_history': 1,
|
|
271
273
|
},
|
|
272
274
|
'post': {
|
|
273
275
|
'transfers': 2.5,
|
|
274
276
|
'sub_account_transfers': 2.5,
|
|
275
277
|
'sub_account_to_sub_account': 2.5,
|
|
278
|
+
'small_balance': 1,
|
|
276
279
|
},
|
|
277
280
|
},
|
|
278
281
|
'subAccounts': {
|
|
@@ -295,7 +298,7 @@ class gate extends gate$1 {
|
|
|
295
298
|
'sub_accounts/{user_id}/keys/{key}': 2.5,
|
|
296
299
|
},
|
|
297
300
|
},
|
|
298
|
-
'
|
|
301
|
+
'unified': {
|
|
299
302
|
'get': {
|
|
300
303
|
'accounts': 20 / 15,
|
|
301
304
|
'account_mode': 20 / 15,
|
|
@@ -304,6 +307,7 @@ class gate extends gate$1 {
|
|
|
304
307
|
'loans': 20 / 15,
|
|
305
308
|
'loan_records': 20 / 15,
|
|
306
309
|
'interest_records': 20 / 15,
|
|
310
|
+
'estimate_rate': 20 / 15,
|
|
307
311
|
},
|
|
308
312
|
'post': {
|
|
309
313
|
'account_mode': 20 / 15,
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -573,6 +573,7 @@ class okx extends okx$1 {
|
|
|
573
573
|
'50027': errors.PermissionDenied,
|
|
574
574
|
'50028': errors.ExchangeError,
|
|
575
575
|
'50044': errors.BadRequest,
|
|
576
|
+
'50062': errors.ExchangeError,
|
|
576
577
|
// API Class
|
|
577
578
|
'50100': errors.ExchangeError,
|
|
578
579
|
'50101': errors.AuthenticationError,
|
|
@@ -627,6 +628,15 @@ class okx extends okx$1 {
|
|
|
627
628
|
'51072': errors.InvalidOrder,
|
|
628
629
|
'51073': errors.InvalidOrder,
|
|
629
630
|
'51074': errors.InvalidOrder,
|
|
631
|
+
'51090': errors.InvalidOrder,
|
|
632
|
+
'51091': errors.InvalidOrder,
|
|
633
|
+
'51092': errors.InvalidOrder,
|
|
634
|
+
'51093': errors.InvalidOrder,
|
|
635
|
+
'51094': errors.InvalidOrder,
|
|
636
|
+
'51095': errors.InvalidOrder,
|
|
637
|
+
'51096': errors.InvalidOrder,
|
|
638
|
+
'51098': errors.InvalidOrder,
|
|
639
|
+
'51099': errors.InvalidOrder,
|
|
630
640
|
'51100': errors.InvalidOrder,
|
|
631
641
|
'51101': errors.InvalidOrder,
|
|
632
642
|
'51102': errors.InvalidOrder,
|
|
@@ -2754,7 +2764,7 @@ class okx extends okx$1 {
|
|
|
2754
2764
|
}
|
|
2755
2765
|
request['tpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
|
|
2756
2766
|
const takeProfitLimitPrice = this.safeValueN(takeProfit, ['price', 'takeProfitPrice', 'tpOrdPx']);
|
|
2757
|
-
const takeProfitOrderType = this.
|
|
2767
|
+
const takeProfitOrderType = this.safeString2(takeProfit, 'type', 'tpOrdKind');
|
|
2758
2768
|
if (takeProfitOrderType !== undefined) {
|
|
2759
2769
|
const takeProfitLimitOrderType = (takeProfitOrderType === 'limit');
|
|
2760
2770
|
const takeProfitMarketOrderType = (takeProfitOrderType === 'market');
|
|
@@ -2766,6 +2776,7 @@ class okx extends okx$1 {
|
|
|
2766
2776
|
throw new errors.InvalidOrder(this.id + ' createOrder() requires a limit price in params["takeProfit"]["price"] or params["takeProfit"]["tpOrdPx"] for a take profit limit order');
|
|
2767
2777
|
}
|
|
2768
2778
|
else {
|
|
2779
|
+
request['tpOrdKind'] = takeProfitOrderType;
|
|
2769
2780
|
request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice);
|
|
2770
2781
|
}
|
|
2771
2782
|
}
|
|
@@ -2774,6 +2785,7 @@ class okx extends okx$1 {
|
|
|
2774
2785
|
}
|
|
2775
2786
|
}
|
|
2776
2787
|
else if (takeProfitLimitPrice !== undefined) {
|
|
2788
|
+
request['tpOrdKind'] = 'limit';
|
|
2777
2789
|
request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice); // limit tp order
|
|
2778
2790
|
}
|
|
2779
2791
|
else {
|
|
@@ -2798,6 +2810,7 @@ class okx extends okx$1 {
|
|
|
2798
2810
|
const twoWayCondition = ((takeProfitPrice !== undefined) && (stopLossPrice !== undefined));
|
|
2799
2811
|
// if TP and SL are sent together
|
|
2800
2812
|
// as ordType 'conditional' only stop-loss order will be applied
|
|
2813
|
+
// tpOrdKind is 'condition' which is the default
|
|
2801
2814
|
if (twoWayCondition) {
|
|
2802
2815
|
request['ordType'] = 'oco';
|
|
2803
2816
|
}
|
|
@@ -2851,6 +2864,7 @@ class okx extends okx$1 {
|
|
|
2851
2864
|
* @param {string} [params.stopLoss.type] 'market' or 'limit' used to specify the stop loss price type
|
|
2852
2865
|
* @param {string} [params.positionSide] if position mode is one-way: set to 'net', if position mode is hedge-mode: set to 'long' or 'short'
|
|
2853
2866
|
* @param {string} [params.trailingPercent] the percent to trail away from the current market price
|
|
2867
|
+
* @param {string} [params.tpOrdKind] 'condition' or 'limit', the default is 'condition'
|
|
2854
2868
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2855
2869
|
*/
|
|
2856
2870
|
await this.loadMarkets();
|
|
@@ -3016,6 +3030,7 @@ class okx extends okx$1 {
|
|
|
3016
3030
|
takeProfitTriggerPrice = this.safeValue(takeProfit, 'triggerPrice');
|
|
3017
3031
|
takeProfitPrice = this.safeValue(takeProfit, 'price');
|
|
3018
3032
|
const takeProfitType = this.safeString(takeProfit, 'type');
|
|
3033
|
+
request['newTpOrdKind'] = (takeProfitType === 'limit') ? takeProfitType : 'condition';
|
|
3019
3034
|
request['newTpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
|
|
3020
3035
|
request['newTpOrdPx'] = (takeProfitType === 'market') ? '-1' : this.priceToPrecision(symbol, takeProfitPrice);
|
|
3021
3036
|
request['newTpTriggerPxType'] = takeProfitTriggerPriceType;
|
|
@@ -3061,6 +3076,7 @@ class okx extends okx$1 {
|
|
|
3061
3076
|
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
3062
3077
|
* @param {float} [params.takeProfit.price] used for take profit limit orders, not used for take profit market price orders
|
|
3063
3078
|
* @param {string} [params.takeProfit.type] 'market' or 'limit' used to specify the take profit price type
|
|
3079
|
+
* @param {string} [params.newTpOrdKind] 'condition' or 'limit', the default is 'condition'
|
|
3064
3080
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3065
3081
|
*/
|
|
3066
3082
|
await this.loadMarkets();
|
|
@@ -89,7 +89,10 @@ class bitget extends bitget$1 {
|
|
|
89
89
|
}
|
|
90
90
|
getInstType(market, params = {}) {
|
|
91
91
|
let instType = undefined;
|
|
92
|
-
if (
|
|
92
|
+
if (market === undefined) {
|
|
93
|
+
[instType, params] = this.handleProductTypeAndParams(undefined, params);
|
|
94
|
+
}
|
|
95
|
+
else if ((market['swap']) || (market['future'])) {
|
|
93
96
|
[instType, params] = this.handleProductTypeAndParams(market, params);
|
|
94
97
|
}
|
|
95
98
|
else {
|
|
@@ -666,9 +669,12 @@ class bitget extends bitget$1 {
|
|
|
666
669
|
stored = new Cache.ArrayCache(limit);
|
|
667
670
|
this.trades[symbol] = stored;
|
|
668
671
|
}
|
|
669
|
-
const data = this.
|
|
670
|
-
|
|
671
|
-
|
|
672
|
+
const data = this.safeList(message, 'data', []);
|
|
673
|
+
const length = data.length;
|
|
674
|
+
const maxLength = Math.max(length - 1, 0);
|
|
675
|
+
// fix chronological order by reversing
|
|
676
|
+
for (let i = maxLength; i >= 0; i--) {
|
|
677
|
+
const rawTrade = data[i];
|
|
672
678
|
const parsed = this.parseWsTrade(rawTrade, market);
|
|
673
679
|
stored.append(parsed);
|
|
674
680
|
}
|
|
@@ -685,22 +691,71 @@ class bitget extends bitget$1 {
|
|
|
685
691
|
// "tradeId": "1116461060594286593"
|
|
686
692
|
// }
|
|
687
693
|
//
|
|
688
|
-
|
|
689
|
-
|
|
694
|
+
// order with trade in it
|
|
695
|
+
// {
|
|
696
|
+
// accBaseVolume: '0.1',
|
|
697
|
+
// baseVolume: '0.1',
|
|
698
|
+
// cTime: '1709221342922',
|
|
699
|
+
// clientOid: '1147122943507734528',
|
|
700
|
+
// enterPointSource: 'API',
|
|
701
|
+
// feeDetail: [Array],
|
|
702
|
+
// fillFee: '-0.0049578',
|
|
703
|
+
// fillFeeCoin: 'USDT',
|
|
704
|
+
// fillNotionalUsd: '8.263',
|
|
705
|
+
// fillPrice: '82.63',
|
|
706
|
+
// fillTime: '1709221342986',
|
|
707
|
+
// force: 'gtc',
|
|
708
|
+
// instId: 'LTCUSDT',
|
|
709
|
+
// leverage: '10',
|
|
710
|
+
// marginCoin: 'USDT',
|
|
711
|
+
// marginMode: 'crossed',
|
|
712
|
+
// notionalUsd: '8.268',
|
|
713
|
+
// orderId: '1147122943499345921',
|
|
714
|
+
// orderType: 'market',
|
|
715
|
+
// pnl: '0',
|
|
716
|
+
// posMode: 'hedge_mode',
|
|
717
|
+
// posSide: 'short',
|
|
718
|
+
// price: '0',
|
|
719
|
+
// priceAvg: '82.63',
|
|
720
|
+
// reduceOnly: 'no',
|
|
721
|
+
// side: 'sell',
|
|
722
|
+
// size: '0.1',
|
|
723
|
+
// status: 'filled',
|
|
724
|
+
// tradeId: '1147122943772479563',
|
|
725
|
+
// tradeScope: 'T',
|
|
726
|
+
// tradeSide: 'open',
|
|
727
|
+
// uTime: '1709221342986'
|
|
728
|
+
// }
|
|
729
|
+
//
|
|
730
|
+
const instId = this.safeString(trade, 'instId');
|
|
731
|
+
if (market === undefined) {
|
|
732
|
+
market = this.safeMarket(instId, undefined, undefined, 'contract');
|
|
733
|
+
}
|
|
734
|
+
const timestamp = this.safeIntegerN(trade, ['uTime', 'cTime', 'ts']);
|
|
735
|
+
const feeCost = this.safeString(trade, 'fillFee');
|
|
736
|
+
let fee = undefined;
|
|
737
|
+
if (feeCost !== undefined) {
|
|
738
|
+
const feeCurrencyId = this.safeString(trade, 'fillFeeCoin');
|
|
739
|
+
const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId);
|
|
740
|
+
fee = {
|
|
741
|
+
'cost': Precise["default"].stringAbs(feeCost),
|
|
742
|
+
'currency': feeCurrencyCode,
|
|
743
|
+
};
|
|
744
|
+
}
|
|
690
745
|
return this.safeTrade({
|
|
691
746
|
'info': trade,
|
|
692
747
|
'id': this.safeString(trade, 'tradeId'),
|
|
693
|
-
'order':
|
|
748
|
+
'order': this.safeString(trade, 'orderId'),
|
|
694
749
|
'timestamp': timestamp,
|
|
695
750
|
'datetime': this.iso8601(timestamp),
|
|
696
751
|
'symbol': market['symbol'],
|
|
697
752
|
'type': undefined,
|
|
698
753
|
'side': this.safeString(trade, 'side'),
|
|
699
754
|
'takerOrMaker': undefined,
|
|
700
|
-
'price': this.
|
|
755
|
+
'price': this.safeString2(trade, 'priceAvg', 'price'),
|
|
701
756
|
'amount': this.safeString(trade, 'size'),
|
|
702
|
-
'cost':
|
|
703
|
-
'fee':
|
|
757
|
+
'cost': this.safeString(trade, 'fillNotionalUsd'),
|
|
758
|
+
'fee': fee,
|
|
704
759
|
}, market);
|
|
705
760
|
}
|
|
706
761
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1105,6 +1160,9 @@ class bitget extends bitget$1 {
|
|
|
1105
1160
|
const marketSymbols = {};
|
|
1106
1161
|
for (let i = 0; i < data.length; i++) {
|
|
1107
1162
|
const order = data[i];
|
|
1163
|
+
if ('tradeId' in order) {
|
|
1164
|
+
this.handleMyTrades(client, order);
|
|
1165
|
+
}
|
|
1108
1166
|
const marketId = this.safeString(order, 'instId');
|
|
1109
1167
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
1110
1168
|
const parsed = this.parseWsOrder(order, market);
|
|
@@ -1370,7 +1428,7 @@ class bitget extends bitget$1 {
|
|
|
1370
1428
|
this.myTrades = new Cache.ArrayCache(limit);
|
|
1371
1429
|
}
|
|
1372
1430
|
const stored = this.myTrades;
|
|
1373
|
-
const parsed = this.
|
|
1431
|
+
const parsed = this.parseWsTrade(message);
|
|
1374
1432
|
stored.append(parsed);
|
|
1375
1433
|
const symbol = parsed['symbol'];
|
|
1376
1434
|
const messageHash = 'myTrades';
|
|
@@ -1378,68 +1436,6 @@ class bitget extends bitget$1 {
|
|
|
1378
1436
|
const symbolSpecificMessageHash = 'myTrades:' + symbol;
|
|
1379
1437
|
client.resolve(stored, symbolSpecificMessageHash);
|
|
1380
1438
|
}
|
|
1381
|
-
parseWsMyTrade(trade, market = undefined) {
|
|
1382
|
-
//
|
|
1383
|
-
// order and trade mixin (contract)
|
|
1384
|
-
//
|
|
1385
|
-
// {
|
|
1386
|
-
// "accBaseVolume": "0",
|
|
1387
|
-
// "cTime": "1701920553759",
|
|
1388
|
-
// "clientOid": "1116501214318198793",
|
|
1389
|
-
// "enterPointSource": "WEB",
|
|
1390
|
-
// "feeDetail": [{
|
|
1391
|
-
// "feeCoin": "USDT",
|
|
1392
|
-
// "fee": "-0.162003"
|
|
1393
|
-
// }],
|
|
1394
|
-
// "force": "gtc",
|
|
1395
|
-
// "instId": "BTCUSDT",
|
|
1396
|
-
// "leverage": "20",
|
|
1397
|
-
// "marginCoin": "USDT",
|
|
1398
|
-
// "marginMode": "isolated",
|
|
1399
|
-
// "notionalUsd": "105",
|
|
1400
|
-
// "orderId": "1116501214293032964",
|
|
1401
|
-
// "orderType": "limit",
|
|
1402
|
-
// "posMode": "hedge_mode",
|
|
1403
|
-
// "posSide": "long",
|
|
1404
|
-
// "price": "35000",
|
|
1405
|
-
// "reduceOnly": "no",
|
|
1406
|
-
// "side": "buy",
|
|
1407
|
-
// "size": "0.003",
|
|
1408
|
-
// "status": "canceled",
|
|
1409
|
-
// "tradeSide": "open",
|
|
1410
|
-
// "uTime": "1701920595866"
|
|
1411
|
-
// }
|
|
1412
|
-
//
|
|
1413
|
-
const marketId = this.safeString(trade, 'instId');
|
|
1414
|
-
market = this.safeMarket(marketId, market, undefined, 'contract');
|
|
1415
|
-
const timestamp = this.safeInteger2(trade, 'uTime', 'cTime');
|
|
1416
|
-
const orderFee = this.safeValue(trade, 'feeDetail', []);
|
|
1417
|
-
const fee = this.safeValue(orderFee, 0);
|
|
1418
|
-
const feeAmount = this.safeString(fee, 'fee');
|
|
1419
|
-
let feeObject = undefined;
|
|
1420
|
-
if (feeAmount !== undefined) {
|
|
1421
|
-
const feeCurrency = this.safeString(fee, 'feeCoin');
|
|
1422
|
-
feeObject = {
|
|
1423
|
-
'cost': Precise["default"].stringAbs(feeAmount),
|
|
1424
|
-
'currency': this.safeCurrencyCode(feeCurrency),
|
|
1425
|
-
};
|
|
1426
|
-
}
|
|
1427
|
-
return this.safeTrade({
|
|
1428
|
-
'info': trade,
|
|
1429
|
-
'id': undefined,
|
|
1430
|
-
'order': this.safeString(trade, 'orderId'),
|
|
1431
|
-
'timestamp': timestamp,
|
|
1432
|
-
'datetime': this.iso8601(timestamp),
|
|
1433
|
-
'symbol': market['symbol'],
|
|
1434
|
-
'type': this.safeString(trade, 'orderType'),
|
|
1435
|
-
'side': this.safeString(trade, 'side'),
|
|
1436
|
-
'takerOrMaker': undefined,
|
|
1437
|
-
'price': this.safeString(trade, 'price'),
|
|
1438
|
-
'amount': this.safeString(trade, 'size'),
|
|
1439
|
-
'cost': this.safeString(trade, 'notionalUsd'),
|
|
1440
|
-
'fee': feeObject,
|
|
1441
|
-
}, market);
|
|
1442
|
-
}
|
|
1443
1439
|
async watchBalance(params = {}) {
|
|
1444
1440
|
/**
|
|
1445
1441
|
* @method
|
|
@@ -328,15 +328,29 @@ class bybit extends bybit$1 {
|
|
|
328
328
|
// "price24hPcnt": "-0.0388"
|
|
329
329
|
// }
|
|
330
330
|
// }
|
|
331
|
+
// swap delta
|
|
332
|
+
// {
|
|
333
|
+
// "topic":"tickers.AAVEUSDT",
|
|
334
|
+
// "type":"delta",
|
|
335
|
+
// "data":{
|
|
336
|
+
// "symbol":"AAVEUSDT",
|
|
337
|
+
// "bid1Price":"112.89",
|
|
338
|
+
// "bid1Size":"2.12",
|
|
339
|
+
// "ask1Price":"112.90",
|
|
340
|
+
// "ask1Size":"5.02"
|
|
341
|
+
// },
|
|
342
|
+
// "cs":78039939929,
|
|
343
|
+
// "ts":1709210212704
|
|
344
|
+
// }
|
|
331
345
|
//
|
|
332
346
|
const topic = this.safeString(message, 'topic', '');
|
|
333
347
|
const updateType = this.safeString(message, 'type', '');
|
|
334
|
-
const data = this.
|
|
335
|
-
const isSpot = this.safeString(data, '
|
|
348
|
+
const data = this.safeDict(message, 'data', {});
|
|
349
|
+
const isSpot = this.safeString(data, 'usdIndexPrice') !== undefined;
|
|
336
350
|
const type = isSpot ? 'spot' : 'contract';
|
|
337
351
|
let symbol = undefined;
|
|
338
352
|
let parsed = undefined;
|
|
339
|
-
if ((updateType === 'snapshot')
|
|
353
|
+
if ((updateType === 'snapshot')) {
|
|
340
354
|
parsed = this.parseTicker(data);
|
|
341
355
|
symbol = parsed['symbol'];
|
|
342
356
|
}
|
|
@@ -347,8 +361,8 @@ class bybit extends bybit$1 {
|
|
|
347
361
|
const market = this.safeMarket(marketId, undefined, undefined, type);
|
|
348
362
|
symbol = market['symbol'];
|
|
349
363
|
// update the info in place
|
|
350
|
-
const ticker = this.
|
|
351
|
-
const rawTicker = this.
|
|
364
|
+
const ticker = this.safeDict(this.tickers, symbol, {});
|
|
365
|
+
const rawTicker = this.safeDict(ticker, 'info', {});
|
|
352
366
|
const merged = this.extend(rawTicker, data);
|
|
353
367
|
parsed = this.parseTicker(merged);
|
|
354
368
|
}
|
|
@@ -90,7 +90,7 @@ class currencycom extends currencycom$1 {
|
|
|
90
90
|
// "accountId": 5470310874305732,
|
|
91
91
|
// "collateralCurrency": true,
|
|
92
92
|
// "asset": "USD",
|
|
93
|
-
// "free": 47.
|
|
93
|
+
// "free": 47.82576736,
|
|
94
94
|
// "locked": 1.187925,
|
|
95
95
|
// "default": true
|
|
96
96
|
// },
|
|
@@ -460,6 +460,7 @@ class currencycom extends currencycom$1 {
|
|
|
460
460
|
orderbook = this.orderBook();
|
|
461
461
|
}
|
|
462
462
|
orderbook.reset({
|
|
463
|
+
'symbol': symbol,
|
|
463
464
|
'timestamp': timestamp,
|
|
464
465
|
'datetime': this.iso8601(timestamp),
|
|
465
466
|
});
|
|
@@ -355,7 +355,7 @@ class kraken extends kraken$1 {
|
|
|
355
355
|
// [
|
|
356
356
|
// 0, // channelID
|
|
357
357
|
// [ // price volume time side type misc
|
|
358
|
-
// [ "5541.20000", "0.15850568", "1534614057.
|
|
358
|
+
// [ "5541.20000", "0.15850568", "1534614057.321596", "s", "l", "" ],
|
|
359
359
|
// [ "6060.00000", "0.02455000", "1534614057.324998", "b", "l", "" ],
|
|
360
360
|
// ],
|
|
361
361
|
// "trade",
|
package/dist/cjs/src/upbit.js
CHANGED
|
@@ -616,7 +616,7 @@ class upbit extends upbit$1 {
|
|
|
616
616
|
// "trade_time": "104543",
|
|
617
617
|
// "trade_date_kst": "20181122",
|
|
618
618
|
// "trade_time_kst": "194543",
|
|
619
|
-
// "trade_timestamp":
|
|
619
|
+
// "trade_timestamp": 1542883543096,
|
|
620
620
|
// "opening_price": 0.02976455,
|
|
621
621
|
// "high_price": 0.02992577,
|
|
622
622
|
// "low_price": 0.02934283,
|
package/dist/cjs/src/woo.js
CHANGED
|
@@ -97,6 +97,7 @@ class woo extends woo$1 {
|
|
|
97
97
|
'reduceMargin': false,
|
|
98
98
|
'setLeverage': true,
|
|
99
99
|
'setMargin': false,
|
|
100
|
+
'setPositionMode': true,
|
|
100
101
|
'transfer': true,
|
|
101
102
|
'withdraw': true, // exchange have that endpoint disabled atm, but was once implemented in ccxt per old docs: https://kronosresearch.github.io/wootrade-documents/#token-withdraw
|
|
102
103
|
},
|
|
@@ -171,10 +172,16 @@ class woo extends woo$1 {
|
|
|
171
172
|
'client/trade/{tid}': 1,
|
|
172
173
|
'order/{oid}/trades': 1,
|
|
173
174
|
'client/trades': 1,
|
|
175
|
+
'client/hist_trades': 1,
|
|
176
|
+
'staking/yield_history': 1,
|
|
177
|
+
'client/holding': 1,
|
|
174
178
|
'asset/deposit': 10,
|
|
175
179
|
'asset/history': 60,
|
|
176
180
|
'sub_account/all': 60,
|
|
177
181
|
'sub_account/assets': 60,
|
|
182
|
+
'sub_account/asset_detail': 60,
|
|
183
|
+
'sub_account/ip_restriction': 10,
|
|
184
|
+
'asset/main_sub_transfer_history': 30,
|
|
178
185
|
'token_interest': 60,
|
|
179
186
|
'token_interest/{token}': 60,
|
|
180
187
|
'interest/history': 60,
|
|
@@ -187,9 +194,12 @@ class woo extends woo$1 {
|
|
|
187
194
|
'post': {
|
|
188
195
|
'order': 5,
|
|
189
196
|
'asset/main_sub_transfer': 30,
|
|
197
|
+
'asset/ltv': 30,
|
|
190
198
|
'asset/withdraw': 30,
|
|
199
|
+
'asset/internal_withdraw': 30,
|
|
191
200
|
'interest/repay': 60,
|
|
192
201
|
'client/account_mode': 120,
|
|
202
|
+
'client/position_mode': 5,
|
|
193
203
|
'client/leverage': 120,
|
|
194
204
|
},
|
|
195
205
|
'delete': {
|
|
@@ -2611,6 +2621,37 @@ class woo extends woo$1 {
|
|
|
2611
2621
|
const sorted = this.sortBy(rates, 'timestamp');
|
|
2612
2622
|
return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
|
|
2613
2623
|
}
|
|
2624
|
+
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
2625
|
+
/**
|
|
2626
|
+
* @method
|
|
2627
|
+
* @name woo#setPositionMode
|
|
2628
|
+
* @description set hedged to true or false for a market
|
|
2629
|
+
* @see https://docs.woo.org/#update-position-mode
|
|
2630
|
+
* @param {bool} hedged set to true to use HEDGE_MODE, false for ONE_WAY
|
|
2631
|
+
* @param {string} symbol not used by woo setPositionMode
|
|
2632
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2633
|
+
* @returns {object} response from the exchange
|
|
2634
|
+
*/
|
|
2635
|
+
let hedgeMode = undefined;
|
|
2636
|
+
if (hedged) {
|
|
2637
|
+
hedgeMode = 'HEDGE_MODE';
|
|
2638
|
+
}
|
|
2639
|
+
else {
|
|
2640
|
+
hedgeMode = 'ONE_WAY';
|
|
2641
|
+
}
|
|
2642
|
+
const request = {
|
|
2643
|
+
'position_mode': hedgeMode,
|
|
2644
|
+
};
|
|
2645
|
+
const response = await this.v1PrivatePostClientPositionMode(this.extend(request, params));
|
|
2646
|
+
//
|
|
2647
|
+
// {
|
|
2648
|
+
// "success": true,
|
|
2649
|
+
// "data": {},
|
|
2650
|
+
// "timestamp": "1709195608551"
|
|
2651
|
+
// }
|
|
2652
|
+
//
|
|
2653
|
+
return response;
|
|
2654
|
+
}
|
|
2614
2655
|
async fetchLeverage(symbol, params = {}) {
|
|
2615
2656
|
await this.loadMarkets();
|
|
2616
2657
|
const response = await this.v3PrivateGetAccountinfo(params);
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.2.
|
|
7
|
+
declare const version = "4.2.55";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.2.
|
|
41
|
+
const version = '4.2.56';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -66,9 +66,12 @@ interface Exchange {
|
|
|
66
66
|
privateWalletGetSavedAddress(params?: {}): Promise<implicitReturnType>;
|
|
67
67
|
privateWalletGetFee(params?: {}): Promise<implicitReturnType>;
|
|
68
68
|
privateWalletGetTotalBalance(params?: {}): Promise<implicitReturnType>;
|
|
69
|
+
privateWalletGetSmallBalance(params?: {}): Promise<implicitReturnType>;
|
|
70
|
+
privateWalletGetSmallBalanceHistory(params?: {}): Promise<implicitReturnType>;
|
|
69
71
|
privateWalletPostTransfers(params?: {}): Promise<implicitReturnType>;
|
|
70
72
|
privateWalletPostSubAccountTransfers(params?: {}): Promise<implicitReturnType>;
|
|
71
73
|
privateWalletPostSubAccountToSubAccount(params?: {}): Promise<implicitReturnType>;
|
|
74
|
+
privateWalletPostSmallBalance(params?: {}): Promise<implicitReturnType>;
|
|
72
75
|
privateSubAccountsGetSubAccounts(params?: {}): Promise<implicitReturnType>;
|
|
73
76
|
privateSubAccountsGetSubAccountsUserId(params?: {}): Promise<implicitReturnType>;
|
|
74
77
|
privateSubAccountsGetSubAccountsUserIdKeys(params?: {}): Promise<implicitReturnType>;
|
|
@@ -79,15 +82,16 @@ interface Exchange {
|
|
|
79
82
|
privateSubAccountsPostSubAccountsUserIdUnlock(params?: {}): Promise<implicitReturnType>;
|
|
80
83
|
privateSubAccountsPutSubAccountsUserIdKeysKey(params?: {}): Promise<implicitReturnType>;
|
|
81
84
|
privateSubAccountsDeleteSubAccountsUserIdKeysKey(params?: {}): Promise<implicitReturnType>;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
privateUnifiedGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
86
|
+
privateUnifiedGetAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
87
|
+
privateUnifiedGetBorrowable(params?: {}): Promise<implicitReturnType>;
|
|
88
|
+
privateUnifiedGetTransferable(params?: {}): Promise<implicitReturnType>;
|
|
89
|
+
privateUnifiedGetLoans(params?: {}): Promise<implicitReturnType>;
|
|
90
|
+
privateUnifiedGetLoanRecords(params?: {}): Promise<implicitReturnType>;
|
|
91
|
+
privateUnifiedGetInterestRecords(params?: {}): Promise<implicitReturnType>;
|
|
92
|
+
privateUnifiedGetEstimateRate(params?: {}): Promise<implicitReturnType>;
|
|
93
|
+
privateUnifiedPostAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
94
|
+
privateUnifiedPostLoans(params?: {}): Promise<implicitReturnType>;
|
|
91
95
|
privateSpotGetFee(params?: {}): Promise<implicitReturnType>;
|
|
92
96
|
privateSpotGetBatchFee(params?: {}): Promise<implicitReturnType>;
|
|
93
97
|
privateSpotGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
@@ -66,9 +66,12 @@ interface gate {
|
|
|
66
66
|
privateWalletGetSavedAddress(params?: {}): Promise<implicitReturnType>;
|
|
67
67
|
privateWalletGetFee(params?: {}): Promise<implicitReturnType>;
|
|
68
68
|
privateWalletGetTotalBalance(params?: {}): Promise<implicitReturnType>;
|
|
69
|
+
privateWalletGetSmallBalance(params?: {}): Promise<implicitReturnType>;
|
|
70
|
+
privateWalletGetSmallBalanceHistory(params?: {}): Promise<implicitReturnType>;
|
|
69
71
|
privateWalletPostTransfers(params?: {}): Promise<implicitReturnType>;
|
|
70
72
|
privateWalletPostSubAccountTransfers(params?: {}): Promise<implicitReturnType>;
|
|
71
73
|
privateWalletPostSubAccountToSubAccount(params?: {}): Promise<implicitReturnType>;
|
|
74
|
+
privateWalletPostSmallBalance(params?: {}): Promise<implicitReturnType>;
|
|
72
75
|
privateSubAccountsGetSubAccounts(params?: {}): Promise<implicitReturnType>;
|
|
73
76
|
privateSubAccountsGetSubAccountsUserId(params?: {}): Promise<implicitReturnType>;
|
|
74
77
|
privateSubAccountsGetSubAccountsUserIdKeys(params?: {}): Promise<implicitReturnType>;
|
|
@@ -79,15 +82,16 @@ interface gate {
|
|
|
79
82
|
privateSubAccountsPostSubAccountsUserIdUnlock(params?: {}): Promise<implicitReturnType>;
|
|
80
83
|
privateSubAccountsPutSubAccountsUserIdKeysKey(params?: {}): Promise<implicitReturnType>;
|
|
81
84
|
privateSubAccountsDeleteSubAccountsUserIdKeysKey(params?: {}): Promise<implicitReturnType>;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
privateUnifiedGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
86
|
+
privateUnifiedGetAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
87
|
+
privateUnifiedGetBorrowable(params?: {}): Promise<implicitReturnType>;
|
|
88
|
+
privateUnifiedGetTransferable(params?: {}): Promise<implicitReturnType>;
|
|
89
|
+
privateUnifiedGetLoans(params?: {}): Promise<implicitReturnType>;
|
|
90
|
+
privateUnifiedGetLoanRecords(params?: {}): Promise<implicitReturnType>;
|
|
91
|
+
privateUnifiedGetInterestRecords(params?: {}): Promise<implicitReturnType>;
|
|
92
|
+
privateUnifiedGetEstimateRate(params?: {}): Promise<implicitReturnType>;
|
|
93
|
+
privateUnifiedPostAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
94
|
+
privateUnifiedPostLoans(params?: {}): Promise<implicitReturnType>;
|
|
91
95
|
privateSpotGetFee(params?: {}): Promise<implicitReturnType>;
|
|
92
96
|
privateSpotGetBatchFee(params?: {}): Promise<implicitReturnType>;
|
|
93
97
|
privateSpotGetAccounts(params?: {}): Promise<implicitReturnType>;
|
package/js/src/abstract/woo.d.ts
CHANGED
|
@@ -23,10 +23,16 @@ interface Exchange {
|
|
|
23
23
|
v1PrivateGetClientTradeTid(params?: {}): Promise<implicitReturnType>;
|
|
24
24
|
v1PrivateGetOrderOidTrades(params?: {}): Promise<implicitReturnType>;
|
|
25
25
|
v1PrivateGetClientTrades(params?: {}): Promise<implicitReturnType>;
|
|
26
|
+
v1PrivateGetClientHistTrades(params?: {}): Promise<implicitReturnType>;
|
|
27
|
+
v1PrivateGetStakingYieldHistory(params?: {}): Promise<implicitReturnType>;
|
|
28
|
+
v1PrivateGetClientHolding(params?: {}): Promise<implicitReturnType>;
|
|
26
29
|
v1PrivateGetAssetDeposit(params?: {}): Promise<implicitReturnType>;
|
|
27
30
|
v1PrivateGetAssetHistory(params?: {}): Promise<implicitReturnType>;
|
|
28
31
|
v1PrivateGetSubAccountAll(params?: {}): Promise<implicitReturnType>;
|
|
29
32
|
v1PrivateGetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
33
|
+
v1PrivateGetSubAccountAssetDetail(params?: {}): Promise<implicitReturnType>;
|
|
34
|
+
v1PrivateGetSubAccountIpRestriction(params?: {}): Promise<implicitReturnType>;
|
|
35
|
+
v1PrivateGetAssetMainSubTransferHistory(params?: {}): Promise<implicitReturnType>;
|
|
30
36
|
v1PrivateGetTokenInterest(params?: {}): Promise<implicitReturnType>;
|
|
31
37
|
v1PrivateGetTokenInterestToken(params?: {}): Promise<implicitReturnType>;
|
|
32
38
|
v1PrivateGetInterestHistory(params?: {}): Promise<implicitReturnType>;
|
|
@@ -37,9 +43,12 @@ interface Exchange {
|
|
|
37
43
|
v1PrivateGetClientTransactionHistory(params?: {}): Promise<implicitReturnType>;
|
|
38
44
|
v1PrivatePostOrder(params?: {}): Promise<implicitReturnType>;
|
|
39
45
|
v1PrivatePostAssetMainSubTransfer(params?: {}): Promise<implicitReturnType>;
|
|
46
|
+
v1PrivatePostAssetLtv(params?: {}): Promise<implicitReturnType>;
|
|
40
47
|
v1PrivatePostAssetWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
48
|
+
v1PrivatePostAssetInternalWithdraw(params?: {}): Promise<implicitReturnType>;
|
|
41
49
|
v1PrivatePostInterestRepay(params?: {}): Promise<implicitReturnType>;
|
|
42
50
|
v1PrivatePostClientAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
51
|
+
v1PrivatePostClientPositionMode(params?: {}): Promise<implicitReturnType>;
|
|
43
52
|
v1PrivatePostClientLeverage(params?: {}): Promise<implicitReturnType>;
|
|
44
53
|
v1PrivateDeleteOrder(params?: {}): Promise<implicitReturnType>;
|
|
45
54
|
v1PrivateDeleteClientOrder(params?: {}): Promise<implicitReturnType>;
|