ccxt 4.4.42 → 4.4.44
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 +35 -33
- package/dist/ccxt.browser.min.js +15 -15
- package/dist/cjs/ccxt.js +6 -1
- package/dist/cjs/src/binance.js +55 -43
- package/dist/cjs/src/bingx.js +37 -12
- package/dist/cjs/src/bitfinex.js +6 -2
- package/dist/cjs/src/bitget.js +3 -1
- package/dist/cjs/src/bitmart.js +4 -7
- package/dist/cjs/src/bitmex.js +3 -5
- package/dist/cjs/src/bitstamp.js +59 -0
- package/dist/cjs/src/bybit.js +7 -22
- package/dist/cjs/src/coinbase.js +13 -9
- package/dist/cjs/src/coinbaseinternational.js +13 -9
- package/dist/cjs/src/coincatch.js +2 -2
- package/dist/cjs/src/coinex.js +5 -5
- package/dist/cjs/src/cryptocom.js +3 -1
- package/dist/cjs/src/defx.js +2 -2
- package/dist/cjs/src/delta.js +1 -1
- package/dist/cjs/src/gate.js +7 -2
- package/dist/cjs/src/gemini.js +65 -2
- package/dist/cjs/src/hashkey.js +9 -9
- package/dist/cjs/src/htx.js +105 -2
- package/dist/cjs/src/hyperliquid.js +6 -1
- package/dist/cjs/src/kraken.js +9 -2
- package/dist/cjs/src/krakenfutures.js +5 -0
- package/dist/cjs/src/kucoin.js +9 -7
- package/dist/cjs/src/kucoinfutures.js +5 -5
- package/dist/cjs/src/mexc.js +16 -10
- package/dist/cjs/src/myokx.js +35 -0
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/oceanex.js +1 -1
- package/dist/cjs/src/okx.js +4 -5
- package/dist/cjs/src/phemex.js +7 -5
- package/dist/cjs/src/pro/bitcoincom.js +4 -1
- package/dist/cjs/src/pro/bitopro.js +1 -1
- package/dist/cjs/src/pro/myokx.js +24 -0
- package/dist/cjs/src/vertex.js +69 -4
- package/dist/cjs/src/whitebit.js +4 -2
- package/dist/cjs/src/woo.js +8 -6
- package/dist/cjs/src/woofipro.js +5 -2
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/bingx.d.ts +4 -0
- package/js/src/abstract/bitstamp.d.ts +1 -0
- package/js/src/abstract/myokx.d.ts +343 -0
- package/js/src/abstract/myokx.js +11 -0
- package/js/src/binance.d.ts +33 -32
- package/js/src/binance.js +55 -43
- package/js/src/bingx.js +37 -12
- package/js/src/bitfinex.js +6 -2
- package/js/src/bitget.js +3 -1
- package/js/src/bitmart.js +4 -7
- package/js/src/bitmex.js +3 -5
- package/js/src/bitstamp.js +59 -0
- package/js/src/bybit.js +7 -22
- package/js/src/coinbase.js +13 -9
- package/js/src/coinbaseinternational.js +13 -9
- package/js/src/coincatch.js +2 -2
- package/js/src/coinex.js +5 -5
- package/js/src/cryptocom.js +3 -1
- package/js/src/defx.js +2 -2
- package/js/src/delta.js +1 -1
- package/js/src/gate.js +7 -2
- package/js/src/gemini.js +65 -2
- package/js/src/hashkey.js +9 -9
- package/js/src/htx.d.ts +13 -1
- package/js/src/htx.js +105 -2
- package/js/src/hyperliquid.js +6 -1
- package/js/src/kraken.js +9 -2
- package/js/src/krakenfutures.js +5 -0
- package/js/src/kucoin.js +9 -7
- package/js/src/kucoinfutures.js +5 -5
- package/js/src/mexc.js +16 -10
- package/js/src/myokx.d.ts +4 -0
- package/js/src/myokx.js +36 -0
- package/js/src/ndax.js +1 -1
- package/js/src/oceanex.js +1 -1
- package/js/src/okx.js +4 -5
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +7 -5
- package/js/src/pro/bitcoincom.js +4 -1
- package/js/src/pro/bitopro.js +1 -1
- package/js/src/pro/myokx.d.ts +4 -0
- package/js/src/pro/myokx.js +25 -0
- package/js/src/vertex.d.ts +11 -1
- package/js/src/vertex.js +69 -4
- package/js/src/whitebit.js +4 -2
- package/js/src/woo.js +8 -6
- package/js/src/woofipro.js +5 -2
- package/package.json +15 -8
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -1107,12 +1107,12 @@ class bybit extends bybit$1 {
|
|
|
1107
1107
|
'GTD': false,
|
|
1108
1108
|
},
|
|
1109
1109
|
'hedged': true,
|
|
1110
|
-
// exchange-supported features
|
|
1111
1110
|
'selfTradePrevention': true,
|
|
1112
1111
|
'trailing': true,
|
|
1113
|
-
'twap': false,
|
|
1114
1112
|
'iceberg': false,
|
|
1115
|
-
'
|
|
1113
|
+
'leverage': false,
|
|
1114
|
+
'marketBuyRequiresPrice': false,
|
|
1115
|
+
'marketBuyByCost': true,
|
|
1116
1116
|
},
|
|
1117
1117
|
'createOrders': {
|
|
1118
1118
|
'max': 10,
|
|
@@ -1151,29 +1151,13 @@ class bybit extends bybit$1 {
|
|
|
1151
1151
|
'spot': {
|
|
1152
1152
|
'extends': 'default',
|
|
1153
1153
|
'createOrder': {
|
|
1154
|
-
'marginMode': false,
|
|
1155
|
-
'triggerPrice': true,
|
|
1156
1154
|
'triggerPriceType': undefined,
|
|
1157
1155
|
'triggerDirection': false,
|
|
1158
|
-
'stopLossPrice': true,
|
|
1159
|
-
'takeProfitPrice': true,
|
|
1160
1156
|
'attachedStopLossTakeProfit': {
|
|
1161
1157
|
'triggerPriceType': undefined,
|
|
1162
1158
|
'limitPrice': true,
|
|
1163
1159
|
},
|
|
1164
|
-
'
|
|
1165
|
-
'IOC': true,
|
|
1166
|
-
'FOK': true,
|
|
1167
|
-
'PO': true,
|
|
1168
|
-
'GTD': false,
|
|
1169
|
-
},
|
|
1170
|
-
'hedged': true,
|
|
1171
|
-
// exchange-supported features
|
|
1172
|
-
'selfTradePrevention': true,
|
|
1173
|
-
'trailing': true,
|
|
1174
|
-
'twap': false,
|
|
1175
|
-
'iceberg': false,
|
|
1176
|
-
'oco': false,
|
|
1160
|
+
'marketBuyRequiresPrice': true,
|
|
1177
1161
|
},
|
|
1178
1162
|
},
|
|
1179
1163
|
'swap': {
|
|
@@ -2098,6 +2082,7 @@ class bybit extends bybit$1 {
|
|
|
2098
2082
|
'quoteId': quoteId,
|
|
2099
2083
|
'settleId': settleId,
|
|
2100
2084
|
'type': 'option',
|
|
2085
|
+
'subType': 'linear',
|
|
2101
2086
|
'spot': false,
|
|
2102
2087
|
'margin': false,
|
|
2103
2088
|
'swap': false,
|
|
@@ -2105,8 +2090,8 @@ class bybit extends bybit$1 {
|
|
|
2105
2090
|
'option': true,
|
|
2106
2091
|
'active': isActive,
|
|
2107
2092
|
'contract': true,
|
|
2108
|
-
'linear':
|
|
2109
|
-
'inverse':
|
|
2093
|
+
'linear': true,
|
|
2094
|
+
'inverse': false,
|
|
2110
2095
|
'taker': this.safeNumber(market, 'takerFee', this.parseNumber('0.0006')),
|
|
2111
2096
|
'maker': this.safeNumber(market, 'makerFee', this.parseNumber('0.0001')),
|
|
2112
2097
|
'contractSize': this.parseNumber('1'),
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -375,7 +375,7 @@ class coinbase extends coinbase$1 {
|
|
|
375
375
|
'user_native_currency': 'USD', // needed to get fees for v3
|
|
376
376
|
},
|
|
377
377
|
'features': {
|
|
378
|
-
'
|
|
378
|
+
'default': {
|
|
379
379
|
'sandbox': false,
|
|
380
380
|
'createOrder': {
|
|
381
381
|
'marginMode': true,
|
|
@@ -393,6 +393,11 @@ class coinbase extends coinbase$1 {
|
|
|
393
393
|
},
|
|
394
394
|
'hedged': false,
|
|
395
395
|
'trailing': false,
|
|
396
|
+
'leverage': true,
|
|
397
|
+
'marketBuyByCost': true,
|
|
398
|
+
'marketBuyRequiresPrice': true,
|
|
399
|
+
'selfTradePrevention': false,
|
|
400
|
+
'iceberg': false,
|
|
396
401
|
},
|
|
397
402
|
'createOrders': undefined,
|
|
398
403
|
'fetchMyTrades': {
|
|
@@ -433,21 +438,20 @@ class coinbase extends coinbase$1 {
|
|
|
433
438
|
'limit': 350,
|
|
434
439
|
},
|
|
435
440
|
},
|
|
441
|
+
'spot': {
|
|
442
|
+
'extends': 'default',
|
|
443
|
+
},
|
|
436
444
|
'swap': {
|
|
437
445
|
'linear': {
|
|
438
|
-
'extends': '
|
|
439
|
-
},
|
|
440
|
-
'inverse': {
|
|
441
|
-
'extends': 'spot',
|
|
446
|
+
'extends': 'default',
|
|
442
447
|
},
|
|
448
|
+
'inverse': undefined,
|
|
443
449
|
},
|
|
444
450
|
'future': {
|
|
445
451
|
'linear': {
|
|
446
|
-
'extends': '
|
|
447
|
-
},
|
|
448
|
-
'inverse': {
|
|
449
|
-
'extends': 'spot',
|
|
452
|
+
'extends': 'default',
|
|
450
453
|
},
|
|
454
|
+
'inverse': undefined,
|
|
451
455
|
},
|
|
452
456
|
},
|
|
453
457
|
});
|
|
@@ -256,7 +256,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
256
256
|
},
|
|
257
257
|
},
|
|
258
258
|
'features': {
|
|
259
|
-
'
|
|
259
|
+
'default': {
|
|
260
260
|
'sandbox': true,
|
|
261
261
|
'createOrder': {
|
|
262
262
|
'marginMode': false,
|
|
@@ -275,6 +275,11 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
275
275
|
},
|
|
276
276
|
'hedged': false,
|
|
277
277
|
'trailing': false,
|
|
278
|
+
'leverage': false,
|
|
279
|
+
'marketBuyByCost': false,
|
|
280
|
+
'marketBuyRequiresPrice': true,
|
|
281
|
+
'selfTradePrevention': true,
|
|
282
|
+
'iceberg': false,
|
|
278
283
|
},
|
|
279
284
|
'createOrders': undefined,
|
|
280
285
|
'fetchMyTrades': {
|
|
@@ -300,21 +305,20 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
300
305
|
'limit': 300,
|
|
301
306
|
},
|
|
302
307
|
},
|
|
308
|
+
'spot': {
|
|
309
|
+
'extends': 'default',
|
|
310
|
+
},
|
|
303
311
|
'swap': {
|
|
304
312
|
'linear': {
|
|
305
|
-
'extends': '
|
|
313
|
+
'extends': 'default',
|
|
306
314
|
},
|
|
307
315
|
'inverse': {
|
|
308
|
-
'extends': '
|
|
316
|
+
'extends': 'default',
|
|
309
317
|
},
|
|
310
318
|
},
|
|
311
319
|
'future': {
|
|
312
|
-
'linear':
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
'inverse': {
|
|
316
|
-
'extends': 'spot',
|
|
317
|
-
},
|
|
320
|
+
'linear': undefined,
|
|
321
|
+
'inverse': undefined,
|
|
318
322
|
},
|
|
319
323
|
},
|
|
320
324
|
});
|
|
@@ -840,8 +840,8 @@ class coincatch extends coincatch$1 {
|
|
|
840
840
|
settleId = this.safeString(supportMarginCoins, 0);
|
|
841
841
|
settle = this.safeCurrencyCode(settleId);
|
|
842
842
|
suffix = ':' + settle;
|
|
843
|
-
isLinear =
|
|
844
|
-
isInverse =
|
|
843
|
+
isLinear = quoteId === settleId; // todo check
|
|
844
|
+
isInverse = baseId === settleId; // todo check
|
|
845
845
|
if (isLinear) {
|
|
846
846
|
subType = 'linear';
|
|
847
847
|
}
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -519,11 +519,11 @@ class coinex extends coinex$1 {
|
|
|
519
519
|
},
|
|
520
520
|
'hedged': false,
|
|
521
521
|
'trailing': false,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
522
|
+
'leverage': false,
|
|
523
|
+
'marketBuyByCost': true,
|
|
524
|
+
'marketBuyRequiresPrice': true,
|
|
525
|
+
'selfTradePrevention': true,
|
|
526
|
+
'iceberg': true, // todo implement
|
|
527
527
|
},
|
|
528
528
|
'createOrders': {
|
|
529
529
|
'max': 5,
|
|
@@ -371,10 +371,12 @@ class cryptocom extends cryptocom$1 {
|
|
|
371
371
|
'GTD': false,
|
|
372
372
|
},
|
|
373
373
|
'hedged': false,
|
|
374
|
-
// exchange-supported features
|
|
375
374
|
'selfTradePrevention': true,
|
|
376
375
|
'trailing': false,
|
|
377
376
|
'iceberg': false,
|
|
377
|
+
'leverage': false,
|
|
378
|
+
'marketBuyByCost': true,
|
|
379
|
+
'marketBuyRequiresPrice': true,
|
|
378
380
|
},
|
|
379
381
|
'createOrders': {
|
|
380
382
|
'max': 10,
|
package/dist/cjs/src/defx.js
CHANGED
|
@@ -934,10 +934,10 @@ class defx extends defx$1 {
|
|
|
934
934
|
const id = this.safeString(trade, 'id');
|
|
935
935
|
const oid = this.safeString(trade, 'orderId');
|
|
936
936
|
const takerOrMaker = this.safeStringLower(trade, 'role');
|
|
937
|
-
const buyerMaker = this.
|
|
937
|
+
const buyerMaker = this.safeBool(trade, 'buyerMaker');
|
|
938
938
|
let side = this.safeStringLower(trade, 'side');
|
|
939
939
|
if (buyerMaker !== undefined) {
|
|
940
|
-
if (buyerMaker
|
|
940
|
+
if (buyerMaker) {
|
|
941
941
|
side = 'sell';
|
|
942
942
|
}
|
|
943
943
|
else {
|
package/dist/cjs/src/delta.js
CHANGED
|
@@ -739,7 +739,7 @@ class delta extends delta$1 {
|
|
|
739
739
|
// other markets (swap, futures, move, spread, irs) seem to use the step of '1' contract
|
|
740
740
|
amountPrecision = this.parseNumber('1');
|
|
741
741
|
}
|
|
742
|
-
const linear = (settle ===
|
|
742
|
+
const linear = (settle === quote);
|
|
743
743
|
let optionType = undefined;
|
|
744
744
|
let symbol = base + '/' + quote;
|
|
745
745
|
if (swap || future || option) {
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -705,7 +705,7 @@ class gate extends gate$1 {
|
|
|
705
705
|
},
|
|
706
706
|
},
|
|
707
707
|
'features': {
|
|
708
|
-
'
|
|
708
|
+
'default': {
|
|
709
709
|
'sandbox': true,
|
|
710
710
|
'createOrder': {
|
|
711
711
|
'marginMode': true,
|
|
@@ -724,9 +724,11 @@ class gate extends gate$1 {
|
|
|
724
724
|
},
|
|
725
725
|
'hedged': false,
|
|
726
726
|
'trailing': false,
|
|
727
|
-
// exchange-specific features
|
|
728
727
|
'iceberg': true,
|
|
729
728
|
'selfTradePrevention': true,
|
|
729
|
+
'leverage': false,
|
|
730
|
+
'marketBuyByCost': true,
|
|
731
|
+
'marketBuyRequiresPrice': true,
|
|
730
732
|
},
|
|
731
733
|
'createOrders': {
|
|
732
734
|
'max': 40, // NOTE! max 10 per symbol
|
|
@@ -762,6 +764,9 @@ class gate extends gate$1 {
|
|
|
762
764
|
'limit': 1000,
|
|
763
765
|
},
|
|
764
766
|
},
|
|
767
|
+
'spot': {
|
|
768
|
+
'extends': 'default',
|
|
769
|
+
},
|
|
765
770
|
'forDerivatives': {
|
|
766
771
|
'extends': 'spot',
|
|
767
772
|
'createOrder': {
|
package/dist/cjs/src/gemini.js
CHANGED
|
@@ -296,6 +296,69 @@ class gemini extends gemini$1 {
|
|
|
296
296
|
},
|
|
297
297
|
},
|
|
298
298
|
},
|
|
299
|
+
'features': {
|
|
300
|
+
'default': {
|
|
301
|
+
'sandbox': true,
|
|
302
|
+
'createOrder': {
|
|
303
|
+
'marginMode': false,
|
|
304
|
+
'triggerPrice': true,
|
|
305
|
+
'triggerPriceType': undefined,
|
|
306
|
+
'triggerDirection': false,
|
|
307
|
+
'stopLossPrice': false,
|
|
308
|
+
'takeProfitPrice': false,
|
|
309
|
+
'attachedStopLossTakeProfit': undefined,
|
|
310
|
+
'timeInForce': {
|
|
311
|
+
'IOC': true,
|
|
312
|
+
'FOK': true,
|
|
313
|
+
'PO': true,
|
|
314
|
+
'GTD': false,
|
|
315
|
+
},
|
|
316
|
+
'hedged': false,
|
|
317
|
+
'trailing': false,
|
|
318
|
+
'leverage': false,
|
|
319
|
+
'marketBuyByCost': true,
|
|
320
|
+
'marketBuyRequiresPrice': false,
|
|
321
|
+
'selfTradePrevention': false,
|
|
322
|
+
'iceberg': false,
|
|
323
|
+
},
|
|
324
|
+
'createOrders': undefined,
|
|
325
|
+
'fetchMyTrades': {
|
|
326
|
+
'marginMode': false,
|
|
327
|
+
'limit': 500,
|
|
328
|
+
'daysBack': undefined,
|
|
329
|
+
'untilDays': undefined,
|
|
330
|
+
},
|
|
331
|
+
'fetchOrder': {
|
|
332
|
+
'marginMode': false,
|
|
333
|
+
'trigger': false,
|
|
334
|
+
'trailing': false,
|
|
335
|
+
},
|
|
336
|
+
'fetchOpenOrders': {
|
|
337
|
+
'marginMode': false,
|
|
338
|
+
'limit': undefined,
|
|
339
|
+
'trigger': false,
|
|
340
|
+
'trailing': false,
|
|
341
|
+
},
|
|
342
|
+
'fetchOrders': undefined,
|
|
343
|
+
'fetchClosedOrders': undefined,
|
|
344
|
+
'fetchOHLCV': {
|
|
345
|
+
'limit': undefined,
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
'spot': {
|
|
349
|
+
'extends': 'default',
|
|
350
|
+
},
|
|
351
|
+
'swap': {
|
|
352
|
+
'linear': {
|
|
353
|
+
'extends': 'default',
|
|
354
|
+
},
|
|
355
|
+
'inverse': undefined,
|
|
356
|
+
},
|
|
357
|
+
'future': {
|
|
358
|
+
'linear': undefined,
|
|
359
|
+
'inverse': undefined,
|
|
360
|
+
},
|
|
361
|
+
},
|
|
299
362
|
});
|
|
300
363
|
}
|
|
301
364
|
/**
|
|
@@ -1477,8 +1540,8 @@ class gemini extends gemini$1 {
|
|
|
1477
1540
|
};
|
|
1478
1541
|
type = this.safeString(params, 'type', type);
|
|
1479
1542
|
params = this.omit(params, 'type');
|
|
1480
|
-
const triggerPrice = this.safeStringN(params, ['stop_price', 'stopPrice']);
|
|
1481
|
-
params = this.omit(params, ['stop_price', 'stopPrice', 'type']);
|
|
1543
|
+
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stop_price', 'stopPrice']);
|
|
1544
|
+
params = this.omit(params, ['triggerPrice', 'stop_price', 'stopPrice', 'type']);
|
|
1482
1545
|
if (type === 'stopLimit') {
|
|
1483
1546
|
throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice parameter or a stop_price parameter for ' + type + ' orders');
|
|
1484
1547
|
}
|
package/dist/cjs/src/hashkey.js
CHANGED
|
@@ -355,13 +355,11 @@ class hashkey extends hashkey$1 {
|
|
|
355
355
|
},
|
|
356
356
|
'hedged': false,
|
|
357
357
|
'trailing': false,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
// 'iceberg': false,
|
|
364
|
-
// 'oco': false,
|
|
358
|
+
'leverage': false,
|
|
359
|
+
'marketBuyByCost': true,
|
|
360
|
+
'marketBuyRequiresPrice': true,
|
|
361
|
+
'selfTradePrevention': true,
|
|
362
|
+
'iceberg': false,
|
|
365
363
|
},
|
|
366
364
|
'createOrders': {
|
|
367
365
|
'max': 20,
|
|
@@ -2437,8 +2435,10 @@ class hashkey extends hashkey$1 {
|
|
|
2437
2435
|
if (!market['spot']) {
|
|
2438
2436
|
throw new errors.NotSupported(this.id + ' createMarketBuyOrderWithCost() is supported for spot markets only');
|
|
2439
2437
|
}
|
|
2440
|
-
|
|
2441
|
-
|
|
2438
|
+
const req = {
|
|
2439
|
+
'cost': cost,
|
|
2440
|
+
};
|
|
2441
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, this.extend(req, params));
|
|
2442
2442
|
}
|
|
2443
2443
|
/**
|
|
2444
2444
|
* @method
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -96,6 +96,7 @@ class htx extends htx$1 {
|
|
|
96
96
|
'fetchOHLCV': true,
|
|
97
97
|
'fetchOpenInterest': true,
|
|
98
98
|
'fetchOpenInterestHistory': true,
|
|
99
|
+
'fetchOpenInterests': true,
|
|
99
100
|
'fetchOpenOrder': undefined,
|
|
100
101
|
'fetchOpenOrders': true,
|
|
101
102
|
'fetchOrder': true,
|
|
@@ -1251,9 +1252,11 @@ class htx extends htx$1 {
|
|
|
1251
1252
|
},
|
|
1252
1253
|
'hedged': false,
|
|
1253
1254
|
'trailing': false,
|
|
1254
|
-
// exchange-specific features
|
|
1255
1255
|
'iceberg': false,
|
|
1256
1256
|
'selfTradePrevention': true,
|
|
1257
|
+
'leverage': true,
|
|
1258
|
+
'marketBuyByCost': true,
|
|
1259
|
+
'marketBuyRequiresPrice': true,
|
|
1257
1260
|
},
|
|
1258
1261
|
'createOrders': {
|
|
1259
1262
|
'max': 10,
|
|
@@ -8640,6 +8643,105 @@ class htx extends htx$1 {
|
|
|
8640
8643
|
const tick = this.safeList(data, 'tick');
|
|
8641
8644
|
return this.parseOpenInterestsHistory(tick, market, since, limit);
|
|
8642
8645
|
}
|
|
8646
|
+
/**
|
|
8647
|
+
* @method
|
|
8648
|
+
* @name htx#fetchOpenInterests
|
|
8649
|
+
* @description Retrieves the open interest for a list of symbols
|
|
8650
|
+
* @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
|
|
8651
|
+
* @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
|
|
8652
|
+
* @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
|
|
8653
|
+
* @param {string[]} [symbols] a list of unified CCXT market symbols
|
|
8654
|
+
* @param {object} [params] exchange specific parameters
|
|
8655
|
+
* @returns {object[]} a list of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
8656
|
+
*/
|
|
8657
|
+
async fetchOpenInterests(symbols = undefined, params = {}) {
|
|
8658
|
+
await this.loadMarkets();
|
|
8659
|
+
symbols = this.marketSymbols(symbols);
|
|
8660
|
+
let market = undefined;
|
|
8661
|
+
if (symbols !== undefined) {
|
|
8662
|
+
const symbolsLength = symbols.length;
|
|
8663
|
+
if (symbolsLength > 0) {
|
|
8664
|
+
const first = this.safeString(symbols, 0);
|
|
8665
|
+
market = this.market(first);
|
|
8666
|
+
}
|
|
8667
|
+
}
|
|
8668
|
+
const request = {};
|
|
8669
|
+
let subType = undefined;
|
|
8670
|
+
[subType, params] = this.handleSubTypeAndParams('fetchPositions', market, params, 'linear');
|
|
8671
|
+
let marketType = undefined;
|
|
8672
|
+
[marketType, params] = this.handleMarketTypeAndParams('fetchPositions', market, params);
|
|
8673
|
+
let response = undefined;
|
|
8674
|
+
if (marketType === 'future') {
|
|
8675
|
+
response = await this.contractPublicGetApiV1ContractOpenInterest(this.extend(request, params));
|
|
8676
|
+
//
|
|
8677
|
+
// {
|
|
8678
|
+
// "status": "ok",
|
|
8679
|
+
// "data": [
|
|
8680
|
+
// {
|
|
8681
|
+
// "volume": 118850.000000000000000000,
|
|
8682
|
+
// "amount": 635.502025211544374189,
|
|
8683
|
+
// "symbol": "BTC",
|
|
8684
|
+
// "contract_type": "this_week",
|
|
8685
|
+
// "contract_code": "BTC220930",
|
|
8686
|
+
// "trade_amount": 1470.9400749347598691119206024033947897351,
|
|
8687
|
+
// "trade_volume": 286286,
|
|
8688
|
+
// "trade_turnover": 28628600.000000000000000000
|
|
8689
|
+
// }
|
|
8690
|
+
// ],
|
|
8691
|
+
// "ts": 1664337928805
|
|
8692
|
+
// }
|
|
8693
|
+
//
|
|
8694
|
+
}
|
|
8695
|
+
else if (subType === 'inverse') {
|
|
8696
|
+
response = await this.contractPublicGetSwapApiV1SwapOpenInterest(this.extend(request, params));
|
|
8697
|
+
//
|
|
8698
|
+
// {
|
|
8699
|
+
// "status": "ok",
|
|
8700
|
+
// "data": [
|
|
8701
|
+
// {
|
|
8702
|
+
// "volume": 518018.000000000000000000,
|
|
8703
|
+
// "amount": 2769.675777407074725180,
|
|
8704
|
+
// "symbol": "BTC",
|
|
8705
|
+
// "contract_code": "BTC-USD",
|
|
8706
|
+
// "trade_amount": 9544.4032080046491323463688602729806842458,
|
|
8707
|
+
// "trade_volume": 1848448,
|
|
8708
|
+
// "trade_turnover": 184844800.000000000000000000
|
|
8709
|
+
// }
|
|
8710
|
+
// ],
|
|
8711
|
+
// "ts": 1664337226028
|
|
8712
|
+
// }
|
|
8713
|
+
//
|
|
8714
|
+
}
|
|
8715
|
+
else {
|
|
8716
|
+
request['contract_type'] = 'swap';
|
|
8717
|
+
response = await this.contractPublicGetLinearSwapApiV1SwapOpenInterest(this.extend(request, params));
|
|
8718
|
+
//
|
|
8719
|
+
// {
|
|
8720
|
+
// "status": "ok",
|
|
8721
|
+
// "data": [
|
|
8722
|
+
// {
|
|
8723
|
+
// "volume": 7192610.000000000000000000,
|
|
8724
|
+
// "amount": 7192.610000000000000000,
|
|
8725
|
+
// "symbol": "BTC",
|
|
8726
|
+
// "value": 134654290.332000000000000000,
|
|
8727
|
+
// "contract_code": "BTC-USDT",
|
|
8728
|
+
// "trade_amount": 70692.804,
|
|
8729
|
+
// "trade_volume": 70692804,
|
|
8730
|
+
// "trade_turnover": 1379302592.9518,
|
|
8731
|
+
// "business_type": "swap",
|
|
8732
|
+
// "pair": "BTC-USDT",
|
|
8733
|
+
// "contract_type": "swap",
|
|
8734
|
+
// "trade_partition": "USDT"
|
|
8735
|
+
// }
|
|
8736
|
+
// ],
|
|
8737
|
+
// "ts": 1664336503144
|
|
8738
|
+
// }
|
|
8739
|
+
//
|
|
8740
|
+
}
|
|
8741
|
+
const data = this.safeList(response, 'data', []);
|
|
8742
|
+
const result = this.parseOpenInterests(data);
|
|
8743
|
+
return this.filterByArray(result, 'symbol', symbols);
|
|
8744
|
+
}
|
|
8643
8745
|
/**
|
|
8644
8746
|
* @method
|
|
8645
8747
|
* @name htx#fetchOpenInterest
|
|
@@ -8803,8 +8905,9 @@ class htx extends htx$1 {
|
|
|
8803
8905
|
const timestamp = this.safeInteger(interest, 'ts');
|
|
8804
8906
|
const amount = this.safeNumber(interest, 'volume');
|
|
8805
8907
|
const value = this.safeNumber(interest, 'value');
|
|
8908
|
+
const marketId = this.safeString(interest, 'contract_code');
|
|
8806
8909
|
return this.safeOpenInterest({
|
|
8807
|
-
'symbol': this.
|
|
8910
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
8808
8911
|
'baseVolume': amount,
|
|
8809
8912
|
'quoteVolume': value,
|
|
8810
8913
|
'openInterestAmount': amount,
|
|
@@ -22,7 +22,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
22
22
|
'countries': [],
|
|
23
23
|
'version': 'v1',
|
|
24
24
|
'rateLimit': 50,
|
|
25
|
-
'certified':
|
|
25
|
+
'certified': true,
|
|
26
26
|
'pro': true,
|
|
27
27
|
'dex': true,
|
|
28
28
|
'has': {
|
|
@@ -235,6 +235,11 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
235
235
|
},
|
|
236
236
|
'hedged': false,
|
|
237
237
|
'trailing': false,
|
|
238
|
+
'leverage': false,
|
|
239
|
+
'marketBuyByCost': false,
|
|
240
|
+
'marketBuyRequiresPrice': false,
|
|
241
|
+
'selfTradePrevention': false,
|
|
242
|
+
'iceberg': false,
|
|
238
243
|
},
|
|
239
244
|
'createOrders': {
|
|
240
245
|
'max': 1000,
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -446,6 +446,11 @@ class kraken extends kraken$1 {
|
|
|
446
446
|
},
|
|
447
447
|
'hedged': false,
|
|
448
448
|
'trailing': true,
|
|
449
|
+
'leverage': false,
|
|
450
|
+
'marketBuyByCost': true,
|
|
451
|
+
'marketBuyRequiresPrice': false,
|
|
452
|
+
'selfTradePrevention': true,
|
|
453
|
+
'iceberg': true, // todo implement
|
|
449
454
|
},
|
|
450
455
|
'createOrders': undefined,
|
|
451
456
|
'fetchMyTrades': {
|
|
@@ -1508,8 +1513,10 @@ class kraken extends kraken$1 {
|
|
|
1508
1513
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
1509
1514
|
await this.loadMarkets();
|
|
1510
1515
|
// only buy orders are supported by the endpoint
|
|
1511
|
-
|
|
1512
|
-
|
|
1516
|
+
const req = {
|
|
1517
|
+
'cost': cost,
|
|
1518
|
+
};
|
|
1519
|
+
return await this.createOrder(symbol, 'market', side, 1, undefined, this.extend(req, params));
|
|
1513
1520
|
}
|
|
1514
1521
|
/**
|
|
1515
1522
|
* @method
|
|
@@ -284,6 +284,11 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
284
284
|
},
|
|
285
285
|
'hedged': false,
|
|
286
286
|
'trailing': false,
|
|
287
|
+
'leverage': false,
|
|
288
|
+
'marketBuyByCost': false,
|
|
289
|
+
'marketBuyRequiresPrice': false,
|
|
290
|
+
'selfTradePrevention': false,
|
|
291
|
+
'iceberg': false,
|
|
287
292
|
},
|
|
288
293
|
'createOrders': {
|
|
289
294
|
'max': 100,
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -1006,11 +1006,11 @@ class kucoin extends kucoin$1 {
|
|
|
1006
1006
|
},
|
|
1007
1007
|
'hedged': false,
|
|
1008
1008
|
'trailing': false,
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1009
|
+
'leverage': false,
|
|
1010
|
+
'marketBuyByCost': true,
|
|
1011
|
+
'marketBuyRequiresPrice': false,
|
|
1012
|
+
'selfTradePrevention': true,
|
|
1013
|
+
'iceberg': true, // todo implement
|
|
1014
1014
|
},
|
|
1015
1015
|
'createOrders': {
|
|
1016
1016
|
'max': 5,
|
|
@@ -2315,8 +2315,10 @@ class kucoin extends kucoin$1 {
|
|
|
2315
2315
|
*/
|
|
2316
2316
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
2317
2317
|
await this.loadMarkets();
|
|
2318
|
-
|
|
2319
|
-
|
|
2318
|
+
const req = {
|
|
2319
|
+
'cost': cost,
|
|
2320
|
+
};
|
|
2321
|
+
return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
|
|
2320
2322
|
}
|
|
2321
2323
|
/**
|
|
2322
2324
|
* @method
|
|
@@ -385,11 +385,11 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
385
385
|
},
|
|
386
386
|
'hedged': false,
|
|
387
387
|
'trailing': false,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
388
|
+
'leverage': true,
|
|
389
|
+
'marketBuyByCost': true,
|
|
390
|
+
'marketBuyRequiresPrice': false,
|
|
391
|
+
'selfTradePrevention': true,
|
|
392
|
+
'iceberg': true,
|
|
393
393
|
},
|
|
394
394
|
'createOrders': {
|
|
395
395
|
'max': 20,
|