ccxt 4.3.1__py2.py3-none-any.whl → 4.3.3__py2.py3-none-any.whl

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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

@@ -1333,7 +1333,7 @@ class kraken(Exchange, ImplicitAPI):
1333
1333
  'ordertype': type,
1334
1334
  'volume': self.amount_to_precision(symbol, amount),
1335
1335
  }
1336
- orderRequest = self.order_request('createOrder()', symbol, type, request, price, params)
1336
+ orderRequest = self.order_request('createOrder', symbol, type, request, price, params)
1337
1337
  response = await self.privatePostAddOrder(self.extend(orderRequest[0], orderRequest[1]))
1338
1338
  #
1339
1339
  # {
@@ -1659,7 +1659,10 @@ class kraken(Exchange, ImplicitAPI):
1659
1659
  request['price'] = trailingAmountString
1660
1660
  request['ordertype'] = 'trailing-stop'
1661
1661
  if reduceOnly:
1662
- request['reduce_only'] = 'true' # not using hasattr(self, boolean) case, because the urlencodedNested transforms it into 'True' string
1662
+ if method == 'createOrderWs':
1663
+ request['reduce_only'] = True # ws request can't have stringified bool
1664
+ else:
1665
+ request['reduce_only'] = 'true' # not using hasattr(self, boolean) case, because the urlencodedNested transforms it into 'True' string
1663
1666
  close = self.safe_value(params, 'close')
1664
1667
  if close is not None:
1665
1668
  close = self.extend({}, close)
@@ -1710,7 +1713,7 @@ class kraken(Exchange, ImplicitAPI):
1710
1713
  }
1711
1714
  if amount is not None:
1712
1715
  request['volume'] = self.amount_to_precision(symbol, amount)
1713
- orderRequest = self.order_request('editOrder()', symbol, type, request, price, params)
1716
+ orderRequest = self.order_request('editOrder', symbol, type, request, price, params)
1714
1717
  response = await self.privatePostEditOrder(self.extend(orderRequest[0], orderRequest[1]))
1715
1718
  #
1716
1719
  # {
@@ -607,6 +607,8 @@ class kucoin(Exchange, ImplicitAPI):
607
607
  'BIFI': 'BIFIF',
608
608
  'VAI': 'VAIOT',
609
609
  'WAX': 'WAXP',
610
+ 'ALT': 'APTOSLAUNCHTOKEN',
611
+ 'KALT': 'ALT', # ALTLAYER
610
612
  },
611
613
  'options': {
612
614
  'version': 'v1',
@@ -1777,7 +1779,7 @@ class kucoin(Exchange, ImplicitAPI):
1777
1779
  address = address.replace('bitcoincash:', '')
1778
1780
  code = None
1779
1781
  if currency is not None:
1780
- code = currency['id']
1782
+ code = self.safe_currency_code(currency['id'])
1781
1783
  if code != 'NIM':
1782
1784
  # contains spaces
1783
1785
  self.check_address(address)
@@ -1823,7 +1825,7 @@ class kucoin(Exchange, ImplicitAPI):
1823
1825
  self.options['versions']['private']['GET']['deposit-addresses'] = version
1824
1826
  chains = self.safe_list(response, 'data', [])
1825
1827
  parsed = self.parse_deposit_addresses(chains, [currency['code']], False, {
1826
- 'currency': currency['id'],
1828
+ 'currency': currency['code'],
1827
1829
  })
1828
1830
  return self.index_by(parsed, 'network')
1829
1831
 
@@ -2800,7 +2802,7 @@ class kucoin(Exchange, ImplicitAPI):
2800
2802
  async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
2801
2803
  """
2802
2804
  get the list of most recent trades for a particular symbol
2803
- :see: https://docs.kucoin.com/#get-trade-histories
2805
+ :see: https://www.kucoin.com/docs/rest/spot-trading/market-data/get-trade-histories
2804
2806
  :param str symbol: unified symbol of the market to fetch trades for
2805
2807
  :param int [since]: timestamp in ms of the earliest trade to fetch
2806
2808
  :param int [limit]: the maximum amount of trades to fetch
@@ -2965,7 +2967,7 @@ class kucoin(Exchange, ImplicitAPI):
2965
2967
  async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
2966
2968
  """
2967
2969
  fetch the trading fees for a market
2968
- :see: https://docs.kucoin.com/#actual-fee-rate-of-the-trading-pair
2970
+ :see: https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-spot-margin-trade_hf
2969
2971
  :param str symbol: unified market symbol
2970
2972
  :param dict [params]: extra parameters specific to the exchange API endpoint
2971
2973
  :returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
@@ -3003,7 +3005,7 @@ class kucoin(Exchange, ImplicitAPI):
3003
3005
  async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
3004
3006
  """
3005
3007
  make a withdrawal
3006
- :see: https://docs.kucoin.com/#apply-withdraw-2
3008
+ :see: https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw
3007
3009
  :param str code: unified currency code
3008
3010
  :param float amount: the amount to withdraw
3009
3011
  :param str address: the address to withdraw to
@@ -3164,8 +3166,8 @@ class kucoin(Exchange, ImplicitAPI):
3164
3166
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
3165
3167
  """
3166
3168
  fetch all deposits made to an account
3167
- :see: https://docs.kucoin.com/#get-deposit-list
3168
- :see: https://docs.kucoin.com/#get-v1-historical-deposits-list
3169
+ :see: https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-list
3170
+ :see: https://www.kucoin.com/docs/rest/funding/deposit/get-v1-historical-deposits-list
3169
3171
  :param str code: unified currency code
3170
3172
  :param int [since]: the earliest time in ms to fetch deposits for
3171
3173
  :param int [limit]: the maximum number of deposits structures to retrieve
@@ -3240,8 +3242,8 @@ class kucoin(Exchange, ImplicitAPI):
3240
3242
  async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
3241
3243
  """
3242
3244
  fetch all withdrawals made from an account
3243
- :see: https://docs.kucoin.com/#get-withdrawals-list
3244
- :see: https://docs.kucoin.com/#get-v1-historical-withdrawals-list
3245
+ :see: https://www.kucoin.com/docs/rest/funding/withdrawals/get-withdrawals-list
3246
+ :see: https://www.kucoin.com/docs/rest/funding/withdrawals/get-v1-historical-withdrawals-list
3245
3247
  :param str code: unified currency code
3246
3248
  :param int [since]: the earliest time in ms to fetch withdrawals for
3247
3249
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -3491,7 +3493,7 @@ class kucoin(Exchange, ImplicitAPI):
3491
3493
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
3492
3494
  """
3493
3495
  transfer currency internally between wallets on the same account
3494
- :see: https://docs.kucoin.com/#inner-transfer
3496
+ :see: https://www.kucoin.com/docs/rest/funding/transfer/inner-transfer
3495
3497
  :see: https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
3496
3498
  :see: https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
3497
3499
  :param str code: unified currency code
@@ -3758,7 +3760,7 @@ class kucoin(Exchange, ImplicitAPI):
3758
3760
 
3759
3761
  async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
3760
3762
  """
3761
- :see: https://docs.kucoin.com/#get-account-ledgers
3763
+ :see: https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
3762
3764
  :see: https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
3763
3765
  :see: https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
3764
3766
  fetch the history of changes, actions done by the user or operations that altered balance of the user
ccxt/async_support/okx.py CHANGED
@@ -87,6 +87,8 @@ class okx(Exchange, ImplicitAPI):
87
87
  'fetchClosedOrders': True,
88
88
  'fetchConvertCurrencies': True,
89
89
  'fetchConvertQuote': True,
90
+ 'fetchConvertTrade': True,
91
+ 'fetchConvertTradeHistory': True,
90
92
  'fetchCrossBorrowRate': True,
91
93
  'fetchCrossBorrowRates': True,
92
94
  'fetchCurrencies': True,
@@ -7203,6 +7205,96 @@ class okx(Exchange, ImplicitAPI):
7203
7205
  toCurrency = self.currency(toCurrencyId)
7204
7206
  return self.parse_conversion(result, fromCurrency, toCurrency)
7205
7207
 
7208
+ async def fetch_convert_trade(self, id: str, code: Str = None, params={}) -> Conversion:
7209
+ """
7210
+ fetch the data for a conversion trade
7211
+ :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-convert-history
7212
+ :param str id: the id of the trade that you want to fetch
7213
+ :param str [code]: the unified currency code of the conversion trade
7214
+ :param dict [params]: extra parameters specific to the exchange API endpoint
7215
+ :returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
7216
+ """
7217
+ await self.load_markets()
7218
+ request = {
7219
+ 'clTReqId': id,
7220
+ }
7221
+ response = await self.privateGetAssetConvertHistory(self.extend(request, params))
7222
+ #
7223
+ # {
7224
+ # "code": "0",
7225
+ # "data": [
7226
+ # {
7227
+ # "clTReqId": "",
7228
+ # "instId": "ETH-USDT",
7229
+ # "side": "buy",
7230
+ # "fillPx": "2932.401044",
7231
+ # "baseCcy": "ETH",
7232
+ # "quoteCcy": "USDT",
7233
+ # "fillBaseSz": "0.01023052",
7234
+ # "state": "fullyFilled",
7235
+ # "tradeId": "trader16461885203381437",
7236
+ # "fillQuoteSz": "30",
7237
+ # "ts": "1646188520000"
7238
+ # }
7239
+ # ],
7240
+ # "msg": ""
7241
+ # }
7242
+ #
7243
+ data = self.safe_list(response, 'data', [])
7244
+ result = self.safe_dict(data, 0, {})
7245
+ fromCurrencyId = self.safe_string(result, 'baseCcy')
7246
+ toCurrencyId = self.safe_string(result, 'quoteCcy')
7247
+ fromCurrency = None
7248
+ toCurrency = None
7249
+ if fromCurrencyId is not None:
7250
+ fromCurrency = self.currency(fromCurrencyId)
7251
+ if toCurrencyId is not None:
7252
+ toCurrency = self.currency(toCurrencyId)
7253
+ return self.parse_conversion(result, fromCurrency, toCurrency)
7254
+
7255
+ async def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Conversion]:
7256
+ """
7257
+ fetch the users history of conversion trades
7258
+ :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-convert-history
7259
+ :param str [code]: the unified currency code
7260
+ :param int [since]: the earliest time in ms to fetch conversions for
7261
+ :param int [limit]: the maximum number of conversion structures to retrieve
7262
+ :param dict [params]: extra parameters specific to the exchange API endpoint
7263
+ :param int [params.until]: timestamp in ms of the latest conversion to fetch
7264
+ :returns dict[]: a list of `conversion structures <https://docs.ccxt.com/#/?id=conversion-structure>`
7265
+ """
7266
+ await self.load_markets()
7267
+ request = {}
7268
+ request, params = self.handle_until_option('after', request, params)
7269
+ if since is not None:
7270
+ request['before'] = since
7271
+ if limit is not None:
7272
+ request['limit'] = limit
7273
+ response = await self.privateGetAssetConvertHistory(self.extend(request, params))
7274
+ #
7275
+ # {
7276
+ # "code": "0",
7277
+ # "data": [
7278
+ # {
7279
+ # "clTReqId": "",
7280
+ # "instId": "ETH-USDT",
7281
+ # "side": "buy",
7282
+ # "fillPx": "2932.401044",
7283
+ # "baseCcy": "ETH",
7284
+ # "quoteCcy": "USDT",
7285
+ # "fillBaseSz": "0.01023052",
7286
+ # "state": "fullyFilled",
7287
+ # "tradeId": "trader16461885203381437",
7288
+ # "fillQuoteSz": "30",
7289
+ # "ts": "1646188520000"
7290
+ # }
7291
+ # ],
7292
+ # "msg": ""
7293
+ # }
7294
+ #
7295
+ rows = self.safe_list(response, 'data', [])
7296
+ return self.parse_conversions(rows, 'baseCcy', 'quoteCcy', since, limit)
7297
+
7206
7298
  def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
7207
7299
  #
7208
7300
  # fetchConvertQuote
@@ -7240,6 +7332,22 @@ class okx(Exchange, ImplicitAPI):
7240
7332
  # "ts": "1646188520338"
7241
7333
  # }
7242
7334
  #
7335
+ # fetchConvertTrade, fetchConvertTradeHistory
7336
+ #
7337
+ # {
7338
+ # "clTReqId": "",
7339
+ # "instId": "ETH-USDT",
7340
+ # "side": "buy",
7341
+ # "fillPx": "2932.401044",
7342
+ # "baseCcy": "ETH",
7343
+ # "quoteCcy": "USDT",
7344
+ # "fillBaseSz": "0.01023052",
7345
+ # "state": "fullyFilled",
7346
+ # "tradeId": "trader16461885203381437",
7347
+ # "fillQuoteSz": "30",
7348
+ # "ts": "1646188520000"
7349
+ # }
7350
+ #
7243
7351
  timestamp = self.safe_integer_2(conversion, 'quoteTime', 'ts')
7244
7352
  fromCoin = self.safe_string(conversion, 'baseCcy')
7245
7353
  fromCode = self.safe_currency_code(fromCoin, fromCurrency)
@@ -383,8 +383,15 @@ class poloniexfutures(Exchange, ImplicitAPI):
383
383
  marketId = self.safe_string(ticker, 'symbol')
384
384
  symbol = self.safe_symbol(marketId, market)
385
385
  timestampString = self.safe_string(ticker, 'ts')
386
- # check timestamp bcz bug: https://app.travis-ci.com/github/ccxt/ccxt/builds/269959181#L4011
387
- multiplier = 0.00001 if (len(timestampString) == 18) else 0.000001
386
+ # check timestamp bcz bug: https://app.travis-ci.com/github/ccxt/ccxt/builds/269959181#L4011 and also 17 digits occured
387
+ multiplier = None
388
+ if len(timestampString) == 17:
389
+ multiplier = 0.0001
390
+ elif len(timestampString) == 18:
391
+ multiplier = 0.00001
392
+ else:
393
+ # 19 length default
394
+ multiplier = 0.000001
388
395
  timestamp = self.safe_integer_product(ticker, 'ts', multiplier)
389
396
  last = self.safe_string_2(ticker, 'price', 'lastPrice')
390
397
  percentage = Precise.string_mul(self.safe_string(ticker, 'priceChgPct'), '100')
ccxt/async_support/woo.py CHANGED
@@ -69,6 +69,8 @@ class woo(Exchange, ImplicitAPI):
69
69
  'fetchClosedOrders': True,
70
70
  'fetchConvertCurrencies': True,
71
71
  'fetchConvertQuote': True,
72
+ 'fetchConvertTrade': True,
73
+ 'fetchConvertTradeHistory': True,
72
74
  'fetchCurrencies': True,
73
75
  'fetchDepositAddress': True,
74
76
  'fetchDeposits': True,
@@ -2853,6 +2855,88 @@ class woo(Exchange, ImplicitAPI):
2853
2855
  data = self.safe_dict(response, 'data', {})
2854
2856
  return self.parse_conversion(data)
2855
2857
 
2858
+ async def fetch_convert_trade(self, id: str, code: Str = None, params={}) -> Conversion:
2859
+ """
2860
+ fetch the data for a conversion trade
2861
+ :see: https://docs.woo.org/#get-quote-trade
2862
+ :param str id: the id of the trade that you want to fetch
2863
+ :param str [code]: the unified currency code of the conversion trade
2864
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2865
+ :returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
2866
+ """
2867
+ await self.load_markets()
2868
+ request = {
2869
+ 'quoteId': id,
2870
+ }
2871
+ response = await self.v3PrivateGetConvertTrade(self.extend(request, params))
2872
+ #
2873
+ # {
2874
+ # "success": True,
2875
+ # "data": {
2876
+ # "quoteId": 12,
2877
+ # "buyAsset": "",
2878
+ # "sellAsset": "",
2879
+ # "buyAmount": 12.11,
2880
+ # "sellAmount": 12.11,
2881
+ # "tradeStatus": 12,
2882
+ # "createdTime": ""
2883
+ # }
2884
+ # }
2885
+ #
2886
+ data = self.safe_dict(response, 'data', {})
2887
+ fromCurrencyId = self.safe_string(data, 'sellAsset')
2888
+ toCurrencyId = self.safe_string(data, 'buyAsset')
2889
+ fromCurrency = None
2890
+ toCurrency = None
2891
+ if fromCurrencyId is not None:
2892
+ fromCurrency = self.currency(fromCurrencyId)
2893
+ if toCurrencyId is not None:
2894
+ toCurrency = self.currency(toCurrencyId)
2895
+ return self.parse_conversion(data, fromCurrency, toCurrency)
2896
+
2897
+ async def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Conversion]:
2898
+ """
2899
+ fetch the users history of conversion trades
2900
+ :see: https://docs.woo.org/#get-quote-trades
2901
+ :param str [code]: the unified currency code
2902
+ :param int [since]: the earliest time in ms to fetch conversions for
2903
+ :param int [limit]: the maximum number of conversion structures to retrieve
2904
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2905
+ :param int [params.until]: timestamp in ms of the latest conversion to fetch
2906
+ :returns dict[]: a list of `conversion structures <https://docs.ccxt.com/#/?id=conversion-structure>`
2907
+ """
2908
+ await self.load_markets()
2909
+ request = {}
2910
+ request, params = self.handle_until_option('endTime', request, params)
2911
+ if since is not None:
2912
+ request['startTime'] = since
2913
+ if limit is not None:
2914
+ request['size'] = limit
2915
+ response = await self.v3PrivateGetConvertTrades(self.extend(request, params))
2916
+ #
2917
+ # {
2918
+ # "success": True,
2919
+ # "data": {
2920
+ # "count": 12,
2921
+ # "tradeVos":[
2922
+ # {
2923
+ # "quoteId": 12,
2924
+ # "buyAsset": "",
2925
+ # "sellAsset": "",
2926
+ # "buyAmount": 12.11,
2927
+ # "sellAmount": 12.11,
2928
+ # "tradeStatus": 12,
2929
+ # "createdTime": ""
2930
+ # }
2931
+ # ...
2932
+ # ]
2933
+ # }
2934
+ # }
2935
+ #
2936
+ data = self.safe_dict(response, 'data', {})
2937
+ rows = self.safe_list(data, 'tradeVos', [])
2938
+ return self.parse_conversions(rows, 'sellAsset', 'buyAsset', since, limit)
2939
+
2856
2940
  def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
2857
2941
  #
2858
2942
  # fetchConvertQuote
@@ -2877,10 +2961,22 @@ class woo(Exchange, ImplicitAPI):
2877
2961
  # "rftAccepted": 1 # 1 -> success; 2 -> processing; 3 -> fail
2878
2962
  # }
2879
2963
  #
2880
- timestamp = self.safe_integer(conversion, 'expireTimestamp')
2881
- fromCoin = self.safe_string(conversion, 'sellToken')
2882
- fromCode = self.safe_currency_code(fromCoin, fromCurrency)
2883
- to = self.safe_string(conversion, 'buyToken')
2964
+ # fetchConvertTrade, fetchConvertTradeHistory
2965
+ #
2966
+ # {
2967
+ # "quoteId": 12,
2968
+ # "buyAsset": "",
2969
+ # "sellAsset": "",
2970
+ # "buyAmount": 12.11,
2971
+ # "sellAmount": 12.11,
2972
+ # "tradeStatus": 12,
2973
+ # "createdTime": ""
2974
+ # }
2975
+ #
2976
+ timestamp = self.safe_integer_2(conversion, 'expireTimestamp', 'createdTime')
2977
+ fromCurr = self.safe_string_2(conversion, 'sellToken', 'buyAsset')
2978
+ fromCode = self.safe_currency_code(fromCurr, fromCurrency)
2979
+ to = self.safe_string_2(conversion, 'buyToken', 'sellAsset')
2884
2980
  toCode = self.safe_currency_code(to, toCurrency)
2885
2981
  return {
2886
2982
  'info': conversion,
@@ -2888,9 +2984,9 @@ class woo(Exchange, ImplicitAPI):
2888
2984
  'datetime': self.iso8601(timestamp),
2889
2985
  'id': self.safe_string(conversion, 'quoteId'),
2890
2986
  'fromCurrency': fromCode,
2891
- 'fromAmount': self.safe_number(conversion, 'sellQuantity'),
2987
+ 'fromAmount': self.safe_number_2(conversion, 'sellQuantity', 'sellAmount'),
2892
2988
  'toCurrency': toCode,
2893
- 'toAmount': self.safe_number(conversion, 'buyQuantity'),
2989
+ 'toAmount': self.safe_number_2(conversion, 'buyQuantity', 'buyAmount'),
2894
2990
  'price': self.safe_number(conversion, 'buyPrice'),
2895
2991
  'fee': None,
2896
2992
  }
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.1'
7
+ __version__ = '4.3.3'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -31,7 +31,7 @@ from ccxt.base.decimal_to_precision import decimal_to_precision
31
31
  from ccxt.base.decimal_to_precision import DECIMAL_PLACES, TICK_SIZE, NO_PADDING, TRUNCATE, ROUND, ROUND_UP, ROUND_DOWN, SIGNIFICANT_DIGITS
32
32
  from ccxt.base.decimal_to_precision import number_to_string
33
33
  from ccxt.base.precise import Precise
34
- from ccxt.base.types import BalanceAccount, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, MarketType, Str, Num, Strings
34
+ from ccxt.base.types import BalanceAccount, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, MarketType, Str, Num, Strings, CancellationRequest
35
35
 
36
36
  # -----------------------------------------------------------------------------
37
37
 
@@ -4318,6 +4318,9 @@ class Exchange(object):
4318
4318
  def cancel_all_orders(self, symbol: Str = None, params={}):
4319
4319
  raise NotSupported(self.id + ' cancelAllOrders() is not supported yet')
4320
4320
 
4321
+ def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
4322
+ raise NotSupported(self.id + ' cancelOrdersForSymbols() is not supported yet')
4323
+
4321
4324
  def cancel_all_orders_ws(self, symbol: Str = None, params={}):
4322
4325
  raise NotSupported(self.id + ' cancelAllOrdersWs() is not supported yet')
4323
4326
 
@@ -5451,6 +5454,25 @@ class Exchange(object):
5451
5454
  def parse_leverage(self, leverage, market: Market = None):
5452
5455
  raise NotSupported(self.id + ' parseLeverage() is not supported yet')
5453
5456
 
5457
+ def parse_conversions(self, conversions: List[Any], fromCurrencyKey: Str = None, toCurrencyKey: Str = None, since: Int = None, limit: Int = None, params={}):
5458
+ conversions = self.to_array(conversions)
5459
+ result = []
5460
+ fromCurrency = None
5461
+ toCurrency = None
5462
+ for i in range(0, len(conversions)):
5463
+ entry = conversions[i]
5464
+ fromId = self.safe_string(entry, fromCurrencyKey)
5465
+ toId = self.safe_string(entry, toCurrencyKey)
5466
+ if fromId is not None:
5467
+ fromCurrency = self.currency(fromId)
5468
+ if toId is not None:
5469
+ toCurrency = self.currency(toId)
5470
+ conversion = self.extend(self.parseConversion(entry, fromCurrency, toCurrency), params)
5471
+ result.append(conversion)
5472
+ sorted = self.sort_by(result, 'timestamp')
5473
+ code = fromCurrency['code'] if (fromCurrency is not None) else None
5474
+ return self.filter_by_currency_since_limit(sorted, code, since, limit)
5475
+
5454
5476
  def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None):
5455
5477
  raise NotSupported(self.id + ' parseConversion() is not supported yet')
5456
5478
 
ccxt/base/types.py CHANGED
@@ -148,6 +148,10 @@ class OrderRequest(TypedDict):
148
148
  price: Union[None, float]
149
149
  params: Dict[str, Any]
150
150
 
151
+ class CancellationRequest(TypedDict):
152
+ id: Str
153
+ symbol: Str
154
+ clientOrderId: Str
151
155
 
152
156
  class Order(TypedDict):
153
157
  info: Dict[str, Any]