ccxt 4.4.78__py2.py3-none-any.whl → 4.4.80__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 (83) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bitmart.py +1 -0
  3. ccxt/apex.py +2 -2
  4. ccxt/ascendex.py +22 -5
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/apex.py +2 -2
  7. ccxt/async_support/ascendex.py +22 -5
  8. ccxt/async_support/base/exchange.py +5 -1
  9. ccxt/async_support/binance.py +6 -0
  10. ccxt/async_support/bingx.py +3 -3
  11. ccxt/async_support/bitfinex.py +59 -34
  12. ccxt/async_support/bitget.py +52 -64
  13. ccxt/async_support/bitmart.py +7 -2
  14. ccxt/async_support/bitmex.py +8 -1
  15. ccxt/async_support/bitopro.py +5 -1
  16. ccxt/async_support/bitrue.py +2 -1
  17. ccxt/async_support/bitso.py +1 -1
  18. ccxt/async_support/bitteam.py +2 -0
  19. ccxt/async_support/bitvavo.py +25 -10
  20. ccxt/async_support/btcalpha.py +1 -1
  21. ccxt/async_support/btcmarkets.py +1 -1
  22. ccxt/async_support/btcturk.py +1 -1
  23. ccxt/async_support/bybit.py +27 -15
  24. ccxt/async_support/coinbase.py +3 -15
  25. ccxt/async_support/coinex.py +1 -0
  26. ccxt/async_support/coinlist.py +1 -0
  27. ccxt/async_support/coinone.py +1 -0
  28. ccxt/async_support/delta.py +3 -0
  29. ccxt/async_support/deribit.py +1 -0
  30. ccxt/async_support/hollaex.py +1 -0
  31. ccxt/async_support/htx.py +7 -3
  32. ccxt/async_support/huobijp.py +1 -0
  33. ccxt/async_support/hyperliquid.py +1 -0
  34. ccxt/async_support/kraken.py +2 -0
  35. ccxt/async_support/okx.py +1 -1
  36. ccxt/async_support/poloniex.py +1 -0
  37. ccxt/async_support/timex.py +2 -2
  38. ccxt/async_support/upbit.py +43 -21
  39. ccxt/async_support/whitebit.py +65 -12
  40. ccxt/base/errors.py +0 -6
  41. ccxt/base/exchange.py +1 -1
  42. ccxt/binance.py +6 -0
  43. ccxt/bingx.py +3 -3
  44. ccxt/bitfinex.py +59 -34
  45. ccxt/bitget.py +52 -64
  46. ccxt/bitmart.py +7 -2
  47. ccxt/bitmex.py +8 -1
  48. ccxt/bitopro.py +5 -1
  49. ccxt/bitrue.py +2 -1
  50. ccxt/bitso.py +1 -1
  51. ccxt/bitteam.py +2 -0
  52. ccxt/bitvavo.py +25 -10
  53. ccxt/btcalpha.py +1 -1
  54. ccxt/btcmarkets.py +1 -1
  55. ccxt/btcturk.py +1 -1
  56. ccxt/bybit.py +27 -15
  57. ccxt/coinbase.py +3 -15
  58. ccxt/coinex.py +1 -0
  59. ccxt/coinlist.py +1 -0
  60. ccxt/coinone.py +1 -0
  61. ccxt/delta.py +3 -0
  62. ccxt/deribit.py +1 -0
  63. ccxt/hollaex.py +1 -0
  64. ccxt/htx.py +7 -3
  65. ccxt/huobijp.py +1 -0
  66. ccxt/hyperliquid.py +1 -0
  67. ccxt/kraken.py +2 -0
  68. ccxt/okx.py +1 -1
  69. ccxt/poloniex.py +1 -0
  70. ccxt/pro/__init__.py +1 -1
  71. ccxt/pro/binance.py +3 -3
  72. ccxt/pro/coinbase.py +40 -52
  73. ccxt/pro/upbit.py +42 -0
  74. ccxt/test/tests_async.py +0 -1
  75. ccxt/test/tests_sync.py +0 -1
  76. ccxt/timex.py +2 -2
  77. ccxt/upbit.py +43 -21
  78. ccxt/whitebit.py +65 -12
  79. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/METADATA +9 -11
  80. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/RECORD +83 -83
  81. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/LICENSE.txt +0 -0
  82. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/WHEEL +0 -0
  83. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/top_level.txt +0 -0
ccxt/bitget.py CHANGED
@@ -1566,6 +1566,8 @@ class bitget(Exchange, ImplicitAPI):
1566
1566
  'method': 'privateMixGetV2MixPositionAllPosition', # or privateMixGetV2MixPositionHistoryPosition
1567
1567
  },
1568
1568
  'defaultTimeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
1569
+ # fiat currencies on deposit page
1570
+ 'fiatCurrencies': ['EUR', 'VND', 'PLN', 'CZK', 'HUF', 'DKK', 'AUD', 'CAD', 'NOK', 'SEK', 'CHF', 'MXN', 'COP', 'ARS', 'GBP', 'BRL', 'UAH', 'ZAR'],
1569
1571
  },
1570
1572
  'features': {
1571
1573
  'spot': {
@@ -2024,99 +2026,85 @@ class bitget(Exchange, ImplicitAPI):
2024
2026
  """
2025
2027
  response = self.publicSpotGetV2SpotPublicCoins(params)
2026
2028
  #
2027
- # {
2028
- # "code": "00000",
2029
- # "data": [
2030
- # {
2031
- # "chains": [
2032
- # {
2033
- # "browserUrl": "https://blockchair.com/bitcoin/transaction/",
2034
- # "chain": "BTC",
2035
- # "depositConfirm": "1",
2036
- # "extraWithdrawFee": "0",
2037
- # "minDepositAmount": "0.0001",
2038
- # "minWithdrawAmount": "0.005",
2039
- # "needTag": "false",
2040
- # "rechargeable": "true",
2041
- # "withdrawConfirm": "1",
2042
- # "withdrawFee": "0.0004",
2043
- # "withdrawable": "true"
2044
- # },
2045
- # ],
2046
- # "coin": "BTC",
2047
- # "coinId": "1",
2048
- # "transfer": "true""
2049
- # }
2050
- # ],
2051
- # "msg": "success",
2052
- # "requestTime": "1700120731773"
2053
- # }
2029
+ # {
2030
+ # "code": "00000",
2031
+ # "msg": "success",
2032
+ # "requestTime": "1746195617812",
2033
+ # "data": [
2034
+ # {
2035
+ # "coinId": "1456",
2036
+ # "coin": "NEIROETH",
2037
+ # "transfer": "false",
2038
+ # "chains": [
2039
+ # {
2040
+ # "chain": "ERC20",
2041
+ # "needTag": "false",
2042
+ # "withdrawable": "true",
2043
+ # "rechargeable": "true",
2044
+ # "withdrawFee": "44.91017965",
2045
+ # "extraWithdrawFee": "0",
2046
+ # "depositConfirm": "12",
2047
+ # "withdrawConfirm": "64",
2048
+ # "minDepositAmount": "0.06",
2049
+ # "minWithdrawAmount": "60",
2050
+ # "browserUrl": "https://etherscan.io/tx/",
2051
+ # "contractAddress": "0xee2a03aa6dacf51c18679c516ad5283d8e7c2637",
2052
+ # "withdrawStep": "0",
2053
+ # "withdrawMinScale": "8",
2054
+ # "congestion": "normal"
2055
+ # }
2056
+ # ],
2057
+ # "areaCoin": "no"
2058
+ # },
2059
+ # ...
2054
2060
  #
2055
2061
  result: dict = {}
2056
2062
  data = self.safe_value(response, 'data', [])
2063
+ fiatCurrencies = self.safe_list(self.options, 'fiatCurrencies', [])
2057
2064
  for i in range(0, len(data)):
2058
2065
  entry = data[i]
2059
2066
  id = self.safe_string(entry, 'coin') # we don't use 'coinId' has no use. it is 'coin' field that needs to be used in currency related endpoints(deposit, withdraw, etc..)
2060
2067
  code = self.safe_currency_code(id)
2061
2068
  chains = self.safe_value(entry, 'chains', [])
2062
2069
  networks: dict = {}
2063
- deposit = False
2064
- withdraw = False
2065
- minWithdrawString = None
2066
- minDepositString = None
2067
- minWithdrawFeeString = None
2068
2070
  for j in range(0, len(chains)):
2069
2071
  chain = chains[j]
2070
2072
  networkId = self.safe_string(chain, 'chain')
2071
2073
  network = self.network_id_to_code(networkId, code)
2072
2074
  if network is not None:
2073
2075
  network = network.upper()
2074
- withdrawEnabled = self.safe_string(chain, 'withdrawable')
2075
- canWithdraw = withdrawEnabled == 'true'
2076
- withdraw = canWithdraw if (canWithdraw) else withdraw
2077
- depositEnabled = self.safe_string(chain, 'rechargeable')
2078
- canDeposit = depositEnabled == 'true'
2079
- deposit = canDeposit if (canDeposit) else deposit
2080
- networkWithdrawFeeString = self.safe_string(chain, 'withdrawFee')
2081
- if networkWithdrawFeeString is not None:
2082
- minWithdrawFeeString = networkWithdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(networkWithdrawFeeString, minWithdrawFeeString)
2083
- networkMinWithdrawString = self.safe_string(chain, 'minWithdrawAmount')
2084
- if networkMinWithdrawString is not None:
2085
- minWithdrawString = networkMinWithdrawString if (minWithdrawString is None) else Precise.string_min(networkMinWithdrawString, minWithdrawString)
2086
- networkMinDepositString = self.safe_string(chain, 'minDepositAmount')
2087
- if networkMinDepositString is not None:
2088
- minDepositString = networkMinDepositString if (minDepositString is None) else Precise.string_min(networkMinDepositString, minDepositString)
2089
2076
  networks[network] = {
2090
2077
  'info': chain,
2091
2078
  'id': networkId,
2092
2079
  'network': network,
2093
2080
  'limits': {
2094
2081
  'withdraw': {
2095
- 'min': self.parse_number(networkMinWithdrawString),
2082
+ 'min': self.safe_number(chain, 'minWithdrawAmount'),
2096
2083
  'max': None,
2097
2084
  },
2098
2085
  'deposit': {
2099
- 'min': self.parse_number(networkMinDepositString),
2086
+ 'min': self.safe_number(chain, 'minDepositAmount'),
2100
2087
  'max': None,
2101
2088
  },
2102
2089
  },
2103
- 'active': canWithdraw and canDeposit,
2104
- 'withdraw': canWithdraw,
2105
- 'deposit': canDeposit,
2106
- 'fee': self.parse_number(networkWithdrawFeeString),
2107
- 'precision': None,
2090
+ 'active': None,
2091
+ 'withdraw': self.safe_string(chain, 'withdrawable') == 'true',
2092
+ 'deposit': self.safe_string(chain, 'rechargeable') == 'true',
2093
+ 'fee': self.safe_number(chain, 'withdrawFee'),
2094
+ 'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'withdrawMinScale'))),
2108
2095
  }
2109
- result[code] = {
2096
+ isFiat = self.in_array(code, fiatCurrencies)
2097
+ result[code] = self.safe_currency_structure({
2110
2098
  'info': entry,
2111
2099
  'id': id,
2112
2100
  'code': code,
2113
2101
  'networks': networks,
2114
- 'type': None,
2102
+ 'type': 'fiat' if isFiat else 'crypto',
2115
2103
  'name': None,
2116
- 'active': deposit and withdraw,
2117
- 'deposit': deposit,
2118
- 'withdraw': withdraw,
2119
- 'fee': self.parse_number(minWithdrawFeeString),
2104
+ 'active': None,
2105
+ 'deposit': None,
2106
+ 'withdraw': None,
2107
+ 'fee': None,
2120
2108
  'precision': None,
2121
2109
  'limits': {
2122
2110
  'amount': {
@@ -2124,16 +2112,16 @@ class bitget(Exchange, ImplicitAPI):
2124
2112
  'max': None,
2125
2113
  },
2126
2114
  'withdraw': {
2127
- 'min': self.parse_number(minWithdrawString),
2115
+ 'min': None,
2128
2116
  'max': None,
2129
2117
  },
2130
2118
  'deposit': {
2131
- 'min': self.parse_number(minDepositString),
2119
+ 'min': None,
2132
2120
  'max': None,
2133
2121
  },
2134
2122
  },
2135
2123
  'created': None,
2136
- }
2124
+ })
2137
2125
  return result
2138
2126
 
2139
2127
  def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
@@ -2752,7 +2740,7 @@ class bitget(Exchange, ImplicitAPI):
2752
2740
  close = self.safe_string(ticker, 'lastPr')
2753
2741
  timestamp = self.safe_integer_omit_zero(ticker, 'ts') # exchange bitget provided 0
2754
2742
  change = self.safe_string(ticker, 'change24h')
2755
- open24 = self.safe_string(ticker, 'open24')
2743
+ open24 = self.safe_string_2(ticker, 'open24', 'open24h')
2756
2744
  open = self.safe_string(ticker, 'open')
2757
2745
  symbol: str
2758
2746
  openValue: str
ccxt/bitmart.py CHANGED
@@ -225,6 +225,7 @@ class bitmart(Exchange, ImplicitAPI):
225
225
  'contract/private/order': 1.2,
226
226
  'contract/private/order-history': 10,
227
227
  'contract/private/position': 10,
228
+ 'contract/private/position-v2': 10,
228
229
  'contract/private/get-open-orders': 1.2,
229
230
  'contract/private/current-plan-order': 1.2,
230
231
  'contract/private/trades': 10,
@@ -1214,6 +1215,7 @@ class bitmart(Exchange, ImplicitAPI):
1214
1215
  # {
1215
1216
  # "currency": "BTC",
1216
1217
  # "name": "Bitcoin",
1218
+ # "recharge_minsize": '0.00000001',
1217
1219
  # "contract_address": null,
1218
1220
  # "network": "BTC",
1219
1221
  # "withdraw_enabled": True,
@@ -1235,7 +1237,8 @@ class bitmart(Exchange, ImplicitAPI):
1235
1237
  fullId = self.safe_string(currency, 'currency')
1236
1238
  currencyId = fullId
1237
1239
  networkId = self.safe_string(currency, 'network')
1238
- if fullId.find('NFT') < 0:
1240
+ isNtf = (fullId.find('NFT') >= 0)
1241
+ if not isNtf:
1239
1242
  parts = fullId.split('-')
1240
1243
  currencyId = self.safe_string(parts, 0)
1241
1244
  second = self.safe_string(parts, 1)
@@ -1254,6 +1257,7 @@ class bitmart(Exchange, ImplicitAPI):
1254
1257
  'withdraw': None,
1255
1258
  'active': None,
1256
1259
  'networks': {},
1260
+ 'type': 'other' if isNtf else 'crypto',
1257
1261
  }
1258
1262
  networkCode = self.network_id_to_code(networkId)
1259
1263
  withdraw = self.safe_bool(currency, 'withdraw_enabled')
@@ -4659,6 +4663,7 @@ class bitmart(Exchange, ImplicitAPI):
4659
4663
  fetch all open contract positions
4660
4664
 
4661
4665
  https://developer-pro.bitmart.com/en/futuresv2/#get-current-position-keyed
4666
+ https://developer-pro.bitmart.com/en/futuresv2/#get-current-position-v2-keyed
4662
4667
 
4663
4668
  :param str[]|None symbols: list of unified market symbols
4664
4669
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -4675,7 +4680,7 @@ class bitmart(Exchange, ImplicitAPI):
4675
4680
  if symbolsLength == 1:
4676
4681
  # only supports symbols or sending one symbol
4677
4682
  request['symbol'] = market['id']
4678
- response = self.privateGetContractPrivatePosition(self.extend(request, params))
4683
+ response = self.privateGetContractPrivatePositionV2(self.extend(request, params))
4679
4684
  #
4680
4685
  # {
4681
4686
  # "code": 1000,
ccxt/bitmex.py CHANGED
@@ -503,6 +503,7 @@ class bitmex(Exchange, ImplicitAPI):
503
503
  maxWithdrawal = self.parse_number(Precise.string_mul(maxWithdrawalString, precisionString))
504
504
  minDepositString = self.safe_string(currency, 'minDepositAmount')
505
505
  minDeposit = self.parse_number(Precise.string_mul(minDepositString, precisionString))
506
+ isCrypto = self.safe_string(currency, 'currencyType') == 'Crypto'
506
507
  result[code] = {
507
508
  'id': id,
508
509
  'code': code,
@@ -528,6 +529,7 @@ class bitmex(Exchange, ImplicitAPI):
528
529
  },
529
530
  },
530
531
  'networks': networks,
532
+ 'type': 'crypto' if isCrypto else 'other',
531
533
  }
532
534
  return result
533
535
 
@@ -756,6 +758,11 @@ class bitmex(Exchange, ImplicitAPI):
756
758
  maxOrderQty = self.safe_number(market, 'maxOrderQty')
757
759
  initMargin = self.safe_string(market, 'initMargin', '1')
758
760
  maxLeverage = self.parse_number(Precise.string_div('1', initMargin))
761
+ # subtype should be None for spot markets
762
+ if spot:
763
+ isInverse = None
764
+ isQuanto = None
765
+ linear = None
759
766
  return {
760
767
  'id': id,
761
768
  'symbol': symbol,
@@ -805,7 +812,7 @@ class bitmex(Exchange, ImplicitAPI):
805
812
  'max': maxOrderQty if positionIsQuote else None,
806
813
  },
807
814
  },
808
- 'created': self.parse8601(self.safe_string(market, 'listing')),
815
+ 'created': None, # 'listing' field is buggy, e.g. 2200-02-01T00:00:00.000Z
809
816
  'info': market,
810
817
  }
811
818
 
ccxt/bitopro.py CHANGED
@@ -245,6 +245,7 @@ class bitopro(Exchange, ImplicitAPI):
245
245
  'BEP20': 'BSC',
246
246
  'BSC': 'BSC',
247
247
  },
248
+ 'fiatCurrencies': ['TWD'], # the only fiat currency for exchange
248
249
  },
249
250
  'features': {
250
251
  'spot': {
@@ -373,6 +374,7 @@ class bitopro(Exchange, ImplicitAPI):
373
374
  # }
374
375
  #
375
376
  result: dict = {}
377
+ fiatCurrencies = self.safe_list(self.options, 'fiatCurrencies', [])
376
378
  for i in range(0, len(currencies)):
377
379
  currency = currencies[i]
378
380
  currencyId = self.safe_string(currency, 'currency')
@@ -392,11 +394,12 @@ class bitopro(Exchange, ImplicitAPI):
392
394
  'max': None,
393
395
  },
394
396
  }
397
+ isFiat = self.in_array(code, fiatCurrencies)
395
398
  result[code] = {
396
399
  'id': currencyId,
397
400
  'code': code,
398
401
  'info': currency,
399
- 'type': None,
402
+ 'type': 'fiat' if isFiat else 'crypto',
400
403
  'name': None,
401
404
  'active': deposit and withdraw,
402
405
  'deposit': deposit,
@@ -404,6 +407,7 @@ class bitopro(Exchange, ImplicitAPI):
404
407
  'fee': fee,
405
408
  'precision': None,
406
409
  'limits': limits,
410
+ 'networks': None,
407
411
  }
408
412
  return result
409
413
 
ccxt/bitrue.py CHANGED
@@ -833,7 +833,8 @@ class bitrue(Exchange, ImplicitAPI):
833
833
  'withdraw': withdraw,
834
834
  'networks': networks,
835
835
  'fee': self.parse_number(minWithdrawFeeString),
836
- # 'fees': fees,
836
+ 'fees': None,
837
+ 'type': 'crypto',
837
838
  'limits': {
838
839
  'withdraw': {
839
840
  'min': self.parse_number(minWithdrawString),
ccxt/bitso.py CHANGED
@@ -742,7 +742,7 @@ class bitso(Exchange, ImplicitAPI):
742
742
  # {
743
743
  # "bucket_start_time":1648219140000,
744
744
  # "first_trade_time":1648219154990,
745
- # "last_trade_time":1648219189441,
745
+ # "last_trade_time":1648219189442,
746
746
  # "first_rate":"44958.60",
747
747
  # "last_rate":"44979.88",
748
748
  # "min_rate":"44957.33",
ccxt/bitteam.py CHANGED
@@ -650,6 +650,7 @@ class bitteam(Exchange, ImplicitAPI):
650
650
  networkIds = list(feesByNetworkId.keys())
651
651
  networks: dict = {}
652
652
  networkPrecision = self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals')))
653
+ typeRaw = self.safe_string(currency, 'type')
653
654
  for j in range(0, len(networkIds)):
654
655
  networkId = networkIds[j]
655
656
  networkCode = self.network_id_to_code(networkId, code)
@@ -703,6 +704,7 @@ class bitteam(Exchange, ImplicitAPI):
703
704
  'max': None,
704
705
  },
705
706
  },
707
+ 'type': typeRaw, # 'crypto' or 'fiat'
706
708
  'networks': networks,
707
709
  }
708
710
  return result
ccxt/bitvavo.py CHANGED
@@ -361,6 +361,8 @@ class bitvavo(Exchange, ImplicitAPI):
361
361
  'ERC20': 'ETH',
362
362
  'TRC20': 'TRX',
363
363
  },
364
+ 'operatorId': None, # self will be required soon for order-related endpoints
365
+ 'fiatCurrencies': ['EUR'], # only fiat atm
364
366
  },
365
367
  'precisionMode': SIGNIFICANT_DIGITS,
366
368
  'commonCurrencies': {
@@ -567,24 +569,24 @@ class bitvavo(Exchange, ImplicitAPI):
567
569
  # },
568
570
  # ]
569
571
  #
572
+ fiatCurrencies = self.safe_list(self.options, 'fiatCurrencies', [])
570
573
  result: dict = {}
571
574
  for i in range(0, len(currencies)):
572
575
  currency = currencies[i]
573
576
  id = self.safe_string(currency, 'symbol')
574
577
  code = self.safe_currency_code(id)
578
+ isFiat = self.in_array(code, fiatCurrencies)
575
579
  networks: dict = {}
576
- networksArray = self.safe_value(currency, 'networks', [])
577
- networksLength = len(networksArray)
578
- isOneNetwork = (networksLength == 1)
579
- deposit = (self.safe_value(currency, 'depositStatus') == 'OK')
580
- withdrawal = (self.safe_value(currency, 'withdrawalStatus') == 'OK')
580
+ networksArray = self.safe_list(currency, 'networks', [])
581
+ deposit = self.safe_string(currency, 'depositStatus') == 'OK'
582
+ withdrawal = self.safe_string(currency, 'withdrawalStatus') == 'OK'
581
583
  active = deposit and withdrawal
582
584
  withdrawFee = self.safe_number(currency, 'withdrawalFee')
583
585
  precision = self.safe_integer(currency, 'decimals', 8)
584
586
  minWithdraw = self.safe_number(currency, 'withdrawalMinAmount')
585
- # absolutely all of them have 1 network atm - ETH. So, we can reliably assign that inside networks
586
- if isOneNetwork:
587
- networkId = networksArray[0]
587
+ # btw, absolutely all of them have 1 network atm
588
+ for j in range(0, len(networksArray)):
589
+ networkId = networksArray[j]
588
590
  networkCode = self.network_id_to_code(networkId)
589
591
  networks[networkCode] = {
590
592
  'info': currency,
@@ -602,7 +604,7 @@ class bitvavo(Exchange, ImplicitAPI):
602
604
  },
603
605
  },
604
606
  }
605
- result[code] = {
607
+ result[code] = self.safe_currency_structure({
606
608
  'info': currency,
607
609
  'id': id,
608
610
  'code': code,
@@ -613,6 +615,7 @@ class bitvavo(Exchange, ImplicitAPI):
613
615
  'networks': networks,
614
616
  'fee': withdrawFee,
615
617
  'precision': precision,
618
+ 'type': 'fiat' if isFiat else 'crypto',
616
619
  'limits': {
617
620
  'amount': {
618
621
  'min': None,
@@ -627,7 +630,7 @@ class bitvavo(Exchange, ImplicitAPI):
627
630
  'max': None,
628
631
  },
629
632
  },
630
- }
633
+ })
631
634
  # set currencies here to avoid calling publicGetAssets twice
632
635
  self.currencies = self.deep_extend(self.currencies, result)
633
636
  return result
@@ -1166,6 +1169,10 @@ class bitvavo(Exchange, ImplicitAPI):
1166
1169
  request['timeInForce'] = timeInForce
1167
1170
  if postOnly:
1168
1171
  request['postOnly'] = True
1172
+ operatorId = None
1173
+ operatorId, params = self.handle_option_and_params(params, 'createOrder', 'operatorId')
1174
+ if operatorId is not None:
1175
+ request['operatorId'] = self.parse_to_int(operatorId)
1169
1176
  return self.extend(request, params)
1170
1177
 
1171
1178
  def create_order(self, symbol: Str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -1259,6 +1266,10 @@ class bitvavo(Exchange, ImplicitAPI):
1259
1266
  clientOrderId = self.safe_string(params, 'clientOrderId')
1260
1267
  if clientOrderId is None:
1261
1268
  request['orderId'] = id
1269
+ operatorId = None
1270
+ operatorId, params = self.handle_option_and_params(params, 'editOrder', 'operatorId')
1271
+ if operatorId is not None:
1272
+ request['operatorId'] = self.parse_to_int(operatorId)
1262
1273
  request['market'] = market['id']
1263
1274
  return request
1264
1275
 
@@ -1293,6 +1304,10 @@ class bitvavo(Exchange, ImplicitAPI):
1293
1304
  clientOrderId = self.safe_string(params, 'clientOrderId')
1294
1305
  if clientOrderId is None:
1295
1306
  request['orderId'] = id
1307
+ operatorId = None
1308
+ operatorId, params = self.handle_option_and_params(params, 'cancelOrder', 'operatorId')
1309
+ if operatorId is not None:
1310
+ request['operatorId'] = self.parse_to_int(operatorId)
1296
1311
  return self.extend(request, params)
1297
1312
 
1298
1313
  def cancel_order(self, id: str, symbol: Str = None, params={}):
ccxt/btcalpha.py CHANGED
@@ -216,7 +216,7 @@ class btcalpha(Exchange, ImplicitAPI):
216
216
  'symbolRequired': False,
217
217
  },
218
218
  'fetchOHLCV': {
219
- 'max': 720,
219
+ 'limit': 720,
220
220
  },
221
221
  },
222
222
  'swap': {
ccxt/btcmarkets.py CHANGED
@@ -455,7 +455,7 @@ class btcmarkets(Exchange, ImplicitAPI):
455
455
  # "marketId":"COMP-AUD",
456
456
  # "baseAssetName":"COMP",
457
457
  # "quoteAssetName":"AUD",
458
- # "minOrderAmount":"0.00007",
458
+ # "minOrderAmount":"0.00006",
459
459
  # "maxOrderAmount":"1000000",
460
460
  # "amountDecimals":"8",
461
461
  # "priceDecimals":"2",
ccxt/btcturk.py CHANGED
@@ -248,7 +248,7 @@ class btcturk(Exchange, ImplicitAPI):
248
248
  # "minPrice": "0.0000000000001",
249
249
  # "maxPrice": "10000000",
250
250
  # "tickSize": "10",
251
- # "minExchangeValue": "99.91",
251
+ # "minExchangeValue": "99.92",
252
252
  # "minAmount": null,
253
253
  # "maxAmount": null
254
254
  # }
ccxt/bybit.py CHANGED
@@ -1040,9 +1040,6 @@ class bybit(Exchange, ImplicitAPI):
1040
1040
  'usePrivateInstrumentsInfo': False,
1041
1041
  'enableDemoTrading': False,
1042
1042
  'fetchMarkets': ['spot', 'linear', 'inverse', 'option'],
1043
- 'createOrder': {
1044
- 'method': 'privatePostV5OrderCreate', # 'privatePostV5PositionTradingStop'
1045
- },
1046
1043
  'enableUnifiedMargin': None,
1047
1044
  'enableUnifiedAccount': None,
1048
1045
  'unifiedMarginStatus': None,
@@ -2141,7 +2138,7 @@ class bybit(Exchange, ImplicitAPI):
2141
2138
  'quoteId': quoteId,
2142
2139
  'settleId': settleId,
2143
2140
  'type': 'option',
2144
- 'subType': 'linear',
2141
+ 'subType': None,
2145
2142
  'spot': False,
2146
2143
  'margin': False,
2147
2144
  'swap': False,
@@ -2149,8 +2146,8 @@ class bybit(Exchange, ImplicitAPI):
2149
2146
  'option': True,
2150
2147
  'active': isActive,
2151
2148
  'contract': True,
2152
- 'linear': True,
2153
- 'inverse': False,
2149
+ 'linear': None,
2150
+ 'inverse': None,
2154
2151
  'taker': self.safe_number(market, 'takerFee', self.parse_number('0.0006')),
2155
2152
  'maker': self.safe_number(market, 'makerFee', self.parse_number('0.0001')),
2156
2153
  'contractSize': self.parse_number('1'),
@@ -3774,12 +3771,21 @@ class bybit(Exchange, ImplicitAPI):
3774
3771
  parts = self.is_unified_enabled()
3775
3772
  enableUnifiedAccount = parts[1]
3776
3773
  trailingAmount = self.safe_string_2(params, 'trailingAmount', 'trailingStop')
3774
+ stopLossPrice = self.safe_string(params, 'stopLossPrice')
3775
+ takeProfitPrice = self.safe_string(params, 'takeProfitPrice')
3777
3776
  isTrailingAmountOrder = trailingAmount is not None
3777
+ isStopLoss = stopLossPrice is not None
3778
+ isTakeProfit = takeProfitPrice is not None
3778
3779
  orderRequest = self.create_order_request(symbol, type, side, amount, price, params, enableUnifiedAccount)
3779
- options = self.safe_dict(self.options, 'createOrder', {})
3780
- defaultMethod = self.safe_string(options, 'method', 'privatePostV5OrderCreate')
3780
+ defaultMethod = None
3781
+ if isTrailingAmountOrder or isStopLoss or isTakeProfit:
3782
+ defaultMethod = 'privatePostV5PositionTradingStop'
3783
+ else:
3784
+ defaultMethod = 'privatePostV5OrderCreate'
3785
+ method = None
3786
+ method, params = self.handle_option_and_params(params, 'createOrder', 'method', defaultMethod)
3781
3787
  response = None
3782
- if isTrailingAmountOrder or (defaultMethod == 'privatePostV5PositionTradingStop'):
3788
+ if method == 'privatePostV5PositionTradingStop':
3783
3789
  response = self.privatePostV5PositionTradingStop(orderRequest)
3784
3790
  else:
3785
3791
  response = self.privatePostV5OrderCreate(orderRequest) # already extended inside createOrderRequest
@@ -3804,8 +3810,6 @@ class bybit(Exchange, ImplicitAPI):
3804
3810
  lowerCaseType = type.lower()
3805
3811
  if (price is None) and (lowerCaseType == 'limit'):
3806
3812
  raise ArgumentsRequired(self.id + ' createOrder requires a price argument for limit orders')
3807
- defaultMethod = None
3808
- defaultMethod, params = self.handle_option_and_params(params, 'createOrder', 'method', 'privatePostV5OrderCreate')
3809
3813
  request: dict = {
3810
3814
  'symbol': market['id'],
3811
3815
  # 'side': self.capitalize(side),
@@ -3849,7 +3853,14 @@ class bybit(Exchange, ImplicitAPI):
3849
3853
  isMarket = lowerCaseType == 'market'
3850
3854
  isLimit = lowerCaseType == 'limit'
3851
3855
  isBuy = side == 'buy'
3852
- isAlternativeEndpoint = defaultMethod == 'privatePostV5PositionTradingStop'
3856
+ defaultMethod = None
3857
+ if isTrailingAmountOrder or isStopLossTriggerOrder or isTakeProfitTriggerOrder:
3858
+ defaultMethod = 'privatePostV5PositionTradingStop'
3859
+ else:
3860
+ defaultMethod = 'privatePostV5OrderCreate'
3861
+ method = None
3862
+ method, params = self.handle_option_and_params(params, 'createOrder', 'method', defaultMethod)
3863
+ isAlternativeEndpoint = method == 'privatePostV5PositionTradingStop'
3853
3864
  amountString = self.get_amount(symbol, amount)
3854
3865
  priceString = self.get_price(symbol, self.number_to_string(price)) if (price is not None) else None
3855
3866
  if isTrailingAmountOrder or isAlternativeEndpoint:
@@ -3900,12 +3911,12 @@ class bybit(Exchange, ImplicitAPI):
3900
3911
  request['price'] = priceString
3901
3912
  if market['spot']:
3902
3913
  request['category'] = 'spot'
3914
+ elif market['option']:
3915
+ request['category'] = 'option'
3903
3916
  elif market['linear']:
3904
3917
  request['category'] = 'linear'
3905
3918
  elif market['inverse']:
3906
3919
  request['category'] = 'inverse'
3907
- elif market['option']:
3908
- request['category'] = 'option'
3909
3920
  cost = self.safe_string(params, 'cost')
3910
3921
  params = self.omit(params, 'cost')
3911
3922
  # if the cost is inferable, let's keep the old logic and ignore marketUnit, to minimize the impact of the changes
@@ -5650,7 +5661,8 @@ classic accounts only/ spot not supported* fetches information on an order made
5650
5661
  subType, params = self.handle_sub_type_and_params('fetchLedger', None, params)
5651
5662
  response = None
5652
5663
  if enableUnified[1]:
5653
- if subType == 'inverse':
5664
+ unifiedMarginStatus = self.safe_integer(self.options, 'unifiedMarginStatus', 5) # 3/4 uta 1.0, 5/6 uta 2.0
5665
+ if subType == 'inverse' and (unifiedMarginStatus < 5):
5654
5666
  response = self.privateGetV5AccountContractTransactionLog(self.extend(request, params))
5655
5667
  else:
5656
5668
  response = self.privateGetV5AccountTransactionLog(self.extend(request, params))
ccxt/coinbase.py CHANGED
@@ -386,7 +386,6 @@ class coinbase(Exchange, ImplicitAPI):
386
386
  'fetchBalance': 'v2PrivateGetAccounts', # 'v2PrivateGetAccounts' or 'v3PrivateGetBrokerageAccounts'
387
387
  'fetchTime': 'v2PublicGetTime', # 'v2PublicGetTime' or 'v3PublicGetBrokerageTime'
388
388
  'user_native_currency': 'USD', # needed to get fees for v3
389
- 'aliasCbMarketIds': {},
390
389
  },
391
390
  'features': {
392
391
  'default': {
@@ -1474,8 +1473,6 @@ class coinbase(Exchange, ImplicitAPI):
1474
1473
  perpetualData = self.safe_list(perpetualFutures, 'products', [])
1475
1474
  for i in range(0, len(perpetualData)):
1476
1475
  result.append(self.parse_contract_market(perpetualData[i], perpetualFeeTier))
1477
- # remove aliases
1478
- self.options['aliasCbMarketIds'] = {}
1479
1476
  newMarkets = []
1480
1477
  for i in range(0, len(result)):
1481
1478
  market = result[i]
@@ -1483,21 +1480,12 @@ class coinbase(Exchange, ImplicitAPI):
1483
1480
  realMarketIds = self.safe_list(info, 'alias_to', [])
1484
1481
  length = len(realMarketIds)
1485
1482
  if length > 0:
1486
- self.options['aliasCbMarketIds'][market['id']] = realMarketIds[0]
1487
- self.options['aliasCbMarketIds'][market['symbol']] = realMarketIds[0]
1483
+ market['alias'] = realMarketIds[0]
1488
1484
  else:
1489
- newMarkets.append(market)
1485
+ market['alias'] = None
1486
+ newMarkets.append(market)
1490
1487
  return newMarkets
1491
1488
 
1492
- def market(self, symbol: str) -> MarketInterface:
1493
- finalSymbol = self.safe_string(self.options['aliasCbMarketIds'], symbol, symbol)
1494
- return super(coinbase, self).market(finalSymbol)
1495
-
1496
- def safe_market(self, marketId: Str = None, market: Market = None, delimiter: Str = None, marketType: Str = None) -> MarketInterface:
1497
- if marketId in self.options['aliasCbMarketIds']:
1498
- return self.market(marketId)
1499
- return super(coinbase, self).safe_market(marketId, market, delimiter, marketType)
1500
-
1501
1489
  def parse_spot_market(self, market, feeTier) -> MarketInterface:
1502
1490
  #
1503
1491
  # {
ccxt/coinex.py CHANGED
@@ -757,6 +757,7 @@ class coinex(Exchange, ImplicitAPI):
757
757
  },
758
758
  },
759
759
  'networks': {},
760
+ 'type': 'crypto',
760
761
  'info': coin,
761
762
  }
762
763
  for j in range(0, len(chains)):
ccxt/coinlist.py CHANGED
@@ -489,6 +489,7 @@ class coinlist(Exchange, ImplicitAPI):
489
489
  'withdraw': {'min': minWithdrawal, 'max': None},
490
490
  },
491
491
  'networks': {},
492
+ 'type': 'crypto',
492
493
  }
493
494
  return result
494
495