ccxt 4.4.1 → 4.4.3
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/base/Exchange.js +69 -0
- package/dist/cjs/src/binance.js +88 -18
- package/dist/cjs/src/bitmart.js +3 -1
- package/dist/cjs/src/bitstamp.js +24 -36
- package/dist/cjs/src/bybit.js +1 -0
- package/dist/cjs/src/cryptocom.js +3 -2
- package/dist/cjs/src/currencycom.js +1 -2
- package/dist/cjs/src/htx.js +1 -1
- package/dist/cjs/src/mexc.js +88 -1
- package/dist/cjs/src/pro/binance.js +3 -63
- package/dist/cjs/src/pro/bitget.js +1 -9
- package/dist/cjs/src/pro/bitmex.js +11 -1
- package/dist/cjs/src/pro/bybit.js +2 -54
- package/dist/cjs/src/pro/cryptocom.js +193 -61
- package/dist/cjs/src/pro/gate.js +1 -9
- package/dist/cjs/src/pro/hyperliquid.js +4 -36
- package/dist/cjs/src/pro/kucoin.js +2 -59
- package/dist/cjs/src/pro/kucoinfutures.js +139 -1
- package/dist/cjs/src/pro/mexc.js +82 -3
- package/dist/cjs/src/pro/okx.js +14 -39
- package/dist/cjs/src/pro/oxfun.js +75 -0
- package/dist/cjs/src/pro/phemex.js +45 -1
- package/dist/cjs/src/pro/woofipro.js +67 -0
- package/dist/cjs/src/xt.js +7 -2
- package/examples/js/cli.js +8 -4
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +2 -0
- package/js/src/base/Exchange.js +70 -1
- package/js/src/base/types.d.ts +5 -4
- package/js/src/binance.js +88 -18
- package/js/src/bitmart.js +3 -1
- package/js/src/bitstamp.js +24 -36
- package/js/src/bybit.js +2 -1
- package/js/src/cryptocom.js +3 -2
- package/js/src/currencycom.js +1 -2
- package/js/src/htx.js +1 -1
- package/js/src/mexc.js +88 -1
- package/js/src/pro/binance.d.ts +0 -1
- package/js/src/pro/binance.js +4 -64
- package/js/src/pro/bitget.js +1 -9
- package/js/src/pro/bitmex.js +11 -1
- package/js/src/pro/bybit.d.ts +1 -2
- package/js/src/pro/bybit.js +3 -55
- package/js/src/pro/cryptocom.d.ts +7 -2
- package/js/src/pro/cryptocom.js +194 -62
- package/js/src/pro/gate.js +2 -10
- package/js/src/pro/hyperliquid.js +5 -37
- package/js/src/pro/kucoin.d.ts +0 -1
- package/js/src/pro/kucoin.js +3 -60
- package/js/src/pro/kucoinfutures.d.ts +7 -1
- package/js/src/pro/kucoinfutures.js +139 -1
- package/js/src/pro/mexc.d.ts +3 -1
- package/js/src/pro/mexc.js +82 -3
- package/js/src/pro/okx.js +15 -40
- package/js/src/pro/oxfun.d.ts +3 -0
- package/js/src/pro/oxfun.js +75 -0
- package/js/src/pro/phemex.d.ts +2 -1
- package/js/src/pro/phemex.js +45 -1
- package/js/src/pro/woofipro.d.ts +3 -0
- package/js/src/pro/woofipro.js +67 -0
- package/js/src/xt.js +7 -2
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -194,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
194
194
|
|
|
195
195
|
//-----------------------------------------------------------------------------
|
|
196
196
|
// this is updated by vss.js when building
|
|
197
|
-
const version = '4.4.
|
|
197
|
+
const version = '4.4.3';
|
|
198
198
|
Exchange["default"].ccxtVersion = version;
|
|
199
199
|
const exchanges = {
|
|
200
200
|
'ace': ace,
|
|
@@ -2398,6 +2398,10 @@ class Exchange {
|
|
|
2398
2398
|
'max': undefined,
|
|
2399
2399
|
},
|
|
2400
2400
|
},
|
|
2401
|
+
'marginModes': {
|
|
2402
|
+
'cross': undefined,
|
|
2403
|
+
'isolated': undefined,
|
|
2404
|
+
},
|
|
2401
2405
|
'created': undefined,
|
|
2402
2406
|
'info': undefined,
|
|
2403
2407
|
};
|
|
@@ -6504,6 +6508,71 @@ class Exchange {
|
|
|
6504
6508
|
*/
|
|
6505
6509
|
throw new errors.NotSupported(this.id + ' fetchTransfers () is not supported yet');
|
|
6506
6510
|
}
|
|
6511
|
+
cleanUnsubscription(client, subHash, unsubHash) {
|
|
6512
|
+
if (unsubHash in client.subscriptions) {
|
|
6513
|
+
delete client.subscriptions[unsubHash];
|
|
6514
|
+
}
|
|
6515
|
+
if (subHash in client.subscriptions) {
|
|
6516
|
+
delete client.subscriptions[subHash];
|
|
6517
|
+
}
|
|
6518
|
+
if (subHash in client.futures) {
|
|
6519
|
+
const error = new errors.UnsubscribeError(this.id + ' ' + subHash);
|
|
6520
|
+
client.reject(error, subHash);
|
|
6521
|
+
}
|
|
6522
|
+
client.resolve(true, unsubHash);
|
|
6523
|
+
}
|
|
6524
|
+
cleanCache(subscription) {
|
|
6525
|
+
const topic = this.safeString(subscription, 'topic');
|
|
6526
|
+
const symbols = this.safeList(subscription, 'symbols', []);
|
|
6527
|
+
const symbolsLength = symbols.length;
|
|
6528
|
+
if (topic === 'ohlcv') {
|
|
6529
|
+
const symbolsAndTimeFrames = this.safeList(subscription, 'symbolsAndTimeframes', []);
|
|
6530
|
+
for (let i = 0; i < symbolsAndTimeFrames.length; i++) {
|
|
6531
|
+
const symbolAndTimeFrame = symbolsAndTimeFrames[i];
|
|
6532
|
+
const symbol = this.safeString(symbolAndTimeFrame, 0);
|
|
6533
|
+
const timeframe = this.safeString(symbolAndTimeFrame, 1);
|
|
6534
|
+
if (timeframe in this.ohlcvs[symbol]) {
|
|
6535
|
+
delete this.ohlcvs[symbol][timeframe];
|
|
6536
|
+
}
|
|
6537
|
+
}
|
|
6538
|
+
}
|
|
6539
|
+
else if (symbolsLength > 0) {
|
|
6540
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
6541
|
+
const symbol = symbols[i];
|
|
6542
|
+
if (topic === 'trades') {
|
|
6543
|
+
delete this.trades[symbol];
|
|
6544
|
+
}
|
|
6545
|
+
else if (topic === 'orderbook') {
|
|
6546
|
+
delete this.orderbooks[symbol];
|
|
6547
|
+
}
|
|
6548
|
+
else if (topic === 'ticker') {
|
|
6549
|
+
delete this.tickers[symbol];
|
|
6550
|
+
}
|
|
6551
|
+
}
|
|
6552
|
+
}
|
|
6553
|
+
else {
|
|
6554
|
+
if (topic === 'myTrades') {
|
|
6555
|
+
// don't reset this.myTrades directly here
|
|
6556
|
+
// because in c# we need to use a different object
|
|
6557
|
+
const keys = Object.keys(this.myTrades);
|
|
6558
|
+
for (let i = 0; i < keys.length; i++) {
|
|
6559
|
+
delete this.myTrades[keys[i]];
|
|
6560
|
+
}
|
|
6561
|
+
}
|
|
6562
|
+
else if (topic === 'orders') {
|
|
6563
|
+
const orderSymbols = Object.keys(this.orders);
|
|
6564
|
+
for (let i = 0; i < orderSymbols.length; i++) {
|
|
6565
|
+
delete this.orders[orderSymbols[i]];
|
|
6566
|
+
}
|
|
6567
|
+
}
|
|
6568
|
+
else if (topic === 'ticker') {
|
|
6569
|
+
const tickerSymbols = Object.keys(this.tickers);
|
|
6570
|
+
for (let i = 0; i < tickerSymbols.length; i++) {
|
|
6571
|
+
delete this.tickers[tickerSymbols[i]];
|
|
6572
|
+
}
|
|
6573
|
+
}
|
|
6574
|
+
}
|
|
6575
|
+
}
|
|
6507
6576
|
}
|
|
6508
6577
|
|
|
6509
6578
|
exports.Exchange = Exchange;
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -2641,6 +2641,7 @@ class binance extends binance$1 {
|
|
|
2641
2641
|
* @name binance#fetchCurrencies
|
|
2642
2642
|
* @description fetches all available currencies on an exchange
|
|
2643
2643
|
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
2644
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets
|
|
2644
2645
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2645
2646
|
* @returns {object} an associative dictionary of currencies
|
|
2646
2647
|
*/
|
|
@@ -2660,9 +2661,13 @@ class binance extends binance$1 {
|
|
|
2660
2661
|
if (apiBackup !== undefined) {
|
|
2661
2662
|
return undefined;
|
|
2662
2663
|
}
|
|
2663
|
-
const
|
|
2664
|
+
const promises = [this.sapiGetCapitalConfigGetall(params), this.sapiGetMarginAllAssets(params)];
|
|
2665
|
+
const results = await Promise.all(promises);
|
|
2666
|
+
const responseCurrencies = results[0];
|
|
2667
|
+
const responseMarginables = results[1];
|
|
2668
|
+
const marginablesById = this.indexBy(responseMarginables, 'assetName');
|
|
2664
2669
|
const result = {};
|
|
2665
|
-
for (let i = 0; i <
|
|
2670
|
+
for (let i = 0; i < responseCurrencies.length; i++) {
|
|
2666
2671
|
//
|
|
2667
2672
|
// {
|
|
2668
2673
|
// "coin": "LINK",
|
|
@@ -2758,7 +2763,7 @@ class binance extends binance$1 {
|
|
|
2758
2763
|
// ]
|
|
2759
2764
|
// }
|
|
2760
2765
|
//
|
|
2761
|
-
const entry =
|
|
2766
|
+
const entry = responseCurrencies[i];
|
|
2762
2767
|
const id = this.safeString(entry, 'coin');
|
|
2763
2768
|
const name = this.safeString(entry, 'name');
|
|
2764
2769
|
const code = this.safeCurrencyCode(id);
|
|
@@ -2813,6 +2818,17 @@ class binance extends binance$1 {
|
|
|
2813
2818
|
}
|
|
2814
2819
|
const trading = this.safeBool(entry, 'trading');
|
|
2815
2820
|
const active = (isWithdrawEnabled && isDepositEnabled && trading);
|
|
2821
|
+
const marginEntry = this.safeDict(marginablesById, id, {});
|
|
2822
|
+
//
|
|
2823
|
+
// {
|
|
2824
|
+
// assetName: "BTC",
|
|
2825
|
+
// assetFullName: "Bitcoin",
|
|
2826
|
+
// isBorrowable: true,
|
|
2827
|
+
// isMortgageable: true,
|
|
2828
|
+
// userMinBorrow: "0",
|
|
2829
|
+
// userMinRepay: "0",
|
|
2830
|
+
// }
|
|
2831
|
+
//
|
|
2816
2832
|
result[code] = {
|
|
2817
2833
|
'id': id,
|
|
2818
2834
|
'name': name,
|
|
@@ -2826,6 +2842,7 @@ class binance extends binance$1 {
|
|
|
2826
2842
|
'fee': fee,
|
|
2827
2843
|
'fees': fees,
|
|
2828
2844
|
'limits': this.limits,
|
|
2845
|
+
'margin': this.safeBool(marginEntry, 'isBorrowable'),
|
|
2829
2846
|
};
|
|
2830
2847
|
}
|
|
2831
2848
|
return result;
|
|
@@ -2839,6 +2856,8 @@ class binance extends binance$1 {
|
|
|
2839
2856
|
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
|
|
2840
2857
|
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
|
|
2841
2858
|
* @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
|
|
2859
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs // cross margin
|
|
2860
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol // isolated margin
|
|
2842
2861
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2843
2862
|
* @returns {object[]} an array of objects representing market data
|
|
2844
2863
|
*/
|
|
@@ -2853,10 +2872,16 @@ class binance extends binance$1 {
|
|
|
2853
2872
|
}
|
|
2854
2873
|
fetchMarkets.push(type);
|
|
2855
2874
|
}
|
|
2875
|
+
let fetchMargins = false;
|
|
2856
2876
|
for (let i = 0; i < fetchMarkets.length; i++) {
|
|
2857
2877
|
const marketType = fetchMarkets[i];
|
|
2858
2878
|
if (marketType === 'spot') {
|
|
2859
2879
|
promisesRaw.push(this.publicGetExchangeInfo(params));
|
|
2880
|
+
if (this.checkRequiredCredentials(false) && !sandboxMode) {
|
|
2881
|
+
fetchMargins = true;
|
|
2882
|
+
promisesRaw.push(this.sapiGetMarginAllPairs(params));
|
|
2883
|
+
promisesRaw.push(this.sapiGetMarginIsolatedAllPairs(params));
|
|
2884
|
+
}
|
|
2860
2885
|
}
|
|
2861
2886
|
else if (marketType === 'linear') {
|
|
2862
2887
|
promisesRaw.push(this.fapiPublicGetExchangeInfo(params));
|
|
@@ -2871,12 +2896,27 @@ class binance extends binance$1 {
|
|
|
2871
2896
|
throw new errors.ExchangeError(this.id + ' fetchMarkets() this.options fetchMarkets "' + marketType + '" is not a supported market type');
|
|
2872
2897
|
}
|
|
2873
2898
|
}
|
|
2874
|
-
const
|
|
2899
|
+
const results = await Promise.all(promisesRaw);
|
|
2875
2900
|
let markets = [];
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2901
|
+
this.options['crossMarginPairsData'] = [];
|
|
2902
|
+
this.options['isolatedMarginPairsData'] = [];
|
|
2903
|
+
for (let i = 0; i < results.length; i++) {
|
|
2904
|
+
const res = this.safeValue(results, i);
|
|
2905
|
+
if (fetchMargins && Array.isArray(res)) {
|
|
2906
|
+
const keysList = Object.keys(this.indexBy(res, 'symbol'));
|
|
2907
|
+
const length = (Object.keys(this.options['crossMarginPairsData'])).length;
|
|
2908
|
+
// first one is the cross-margin promise
|
|
2909
|
+
if (length === 0) {
|
|
2910
|
+
this.options['crossMarginPairsData'] = keysList;
|
|
2911
|
+
}
|
|
2912
|
+
else {
|
|
2913
|
+
this.options['isolatedMarginPairsData'] = keysList;
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
else {
|
|
2917
|
+
const resultMarkets = this.safeList2(res, 'symbols', 'optionSymbols', []);
|
|
2918
|
+
markets = this.arrayConcat(markets, resultMarkets);
|
|
2919
|
+
}
|
|
2880
2920
|
}
|
|
2881
2921
|
//
|
|
2882
2922
|
// spot / margin
|
|
@@ -2922,6 +2962,20 @@ class binance extends binance$1 {
|
|
|
2922
2962
|
// ],
|
|
2923
2963
|
// }
|
|
2924
2964
|
//
|
|
2965
|
+
// cross & isolated pairs response:
|
|
2966
|
+
//
|
|
2967
|
+
// [
|
|
2968
|
+
// {
|
|
2969
|
+
// symbol: "BTCUSDT",
|
|
2970
|
+
// base: "BTC",
|
|
2971
|
+
// quote: "USDT",
|
|
2972
|
+
// isMarginTrade: true,
|
|
2973
|
+
// isBuyAllowed: true,
|
|
2974
|
+
// isSellAllowed: true,
|
|
2975
|
+
// id: "376870555451677893", // doesn't exist in isolated
|
|
2976
|
+
// },
|
|
2977
|
+
// ]
|
|
2978
|
+
//
|
|
2925
2979
|
// futures/usdt-margined (fapi)
|
|
2926
2980
|
//
|
|
2927
2981
|
// {
|
|
@@ -3156,6 +3210,21 @@ class binance extends binance$1 {
|
|
|
3156
3210
|
}
|
|
3157
3211
|
}
|
|
3158
3212
|
const isMarginTradingAllowed = this.safeBool(market, 'isMarginTradingAllowed', false);
|
|
3213
|
+
let marginModes = undefined;
|
|
3214
|
+
if (spot) {
|
|
3215
|
+
const hasCrossMargin = this.inArray(id, this.options['crossMarginPairsData']);
|
|
3216
|
+
const hasIsolatedMargin = this.inArray(id, this.options['isolatedMarginPairsData']);
|
|
3217
|
+
marginModes = {
|
|
3218
|
+
'cross': hasCrossMargin,
|
|
3219
|
+
'isolated': hasIsolatedMargin,
|
|
3220
|
+
};
|
|
3221
|
+
}
|
|
3222
|
+
else if (linear || inverse) {
|
|
3223
|
+
marginModes = {
|
|
3224
|
+
'cross': true,
|
|
3225
|
+
'isolated': true,
|
|
3226
|
+
};
|
|
3227
|
+
}
|
|
3159
3228
|
let unifiedType = undefined;
|
|
3160
3229
|
if (spot) {
|
|
3161
3230
|
unifiedType = 'spot';
|
|
@@ -3187,6 +3256,7 @@ class binance extends binance$1 {
|
|
|
3187
3256
|
'type': unifiedType,
|
|
3188
3257
|
'spot': spot,
|
|
3189
3258
|
'margin': spot && isMarginTradingAllowed,
|
|
3259
|
+
'marginModes': marginModes,
|
|
3190
3260
|
'swap': swap,
|
|
3191
3261
|
'future': future,
|
|
3192
3262
|
'option': option,
|
|
@@ -6330,8 +6400,8 @@ class binance extends binance$1 {
|
|
|
6330
6400
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOrders', params);
|
|
6331
6401
|
let isPortfolioMargin = undefined;
|
|
6332
6402
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOrders', 'papi', 'portfolioMargin', false);
|
|
6333
|
-
const isConditional = this.
|
|
6334
|
-
params = this.omit(params, ['stop', 'conditional', 'type']);
|
|
6403
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
6404
|
+
params = this.omit(params, ['stop', 'trigger', 'conditional', 'type']);
|
|
6335
6405
|
let request = {
|
|
6336
6406
|
'symbol': market['id'],
|
|
6337
6407
|
};
|
|
@@ -6600,7 +6670,7 @@ class binance extends binance$1 {
|
|
|
6600
6670
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
|
|
6601
6671
|
let isPortfolioMargin = undefined;
|
|
6602
6672
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOpenOrders', 'papi', 'portfolioMargin', false);
|
|
6603
|
-
const isConditional = this.safeBoolN(params, ['stop', '
|
|
6673
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
6604
6674
|
if (symbol !== undefined) {
|
|
6605
6675
|
market = this.market(symbol);
|
|
6606
6676
|
request['symbol'] = market['id'];
|
|
@@ -6617,7 +6687,7 @@ class binance extends binance$1 {
|
|
|
6617
6687
|
}
|
|
6618
6688
|
let subType = undefined;
|
|
6619
6689
|
[subType, params] = this.handleSubTypeAndParams('fetchOpenOrders', market, params);
|
|
6620
|
-
params = this.omit(params, ['type', 'stop', '
|
|
6690
|
+
params = this.omit(params, ['type', 'stop', 'trigger', 'conditional']);
|
|
6621
6691
|
let response = undefined;
|
|
6622
6692
|
if (type === 'option') {
|
|
6623
6693
|
if (since !== undefined) {
|
|
@@ -6700,8 +6770,8 @@ class binance extends binance$1 {
|
|
|
6700
6770
|
};
|
|
6701
6771
|
let isPortfolioMargin = undefined;
|
|
6702
6772
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOpenOrder', 'papi', 'portfolioMargin', false);
|
|
6703
|
-
const isConditional = this.safeBoolN(params, ['stop', '
|
|
6704
|
-
params = this.omit(params, ['stop', '
|
|
6773
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
6774
|
+
params = this.omit(params, ['stop', 'trigger', 'conditional']);
|
|
6705
6775
|
const isPortfolioMarginConditional = (isPortfolioMargin && isConditional);
|
|
6706
6776
|
const orderIdRequest = isPortfolioMarginConditional ? 'strategyId' : 'orderId';
|
|
6707
6777
|
request[orderIdRequest] = id;
|
|
@@ -7016,7 +7086,7 @@ class binance extends binance$1 {
|
|
|
7016
7086
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
7017
7087
|
let isPortfolioMargin = undefined;
|
|
7018
7088
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'cancelOrder', 'papi', 'portfolioMargin', false);
|
|
7019
|
-
const isConditional = this.
|
|
7089
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
7020
7090
|
const request = {
|
|
7021
7091
|
'symbol': market['id'],
|
|
7022
7092
|
};
|
|
@@ -7042,7 +7112,7 @@ class binance extends binance$1 {
|
|
|
7042
7112
|
request['orderId'] = id;
|
|
7043
7113
|
}
|
|
7044
7114
|
}
|
|
7045
|
-
params = this.omit(params, ['type', 'origClientOrderId', 'clientOrderId', 'newClientStrategyId', 'stop', 'conditional']);
|
|
7115
|
+
params = this.omit(params, ['type', 'origClientOrderId', 'clientOrderId', 'newClientStrategyId', 'stop', 'trigger', 'conditional']);
|
|
7046
7116
|
let response = undefined;
|
|
7047
7117
|
if (market['option']) {
|
|
7048
7118
|
response = await this.eapiPrivateDeleteOrder(this.extend(request, params));
|
|
@@ -7120,9 +7190,9 @@ class binance extends binance$1 {
|
|
|
7120
7190
|
};
|
|
7121
7191
|
let isPortfolioMargin = undefined;
|
|
7122
7192
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'cancelAllOrders', 'papi', 'portfolioMargin', false);
|
|
7123
|
-
const isConditional = this.
|
|
7193
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
7124
7194
|
const type = this.safeString(params, 'type', market['type']);
|
|
7125
|
-
params = this.omit(params, ['type', 'stop', 'conditional']);
|
|
7195
|
+
params = this.omit(params, ['type', 'stop', 'trigger', 'conditional']);
|
|
7126
7196
|
let marginMode = undefined;
|
|
7127
7197
|
[marginMode, params] = this.handleMarginModeAndParams('cancelAllOrders', params);
|
|
7128
7198
|
let response = undefined;
|
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -229,6 +229,7 @@ class bitmart extends bitmart$1 {
|
|
|
229
229
|
'spot/v4/query/trades': 5,
|
|
230
230
|
'spot/v4/query/order-trades': 5,
|
|
231
231
|
'spot/v4/cancel_orders': 3,
|
|
232
|
+
'spot/v4/cancel_all': 90,
|
|
232
233
|
'spot/v4/batch_orders': 3,
|
|
233
234
|
// newer endpoint
|
|
234
235
|
'spot/v3/cancel_order': 1,
|
|
@@ -2964,6 +2965,7 @@ class bitmart extends bitmart$1 {
|
|
|
2964
2965
|
* @name bitmart#cancelAllOrders
|
|
2965
2966
|
* @description cancel all open orders in a market
|
|
2966
2967
|
* @see https://developer-pro.bitmart.com/en/spot/#cancel-all-orders
|
|
2968
|
+
* @see https://developer-pro.bitmart.com/en/spot/#new-batch-order-v4-signed
|
|
2967
2969
|
* @see https://developer-pro.bitmart.com/en/futures/#cancel-all-orders-signed
|
|
2968
2970
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#cancel-all-orders-signed
|
|
2969
2971
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
@@ -2982,7 +2984,7 @@ class bitmart extends bitmart$1 {
|
|
|
2982
2984
|
let type = undefined;
|
|
2983
2985
|
[type, params] = this.handleMarketTypeAndParams('cancelAllOrders', market, params);
|
|
2984
2986
|
if (type === 'spot') {
|
|
2985
|
-
response = await this.
|
|
2987
|
+
response = await this.privatePostSpotV4CancelAll(this.extend(request, params));
|
|
2986
2988
|
}
|
|
2987
2989
|
else if (type === 'swap') {
|
|
2988
2990
|
if (symbol === undefined) {
|
package/dist/cjs/src/bitstamp.js
CHANGED
|
@@ -389,46 +389,34 @@ class bitstamp extends bitstamp$1 {
|
|
|
389
389
|
'trading': {
|
|
390
390
|
'tierBased': true,
|
|
391
391
|
'percentage': true,
|
|
392
|
-
'taker': this.parseNumber('0.
|
|
393
|
-
'maker': this.parseNumber('0.
|
|
392
|
+
'taker': this.parseNumber('0.004'),
|
|
393
|
+
'maker': this.parseNumber('0.004'),
|
|
394
394
|
'tiers': {
|
|
395
395
|
'taker': [
|
|
396
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
397
|
-
[this.parseNumber('
|
|
398
|
-
[this.parseNumber('100000'), this.parseNumber('0.
|
|
399
|
-
[this.parseNumber('
|
|
400
|
-
[this.parseNumber('
|
|
401
|
-
[this.parseNumber('
|
|
402
|
-
[this.parseNumber('
|
|
403
|
-
[this.parseNumber('
|
|
404
|
-
[this.parseNumber('
|
|
405
|
-
[this.parseNumber('
|
|
406
|
-
[this.parseNumber('
|
|
407
|
-
[this.parseNumber('100000000'), this.parseNumber('0.0007')],
|
|
408
|
-
[this.parseNumber('500000000'), this.parseNumber('0.0005')],
|
|
409
|
-
[this.parseNumber('2000000000'), this.parseNumber('0.0003')],
|
|
410
|
-
[this.parseNumber('6000000000'), this.parseNumber('0.0001')],
|
|
411
|
-
[this.parseNumber('20000000000'), this.parseNumber('0.00005')],
|
|
412
|
-
[this.parseNumber('20000000001'), this.parseNumber('0')],
|
|
396
|
+
[this.parseNumber('0'), this.parseNumber('0.004')],
|
|
397
|
+
[this.parseNumber('10000'), this.parseNumber('0.003')],
|
|
398
|
+
[this.parseNumber('100000'), this.parseNumber('0.002')],
|
|
399
|
+
[this.parseNumber('500000'), this.parseNumber('0.0018')],
|
|
400
|
+
[this.parseNumber('1500000'), this.parseNumber('0.0016')],
|
|
401
|
+
[this.parseNumber('5000000'), this.parseNumber('0.0012')],
|
|
402
|
+
[this.parseNumber('20000000'), this.parseNumber('0.001')],
|
|
403
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0008')],
|
|
404
|
+
[this.parseNumber('100000000'), this.parseNumber('0.0006')],
|
|
405
|
+
[this.parseNumber('250000000'), this.parseNumber('0.0005')],
|
|
406
|
+
[this.parseNumber('1000000000'), this.parseNumber('0.0003')],
|
|
413
407
|
],
|
|
414
408
|
'maker': [
|
|
415
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
416
|
-
[this.parseNumber('
|
|
417
|
-
[this.parseNumber('100000'), this.parseNumber('0.
|
|
418
|
-
[this.parseNumber('
|
|
419
|
-
[this.parseNumber('
|
|
420
|
-
[this.parseNumber('
|
|
421
|
-
[this.parseNumber('
|
|
422
|
-
[this.parseNumber('
|
|
423
|
-
[this.parseNumber('
|
|
424
|
-
[this.parseNumber('
|
|
425
|
-
[this.parseNumber('
|
|
426
|
-
[this.parseNumber('100000000'), this.parseNumber('0.0007')],
|
|
427
|
-
[this.parseNumber('500000000'), this.parseNumber('0.0005')],
|
|
428
|
-
[this.parseNumber('2000000000'), this.parseNumber('0.0003')],
|
|
429
|
-
[this.parseNumber('6000000000'), this.parseNumber('0.0001')],
|
|
430
|
-
[this.parseNumber('20000000000'), this.parseNumber('0.00005')],
|
|
431
|
-
[this.parseNumber('20000000001'), this.parseNumber('0')],
|
|
409
|
+
[this.parseNumber('0'), this.parseNumber('0.003')],
|
|
410
|
+
[this.parseNumber('10000'), this.parseNumber('0.002')],
|
|
411
|
+
[this.parseNumber('100000'), this.parseNumber('0.001')],
|
|
412
|
+
[this.parseNumber('500000'), this.parseNumber('0.0008')],
|
|
413
|
+
[this.parseNumber('1500000'), this.parseNumber('0.0006')],
|
|
414
|
+
[this.parseNumber('5000000'), this.parseNumber('0.0003')],
|
|
415
|
+
[this.parseNumber('20000000'), this.parseNumber('0.002')],
|
|
416
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0001')],
|
|
417
|
+
[this.parseNumber('100000000'), this.parseNumber('0')],
|
|
418
|
+
[this.parseNumber('250000000'), this.parseNumber('0')],
|
|
419
|
+
[this.parseNumber('1000000000'), this.parseNumber('0')],
|
|
432
420
|
],
|
|
433
421
|
},
|
|
434
422
|
},
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -976,6 +976,7 @@ class bybit extends bybit$1 {
|
|
|
976
976
|
'3200300': errors.InsufficientFunds, // {"retCode":3200300,"retMsg":"Insufficient margin balance.","result":null,"retExtMap":{}}
|
|
977
977
|
},
|
|
978
978
|
'broad': {
|
|
979
|
+
'Not supported symbols': errors.BadSymbol,
|
|
979
980
|
'Request timeout': errors.RequestTimeout,
|
|
980
981
|
'unknown orderInfo': errors.OrderNotFound,
|
|
981
982
|
'invalid api_key': errors.AuthenticationError,
|
|
@@ -138,7 +138,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
138
138
|
'www': 'https://crypto.com/',
|
|
139
139
|
'referral': {
|
|
140
140
|
'url': 'https://crypto.com/exch/kdacthrnxt',
|
|
141
|
-
'discount': 0.
|
|
141
|
+
'discount': 0.75,
|
|
142
142
|
},
|
|
143
143
|
'doc': [
|
|
144
144
|
'https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html',
|
|
@@ -602,7 +602,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
602
602
|
* @method
|
|
603
603
|
* @name cryptocom#fetchTickers
|
|
604
604
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
605
|
-
* @see https://exchange-docs.crypto.com/
|
|
605
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#public-get-tickers
|
|
606
606
|
* @see https://exchange-docs.crypto.com/derivatives/index.html#public-get-tickers
|
|
607
607
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
608
608
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1796,6 +1796,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
1796
1796
|
* @method
|
|
1797
1797
|
* @name cryptocom#fetchDepositAddress
|
|
1798
1798
|
* @description fetch the deposit address for a currency associated with this account
|
|
1799
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-deposit-address
|
|
1799
1800
|
* @param {string} code unified currency code
|
|
1800
1801
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1801
1802
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -1989,7 +1989,7 @@ class currencycom extends currencycom$1 {
|
|
|
1989
1989
|
'collateral': undefined,
|
|
1990
1990
|
'side': side,
|
|
1991
1991
|
// 'realizedProfit': this.safeNumber (position, 'rpl'),
|
|
1992
|
-
'
|
|
1992
|
+
'unrealizedPnl': unrealizedProfit,
|
|
1993
1993
|
'leverage': leverage,
|
|
1994
1994
|
'percentage': undefined,
|
|
1995
1995
|
'marginMode': undefined,
|
|
@@ -2003,7 +2003,6 @@ class currencycom extends currencycom$1 {
|
|
|
2003
2003
|
'maintenanceMarginPercentage': undefined,
|
|
2004
2004
|
'marginRatio': undefined,
|
|
2005
2005
|
'id': undefined,
|
|
2006
|
-
'unrealizedPnl': undefined,
|
|
2007
2006
|
'hedged': undefined,
|
|
2008
2007
|
'stopLossPrice': undefined,
|
|
2009
2008
|
'takeProfitPrice': undefined,
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -7642,7 +7642,7 @@ class htx extends htx$1 {
|
|
|
7642
7642
|
'entryPrice': entryPrice,
|
|
7643
7643
|
'collateral': this.parseNumber(collateral),
|
|
7644
7644
|
'side': side,
|
|
7645
|
-
'
|
|
7645
|
+
'unrealizedPnl': unrealizedProfit,
|
|
7646
7646
|
'leverage': this.parseNumber(leverage),
|
|
7647
7647
|
'percentage': this.parseNumber(percentage),
|
|
7648
7648
|
'marginMode': marginMode,
|