ccxt 4.2.93 → 4.2.95

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 (60) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +1055 -366
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +22 -1
  6. package/dist/cjs/src/base/errors.js +25 -64
  7. package/dist/cjs/src/base/ws/OrderBookSide.js +5 -0
  8. package/dist/cjs/src/binance.js +63 -2
  9. package/dist/cjs/src/bitget.js +139 -0
  10. package/dist/cjs/src/bitstamp.js +6 -0
  11. package/dist/cjs/src/coinex.js +61 -55
  12. package/dist/cjs/src/gemini.js +2 -1
  13. package/dist/cjs/src/htx.js +127 -125
  14. package/dist/cjs/src/okx.js +193 -40
  15. package/dist/cjs/src/pro/coinbase.js +18 -0
  16. package/dist/cjs/src/pro/kraken.js +107 -17
  17. package/dist/cjs/src/pro/krakenfutures.js +117 -40
  18. package/dist/cjs/src/pro/kucoin.js +30 -19
  19. package/dist/cjs/src/woo.js +139 -0
  20. package/examples/js/cli.js +4 -1
  21. package/examples/ts/cli.ts +4 -1
  22. package/js/ccxt.d.ts +4 -4
  23. package/js/ccxt.js +3 -3
  24. package/js/src/abstract/binance.d.ts +1 -0
  25. package/js/src/abstract/binancecoinm.d.ts +1 -0
  26. package/js/src/abstract/binanceus.d.ts +1 -0
  27. package/js/src/abstract/binanceusdm.d.ts +1 -0
  28. package/js/src/abstract/bitstamp.d.ts +6 -0
  29. package/js/src/base/Exchange.d.ts +8 -2
  30. package/js/src/base/Exchange.js +22 -1
  31. package/js/src/base/errorHierarchy.d.ts +1 -1
  32. package/js/src/base/errorHierarchy.js +1 -1
  33. package/js/src/base/errors.d.ts +26 -26
  34. package/js/src/base/errors.js +26 -66
  35. package/js/src/base/types.d.ts +12 -0
  36. package/js/src/base/ws/OrderBook.d.ts +7 -0
  37. package/js/src/base/ws/OrderBook.js +1 -6
  38. package/js/src/base/ws/OrderBookSide.d.ts +9 -3
  39. package/js/src/base/ws/OrderBookSide.js +6 -1
  40. package/js/src/binance.d.ts +1 -0
  41. package/js/src/binance.js +63 -2
  42. package/js/src/bitget.d.ts +4 -1
  43. package/js/src/bitget.js +139 -0
  44. package/js/src/bitstamp.js +6 -0
  45. package/js/src/coinex.js +61 -55
  46. package/js/src/gemini.js +2 -1
  47. package/js/src/htx.d.ts +1 -0
  48. package/js/src/htx.js +128 -126
  49. package/js/src/okx.d.ts +4 -1
  50. package/js/src/okx.js +193 -40
  51. package/js/src/pro/coinbase.js +18 -0
  52. package/js/src/pro/kraken.d.ts +6 -1
  53. package/js/src/pro/kraken.js +107 -17
  54. package/js/src/pro/krakenfutures.d.ts +8 -2
  55. package/js/src/pro/krakenfutures.js +117 -40
  56. package/js/src/pro/kucoin.js +30 -19
  57. package/js/src/woo.d.ts +4 -1
  58. package/js/src/woo.js +139 -0
  59. package/package.json +1 -1
  60. package/skip-tests.json +5 -0
@@ -57,6 +57,8 @@ class woo extends woo$1 {
57
57
  'fetchCanceledOrders': false,
58
58
  'fetchClosedOrder': false,
59
59
  'fetchClosedOrders': true,
60
+ 'fetchConvertCurrencies': true,
61
+ 'fetchConvertQuote': true,
60
62
  'fetchCurrencies': true,
61
63
  'fetchDepositAddress': true,
62
64
  'fetchDeposits': true,
@@ -2985,6 +2987,143 @@ class woo extends woo$1 {
2985
2987
  'takeProfitPrice': undefined,
2986
2988
  });
2987
2989
  }
2990
+ async fetchConvertQuote(fromCode, toCode, amount = undefined, params = {}) {
2991
+ /**
2992
+ * @method
2993
+ * @name woo#fetchConvertQuote
2994
+ * @description fetch a quote for converting from one currency to another
2995
+ * @see https://docs.woo.org/#get-quote-rfq
2996
+ * @param {string} fromCode the currency that you want to sell and convert from
2997
+ * @param {string} toCode the currency that you want to buy and convert into
2998
+ * @param {float} [amount] how much you want to trade in units of the from currency
2999
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3000
+ * @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
3001
+ */
3002
+ await this.loadMarkets();
3003
+ const request = {
3004
+ 'sellToken': fromCode.toUpperCase(),
3005
+ 'buyToken': toCode.toUpperCase(),
3006
+ 'sellQuantity': this.numberToString(amount),
3007
+ };
3008
+ const response = await this.v3PrivateGetConvertRfq(this.extend(request, params));
3009
+ //
3010
+ // {
3011
+ // "success": true,
3012
+ // "data": {
3013
+ // "quoteId": 123123123,
3014
+ // "counterPartyId": "",
3015
+ // "sellToken": "ETH",
3016
+ // "sellQuantity": "0.0445",
3017
+ // "buyToken": "USDT",
3018
+ // "buyQuantity": "33.45",
3019
+ // "buyPrice": "6.77",
3020
+ // "expireTimestamp": 1659084466000,
3021
+ // "message": 1659084466000
3022
+ // }
3023
+ // }
3024
+ //
3025
+ const data = this.safeDict(response, 'data', {});
3026
+ const fromCurrencyId = this.safeString(data, 'sellToken', fromCode);
3027
+ const fromCurrency = this.currency(fromCurrencyId);
3028
+ const toCurrencyId = this.safeString(data, 'buyToken', toCode);
3029
+ const toCurrency = this.currency(toCurrencyId);
3030
+ return this.parseConversion(data, fromCurrency, toCurrency);
3031
+ }
3032
+ parseConversion(conversion, fromCurrency = undefined, toCurrency = undefined) {
3033
+ //
3034
+ // fetchConvertQuote
3035
+ //
3036
+ // {
3037
+ // "quoteId": 123123123,
3038
+ // "counterPartyId": "",
3039
+ // "sellToken": "ETH",
3040
+ // "sellQuantity": "0.0445",
3041
+ // "buyToken": "USDT",
3042
+ // "buyQuantity": "33.45",
3043
+ // "buyPrice": "6.77",
3044
+ // "expireTimestamp": 1659084466000,
3045
+ // "message": 1659084466000
3046
+ // }
3047
+ //
3048
+ const timestamp = this.safeInteger(conversion, 'expireTimestamp');
3049
+ const fromCoin = this.safeString(conversion, 'sellToken');
3050
+ const fromCode = this.safeCurrencyCode(fromCoin, fromCurrency);
3051
+ const to = this.safeString(conversion, 'buyToken');
3052
+ const toCode = this.safeCurrencyCode(to, toCurrency);
3053
+ return {
3054
+ 'info': conversion,
3055
+ 'timestamp': timestamp,
3056
+ 'datetime': this.iso8601(timestamp),
3057
+ 'id': this.safeString(conversion, 'quoteId'),
3058
+ 'fromCurrency': fromCode,
3059
+ 'fromAmount': this.safeNumber(conversion, 'sellQuantity'),
3060
+ 'toCurrency': toCode,
3061
+ 'toAmount': this.safeNumber(conversion, 'buyQuantity'),
3062
+ 'price': this.safeNumber(conversion, 'buyPrice'),
3063
+ 'fee': undefined,
3064
+ };
3065
+ }
3066
+ async fetchConvertCurrencies(params = {}) {
3067
+ /**
3068
+ * @method
3069
+ * @name woo#fetchConvertCurrencies
3070
+ * @description fetches all available currencies that can be converted
3071
+ * @see https://docs.woo.org/#get-quote-asset-info
3072
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3073
+ * @returns {object} an associative dictionary of currencies
3074
+ */
3075
+ await this.loadMarkets();
3076
+ const response = await this.v3PrivateGetConvertAssetInfo(params);
3077
+ //
3078
+ // {
3079
+ // "success": true,
3080
+ // "rows": [
3081
+ // {
3082
+ // "token": "BTC",
3083
+ // "tick": 0.0001,
3084
+ // "createdTime": "1575014248.99", // Unix epoch time in seconds
3085
+ // "updatedTime": "1575014248.99" // Unix epoch time in seconds
3086
+ // },
3087
+ // ]
3088
+ // }
3089
+ //
3090
+ const result = {};
3091
+ const data = this.safeList(response, 'rows', []);
3092
+ for (let i = 0; i < data.length; i++) {
3093
+ const entry = data[i];
3094
+ const id = this.safeString(entry, 'token');
3095
+ const code = this.safeCurrencyCode(id);
3096
+ result[code] = {
3097
+ 'info': entry,
3098
+ 'id': id,
3099
+ 'code': code,
3100
+ 'networks': undefined,
3101
+ 'type': undefined,
3102
+ 'name': undefined,
3103
+ 'active': undefined,
3104
+ 'deposit': undefined,
3105
+ 'withdraw': undefined,
3106
+ 'fee': undefined,
3107
+ 'precision': this.safeNumber(entry, 'tick'),
3108
+ 'limits': {
3109
+ 'amount': {
3110
+ 'min': undefined,
3111
+ 'max': undefined,
3112
+ },
3113
+ 'withdraw': {
3114
+ 'min': undefined,
3115
+ 'max': undefined,
3116
+ },
3117
+ 'deposit': {
3118
+ 'min': undefined,
3119
+ 'max': undefined,
3120
+ },
3121
+ },
3122
+ 'created': this.safeTimestamp(entry, 'createdTime'),
3123
+ };
3124
+ }
3125
+ return result;
3126
+ }
2988
3127
  defaultNetworkCodeForCurrency(code) {
2989
3128
  const currencyItem = this.currency(code);
2990
3129
  const networks = currencyItem['networks'];
@@ -112,8 +112,11 @@ try {
112
112
  for (const [credential, isRequired] of Object.entries (requiredCredentials)) {
113
113
  if (isRequired && exchange[credential] === undefined) {
114
114
  const credentialEnvName = (exchangeId + '_' + credential).toUpperCase () // example: KRAKEN_APIKEY
115
- const credentialValue = process.env[credentialEnvName]
115
+ let credentialValue = process.env[credentialEnvName]
116
116
  if (credentialValue) {
117
+ if (credentialValue.indexOf('---BEGIN') > -1) {
118
+ credentialValue = credentialValue.replaceAll('\\n', '\n');
119
+ }
117
120
  exchange[credential] = credentialValue
118
121
  }
119
122
  }
@@ -109,8 +109,11 @@ try {
109
109
  for (const [credential, isRequired] of Object.entries (requiredCredentials)) {
110
110
  if (isRequired && exchange[credential] === undefined) {
111
111
  const credentialEnvName = (exchangeId + '_' + credential).toUpperCase () // example: KRAKEN_APIKEY
112
- const credentialValue = process.env[credentialEnvName]
112
+ let credentialValue = process.env[credentialEnvName]
113
113
  if (credentialValue) {
114
+ if (credentialValue.indexOf('---BEGIN') > -1) {
115
+ credentialValue = (credentialValue as any).replaceAll('\\n', '\n');
116
+ }
114
117
  exchange[credential] = credentialValue
115
118
  }
116
119
  }
package/js/ccxt.d.ts CHANGED
@@ -2,9 +2,9 @@ import { Exchange } from './src/base/Exchange.js';
2
2
  import { Precise } from './src/base/Precise.js';
3
3
  import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
- import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain } from './src/base/types.js';
6
- import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser } from './src/base/errors.js';
7
- declare const version = "4.2.92";
5
+ import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion } from './src/base/types.js';
6
+ import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
7
+ declare const version = "4.2.94";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -519,5 +519,5 @@ declare const ccxt: {
519
519
  zaif: typeof zaif;
520
520
  zonda: typeof zonda;
521
521
  } & typeof functions & typeof errors;
522
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
522
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
523
523
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -35,10 +35,10 @@ import { Exchange } from './src/base/Exchange.js';
35
35
  import { Precise } from './src/base/Precise.js';
36
36
  import * as functions from './src/base/functions.js';
37
37
  import * as errors from './src/base/errors.js';
38
- import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser } from './src/base/errors.js';
38
+ import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.2.93';
41
+ const version = '4.2.95';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -392,6 +392,6 @@ pro.exchanges = Object.keys(pro);
392
392
  pro['Exchange'] = Exchange; // now the same for rest and ts
393
393
  //-----------------------------------------------------------------------------
394
394
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
395
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
395
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
396
396
  export default ccxt;
397
397
  //-----------------------------------------------------------------------------
@@ -607,6 +607,7 @@ interface Exchange {
607
607
  privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
608
608
  privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
609
609
  privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
610
+ privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
610
611
  privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
611
612
  privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
612
613
  privatePostOrder(params?: {}): Promise<implicitReturnType>;
@@ -607,6 +607,7 @@ interface binance {
607
607
  privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
608
608
  privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
609
609
  privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
610
+ privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
610
611
  privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
611
612
  privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
612
613
  privatePostOrder(params?: {}): Promise<implicitReturnType>;
@@ -659,6 +659,7 @@ interface binance {
659
659
  privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
660
660
  privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
661
661
  privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
662
+ privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
662
663
  privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
663
664
  privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
664
665
  privatePostOrder(params?: {}): Promise<implicitReturnType>;
@@ -607,6 +607,7 @@ interface binance {
607
607
  privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
608
608
  privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
609
609
  privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
610
+ privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
610
611
  privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
611
612
  privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
612
613
  privatePostOrder(params?: {}): Promise<implicitReturnType>;
@@ -233,6 +233,12 @@ interface Exchange {
233
233
  privatePostBlurAddress(params?: {}): Promise<implicitReturnType>;
234
234
  privatePostVextWithdrawal(params?: {}): Promise<implicitReturnType>;
235
235
  privatePostVextAddress(params?: {}): Promise<implicitReturnType>;
236
+ privatePostCsprWithdrawal(params?: {}): Promise<implicitReturnType>;
237
+ privatePostCsprAddress(params?: {}): Promise<implicitReturnType>;
238
+ privatePostVchfWithdrawal(params?: {}): Promise<implicitReturnType>;
239
+ privatePostVchfAddress(params?: {}): Promise<implicitReturnType>;
240
+ privatePostVeurWithdrawal(params?: {}): Promise<implicitReturnType>;
241
+ privatePostVeurAddress(params?: {}): Promise<implicitReturnType>;
236
242
  }
237
243
  declare abstract class Exchange extends _Exchange {
238
244
  }
@@ -3,8 +3,8 @@ import { // eslint-disable-line object-curly-newline
3
3
  ExchangeError, AuthenticationError, DDoSProtection, RequestTimeout, ExchangeNotAvailable, RateLimitExceeded } from "./errors.js";
4
4
  import WsClient from './ws/WsClient.js';
5
5
  import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
6
- import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees } from './types.js';
7
- export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, BorrowRate, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings } from './types.js';
6
+ import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion } from './types.js';
7
+ export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, BorrowRate, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, Conversion } from './types.js';
8
8
  import { ArrayCache, ArrayCacheByTimestamp } from './ws/Cache.js';
9
9
  import { OrderBook as Ob } from './ws/OrderBook.js';
10
10
  /**
@@ -348,6 +348,8 @@ export default class Exchange {
348
348
  fetchClosedOrder: any;
349
349
  fetchClosedOrders: any;
350
350
  fetchClosedOrdersWs: any;
351
+ fetchConvertCurrencies: any;
352
+ fetchConvertQuote: any;
351
353
  fetchCrossBorrowRate: any;
352
354
  fetchCrossBorrowRates: any;
353
355
  fetchCurrencies: string;
@@ -776,6 +778,7 @@ export default class Exchange {
776
778
  convertOHLCVToTradingView(ohlcvs: number[][], timestamp?: string, open?: string, high?: string, low?: string, close?: string, volume?: string, ms?: boolean): {};
777
779
  fetchWebEndpoint(method: any, endpointMethod: any, returnAsJson: any, startRegex?: any, endRegex?: any): Promise<any>;
778
780
  marketIds(symbols?: Strings): any[];
781
+ marketsForSymbols(symbols?: Strings): any[];
779
782
  marketSymbols(symbols?: Strings, type?: Str, allowEmpty?: boolean, sameTypeOnly?: boolean, sameSubTypeOnly?: boolean): any[];
780
783
  marketCodes(codes?: Strings): any[];
781
784
  parseBidsAsks(bidasks: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): any[];
@@ -910,6 +913,7 @@ export default class Exchange {
910
913
  fetchGreeks(symbol: string, params?: {}): Promise<Greeks>;
911
914
  fetchOptionChain(code: string, params?: {}): Promise<OptionChain>;
912
915
  fetchOption(symbol: string, params?: {}): Promise<Option>;
916
+ fetchConvertQuote(fromCode: string, toCode: string, amount?: Num, params?: {}): Promise<Conversion>;
913
917
  fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
914
918
  fetchDeposits(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
915
919
  fetchWithdrawals(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
@@ -974,6 +978,7 @@ export default class Exchange {
974
978
  fetchTradingFees(params?: {}): Promise<TradingFees>;
975
979
  fetchTradingFeesWs(params?: {}): Promise<TradingFees>;
976
980
  fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
981
+ fetchConvertCurrencies(params?: {}): Promise<Currencies>;
977
982
  parseOpenInterest(interest: any, market?: Market): OpenInterest;
978
983
  parseOpenInterests(response: any, market?: any, since?: Int, limit?: Int): OpenInterest[];
979
984
  fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
@@ -1015,6 +1020,7 @@ export default class Exchange {
1015
1020
  parseMarginMode(marginMode: any, market?: Market): MarginMode;
1016
1021
  parseLeverages(response: object[], symbols?: string[], symbolKey?: Str, marketType?: MarketType): Leverages;
1017
1022
  parseLeverage(leverage: any, market?: Market): Leverage;
1023
+ parseConversion(conversion: any, fromCurrency?: Currency, toCurrency?: Currency): Conversion;
1018
1024
  convertExpireDate(date: string): string;
1019
1025
  convertExpireDateToMarketIdDate(date: string): string;
1020
1026
  convertMarketIdExpireDate(date: string): string;
@@ -406,6 +406,8 @@ export default class Exchange {
406
406
  'fetchClosedOrder': undefined,
407
407
  'fetchClosedOrders': undefined,
408
408
  'fetchClosedOrdersWs': undefined,
409
+ 'fetchConvertCurrencies': undefined,
410
+ 'fetchConvertQuote': undefined,
409
411
  'fetchCrossBorrowRate': undefined,
410
412
  'fetchCrossBorrowRates': undefined,
411
413
  'fetchCurrencies': 'emulated',
@@ -3165,6 +3167,16 @@ export default class Exchange {
3165
3167
  }
3166
3168
  return result;
3167
3169
  }
3170
+ marketsForSymbols(symbols = undefined) {
3171
+ if (symbols === undefined) {
3172
+ return symbols;
3173
+ }
3174
+ const result = [];
3175
+ for (let i = 0; i < symbols.length; i++) {
3176
+ result.push(this.market(symbols[i]));
3177
+ }
3178
+ return result;
3179
+ }
3168
3180
  marketSymbols(symbols = undefined, type = undefined, allowEmpty = true, sameTypeOnly = false, sameSubTypeOnly = false) {
3169
3181
  if (symbols === undefined) {
3170
3182
  if (!allowEmpty) {
@@ -4513,6 +4525,9 @@ export default class Exchange {
4513
4525
  async fetchOption(symbol, params = {}) {
4514
4526
  throw new NotSupported(this.id + ' fetchOption() is not supported yet');
4515
4527
  }
4528
+ async fetchConvertQuote(fromCode, toCode, amount = undefined, params = {}) {
4529
+ throw new NotSupported(this.id + ' fetchConvertQuote() is not supported yet');
4530
+ }
4516
4531
  async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
4517
4532
  /**
4518
4533
  * @method
@@ -5061,6 +5076,9 @@ export default class Exchange {
5061
5076
  const fees = await this.fetchTradingFees(params);
5062
5077
  return this.safeDict(fees, symbol);
5063
5078
  }
5079
+ async fetchConvertCurrencies(params = {}) {
5080
+ throw new NotSupported(this.id + ' fetchConvertCurrencies() is not supported yet');
5081
+ }
5064
5082
  parseOpenInterest(interest, market = undefined) {
5065
5083
  throw new NotSupported(this.id + ' parseOpenInterest () is not supported yet');
5066
5084
  }
@@ -5758,7 +5776,10 @@ export default class Exchange {
5758
5776
  return leverageStructures;
5759
5777
  }
5760
5778
  parseLeverage(leverage, market = undefined) {
5761
- throw new NotSupported(this.id + ' parseLeverage() is not supported yet');
5779
+ throw new NotSupported(this.id + ' parseLeverage () is not supported yet');
5780
+ }
5781
+ parseConversion(conversion, fromCurrency = undefined, toCurrency = undefined) {
5782
+ throw new NotSupported(this.id + ' parseConversion () is not supported yet');
5762
5783
  }
5763
5784
  convertExpireDate(date) {
5764
5785
  // parse YYMMDD to datetime string
@@ -34,6 +34,7 @@ declare const errorHierarchy: {
34
34
  };
35
35
  NotSupported: {};
36
36
  ProxyError: {};
37
+ ExchangeClosedByUser: {};
37
38
  };
38
39
  OperationFailed: {
39
40
  NetworkError: {
@@ -46,7 +47,6 @@ declare const errorHierarchy: {
46
47
  RequestTimeout: {};
47
48
  };
48
49
  };
49
- ExchangeClosedByUser: {};
50
50
  };
51
51
  };
52
52
  export default errorHierarchy;
@@ -40,6 +40,7 @@ const errorHierarchy = {
40
40
  },
41
41
  'NotSupported': {},
42
42
  'ProxyError': {},
43
+ 'ExchangeClosedByUser': {},
43
44
  },
44
45
  'OperationFailed': {
45
46
  'NetworkError': {
@@ -52,7 +53,6 @@ const errorHierarchy = {
52
53
  'RequestTimeout': {},
53
54
  },
54
55
  },
55
- 'ExchangeClosedByUser': {},
56
56
  },
57
57
  };
58
58
  export default errorHierarchy;
@@ -1,22 +1,19 @@
1
1
  declare class BaseError extends Error {
2
2
  constructor(message: any);
3
3
  }
4
- declare class ExchangeError extends Error {
5
- constructor(message: any);
6
- }
7
- declare class ExchangeClosedByUser extends Error {
4
+ declare class ExchangeError extends BaseError {
8
5
  constructor(message: any);
9
6
  }
10
7
  declare class AuthenticationError extends ExchangeError {
11
8
  constructor(message: any);
12
9
  }
13
- declare class PermissionDenied extends ExchangeError {
10
+ declare class PermissionDenied extends AuthenticationError {
14
11
  constructor(message: any);
15
12
  }
16
- declare class AccountNotEnabled extends ExchangeError {
13
+ declare class AccountNotEnabled extends PermissionDenied {
17
14
  constructor(message: any);
18
15
  }
19
- declare class AccountSuspended extends ExchangeError {
16
+ declare class AccountSuspended extends AuthenticationError {
20
17
  constructor(message: any);
21
18
  }
22
19
  declare class ArgumentsRequired extends ExchangeError {
@@ -25,10 +22,10 @@ declare class ArgumentsRequired extends ExchangeError {
25
22
  declare class BadRequest extends ExchangeError {
26
23
  constructor(message: any);
27
24
  }
28
- declare class OperationRejected extends ExchangeError {
25
+ declare class BadSymbol extends BadRequest {
29
26
  constructor(message: any);
30
27
  }
31
- declare class BadSymbol extends BadRequest {
28
+ declare class OperationRejected extends ExchangeError {
32
29
  constructor(message: any);
33
30
  }
34
31
  declare class NoChange extends OperationRejected {
@@ -40,7 +37,7 @@ declare class MarginModeAlreadySet extends NoChange {
40
37
  declare class BadResponse extends ExchangeError {
41
38
  constructor(message: any);
42
39
  }
43
- declare class NullResponse extends ExchangeError {
40
+ declare class NullResponse extends BadResponse {
44
41
  constructor(message: any);
45
42
  }
46
43
  declare class InsufficientFunds extends ExchangeError {
@@ -55,9 +52,6 @@ declare class AddressPending extends InvalidAddress {
55
52
  declare class InvalidOrder extends ExchangeError {
56
53
  constructor(message: any);
57
54
  }
58
- declare class ContractUnavailable extends InvalidOrder {
59
- constructor(message: any);
60
- }
61
55
  declare class OrderNotFound extends InvalidOrder {
62
56
  constructor(message: any);
63
57
  }
@@ -76,15 +70,21 @@ declare class OrderNotFillable extends InvalidOrder {
76
70
  declare class DuplicateOrderId extends InvalidOrder {
77
71
  constructor(message: any);
78
72
  }
79
- declare class NotSupported extends ExchangeError {
73
+ declare class ContractUnavailable extends InvalidOrder {
80
74
  constructor(message: any);
81
75
  }
82
- declare class OperationFailed extends BaseError {
76
+ declare class NotSupported extends ExchangeError {
83
77
  constructor(message: any);
84
78
  }
85
79
  declare class ProxyError extends ExchangeError {
86
80
  constructor(message: any);
87
81
  }
82
+ declare class ExchangeClosedByUser extends ExchangeError {
83
+ constructor(message: any);
84
+ }
85
+ declare class OperationFailed extends BaseError {
86
+ constructor(message: any);
87
+ }
88
88
  declare class NetworkError extends OperationFailed {
89
89
  constructor(message: any);
90
90
  }
@@ -106,21 +106,25 @@ declare class InvalidNonce extends NetworkError {
106
106
  declare class RequestTimeout extends NetworkError {
107
107
  constructor(message: any);
108
108
  }
109
- declare const errors: {
109
+ export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
110
+ declare const _default: {
110
111
  BaseError: typeof BaseError;
111
- ExchangeClosedByUser: typeof ExchangeClosedByUser;
112
112
  ExchangeError: typeof ExchangeError;
113
+ AuthenticationError: typeof AuthenticationError;
113
114
  PermissionDenied: typeof PermissionDenied;
114
115
  AccountNotEnabled: typeof AccountNotEnabled;
115
116
  AccountSuspended: typeof AccountSuspended;
116
117
  ArgumentsRequired: typeof ArgumentsRequired;
117
118
  BadRequest: typeof BadRequest;
118
119
  BadSymbol: typeof BadSymbol;
120
+ OperationRejected: typeof OperationRejected;
121
+ NoChange: typeof NoChange;
119
122
  MarginModeAlreadySet: typeof MarginModeAlreadySet;
120
123
  BadResponse: typeof BadResponse;
121
124
  NullResponse: typeof NullResponse;
122
125
  InsufficientFunds: typeof InsufficientFunds;
123
126
  InvalidAddress: typeof InvalidAddress;
127
+ AddressPending: typeof AddressPending;
124
128
  InvalidOrder: typeof InvalidOrder;
125
129
  OrderNotFound: typeof OrderNotFound;
126
130
  OrderNotCached: typeof OrderNotCached;
@@ -128,7 +132,11 @@ declare const errors: {
128
132
  OrderImmediatelyFillable: typeof OrderImmediatelyFillable;
129
133
  OrderNotFillable: typeof OrderNotFillable;
130
134
  DuplicateOrderId: typeof DuplicateOrderId;
135
+ ContractUnavailable: typeof ContractUnavailable;
131
136
  NotSupported: typeof NotSupported;
137
+ ProxyError: typeof ProxyError;
138
+ ExchangeClosedByUser: typeof ExchangeClosedByUser;
139
+ OperationFailed: typeof OperationFailed;
132
140
  NetworkError: typeof NetworkError;
133
141
  DDoSProtection: typeof DDoSProtection;
134
142
  RateLimitExceeded: typeof RateLimitExceeded;
@@ -136,13 +144,5 @@ declare const errors: {
136
144
  OnMaintenance: typeof OnMaintenance;
137
145
  InvalidNonce: typeof InvalidNonce;
138
146
  RequestTimeout: typeof RequestTimeout;
139
- AuthenticationError: typeof AuthenticationError;
140
- AddressPending: typeof AddressPending;
141
- ContractUnavailable: typeof ContractUnavailable;
142
- NoChange: typeof NoChange;
143
- OperationRejected: typeof OperationRejected;
144
- OperationFailed: typeof OperationFailed;
145
- ProxyError: typeof ProxyError;
146
147
  };
147
- export { BaseError, ExchangeClosedByUser, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, ContractUnavailable, NoChange, OperationRejected, OperationFailed, ProxyError };
148
- export default errors;
148
+ export default _default;