ccxt 4.5.46 → 4.5.47

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 (63) hide show
  1. package/README.md +5 -6
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -6
  4. package/dist/cjs/src/aftermath.js +1 -1
  5. package/dist/cjs/src/backpack.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +24 -0
  7. package/dist/cjs/src/binance.js +12 -15
  8. package/dist/cjs/src/bitfinex.js +6 -11
  9. package/dist/cjs/src/bitget.js +6 -3
  10. package/dist/cjs/src/bitmex.js +46 -0
  11. package/dist/cjs/src/bitstamp.js +14 -1
  12. package/dist/cjs/src/bittrade.js +1 -1
  13. package/dist/cjs/src/blofin.js +137 -29
  14. package/dist/cjs/src/hollaex.js +1 -1
  15. package/dist/cjs/src/kraken.js +39 -31
  16. package/dist/cjs/src/kucoin.js +2158 -461
  17. package/dist/cjs/src/lighter.js +2 -2
  18. package/dist/cjs/src/okx.js +0 -1
  19. package/dist/cjs/src/pro/bittrade.js +4 -0
  20. package/dist/cjs/src/pro/grvt.js +1 -1
  21. package/dist/cjs/src/pro/lighter.js +1 -1
  22. package/dist/cjs/src/whitebit.js +21 -2
  23. package/js/ccxt.d.ts +2 -8
  24. package/js/ccxt.js +2 -6
  25. package/js/src/abstract/blofin.d.ts +28 -12
  26. package/js/src/abstract/kraken.d.ts +36 -30
  27. package/js/src/abstract/kucoin.d.ts +1 -0
  28. package/js/src/abstract/kucoinfutures.d.ts +1 -0
  29. package/js/src/aftermath.js +1 -1
  30. package/js/src/backpack.js +1 -1
  31. package/js/src/base/Exchange.d.ts +1 -0
  32. package/js/src/base/Exchange.js +24 -0
  33. package/js/src/binance.js +12 -15
  34. package/js/src/bitfinex.js +6 -11
  35. package/js/src/bitget.d.ts +1 -1
  36. package/js/src/bitget.js +6 -3
  37. package/js/src/bitmex.d.ts +12 -0
  38. package/js/src/bitmex.js +46 -0
  39. package/js/src/bitstamp.js +14 -1
  40. package/js/src/bittrade.js +1 -1
  41. package/js/src/blofin.d.ts +2 -0
  42. package/js/src/blofin.js +137 -29
  43. package/js/src/hollaex.js +1 -1
  44. package/js/src/kraken.js +39 -31
  45. package/js/src/kucoin.d.ts +249 -8
  46. package/js/src/kucoin.js +2158 -461
  47. package/js/src/lighter.js +2 -2
  48. package/js/src/okx.js +0 -1
  49. package/js/src/pro/bittrade.js +4 -0
  50. package/js/src/pro/grvt.js +1 -1
  51. package/js/src/pro/lighter.js +1 -1
  52. package/js/src/whitebit.d.ts +1 -1
  53. package/js/src/whitebit.js +21 -2
  54. package/package.json +1 -1
  55. package/dist/cjs/src/abstract/coincatch.js +0 -11
  56. package/dist/cjs/src/coincatch.js +0 -5495
  57. package/dist/cjs/src/pro/coincatch.js +0 -1563
  58. package/js/src/abstract/coincatch.d.ts +0 -97
  59. package/js/src/abstract/coincatch.js +0 -5
  60. package/js/src/coincatch.d.ts +0 -788
  61. package/js/src/coincatch.js +0 -5488
  62. package/js/src/pro/coincatch.d.ts +0 -207
  63. package/js/src/pro/coincatch.js +0 -1556
@@ -508,7 +508,7 @@ class lighter extends lighter$1["default"] {
508
508
  setSandboxMode(enable) {
509
509
  super.setSandboxMode(enable);
510
510
  this.options['sandboxMode'] = enable;
511
- this.options['chainId'] = 300;
511
+ this.options['chainId'] = enable ? 300 : 304;
512
512
  }
513
513
  createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
514
514
  /**
@@ -1152,7 +1152,7 @@ class lighter extends lighter$1["default"] {
1152
1152
  // "daily_chart": {},
1153
1153
  // "market_config": {
1154
1154
  // "market_margin_mode": 0,
1155
- // "insurance_fund_account_index": 281474976710655,
1155
+ // "insurance_fund_account_index": 281474976710654,
1156
1156
  // "liquidation_mode": 0,
1157
1157
  // "force_reduce_only": false,
1158
1158
  // "trading_hours": ""
@@ -1073,7 +1073,6 @@ class okx extends okx$1["default"] {
1073
1073
  },
1074
1074
  'networks': {
1075
1075
  'BTC': 'Bitcoin',
1076
- 'BTCLN': 'Lightning',
1077
1076
  'BTCLIGHTNING': 'Lightning',
1078
1077
  'BSC': 'BSC',
1079
1078
  'BEP20': 'BSC',
@@ -304,6 +304,7 @@ class bittrade extends bittrade$1["default"] {
304
304
  // {
305
305
  // "id": 1583473663565,
306
306
  // "rep": "market.btcusdt.mbp.150",
307
+ // "ts": 1774979531056,
307
308
  // "status": "ok",
308
309
  // "data": {
309
310
  // "seqNum": 104999417756,
@@ -322,10 +323,13 @@ class bittrade extends bittrade$1["default"] {
322
323
  //
323
324
  const symbol = this.safeString(subscription, 'symbol');
324
325
  const messageHash = this.safeString(subscription, 'messageHash');
326
+ const timestamp = this.safeInteger(message, 'ts');
325
327
  const orderbook = this.orderbooks[symbol];
326
328
  const data = this.safeValue(message, 'data');
327
329
  const snapshot = this.parseOrderBook(data, symbol);
328
330
  snapshot['nonce'] = this.safeInteger(data, 'seqNum');
331
+ snapshot['timestamp'] = timestamp;
332
+ snapshot['datetime'] = this.iso8601(timestamp);
329
333
  orderbook.reset(snapshot);
330
334
  // unroll the accumulated deltas
331
335
  const messages = orderbook.cache;
@@ -514,7 +514,7 @@ class grvt extends grvt$1["default"] {
514
514
  const symbol = symbols[i];
515
515
  const market = this.market(symbol);
516
516
  const marketId = market['id'];
517
- rawHashes.push(marketId + '@' + extraPart);
517
+ rawHashes.push(marketId + '@' + extraPart.toString());
518
518
  messageHashes.push('orderbook::' + market['symbol']);
519
519
  }
520
520
  const request = {
@@ -820,7 +820,7 @@ class lighter extends lighter$1["default"] {
820
820
  const error = this.safeDict(message, 'error');
821
821
  try {
822
822
  if (error !== undefined) {
823
- const code = this.safeString(message, 'code');
823
+ const code = this.safeString(error, 'code');
824
824
  if (code !== undefined) {
825
825
  const feedback = this.id + ' ' + this.json(message);
826
826
  this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
@@ -427,6 +427,7 @@ class whitebit extends whitebit$1["default"] {
427
427
  '422': errors.OrderNotFound, // {"response":null,"status":422,"errors":{"orderId":["Finished order id 1295772653 not found on your account"]},"notification":null,"warning":"Finished order id 1295772653 not found on your account","_token":null}
428
428
  },
429
429
  'broad': {
430
+ 'limit must be less than or equal to': errors.BadRequest,
430
431
  'This action is unauthorized': errors.PermissionDenied,
431
432
  'Given amount is less than min amount': errors.InvalidOrder,
432
433
  'Min amount step': errors.InvalidOrder,
@@ -4020,7 +4021,7 @@ class whitebit extends whitebit$1["default"] {
4020
4021
  * @see https://docs.whitebit.com/api-reference/market-data/funding-history
4021
4022
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
4022
4023
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
4023
- * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rate-history-structure} to fetch (default 100, max 1000)
4024
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rate-history-structure} to fetch (default 100, max 100)
4024
4025
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4025
4026
  * @param {int} [params.until] timestamp in ms of the latest funding rate
4026
4027
  * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/?id=funding-rate-history-structure}
@@ -4029,7 +4030,7 @@ class whitebit extends whitebit$1["default"] {
4029
4030
  if (symbol === undefined) {
4030
4031
  throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
4031
4032
  }
4032
- const maxLimit = 1000;
4033
+ const maxLimit = 100;
4033
4034
  let paginate = false;
4034
4035
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
4035
4036
  if (paginate) {
@@ -4148,6 +4149,24 @@ class whitebit extends whitebit$1["default"] {
4148
4149
  this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
4149
4150
  throw new errors.ExchangeError(feedback);
4150
4151
  }
4152
+ // {"success":false,"message":{"limit":["limit must be less than or equal to 100"]},"result":null}
4153
+ const success = this.safeBool(response, 'success', true);
4154
+ if (!success) {
4155
+ const errMsg = this.safeDict(response, 'message', {});
4156
+ const errKeys = Object.keys(errMsg);
4157
+ const errKeysLength = errKeys.length;
4158
+ let errorInfo = body;
4159
+ if (errKeysLength > 0) {
4160
+ const errorKey = errKeys[0];
4161
+ const errorMessageArray = this.safeList(errMsg, errorKey, []);
4162
+ const errorMessageLength = errorMessageArray.length;
4163
+ errorInfo = (errorMessageLength > 0) ? errorMessageArray[0] : body;
4164
+ }
4165
+ const feedback = this.id + ' ' + body;
4166
+ this.throwExactlyMatchedException(this.exceptions['exact'], errorInfo, feedback);
4167
+ this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
4168
+ throw new errors.ExchangeError(feedback);
4169
+ }
4151
4170
  }
4152
4171
  return undefined;
4153
4172
  }
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, ADL } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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.5.45";
7
+ declare const version = "4.5.46";
8
8
  import aftermath from './src/aftermath.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import apex from './src/apex.js';
@@ -48,7 +48,6 @@ import coinbase from './src/coinbase.js';
48
48
  import coinbaseadvanced from './src/coinbaseadvanced.js';
49
49
  import coinbaseexchange from './src/coinbaseexchange.js';
50
50
  import coinbaseinternational from './src/coinbaseinternational.js';
51
- import coincatch from './src/coincatch.js';
52
51
  import coincheck from './src/coincheck.js';
53
52
  import coinex from './src/coinex.js';
54
53
  import coinmate from './src/coinmate.js';
@@ -148,7 +147,6 @@ import coinbasePro from './src/pro/coinbase.js';
148
147
  import coinbaseadvancedPro from './src/pro/coinbaseadvanced.js';
149
148
  import coinbaseexchangePro from './src/pro/coinbaseexchange.js';
150
149
  import coinbaseinternationalPro from './src/pro/coinbaseinternational.js';
151
- import coincatchPro from './src/pro/coincatch.js';
152
150
  import coincheckPro from './src/pro/coincheck.js';
153
151
  import coinexPro from './src/pro/coinex.js';
154
152
  import coinonePro from './src/pro/coinone.js';
@@ -238,7 +236,6 @@ declare const exchanges: {
238
236
  coinbaseadvanced: typeof coinbaseadvanced;
239
237
  coinbaseexchange: typeof coinbaseexchange;
240
238
  coinbaseinternational: typeof coinbaseinternational;
241
- coincatch: typeof coincatch;
242
239
  coincheck: typeof coincheck;
243
240
  coinex: typeof coinex;
244
241
  coinmate: typeof coinmate;
@@ -340,7 +337,6 @@ declare const pro: {
340
337
  coinbaseadvanced: typeof coinbaseadvancedPro;
341
338
  coinbaseexchange: typeof coinbaseexchangePro;
342
339
  coinbaseinternational: typeof coinbaseinternationalPro;
343
- coincatch: typeof coincatchPro;
344
340
  coincheck: typeof coincheckPro;
345
341
  coinex: typeof coinexPro;
346
342
  coinone: typeof coinonePro;
@@ -426,7 +422,6 @@ declare const ccxt: {
426
422
  coinbaseadvanced: typeof coinbaseadvancedPro;
427
423
  coinbaseexchange: typeof coinbaseexchangePro;
428
424
  coinbaseinternational: typeof coinbaseinternationalPro;
429
- coincatch: typeof coincatchPro;
430
425
  coincheck: typeof coincheckPro;
431
426
  coinex: typeof coinexPro;
432
427
  coinone: typeof coinonePro;
@@ -517,7 +512,6 @@ declare const ccxt: {
517
512
  coinbaseadvanced: typeof coinbaseadvanced;
518
513
  coinbaseexchange: typeof coinbaseexchange;
519
514
  coinbaseinternational: typeof coinbaseinternational;
520
- coincatch: typeof coincatch;
521
515
  coincheck: typeof coincheck;
522
516
  coinex: typeof coinex;
523
517
  coinmate: typeof coinmate;
@@ -585,5 +579,5 @@ declare const ccxt: {
585
579
  zebpay: typeof zebpay;
586
580
  zonda: typeof zonda;
587
581
  } & typeof functions & typeof errors;
588
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, ADL, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, aftermath, alpaca, apex, arkham, ascendex, aster, backpack, 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, btcbox, btcmarkets, btcturk, bullish, bybit, bydfi, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, deepcoin, delta, deribit, derive, digifinex, dydx, exmo, fmfwio, foxbit, gate, gateio, gemini, grvt, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, lighter, luno, mercado, mexc, modetrade, myokx, ndax, novadax, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, tokocrypto, toobit, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zebpay, zonda, };
582
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, ADL, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, aftermath, alpaca, apex, arkham, ascendex, aster, backpack, 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, btcbox, btcmarkets, btcturk, bullish, bybit, bydfi, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, deepcoin, delta, deribit, derive, digifinex, dydx, exmo, fmfwio, foxbit, gate, gateio, gemini, grvt, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, lighter, luno, mercado, mexc, modetrade, myokx, ndax, novadax, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, tokocrypto, toobit, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zebpay, zonda, };
589
583
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -32,7 +32,7 @@ import * as errors from './src/base/errors.js';
32
32
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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';
33
33
  //-----------------------------------------------------------------------------
34
34
  // this is updated by vss.js when building
35
- const version = '4.5.45';
35
+ const version = '4.5.46';
36
36
  Exchange.ccxtVersion = version;
37
37
  //-----------------------------------------------------------------------------
38
38
  import aftermath from './src/aftermath.js';
@@ -78,7 +78,6 @@ import coinbase from './src/coinbase.js';
78
78
  import coinbaseadvanced from './src/coinbaseadvanced.js';
79
79
  import coinbaseexchange from './src/coinbaseexchange.js';
80
80
  import coinbaseinternational from './src/coinbaseinternational.js';
81
- import coincatch from './src/coincatch.js';
82
81
  import coincheck from './src/coincheck.js';
83
82
  import coinex from './src/coinex.js';
84
83
  import coinmate from './src/coinmate.js';
@@ -179,7 +178,6 @@ import coinbasePro from './src/pro/coinbase.js';
179
178
  import coinbaseadvancedPro from './src/pro/coinbaseadvanced.js';
180
179
  import coinbaseexchangePro from './src/pro/coinbaseexchange.js';
181
180
  import coinbaseinternationalPro from './src/pro/coinbaseinternational.js';
182
- import coincatchPro from './src/pro/coincatch.js';
183
181
  import coincheckPro from './src/pro/coincheck.js';
184
182
  import coinexPro from './src/pro/coinex.js';
185
183
  import coinonePro from './src/pro/coinone.js';
@@ -269,7 +267,6 @@ const exchanges = {
269
267
  'coinbaseadvanced': coinbaseadvanced,
270
268
  'coinbaseexchange': coinbaseexchange,
271
269
  'coinbaseinternational': coinbaseinternational,
272
- 'coincatch': coincatch,
273
270
  'coincheck': coincheck,
274
271
  'coinex': coinex,
275
272
  'coinmate': coinmate,
@@ -371,7 +368,6 @@ const pro = {
371
368
  'coinbaseadvanced': coinbaseadvancedPro,
372
369
  'coinbaseexchange': coinbaseexchangePro,
373
370
  'coinbaseinternational': coinbaseinternationalPro,
374
- 'coincatch': coincatchPro,
375
371
  'coincheck': coincheckPro,
376
372
  'coinex': coinexPro,
377
373
  'coinone': coinonePro,
@@ -430,6 +426,6 @@ pro.exchanges = Object.keys(pro);
430
426
  pro['Exchange'] = Exchange; // now the same for rest and ts
431
427
  //-----------------------------------------------------------------------------
432
428
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
433
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, aftermath, alpaca, apex, arkham, ascendex, aster, backpack, 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, btcbox, btcmarkets, btcturk, bullish, bybit, bydfi, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincatch, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, deepcoin, delta, deribit, derive, digifinex, dydx, exmo, fmfwio, foxbit, gate, gateio, gemini, grvt, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, lighter, luno, mercado, mexc, modetrade, myokx, ndax, novadax, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, tokocrypto, toobit, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zebpay, zonda, };
429
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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, aftermath, alpaca, apex, arkham, ascendex, aster, backpack, 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, btcbox, btcmarkets, btcturk, bullish, bybit, bydfi, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, cryptomus, deepcoin, delta, deribit, derive, digifinex, dydx, exmo, fmfwio, foxbit, gate, gateio, gemini, grvt, hashkey, hibachi, hitbtc, hollaex, htx, huobi, hyperliquid, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, latoken, lbank, lighter, luno, mercado, mexc, modetrade, myokx, ndax, novadax, okx, okxus, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, tokocrypto, toobit, upbit, wavesexchange, whitebit, woo, woofipro, xt, yobit, zaif, zebpay, zonda, };
434
430
  export default ccxt;
435
431
  //-----------------------------------------------------------------------------
@@ -5,31 +5,44 @@ interface Exchange {
5
5
  publicGetMarketTickers(params?: {}): Promise<implicitReturnType>;
6
6
  publicGetMarketBooks(params?: {}): Promise<implicitReturnType>;
7
7
  publicGetMarketTrades(params?: {}): Promise<implicitReturnType>;
8
- publicGetMarketCandles(params?: {}): Promise<implicitReturnType>;
9
8
  publicGetMarketMarkPrice(params?: {}): Promise<implicitReturnType>;
10
9
  publicGetMarketFundingRate(params?: {}): Promise<implicitReturnType>;
11
10
  publicGetMarketFundingRateHistory(params?: {}): Promise<implicitReturnType>;
11
+ publicGetMarketCandles(params?: {}): Promise<implicitReturnType>;
12
+ publicGetMarketIndexCandles(params?: {}): Promise<implicitReturnType>;
13
+ publicGetMarketMarkPriceCandles(params?: {}): Promise<implicitReturnType>;
14
+ publicGetMarketPositionTiers(params?: {}): Promise<implicitReturnType>;
12
15
  privateGetAssetBalances(params?: {}): Promise<implicitReturnType>;
13
- privateGetTradeOrdersPending(params?: {}): Promise<implicitReturnType>;
14
- privateGetTradeFillsHistory(params?: {}): Promise<implicitReturnType>;
15
- privateGetAssetDepositHistory(params?: {}): Promise<implicitReturnType>;
16
- privateGetAssetWithdrawalHistory(params?: {}): Promise<implicitReturnType>;
17
16
  privateGetAssetBills(params?: {}): Promise<implicitReturnType>;
17
+ privateGetAssetWithdrawalHistory(params?: {}): Promise<implicitReturnType>;
18
+ privateGetAssetDepositHistory(params?: {}): Promise<implicitReturnType>;
19
+ privateGetAccountConfig(params?: {}): Promise<implicitReturnType>;
20
+ privateGetAssetCurrencies(params?: {}): Promise<implicitReturnType>;
18
21
  privateGetAccountBalance(params?: {}): Promise<implicitReturnType>;
19
22
  privateGetAccountPositions(params?: {}): Promise<implicitReturnType>;
20
- privateGetAccountLeverageInfo(params?: {}): Promise<implicitReturnType>;
23
+ privateGetAccountPositionsHistory(params?: {}): Promise<implicitReturnType>;
21
24
  privateGetAccountMarginMode(params?: {}): Promise<implicitReturnType>;
22
25
  privateGetAccountPositionMode(params?: {}): Promise<implicitReturnType>;
26
+ privateGetAccountLeverageInfo(params?: {}): Promise<implicitReturnType>;
23
27
  privateGetAccountBatchLeverageInfo(params?: {}): Promise<implicitReturnType>;
28
+ privateGetTradeOrdersPending(params?: {}): Promise<implicitReturnType>;
29
+ privateGetTradeOrderDetail(params?: {}): Promise<implicitReturnType>;
24
30
  privateGetTradeOrdersTpslPending(params?: {}): Promise<implicitReturnType>;
31
+ privateGetTradeOrderTpslDetail(params?: {}): Promise<implicitReturnType>;
25
32
  privateGetTradeOrdersAlgoPending(params?: {}): Promise<implicitReturnType>;
26
33
  privateGetTradeOrdersHistory(params?: {}): Promise<implicitReturnType>;
27
34
  privateGetTradeOrdersTpslHistory(params?: {}): Promise<implicitReturnType>;
28
35
  privateGetTradeOrdersAlgoHistory(params?: {}): Promise<implicitReturnType>;
36
+ privateGetTradeFillsHistory(params?: {}): Promise<implicitReturnType>;
29
37
  privateGetTradeOrderPriceRange(params?: {}): Promise<implicitReturnType>;
30
- privateGetUserQueryApikey(params?: {}): Promise<implicitReturnType>;
31
38
  privateGetAffiliateBasic(params?: {}): Promise<implicitReturnType>;
39
+ privateGetAffiliateReferralCode(params?: {}): Promise<implicitReturnType>;
40
+ privateGetAffiliateInvitees(params?: {}): Promise<implicitReturnType>;
41
+ privateGetAffiliateSubInvitees(params?: {}): Promise<implicitReturnType>;
42
+ privateGetAffiliateSubAffiliates(params?: {}): Promise<implicitReturnType>;
43
+ privateGetAffiliateInviteesDailyInfo(params?: {}): Promise<implicitReturnType>;
32
44
  privateGetCopytradingInstruments(params?: {}): Promise<implicitReturnType>;
45
+ privateGetCopytradingConfig(params?: {}): Promise<implicitReturnType>;
33
46
  privateGetCopytradingAccountBalance(params?: {}): Promise<implicitReturnType>;
34
47
  privateGetCopytradingAccountPositionsByOrder(params?: {}): Promise<implicitReturnType>;
35
48
  privateGetCopytradingAccountPositionsDetailsByOrder(params?: {}): Promise<implicitReturnType>;
@@ -41,19 +54,22 @@ interface Exchange {
41
54
  privateGetCopytradingTradePositionHistoryByOrder(params?: {}): Promise<implicitReturnType>;
42
55
  privateGetCopytradingTradeOrdersHistory(params?: {}): Promise<implicitReturnType>;
43
56
  privateGetCopytradingTradePendingTpslByOrder(params?: {}): Promise<implicitReturnType>;
57
+ privateGetUserQueryApikey(params?: {}): Promise<implicitReturnType>;
58
+ privateGetSpotTradeFillsHistory(params?: {}): Promise<implicitReturnType>;
59
+ privatePostAssetTransfer(params?: {}): Promise<implicitReturnType>;
60
+ privatePostAssetDemoApplyMoney(params?: {}): Promise<implicitReturnType>;
44
61
  privatePostAccountSetMarginMode(params?: {}): Promise<implicitReturnType>;
45
62
  privatePostAccountSetPositionMode(params?: {}): Promise<implicitReturnType>;
46
- privatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
47
- privatePostTradeOrderAlgo(params?: {}): Promise<implicitReturnType>;
48
- privatePostTradeCancelOrder(params?: {}): Promise<implicitReturnType>;
49
- privatePostTradeCancelAlgo(params?: {}): Promise<implicitReturnType>;
50
63
  privatePostAccountSetLeverage(params?: {}): Promise<implicitReturnType>;
64
+ privatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
51
65
  privatePostTradeBatchOrders(params?: {}): Promise<implicitReturnType>;
52
66
  privatePostTradeOrderTpsl(params?: {}): Promise<implicitReturnType>;
67
+ privatePostTradeOrderAlgo(params?: {}): Promise<implicitReturnType>;
68
+ privatePostTradeCancelOrder(params?: {}): Promise<implicitReturnType>;
53
69
  privatePostTradeCancelBatchOrders(params?: {}): Promise<implicitReturnType>;
54
70
  privatePostTradeCancelTpsl(params?: {}): Promise<implicitReturnType>;
71
+ privatePostTradeCancelAlgo(params?: {}): Promise<implicitReturnType>;
55
72
  privatePostTradeClosePosition(params?: {}): Promise<implicitReturnType>;
56
- privatePostAssetTransfer(params?: {}): Promise<implicitReturnType>;
57
73
  privatePostCopytradingAccountSetPositionMode(params?: {}): Promise<implicitReturnType>;
58
74
  privatePostCopytradingAccountSetLeverage(params?: {}): Promise<implicitReturnType>;
59
75
  privatePostCopytradingTradePlaceOrder(params?: {}): Promise<implicitReturnType>;
@@ -3,51 +3,57 @@ import { Exchange as _Exchange } from '../base/Exchange.js';
3
3
  interface Exchange {
4
4
  zendeskGet360000292886(params?: {}): Promise<implicitReturnType>;
5
5
  zendeskGet201893608(params?: {}): Promise<implicitReturnType>;
6
+ publicGetTime(params?: {}): Promise<implicitReturnType>;
7
+ publicGetSystemStatus(params?: {}): Promise<implicitReturnType>;
6
8
  publicGetAssets(params?: {}): Promise<implicitReturnType>;
7
9
  publicGetAssetPairs(params?: {}): Promise<implicitReturnType>;
8
- publicGetDepth(params?: {}): Promise<implicitReturnType>;
9
- publicGetOHLC(params?: {}): Promise<implicitReturnType>;
10
- publicGetSpread(params?: {}): Promise<implicitReturnType>;
11
- publicGetSystemStatus(params?: {}): Promise<implicitReturnType>;
12
10
  publicGetTicker(params?: {}): Promise<implicitReturnType>;
13
- publicGetTime(params?: {}): Promise<implicitReturnType>;
11
+ publicGetOHLC(params?: {}): Promise<implicitReturnType>;
12
+ publicGetDepth(params?: {}): Promise<implicitReturnType>;
13
+ publicGetLevel3(params?: {}): Promise<implicitReturnType>;
14
+ publicGetGroupedBook(params?: {}): Promise<implicitReturnType>;
14
15
  publicGetTrades(params?: {}): Promise<implicitReturnType>;
15
- privatePostAddOrder(params?: {}): Promise<implicitReturnType>;
16
- privatePostAddOrderBatch(params?: {}): Promise<implicitReturnType>;
16
+ publicGetSpread(params?: {}): Promise<implicitReturnType>;
17
+ publicGetPreTrade(params?: {}): Promise<implicitReturnType>;
18
+ publicGetPostTrade(params?: {}): Promise<implicitReturnType>;
19
+ privatePostBalance(params?: {}): Promise<implicitReturnType>;
20
+ privatePostBalanceEx(params?: {}): Promise<implicitReturnType>;
21
+ privatePostCreditLines(params?: {}): Promise<implicitReturnType>;
22
+ privatePostTradeBalance(params?: {}): Promise<implicitReturnType>;
23
+ privatePostOpenOrders(params?: {}): Promise<implicitReturnType>;
24
+ privatePostClosedOrders(params?: {}): Promise<implicitReturnType>;
25
+ privatePostQueryOrders(params?: {}): Promise<implicitReturnType>;
26
+ privatePostOrderAmends(params?: {}): Promise<implicitReturnType>;
27
+ privatePostTradesHistory(params?: {}): Promise<implicitReturnType>;
28
+ privatePostQueryTrades(params?: {}): Promise<implicitReturnType>;
29
+ privatePostOpenPositions(params?: {}): Promise<implicitReturnType>;
30
+ privatePostLedgers(params?: {}): Promise<implicitReturnType>;
31
+ privatePostQueryLedgers(params?: {}): Promise<implicitReturnType>;
32
+ privatePostTradeVolume(params?: {}): Promise<implicitReturnType>;
17
33
  privatePostAddExport(params?: {}): Promise<implicitReturnType>;
34
+ privatePostExportStatus(params?: {}): Promise<implicitReturnType>;
35
+ privatePostRetrieveExport(params?: {}): Promise<implicitReturnType>;
36
+ privatePostRemoveExport(params?: {}): Promise<implicitReturnType>;
37
+ privatePostGetApiKeyInfo(params?: {}): Promise<implicitReturnType>;
38
+ privatePostAddOrder(params?: {}): Promise<implicitReturnType>;
18
39
  privatePostAmendOrder(params?: {}): Promise<implicitReturnType>;
19
- privatePostBalance(params?: {}): Promise<implicitReturnType>;
40
+ privatePostCancelOrder(params?: {}): Promise<implicitReturnType>;
20
41
  privatePostCancelAll(params?: {}): Promise<implicitReturnType>;
21
42
  privatePostCancelAllOrdersAfter(params?: {}): Promise<implicitReturnType>;
22
- privatePostCancelOrder(params?: {}): Promise<implicitReturnType>;
43
+ privatePostGetWebSocketsToken(params?: {}): Promise<implicitReturnType>;
44
+ privatePostAddOrderBatch(params?: {}): Promise<implicitReturnType>;
23
45
  privatePostCancelOrderBatch(params?: {}): Promise<implicitReturnType>;
24
- privatePostClosedOrders(params?: {}): Promise<implicitReturnType>;
25
- privatePostDepositAddresses(params?: {}): Promise<implicitReturnType>;
46
+ privatePostEditOrder(params?: {}): Promise<implicitReturnType>;
26
47
  privatePostDepositMethods(params?: {}): Promise<implicitReturnType>;
48
+ privatePostDepositAddresses(params?: {}): Promise<implicitReturnType>;
27
49
  privatePostDepositStatus(params?: {}): Promise<implicitReturnType>;
28
- privatePostEditOrder(params?: {}): Promise<implicitReturnType>;
29
- privatePostExportStatus(params?: {}): Promise<implicitReturnType>;
30
- privatePostGetWebSocketsToken(params?: {}): Promise<implicitReturnType>;
31
- privatePostLedgers(params?: {}): Promise<implicitReturnType>;
32
- privatePostOpenOrders(params?: {}): Promise<implicitReturnType>;
33
- privatePostOpenPositions(params?: {}): Promise<implicitReturnType>;
34
- privatePostQueryLedgers(params?: {}): Promise<implicitReturnType>;
35
- privatePostQueryOrders(params?: {}): Promise<implicitReturnType>;
36
- privatePostQueryTrades(params?: {}): Promise<implicitReturnType>;
37
- privatePostRetrieveExport(params?: {}): Promise<implicitReturnType>;
38
- privatePostRemoveExport(params?: {}): Promise<implicitReturnType>;
39
- privatePostBalanceEx(params?: {}): Promise<implicitReturnType>;
40
- privatePostTradeBalance(params?: {}): Promise<implicitReturnType>;
41
- privatePostTradesHistory(params?: {}): Promise<implicitReturnType>;
42
- privatePostTradeVolume(params?: {}): Promise<implicitReturnType>;
43
- privatePostWithdraw(params?: {}): Promise<implicitReturnType>;
44
- privatePostWithdrawCancel(params?: {}): Promise<implicitReturnType>;
45
- privatePostWithdrawInfo(params?: {}): Promise<implicitReturnType>;
46
50
  privatePostWithdrawMethods(params?: {}): Promise<implicitReturnType>;
47
51
  privatePostWithdrawAddresses(params?: {}): Promise<implicitReturnType>;
52
+ privatePostWithdrawInfo(params?: {}): Promise<implicitReturnType>;
53
+ privatePostWithdraw(params?: {}): Promise<implicitReturnType>;
48
54
  privatePostWithdrawStatus(params?: {}): Promise<implicitReturnType>;
55
+ privatePostWithdrawCancel(params?: {}): Promise<implicitReturnType>;
49
56
  privatePostWalletTransfer(params?: {}): Promise<implicitReturnType>;
50
- privatePostGetApiKeyInfo(params?: {}): Promise<implicitReturnType>;
51
57
  privatePostCreateSubaccount(params?: {}): Promise<implicitReturnType>;
52
58
  privatePostAccountTransfer(params?: {}): Promise<implicitReturnType>;
53
59
  privatePostEarnAllocate(params?: {}): Promise<implicitReturnType>;
@@ -330,6 +330,7 @@ interface Exchange {
330
330
  utaPrivateGetAccountModeOrderExecution(params?: {}): Promise<implicitReturnType>;
331
331
  utaPrivateGetAccountModePositionOpenList(params?: {}): Promise<implicitReturnType>;
332
332
  utaPrivateGetAccountModePositionHistory(params?: {}): Promise<implicitReturnType>;
333
+ utaPrivateGetPositionHistory(params?: {}): Promise<implicitReturnType>;
333
334
  utaPrivateGetAccountModePositionTiers(params?: {}): Promise<implicitReturnType>;
334
335
  utaPrivateGetSubAccountBalance(params?: {}): Promise<implicitReturnType>;
335
336
  utaPrivateGetUserFeeRate(params?: {}): Promise<implicitReturnType>;
@@ -330,6 +330,7 @@ interface kucoin {
330
330
  utaPrivateGetAccountModeOrderExecution(params?: {}): Promise<implicitReturnType>;
331
331
  utaPrivateGetAccountModePositionOpenList(params?: {}): Promise<implicitReturnType>;
332
332
  utaPrivateGetAccountModePositionHistory(params?: {}): Promise<implicitReturnType>;
333
+ utaPrivateGetPositionHistory(params?: {}): Promise<implicitReturnType>;
333
334
  utaPrivateGetAccountModePositionTiers(params?: {}): Promise<implicitReturnType>;
334
335
  utaPrivateGetSubAccountBalance(params?: {}): Promise<implicitReturnType>;
335
336
  utaPrivateGetUserFeeRate(params?: {}): Promise<implicitReturnType>;
@@ -650,7 +650,7 @@ export default class aftermath extends Exchange {
650
650
  //
651
651
  // [
652
652
  // {
653
- // "id": "0x21c5e3d2f5bcfd4351a62cd70874878b7923b56d79d04225ed96370a7ac844c4",
653
+ // "id": "0x22c5e3d2f5bcfd4351a62cd70874878b7923b56d79d04225ed96370a7ac844c4",
654
654
  // "type": "primary",
655
655
  // "code": "USDC",
656
656
  // "accountNumber": 14822
@@ -464,7 +464,7 @@ export default class backpack extends Exchange {
464
464
  'INSUFFICIENT_SUPPLY': InsufficientFunds,
465
465
  'INVALID_ASSET': BadRequest,
466
466
  'INVALID_MARKET': BadSymbol,
467
- 'INVALID_PRICE': BadRequest,
467
+ 'INVALID_PRICE': InvalidOrder,
468
468
  'INVALID_POSITION_ID': BadRequest,
469
469
  'INVALID_QUANTITY': BadRequest,
470
470
  'INVALID_RANGE': BadRequest,
@@ -696,6 +696,7 @@ export default class Exchange {
696
696
  getListFromObjectValues(objects: any, key: IndexType): any[];
697
697
  getSymbolsForMarketType(marketType?: Str, subType?: Str, symbolWithActiveStatus?: boolean, symbolWithUnknownStatus?: boolean): any[];
698
698
  filterByArray(objects: any, key: IndexType, values?: any, indexed?: boolean): any;
699
+ filterOutByArray(objects: any, key: IndexType, values?: any, indexed?: boolean): any;
699
700
  fetch2(path: any, api?: any, method?: string, params?: {}, headers?: any, body?: any, config?: {}): Promise<any>;
700
701
  request(path: any, api?: any, method?: string, params?: {}, headers?: any, body?: any, config?: {}): Promise<any>;
701
702
  loadAccounts(reload?: boolean, params?: {}): Promise<Account[]>;
@@ -5006,6 +5006,30 @@ export default class Exchange {
5006
5006
  }
5007
5007
  return results;
5008
5008
  }
5009
+ filterOutByArray(objects, key, values = undefined, indexed = true) {
5010
+ objects = this.toArray(objects);
5011
+ // return all of them if no values were passed
5012
+ if (values === undefined || !values) {
5013
+ // return indexed ? this.indexBy (objects, key) : objects;
5014
+ if (indexed) {
5015
+ return this.indexBy(objects, key);
5016
+ }
5017
+ else {
5018
+ return objects;
5019
+ }
5020
+ }
5021
+ const results = [];
5022
+ for (let i = 0; i < objects.length; i++) {
5023
+ if (!this.inArray(objects[i][key], values)) {
5024
+ results.push(objects[i]);
5025
+ }
5026
+ }
5027
+ // return indexed ? this.indexBy (results, key) : results;
5028
+ if (indexed) {
5029
+ return this.indexBy(results, key);
5030
+ }
5031
+ return results;
5032
+ }
5009
5033
  async fetch2(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}) {
5010
5034
  if (this.enableRateLimit) {
5011
5035
  const cost = this.calculateRateLimiterCost(api, method, path, params, config);
package/js/src/binance.js CHANGED
@@ -3071,7 +3071,7 @@ export default class binance extends Exchange {
3071
3071
  for (let j = 0; j < networkList.length; j++) {
3072
3072
  const networkItem = networkList[j];
3073
3073
  const network = this.safeString(networkItem, 'network');
3074
- const networkCode = this.networkIdToCode(network);
3074
+ const networkCode = this.networkIdToCode(network, code);
3075
3075
  const isETF = (network === 'ETF'); // e.g. BTCUP, ETHDOWN
3076
3076
  // const name = this.safeString (networkItem, 'name');
3077
3077
  const withdrawFee = this.safeNumber(networkItem, 'withdrawFee');
@@ -9395,12 +9395,10 @@ export default class binance extends Exchange {
9395
9395
  'coin': currency['id'],
9396
9396
  // 'network': 'ETH', // 'BSC', 'XMR', you can get network and isDefault in networkList in the response of sapiGetCapitalConfigDetail
9397
9397
  };
9398
- const networks = this.safeDict(this.options, 'networks', {});
9399
- let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
9400
- network = this.safeString(networks, network, network); // handle ERC20>ETH alias
9401
- if (network !== undefined) {
9402
- request['network'] = network;
9403
- params = this.omit(params, 'network');
9398
+ let networkCode = undefined;
9399
+ [networkCode, params] = this.handleNetworkCodeAndParams(params);
9400
+ if (networkCode !== undefined) {
9401
+ request['network'] = this.networkCodeToId(networkCode, currency['code']);
9404
9402
  }
9405
9403
  // has support for the 'network' parameter
9406
9404
  const response = await this.sapiGetCapitalDepositAddress(this.extend(request, params));
@@ -9660,12 +9658,13 @@ export default class binance extends Exchange {
9660
9658
  // ]
9661
9659
  // }
9662
9660
  //
9661
+ const code = this.safeString(currency, 'code');
9663
9662
  const networkList = this.safeList(fee, 'networkList', []);
9664
9663
  const result = this.depositWithdrawFee(fee);
9665
9664
  for (let j = 0; j < networkList.length; j++) {
9666
9665
  const networkEntry = networkList[j];
9667
9666
  const networkId = this.safeString(networkEntry, 'network');
9668
- const networkCode = this.networkIdToCode(networkId);
9667
+ const networkCode = this.networkIdToCode(networkId, code);
9669
9668
  const withdrawFee = this.safeNumber(networkEntry, 'withdrawFee');
9670
9669
  const isDefault = this.safeBool(networkEntry, 'isDefault');
9671
9670
  if (isDefault === true) {
@@ -9713,14 +9712,12 @@ export default class binance extends Exchange {
9713
9712
  if (tag !== undefined) {
9714
9713
  request['addressTag'] = tag;
9715
9714
  }
9716
- const networks = this.safeDict(this.options, 'networks', {});
9717
- let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
9718
- network = this.safeString(networks, network, network); // handle ERC20>ETH alias
9719
- if (network !== undefined) {
9720
- request['network'] = network;
9721
- params = this.omit(params, 'network');
9715
+ let networkCode = undefined;
9716
+ [networkCode, params] = this.handleNetworkCodeAndParams(params);
9717
+ if (networkCode !== undefined) {
9718
+ request['network'] = this.networkCodeToId(networkCode, currency['code']);
9722
9719
  }
9723
- request['amount'] = this.currencyToPrecision(code, amount, network);
9720
+ request['amount'] = this.currencyToPrecision(currency['code'], amount, networkCode);
9724
9721
  const response = await this.sapiPostCapitalWithdrawApply(this.extend(request, params));
9725
9722
  // { id: '9a67628b16ba4988ae20d329333f16bc' }
9726
9723
  return this.parseTransaction(response, currency);
@@ -865,30 +865,25 @@ export default class bitfinex extends Exchange {
865
865
  const pool = this.safeList(indexed['pool'], id, []);
866
866
  const rawType = this.safeString(pool, 1);
867
867
  const isCryptoCoin = (rawType !== undefined) || (id in indexed['explorer']); // "hacky" solution
868
- let type = undefined;
869
- if (isCryptoCoin) {
870
- type = 'crypto';
871
- }
868
+ const type = isCryptoCoin ? 'crypto' : undefined;
872
869
  const feeValues = this.safeList(indexed['fees'], id, []);
873
870
  const fees = this.safeList(feeValues, 1, []);
874
871
  const fee = this.safeNumber(fees, 1);
875
872
  const undl = this.safeList(indexed['undl'], id, []);
876
873
  const precision = '8'; // default precision, todo: fix "magic constants"
877
- const dwStatuses = this.safeList(indexed['statuses'], id, []);
878
- const depositEnabled = this.safeInteger(dwStatuses, 1) === 1;
879
- const withdrawEnabled = this.safeInteger(dwStatuses, 2) === 1;
880
874
  const networks = {};
881
875
  const netwokIds = this.safeList(indexedNetworks, id, []);
882
876
  for (let j = 0; j < netwokIds.length; j++) {
883
877
  const networkId = netwokIds[j];
884
878
  const network = this.networkIdToCode(networkId);
879
+ const dwStatuses = this.safeList(indexed['statuses'], networkId, []);
885
880
  networks[network] = {
886
881
  'info': networkId,
887
882
  'id': networkId.toLowerCase(),
888
883
  'network': networkId,
889
884
  'active': undefined,
890
- 'deposit': undefined,
891
- 'withdraw': undefined,
885
+ 'deposit': this.safeInteger(dwStatuses, 1) === 1,
886
+ 'withdraw': this.safeInteger(dwStatuses, 2) === 1,
892
887
  'fee': undefined,
893
888
  'precision': undefined,
894
889
  'limits': {
@@ -906,8 +901,8 @@ export default class bitfinex extends Exchange {
906
901
  'type': type,
907
902
  'name': name,
908
903
  'active': true,
909
- 'deposit': depositEnabled,
910
- 'withdraw': withdrawEnabled,
904
+ 'deposit': undefined,
905
+ 'withdraw': undefined,
911
906
  'fee': fee,
912
907
  'precision': parseInt(precision),
913
908
  'limits': {
@@ -311,7 +311,7 @@ export default class bitget extends Exchange {
311
311
  * @param {string} type 'market' or 'limit'
312
312
  * @param {string} side 'buy' or 'sell'
313
313
  * @param {float} amount how much you want to trade in units of the base currency
314
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
314
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders, and used as the execution price for contract stop-loss / take-profit orders
315
315
  * @param {object} [params] extra parameters specific to the exchange API endpoint
316
316
  * @param {float} [params.cost] *spot only* how much you want to trade in units of the quote currency, for market buy orders only
317
317
  * @param {float} [params.triggerPrice] *swap only* The price at which a trigger order is triggered at