ccxt 4.4.43 → 4.4.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +15 -15
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +55 -43
- package/dist/cjs/src/bingx.js +5 -0
- package/dist/cjs/src/bitfinex.js +6 -2
- package/dist/cjs/src/bitget.js +3 -1
- package/dist/cjs/src/bitmart.js +4 -7
- package/dist/cjs/src/bitmex.js +3 -5
- package/dist/cjs/src/bitstamp.js +5 -0
- package/dist/cjs/src/bybit.js +7 -22
- package/dist/cjs/src/coinbase.js +13 -9
- package/dist/cjs/src/coinbaseinternational.js +13 -9
- package/dist/cjs/src/coincatch.js +2 -2
- package/dist/cjs/src/coinex.js +5 -5
- package/dist/cjs/src/cryptocom.js +3 -1
- package/dist/cjs/src/defx.js +2 -2
- package/dist/cjs/src/delta.js +1 -1
- package/dist/cjs/src/gate.js +7 -2
- package/dist/cjs/src/gemini.js +5 -0
- package/dist/cjs/src/hashkey.js +9 -9
- package/dist/cjs/src/htx.js +105 -2
- package/dist/cjs/src/hyperliquid.js +5 -0
- package/dist/cjs/src/kraken.js +9 -2
- package/dist/cjs/src/krakenfutures.js +5 -0
- package/dist/cjs/src/kucoin.js +9 -7
- package/dist/cjs/src/kucoinfutures.js +5 -5
- package/dist/cjs/src/mexc.js +16 -10
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/oceanex.js +1 -1
- package/dist/cjs/src/okx.js +4 -5
- package/dist/cjs/src/pro/bitcoincom.js +4 -1
- package/dist/cjs/src/pro/bitopro.js +1 -1
- package/dist/cjs/src/whitebit.js +4 -2
- package/dist/cjs/src/woo.js +5 -3
- package/dist/cjs/src/woofipro.js +5 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/binance.d.ts +33 -32
- package/js/src/binance.js +55 -43
- package/js/src/bingx.js +5 -0
- package/js/src/bitfinex.js +6 -2
- package/js/src/bitget.js +3 -1
- package/js/src/bitmart.js +4 -7
- package/js/src/bitmex.js +3 -5
- package/js/src/bitstamp.js +5 -0
- package/js/src/bybit.js +7 -22
- package/js/src/coinbase.js +13 -9
- package/js/src/coinbaseinternational.js +13 -9
- package/js/src/coincatch.js +2 -2
- package/js/src/coinex.js +5 -5
- package/js/src/cryptocom.js +3 -1
- package/js/src/defx.js +2 -2
- package/js/src/delta.js +1 -1
- package/js/src/gate.js +7 -2
- package/js/src/gemini.js +5 -0
- package/js/src/hashkey.js +9 -9
- package/js/src/htx.d.ts +13 -1
- package/js/src/htx.js +105 -2
- package/js/src/hyperliquid.js +5 -0
- package/js/src/kraken.js +9 -2
- package/js/src/krakenfutures.js +5 -0
- package/js/src/kucoin.js +9 -7
- package/js/src/kucoinfutures.js +5 -5
- package/js/src/mexc.js +16 -10
- package/js/src/ndax.js +1 -1
- package/js/src/oceanex.js +1 -1
- package/js/src/okx.js +4 -5
- package/js/src/pro/bitcoincom.js +4 -1
- package/js/src/pro/bitopro.js +1 -1
- package/js/src/whitebit.js +4 -2
- package/js/src/woo.js +5 -3
- package/js/src/woofipro.js +5 -2
- package/package.json +1 -1
package/js/src/coinex.js
CHANGED
|
@@ -522,11 +522,11 @@ export default class coinex extends Exchange {
|
|
|
522
522
|
},
|
|
523
523
|
'hedged': false,
|
|
524
524
|
'trailing': false,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
525
|
+
'leverage': false,
|
|
526
|
+
'marketBuyByCost': true,
|
|
527
|
+
'marketBuyRequiresPrice': true,
|
|
528
|
+
'selfTradePrevention': true,
|
|
529
|
+
'iceberg': true, // todo implement
|
|
530
530
|
},
|
|
531
531
|
'createOrders': {
|
|
532
532
|
'max': 5,
|
package/js/src/cryptocom.js
CHANGED
|
@@ -374,10 +374,12 @@ export default class cryptocom extends Exchange {
|
|
|
374
374
|
'GTD': false,
|
|
375
375
|
},
|
|
376
376
|
'hedged': false,
|
|
377
|
-
// exchange-supported features
|
|
378
377
|
'selfTradePrevention': true,
|
|
379
378
|
'trailing': false,
|
|
380
379
|
'iceberg': false,
|
|
380
|
+
'leverage': false,
|
|
381
|
+
'marketBuyByCost': true,
|
|
382
|
+
'marketBuyRequiresPrice': true,
|
|
381
383
|
},
|
|
382
384
|
'createOrders': {
|
|
383
385
|
'max': 10,
|
package/js/src/defx.js
CHANGED
|
@@ -937,10 +937,10 @@ export default class defx extends Exchange {
|
|
|
937
937
|
const id = this.safeString(trade, 'id');
|
|
938
938
|
const oid = this.safeString(trade, 'orderId');
|
|
939
939
|
const takerOrMaker = this.safeStringLower(trade, 'role');
|
|
940
|
-
const buyerMaker = this.
|
|
940
|
+
const buyerMaker = this.safeBool(trade, 'buyerMaker');
|
|
941
941
|
let side = this.safeStringLower(trade, 'side');
|
|
942
942
|
if (buyerMaker !== undefined) {
|
|
943
|
-
if (buyerMaker
|
|
943
|
+
if (buyerMaker) {
|
|
944
944
|
side = 'sell';
|
|
945
945
|
}
|
|
946
946
|
else {
|
package/js/src/delta.js
CHANGED
|
@@ -742,7 +742,7 @@ export default class delta extends Exchange {
|
|
|
742
742
|
// other markets (swap, futures, move, spread, irs) seem to use the step of '1' contract
|
|
743
743
|
amountPrecision = this.parseNumber('1');
|
|
744
744
|
}
|
|
745
|
-
const linear = (settle ===
|
|
745
|
+
const linear = (settle === quote);
|
|
746
746
|
let optionType = undefined;
|
|
747
747
|
let symbol = base + '/' + quote;
|
|
748
748
|
if (swap || future || option) {
|
package/js/src/gate.js
CHANGED
|
@@ -708,7 +708,7 @@ export default class gate extends Exchange {
|
|
|
708
708
|
},
|
|
709
709
|
},
|
|
710
710
|
'features': {
|
|
711
|
-
'
|
|
711
|
+
'default': {
|
|
712
712
|
'sandbox': true,
|
|
713
713
|
'createOrder': {
|
|
714
714
|
'marginMode': true,
|
|
@@ -727,9 +727,11 @@ export default class gate extends Exchange {
|
|
|
727
727
|
},
|
|
728
728
|
'hedged': false,
|
|
729
729
|
'trailing': false,
|
|
730
|
-
// exchange-specific features
|
|
731
730
|
'iceberg': true,
|
|
732
731
|
'selfTradePrevention': true,
|
|
732
|
+
'leverage': false,
|
|
733
|
+
'marketBuyByCost': true,
|
|
734
|
+
'marketBuyRequiresPrice': true,
|
|
733
735
|
},
|
|
734
736
|
'createOrders': {
|
|
735
737
|
'max': 40, // NOTE! max 10 per symbol
|
|
@@ -765,6 +767,9 @@ export default class gate extends Exchange {
|
|
|
765
767
|
'limit': 1000,
|
|
766
768
|
},
|
|
767
769
|
},
|
|
770
|
+
'spot': {
|
|
771
|
+
'extends': 'default',
|
|
772
|
+
},
|
|
768
773
|
'forDerivatives': {
|
|
769
774
|
'extends': 'spot',
|
|
770
775
|
'createOrder': {
|
package/js/src/gemini.js
CHANGED
|
@@ -318,6 +318,11 @@ export default class gemini extends Exchange {
|
|
|
318
318
|
},
|
|
319
319
|
'hedged': false,
|
|
320
320
|
'trailing': false,
|
|
321
|
+
'leverage': false,
|
|
322
|
+
'marketBuyByCost': true,
|
|
323
|
+
'marketBuyRequiresPrice': false,
|
|
324
|
+
'selfTradePrevention': false,
|
|
325
|
+
'iceberg': false,
|
|
321
326
|
},
|
|
322
327
|
'createOrders': undefined,
|
|
323
328
|
'fetchMyTrades': {
|
package/js/src/hashkey.js
CHANGED
|
@@ -358,13 +358,11 @@ export default class hashkey extends Exchange {
|
|
|
358
358
|
},
|
|
359
359
|
'hedged': false,
|
|
360
360
|
'trailing': false,
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
// 'iceberg': false,
|
|
367
|
-
// 'oco': false,
|
|
361
|
+
'leverage': false,
|
|
362
|
+
'marketBuyByCost': true,
|
|
363
|
+
'marketBuyRequiresPrice': true,
|
|
364
|
+
'selfTradePrevention': true,
|
|
365
|
+
'iceberg': false,
|
|
368
366
|
},
|
|
369
367
|
'createOrders': {
|
|
370
368
|
'max': 20,
|
|
@@ -2440,8 +2438,10 @@ export default class hashkey extends Exchange {
|
|
|
2440
2438
|
if (!market['spot']) {
|
|
2441
2439
|
throw new NotSupported(this.id + ' createMarketBuyOrderWithCost() is supported for spot markets only');
|
|
2442
2440
|
}
|
|
2443
|
-
|
|
2444
|
-
|
|
2441
|
+
const req = {
|
|
2442
|
+
'cost': cost,
|
|
2443
|
+
};
|
|
2444
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, this.extend(req, params));
|
|
2445
2445
|
}
|
|
2446
2446
|
/**
|
|
2447
2447
|
* @method
|
package/js/src/htx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/htx.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, FundingRateHistory, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, OrderRequest, Strings, Market, Currency, Num, Account, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, LeverageTiers, LeverageTier, int, LedgerEntry, FundingRate, FundingRates, DepositAddress, BorrowInterest } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, FundingRateHistory, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, OrderRequest, Strings, Market, Currency, Num, Account, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, LeverageTiers, LeverageTier, int, LedgerEntry, FundingRate, FundingRates, DepositAddress, BorrowInterest, OpenInterests } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class huobi
|
|
5
5
|
* @augments Exchange
|
|
@@ -789,6 +789,18 @@ export default class htx extends Exchange {
|
|
|
789
789
|
* @returns {object} an array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
790
790
|
*/
|
|
791
791
|
fetchOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").OpenInterest[]>;
|
|
792
|
+
/**
|
|
793
|
+
* @method
|
|
794
|
+
* @name htx#fetchOpenInterests
|
|
795
|
+
* @description Retrieves the open interest for a list of symbols
|
|
796
|
+
* @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
|
|
797
|
+
* @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
|
|
798
|
+
* @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
|
|
799
|
+
* @param {string[]} [symbols] a list of unified CCXT market symbols
|
|
800
|
+
* @param {object} [params] exchange specific parameters
|
|
801
|
+
* @returns {object[]} a list of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
802
|
+
*/
|
|
803
|
+
fetchOpenInterests(symbols?: Strings, params?: {}): Promise<OpenInterests>;
|
|
792
804
|
/**
|
|
793
805
|
* @method
|
|
794
806
|
* @name htx#fetchOpenInterest
|
package/js/src/htx.js
CHANGED
|
@@ -99,6 +99,7 @@ export default class htx extends Exchange {
|
|
|
99
99
|
'fetchOHLCV': true,
|
|
100
100
|
'fetchOpenInterest': true,
|
|
101
101
|
'fetchOpenInterestHistory': true,
|
|
102
|
+
'fetchOpenInterests': true,
|
|
102
103
|
'fetchOpenOrder': undefined,
|
|
103
104
|
'fetchOpenOrders': true,
|
|
104
105
|
'fetchOrder': true,
|
|
@@ -1254,9 +1255,11 @@ export default class htx extends Exchange {
|
|
|
1254
1255
|
},
|
|
1255
1256
|
'hedged': false,
|
|
1256
1257
|
'trailing': false,
|
|
1257
|
-
// exchange-specific features
|
|
1258
1258
|
'iceberg': false,
|
|
1259
1259
|
'selfTradePrevention': true,
|
|
1260
|
+
'leverage': true,
|
|
1261
|
+
'marketBuyByCost': true,
|
|
1262
|
+
'marketBuyRequiresPrice': true,
|
|
1260
1263
|
},
|
|
1261
1264
|
'createOrders': {
|
|
1262
1265
|
'max': 10,
|
|
@@ -8643,6 +8646,105 @@ export default class htx extends Exchange {
|
|
|
8643
8646
|
const tick = this.safeList(data, 'tick');
|
|
8644
8647
|
return this.parseOpenInterestsHistory(tick, market, since, limit);
|
|
8645
8648
|
}
|
|
8649
|
+
/**
|
|
8650
|
+
* @method
|
|
8651
|
+
* @name htx#fetchOpenInterests
|
|
8652
|
+
* @description Retrieves the open interest for a list of symbols
|
|
8653
|
+
* @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
|
|
8654
|
+
* @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
|
|
8655
|
+
* @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
|
|
8656
|
+
* @param {string[]} [symbols] a list of unified CCXT market symbols
|
|
8657
|
+
* @param {object} [params] exchange specific parameters
|
|
8658
|
+
* @returns {object[]} a list of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
8659
|
+
*/
|
|
8660
|
+
async fetchOpenInterests(symbols = undefined, params = {}) {
|
|
8661
|
+
await this.loadMarkets();
|
|
8662
|
+
symbols = this.marketSymbols(symbols);
|
|
8663
|
+
let market = undefined;
|
|
8664
|
+
if (symbols !== undefined) {
|
|
8665
|
+
const symbolsLength = symbols.length;
|
|
8666
|
+
if (symbolsLength > 0) {
|
|
8667
|
+
const first = this.safeString(symbols, 0);
|
|
8668
|
+
market = this.market(first);
|
|
8669
|
+
}
|
|
8670
|
+
}
|
|
8671
|
+
const request = {};
|
|
8672
|
+
let subType = undefined;
|
|
8673
|
+
[subType, params] = this.handleSubTypeAndParams('fetchPositions', market, params, 'linear');
|
|
8674
|
+
let marketType = undefined;
|
|
8675
|
+
[marketType, params] = this.handleMarketTypeAndParams('fetchPositions', market, params);
|
|
8676
|
+
let response = undefined;
|
|
8677
|
+
if (marketType === 'future') {
|
|
8678
|
+
response = await this.contractPublicGetApiV1ContractOpenInterest(this.extend(request, params));
|
|
8679
|
+
//
|
|
8680
|
+
// {
|
|
8681
|
+
// "status": "ok",
|
|
8682
|
+
// "data": [
|
|
8683
|
+
// {
|
|
8684
|
+
// "volume": 118850.000000000000000000,
|
|
8685
|
+
// "amount": 635.502025211544374189,
|
|
8686
|
+
// "symbol": "BTC",
|
|
8687
|
+
// "contract_type": "this_week",
|
|
8688
|
+
// "contract_code": "BTC220930",
|
|
8689
|
+
// "trade_amount": 1470.9400749347598691119206024033947897351,
|
|
8690
|
+
// "trade_volume": 286286,
|
|
8691
|
+
// "trade_turnover": 28628600.000000000000000000
|
|
8692
|
+
// }
|
|
8693
|
+
// ],
|
|
8694
|
+
// "ts": 1664337928805
|
|
8695
|
+
// }
|
|
8696
|
+
//
|
|
8697
|
+
}
|
|
8698
|
+
else if (subType === 'inverse') {
|
|
8699
|
+
response = await this.contractPublicGetSwapApiV1SwapOpenInterest(this.extend(request, params));
|
|
8700
|
+
//
|
|
8701
|
+
// {
|
|
8702
|
+
// "status": "ok",
|
|
8703
|
+
// "data": [
|
|
8704
|
+
// {
|
|
8705
|
+
// "volume": 518018.000000000000000000,
|
|
8706
|
+
// "amount": 2769.675777407074725180,
|
|
8707
|
+
// "symbol": "BTC",
|
|
8708
|
+
// "contract_code": "BTC-USD",
|
|
8709
|
+
// "trade_amount": 9544.4032080046491323463688602729806842458,
|
|
8710
|
+
// "trade_volume": 1848448,
|
|
8711
|
+
// "trade_turnover": 184844800.000000000000000000
|
|
8712
|
+
// }
|
|
8713
|
+
// ],
|
|
8714
|
+
// "ts": 1664337226028
|
|
8715
|
+
// }
|
|
8716
|
+
//
|
|
8717
|
+
}
|
|
8718
|
+
else {
|
|
8719
|
+
request['contract_type'] = 'swap';
|
|
8720
|
+
response = await this.contractPublicGetLinearSwapApiV1SwapOpenInterest(this.extend(request, params));
|
|
8721
|
+
//
|
|
8722
|
+
// {
|
|
8723
|
+
// "status": "ok",
|
|
8724
|
+
// "data": [
|
|
8725
|
+
// {
|
|
8726
|
+
// "volume": 7192610.000000000000000000,
|
|
8727
|
+
// "amount": 7192.610000000000000000,
|
|
8728
|
+
// "symbol": "BTC",
|
|
8729
|
+
// "value": 134654290.332000000000000000,
|
|
8730
|
+
// "contract_code": "BTC-USDT",
|
|
8731
|
+
// "trade_amount": 70692.804,
|
|
8732
|
+
// "trade_volume": 70692804,
|
|
8733
|
+
// "trade_turnover": 1379302592.9518,
|
|
8734
|
+
// "business_type": "swap",
|
|
8735
|
+
// "pair": "BTC-USDT",
|
|
8736
|
+
// "contract_type": "swap",
|
|
8737
|
+
// "trade_partition": "USDT"
|
|
8738
|
+
// }
|
|
8739
|
+
// ],
|
|
8740
|
+
// "ts": 1664336503144
|
|
8741
|
+
// }
|
|
8742
|
+
//
|
|
8743
|
+
}
|
|
8744
|
+
const data = this.safeList(response, 'data', []);
|
|
8745
|
+
const result = this.parseOpenInterests(data);
|
|
8746
|
+
return this.filterByArray(result, 'symbol', symbols);
|
|
8747
|
+
}
|
|
8646
8748
|
/**
|
|
8647
8749
|
* @method
|
|
8648
8750
|
* @name htx#fetchOpenInterest
|
|
@@ -8806,8 +8908,9 @@ export default class htx extends Exchange {
|
|
|
8806
8908
|
const timestamp = this.safeInteger(interest, 'ts');
|
|
8807
8909
|
const amount = this.safeNumber(interest, 'volume');
|
|
8808
8910
|
const value = this.safeNumber(interest, 'value');
|
|
8911
|
+
const marketId = this.safeString(interest, 'contract_code');
|
|
8809
8912
|
return this.safeOpenInterest({
|
|
8810
|
-
'symbol': this.
|
|
8913
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
8811
8914
|
'baseVolume': amount,
|
|
8812
8915
|
'quoteVolume': value,
|
|
8813
8916
|
'openInterestAmount': amount,
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -238,6 +238,11 @@ export default class hyperliquid extends Exchange {
|
|
|
238
238
|
},
|
|
239
239
|
'hedged': false,
|
|
240
240
|
'trailing': false,
|
|
241
|
+
'leverage': false,
|
|
242
|
+
'marketBuyByCost': false,
|
|
243
|
+
'marketBuyRequiresPrice': false,
|
|
244
|
+
'selfTradePrevention': false,
|
|
245
|
+
'iceberg': false,
|
|
241
246
|
},
|
|
242
247
|
'createOrders': {
|
|
243
248
|
'max': 1000,
|
package/js/src/kraken.js
CHANGED
|
@@ -449,6 +449,11 @@ export default class kraken extends Exchange {
|
|
|
449
449
|
},
|
|
450
450
|
'hedged': false,
|
|
451
451
|
'trailing': true,
|
|
452
|
+
'leverage': false,
|
|
453
|
+
'marketBuyByCost': true,
|
|
454
|
+
'marketBuyRequiresPrice': false,
|
|
455
|
+
'selfTradePrevention': true,
|
|
456
|
+
'iceberg': true, // todo implement
|
|
452
457
|
},
|
|
453
458
|
'createOrders': undefined,
|
|
454
459
|
'fetchMyTrades': {
|
|
@@ -1511,8 +1516,10 @@ export default class kraken extends Exchange {
|
|
|
1511
1516
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
1512
1517
|
await this.loadMarkets();
|
|
1513
1518
|
// only buy orders are supported by the endpoint
|
|
1514
|
-
|
|
1515
|
-
|
|
1519
|
+
const req = {
|
|
1520
|
+
'cost': cost,
|
|
1521
|
+
};
|
|
1522
|
+
return await this.createOrder(symbol, 'market', side, 1, undefined, this.extend(req, params));
|
|
1516
1523
|
}
|
|
1517
1524
|
/**
|
|
1518
1525
|
* @method
|
package/js/src/krakenfutures.js
CHANGED
|
@@ -287,6 +287,11 @@ export default class krakenfutures extends Exchange {
|
|
|
287
287
|
},
|
|
288
288
|
'hedged': false,
|
|
289
289
|
'trailing': false,
|
|
290
|
+
'leverage': false,
|
|
291
|
+
'marketBuyByCost': false,
|
|
292
|
+
'marketBuyRequiresPrice': false,
|
|
293
|
+
'selfTradePrevention': false,
|
|
294
|
+
'iceberg': false,
|
|
290
295
|
},
|
|
291
296
|
'createOrders': {
|
|
292
297
|
'max': 100,
|
package/js/src/kucoin.js
CHANGED
|
@@ -1009,11 +1009,11 @@ export default class kucoin extends Exchange {
|
|
|
1009
1009
|
},
|
|
1010
1010
|
'hedged': false,
|
|
1011
1011
|
'trailing': false,
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1012
|
+
'leverage': false,
|
|
1013
|
+
'marketBuyByCost': true,
|
|
1014
|
+
'marketBuyRequiresPrice': false,
|
|
1015
|
+
'selfTradePrevention': true,
|
|
1016
|
+
'iceberg': true, // todo implement
|
|
1017
1017
|
},
|
|
1018
1018
|
'createOrders': {
|
|
1019
1019
|
'max': 5,
|
|
@@ -2318,8 +2318,10 @@ export default class kucoin extends Exchange {
|
|
|
2318
2318
|
*/
|
|
2319
2319
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
2320
2320
|
await this.loadMarkets();
|
|
2321
|
-
|
|
2322
|
-
|
|
2321
|
+
const req = {
|
|
2322
|
+
'cost': cost,
|
|
2323
|
+
};
|
|
2324
|
+
return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
|
|
2323
2325
|
}
|
|
2324
2326
|
/**
|
|
2325
2327
|
* @method
|
package/js/src/kucoinfutures.js
CHANGED
|
@@ -388,11 +388,11 @@ export default class kucoinfutures extends kucoin {
|
|
|
388
388
|
},
|
|
389
389
|
'hedged': false,
|
|
390
390
|
'trailing': false,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
391
|
+
'leverage': true,
|
|
392
|
+
'marketBuyByCost': true,
|
|
393
|
+
'marketBuyRequiresPrice': false,
|
|
394
|
+
'selfTradePrevention': true,
|
|
395
|
+
'iceberg': true,
|
|
396
396
|
},
|
|
397
397
|
'createOrders': {
|
|
398
398
|
'max': 20,
|
package/js/src/mexc.js
CHANGED
|
@@ -698,10 +698,12 @@ export default class mexc extends Exchange {
|
|
|
698
698
|
'PO': true,
|
|
699
699
|
'GTD': false,
|
|
700
700
|
},
|
|
701
|
-
'hedged':
|
|
702
|
-
// exchange-supported features
|
|
703
|
-
'selfTradePrevention': false,
|
|
701
|
+
'hedged': true,
|
|
704
702
|
'trailing': false,
|
|
703
|
+
'leverage': true,
|
|
704
|
+
'marketBuyByCost': true,
|
|
705
|
+
'marketBuyRequiresPrice': false,
|
|
706
|
+
'selfTradePrevention': false,
|
|
705
707
|
'iceberg': false,
|
|
706
708
|
},
|
|
707
709
|
'createOrders': {
|
|
@@ -761,10 +763,10 @@ export default class mexc extends Exchange {
|
|
|
761
763
|
'stopLossPrice': false,
|
|
762
764
|
'takeProfitPrice': false,
|
|
763
765
|
'hedged': true,
|
|
766
|
+
'leverage': true,
|
|
767
|
+
'marketBuyByCost': false,
|
|
764
768
|
},
|
|
765
|
-
'createOrders':
|
|
766
|
-
'max': 50,
|
|
767
|
-
},
|
|
769
|
+
'createOrders': undefined,
|
|
768
770
|
'fetchMyTrades': {
|
|
769
771
|
'marginMode': false,
|
|
770
772
|
'limit': 100,
|
|
@@ -2251,8 +2253,10 @@ export default class mexc extends Exchange {
|
|
|
2251
2253
|
if (!market['spot']) {
|
|
2252
2254
|
throw new NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
|
|
2253
2255
|
}
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
+
const req = {
|
|
2257
|
+
'cost': cost,
|
|
2258
|
+
};
|
|
2259
|
+
return await this.createOrder(symbol, 'market', 'buy', 0, undefined, this.extend(req, params));
|
|
2256
2260
|
}
|
|
2257
2261
|
/**
|
|
2258
2262
|
* @method
|
|
@@ -2270,8 +2274,10 @@ export default class mexc extends Exchange {
|
|
|
2270
2274
|
if (!market['spot']) {
|
|
2271
2275
|
throw new NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
|
|
2272
2276
|
}
|
|
2273
|
-
|
|
2274
|
-
|
|
2277
|
+
const req = {
|
|
2278
|
+
'cost': cost,
|
|
2279
|
+
};
|
|
2280
|
+
return await this.createOrder(symbol, 'market', 'sell', 0, undefined, this.extend(req, params));
|
|
2275
2281
|
}
|
|
2276
2282
|
/**
|
|
2277
2283
|
* @method
|
package/js/src/ndax.js
CHANGED
package/js/src/oceanex.js
CHANGED
package/js/src/okx.js
CHANGED
|
@@ -1183,7 +1183,6 @@ export default class okx extends Exchange {
|
|
|
1183
1183
|
'brokerId': 'e847386590ce4dBC',
|
|
1184
1184
|
},
|
|
1185
1185
|
'features': {
|
|
1186
|
-
// https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
|
1187
1186
|
'default': {
|
|
1188
1187
|
'sandbox': true,
|
|
1189
1188
|
'createOrder': {
|
|
@@ -1212,12 +1211,12 @@ export default class okx extends Exchange {
|
|
|
1212
1211
|
'GTD': false,
|
|
1213
1212
|
},
|
|
1214
1213
|
'hedged': true,
|
|
1215
|
-
// even though the below params not unified yet, it's useful metadata for users to know that exchange supports them
|
|
1216
|
-
'selfTradePrevention': true,
|
|
1217
1214
|
'trailing': true,
|
|
1218
|
-
'twap': true,
|
|
1219
1215
|
'iceberg': true,
|
|
1220
|
-
'
|
|
1216
|
+
'leverage': false,
|
|
1217
|
+
'selfTradePrevention': true,
|
|
1218
|
+
'marketBuyByCost': true,
|
|
1219
|
+
'marketBuyRequiresPrice': false,
|
|
1221
1220
|
},
|
|
1222
1221
|
'createOrders': {
|
|
1223
1222
|
'max': 20,
|
package/js/src/pro/bitcoincom.js
CHANGED
|
@@ -20,7 +20,10 @@ export default class bitcoincom extends hitbtc {
|
|
|
20
20
|
'urls': {
|
|
21
21
|
'logo': 'https://user-images.githubusercontent.com/1294454/97296144-514fa300-1861-11eb-952b-3d55d492200b.jpg',
|
|
22
22
|
'api': {
|
|
23
|
-
'ws':
|
|
23
|
+
'ws': {
|
|
24
|
+
'public': 'wss://api.fmfw.io/api/3/ws/public',
|
|
25
|
+
'private': 'wss://api.fmfw.io/api/3/ws/trading',
|
|
26
|
+
},
|
|
24
27
|
},
|
|
25
28
|
},
|
|
26
29
|
'fees': {
|
package/js/src/pro/bitopro.js
CHANGED
|
@@ -77,7 +77,7 @@ export default class bitopro extends bitoproRest {
|
|
|
77
77
|
endPart = market['id'];
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
endPart = market['id'] + ':' + limit;
|
|
80
|
+
endPart = market['id'] + ':' + this.numberToString(limit);
|
|
81
81
|
}
|
|
82
82
|
const orderbook = await this.watchPublic('order-books', messageHash, endPart);
|
|
83
83
|
return orderbook.limit();
|
package/js/src/whitebit.js
CHANGED
|
@@ -1231,9 +1231,11 @@ export default class whitebit extends Exchange {
|
|
|
1231
1231
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1232
1232
|
*/
|
|
1233
1233
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
1234
|
-
|
|
1234
|
+
const req = {
|
|
1235
|
+
'cost': cost,
|
|
1236
|
+
};
|
|
1235
1237
|
// only buy side is supported
|
|
1236
|
-
return await this.createOrder(symbol, 'market', side, 0, undefined, params);
|
|
1238
|
+
return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
|
|
1237
1239
|
}
|
|
1238
1240
|
/**
|
|
1239
1241
|
* @method
|
package/js/src/woo.js
CHANGED
|
@@ -336,9 +336,11 @@ export default class woo extends Exchange {
|
|
|
336
336
|
},
|
|
337
337
|
'hedged': false,
|
|
338
338
|
'trailing': true,
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
339
|
+
'leverage': false,
|
|
340
|
+
'marketBuyByCost': true,
|
|
341
|
+
'marketBuyRequiresPrice': false,
|
|
342
|
+
'selfTradePrevention': false,
|
|
343
|
+
'iceberg': true, // todo implement
|
|
342
344
|
},
|
|
343
345
|
'createOrders': undefined,
|
|
344
346
|
'fetchMyTrades': {
|
package/js/src/woofipro.js
CHANGED
|
@@ -323,8 +323,11 @@ export default class woofipro extends Exchange {
|
|
|
323
323
|
},
|
|
324
324
|
'hedged': false,
|
|
325
325
|
'trailing': true,
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
'leverage': true,
|
|
327
|
+
'marketBuyByCost': false,
|
|
328
|
+
'marketBuyRequiresPrice': false,
|
|
329
|
+
'selfTradePrevention': false,
|
|
330
|
+
'iceberg': true, // todo implement
|
|
328
331
|
},
|
|
329
332
|
'createOrders': {
|
|
330
333
|
'max': 10,
|
package/package.json
CHANGED