ccxt 4.3.61__py2.py3-none-any.whl → 4.3.62__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.
- ccxt/__init__.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/fast_client.py +2 -2
- ccxt/async_support/binance.py +37 -29
- ccxt/async_support/bingx.py +41 -33
- ccxt/async_support/bybit.py +1 -1
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/xt.py +1 -1
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +37 -29
- ccxt/bingx.py +41 -33
- ccxt/bybit.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +3 -3
- ccxt/pro/binance.py +2 -4
- ccxt/pro/bingx.py +2 -2
- ccxt/pro/bitfinex2.py +2 -2
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bitmex.py +1 -1
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/bybit.py +5 -5
- ccxt/pro/coinbaseexchange.py +2 -2
- ccxt/pro/coincheck.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/cryptocom.py +1 -1
- ccxt/pro/deribit.py +1 -1
- ccxt/pro/gate.py +2 -2
- ccxt/pro/hollaex.py +1 -1
- ccxt/pro/htx.py +1 -1
- ccxt/pro/hyperliquid.py +3 -3
- ccxt/pro/kraken.py +1 -1
- ccxt/pro/kucoin.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/pro/okx.py +1 -1
- ccxt/pro/oxfun.py +1 -1
- ccxt/pro/phemex.py +1 -1
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/vertex.py +2 -2
- ccxt/pro/whitebit.py +1 -1
- ccxt/pro/woo.py +1 -1
- ccxt/tradeogre.py +1 -1
- ccxt/xt.py +1 -1
- {ccxt-4.3.61.dist-info → ccxt-4.3.62.dist-info}/METADATA +4 -4
- {ccxt-4.3.61.dist-info → ccxt-4.3.62.dist-info}/RECORD +48 -48
- {ccxt-4.3.61.dist-info → ccxt-4.3.62.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.61.dist-info → ccxt-4.3.62.dist-info}/WHEEL +0 -0
- {ccxt-4.3.61.dist-info → ccxt-4.3.62.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/async_support/__init__.py
CHANGED
@@ -35,7 +35,7 @@ class FastClient(AiohttpClient):
|
|
35
35
|
self.stack.append(message)
|
36
36
|
|
37
37
|
def feed_eof():
|
38
|
-
if self._close_code == 1000: # OK close
|
38
|
+
if self.connection._close_code == 1000: # OK close
|
39
39
|
self.on_close(1000)
|
40
40
|
else:
|
41
41
|
self.on_error(1006) # ABNORMAL_CLOSURE
|
@@ -58,7 +58,7 @@ class FastClient(AiohttpClient):
|
|
58
58
|
try:
|
59
59
|
await _self._writer.close(code, message)
|
60
60
|
_self._response.close()
|
61
|
-
|
61
|
+
_self._close_code = 1000
|
62
62
|
except asyncio.CancelledError:
|
63
63
|
_self._response.close()
|
64
64
|
_self._close_code = 1006
|
ccxt/async_support/binance.py
CHANGED
@@ -9104,34 +9104,38 @@ class binance(Exchange, ImplicitAPI):
|
|
9104
9104
|
if marginMode == 'cross':
|
9105
9105
|
# calculate collateral
|
9106
9106
|
precision = self.safe_dict(market, 'precision', {})
|
9107
|
-
|
9108
|
-
|
9109
|
-
|
9110
|
-
|
9111
|
-
if
|
9112
|
-
|
9113
|
-
|
9114
|
-
|
9115
|
-
|
9116
|
-
|
9117
|
-
|
9118
|
-
|
9119
|
-
|
9120
|
-
|
9121
|
-
|
9122
|
-
|
9123
|
-
|
9124
|
-
|
9125
|
-
if side == 'short':
|
9126
|
-
onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
|
9107
|
+
basePrecisionValue = self.safe_string(precision, 'base')
|
9108
|
+
quotePrecisionValue = self.safe_string_2(precision, 'quote', 'price')
|
9109
|
+
precisionIsUndefined = (basePrecisionValue is None) and (quotePrecisionValue is None)
|
9110
|
+
if not precisionIsUndefined:
|
9111
|
+
if linear:
|
9112
|
+
# walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
|
9113
|
+
onePlusMaintenanceMarginPercentageString = None
|
9114
|
+
entryPriceSignString = entryPriceString
|
9115
|
+
if side == 'short':
|
9116
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_add('1', maintenanceMarginPercentageString)
|
9117
|
+
entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
|
9118
|
+
else:
|
9119
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_add('-1', maintenanceMarginPercentageString)
|
9120
|
+
inner = Precise.string_mul(liquidationPriceString, onePlusMaintenanceMarginPercentageString)
|
9121
|
+
leftSide = Precise.string_add(inner, entryPriceSignString)
|
9122
|
+
quotePrecision = self.precision_from_string(self.safe_string_2(precision, 'quote', 'price'))
|
9123
|
+
if quotePrecision is not None:
|
9124
|
+
collateralString = Precise.string_div(Precise.string_mul(leftSide, contractsAbs), '1', quotePrecision)
|
9127
9125
|
else:
|
9128
|
-
|
9129
|
-
|
9130
|
-
|
9131
|
-
|
9132
|
-
|
9133
|
-
|
9134
|
-
|
9126
|
+
# walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)
|
9127
|
+
onePlusMaintenanceMarginPercentageString = None
|
9128
|
+
entryPriceSignString = entryPriceString
|
9129
|
+
if side == 'short':
|
9130
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
|
9131
|
+
else:
|
9132
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_sub('-1', maintenanceMarginPercentageString)
|
9133
|
+
entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
|
9134
|
+
leftSide = Precise.string_mul(contractsAbs, contractSizeString)
|
9135
|
+
rightSide = Precise.string_sub(Precise.string_div('1', entryPriceSignString), Precise.string_div(onePlusMaintenanceMarginPercentageString, liquidationPriceString))
|
9136
|
+
basePrecision = self.precision_from_string(self.safe_string(precision, 'base'))
|
9137
|
+
if basePrecision is not None:
|
9138
|
+
collateralString = Precise.string_div(Precise.string_mul(leftSide, rightSide), '1', basePrecision)
|
9135
9139
|
else:
|
9136
9140
|
collateralString = self.safe_string(position, 'isolatedMargin')
|
9137
9141
|
collateralString = '0' if (collateralString is None) else collateralString
|
@@ -9696,9 +9700,10 @@ class binance(Exchange, ImplicitAPI):
|
|
9696
9700
|
#
|
9697
9701
|
result = []
|
9698
9702
|
for i in range(0, len(response)):
|
9699
|
-
|
9700
|
-
entryPrice = self.safe_string(
|
9703
|
+
rawPosition = response[i]
|
9704
|
+
entryPrice = self.safe_string(rawPosition, 'entryPrice')
|
9701
9705
|
if (entryPrice != '0') and (entryPrice != '0.0') and (entryPrice != '0.00000000'):
|
9706
|
+
parsed = self.parse_position_risk(response[i])
|
9702
9707
|
result.append(parsed)
|
9703
9708
|
symbols = self.market_symbols(symbols)
|
9704
9709
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
@@ -11201,6 +11206,8 @@ class binance(Exchange, ImplicitAPI):
|
|
11201
11206
|
request: dict = {}
|
11202
11207
|
if market['option']:
|
11203
11208
|
request['underlyingAsset'] = market['baseId']
|
11209
|
+
if market['expiry'] is None:
|
11210
|
+
raise NotSupported(self.id + ' fetchOpenInterest does not support ' + symbol)
|
11204
11211
|
request['expiration'] = self.yymmdd(market['expiry'])
|
11205
11212
|
else:
|
11206
11213
|
request['symbol'] = market['id']
|
@@ -11242,6 +11249,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11242
11249
|
# ]
|
11243
11250
|
#
|
11244
11251
|
if market['option']:
|
11252
|
+
symbol = market['symbol']
|
11245
11253
|
result = self.parse_open_interests(response, market)
|
11246
11254
|
for i in range(0, len(result)):
|
11247
11255
|
item = result[i]
|
ccxt/async_support/bingx.py
CHANGED
@@ -528,37 +528,40 @@ class bingx(Exchange, ImplicitAPI):
|
|
528
528
|
response = await self.walletsV1PrivateGetCapitalConfigGetall(params)
|
529
529
|
#
|
530
530
|
# {
|
531
|
-
#
|
532
|
-
#
|
533
|
-
#
|
531
|
+
# "code": 0,
|
532
|
+
# "timestamp": 1702623271477,
|
533
|
+
# "data": [
|
534
|
+
# {
|
535
|
+
# "coin": "BTC",
|
536
|
+
# "name": "BTC",
|
537
|
+
# "networkList": [
|
534
538
|
# {
|
535
|
-
# "coin": "BTC",
|
536
539
|
# "name": "BTC",
|
537
|
-
# "
|
538
|
-
#
|
539
|
-
#
|
540
|
-
#
|
541
|
-
#
|
542
|
-
#
|
543
|
-
#
|
544
|
-
#
|
545
|
-
#
|
546
|
-
#
|
547
|
-
#
|
548
|
-
#
|
549
|
-
#
|
550
|
-
#
|
551
|
-
#
|
552
|
-
#
|
553
|
-
#
|
554
|
-
#
|
555
|
-
#
|
556
|
-
#
|
557
|
-
#
|
558
|
-
#
|
559
|
-
#
|
560
|
-
#
|
561
|
-
#
|
540
|
+
# "network": "BTC",
|
541
|
+
# "isDefault": True,
|
542
|
+
# "minConfirm": 2,
|
543
|
+
# "withdrawEnable": True,
|
544
|
+
# "depositEnable": True,
|
545
|
+
# "withdrawFee": "0.0006",
|
546
|
+
# "withdrawMax": "1.17522",
|
547
|
+
# "withdrawMin": "0.0005",
|
548
|
+
# "depositMin": "0.0002"
|
549
|
+
# },
|
550
|
+
# {
|
551
|
+
# "name": "BTC",
|
552
|
+
# "network": "BEP20",
|
553
|
+
# "isDefault": False,
|
554
|
+
# "minConfirm": 15,
|
555
|
+
# "withdrawEnable": True,
|
556
|
+
# "depositEnable": True,
|
557
|
+
# "withdrawFee": "0.0000066",
|
558
|
+
# "withdrawMax": "1.17522",
|
559
|
+
# "withdrawMin": "0.0000066",
|
560
|
+
# "depositMin": "0.0002"
|
561
|
+
# }
|
562
|
+
# ]
|
563
|
+
# }
|
564
|
+
# ]
|
562
565
|
# }
|
563
566
|
#
|
564
567
|
data = self.safe_list(response, 'data', [])
|
@@ -572,6 +575,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
572
575
|
networks: dict = {}
|
573
576
|
fee = None
|
574
577
|
active = None
|
578
|
+
depositEnabled = None
|
575
579
|
withdrawEnabled = None
|
576
580
|
defaultLimits: dict = {}
|
577
581
|
for j in range(0, len(networkList)):
|
@@ -579,13 +583,17 @@ class bingx(Exchange, ImplicitAPI):
|
|
579
583
|
network = self.safe_string(rawNetwork, 'network')
|
580
584
|
networkCode = self.network_id_to_code(network)
|
581
585
|
isDefault = self.safe_bool(rawNetwork, 'isDefault')
|
586
|
+
depositEnabled = self.safe_bool(rawNetwork, 'depositEnable')
|
582
587
|
withdrawEnabled = self.safe_bool(rawNetwork, 'withdrawEnable')
|
583
588
|
limits: dict = {
|
584
|
-
'
|
589
|
+
'withdraw': {
|
590
|
+
'min': self.safe_number(rawNetwork, 'withdrawMin'),
|
591
|
+
'max': self.safe_number(rawNetwork, 'withdrawMax'),
|
592
|
+
},
|
585
593
|
}
|
586
594
|
if isDefault:
|
587
595
|
fee = self.safe_number(rawNetwork, 'withdrawFee')
|
588
|
-
active = withdrawEnabled
|
596
|
+
active = depositEnabled or withdrawEnabled
|
589
597
|
defaultLimits = limits
|
590
598
|
networks[networkCode] = {
|
591
599
|
'info': rawNetwork,
|
@@ -593,7 +601,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
593
601
|
'network': networkCode,
|
594
602
|
'fee': fee,
|
595
603
|
'active': active,
|
596
|
-
'deposit':
|
604
|
+
'deposit': depositEnabled,
|
597
605
|
'withdraw': withdrawEnabled,
|
598
606
|
'precision': None,
|
599
607
|
'limits': limits,
|
@@ -605,7 +613,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
605
613
|
'precision': None,
|
606
614
|
'name': name,
|
607
615
|
'active': active,
|
608
|
-
'deposit':
|
616
|
+
'deposit': depositEnabled,
|
609
617
|
'withdraw': withdrawEnabled,
|
610
618
|
'networks': networks,
|
611
619
|
'fee': fee,
|
ccxt/async_support/bybit.py
CHANGED
@@ -5878,6 +5878,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5878
5878
|
:param str [params.settleCoin]: Settle coin. Supports linear, inverse & option
|
5879
5879
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
5880
5880
|
"""
|
5881
|
+
await self.load_markets()
|
5881
5882
|
symbol = None
|
5882
5883
|
if (symbols is not None) and isinstance(symbols, list):
|
5883
5884
|
symbolsLength = len(symbols)
|
@@ -5889,7 +5890,6 @@ class bybit(Exchange, ImplicitAPI):
|
|
5889
5890
|
elif symbols is not None:
|
5890
5891
|
symbol = symbols
|
5891
5892
|
symbols = [self.symbol(symbol)]
|
5892
|
-
await self.load_markets()
|
5893
5893
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
5894
5894
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
5895
5895
|
request: dict = {}
|
ccxt/async_support/tradeogre.py
CHANGED
@@ -221,7 +221,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
221
221
|
'inverse': None,
|
222
222
|
'contractSize': None,
|
223
223
|
'taker': self.fees['trading']['taker'],
|
224
|
-
'maker': self.fees['trading']['
|
224
|
+
'maker': self.fees['trading']['maker'],
|
225
225
|
'expiry': None,
|
226
226
|
'expiryDatetime': None,
|
227
227
|
'strike': None,
|
ccxt/async_support/xt.py
CHANGED
@@ -4490,7 +4490,7 @@ class xt(Exchange, ImplicitAPI):
|
|
4490
4490
|
if isUndefinedBody:
|
4491
4491
|
if urlencoded:
|
4492
4492
|
url += '?' + urlencoded
|
4493
|
-
payloadString += '#' + method + '#' + payload + '#' +
|
4493
|
+
payloadString += '#' + method + '#' + payload + '#' + self.rawencode(self.keysort(query))
|
4494
4494
|
else:
|
4495
4495
|
payloadString += '#' + method + '#' + payload
|
4496
4496
|
else:
|
ccxt/base/exchange.py
CHANGED
ccxt/binance.py
CHANGED
@@ -9103,34 +9103,38 @@ class binance(Exchange, ImplicitAPI):
|
|
9103
9103
|
if marginMode == 'cross':
|
9104
9104
|
# calculate collateral
|
9105
9105
|
precision = self.safe_dict(market, 'precision', {})
|
9106
|
-
|
9107
|
-
|
9108
|
-
|
9109
|
-
|
9110
|
-
if
|
9111
|
-
|
9112
|
-
|
9113
|
-
|
9114
|
-
|
9115
|
-
|
9116
|
-
|
9117
|
-
|
9118
|
-
|
9119
|
-
|
9120
|
-
|
9121
|
-
|
9122
|
-
|
9123
|
-
|
9124
|
-
if side == 'short':
|
9125
|
-
onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
|
9106
|
+
basePrecisionValue = self.safe_string(precision, 'base')
|
9107
|
+
quotePrecisionValue = self.safe_string_2(precision, 'quote', 'price')
|
9108
|
+
precisionIsUndefined = (basePrecisionValue is None) and (quotePrecisionValue is None)
|
9109
|
+
if not precisionIsUndefined:
|
9110
|
+
if linear:
|
9111
|
+
# walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
|
9112
|
+
onePlusMaintenanceMarginPercentageString = None
|
9113
|
+
entryPriceSignString = entryPriceString
|
9114
|
+
if side == 'short':
|
9115
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_add('1', maintenanceMarginPercentageString)
|
9116
|
+
entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
|
9117
|
+
else:
|
9118
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_add('-1', maintenanceMarginPercentageString)
|
9119
|
+
inner = Precise.string_mul(liquidationPriceString, onePlusMaintenanceMarginPercentageString)
|
9120
|
+
leftSide = Precise.string_add(inner, entryPriceSignString)
|
9121
|
+
quotePrecision = self.precision_from_string(self.safe_string_2(precision, 'quote', 'price'))
|
9122
|
+
if quotePrecision is not None:
|
9123
|
+
collateralString = Precise.string_div(Precise.string_mul(leftSide, contractsAbs), '1', quotePrecision)
|
9126
9124
|
else:
|
9127
|
-
|
9128
|
-
|
9129
|
-
|
9130
|
-
|
9131
|
-
|
9132
|
-
|
9133
|
-
|
9125
|
+
# walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)
|
9126
|
+
onePlusMaintenanceMarginPercentageString = None
|
9127
|
+
entryPriceSignString = entryPriceString
|
9128
|
+
if side == 'short':
|
9129
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
|
9130
|
+
else:
|
9131
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_sub('-1', maintenanceMarginPercentageString)
|
9132
|
+
entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
|
9133
|
+
leftSide = Precise.string_mul(contractsAbs, contractSizeString)
|
9134
|
+
rightSide = Precise.string_sub(Precise.string_div('1', entryPriceSignString), Precise.string_div(onePlusMaintenanceMarginPercentageString, liquidationPriceString))
|
9135
|
+
basePrecision = self.precision_from_string(self.safe_string(precision, 'base'))
|
9136
|
+
if basePrecision is not None:
|
9137
|
+
collateralString = Precise.string_div(Precise.string_mul(leftSide, rightSide), '1', basePrecision)
|
9134
9138
|
else:
|
9135
9139
|
collateralString = self.safe_string(position, 'isolatedMargin')
|
9136
9140
|
collateralString = '0' if (collateralString is None) else collateralString
|
@@ -9695,9 +9699,10 @@ class binance(Exchange, ImplicitAPI):
|
|
9695
9699
|
#
|
9696
9700
|
result = []
|
9697
9701
|
for i in range(0, len(response)):
|
9698
|
-
|
9699
|
-
entryPrice = self.safe_string(
|
9702
|
+
rawPosition = response[i]
|
9703
|
+
entryPrice = self.safe_string(rawPosition, 'entryPrice')
|
9700
9704
|
if (entryPrice != '0') and (entryPrice != '0.0') and (entryPrice != '0.00000000'):
|
9705
|
+
parsed = self.parse_position_risk(response[i])
|
9701
9706
|
result.append(parsed)
|
9702
9707
|
symbols = self.market_symbols(symbols)
|
9703
9708
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
@@ -11200,6 +11205,8 @@ class binance(Exchange, ImplicitAPI):
|
|
11200
11205
|
request: dict = {}
|
11201
11206
|
if market['option']:
|
11202
11207
|
request['underlyingAsset'] = market['baseId']
|
11208
|
+
if market['expiry'] is None:
|
11209
|
+
raise NotSupported(self.id + ' fetchOpenInterest does not support ' + symbol)
|
11203
11210
|
request['expiration'] = self.yymmdd(market['expiry'])
|
11204
11211
|
else:
|
11205
11212
|
request['symbol'] = market['id']
|
@@ -11241,6 +11248,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11241
11248
|
# ]
|
11242
11249
|
#
|
11243
11250
|
if market['option']:
|
11251
|
+
symbol = market['symbol']
|
11244
11252
|
result = self.parse_open_interests(response, market)
|
11245
11253
|
for i in range(0, len(result)):
|
11246
11254
|
item = result[i]
|
ccxt/bingx.py
CHANGED
@@ -527,37 +527,40 @@ class bingx(Exchange, ImplicitAPI):
|
|
527
527
|
response = self.walletsV1PrivateGetCapitalConfigGetall(params)
|
528
528
|
#
|
529
529
|
# {
|
530
|
-
#
|
531
|
-
#
|
532
|
-
#
|
530
|
+
# "code": 0,
|
531
|
+
# "timestamp": 1702623271477,
|
532
|
+
# "data": [
|
533
|
+
# {
|
534
|
+
# "coin": "BTC",
|
535
|
+
# "name": "BTC",
|
536
|
+
# "networkList": [
|
533
537
|
# {
|
534
|
-
# "coin": "BTC",
|
535
538
|
# "name": "BTC",
|
536
|
-
# "
|
537
|
-
#
|
538
|
-
#
|
539
|
-
#
|
540
|
-
#
|
541
|
-
#
|
542
|
-
#
|
543
|
-
#
|
544
|
-
#
|
545
|
-
#
|
546
|
-
#
|
547
|
-
#
|
548
|
-
#
|
549
|
-
#
|
550
|
-
#
|
551
|
-
#
|
552
|
-
#
|
553
|
-
#
|
554
|
-
#
|
555
|
-
#
|
556
|
-
#
|
557
|
-
#
|
558
|
-
#
|
559
|
-
#
|
560
|
-
#
|
539
|
+
# "network": "BTC",
|
540
|
+
# "isDefault": True,
|
541
|
+
# "minConfirm": 2,
|
542
|
+
# "withdrawEnable": True,
|
543
|
+
# "depositEnable": True,
|
544
|
+
# "withdrawFee": "0.0006",
|
545
|
+
# "withdrawMax": "1.17522",
|
546
|
+
# "withdrawMin": "0.0005",
|
547
|
+
# "depositMin": "0.0002"
|
548
|
+
# },
|
549
|
+
# {
|
550
|
+
# "name": "BTC",
|
551
|
+
# "network": "BEP20",
|
552
|
+
# "isDefault": False,
|
553
|
+
# "minConfirm": 15,
|
554
|
+
# "withdrawEnable": True,
|
555
|
+
# "depositEnable": True,
|
556
|
+
# "withdrawFee": "0.0000066",
|
557
|
+
# "withdrawMax": "1.17522",
|
558
|
+
# "withdrawMin": "0.0000066",
|
559
|
+
# "depositMin": "0.0002"
|
560
|
+
# }
|
561
|
+
# ]
|
562
|
+
# }
|
563
|
+
# ]
|
561
564
|
# }
|
562
565
|
#
|
563
566
|
data = self.safe_list(response, 'data', [])
|
@@ -571,6 +574,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
571
574
|
networks: dict = {}
|
572
575
|
fee = None
|
573
576
|
active = None
|
577
|
+
depositEnabled = None
|
574
578
|
withdrawEnabled = None
|
575
579
|
defaultLimits: dict = {}
|
576
580
|
for j in range(0, len(networkList)):
|
@@ -578,13 +582,17 @@ class bingx(Exchange, ImplicitAPI):
|
|
578
582
|
network = self.safe_string(rawNetwork, 'network')
|
579
583
|
networkCode = self.network_id_to_code(network)
|
580
584
|
isDefault = self.safe_bool(rawNetwork, 'isDefault')
|
585
|
+
depositEnabled = self.safe_bool(rawNetwork, 'depositEnable')
|
581
586
|
withdrawEnabled = self.safe_bool(rawNetwork, 'withdrawEnable')
|
582
587
|
limits: dict = {
|
583
|
-
'
|
588
|
+
'withdraw': {
|
589
|
+
'min': self.safe_number(rawNetwork, 'withdrawMin'),
|
590
|
+
'max': self.safe_number(rawNetwork, 'withdrawMax'),
|
591
|
+
},
|
584
592
|
}
|
585
593
|
if isDefault:
|
586
594
|
fee = self.safe_number(rawNetwork, 'withdrawFee')
|
587
|
-
active = withdrawEnabled
|
595
|
+
active = depositEnabled or withdrawEnabled
|
588
596
|
defaultLimits = limits
|
589
597
|
networks[networkCode] = {
|
590
598
|
'info': rawNetwork,
|
@@ -592,7 +600,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
592
600
|
'network': networkCode,
|
593
601
|
'fee': fee,
|
594
602
|
'active': active,
|
595
|
-
'deposit':
|
603
|
+
'deposit': depositEnabled,
|
596
604
|
'withdraw': withdrawEnabled,
|
597
605
|
'precision': None,
|
598
606
|
'limits': limits,
|
@@ -604,7 +612,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
604
612
|
'precision': None,
|
605
613
|
'name': name,
|
606
614
|
'active': active,
|
607
|
-
'deposit':
|
615
|
+
'deposit': depositEnabled,
|
608
616
|
'withdraw': withdrawEnabled,
|
609
617
|
'networks': networks,
|
610
618
|
'fee': fee,
|
ccxt/bybit.py
CHANGED
@@ -5877,6 +5877,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5877
5877
|
:param str [params.settleCoin]: Settle coin. Supports linear, inverse & option
|
5878
5878
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
5879
5879
|
"""
|
5880
|
+
self.load_markets()
|
5880
5881
|
symbol = None
|
5881
5882
|
if (symbols is not None) and isinstance(symbols, list):
|
5882
5883
|
symbolsLength = len(symbols)
|
@@ -5888,7 +5889,6 @@ class bybit(Exchange, ImplicitAPI):
|
|
5888
5889
|
elif symbols is not None:
|
5889
5890
|
symbol = symbols
|
5890
5891
|
symbols = [self.symbol(symbol)]
|
5891
|
-
self.load_markets()
|
5892
5892
|
enableUnifiedMargin, enableUnifiedAccount = self.is_unified_enabled()
|
5893
5893
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
5894
5894
|
request: dict = {}
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/alpaca.py
CHANGED
@@ -258,7 +258,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
258
258
|
:param int [since]: the earliest time in ms to fetch orders for
|
259
259
|
:param int [limit]: the maximum number of trade structures to retrieve
|
260
260
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
261
|
-
:returns dict[]: a list of
|
261
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
262
262
|
"""
|
263
263
|
url = self.urls['api']['ws']['crypto']
|
264
264
|
await self.authenticate(url)
|
@@ -307,7 +307,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
307
307
|
:param int [limit]: the maximum number of trade structures to retrieve
|
308
308
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
309
309
|
:param boolean [params.unifiedMargin]: use unified margin account
|
310
|
-
:returns dict[]: a list of
|
310
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
311
311
|
"""
|
312
312
|
url = self.urls['api']['ws']['trading']
|
313
313
|
await self.authenticate(url)
|
@@ -334,7 +334,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
334
334
|
:param int [since]: the earliest time in ms to fetch orders for
|
335
335
|
:param int [limit]: the maximum number of order structures to retrieve
|
336
336
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
337
|
-
:returns dict[]: a list of
|
337
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
338
338
|
"""
|
339
339
|
url = self.urls['api']['ws']['trading']
|
340
340
|
await self.authenticate(url)
|
ccxt/pro/binance.py
CHANGED
@@ -679,10 +679,8 @@ class binance(ccxt.async_support.binance):
|
|
679
679
|
client.resolve(orderbook, messageHash)
|
680
680
|
|
681
681
|
async def fetch_order_book_snapshot(self, client, message, subscription):
|
682
|
-
name = self.safe_string(subscription, 'name')
|
683
682
|
symbol = self.safe_string(subscription, 'symbol')
|
684
|
-
|
685
|
-
messageHash = market['lowercaseId'] + '@' + name
|
683
|
+
messageHash = 'orderbook::' + symbol
|
686
684
|
try:
|
687
685
|
defaultLimit = self.safe_integer(self.options, 'watchOrderBookLimit', 1000)
|
688
686
|
type = self.safe_value(subscription, 'type')
|
@@ -3260,7 +3258,7 @@ class binance(ccxt.async_support.binance):
|
|
3260
3258
|
:param int [limit]: the maximum number of order structures to retrieve
|
3261
3259
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3262
3260
|
:param boolean [params.portfolioMargin]: set to True if you would like to watch trades in a portfolio margin account
|
3263
|
-
:returns dict[]: a list of
|
3261
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
3264
3262
|
"""
|
3265
3263
|
await self.load_markets()
|
3266
3264
|
type = None
|
ccxt/pro/bingx.py
CHANGED
@@ -409,7 +409,7 @@ class bingx(ccxt.async_support.bingx):
|
|
409
409
|
:param int [since]: the earliest time in ms to fetch orders for
|
410
410
|
:param int [limit]: the maximum number of order structures to retrieve
|
411
411
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
412
|
-
:returns dict[]: a list of
|
412
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
413
413
|
"""
|
414
414
|
await self.load_markets()
|
415
415
|
market = self.market(symbol)
|
@@ -824,7 +824,7 @@ class bingx(ccxt.async_support.bingx):
|
|
824
824
|
:param int [since]: the earliest time in ms to trades orders for
|
825
825
|
:param int [limit]: the maximum number of trades structures to retrieve
|
826
826
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
827
|
-
:returns dict[]: a list of
|
827
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
828
828
|
"""
|
829
829
|
await self.load_markets()
|
830
830
|
await self.authenticate()
|