ccxt 4.3.11__py2.py3-none-any.whl → 4.3.13__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.
Files changed (73) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bybit.py +1 -0
  3. ccxt/async_support/__init__.py +1 -1
  4. ccxt/async_support/base/exchange.py +1 -1
  5. ccxt/async_support/bigone.py +22 -22
  6. ccxt/async_support/binance.py +7 -7
  7. ccxt/async_support/bingx.py +2 -2
  8. ccxt/async_support/bitget.py +10 -8
  9. ccxt/async_support/bitmart.py +7 -11
  10. ccxt/async_support/bitmex.py +2 -2
  11. ccxt/async_support/bybit.py +76 -65
  12. ccxt/async_support/coinbase.py +8 -8
  13. ccxt/async_support/coinbaseinternational.py +2 -2
  14. ccxt/async_support/coinex.py +501 -445
  15. ccxt/async_support/coinlist.py +12 -12
  16. ccxt/async_support/coinmetro.py +2 -2
  17. ccxt/async_support/cryptocom.py +16 -16
  18. ccxt/async_support/digifinex.py +3 -3
  19. ccxt/async_support/gate.py +2 -2
  20. ccxt/async_support/hitbtc.py +3 -3
  21. ccxt/async_support/htx.py +6 -9
  22. ccxt/async_support/indodax.py +2 -2
  23. ccxt/async_support/kraken.py +3 -1
  24. ccxt/async_support/kucoin.py +4 -4
  25. ccxt/async_support/kucoinfutures.py +6 -6
  26. ccxt/async_support/mexc.py +5 -5
  27. ccxt/async_support/okx.py +9 -9
  28. ccxt/async_support/poloniexfutures.py +4 -4
  29. ccxt/async_support/probit.py +2 -2
  30. ccxt/async_support/whitebit.py +72 -1
  31. ccxt/async_support/woo.py +2 -2
  32. ccxt/base/exchange.py +14 -2
  33. ccxt/base/types.py +25 -0
  34. ccxt/bigone.py +22 -22
  35. ccxt/binance.py +7 -7
  36. ccxt/bingx.py +2 -2
  37. ccxt/bitget.py +10 -8
  38. ccxt/bitmart.py +7 -11
  39. ccxt/bitmex.py +2 -2
  40. ccxt/bybit.py +76 -65
  41. ccxt/coinbase.py +8 -8
  42. ccxt/coinbaseinternational.py +2 -2
  43. ccxt/coinex.py +501 -445
  44. ccxt/coinlist.py +12 -12
  45. ccxt/coinmetro.py +2 -2
  46. ccxt/cryptocom.py +16 -16
  47. ccxt/digifinex.py +3 -3
  48. ccxt/gate.py +2 -2
  49. ccxt/hitbtc.py +3 -3
  50. ccxt/htx.py +6 -9
  51. ccxt/indodax.py +2 -2
  52. ccxt/kraken.py +3 -1
  53. ccxt/kucoin.py +4 -4
  54. ccxt/kucoinfutures.py +6 -6
  55. ccxt/mexc.py +5 -5
  56. ccxt/okx.py +9 -9
  57. ccxt/poloniexfutures.py +4 -4
  58. ccxt/pro/__init__.py +1 -1
  59. ccxt/pro/bitget.py +139 -87
  60. ccxt/pro/bybit.py +192 -12
  61. ccxt/pro/coinbase.py +90 -20
  62. ccxt/pro/mexc.py +21 -1
  63. ccxt/probit.py +2 -2
  64. ccxt/test/base/test_datetime.py +6 -0
  65. ccxt/test/base/test_ledger_entry.py +2 -2
  66. ccxt/whitebit.py +72 -1
  67. ccxt/woo.py +2 -2
  68. {ccxt-4.3.11.dist-info → ccxt-4.3.13.dist-info}/METADATA +4 -4
  69. {ccxt-4.3.11.dist-info → ccxt-4.3.13.dist-info}/RECORD +71 -73
  70. ccxt/async_support/flowbtc.py +0 -34
  71. ccxt/flowbtc.py +0 -34
  72. {ccxt-4.3.11.dist-info → ccxt-4.3.13.dist-info}/WHEEL +0 -0
  73. {ccxt-4.3.11.dist-info → ccxt-4.3.13.dist-info}/top_level.txt +0 -0
@@ -60,6 +60,7 @@ class whitebit(Exchange, ImplicitAPI):
60
60
  'fetchDeposit': True,
61
61
  'fetchDepositAddress': True,
62
62
  'fetchDeposits': True,
63
+ 'fetchDepositsWithdrawals': True,
63
64
  'fetchDepositWithdrawFee': 'emulated',
64
65
  'fetchDepositWithdrawFees': True,
65
66
  'fetchFundingHistory': False,
@@ -1852,6 +1853,7 @@ class whitebit(Exchange, ImplicitAPI):
1852
1853
  # {
1853
1854
  # "address": "3ApEASLcrQtZpg1TsssFgYF5V5YQJAKvuE", # deposit address
1854
1855
  # "uniqueId": null, # unique Id of deposit
1856
+ # "transactionId": "a6d71d69-2b17-4ad8-8b15-2d686c54a1a5",
1855
1857
  # "createdAt": 1593437922, # timestamp of deposit
1856
1858
  # "currency": "Bitcoin", # deposit currency
1857
1859
  # "ticker": "BTC", # deposit currency ticker
@@ -1875,6 +1877,7 @@ class whitebit(Exchange, ImplicitAPI):
1875
1877
  # "actual": 1, # current block confirmations
1876
1878
  # "required": 2 # required block confirmation for successful deposit
1877
1879
  # }
1880
+ # "centralized": False,
1878
1881
  # }
1879
1882
  #
1880
1883
  currency = self.safe_currency(None, currency)
@@ -1885,7 +1888,7 @@ class whitebit(Exchange, ImplicitAPI):
1885
1888
  method = self.safe_string(transaction, 'method')
1886
1889
  return {
1887
1890
  'id': self.safe_string(transaction, 'uniqueId'),
1888
- 'txid': self.safe_string(transaction, 'transactionHash'),
1891
+ 'txid': self.safe_string(transaction, 'transactionId'),
1889
1892
  'timestamp': timestamp,
1890
1893
  'datetime': self.iso8601(timestamp),
1891
1894
  'network': self.safe_string(transaction, 'network'),
@@ -2263,6 +2266,74 @@ class whitebit(Exchange, ImplicitAPI):
2263
2266
  'previousFundingDatetime': None,
2264
2267
  }
2265
2268
 
2269
+ async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
2270
+ """
2271
+ fetch history of deposits and withdrawals
2272
+ :see: https://github.com/whitebit-exchange/api-docs/blob/main/pages/private/http-main-v4.md#get-depositwithdraw-history
2273
+ :param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
2274
+ :param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
2275
+ :param int [limit]: max number of deposit/withdrawals to return, default = 50, Min: 1, Max: 100
2276
+ :param dict [params]: extra parameters specific to the exchange API endpoint
2277
+ *
2278
+ * EXCHANGE SPECIFIC PARAMETERS
2279
+ :param number [params.transactionMethod]: Method. Example: 1 to display deposits / 2 to display withdraws. Do not send self parameter in order to receive both deposits and withdraws.
2280
+ :param str [params.address]: Can be used for filtering transactions by specific address or memo.
2281
+ :param str[] [params.addresses]: Can be used for filtering transactions by specific addresses or memos(max: 20).
2282
+ :param str [params.uniqueId]: Can be used for filtering transactions by specific unique id
2283
+ :param int [params.offset]: If you want the request to return entries starting from a particular line, you can use OFFSET clause to tell it where it should start. Default: 0, Min: 0, Max: 10000
2284
+ :param str[] [params.status]: Can be used for filtering transactions by status codes. Caution: You must use self parameter with appropriate transactionMethod and use valid status codes for self method. You can find them below. Example: "status": [3,7]
2285
+ :returns dict: a list of `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
2286
+ """
2287
+ await self.load_markets()
2288
+ request = {}
2289
+ currency = None
2290
+ if code is not None:
2291
+ currency = self.currency(code)
2292
+ request['ticker'] = currency['id']
2293
+ if limit is not None:
2294
+ request['limit'] = limit # default 1000
2295
+ response = await self.v4PrivatePostMainAccountHistory(self.extend(request, params))
2296
+ #
2297
+ # {
2298
+ # "limit": 100,
2299
+ # "offset": 0,
2300
+ # "records": [
2301
+ # {
2302
+ # "address": "3ApEASLcrQtZpg1TsssFgYF5V5YQJAKvuE", # deposit address
2303
+ # "uniqueId": null, # unique Id of deposit
2304
+ # "createdAt": 1593437922, # timestamp of deposit
2305
+ # "currency": "Bitcoin", # deposit currency
2306
+ # "ticker": "BTC", # deposit currency ticker
2307
+ # "method": 1, # called method 1 - deposit, 2 - withdraw
2308
+ # "amount": "0.0006", # amount of deposit
2309
+ # "description": "", # deposit description
2310
+ # "memo": "", # deposit memo
2311
+ # "fee": "0", # deposit fee
2312
+ # "status": 15, # transactions status
2313
+ # "network": null, # if currency is multinetwork
2314
+ # "transactionHash": "a275a514013e4e0f927fd0d1bed215e7f6f2c4c6ce762836fe135ec22529d886", # deposit transaction hash
2315
+ # "transactionId": "5e112b38-9652-11ed-a1eb-0242ac120002", # transaction id
2316
+ # "details": {
2317
+ # "partial": { # details about partially successful withdrawals
2318
+ # "requestAmount": "50000", # requested withdrawal amount
2319
+ # "processedAmount": "39000", # processed withdrawal amount
2320
+ # "processedFee": "273", # fee for processed withdrawal amount
2321
+ # "normalizeTransaction": "" # deposit id
2322
+ # }
2323
+ # },
2324
+ # "confirmations": { # if transaction status == 15(Pending) you can see self object
2325
+ # "actual": 1, # current block confirmations
2326
+ # "required": 2 # required block confirmation for successful deposit
2327
+ # }
2328
+ # },
2329
+ # {...},
2330
+ # ],
2331
+ # "total": 300 # total number of transactions, use self for calculating ‘limit’ and ‘offset'
2332
+ # }
2333
+ #
2334
+ records = self.safe_list(response, 'records')
2335
+ return self.parse_transactions(records, currency, since, limit)
2336
+
2266
2337
  def is_fiat(self, currency):
2267
2338
  fiatCurrencies = self.safe_value(self.options, 'fiatCurrencies', [])
2268
2339
  return self.in_array(currency, fiatCurrencies)
ccxt/async_support/woo.py CHANGED
@@ -2156,8 +2156,8 @@ class woo(Exchange, ImplicitAPI):
2156
2156
  request['size'] = limit
2157
2157
  if since is not None:
2158
2158
  request['start_t'] = since
2159
- until = self.safe_integer_2(params, 'until', 'till') # unified in milliseconds
2160
- params = self.omit(params, ['until', 'till'])
2159
+ until = self.safe_integer(params, 'until') # unified in milliseconds
2160
+ params = self.omit(params, ['until'])
2161
2161
  if until is not None:
2162
2162
  request['end_t'] = until
2163
2163
  response = await self.v1PrivateGetAssetMainSubTransferHistory(self.extend(request, params))
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.11'
7
+ __version__ = '4.3.13'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -1216,7 +1216,7 @@ class Exchange(object):
1216
1216
  return None
1217
1217
  if 'GMT' in timestamp:
1218
1218
  try:
1219
- string = ''.join([str(value) for value in parsedate(timestamp)[:6]]) + '.000Z'
1219
+ string = ''.join([str(value).zfill(2) for value in parsedate(timestamp)[:6]]) + '.000Z'
1220
1220
  dt = datetime.datetime.strptime(string, "%Y%m%d%H%M%S.%fZ")
1221
1221
  return calendar.timegm(dt.utctimetuple()) * 1000
1222
1222
  except (TypeError, OverflowError, OSError):
@@ -2212,6 +2212,9 @@ class Exchange(object):
2212
2212
  def parse_borrow_interest(self, info, market: Market = None):
2213
2213
  raise NotSupported(self.id + ' parseBorrowInterest() is not supported yet')
2214
2214
 
2215
+ def parse_isolated_borrow_rate(self, info, market: Market = None):
2216
+ raise NotSupported(self.id + ' parseIsolatedBorrowRate() is not supported yet')
2217
+
2215
2218
  def parse_ws_trade(self, trade, market: Market = None):
2216
2219
  raise NotSupported(self.id + ' parseWsTrade() is not supported yet')
2217
2220
 
@@ -5002,6 +5005,15 @@ class Exchange(object):
5002
5005
  interests.append(self.parse_borrow_interest(row, market))
5003
5006
  return interests
5004
5007
 
5008
+ def parse_isolated_borrow_rates(self, info: Any):
5009
+ result = {}
5010
+ for i in range(0, len(info)):
5011
+ item = info[i]
5012
+ borrowRate = self.parseIsolatedBorrowRate(item)
5013
+ symbol = self.safe_string(borrowRate, 'symbol')
5014
+ result[symbol] = borrowRate
5015
+ return result
5016
+
5005
5017
  def parse_funding_rate_histories(self, response, market=None, since: Int = None, limit: Int = None):
5006
5018
  rates = []
5007
5019
  for i in range(0, len(response)):
ccxt/base/types.py CHANGED
@@ -148,11 +148,13 @@ class OrderRequest(TypedDict):
148
148
  price: Union[None, float]
149
149
  params: Dict[str, Any]
150
150
 
151
+
151
152
  class CancellationRequest(TypedDict):
152
153
  id: Str
153
154
  symbol: Str
154
155
  clientOrderId: Str
155
156
 
157
+
156
158
  class Order(TypedDict):
157
159
  info: Dict[str, Any]
158
160
  id: Str
@@ -437,9 +439,32 @@ class MarginModification(TypedDict):
437
439
  datetime: Str
438
440
 
439
441
 
442
+ class CrossBorrowRate(TypedDict):
443
+ info: Dict[str, any]
444
+ currency: Str
445
+ rate: float
446
+ period: Optional[float]
447
+ timestamp: Int
448
+ datetime: Str
449
+
450
+
451
+ class IsolatedBorrowRate(TypedDict):
452
+ info: Dict[str, any]
453
+ symbol: str
454
+ base: str
455
+ baseRate: float
456
+ quote: str
457
+ quoteRate: float
458
+ period: Int
459
+ timestamp: Int
460
+ datetime: Str
461
+
462
+
440
463
  LastPrices = Dict[Str, LastPrice]
441
464
  Currencies = Dict[Str, CurrencyInterface]
442
465
  TradingFees = Dict[Str, TradingFeeInterface]
466
+ IsolatedBorrowRates = Dict[Str, IsolatedBorrowRate]
467
+ CrossBorrowRates = Dict[Str, CrossBorrowRate]
443
468
 
444
469
  Market = Optional[MarketInterface]
445
470
  Currency = Optional[CurrencyInterface]
ccxt/bigone.py CHANGED
@@ -444,16 +444,16 @@ class bigone(Exchange, ImplicitAPI):
444
444
  # ],
445
445
  # }
446
446
  #
447
- currenciesData = self.safe_value(data, 'data', [])
447
+ currenciesData = self.safe_list(data, 'data', [])
448
448
  result = {}
449
449
  for i in range(0, len(currenciesData)):
450
450
  currency = currenciesData[i]
451
451
  id = self.safe_string(currency, 'symbol')
452
452
  code = self.safe_currency_code(id)
453
453
  name = self.safe_string(currency, 'name')
454
- type = 'fiat' if self.safe_value(currency, 'is_fiat') else 'crypto'
454
+ type = 'fiat' if self.safe_bool(currency, 'is_fiat') else 'crypto'
455
455
  networks = {}
456
- chains = self.safe_value(currency, 'binding_gateways', [])
456
+ chains = self.safe_list(currency, 'binding_gateways', [])
457
457
  currencyMaxPrecision = self.parse_precision(self.safe_string_2(currency, 'withdrawal_scale', 'scale'))
458
458
  currencyDepositEnabled: Bool = None
459
459
  currencyWithdrawEnabled: Bool = None
@@ -461,8 +461,8 @@ class bigone(Exchange, ImplicitAPI):
461
461
  chain = chains[j]
462
462
  networkId = self.safe_string(chain, 'gateway_name')
463
463
  networkCode = self.network_id_to_code(networkId)
464
- deposit = self.safe_value(chain, 'is_deposit_enabled')
465
- withdraw = self.safe_value(chain, 'is_withdrawal_enabled')
464
+ deposit = self.safe_bool(chain, 'is_deposit_enabled')
465
+ withdraw = self.safe_bool(chain, 'is_withdrawal_enabled')
466
466
  isActive = (deposit and withdraw)
467
467
  minDepositAmount = self.safe_string(chain, 'min_deposit_amount')
468
468
  minWithdrawalAmount = self.safe_string(chain, 'min_withdrawal_amount')
@@ -581,12 +581,12 @@ class bigone(Exchange, ImplicitAPI):
581
581
  # ...
582
582
  # ]
583
583
  #
584
- markets = self.safe_value(response, 'data', [])
584
+ markets = self.safe_list(response, 'data', [])
585
585
  result = []
586
586
  for i in range(0, len(markets)):
587
587
  market = markets[i]
588
- baseAsset = self.safe_value(market, 'base_asset', {})
589
- quoteAsset = self.safe_value(market, 'quote_asset', {})
588
+ baseAsset = self.safe_dict(market, 'base_asset', {})
589
+ quoteAsset = self.safe_dict(market, 'quote_asset', {})
590
590
  baseId = self.safe_string(baseAsset, 'symbol')
591
591
  quoteId = self.safe_string(quoteAsset, 'symbol')
592
592
  base = self.safe_currency_code(baseId)
@@ -650,7 +650,7 @@ class bigone(Exchange, ImplicitAPI):
650
650
  base = self.safe_currency_code(baseId)
651
651
  quote = self.safe_currency_code(quoteId)
652
652
  settle = self.safe_currency_code(settleId)
653
- inverse = self.safe_value(market, 'isInverse')
653
+ inverse = self.safe_bool(market, 'isInverse')
654
654
  result.append(self.safe_market_structure({
655
655
  'id': marketId,
656
656
  'symbol': base + '/' + quote + ':' + settle,
@@ -666,7 +666,7 @@ class bigone(Exchange, ImplicitAPI):
666
666
  'swap': True,
667
667
  'future': False,
668
668
  'option': False,
669
- 'active': self.safe_value(market, 'enable'),
669
+ 'active': self.safe_bool(market, 'enable'),
670
670
  'contract': True,
671
671
  'linear': not inverse,
672
672
  'inverse': inverse,
@@ -752,8 +752,8 @@ class bigone(Exchange, ImplicitAPI):
752
752
  marketId = self.safe_string_2(ticker, 'asset_pair_name', 'symbol')
753
753
  symbol = self.safe_symbol(marketId, market, '-', marketType)
754
754
  close = self.safe_string_2(ticker, 'close', 'latestPrice')
755
- bid = self.safe_value(ticker, 'bid', {})
756
- ask = self.safe_value(ticker, 'ask', {})
755
+ bid = self.safe_dict(ticker, 'bid', {})
756
+ ask = self.safe_dict(ticker, 'ask', {})
757
757
  return self.safe_ticker({
758
758
  'symbol': symbol,
759
759
  'timestamp': None,
@@ -867,7 +867,7 @@ class bigone(Exchange, ImplicitAPI):
867
867
  # ]
868
868
  # }
869
869
  #
870
- data = self.safe_value(response, 'data', [])
870
+ data = self.safe_list(response, 'data', [])
871
871
  else:
872
872
  data = self.contractPublicGetInstruments(params)
873
873
  #
@@ -913,7 +913,7 @@ class bigone(Exchange, ImplicitAPI):
913
913
  # }
914
914
  # }
915
915
  #
916
- data = self.safe_value(response, 'data', {})
916
+ data = self.safe_dict(response, 'data', {})
917
917
  timestamp = self.safe_integer(data, 'Timestamp')
918
918
  return self.parse_to_int(timestamp / 1000000)
919
919
 
@@ -1254,7 +1254,7 @@ class bigone(Exchange, ImplicitAPI):
1254
1254
  'timestamp': None,
1255
1255
  'datetime': None,
1256
1256
  }
1257
- balances = self.safe_value(response, 'data', [])
1257
+ balances = self.safe_list(response, 'data', [])
1258
1258
  for i in range(0, len(balances)):
1259
1259
  balance = balances[i]
1260
1260
  symbol = self.safe_string(balance, 'asset_symbol')
@@ -1334,7 +1334,7 @@ class bigone(Exchange, ImplicitAPI):
1334
1334
  triggerPrice = self.safe_string(order, 'stop_price')
1335
1335
  if Precise.string_eq(triggerPrice, '0'):
1336
1336
  triggerPrice = None
1337
- immediateOrCancel = self.safe_value(order, 'immediate_or_cancel')
1337
+ immediateOrCancel = self.safe_bool(order, 'immediate_or_cancel')
1338
1338
  timeInForce = None
1339
1339
  if immediateOrCancel:
1340
1340
  timeInForce = 'IOC'
@@ -1358,7 +1358,7 @@ class bigone(Exchange, ImplicitAPI):
1358
1358
  'symbol': symbol,
1359
1359
  'type': type,
1360
1360
  'timeInForce': timeInForce,
1361
- 'postOnly': self.safe_value(order, 'post_only'),
1361
+ 'postOnly': self.safe_bool(order, 'post_only'),
1362
1362
  'side': side,
1363
1363
  'price': price,
1364
1364
  'stopPrice': triggerPrice,
@@ -1762,13 +1762,13 @@ class bigone(Exchange, ImplicitAPI):
1762
1762
  # ]
1763
1763
  # }
1764
1764
  #
1765
- data = self.safe_value(response, 'data', [])
1765
+ data = self.safe_list(response, 'data', [])
1766
1766
  dataLength = len(data)
1767
1767
  if dataLength < 1:
1768
1768
  raise ExchangeError(self.id + ' fetchDepositAddress() returned empty address response')
1769
1769
  chainsIndexedById = self.index_by(data, 'chain')
1770
1770
  selectedNetworkId = self.select_network_id_from_raw_networks(code, networkCode, chainsIndexedById)
1771
- addressObject = self.safe_value(chainsIndexedById, selectedNetworkId, {})
1771
+ addressObject = self.safe_dict(chainsIndexedById, selectedNetworkId, {})
1772
1772
  address = self.safe_string(addressObject, 'value')
1773
1773
  tag = self.safe_string(addressObject, 'memo')
1774
1774
  self.check_address(address)
@@ -1854,7 +1854,7 @@ class bigone(Exchange, ImplicitAPI):
1854
1854
  address = self.safe_string(transaction, 'target_address')
1855
1855
  tag = self.safe_string(transaction, 'memo')
1856
1856
  type = 'withdrawal' if ('customer_id' in transaction) else 'deposit'
1857
- internal = self.safe_value(transaction, 'is_internal')
1857
+ internal = self.safe_bool(transaction, 'is_internal')
1858
1858
  return {
1859
1859
  'info': transaction,
1860
1860
  'id': id,
@@ -1987,7 +1987,7 @@ class bigone(Exchange, ImplicitAPI):
1987
1987
  """
1988
1988
  self.load_markets()
1989
1989
  currency = self.currency(code)
1990
- accountsByType = self.safe_value(self.options, 'accountsByType', {})
1990
+ accountsByType = self.safe_dict(self.options, 'accountsByType', {})
1991
1991
  fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
1992
1992
  toId = self.safe_string(accountsByType, toAccount, toAccount)
1993
1993
  guid = self.safe_string(params, 'guid', self.uuid())
@@ -2008,7 +2008,7 @@ class bigone(Exchange, ImplicitAPI):
2008
2008
  # }
2009
2009
  #
2010
2010
  transfer = self.parse_transfer(response, currency)
2011
- transferOptions = self.safe_value(self.options, 'transfer', {})
2011
+ transferOptions = self.safe_dict(self.options, 'transfer', {})
2012
2012
  fillResponseFromRequest = self.safe_bool(transferOptions, 'fillResponseFromRequest', True)
2013
2013
  if fillResponseFromRequest:
2014
2014
  transfer['fromAccount'] = fromAccount
ccxt/binance.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.binance import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Conversion, Currencies, Currency, Greeks, Int, Leverage, Leverages, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, Leverage, Leverages, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -1121,7 +1121,7 @@ class binance(Exchange, ImplicitAPI):
1121
1121
  'feeSide': 'quote',
1122
1122
  'tierBased': True,
1123
1123
  'percentage': True,
1124
- 'taker': self.parse_number('0.000400'),
1124
+ 'taker': self.parse_number('0.000500'),
1125
1125
  'maker': self.parse_number('0.000200'),
1126
1126
  'tiers': {
1127
1127
  'taker': [
@@ -8411,9 +8411,9 @@ class binance(Exchange, ImplicitAPI):
8411
8411
  params = self.omit(params, 'type')
8412
8412
  if since is not None:
8413
8413
  request['startTime'] = since
8414
- until = self.safe_integer_2(params, 'until', 'till') # unified in milliseconds
8414
+ until = self.safe_integer(params, 'until') # unified in milliseconds
8415
8415
  endTime = self.safe_integer(params, 'endTime', until) # exchange-specific in milliseconds
8416
- params = self.omit(params, ['endTime', 'till', 'until'])
8416
+ params = self.omit(params, ['endTime', 'until'])
8417
8417
  if endTime is not None:
8418
8418
  request['endTime'] = endTime
8419
8419
  if limit is not None:
@@ -10405,7 +10405,7 @@ class binance(Exchange, ImplicitAPI):
10405
10405
  """
10406
10406
  return self.modify_margin_helper(symbol, amount, 1, params)
10407
10407
 
10408
- def fetch_cross_borrow_rate(self, code: str, params={}):
10408
+ def fetch_cross_borrow_rate(self, code: str, params={}) -> CrossBorrowRate:
10409
10409
  """
10410
10410
  fetch the rate of interest to borrow a currency for margin trading
10411
10411
  :see: https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
@@ -10851,9 +10851,9 @@ class binance(Exchange, ImplicitAPI):
10851
10851
  request['contractType'] = self.safe_string(params, 'contractType', 'CURRENT_QUARTER')
10852
10852
  if since is not None:
10853
10853
  request['startTime'] = since
10854
- until = self.safe_integer_2(params, 'until', 'till') # unified in milliseconds
10854
+ until = self.safe_integer(params, 'until') # unified in milliseconds
10855
10855
  endTime = self.safe_integer(params, 'endTime', until) # exchange-specific in milliseconds
10856
- params = self.omit(params, ['endTime', 'until', 'till'])
10856
+ params = self.omit(params, ['endTime', 'until'])
10857
10857
  if endTime:
10858
10858
  request['endTime'] = endTime
10859
10859
  elif since:
ccxt/bingx.py CHANGED
@@ -2734,9 +2734,9 @@ class bingx(Exchange, ImplicitAPI):
2734
2734
  request['limit'] = limit
2735
2735
  if since is not None:
2736
2736
  request['startTime'] = since
2737
- until = self.safe_integer_2(params, 'until', 'till') # unified in milliseconds
2737
+ until = self.safe_integer(params, 'until') # unified in milliseconds
2738
2738
  endTime = self.safe_integer(params, 'endTime', until) # exchange-specific in milliseconds
2739
- params = self.omit(params, ['endTime', 'till', 'until'])
2739
+ params = self.omit(params, ['endTime', 'until'])
2740
2740
  if endTime is not None:
2741
2741
  request['endTime'] = endTime
2742
2742
  response = self.swapV1PrivateGetTradeFullOrder(self.extend(request, params))
ccxt/bitget.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitget import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Conversion, Currencies, Currency, FundingHistory, Int, Liquidation, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, FundingHistory, Int, IsolatedBorrowRate, Leverage, Liquidation, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -3240,11 +3240,11 @@ class bitget(Exchange, ImplicitAPI):
3240
3240
  'symbol': market['id'],
3241
3241
  'granularity': self.safe_string(timeframes, timeframe, timeframe),
3242
3242
  }
3243
- until = self.safe_integer_2(params, 'until', 'till')
3243
+ until = self.safe_integer(params, 'until')
3244
3244
  limitDefined = limit is not None
3245
3245
  sinceDefined = since is not None
3246
3246
  untilDefined = until is not None
3247
- params = self.omit(params, ['until', 'till'])
3247
+ params = self.omit(params, ['until'])
3248
3248
  response = None
3249
3249
  now = self.milliseconds()
3250
3250
  # retrievable periods listed here:
@@ -4357,6 +4357,8 @@ class bitget(Exchange, ImplicitAPI):
4357
4357
  params = self.omit(params, ['stopPrice', 'triggerType', 'stopLossPrice', 'takeProfitPrice', 'stopLoss', 'takeProfit', 'clientOrderId', 'trailingTriggerPrice', 'trailingPercent'])
4358
4358
  response = None
4359
4359
  if market['spot']:
4360
+ if triggerPrice is None:
4361
+ raise NotSupported(self.id + 'editOrder() only supports plan/trigger spot orders')
4360
4362
  editMarketBuyOrderRequiresPrice = self.safe_bool(self.options, 'editMarketBuyOrderRequiresPrice', True)
4361
4363
  if editMarketBuyOrderRequiresPrice and isMarketOrder and (side == 'buy'):
4362
4364
  if price is None:
@@ -5254,8 +5256,8 @@ class bitget(Exchange, ImplicitAPI):
5254
5256
  if stop:
5255
5257
  if symbol is None:
5256
5258
  raise ArgumentsRequired(self.id + ' fetchCanceledAndClosedOrders() requires a symbol argument')
5257
- endTime = self.safe_integer_n(params, ['endTime', 'until', 'till'])
5258
- params = self.omit(params, ['until', 'till'])
5259
+ endTime = self.safe_integer_n(params, ['endTime', 'until'])
5260
+ params = self.omit(params, ['until'])
5259
5261
  if since is None:
5260
5262
  since = now - 7776000000
5261
5263
  request['startTime'] = since
@@ -7379,7 +7381,7 @@ class bitget(Exchange, ImplicitAPI):
7379
7381
  'datetime': self.iso8601(timestamp),
7380
7382
  })
7381
7383
 
7382
- def fetch_isolated_borrow_rate(self, symbol: str, params={}):
7384
+ def fetch_isolated_borrow_rate(self, symbol: str, params={}) -> IsolatedBorrowRate:
7383
7385
  """
7384
7386
  fetch the rate of interest to borrow a currency for margin trading
7385
7387
  :see: https://www.bitget.com/api-doc/margin/isolated/account/Isolated-Margin-Interest-Rate-And-Max-Borrowable-Amount
@@ -7440,7 +7442,7 @@ class bitget(Exchange, ImplicitAPI):
7440
7442
  first['timestamp'] = timestamp
7441
7443
  return self.parse_isolated_borrow_rate(first, market)
7442
7444
 
7443
- def parse_isolated_borrow_rate(self, info, market: Market = None):
7445
+ def parse_isolated_borrow_rate(self, info, market: Market = None) -> IsolatedBorrowRate:
7444
7446
  #
7445
7447
  # {
7446
7448
  # "symbol": "BTCUSDT",
@@ -7492,7 +7494,7 @@ class bitget(Exchange, ImplicitAPI):
7492
7494
  'info': info,
7493
7495
  }
7494
7496
 
7495
- def fetch_cross_borrow_rate(self, code: str, params={}):
7497
+ def fetch_cross_borrow_rate(self, code: str, params={}) -> CrossBorrowRate:
7496
7498
  """
7497
7499
  fetch the rate of interest to borrow a currency for margin trading
7498
7500
  :see: https://www.bitget.com/api-doc/margin/cross/account/Get-Cross-Margin-Interest-Rate-And-Borrowable
ccxt/bitmart.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitmart import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, IsolatedBorrowRates, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -3342,7 +3342,7 @@ class bitmart(Exchange, ImplicitAPI):
3342
3342
  'info': info,
3343
3343
  }
3344
3344
 
3345
- def fetch_isolated_borrow_rate(self, symbol: str, params={}):
3345
+ def fetch_isolated_borrow_rate(self, symbol: str, params={}) -> IsolatedBorrowRate:
3346
3346
  """
3347
3347
  fetch the rate of interest to borrow a currency for margin trading
3348
3348
  :see: https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
@@ -3393,7 +3393,7 @@ class bitmart(Exchange, ImplicitAPI):
3393
3393
  borrowRate = self.safe_value(symbols, 0)
3394
3394
  return self.parse_isolated_borrow_rate(borrowRate, market)
3395
3395
 
3396
- def parse_isolated_borrow_rate(self, info, market: Market = None):
3396
+ def parse_isolated_borrow_rate(self, info, market: Market = None) -> IsolatedBorrowRate:
3397
3397
  #
3398
3398
  # {
3399
3399
  # "symbol": "BTC_USDT",
@@ -3435,7 +3435,7 @@ class bitmart(Exchange, ImplicitAPI):
3435
3435
  'info': info,
3436
3436
  }
3437
3437
 
3438
- def fetch_isolated_borrow_rates(self, params={}):
3438
+ def fetch_isolated_borrow_rates(self, params={}) -> IsolatedBorrowRates:
3439
3439
  """
3440
3440
  fetch the borrow interest rates of all currencies, currently only works for isolated margin
3441
3441
  :see: https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
@@ -3478,11 +3478,7 @@ class bitmart(Exchange, ImplicitAPI):
3478
3478
  #
3479
3479
  data = self.safe_value(response, 'data', {})
3480
3480
  symbols = self.safe_value(data, 'symbols', [])
3481
- result = []
3482
- for i in range(0, len(symbols)):
3483
- symbol = self.safe_value(symbols, i)
3484
- result.append(self.parse_isolated_borrow_rate(symbol))
3485
- return result
3481
+ return self.parse_isolated_borrow_rates(symbols)
3486
3482
 
3487
3483
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
3488
3484
  """
@@ -3641,9 +3637,9 @@ class bitmart(Exchange, ImplicitAPI):
3641
3637
  request['time_start'] = since
3642
3638
  if limit is not None:
3643
3639
  request['limit'] = limit
3644
- until = self.safe_integer_2(params, 'until', 'till') # unified in milliseconds
3640
+ until = self.safe_integer(params, 'until') # unified in milliseconds
3645
3641
  endTime = self.safe_integer(params, 'time_end', until) # exchange-specific in milliseconds
3646
- params = self.omit(params, ['till', 'until'])
3642
+ params = self.omit(params, ['until'])
3647
3643
  if endTime is not None:
3648
3644
  request['time_end'] = endTime
3649
3645
  response = self.privatePostAccountV1TransferContractList(self.extend(request, params))
ccxt/bitmex.py CHANGED
@@ -2409,8 +2409,8 @@ class bitmex(Exchange, ImplicitAPI):
2409
2409
  request['startTime'] = self.iso8601(since)
2410
2410
  if limit is not None:
2411
2411
  request['count'] = limit
2412
- until = self.safe_integer_2(params, 'until', 'till')
2413
- params = self.omit(params, ['until', 'till'])
2412
+ until = self.safe_integer(params, 'until')
2413
+ params = self.omit(params, ['until'])
2414
2414
  if until is not None:
2415
2415
  request['endTime'] = self.iso8601(until)
2416
2416
  if (since is None) and (until is None):