ccxt 4.4.90 → 4.4.92

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.
Files changed (71) hide show
  1. package/README.md +5 -6
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -4
  4. package/dist/cjs/src/base/Exchange.js +23 -33
  5. package/dist/cjs/src/base/ws/Client.js +4 -34
  6. package/dist/cjs/src/binance.js +1 -1
  7. package/dist/cjs/src/bitmart.js +7 -0
  8. package/dist/cjs/src/bitmex.js +2 -1
  9. package/dist/cjs/src/bitvavo.js +10 -1
  10. package/dist/cjs/src/cex.js +61 -0
  11. package/dist/cjs/src/cryptocom.js +21 -2
  12. package/dist/cjs/src/cryptomus.js +1 -1
  13. package/dist/cjs/src/exmo.js +25 -10
  14. package/dist/cjs/src/fmfwio.js +1 -1
  15. package/dist/cjs/src/gate.js +2 -2
  16. package/dist/cjs/src/htx.js +1 -1
  17. package/dist/cjs/src/hyperliquid.js +115 -59
  18. package/dist/cjs/src/kraken.js +29 -1
  19. package/dist/cjs/src/krakenfutures.js +1 -1
  20. package/dist/cjs/src/lbank.js +116 -32
  21. package/dist/cjs/src/mexc.js +1 -0
  22. package/dist/cjs/src/modetrade.js +2 -2
  23. package/dist/cjs/src/okx.js +2 -2
  24. package/dist/cjs/src/paradex.js +1 -1
  25. package/dist/cjs/src/pro/bitstamp.js +1 -1
  26. package/dist/cjs/src/pro/bybit.js +10 -149
  27. package/dist/cjs/src/pro/kraken.js +251 -264
  28. package/dist/cjs/src/pro/mexc.js +0 -1
  29. package/js/ccxt.d.ts +2 -5
  30. package/js/ccxt.js +2 -4
  31. package/js/src/abstract/lbank.d.ts +1 -0
  32. package/js/src/base/Exchange.d.ts +4 -1
  33. package/js/src/base/Exchange.js +24 -34
  34. package/js/src/base/ws/Client.d.ts +0 -2
  35. package/js/src/base/ws/Client.js +4 -34
  36. package/js/src/binance.js +1 -1
  37. package/js/src/bitmart.d.ts +7 -0
  38. package/js/src/bitmart.js +7 -0
  39. package/js/src/bitmex.js +2 -1
  40. package/js/src/bitvavo.js +10 -1
  41. package/js/src/cex.js +61 -0
  42. package/js/src/cryptocom.js +21 -2
  43. package/js/src/cryptomus.js +1 -1
  44. package/js/src/exmo.js +25 -10
  45. package/js/src/fmfwio.js +2 -2
  46. package/js/src/gate.js +2 -2
  47. package/js/src/htx.js +1 -1
  48. package/js/src/hyperliquid.d.ts +1 -0
  49. package/js/src/hyperliquid.js +115 -59
  50. package/js/src/kraken.js +29 -1
  51. package/js/src/krakenfutures.js +1 -1
  52. package/js/src/lbank.d.ts +9 -1
  53. package/js/src/lbank.js +116 -32
  54. package/js/src/mexc.js +1 -0
  55. package/js/src/modetrade.js +2 -2
  56. package/js/src/okx.d.ts +1 -1
  57. package/js/src/okx.js +2 -2
  58. package/js/src/p2b.d.ts +1 -2
  59. package/js/src/paradex.js +1 -1
  60. package/js/src/pro/bitstamp.js +1 -1
  61. package/js/src/pro/bybit.d.ts +0 -1
  62. package/js/src/pro/bybit.js +11 -150
  63. package/js/src/pro/kraken.d.ts +17 -17
  64. package/js/src/pro/kraken.js +251 -264
  65. package/js/src/pro/mexc.js +0 -1
  66. package/js/src/tradeogre.d.ts +1 -2
  67. package/package.json +1 -1
  68. package/js/src/abstract/coinlist.d.ts +0 -60
  69. package/js/src/abstract/coinlist.js +0 -11
  70. package/js/src/coinlist.d.ts +0 -384
  71. package/js/src/coinlist.js +0 -2610
@@ -1108,7 +1108,6 @@ class mexc extends mexc$1 {
1108
1108
  */
1109
1109
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1110
1110
  await this.loadMarkets();
1111
- params = this.omit(params, 'type');
1112
1111
  let messageHash = 'orders';
1113
1112
  let market = undefined;
1114
1113
  if (symbol !== undefined) {
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.4.89";
7
+ declare const version = "4.4.91";
8
8
  import alpaca from './src/alpaca.js';
9
9
  import apex from './src/apex.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -46,7 +46,6 @@ import coinbaseinternational from './src/coinbaseinternational.js';
46
46
  import coincatch from './src/coincatch.js';
47
47
  import coincheck from './src/coincheck.js';
48
48
  import coinex from './src/coinex.js';
49
- import coinlist from './src/coinlist.js';
50
49
  import coinmate from './src/coinmate.js';
51
50
  import coinmetro from './src/coinmetro.js';
52
51
  import coinone from './src/coinone.js';
@@ -226,7 +225,6 @@ declare const exchanges: {
226
225
  coincatch: typeof coincatch;
227
226
  coincheck: typeof coincheck;
228
227
  coinex: typeof coinex;
229
- coinlist: typeof coinlist;
230
228
  coinmate: typeof coinmate;
231
229
  coinmetro: typeof coinmetro;
232
230
  coinone: typeof coinone;
@@ -489,7 +487,6 @@ declare const ccxt: {
489
487
  coincatch: typeof coincatch;
490
488
  coincheck: typeof coincheck;
491
489
  coinex: typeof coinex;
492
- coinlist: typeof coinlist;
493
490
  coinmate: typeof coinmate;
494
491
  coinmetro: typeof coinmetro;
495
492
  coinone: typeof coinone;
@@ -555,5 +552,5 @@ declare const ccxt: {
555
552
  zaif: typeof zaif;
556
553
  zonda: typeof zonda;
557
554
  } & typeof functions & typeof errors;
558
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
555
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, ConstructorArgs, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketMarginModes, MarketInterface, Trade, Order, OrderBook, OrderBooks, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, OpenInterests, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, LongShortRatio, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
559
556
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.4.89';
41
+ const version = '4.4.91';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import alpaca from './src/alpaca.js';
@@ -82,7 +82,6 @@ import coinbaseinternational from './src/coinbaseinternational.js';
82
82
  import coincatch from './src/coincatch.js';
83
83
  import coincheck from './src/coincheck.js';
84
84
  import coinex from './src/coinex.js';
85
- import coinlist from './src/coinlist.js';
86
85
  import coinmate from './src/coinmate.js';
87
86
  import coinmetro from './src/coinmetro.js';
88
87
  import coinone from './src/coinone.js';
@@ -263,7 +262,6 @@ const exchanges = {
263
262
  'coincatch': coincatch,
264
263
  'coincheck': coincheck,
265
264
  'coinex': coinex,
266
- 'coinlist': coinlist,
267
265
  'coinmate': coinmate,
268
266
  'coinmetro': coinmetro,
269
267
  'coinone': coinone,
@@ -416,6 +414,6 @@ pro.exchanges = Object.keys(pro);
416
414
  pro['Exchange'] = Exchange; // now the same for rest and ts
417
415
  //-----------------------------------------------------------------------------
418
416
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
419
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
417
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, alpaca, apex, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbns, bitfinex, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitrue, bitso, bitstamp, bitteam, bittrade, bitvavo, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, defx, delta, deribit, derive, digifinex, ellipx, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, luno, mercado, mexc, modetrade, myokx, ndax, novadax, oceanex, okcoin, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
420
418
  export default ccxt;
421
419
  //-----------------------------------------------------------------------------
@@ -4,6 +4,7 @@ interface Exchange {
4
4
  spotPublicGetCurrencyPairs(params?: {}): Promise<implicitReturnType>;
5
5
  spotPublicGetAccuracy(params?: {}): Promise<implicitReturnType>;
6
6
  spotPublicGetUsdToCny(params?: {}): Promise<implicitReturnType>;
7
+ spotPublicGetAssetConfigs(params?: {}): Promise<implicitReturnType>;
7
8
  spotPublicGetWithdrawConfigs(params?: {}): Promise<implicitReturnType>;
8
9
  spotPublicGetTimestamp(params?: {}): Promise<implicitReturnType>;
9
10
  spotPublicGetTicker24hr(params?: {}): Promise<implicitReturnType>;
@@ -362,6 +362,8 @@ export default class Exchange {
362
362
  checkOrderArguments(market: any, type: any, side: any, amount: any, price: any, params: any): void;
363
363
  handleHttpStatusCode(code: any, reason: any, url: any, method: any, body: any): void;
364
364
  remove0xPrefix(hexData: any): any;
365
+ mapToSafeMap(dict: any): any;
366
+ safeMapToMap(dict: any): any;
365
367
  spawn(method: any, ...args: any[]): import("./ws/Future.js").FutureInterface;
366
368
  delay(timeout: any, method: any, ...args: any[]): void;
367
369
  orderBook(snapshot?: {}, depth?: number): WsOrderBook;
@@ -375,7 +377,7 @@ export default class Exchange {
375
377
  onConnected(client: any, message?: any): void;
376
378
  onError(client: any, error: any): void;
377
379
  onClose(client: any, error: any): void;
378
- close(): Promise<void>;
380
+ close(): Promise<any[]>;
379
381
  loadOrderBook(client: any, messageHash: string, symbol: string, limit?: Int, params?: {}): Promise<void>;
380
382
  convertToBigInt(value: string): bigint;
381
383
  stringToCharsArray(value: string): string[];
@@ -444,6 +446,7 @@ export default class Exchange {
444
446
  watchMyLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
445
447
  watchMyLiquidationsForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
446
448
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
449
+ unWatchOrders(symbol?: Str, params?: {}): Promise<any>;
447
450
  unWatchTrades(symbol: string, params?: {}): Promise<any>;
448
451
  watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
449
452
  unWatchTradesForSymbols(symbols: string[], params?: {}): Promise<any>;
@@ -11,7 +11,7 @@ const { isNode, selfIsDefined, deepExtend, extend, clone, flatten, unique, index
11
11
  import { keys as keysFunc, values as valuesFunc, vwap as vwapFunc } from './functions.js';
12
12
  // import exceptions from "./errors.js"
13
13
  import { // eslint-disable-line object-curly-newline
14
- ExchangeError, BadSymbol, NullResponse, InvalidAddress, InvalidOrder, NotSupported, OperationFailed, BadResponse, AuthenticationError, DDoSProtection, RequestTimeout, NetworkError, InvalidProxySettings, ExchangeNotAvailable, ArgumentsRequired, RateLimitExceeded, BadRequest, ExchangeClosedByUser, UnsubscribeError } from "./errors.js";
14
+ ExchangeError, BadSymbol, NullResponse, InvalidAddress, InvalidOrder, NotSupported, OperationFailed, BadResponse, AuthenticationError, DDoSProtection, RequestTimeout, NetworkError, InvalidProxySettings, ExchangeNotAvailable, ArgumentsRequired, RateLimitExceeded, BadRequest, UnsubscribeError } from "./errors.js";
15
15
  import { Precise } from './Precise.js';
16
16
  //-----------------------------------------------------------------------------
17
17
  import WsClient from './ws/WsClient.js';
@@ -841,6 +841,12 @@ export default class Exchange {
841
841
  return hexData;
842
842
  }
843
843
  }
844
+ mapToSafeMap(dict) {
845
+ return dict; // wrapper for go
846
+ }
847
+ safeMapToMap(dict) {
848
+ return dict; // wrapper for go
849
+ }
844
850
  spawn(method, ...args) {
845
851
  const future = Future();
846
852
  // using setTimeout 0 to force the execution to run after the future is returned
@@ -1096,17 +1102,12 @@ export default class Exchange {
1096
1102
  async close() {
1097
1103
  const clients = Object.values(this.clients || {});
1098
1104
  const closedClients = [];
1099
- for (let i = 0; i < clients.length; i++) {
1100
- const client = clients[i];
1101
- client.error = new ExchangeClosedByUser(this.id + ' closedByUser');
1102
- closedClients.push(client.close());
1103
- }
1104
- await Promise.all(closedClients);
1105
1105
  for (let i = 0; i < clients.length; i++) {
1106
1106
  const client = clients[i];
1107
1107
  delete this.clients[client.url];
1108
+ closedClients.push(client.close());
1108
1109
  }
1109
- return;
1110
+ return Promise.all(closedClients);
1110
1111
  }
1111
1112
  async loadOrderBook(client, messageHash, symbol, limit = undefined, params = {}) {
1112
1113
  if (!(symbol in this.orderbooks)) {
@@ -2092,6 +2093,9 @@ export default class Exchange {
2092
2093
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
2093
2094
  throw new NotSupported(this.id + ' watchTrades() is not supported yet');
2094
2095
  }
2096
+ async unWatchOrders(symbol = undefined, params = {}) {
2097
+ throw new NotSupported(this.id + ' unWatchOrders() is not supported yet');
2098
+ }
2095
2099
  async unWatchTrades(symbol, params = {}) {
2096
2100
  throw new NotSupported(this.id + ' unWatchTrades() is not supported yet');
2097
2101
  }
@@ -2803,14 +2807,14 @@ export default class Exchange {
2803
2807
  }
2804
2808
  values.push(market);
2805
2809
  }
2806
- this.markets = this.indexBy(values, 'symbol');
2810
+ this.markets = this.mapToSafeMap(this.indexBy(values, 'symbol'));
2807
2811
  const marketsSortedBySymbol = this.keysort(this.markets);
2808
2812
  const marketsSortedById = this.keysort(this.markets_by_id);
2809
2813
  this.symbols = Object.keys(marketsSortedBySymbol);
2810
2814
  this.ids = Object.keys(marketsSortedById);
2811
2815
  if (currencies !== undefined) {
2812
2816
  // currencies is always undefined when called in constructor but not when called from loadMarkets
2813
- this.currencies = this.deepExtend(this.currencies, currencies);
2817
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, currencies));
2814
2818
  }
2815
2819
  else {
2816
2820
  let baseCurrencies = [];
@@ -2840,8 +2844,8 @@ export default class Exchange {
2840
2844
  }
2841
2845
  baseCurrencies = this.sortBy(baseCurrencies, 'code', false, '');
2842
2846
  quoteCurrencies = this.sortBy(quoteCurrencies, 'code', false, '');
2843
- this.baseCurrencies = this.indexBy(baseCurrencies, 'code');
2844
- this.quoteCurrencies = this.indexBy(quoteCurrencies, 'code');
2847
+ this.baseCurrencies = this.mapToSafeMap(this.indexBy(baseCurrencies, 'code'));
2848
+ this.quoteCurrencies = this.mapToSafeMap(this.indexBy(quoteCurrencies, 'code'));
2845
2849
  const allCurrencies = this.arrayConcat(baseCurrencies, quoteCurrencies);
2846
2850
  const groupedCurrencies = this.groupBy(allCurrencies, 'code');
2847
2851
  const codes = Object.keys(groupedCurrencies);
@@ -2862,7 +2866,7 @@ export default class Exchange {
2862
2866
  resultingCurrencies.push(highestPrecisionCurrency);
2863
2867
  }
2864
2868
  const sortedCurrencies = this.sortBy(resultingCurrencies, 'code');
2865
- this.currencies = this.deepExtend(this.currencies, this.indexBy(sortedCurrencies, 'code'));
2869
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, this.indexBy(sortedCurrencies, 'code')));
2866
2870
  }
2867
2871
  this.currencies_by_id = this.indexBySafe(this.currencies, 'id');
2868
2872
  const currenciesSortedByCode = this.keysort(this.currencies);
@@ -7035,7 +7039,7 @@ export default class Exchange {
7035
7039
  return reconstructedDate;
7036
7040
  }
7037
7041
  convertMarketIdExpireDate(date) {
7038
- // parse 03JAN24 to 240103
7042
+ // parse 03JAN24 to 240103.
7039
7043
  const monthMappping = {
7040
7044
  'JAN': '01',
7041
7045
  'FEB': '02',
@@ -7156,7 +7160,7 @@ export default class Exchange {
7156
7160
  const symbolAndTimeFrame = symbolsAndTimeFrames[i];
7157
7161
  const symbol = this.safeString(symbolAndTimeFrame, 0);
7158
7162
  const timeframe = this.safeString(symbolAndTimeFrame, 1);
7159
- if (symbol in this.ohlcvs) {
7163
+ if ((this.ohlcvs !== undefined) && (symbol in this.ohlcvs)) {
7160
7164
  if (timeframe in this.ohlcvs[symbol]) {
7161
7165
  delete this.ohlcvs[symbol][timeframe];
7162
7166
  }
@@ -7184,27 +7188,13 @@ export default class Exchange {
7184
7188
  }
7185
7189
  }
7186
7190
  else {
7187
- if (topic === 'myTrades') {
7188
- // don't reset this.myTrades directly here
7189
- // because in c# we need to use a different object (thread-safe dict)
7190
- const keys = Object.keys(this.myTrades);
7191
- for (let i = 0; i < keys.length; i++) {
7192
- const key = keys[i];
7193
- if (key in this.myTrades) {
7194
- delete this.myTrades[key];
7195
- }
7196
- }
7191
+ if (topic === 'myTrades' && (this.myTrades !== undefined)) {
7192
+ this.myTrades = undefined;
7197
7193
  }
7198
- else if (topic === 'orders') {
7199
- const orderSymbols = Object.keys(this.orders);
7200
- for (let i = 0; i < orderSymbols.length; i++) {
7201
- const orderSymbol = orderSymbols[i];
7202
- if (orderSymbol in this.orders) {
7203
- delete this.orders[orderSymbol];
7204
- }
7205
- }
7194
+ else if (topic === 'orders' && (this.orders !== undefined)) {
7195
+ this.orders = undefined;
7206
7196
  }
7207
- else if (topic === 'ticker') {
7197
+ else if (topic === 'ticker' && (this.tickers !== undefined)) {
7208
7198
  const tickerSymbols = Object.keys(this.tickers);
7209
7199
  for (let i = 0; i < tickerSymbols.length; i++) {
7210
7200
  const tickerSymbol = tickerSymbols[i];
@@ -5,8 +5,6 @@ export default class Client {
5
5
  disconnected: ReturnType<typeof Future>;
6
6
  futures: Dictionary<any>;
7
7
  rejections: Dictionary<any>;
8
- messageQueue: Dictionary<any>;
9
- useMessageQueue: boolean;
10
8
  keepAlive: number;
11
9
  connection: any;
12
10
  connectionTimeout: any;
@@ -11,7 +11,6 @@ import { isNode, isJsonEncodedObject, deepExtend, milliseconds, } from '../../ba
11
11
  import { utf8 } from '../../static_dependencies/scure-base/index.js';
12
12
  export default class Client {
13
13
  constructor(url, onMessageCallback, onErrorCallback, onCloseCallback, onConnectedCallback, config = {}) {
14
- this.useMessageQueue = false;
15
14
  this.verbose = false;
16
15
  const defaults = {
17
16
  url,
@@ -25,8 +24,6 @@ export default class Client {
25
24
  futures: {},
26
25
  subscriptions: {},
27
26
  rejections: {},
28
- messageQueue: {},
29
- useMessageQueue: false,
30
27
  connected: undefined,
31
28
  error: undefined,
32
29
  connectionStarted: undefined,
@@ -57,15 +54,6 @@ export default class Client {
57
54
  if (messageHash in this.rejections) {
58
55
  future.reject(this.rejections[messageHash]);
59
56
  delete this.rejections[messageHash];
60
- delete this.messageQueue[messageHash];
61
- return future;
62
- }
63
- if (this.useMessageQueue) {
64
- const queue = this.messageQueue[messageHash];
65
- if (queue && queue.length) {
66
- future.resolve(queue.shift());
67
- delete this.futures[messageHash];
68
- }
69
57
  }
70
58
  return future;
71
59
  }
@@ -73,27 +61,10 @@ export default class Client {
73
61
  if (this.verbose && (messageHash === undefined)) {
74
62
  this.log(new Date(), 'resolve received undefined messageHash');
75
63
  }
76
- if (this.useMessageQueue === true) {
77
- if (!(messageHash in this.messageQueue)) {
78
- this.messageQueue[messageHash] = [];
79
- }
80
- const queue = this.messageQueue[messageHash];
81
- queue.push(result);
82
- while (queue.length > 10) { // limit size to 10 messages in the queue
83
- queue.shift();
84
- }
85
- if ((messageHash !== undefined) && (messageHash in this.futures)) {
86
- const promise = this.futures[messageHash];
87
- promise.resolve(queue.shift());
88
- delete this.futures[messageHash];
89
- }
90
- }
91
- else {
92
- if (messageHash in this.futures) {
93
- const promise = this.futures[messageHash];
94
- promise.resolve(result);
95
- delete this.futures[messageHash];
96
- }
64
+ if ((messageHash !== undefined) && (messageHash in this.futures)) {
65
+ const promise = this.futures[messageHash];
66
+ promise.resolve(result);
67
+ delete this.futures[messageHash];
97
68
  }
98
69
  return result;
99
70
  }
@@ -134,7 +105,6 @@ export default class Client {
134
105
  reset(error) {
135
106
  this.clearConnectionTimeout();
136
107
  this.clearPingInterval();
137
- this.messageQueue = {};
138
108
  this.reject(error);
139
109
  }
140
110
  onConnectionTimeout() {
package/js/src/binance.js CHANGED
@@ -4000,7 +4000,7 @@ export default class binance extends Exchange {
4000
4000
  //
4001
4001
  // {
4002
4002
  // "symbol": "BTCUSDT",
4003
- // "markPrice": "11793.63104562", // mark price
4003
+ // "markPrice": "11793.63104561", // mark price
4004
4004
  // "indexPrice": "11781.80495970", // index price
4005
4005
  // "estimatedSettlePrice": "11781.16138815", // Estimated Settle Price, only useful in the last hour before the settlement starts
4006
4006
  // "lastFundingRate": "0.00038246", // This is the lastest estimated funding rate
@@ -167,6 +167,7 @@ export default class bitmart extends Exchange {
167
167
  * @param {object} [params] extra parameters specific to the exchange API endpoint
168
168
  * @param {int} [params.until] the latest time in ms to fetch trades for
169
169
  * @param {boolean} [params.marginMode] *spot* whether to fetch trades for margin orders or spot orders, defaults to spot orders (only isolated margin orders are supported)
170
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
170
171
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
171
172
  */
172
173
  fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
@@ -180,6 +181,7 @@ export default class bitmart extends Exchange {
180
181
  * @param {int} [since] the earliest time in ms to fetch trades for
181
182
  * @param {int} [limit] the maximum number of trades to retrieve
182
183
  * @param {object} [params] extra parameters specific to the exchange API endpoint
184
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
183
185
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
184
186
  */
185
187
  fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
@@ -252,6 +254,7 @@ export default class bitmart extends Exchange {
252
254
  * @param {string} [params.stopLossPrice] *swap only* the price to trigger a stop-loss order
253
255
  * @param {string} [params.takeProfitPrice] *swap only* the price to trigger a take-profit order
254
256
  * @param {int} [params.plan_category] *swap tp/sl only* 1: tp/sl, 2: position tp/sl, default is 1
257
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
255
258
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
256
259
  */
257
260
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
@@ -262,6 +265,7 @@ export default class bitmart extends Exchange {
262
265
  * @see https://developer-pro.bitmart.com/en/spot/#new-batch-order-v4-signed
263
266
  * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
264
267
  * @param {object} [params] extra parameters specific to the exchange API endpoint
268
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
265
269
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
266
270
  */
267
271
  createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
@@ -328,6 +332,7 @@ export default class bitmart extends Exchange {
328
332
  * @param {string} [params.orderType] *swap only* 'limit', 'market', or 'trailing'
329
333
  * @param {boolean} [params.trailing] *swap only* set to true if you want to fetch trailing orders
330
334
  * @param {boolean} [params.trigger] *swap only* set to true if you want to fetch trigger orders
335
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
331
336
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
332
337
  */
333
338
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -343,6 +348,7 @@ export default class bitmart extends Exchange {
343
348
  * @param {object} [params] extra parameters specific to the exchange API endpoint
344
349
  * @param {int} [params.until] timestamp in ms of the latest entry
345
350
  * @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
351
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
346
352
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
347
353
  */
348
354
  fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -370,6 +376,7 @@ export default class bitmart extends Exchange {
370
376
  * @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
371
377
  * @param {string} [params.orderType] *swap only* 'limit', 'market', 'liquidate', 'bankruptcy', 'adl' or 'trailing'
372
378
  * @param {boolean} [params.trailing] *swap only* set to true if you want to fetch a trailing order
379
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
373
380
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
374
381
  */
375
382
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
package/js/src/bitmart.js CHANGED
@@ -2211,6 +2211,7 @@ export default class bitmart extends Exchange {
2211
2211
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2212
2212
  * @param {int} [params.until] the latest time in ms to fetch trades for
2213
2213
  * @param {boolean} [params.marginMode] *spot* whether to fetch trades for margin orders or spot orders, defaults to spot orders (only isolated margin orders are supported)
2214
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
2214
2215
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2215
2216
  */
2216
2217
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -2326,6 +2327,7 @@ export default class bitmart extends Exchange {
2326
2327
  * @param {int} [since] the earliest time in ms to fetch trades for
2327
2328
  * @param {int} [limit] the maximum number of trades to retrieve
2328
2329
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2330
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
2329
2331
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2330
2332
  */
2331
2333
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -2787,6 +2789,7 @@ export default class bitmart extends Exchange {
2787
2789
  * @param {string} [params.stopLossPrice] *swap only* the price to trigger a stop-loss order
2788
2790
  * @param {string} [params.takeProfitPrice] *swap only* the price to trigger a take-profit order
2789
2791
  * @param {int} [params.plan_category] *swap tp/sl only* 1: tp/sl, 2: position tp/sl, default is 1
2792
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
2790
2793
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2791
2794
  */
2792
2795
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -2857,6 +2860,7 @@ export default class bitmart extends Exchange {
2857
2860
  * @see https://developer-pro.bitmart.com/en/spot/#new-batch-order-v4-signed
2858
2861
  * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
2859
2862
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2863
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
2860
2864
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2861
2865
  */
2862
2866
  async createOrders(orders, params = {}) {
@@ -3441,6 +3445,7 @@ export default class bitmart extends Exchange {
3441
3445
  * @param {string} [params.orderType] *swap only* 'limit', 'market', or 'trailing'
3442
3446
  * @param {boolean} [params.trailing] *swap only* set to true if you want to fetch trailing orders
3443
3447
  * @param {boolean} [params.trigger] *swap only* set to true if you want to fetch trigger orders
3448
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
3444
3449
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3445
3450
  */
3446
3451
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -3567,6 +3572,7 @@ export default class bitmart extends Exchange {
3567
3572
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3568
3573
  * @param {int} [params.until] timestamp in ms of the latest entry
3569
3574
  * @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
3575
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
3570
3576
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3571
3577
  */
3572
3578
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -3635,6 +3641,7 @@ export default class bitmart extends Exchange {
3635
3641
  * @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
3636
3642
  * @param {string} [params.orderType] *swap only* 'limit', 'market', 'liquidate', 'bankruptcy', 'adl' or 'trailing'
3637
3643
  * @param {boolean} [params.trailing] *swap only* set to true if you want to fetch a trailing order
3644
+ * @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
3638
3645
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3639
3646
  */
3640
3647
  async fetchOrder(id, symbol = undefined, params = {}) {
package/js/src/bitmex.js CHANGED
@@ -93,6 +93,7 @@ export default class bitmex extends Exchange {
93
93
  'fetchTransactions': 'emulated',
94
94
  'fetchTransfer': false,
95
95
  'fetchTransfers': false,
96
+ 'index': true,
96
97
  'reduceMargin': undefined,
97
98
  'sandbox': true,
98
99
  'setLeverage': true,
@@ -419,8 +420,8 @@ export default class bitmex extends Exchange {
419
420
  // // "mediumPrecision": "8",
420
421
  // // "shorterPrecision": "4",
421
422
  // // "symbol": "₿",
422
- // // "weight": "1",
423
423
  // // "tickLog": "0",
424
+ // // "weight": "1",
424
425
  // "enabled": true,
425
426
  // "isMarginCurrency": true,
426
427
  // "minDepositAmount": "10000",
package/js/src/bitvavo.js CHANGED
@@ -656,7 +656,7 @@ export default class bitvavo extends Exchange {
656
656
  });
657
657
  }
658
658
  // set currencies here to avoid calling publicGetAssets twice
659
- this.currencies = this.deepExtend(this.currencies, result);
659
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, result));
660
660
  return result;
661
661
  }
662
662
  /**
@@ -1228,6 +1228,9 @@ export default class bitvavo extends Exchange {
1228
1228
  if (operatorId !== undefined) {
1229
1229
  request['operatorId'] = this.parseToInt(operatorId);
1230
1230
  }
1231
+ else {
1232
+ throw new ArgumentsRequired(this.id + ' createOrder() requires an operatorId in params or options, eg: exchange.options[\'operatorId\'] = 1234567890');
1233
+ }
1231
1234
  return this.extend(request, params);
1232
1235
  }
1233
1236
  /**
@@ -1332,6 +1335,9 @@ export default class bitvavo extends Exchange {
1332
1335
  if (operatorId !== undefined) {
1333
1336
  request['operatorId'] = this.parseToInt(operatorId);
1334
1337
  }
1338
+ else {
1339
+ throw new ArgumentsRequired(this.id + ' editOrder() requires an operatorId in params or options, eg: exchange.options[\'operatorId\'] = 1234567890');
1340
+ }
1335
1341
  request['market'] = market['id'];
1336
1342
  return request;
1337
1343
  }
@@ -1373,6 +1379,9 @@ export default class bitvavo extends Exchange {
1373
1379
  if (operatorId !== undefined) {
1374
1380
  request['operatorId'] = this.parseToInt(operatorId);
1375
1381
  }
1382
+ else {
1383
+ throw new ArgumentsRequired(this.id + ' cancelOrder() requires an operatorId in params or options, eg: exchange.options[\'operatorId\'] = 1234567890');
1384
+ }
1376
1385
  return this.extend(request, params);
1377
1386
  }
1378
1387
  /**
package/js/src/cex.js CHANGED
@@ -30,34 +30,95 @@ export default class cex extends Exchange {
30
30
  'swap': false,
31
31
  'future': false,
32
32
  'option': false,
33
+ 'addMargin': false,
34
+ 'borrowCrossMargin': false,
35
+ 'borrowIsolatedMargin': false,
36
+ 'borrowMargin': false,
33
37
  'cancelAllOrders': true,
34
38
  'cancelOrder': true,
39
+ 'closeAllPositions': false,
40
+ 'closePosition': false,
35
41
  'createOrder': true,
42
+ 'createOrderWithTakeProfitAndStopLoss': false,
43
+ 'createOrderWithTakeProfitAndStopLossWs': false,
44
+ 'createPostOnlyOrder': false,
36
45
  'createReduceOnlyOrder': false,
37
46
  'createStopOrder': true,
38
47
  'createTriggerOrder': true,
39
48
  'fetchAccounts': true,
40
49
  'fetchBalance': true,
50
+ 'fetchBorrowInterest': false,
51
+ 'fetchBorrowRate': false,
52
+ 'fetchBorrowRateHistories': false,
53
+ 'fetchBorrowRateHistory': false,
54
+ 'fetchBorrowRates': false,
55
+ 'fetchBorrowRatesPerSymbol': false,
41
56
  'fetchClosedOrder': true,
42
57
  'fetchClosedOrders': true,
58
+ 'fetchCrossBorrowRate': false,
59
+ 'fetchCrossBorrowRates': false,
43
60
  'fetchCurrencies': true,
44
61
  'fetchDepositAddress': true,
45
62
  'fetchDepositsWithdrawals': true,
46
63
  'fetchFundingHistory': false,
64
+ 'fetchFundingInterval': false,
65
+ 'fetchFundingIntervals': false,
47
66
  'fetchFundingRate': false,
48
67
  'fetchFundingRateHistory': false,
49
68
  'fetchFundingRates': false,
69
+ 'fetchGreeks': false,
70
+ 'fetchIndexOHLCV': false,
71
+ 'fetchIsolatedBorrowRate': false,
72
+ 'fetchIsolatedBorrowRates': false,
73
+ 'fetchIsolatedPositions': false,
50
74
  'fetchLedger': true,
75
+ 'fetchLeverage': false,
76
+ 'fetchLeverages': false,
77
+ 'fetchLeverageTiers': false,
78
+ 'fetchLiquidations': false,
79
+ 'fetchLongShortRatio': false,
80
+ 'fetchLongShortRatioHistory': false,
81
+ 'fetchMarginAdjustmentHistory': false,
82
+ 'fetchMarginMode': false,
83
+ 'fetchMarginModes': false,
84
+ 'fetchMarketLeverageTiers': false,
51
85
  'fetchMarkets': true,
86
+ 'fetchMarkOHLCV': false,
87
+ 'fetchMarkPrices': false,
88
+ 'fetchMyLiquidations': false,
89
+ 'fetchMySettlementHistory': false,
52
90
  'fetchOHLCV': true,
91
+ 'fetchOpenInterest': false,
92
+ 'fetchOpenInterestHistory': false,
93
+ 'fetchOpenInterests': false,
53
94
  'fetchOpenOrder': true,
54
95
  'fetchOpenOrders': true,
96
+ 'fetchOption': false,
97
+ 'fetchOptionChain': false,
55
98
  'fetchOrderBook': true,
99
+ 'fetchPosition': false,
100
+ 'fetchPositionHistory': false,
101
+ 'fetchPositionMode': false,
102
+ 'fetchPositions': false,
103
+ 'fetchPositionsForSymbol': false,
104
+ 'fetchPositionsHistory': false,
105
+ 'fetchPositionsRisk': false,
106
+ 'fetchPremiumIndexOHLCV': false,
107
+ 'fetchSettlementHistory': false,
56
108
  'fetchTicker': true,
57
109
  'fetchTickers': true,
58
110
  'fetchTime': true,
59
111
  'fetchTrades': true,
60
112
  'fetchTradingFees': true,
113
+ 'fetchVolatilityHistory': false,
114
+ 'reduceMargin': false,
115
+ 'repayCrossMargin': false,
116
+ 'repayIsolatedMargin': false,
117
+ 'repayMargin': false,
118
+ 'setLeverage': false,
119
+ 'setMargin': false,
120
+ 'setMarginMode': false,
121
+ 'setPositionMode': false,
61
122
  'transfer': true,
62
123
  },
63
124
  'urls': {