ccxt 4.4.41 → 4.4.42
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 +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -1
- package/dist/cjs/src/alpaca.js +0 -1
- package/dist/cjs/src/ascendex.js +0 -1
- package/dist/cjs/src/base/Exchange.js +21 -16
- package/dist/cjs/src/bigone.js +0 -1
- package/dist/cjs/src/binance.js +3 -0
- package/dist/cjs/src/bingx.js +3 -0
- package/dist/cjs/src/bitfinex.js +123 -0
- package/dist/cjs/src/blofin.js +16 -7
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +8 -9
- package/dist/cjs/src/coinbaseexchange.js +5 -6
- package/dist/cjs/src/coinbaseinternational.js +7 -8
- package/dist/cjs/src/coincatch.js +0 -1
- package/dist/cjs/src/coincheck.js +0 -1
- package/dist/cjs/src/coinex.js +91 -6
- package/dist/cjs/src/coinlist.js +3 -4
- package/dist/cjs/src/coinmate.js +1 -3
- package/dist/cjs/src/coinmetro.js +4 -5
- package/dist/cjs/src/coinone.js +0 -1
- package/dist/cjs/src/coinsph.js +7 -8
- package/dist/cjs/src/cryptocom.js +3 -0
- package/dist/cjs/src/currencycom.js +3 -4
- package/dist/cjs/src/defx.js +6 -7
- package/dist/cjs/src/deribit.js +1 -3
- package/dist/cjs/src/digifinex.js +0 -1
- package/dist/cjs/src/ellipx.js +0 -2
- package/dist/cjs/src/exmo.js +1 -2
- package/dist/cjs/src/gate.js +1 -2
- package/dist/cjs/src/gemini.js +4 -5
- package/dist/cjs/src/hashkey.js +79 -83
- package/dist/cjs/src/hitbtc.js +49 -5
- package/dist/cjs/src/hollaex.js +4 -6
- package/dist/cjs/src/htx.js +1 -3
- package/dist/cjs/src/huobijp.js +0 -1
- package/dist/cjs/src/idex.js +8 -8
- package/dist/cjs/src/independentreserve.js +0 -1
- package/dist/cjs/src/indodax.js +0 -1
- package/dist/cjs/src/kraken.js +63 -3
- package/dist/cjs/src/krakenfutures.js +75 -3
- package/dist/cjs/src/kucoin.js +1 -3
- package/dist/cjs/src/kucoinfutures.js +10 -9
- package/dist/cjs/src/kuna.js +1 -3
- package/dist/cjs/src/latoken.js +1 -3
- package/dist/cjs/src/lbank.js +0 -1
- package/dist/cjs/src/luno.js +0 -1
- package/dist/cjs/src/lykke.js +0 -1
- package/dist/cjs/src/mercado.js +0 -1
- package/dist/cjs/src/mexc.js +3 -4
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/novadax.js +4 -6
- package/dist/cjs/src/oceanex.js +0 -1
- package/dist/cjs/src/okcoin.js +1 -3
- package/dist/cjs/src/okx.js +1 -3
- package/dist/cjs/src/onetrading.js +1 -3
- package/dist/cjs/src/p2b.js +1 -1
- package/dist/cjs/src/paradex.js +5 -7
- package/dist/cjs/src/phemex.js +8 -10
- package/dist/cjs/src/poloniex.js +1 -3
- package/dist/cjs/src/poloniexfutures.js +6 -6
- package/dist/cjs/src/probit.js +0 -1
- package/dist/cjs/src/timex.js +0 -1
- package/dist/cjs/src/tokocrypto.js +11 -14
- package/dist/cjs/src/tradeogre.js +1 -1
- package/dist/cjs/src/upbit.js +0 -1
- package/dist/cjs/src/wavesexchange.js +4 -5
- package/dist/cjs/src/whitebit.js +8 -9
- package/dist/cjs/src/woo.js +99 -13
- package/dist/cjs/src/woofipro.js +96 -15
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +0 -1
- package/dist/cjs/src/zaif.js +0 -1
- package/dist/cjs/src/zonda.js +1 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +3 -0
- package/js/src/abstract/binancecoinm.d.ts +3 -0
- package/js/src/abstract/binanceus.d.ts +3 -0
- package/js/src/abstract/binanceusdm.d.ts +3 -0
- package/js/src/ace.js +1 -1
- package/js/src/alpaca.js +0 -1
- package/js/src/ascendex.js +0 -1
- package/js/src/base/Exchange.d.ts +6 -6
- package/js/src/base/Exchange.js +21 -16
- package/js/src/bigone.js +0 -1
- package/js/src/binance.js +3 -0
- package/js/src/bingx.js +3 -0
- package/js/src/bitfinex.d.ts +11 -1
- package/js/src/bitfinex.js +123 -0
- package/js/src/blofin.d.ts +1 -1
- package/js/src/blofin.js +16 -7
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.js +8 -9
- package/js/src/coinbaseexchange.js +5 -6
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +7 -8
- package/js/src/coincatch.js +0 -1
- package/js/src/coincheck.js +0 -1
- package/js/src/coinex.js +91 -6
- package/js/src/coinlist.js +3 -4
- package/js/src/coinmate.js +1 -3
- package/js/src/coinmetro.js +4 -5
- package/js/src/coinone.js +0 -1
- package/js/src/coinsph.js +7 -8
- package/js/src/cryptocom.js +3 -0
- package/js/src/currencycom.js +3 -4
- package/js/src/defx.js +6 -7
- package/js/src/deribit.js +1 -3
- package/js/src/digifinex.js +0 -1
- package/js/src/ellipx.js +0 -2
- package/js/src/exmo.d.ts +1 -1
- package/js/src/exmo.js +1 -2
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +1 -2
- package/js/src/gemini.js +4 -5
- package/js/src/hashkey.js +79 -83
- package/js/src/hitbtc.d.ts +11 -1
- package/js/src/hitbtc.js +49 -5
- package/js/src/hollaex.js +4 -6
- package/js/src/htx.js +1 -3
- package/js/src/huobijp.js +0 -1
- package/js/src/idex.js +8 -8
- package/js/src/independentreserve.js +0 -1
- package/js/src/indodax.js +0 -1
- package/js/src/kraken.d.ts +2 -2
- package/js/src/kraken.js +63 -3
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/krakenfutures.js +75 -3
- package/js/src/kucoin.js +1 -3
- package/js/src/kucoinfutures.d.ts +5 -4
- package/js/src/kucoinfutures.js +10 -9
- package/js/src/kuna.js +1 -3
- package/js/src/latoken.js +1 -3
- package/js/src/lbank.js +0 -1
- package/js/src/luno.js +0 -1
- package/js/src/lykke.js +0 -1
- package/js/src/mercado.js +0 -1
- package/js/src/mexc.js +3 -4
- package/js/src/ndax.js +1 -1
- package/js/src/novadax.js +4 -6
- package/js/src/oceanex.js +0 -1
- package/js/src/okcoin.js +1 -3
- package/js/src/okx.js +1 -3
- package/js/src/onetrading.js +1 -3
- package/js/src/p2b.js +1 -1
- package/js/src/paradex.d.ts +1 -1
- package/js/src/paradex.js +5 -7
- package/js/src/phemex.js +8 -10
- package/js/src/poloniex.js +1 -3
- package/js/src/poloniexfutures.js +6 -6
- package/js/src/probit.js +0 -1
- package/js/src/timex.js +0 -1
- package/js/src/tokocrypto.js +11 -14
- package/js/src/tradeogre.js +1 -1
- package/js/src/upbit.js +0 -1
- package/js/src/wavesexchange.d.ts +1 -1
- package/js/src/wavesexchange.js +4 -5
- package/js/src/whitebit.js +8 -9
- package/js/src/woo.d.ts +1 -1
- package/js/src/woo.js +99 -13
- package/js/src/woofipro.js +96 -15
- package/js/src/xt.d.ts +2 -1
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +0 -1
- package/js/src/zaif.js +0 -1
- package/js/src/zonda.js +1 -2
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -200,7 +200,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
200
200
|
|
|
201
201
|
//-----------------------------------------------------------------------------
|
|
202
202
|
// this is updated by vss.js when building
|
|
203
|
-
const version = '4.4.
|
|
203
|
+
const version = '4.4.42';
|
|
204
204
|
Exchange["default"].ccxtVersion = version;
|
|
205
205
|
const exchanges = {
|
|
206
206
|
'ace': ace,
|
package/dist/cjs/src/ace.js
CHANGED
package/dist/cjs/src/alpaca.js
CHANGED
|
@@ -1211,7 +1211,6 @@ class alpaca extends alpaca$1 {
|
|
|
1211
1211
|
'postOnly': undefined,
|
|
1212
1212
|
'side': this.safeString(order, 'side'),
|
|
1213
1213
|
'price': this.safeNumber(order, 'limit_price'),
|
|
1214
|
-
'stopPrice': this.safeNumber(order, 'stop_price'),
|
|
1215
1214
|
'triggerPrice': this.safeNumber(order, 'stop_price'),
|
|
1216
1215
|
'cost': undefined,
|
|
1217
1216
|
'average': this.safeNumber(order, 'filled_avg_price'),
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -4466,10 +4466,15 @@ class Exchange {
|
|
|
4466
4466
|
}
|
|
4467
4467
|
handleOptionAndParams2(params, methodName1, optionName1, optionName2, defaultValue = undefined) {
|
|
4468
4468
|
let value = undefined;
|
|
4469
|
-
[value, params] = this.handleOptionAndParams(params, methodName1, optionName1
|
|
4469
|
+
[value, params] = this.handleOptionAndParams(params, methodName1, optionName1);
|
|
4470
|
+
if (value !== undefined) {
|
|
4471
|
+
// omit optionName2 too from params
|
|
4472
|
+
params = this.omit(params, optionName2);
|
|
4473
|
+
return [value, params];
|
|
4474
|
+
}
|
|
4470
4475
|
// if still undefined, try optionName2
|
|
4471
4476
|
let value2 = undefined;
|
|
4472
|
-
[value2, params] = this.handleOptionAndParams(params, methodName1, optionName2,
|
|
4477
|
+
[value2, params] = this.handleOptionAndParams(params, methodName1, optionName2, defaultValue);
|
|
4473
4478
|
return [value2, params];
|
|
4474
4479
|
}
|
|
4475
4480
|
handleOption(methodName, optionName, defaultValue = undefined) {
|
|
@@ -5524,52 +5529,52 @@ class Exchange {
|
|
|
5524
5529
|
const query = this.extend(params, { 'reduceOnly': true });
|
|
5525
5530
|
return await this.createOrderWs(symbol, type, side, amount, price, query);
|
|
5526
5531
|
}
|
|
5527
|
-
async createStopOrder(symbol, type, side, amount, price = undefined,
|
|
5532
|
+
async createStopOrder(symbol, type, side, amount, price = undefined, triggerPrice = undefined, params = {}) {
|
|
5528
5533
|
if (!this.has['createStopOrder']) {
|
|
5529
5534
|
throw new errors.NotSupported(this.id + ' createStopOrder() is not supported yet');
|
|
5530
5535
|
}
|
|
5531
|
-
if (
|
|
5536
|
+
if (triggerPrice === undefined) {
|
|
5532
5537
|
throw new errors.ArgumentsRequired(this.id + ' create_stop_order() requires a stopPrice argument');
|
|
5533
5538
|
}
|
|
5534
|
-
const query = this.extend(params, { 'stopPrice':
|
|
5539
|
+
const query = this.extend(params, { 'stopPrice': triggerPrice });
|
|
5535
5540
|
return await this.createOrder(symbol, type, side, amount, price, query);
|
|
5536
5541
|
}
|
|
5537
|
-
async createStopOrderWs(symbol, type, side, amount, price = undefined,
|
|
5542
|
+
async createStopOrderWs(symbol, type, side, amount, price = undefined, triggerPrice = undefined, params = {}) {
|
|
5538
5543
|
if (!this.has['createStopOrderWs']) {
|
|
5539
5544
|
throw new errors.NotSupported(this.id + ' createStopOrderWs() is not supported yet');
|
|
5540
5545
|
}
|
|
5541
|
-
if (
|
|
5546
|
+
if (triggerPrice === undefined) {
|
|
5542
5547
|
throw new errors.ArgumentsRequired(this.id + ' createStopOrderWs() requires a stopPrice argument');
|
|
5543
5548
|
}
|
|
5544
|
-
const query = this.extend(params, { 'stopPrice':
|
|
5549
|
+
const query = this.extend(params, { 'stopPrice': triggerPrice });
|
|
5545
5550
|
return await this.createOrderWs(symbol, type, side, amount, price, query);
|
|
5546
5551
|
}
|
|
5547
|
-
async createStopLimitOrder(symbol, side, amount, price,
|
|
5552
|
+
async createStopLimitOrder(symbol, side, amount, price, triggerPrice, params = {}) {
|
|
5548
5553
|
if (!this.has['createStopLimitOrder']) {
|
|
5549
5554
|
throw new errors.NotSupported(this.id + ' createStopLimitOrder() is not supported yet');
|
|
5550
5555
|
}
|
|
5551
|
-
const query = this.extend(params, { 'stopPrice':
|
|
5556
|
+
const query = this.extend(params, { 'stopPrice': triggerPrice });
|
|
5552
5557
|
return await this.createOrder(symbol, 'limit', side, amount, price, query);
|
|
5553
5558
|
}
|
|
5554
|
-
async createStopLimitOrderWs(symbol, side, amount, price,
|
|
5559
|
+
async createStopLimitOrderWs(symbol, side, amount, price, triggerPrice, params = {}) {
|
|
5555
5560
|
if (!this.has['createStopLimitOrderWs']) {
|
|
5556
5561
|
throw new errors.NotSupported(this.id + ' createStopLimitOrderWs() is not supported yet');
|
|
5557
5562
|
}
|
|
5558
|
-
const query = this.extend(params, { 'stopPrice':
|
|
5563
|
+
const query = this.extend(params, { 'stopPrice': triggerPrice });
|
|
5559
5564
|
return await this.createOrderWs(symbol, 'limit', side, amount, price, query);
|
|
5560
5565
|
}
|
|
5561
|
-
async createStopMarketOrder(symbol, side, amount,
|
|
5566
|
+
async createStopMarketOrder(symbol, side, amount, triggerPrice, params = {}) {
|
|
5562
5567
|
if (!this.has['createStopMarketOrder']) {
|
|
5563
5568
|
throw new errors.NotSupported(this.id + ' createStopMarketOrder() is not supported yet');
|
|
5564
5569
|
}
|
|
5565
|
-
const query = this.extend(params, { 'stopPrice':
|
|
5570
|
+
const query = this.extend(params, { 'stopPrice': triggerPrice });
|
|
5566
5571
|
return await this.createOrder(symbol, 'market', side, amount, undefined, query);
|
|
5567
5572
|
}
|
|
5568
|
-
async createStopMarketOrderWs(symbol, side, amount,
|
|
5573
|
+
async createStopMarketOrderWs(symbol, side, amount, triggerPrice, params = {}) {
|
|
5569
5574
|
if (!this.has['createStopMarketOrderWs']) {
|
|
5570
5575
|
throw new errors.NotSupported(this.id + ' createStopMarketOrderWs() is not supported yet');
|
|
5571
5576
|
}
|
|
5572
|
-
const query = this.extend(params, { 'stopPrice':
|
|
5577
|
+
const query = this.extend(params, { 'stopPrice': triggerPrice });
|
|
5573
5578
|
return await this.createOrderWs(symbol, 'market', side, amount, undefined, query);
|
|
5574
5579
|
}
|
|
5575
5580
|
safeCurrencyCode(currencyId, currency = undefined) {
|
package/dist/cjs/src/bigone.js
CHANGED
package/dist/cjs/src/binance.js
CHANGED
|
@@ -634,6 +634,8 @@ class binance extends binance$1 {
|
|
|
634
634
|
'portfolio/bnb-transfer': 150,
|
|
635
635
|
'portfolio/repay-futures-switch': 150,
|
|
636
636
|
'portfolio/repay-futures-negative-balance': 150,
|
|
637
|
+
'portfolio/mint': 20,
|
|
638
|
+
'portfolio/redeem': 20,
|
|
637
639
|
'lending/auto-invest/plan/add': 0.1,
|
|
638
640
|
'lending/auto-invest/plan/edit': 0.1,
|
|
639
641
|
'lending/auto-invest/plan/edit-status': 0.1,
|
|
@@ -962,6 +964,7 @@ class binance extends binance$1 {
|
|
|
962
964
|
'block/order/orders': 5,
|
|
963
965
|
'block/order/execute': 5,
|
|
964
966
|
'block/user-trades': 5,
|
|
967
|
+
'blockTrades': 5,
|
|
965
968
|
},
|
|
966
969
|
'post': {
|
|
967
970
|
'order': 1,
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -5598,6 +5598,9 @@ class bingx extends bingx$1 {
|
|
|
5598
5598
|
request['endTs'] = now;
|
|
5599
5599
|
}
|
|
5600
5600
|
if (market['spot']) {
|
|
5601
|
+
if (limit !== undefined) {
|
|
5602
|
+
request['limit'] = limit; // default 500, maximum 1000
|
|
5603
|
+
}
|
|
5601
5604
|
response = await this.spotV1PrivateGetTradeMyTrades(this.extend(request, params));
|
|
5602
5605
|
const data = this.safeDict(response, 'data', {});
|
|
5603
5606
|
fills = this.safeList(data, 'fills', []);
|
package/dist/cjs/src/bitfinex.js
CHANGED
|
@@ -82,6 +82,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
82
82
|
'fetchOHLCV': true,
|
|
83
83
|
'fetchOpenInterest': true,
|
|
84
84
|
'fetchOpenInterestHistory': true,
|
|
85
|
+
'fetchOpenInterests': true,
|
|
85
86
|
'fetchOpenOrder': true,
|
|
86
87
|
'fetchOpenOrders': true,
|
|
87
88
|
'fetchOrder': true,
|
|
@@ -401,6 +402,75 @@ class bitfinex extends bitfinex$1 {
|
|
|
401
402
|
'TETHERUSE': 'ERC20',
|
|
402
403
|
},
|
|
403
404
|
},
|
|
405
|
+
'features': {
|
|
406
|
+
'default': {
|
|
407
|
+
'sandbox': false,
|
|
408
|
+
'createOrder': {
|
|
409
|
+
'marginMode': true,
|
|
410
|
+
'triggerPrice': true,
|
|
411
|
+
'triggerPriceType': undefined,
|
|
412
|
+
'triggerDirection': false,
|
|
413
|
+
'stopLossPrice': true,
|
|
414
|
+
'takeProfitPrice': true,
|
|
415
|
+
'attachedStopLossTakeProfit': undefined,
|
|
416
|
+
'timeInForce': {
|
|
417
|
+
'IOC': true,
|
|
418
|
+
'FOK': true,
|
|
419
|
+
'PO': true,
|
|
420
|
+
'GTD': false,
|
|
421
|
+
},
|
|
422
|
+
'hedged': false,
|
|
423
|
+
'trailing': true, // todo: unify
|
|
424
|
+
// todo: leverage unify
|
|
425
|
+
},
|
|
426
|
+
'createOrders': {
|
|
427
|
+
'max': 75,
|
|
428
|
+
},
|
|
429
|
+
'fetchMyTrades': {
|
|
430
|
+
'marginMode': false,
|
|
431
|
+
'limit': 2500,
|
|
432
|
+
'daysBack': undefined,
|
|
433
|
+
'untilDays': 100000, // todo: implement
|
|
434
|
+
},
|
|
435
|
+
'fetchOrder': {
|
|
436
|
+
'marginMode': false,
|
|
437
|
+
'trigger': false,
|
|
438
|
+
'trailing': false,
|
|
439
|
+
},
|
|
440
|
+
'fetchOpenOrders': {
|
|
441
|
+
'marginMode': false,
|
|
442
|
+
'limit': undefined,
|
|
443
|
+
'trigger': false,
|
|
444
|
+
'trailing': false,
|
|
445
|
+
},
|
|
446
|
+
'fetchOrders': undefined,
|
|
447
|
+
'fetchClosedOrders': {
|
|
448
|
+
'marginMode': false,
|
|
449
|
+
'limit': undefined,
|
|
450
|
+
'daysBackClosed': undefined,
|
|
451
|
+
'daysBackCanceled': undefined,
|
|
452
|
+
'untilDays': 100000,
|
|
453
|
+
'trigger': false,
|
|
454
|
+
'trailing': false,
|
|
455
|
+
},
|
|
456
|
+
'fetchOHLCV': {
|
|
457
|
+
'limit': 10000,
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
'spot': {
|
|
461
|
+
'extends': 'default',
|
|
462
|
+
},
|
|
463
|
+
'swap': {
|
|
464
|
+
'linear': {
|
|
465
|
+
'extends': 'default',
|
|
466
|
+
},
|
|
467
|
+
'inverse': undefined,
|
|
468
|
+
},
|
|
469
|
+
'future': {
|
|
470
|
+
'linear': undefined,
|
|
471
|
+
'inverse': undefined,
|
|
472
|
+
},
|
|
473
|
+
},
|
|
404
474
|
'exceptions': {
|
|
405
475
|
'exact': {
|
|
406
476
|
'11010': errors.RateLimitExceeded,
|
|
@@ -3245,6 +3315,59 @@ class bitfinex extends bitfinex$1 {
|
|
|
3245
3315
|
'previousFundingDatetime': undefined,
|
|
3246
3316
|
};
|
|
3247
3317
|
}
|
|
3318
|
+
/**
|
|
3319
|
+
* @method
|
|
3320
|
+
* @name bitfinex#fetchOpenInterests
|
|
3321
|
+
* @description Retrieves the open interest for a list of symbols
|
|
3322
|
+
* @see https://docs.bitfinex.com/reference/rest-public-derivatives-status
|
|
3323
|
+
* @param {string[]} [symbols] a list of unified CCXT market symbols
|
|
3324
|
+
* @param {object} [params] exchange specific parameters
|
|
3325
|
+
* @returns {object[]} a list of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
3326
|
+
*/
|
|
3327
|
+
async fetchOpenInterests(symbols = undefined, params = {}) {
|
|
3328
|
+
await this.loadMarkets();
|
|
3329
|
+
symbols = this.marketSymbols(symbols);
|
|
3330
|
+
let marketIds = ['ALL'];
|
|
3331
|
+
if (symbols !== undefined) {
|
|
3332
|
+
marketIds = this.marketIds(symbols);
|
|
3333
|
+
}
|
|
3334
|
+
const request = {
|
|
3335
|
+
'keys': marketIds.join(','),
|
|
3336
|
+
};
|
|
3337
|
+
const response = await this.publicGetStatusDeriv(this.extend(request, params));
|
|
3338
|
+
//
|
|
3339
|
+
// [
|
|
3340
|
+
// [
|
|
3341
|
+
// "tXRPF0:USTF0", // market id
|
|
3342
|
+
// 1706256986000, // millisecond timestamp
|
|
3343
|
+
// null,
|
|
3344
|
+
// 0.512705, // derivative mid price
|
|
3345
|
+
// 0.512395, // underlying spot mid price
|
|
3346
|
+
// null,
|
|
3347
|
+
// 37671483.04, // insurance fund balance
|
|
3348
|
+
// null,
|
|
3349
|
+
// 1706284800000, // timestamp of next funding
|
|
3350
|
+
// 0.00002353, // accrued funding for next period
|
|
3351
|
+
// 317, // next funding step
|
|
3352
|
+
// null,
|
|
3353
|
+
// 0, // current funding
|
|
3354
|
+
// null,
|
|
3355
|
+
// null,
|
|
3356
|
+
// 0.5123016, // mark price
|
|
3357
|
+
// null,
|
|
3358
|
+
// null,
|
|
3359
|
+
// 2233562.03115, // open interest in contracts
|
|
3360
|
+
// null,
|
|
3361
|
+
// null,
|
|
3362
|
+
// null,
|
|
3363
|
+
// 0.0005, // average spread without funding payment
|
|
3364
|
+
// 0.0025 // funding payment cap
|
|
3365
|
+
// ]
|
|
3366
|
+
// ]
|
|
3367
|
+
//
|
|
3368
|
+
const result = this.parseOpenInterests(response);
|
|
3369
|
+
return this.filterByArray(result, 'symbol', symbols);
|
|
3370
|
+
}
|
|
3248
3371
|
/**
|
|
3249
3372
|
* @method
|
|
3250
3373
|
* @name bitfinex#fetchOpenInterest
|
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -158,7 +158,7 @@ class blofin extends blofin$1 {
|
|
|
158
158
|
'rest': 'https://openapi.blofin.com',
|
|
159
159
|
},
|
|
160
160
|
'referral': {
|
|
161
|
-
'url': 'https://blofin.com/register?referral_code=
|
|
161
|
+
'url': 'https://blofin.com/register?referral_code=f79EsS',
|
|
162
162
|
'discount': 0.05,
|
|
163
163
|
},
|
|
164
164
|
'www': 'https://www.blofin.com',
|
|
@@ -278,10 +278,18 @@ class blofin extends blofin$1 {
|
|
|
278
278
|
'brokerId': 'ec6dd3a7dd982d0b',
|
|
279
279
|
'accountsByType': {
|
|
280
280
|
'swap': 'futures',
|
|
281
|
+
'funding': 'funding',
|
|
281
282
|
'future': 'futures',
|
|
283
|
+
'copy_trading': 'copy_trading',
|
|
284
|
+
'earn': 'earn',
|
|
285
|
+
'spot': 'spot',
|
|
282
286
|
},
|
|
283
287
|
'accountsById': {
|
|
288
|
+
'funding': 'funding',
|
|
284
289
|
'futures': 'swap',
|
|
290
|
+
'copy_trading': 'copy_trading',
|
|
291
|
+
'earn': 'earn',
|
|
292
|
+
'spot': 'spot',
|
|
285
293
|
},
|
|
286
294
|
'sandboxMode': false,
|
|
287
295
|
'defaultNetwork': 'ERC20',
|
|
@@ -879,8 +887,9 @@ class blofin extends blofin$1 {
|
|
|
879
887
|
const entry = this.safeDict(data, 0, {});
|
|
880
888
|
return this.parseFundingRate(entry, market);
|
|
881
889
|
}
|
|
882
|
-
parseBalanceByType(
|
|
883
|
-
|
|
890
|
+
parseBalanceByType(response) {
|
|
891
|
+
const data = this.safeList(response, 'data');
|
|
892
|
+
if ((data !== undefined) && Array.isArray(data)) {
|
|
884
893
|
return this.parseFundingBalance(response);
|
|
885
894
|
}
|
|
886
895
|
else {
|
|
@@ -998,11 +1007,11 @@ class blofin extends blofin$1 {
|
|
|
998
1007
|
*/
|
|
999
1008
|
async fetchBalance(params = {}) {
|
|
1000
1009
|
await this.loadMarkets();
|
|
1001
|
-
|
|
1002
|
-
params = this.
|
|
1010
|
+
let accountType = undefined;
|
|
1011
|
+
[accountType, params] = this.handleOptionAndParams2(params, 'fetchBalance', 'accountType', 'type');
|
|
1003
1012
|
const request = {};
|
|
1004
1013
|
let response = undefined;
|
|
1005
|
-
if (accountType !== undefined) {
|
|
1014
|
+
if (accountType !== undefined && accountType !== 'swap') {
|
|
1006
1015
|
const options = this.safeDict(this.options, 'accountsByType', {});
|
|
1007
1016
|
const parsedAccountType = this.safeString(options, accountType, accountType);
|
|
1008
1017
|
request['accountType'] = parsedAccountType;
|
|
@@ -1011,7 +1020,7 @@ class blofin extends blofin$1 {
|
|
|
1011
1020
|
else {
|
|
1012
1021
|
response = await this.privateGetAccountBalance(this.extend(request, params));
|
|
1013
1022
|
}
|
|
1014
|
-
return this.parseBalanceByType(
|
|
1023
|
+
return this.parseBalanceByType(response);
|
|
1015
1024
|
}
|
|
1016
1025
|
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1017
1026
|
const market = this.market(symbol);
|
package/dist/cjs/src/cex.js
CHANGED
|
@@ -1087,7 +1087,7 @@ class cex extends cex$1 {
|
|
|
1087
1087
|
'postOnly': undefined,
|
|
1088
1088
|
'side': this.safeStringLower(order, 'side'),
|
|
1089
1089
|
'price': this.safeNumber(order, 'price'),
|
|
1090
|
-
'
|
|
1090
|
+
'triggerPrice': this.safeNumber(order, 'stopPrice'),
|
|
1091
1091
|
'amount': requestedBase,
|
|
1092
1092
|
'cost': executedQuote,
|
|
1093
1093
|
'average': this.safeNumber(order, 'averagePrice'),
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -2890,10 +2890,10 @@ class coinbase extends coinbase$1 {
|
|
|
2890
2890
|
'product_id': market['id'],
|
|
2891
2891
|
'side': side.toUpperCase(),
|
|
2892
2892
|
};
|
|
2893
|
-
const
|
|
2893
|
+
const triggerPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
|
|
2894
2894
|
const stopLossPrice = this.safeNumber(params, 'stopLossPrice');
|
|
2895
2895
|
const takeProfitPrice = this.safeNumber(params, 'takeProfitPrice');
|
|
2896
|
-
const isStop =
|
|
2896
|
+
const isStop = triggerPrice !== undefined;
|
|
2897
2897
|
const isStopLoss = stopLossPrice !== undefined;
|
|
2898
2898
|
const isTakeProfit = takeProfitPrice !== undefined;
|
|
2899
2899
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
@@ -2913,7 +2913,7 @@ class coinbase extends coinbase$1 {
|
|
|
2913
2913
|
'stop_limit_stop_limit_gtd': {
|
|
2914
2914
|
'base_size': this.amountToPrecision(symbol, amount),
|
|
2915
2915
|
'limit_price': this.priceToPrecision(symbol, price),
|
|
2916
|
-
'stop_price': this.priceToPrecision(symbol,
|
|
2916
|
+
'stop_price': this.priceToPrecision(symbol, triggerPrice),
|
|
2917
2917
|
'stop_direction': stopDirection,
|
|
2918
2918
|
'end_time': endTime,
|
|
2919
2919
|
},
|
|
@@ -2924,31 +2924,31 @@ class coinbase extends coinbase$1 {
|
|
|
2924
2924
|
'stop_limit_stop_limit_gtc': {
|
|
2925
2925
|
'base_size': this.amountToPrecision(symbol, amount),
|
|
2926
2926
|
'limit_price': this.priceToPrecision(symbol, price),
|
|
2927
|
-
'stop_price': this.priceToPrecision(symbol,
|
|
2927
|
+
'stop_price': this.priceToPrecision(symbol, triggerPrice),
|
|
2928
2928
|
'stop_direction': stopDirection,
|
|
2929
2929
|
},
|
|
2930
2930
|
};
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
2933
|
else if (isStopLoss || isTakeProfit) {
|
|
2934
|
-
let
|
|
2934
|
+
let tpslPrice = undefined;
|
|
2935
2935
|
if (isStopLoss) {
|
|
2936
2936
|
if (stopDirection === undefined) {
|
|
2937
2937
|
stopDirection = (side === 'buy') ? 'STOP_DIRECTION_STOP_UP' : 'STOP_DIRECTION_STOP_DOWN';
|
|
2938
2938
|
}
|
|
2939
|
-
|
|
2939
|
+
tpslPrice = this.priceToPrecision(symbol, stopLossPrice);
|
|
2940
2940
|
}
|
|
2941
2941
|
else {
|
|
2942
2942
|
if (stopDirection === undefined) {
|
|
2943
2943
|
stopDirection = (side === 'buy') ? 'STOP_DIRECTION_STOP_DOWN' : 'STOP_DIRECTION_STOP_UP';
|
|
2944
2944
|
}
|
|
2945
|
-
|
|
2945
|
+
tpslPrice = this.priceToPrecision(symbol, takeProfitPrice);
|
|
2946
2946
|
}
|
|
2947
2947
|
request['order_configuration'] = {
|
|
2948
2948
|
'stop_limit_stop_limit_gtc': {
|
|
2949
2949
|
'base_size': this.amountToPrecision(symbol, amount),
|
|
2950
2950
|
'limit_price': this.priceToPrecision(symbol, price),
|
|
2951
|
-
'stop_price':
|
|
2951
|
+
'stop_price': tpslPrice,
|
|
2952
2952
|
'stop_direction': stopDirection,
|
|
2953
2953
|
},
|
|
2954
2954
|
};
|
|
@@ -3231,7 +3231,6 @@ class coinbase extends coinbase$1 {
|
|
|
3231
3231
|
'postOnly': postOnly,
|
|
3232
3232
|
'side': this.safeStringLower(order, 'side'),
|
|
3233
3233
|
'price': price,
|
|
3234
|
-
'stopPrice': triggerPrice,
|
|
3235
3234
|
'triggerPrice': triggerPrice,
|
|
3236
3235
|
'amount': amount,
|
|
3237
3236
|
'filled': this.safeString(order, 'filled_size'),
|
|
@@ -1061,7 +1061,7 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
1061
1061
|
const side = this.safeString(order, 'side');
|
|
1062
1062
|
const timeInForce = this.safeString(order, 'time_in_force');
|
|
1063
1063
|
const postOnly = this.safeValue(order, 'post_only');
|
|
1064
|
-
const
|
|
1064
|
+
const triggerPrice = this.safeNumber(order, 'stop_price');
|
|
1065
1065
|
const clientOrderId = this.safeString(order, 'client_oid');
|
|
1066
1066
|
return this.safeOrder({
|
|
1067
1067
|
'id': id,
|
|
@@ -1077,8 +1077,7 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
1077
1077
|
'postOnly': postOnly,
|
|
1078
1078
|
'side': side,
|
|
1079
1079
|
'price': price,
|
|
1080
|
-
'
|
|
1081
|
-
'triggerPrice': stopPrice,
|
|
1080
|
+
'triggerPrice': triggerPrice,
|
|
1082
1081
|
'cost': cost,
|
|
1083
1082
|
'amount': amount,
|
|
1084
1083
|
'filled': filled,
|
|
@@ -1254,9 +1253,9 @@ class coinbaseexchange extends coinbaseexchange$1 {
|
|
|
1254
1253
|
if (clientOrderId !== undefined) {
|
|
1255
1254
|
request['client_oid'] = clientOrderId;
|
|
1256
1255
|
}
|
|
1257
|
-
const
|
|
1258
|
-
if (
|
|
1259
|
-
request['stop_price'] = this.priceToPrecision(symbol,
|
|
1256
|
+
const triggerPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
|
|
1257
|
+
if (triggerPrice !== undefined) {
|
|
1258
|
+
request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1260
1259
|
}
|
|
1261
1260
|
const timeInForce = this.safeString2(params, 'timeInForce', 'time_in_force');
|
|
1262
1261
|
if (timeInForce !== undefined) {
|
|
@@ -1678,7 +1678,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
1678
1678
|
* @param {float} amount how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders
|
|
1679
1679
|
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
1680
1680
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1681
|
-
* @param {float} [params.stopPrice]
|
|
1681
|
+
* @param {float} [params.stopPrice] alias for triggerPrice
|
|
1682
1682
|
* @param {float} [params.triggerPrice] price to trigger stop orders
|
|
1683
1683
|
* @param {float} [params.stopLossPrice] price to trigger stop-loss orders
|
|
1684
1684
|
* @param {bool} [params.postOnly] true or false
|
|
@@ -1691,7 +1691,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
1691
1691
|
await this.loadMarkets();
|
|
1692
1692
|
const market = this.market(symbol);
|
|
1693
1693
|
let typeId = type.toUpperCase();
|
|
1694
|
-
const
|
|
1694
|
+
const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
|
|
1695
1695
|
const clientOrderIdprefix = this.safeString(this.options, 'brokerId', 'nfqkvdjp');
|
|
1696
1696
|
let clientOrderId = clientOrderIdprefix + '-' + this.uuid();
|
|
1697
1697
|
clientOrderId = clientOrderId.slice(0, 17);
|
|
@@ -1701,14 +1701,14 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
1701
1701
|
'instrument': market['id'],
|
|
1702
1702
|
'size': this.amountToPrecision(market['symbol'], amount),
|
|
1703
1703
|
};
|
|
1704
|
-
if (
|
|
1704
|
+
if (triggerPrice !== undefined) {
|
|
1705
1705
|
if (type === 'limit') {
|
|
1706
1706
|
typeId = 'STOP_LIMIT';
|
|
1707
1707
|
}
|
|
1708
1708
|
else {
|
|
1709
1709
|
typeId = 'STOP';
|
|
1710
1710
|
}
|
|
1711
|
-
request['stop_price'] =
|
|
1711
|
+
request['stop_price'] = triggerPrice;
|
|
1712
1712
|
}
|
|
1713
1713
|
request['type'] = typeId;
|
|
1714
1714
|
if (type === 'limit') {
|
|
@@ -1811,7 +1811,6 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
1811
1811
|
'postOnly': undefined,
|
|
1812
1812
|
'side': this.safeStringLower(order, 'side'),
|
|
1813
1813
|
'price': this.safeString(order, 'price'),
|
|
1814
|
-
'stopPrice': this.safeString(order, 'stop_price'),
|
|
1815
1814
|
'triggerPrice': this.safeString(order, 'stop_price'),
|
|
1816
1815
|
'amount': this.safeString(order, 'size'),
|
|
1817
1816
|
'filled': this.safeString(order, 'exec_qty'),
|
|
@@ -1953,9 +1952,9 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
1953
1952
|
if (price !== undefined) {
|
|
1954
1953
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
1955
1954
|
}
|
|
1956
|
-
const
|
|
1957
|
-
if (
|
|
1958
|
-
request['stop_price'] =
|
|
1955
|
+
const triggerPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
|
|
1956
|
+
if (triggerPrice !== undefined) {
|
|
1957
|
+
request['stop_price'] = triggerPrice;
|
|
1959
1958
|
}
|
|
1960
1959
|
const clientOrderId = this.safeString2(params, 'client_order_id', 'clientOrderId');
|
|
1961
1960
|
if (clientOrderId === undefined) {
|
|
@@ -4149,7 +4149,6 @@ class coincatch extends coincatch$1 {
|
|
|
4149
4149
|
'amount': amount,
|
|
4150
4150
|
'filled': this.safeString2(order, 'fillQuantity', 'filledQty'),
|
|
4151
4151
|
'remaining': undefined,
|
|
4152
|
-
'stopPrice': undefined,
|
|
4153
4152
|
'triggerPrice': triggerPrice,
|
|
4154
4153
|
'takeProfitPrice': takeProfitPrice,
|
|
4155
4154
|
'stopLossPrice': stopLossPrice,
|