ccxt 4.4.23__py2.py3-none-any.whl → 4.4.24__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.
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.4.23'
25
+ __version__ = '4.4.24'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/binance.py CHANGED
@@ -697,7 +697,7 @@ class ImplicitAPI:
697
697
  papi_get_cm_adlquantile = papiGetCmAdlQuantile = Entry('cm/adlQuantile', 'papi', 'GET', {'cost': 5})
698
698
  papi_get_um_trade_asyn = papiGetUmTradeAsyn = Entry('um/trade/asyn', 'papi', 'GET', {'cost': 300})
699
699
  papi_get_um_trade_asyn_id = papiGetUmTradeAsynId = Entry('um/trade/asyn/id', 'papi', 'GET', {'cost': 2})
700
- papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn/', 'papi', 'GET', {'cost': 300})
700
+ papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn', 'papi', 'GET', {'cost': 300})
701
701
  papi_get_um_order_asyn_id = papiGetUmOrderAsynId = Entry('um/order/asyn/id', 'papi', 'GET', {'cost': 2})
702
702
  papi_get_um_income_asyn = papiGetUmIncomeAsyn = Entry('um/income/asyn', 'papi', 'GET', {'cost': 300})
703
703
  papi_get_um_income_asyn_id = papiGetUmIncomeAsynId = Entry('um/income/asyn/id', 'papi', 'GET', {'cost': 2})
@@ -697,7 +697,7 @@ class ImplicitAPI:
697
697
  papi_get_cm_adlquantile = papiGetCmAdlQuantile = Entry('cm/adlQuantile', 'papi', 'GET', {'cost': 5})
698
698
  papi_get_um_trade_asyn = papiGetUmTradeAsyn = Entry('um/trade/asyn', 'papi', 'GET', {'cost': 300})
699
699
  papi_get_um_trade_asyn_id = papiGetUmTradeAsynId = Entry('um/trade/asyn/id', 'papi', 'GET', {'cost': 2})
700
- papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn/', 'papi', 'GET', {'cost': 300})
700
+ papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn', 'papi', 'GET', {'cost': 300})
701
701
  papi_get_um_order_asyn_id = papiGetUmOrderAsynId = Entry('um/order/asyn/id', 'papi', 'GET', {'cost': 2})
702
702
  papi_get_um_income_asyn = papiGetUmIncomeAsyn = Entry('um/income/asyn', 'papi', 'GET', {'cost': 300})
703
703
  papi_get_um_income_asyn_id = papiGetUmIncomeAsynId = Entry('um/income/asyn/id', 'papi', 'GET', {'cost': 2})
@@ -749,7 +749,7 @@ class ImplicitAPI:
749
749
  papi_get_cm_adlquantile = papiGetCmAdlQuantile = Entry('cm/adlQuantile', 'papi', 'GET', {'cost': 5})
750
750
  papi_get_um_trade_asyn = papiGetUmTradeAsyn = Entry('um/trade/asyn', 'papi', 'GET', {'cost': 300})
751
751
  papi_get_um_trade_asyn_id = papiGetUmTradeAsynId = Entry('um/trade/asyn/id', 'papi', 'GET', {'cost': 2})
752
- papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn/', 'papi', 'GET', {'cost': 300})
752
+ papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn', 'papi', 'GET', {'cost': 300})
753
753
  papi_get_um_order_asyn_id = papiGetUmOrderAsynId = Entry('um/order/asyn/id', 'papi', 'GET', {'cost': 2})
754
754
  papi_get_um_income_asyn = papiGetUmIncomeAsyn = Entry('um/income/asyn', 'papi', 'GET', {'cost': 300})
755
755
  papi_get_um_income_asyn_id = papiGetUmIncomeAsynId = Entry('um/income/asyn/id', 'papi', 'GET', {'cost': 2})
@@ -697,7 +697,7 @@ class ImplicitAPI:
697
697
  papi_get_cm_adlquantile = papiGetCmAdlQuantile = Entry('cm/adlQuantile', 'papi', 'GET', {'cost': 5})
698
698
  papi_get_um_trade_asyn = papiGetUmTradeAsyn = Entry('um/trade/asyn', 'papi', 'GET', {'cost': 300})
699
699
  papi_get_um_trade_asyn_id = papiGetUmTradeAsynId = Entry('um/trade/asyn/id', 'papi', 'GET', {'cost': 2})
700
- papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn/', 'papi', 'GET', {'cost': 300})
700
+ papi_get_um_order_asyn = papiGetUmOrderAsyn = Entry('um/order/asyn', 'papi', 'GET', {'cost': 300})
701
701
  papi_get_um_order_asyn_id = papiGetUmOrderAsynId = Entry('um/order/asyn/id', 'papi', 'GET', {'cost': 2})
702
702
  papi_get_um_income_asyn = papiGetUmIncomeAsyn = Entry('um/income/asyn', 'papi', 'GET', {'cost': 300})
703
703
  papi_get_um_income_asyn_id = papiGetUmIncomeAsynId = Entry('um/income/asyn/id', 'papi', 'GET', {'cost': 2})
ccxt/abstract/kucoin.py CHANGED
@@ -49,6 +49,7 @@ class ImplicitAPI:
49
49
  private_get_market_orderbook_level_level = privateGetMarketOrderbookLevelLevel = Entry('market/orderbook/level{level}', 'private', 'GET', {'cost': 3})
50
50
  private_get_market_orderbook_level2 = privateGetMarketOrderbookLevel2 = Entry('market/orderbook/level2', 'private', 'GET', {'cost': 3})
51
51
  private_get_market_orderbook_level3 = privateGetMarketOrderbookLevel3 = Entry('market/orderbook/level3', 'private', 'GET', {'cost': 3})
52
+ private_get_hf_accounts_opened = privateGetHfAccountsOpened = Entry('hf/accounts/opened', 'private', 'GET', {'cost': 2})
52
53
  private_get_hf_orders_active = privateGetHfOrdersActive = Entry('hf/orders/active', 'private', 'GET', {'cost': 2})
53
54
  private_get_hf_orders_active_symbols = privateGetHfOrdersActiveSymbols = Entry('hf/orders/active/symbols', 'private', 'GET', {'cost': 2})
54
55
  private_get_hf_margin_order_active_symbols = privateGetHfMarginOrderActiveSymbols = Entry('hf/margin/order/active/symbols', 'private', 'GET', {'cost': 2})
@@ -49,6 +49,7 @@ class ImplicitAPI:
49
49
  private_get_market_orderbook_level_level = privateGetMarketOrderbookLevelLevel = Entry('market/orderbook/level{level}', 'private', 'GET', {'cost': 3})
50
50
  private_get_market_orderbook_level2 = privateGetMarketOrderbookLevel2 = Entry('market/orderbook/level2', 'private', 'GET', {'cost': 3})
51
51
  private_get_market_orderbook_level3 = privateGetMarketOrderbookLevel3 = Entry('market/orderbook/level3', 'private', 'GET', {'cost': 3})
52
+ private_get_hf_accounts_opened = privateGetHfAccountsOpened = Entry('hf/accounts/opened', 'private', 'GET', {'cost': 2})
52
53
  private_get_hf_orders_active = privateGetHfOrdersActive = Entry('hf/orders/active', 'private', 'GET', {'cost': 2})
53
54
  private_get_hf_orders_active_symbols = privateGetHfOrdersActiveSymbols = Entry('hf/orders/active/symbols', 'private', 'GET', {'cost': 2})
54
55
  private_get_hf_margin_order_active_symbols = privateGetHfMarginOrderActiveSymbols = Entry('hf/margin/order/active/symbols', 'private', 'GET', {'cost': 2})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.23'
7
+ __version__ = '4.4.24'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.23'
5
+ __version__ = '4.4.24'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -1118,7 +1118,7 @@ class binance(Exchange, ImplicitAPI):
1118
1118
  'cm/adlQuantile': 5,
1119
1119
  'um/trade/asyn': 300,
1120
1120
  'um/trade/asyn/id': 2,
1121
- 'um/order/asyn/': 300,
1121
+ 'um/order/asyn': 300,
1122
1122
  'um/order/asyn/id': 2,
1123
1123
  'um/income/asyn': 300,
1124
1124
  'um/income/asyn/id': 2,
@@ -1027,6 +1027,7 @@ class bybit(Exchange, ImplicitAPI):
1027
1027
  },
1028
1028
  'enableUnifiedMargin': None,
1029
1029
  'enableUnifiedAccount': None,
1030
+ 'unifiedMarginStatus': None,
1030
1031
  'createMarketBuyOrderRequiresPrice': True, # only True for classic accounts
1031
1032
  'createUnifiedMarginAccount': False,
1032
1033
  'defaultType': 'swap', # 'swap', 'future', 'option', 'spot'
@@ -1146,6 +1147,8 @@ class bybit(Exchange, ImplicitAPI):
1146
1147
 
1147
1148
  async def is_unified_enabled(self, params={}):
1148
1149
  """
1150
+ :see: https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
1151
+ :see: https://bybit-exchange.github.io/docs/v5/account/account-info
1149
1152
  returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
1150
1153
  """
1151
1154
  # The API key of user id must own one of permissions will be allowed to call following API endpoints.
@@ -1159,8 +1162,12 @@ class bybit(Exchange, ImplicitAPI):
1159
1162
  # so we're assuming UTA is enabled
1160
1163
  self.options['enableUnifiedMargin'] = False
1161
1164
  self.options['enableUnifiedAccount'] = True
1165
+ self.options['unifiedMarginStatus'] = 3
1162
1166
  return [self.options['enableUnifiedMargin'], self.options['enableUnifiedAccount']]
1163
- response = await self.privateGetV5UserQueryApi(params)
1167
+ rawPromises = [self.privateGetV5UserQueryApi(params), self.privateGetV5AccountInfo(params)]
1168
+ promises = await asyncio.gather(*rawPromises)
1169
+ response = promises[0]
1170
+ accountInfo = promises[1]
1164
1171
  #
1165
1172
  # {
1166
1173
  # "retCode": 0,
@@ -1200,13 +1207,34 @@ class bybit(Exchange, ImplicitAPI):
1200
1207
  # "retExtInfo": {},
1201
1208
  # "time": 1676891757649
1202
1209
  # }
1210
+ # account info
1211
+ # {
1212
+ # "retCode": 0,
1213
+ # "retMsg": "OK",
1214
+ # "result": {
1215
+ # "marginMode": "REGULAR_MARGIN",
1216
+ # "updatedTime": "1697078946000",
1217
+ # "unifiedMarginStatus": 4,
1218
+ # "dcpStatus": "OFF",
1219
+ # "timeWindow": 10,
1220
+ # "smpGroup": 0,
1221
+ # "isMasterTrader": False,
1222
+ # "spotHedgingStatus": "OFF"
1223
+ # }
1224
+ # }
1203
1225
  #
1204
1226
  result = self.safe_dict(response, 'result', {})
1227
+ accountResult = self.safe_dict(accountInfo, 'result', {})
1205
1228
  self.options['enableUnifiedMargin'] = self.safe_integer(result, 'unified') == 1
1206
1229
  self.options['enableUnifiedAccount'] = self.safe_integer(result, 'uta') == 1
1230
+ self.options['unifiedMarginStatus'] = self.safe_integer(accountResult, 'unifiedMarginStatus', 3) # default to uta.1 if not found
1207
1231
  return [self.options['enableUnifiedMargin'], self.options['enableUnifiedAccount']]
1208
1232
 
1209
1233
  async def upgrade_unified_trade_account(self, params={}):
1234
+ """
1235
+ :see: https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
1236
+ upgrades the account to unified trade account *warning* self is irreversible
1237
+ """
1210
1238
  return await self.privatePostV5AccountUpgradeToUta(params)
1211
1239
 
1212
1240
  def create_expired_option_market(self, symbol: str):
@@ -3019,10 +3047,15 @@ class bybit(Exchange, ImplicitAPI):
3019
3047
  isInverse = (type == 'inverse')
3020
3048
  isFunding = (lowercaseRawType == 'fund') or (lowercaseRawType == 'funding')
3021
3049
  if isUnifiedAccount:
3022
- if isInverse:
3023
- type = 'contract'
3050
+ unifiedMarginStatus = self.safe_integer(self.options, 'unifiedMarginStatus', 3)
3051
+ if unifiedMarginStatus < 5:
3052
+ # it's not uta.20 where inverse are unified
3053
+ if isInverse:
3054
+ type = 'contract'
3055
+ else:
3056
+ type = 'unified'
3024
3057
  else:
3025
- type = 'unified'
3058
+ type = 'unified' # uta.20 where inverse are unified
3026
3059
  else:
3027
3060
  if isLinear or isInverse:
3028
3061
  type = 'contract'
@@ -154,7 +154,7 @@ class coincatch(Exchange, ImplicitAPI):
154
154
  '1M': '1M',
155
155
  },
156
156
  'urls': {
157
- 'logo': 'https://private-user-images.githubusercontent.com/43336371/379178446-b99d8af1-3016-4775-ac37-d5016dccb000.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjk2NzMxOTksIm5iZiI6MTcyOTY3Mjg5OSwicGF0aCI6Ii80MzMzNjM3MS8zNzkxNzg0NDYtYjk5ZDhhZjEtMzAxNi00Nzc1LWFjMzctZDUwMTZkY2NiMDAwLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMDIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTAyM1QwODQxMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xMTkzNTAzYjhlYzg5ODU4ZjFhYzgwZTg3MGFmYjk5MWViMjMwNDY5ZGU4NDRlNGU0NmUxYTgxMzM3OTNlZWM4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.tosowLHE9p_cKbY8dPPduHXFVJQrUZ8qzGBOTCCznvw',
157
+ 'logo': 'https://github.com/user-attachments/assets/3d49065f-f05d-4573-88a2-1b5201ec6ff3',
158
158
  'api': {
159
159
  'public': 'https://api.coincatch.com',
160
160
  'private': 'https://api.coincatch.com',