ccxt 4.4.41 → 4.4.43
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 +36 -34
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +6 -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 +35 -12
- package/dist/cjs/src/bitfinex.js +123 -0
- package/dist/cjs/src/bitstamp.js +54 -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 +63 -6
- 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/hyperliquid.js +1 -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/myokx.js +35 -0
- 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 +15 -15
- package/dist/cjs/src/poloniex.js +1 -3
- package/dist/cjs/src/poloniexfutures.js +6 -6
- package/dist/cjs/src/pro/myokx.js +24 -0
- 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/vertex.js +69 -4
- package/dist/cjs/src/wavesexchange.js +4 -5
- package/dist/cjs/src/whitebit.js +8 -9
- package/dist/cjs/src/woo.js +101 -15
- 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 +8 -2
- package/js/ccxt.js +6 -2
- 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/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/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 +35 -12
- package/js/src/bitfinex.d.ts +11 -1
- package/js/src/bitfinex.js +123 -0
- package/js/src/bitstamp.js +54 -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 +63 -6
- 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/hyperliquid.js +1 -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/myokx.d.ts +4 -0
- package/js/src/myokx.js +36 -0
- 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.d.ts +1 -0
- package/js/src/phemex.js +15 -15
- package/js/src/poloniex.js +1 -3
- package/js/src/poloniexfutures.js +6 -6
- package/js/src/pro/myokx.d.ts +4 -0
- package/js/src/pro/myokx.js +25 -0
- 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/vertex.d.ts +11 -1
- package/js/src/vertex.js +69 -4
- 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 +101 -15
- 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 +15 -8
package/dist/cjs/ccxt.js
CHANGED
|
@@ -95,6 +95,7 @@ var luno = require('./src/luno.js');
|
|
|
95
95
|
var lykke = require('./src/lykke.js');
|
|
96
96
|
var mercado = require('./src/mercado.js');
|
|
97
97
|
var mexc = require('./src/mexc.js');
|
|
98
|
+
var myokx = require('./src/myokx.js');
|
|
98
99
|
var ndax = require('./src/ndax.js');
|
|
99
100
|
var novadax = require('./src/novadax.js');
|
|
100
101
|
var oceanex = require('./src/oceanex.js');
|
|
@@ -179,6 +180,7 @@ var kucoinfutures$1 = require('./src/pro/kucoinfutures.js');
|
|
|
179
180
|
var lbank$1 = require('./src/pro/lbank.js');
|
|
180
181
|
var luno$1 = require('./src/pro/luno.js');
|
|
181
182
|
var mexc$1 = require('./src/pro/mexc.js');
|
|
183
|
+
var myokx$1 = require('./src/pro/myokx.js');
|
|
182
184
|
var ndax$1 = require('./src/pro/ndax.js');
|
|
183
185
|
var okcoin$1 = require('./src/pro/okcoin.js');
|
|
184
186
|
var okx$1 = require('./src/pro/okx.js');
|
|
@@ -200,7 +202,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
200
202
|
|
|
201
203
|
//-----------------------------------------------------------------------------
|
|
202
204
|
// this is updated by vss.js when building
|
|
203
|
-
const version = '4.4.
|
|
205
|
+
const version = '4.4.43';
|
|
204
206
|
Exchange["default"].ccxtVersion = version;
|
|
205
207
|
const exchanges = {
|
|
206
208
|
'ace': ace,
|
|
@@ -286,6 +288,7 @@ const exchanges = {
|
|
|
286
288
|
'lykke': lykke,
|
|
287
289
|
'mercado': mercado,
|
|
288
290
|
'mexc': mexc,
|
|
291
|
+
'myokx': myokx,
|
|
289
292
|
'ndax': ndax,
|
|
290
293
|
'novadax': novadax,
|
|
291
294
|
'oceanex': oceanex,
|
|
@@ -372,6 +375,7 @@ const pro = {
|
|
|
372
375
|
'lbank': lbank$1,
|
|
373
376
|
'luno': luno$1,
|
|
374
377
|
'mexc': mexc$1,
|
|
378
|
+
'myokx': myokx$1,
|
|
375
379
|
'ndax': ndax$1,
|
|
376
380
|
'okcoin': okcoin$1,
|
|
377
381
|
'okx': okx$1,
|
|
@@ -524,6 +528,7 @@ exports.luno = luno;
|
|
|
524
528
|
exports.lykke = lykke;
|
|
525
529
|
exports.mercado = mercado;
|
|
526
530
|
exports.mexc = mexc;
|
|
531
|
+
exports.myokx = myokx;
|
|
527
532
|
exports.ndax = ndax;
|
|
528
533
|
exports.novadax = novadax;
|
|
529
534
|
exports.oceanex = oceanex;
|
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
|
@@ -384,12 +384,26 @@ class bingx extends bingx$1 {
|
|
|
384
384
|
'get': {
|
|
385
385
|
'uid': 1,
|
|
386
386
|
'apiKey/query': 2,
|
|
387
|
+
'account/apiPermissions': 5,
|
|
387
388
|
},
|
|
388
389
|
'post': {
|
|
389
390
|
'innerTransfer/authorizeSubAccount': 1,
|
|
390
391
|
},
|
|
391
392
|
},
|
|
392
393
|
},
|
|
394
|
+
'transfer': {
|
|
395
|
+
'v1': {
|
|
396
|
+
'private': {
|
|
397
|
+
'get': {
|
|
398
|
+
'subAccount/asset/transferHistory': 1,
|
|
399
|
+
},
|
|
400
|
+
'post': {
|
|
401
|
+
'subAccount/transferAsset/supportCoins': 1,
|
|
402
|
+
'subAccount/transferAsset': 1,
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
},
|
|
393
407
|
},
|
|
394
408
|
'user': {
|
|
395
409
|
'auth': {
|
|
@@ -5598,6 +5612,9 @@ class bingx extends bingx$1 {
|
|
|
5598
5612
|
request['endTs'] = now;
|
|
5599
5613
|
}
|
|
5600
5614
|
if (market['spot']) {
|
|
5615
|
+
if (limit !== undefined) {
|
|
5616
|
+
request['limit'] = limit; // default 500, maximum 1000
|
|
5617
|
+
}
|
|
5601
5618
|
response = await this.spotV1PrivateGetTradeMyTrades(this.extend(request, params));
|
|
5602
5619
|
const data = this.safeDict(response, 'data', {});
|
|
5603
5620
|
fills = this.safeList(data, 'fills', []);
|
|
@@ -6426,23 +6443,29 @@ class bingx extends bingx$1 {
|
|
|
6426
6443
|
};
|
|
6427
6444
|
}
|
|
6428
6445
|
sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6446
|
+
let type = section[0];
|
|
6447
|
+
let version = section[1];
|
|
6448
|
+
let access = section[2];
|
|
6432
6449
|
const isSandbox = this.safeBool(this.options, 'sandboxMode', false);
|
|
6433
6450
|
if (isSandbox && (type !== 'swap')) {
|
|
6434
6451
|
throw new errors.NotSupported(this.id + ' does not have a testnet/sandbox URL for ' + type + ' endpoints');
|
|
6435
6452
|
}
|
|
6436
6453
|
let url = this.implodeHostname(this.urls['api'][type]);
|
|
6437
|
-
if (type === 'spot' && version === 'v3') {
|
|
6438
|
-
url += '/api';
|
|
6439
|
-
}
|
|
6440
|
-
else {
|
|
6441
|
-
url += '/' + type;
|
|
6442
|
-
}
|
|
6443
|
-
url += '/' + version + '/';
|
|
6444
6454
|
path = this.implodeParams(path, params);
|
|
6445
|
-
|
|
6455
|
+
if (version === 'transfer') {
|
|
6456
|
+
type = 'account/transfer';
|
|
6457
|
+
version = section[2];
|
|
6458
|
+
access = section[3];
|
|
6459
|
+
}
|
|
6460
|
+
if (path !== 'account/apiPermissions') {
|
|
6461
|
+
if (type === 'spot' && version === 'v3') {
|
|
6462
|
+
url += '/api';
|
|
6463
|
+
}
|
|
6464
|
+
else {
|
|
6465
|
+
url += '/' + type;
|
|
6466
|
+
}
|
|
6467
|
+
}
|
|
6468
|
+
url += '/' + version + '/' + path;
|
|
6446
6469
|
params = this.omit(params, this.extractParams(path));
|
|
6447
6470
|
params['timestamp'] = this.nonce();
|
|
6448
6471
|
params = this.keysort(params);
|
|
@@ -6453,7 +6476,7 @@ class bingx extends bingx$1 {
|
|
|
6453
6476
|
}
|
|
6454
6477
|
else if (access === 'private') {
|
|
6455
6478
|
this.checkRequiredCredentials();
|
|
6456
|
-
const isJsonContentType = ((type === 'subAccount') && (method === 'POST'));
|
|
6479
|
+
const isJsonContentType = (((type === 'subAccount') || (type === 'account/transfer')) && (method === 'POST'));
|
|
6457
6480
|
const parsedParams = this.parseParams(params);
|
|
6458
6481
|
const signature = this.hmac(this.encode(this.rawencode(parsedParams)), this.encode(this.secret), sha256.sha256);
|
|
6459
6482
|
headers = {
|
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/bitstamp.js
CHANGED
|
@@ -152,6 +152,7 @@ class bitstamp extends bitstamp$1 {
|
|
|
152
152
|
'user_transactions/': 1,
|
|
153
153
|
'user_transactions/{pair}/': 1,
|
|
154
154
|
'crypto-transactions/': 1,
|
|
155
|
+
'open_order': 1,
|
|
155
156
|
'open_orders/all/': 1,
|
|
156
157
|
'open_orders/{pair}/': 1,
|
|
157
158
|
'order_status/': 1,
|
|
@@ -492,6 +493,59 @@ class bitstamp extends bitstamp$1 {
|
|
|
492
493
|
'Ensure that there are no more than': errors.InvalidOrder, // {"status": "error", "reason": {"amount": ["Ensure that there are no more than 0 decimal places."], "__all__": [""]}}
|
|
493
494
|
},
|
|
494
495
|
},
|
|
496
|
+
'features': {
|
|
497
|
+
'spot': {
|
|
498
|
+
'sandbox': false,
|
|
499
|
+
'createOrder': {
|
|
500
|
+
'marginMode': false,
|
|
501
|
+
'triggerPrice': false,
|
|
502
|
+
'triggerPriceType': undefined,
|
|
503
|
+
'triggerDirection': false,
|
|
504
|
+
'stopLossPrice': false,
|
|
505
|
+
'takeProfitPrice': false,
|
|
506
|
+
'attachedStopLossTakeProfit': undefined,
|
|
507
|
+
'timeInForce': {
|
|
508
|
+
'IOC': true,
|
|
509
|
+
'FOK': true,
|
|
510
|
+
'PO': true,
|
|
511
|
+
'GTD': true,
|
|
512
|
+
},
|
|
513
|
+
'hedged': false,
|
|
514
|
+
'trailing': false,
|
|
515
|
+
},
|
|
516
|
+
'createOrders': undefined,
|
|
517
|
+
'fetchMyTrades': {
|
|
518
|
+
'marginMode': false,
|
|
519
|
+
'limit': 1000,
|
|
520
|
+
'daysBack': undefined,
|
|
521
|
+
'untilDays': 30,
|
|
522
|
+
},
|
|
523
|
+
'fetchOrder': {
|
|
524
|
+
'marginMode': false,
|
|
525
|
+
'trigger': false,
|
|
526
|
+
'trailing': false,
|
|
527
|
+
},
|
|
528
|
+
'fetchOpenOrders': {
|
|
529
|
+
'marginMode': false,
|
|
530
|
+
'limit': undefined,
|
|
531
|
+
'trigger': false,
|
|
532
|
+
'trailing': false,
|
|
533
|
+
},
|
|
534
|
+
'fetchOrders': undefined,
|
|
535
|
+
'fetchClosedOrders': undefined,
|
|
536
|
+
'fetchOHLCV': {
|
|
537
|
+
'limit': 1000,
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
'swap': {
|
|
541
|
+
'linear': undefined,
|
|
542
|
+
'inverse': undefined,
|
|
543
|
+
},
|
|
544
|
+
'future': {
|
|
545
|
+
'linear': undefined,
|
|
546
|
+
'inverse': undefined,
|
|
547
|
+
},
|
|
548
|
+
},
|
|
495
549
|
});
|
|
496
550
|
}
|
|
497
551
|
/**
|
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'),
|