ccxt 4.3.55__py2.py3-none-any.whl → 4.3.57__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/abstract/bingx.py +16 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +19 -3
- ccxt/async_support/base/ws/client.py +25 -5
- ccxt/async_support/binance.py +7 -7
- ccxt/async_support/bingx.py +78 -7
- ccxt/async_support/bitflyer.py +7 -1
- ccxt/async_support/bitget.py +56 -47
- ccxt/async_support/bitopro.py +18 -3
- ccxt/async_support/btcmarkets.py +27 -26
- ccxt/async_support/bybit.py +8 -5
- ccxt/async_support/coinone.py +15 -19
- ccxt/async_support/delta.py +5 -1
- ccxt/async_support/gate.py +97 -2
- ccxt/async_support/htx.py +84 -25
- ccxt/async_support/huobijp.py +61 -2
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/lbank.py +27 -6
- ccxt/base/exchange.py +19 -3
- ccxt/binance.py +7 -7
- ccxt/bingx.py +78 -7
- ccxt/bitflyer.py +7 -1
- ccxt/bitget.py +56 -47
- ccxt/bitopro.py +18 -3
- ccxt/btcmarkets.py +27 -26
- ccxt/bybit.py +8 -5
- ccxt/coinone.py +15 -19
- ccxt/delta.py +5 -1
- ccxt/gate.py +97 -2
- ccxt/htx.py +84 -25
- ccxt/huobijp.py +61 -2
- ccxt/hyperliquid.py +1 -1
- ccxt/lbank.py +27 -6
- ccxt/pro/__init__.py +1 -1
- {ccxt-4.3.55.dist-info → ccxt-4.3.57.dist-info}/METADATA +4 -6
- {ccxt-4.3.55.dist-info → ccxt-4.3.57.dist-info}/RECORD +40 -40
- {ccxt-4.3.55.dist-info → ccxt-4.3.57.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.55.dist-info → ccxt-4.3.57.dist-info}/WHEEL +0 -0
- {ccxt-4.3.55.dist-info → ccxt-4.3.57.dist-info}/top_level.txt +0 -0
ccxt/bingx.py
CHANGED
@@ -115,6 +115,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
115
115
|
'subAccount': 'https://open-api.{hostname}/openApi',
|
116
116
|
'account': 'https://open-api.{hostname}/openApi',
|
117
117
|
'copyTrading': 'https://open-api.{hostname}/openApi',
|
118
|
+
'cswap': 'https://open-api.{hostname}/openApi',
|
118
119
|
},
|
119
120
|
'test': {
|
120
121
|
'swap': 'https://open-api-vst.{hostname}/openApi', # only swap is really "test" but since the API keys are the same, we want to keep all the functionalities when the user enables the sandboxmode
|
@@ -277,6 +278,36 @@ class bingx(Exchange, ImplicitAPI):
|
|
277
278
|
},
|
278
279
|
},
|
279
280
|
},
|
281
|
+
'cswap': {
|
282
|
+
'v1': {
|
283
|
+
'public': {
|
284
|
+
'get': {
|
285
|
+
'market/contracts': 1,
|
286
|
+
'market/premiumIndex': 1,
|
287
|
+
'market/openInterest': 1,
|
288
|
+
'market/klines': 1,
|
289
|
+
'market/depth': 1,
|
290
|
+
'market/ticker': 1,
|
291
|
+
},
|
292
|
+
},
|
293
|
+
'private': {
|
294
|
+
'get': {
|
295
|
+
'trade/leverage': 2,
|
296
|
+
'trade/forceOrders': 2,
|
297
|
+
'trade/allFillOrders': 2,
|
298
|
+
'user/commissionRate': 2,
|
299
|
+
'user/positions': 2,
|
300
|
+
'user/balance': 2,
|
301
|
+
},
|
302
|
+
'post': {
|
303
|
+
'trade/order': 2,
|
304
|
+
'trade/leverage': 2,
|
305
|
+
'trade/allOpenOrders': 2,
|
306
|
+
'trade/closeAllPositions': 2,
|
307
|
+
},
|
308
|
+
},
|
309
|
+
},
|
310
|
+
},
|
280
311
|
'contract': {
|
281
312
|
'v1': {
|
282
313
|
'private': {
|
@@ -643,6 +674,29 @@ class bingx(Exchange, ImplicitAPI):
|
|
643
674
|
markets = self.safe_list(response, 'data', [])
|
644
675
|
return self.parse_markets(markets)
|
645
676
|
|
677
|
+
def fetch_inverse_swap_markets(self, params):
|
678
|
+
response = self.cswapV1PublicGetMarketContracts(params)
|
679
|
+
#
|
680
|
+
# {
|
681
|
+
# "code": 0,
|
682
|
+
# "msg": "",
|
683
|
+
# "timestamp": 1720074487610,
|
684
|
+
# "data": [
|
685
|
+
# {
|
686
|
+
# "symbol": "BNB-USD",
|
687
|
+
# "pricePrecision": 2,
|
688
|
+
# "minTickSize": "10",
|
689
|
+
# "minTradeValue": "10",
|
690
|
+
# "minQty": "1.00000000",
|
691
|
+
# "status": 1,
|
692
|
+
# "timeOnline": 1713175200000
|
693
|
+
# },
|
694
|
+
# ]
|
695
|
+
# }
|
696
|
+
#
|
697
|
+
markets = self.safe_list(response, 'data', [])
|
698
|
+
return self.parse_markets(markets)
|
699
|
+
|
646
700
|
def parse_market(self, market: dict) -> Market:
|
647
701
|
id = self.safe_string(market, 'symbol')
|
648
702
|
symbolParts = id.split('-')
|
@@ -651,6 +705,14 @@ class bingx(Exchange, ImplicitAPI):
|
|
651
705
|
base = self.safe_currency_code(baseId)
|
652
706
|
quote = self.safe_currency_code(quoteId)
|
653
707
|
currency = self.safe_string(market, 'currency')
|
708
|
+
checkIsInverse = False
|
709
|
+
checkIsLinear = True
|
710
|
+
minTickSize = self.safe_number(market, 'minTickSize')
|
711
|
+
if minTickSize is not None:
|
712
|
+
# inverse swap market
|
713
|
+
currency = baseId
|
714
|
+
checkIsInverse = True
|
715
|
+
checkIsLinear = False
|
654
716
|
settle = self.safe_currency_code(currency)
|
655
717
|
pricePrecision = self.safe_number(market, 'tickSize')
|
656
718
|
if pricePrecision is None:
|
@@ -667,8 +729,11 @@ class bingx(Exchange, ImplicitAPI):
|
|
667
729
|
fees = self.safe_dict(self.fees, type, {})
|
668
730
|
contractSize = self.parse_number('1') if (swap) else None
|
669
731
|
isActive = self.safe_string(market, 'status') == '1'
|
670
|
-
isInverse = None if (spot) else
|
671
|
-
isLinear = None if (spot) else
|
732
|
+
isInverse = None if (spot) else checkIsInverse
|
733
|
+
isLinear = None if (spot) else checkIsLinear
|
734
|
+
timeOnline = self.safe_integer(market, 'timeOnline')
|
735
|
+
if timeOnline == 0:
|
736
|
+
timeOnline = None
|
672
737
|
return self.safe_market_structure({
|
673
738
|
'id': id,
|
674
739
|
'symbol': symbol,
|
@@ -710,15 +775,15 @@ class bingx(Exchange, ImplicitAPI):
|
|
710
775
|
'max': self.safe_number(market, 'maxQty'),
|
711
776
|
},
|
712
777
|
'price': {
|
713
|
-
'min':
|
778
|
+
'min': minTickSize,
|
714
779
|
'max': None,
|
715
780
|
},
|
716
781
|
'cost': {
|
717
|
-
'min': self.
|
782
|
+
'min': self.safe_number_n(market, ['minNotional', 'tradeMinUSDT', 'minTradeValue']),
|
718
783
|
'max': self.safe_number(market, 'maxNotional'),
|
719
784
|
},
|
720
785
|
},
|
721
|
-
'created':
|
786
|
+
'created': timeOnline,
|
722
787
|
'info': market,
|
723
788
|
})
|
724
789
|
|
@@ -727,16 +792,20 @@ class bingx(Exchange, ImplicitAPI):
|
|
727
792
|
retrieves data on all markets for bingx
|
728
793
|
:see: https://bingx-api.github.io/docs/#/spot/market-api.html#Query%20Symbols
|
729
794
|
:see: https://bingx-api.github.io/docs/#/swapV2/market-api.html#Contract%20Information
|
795
|
+
:see: https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Contract%20Information
|
730
796
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
731
797
|
:returns dict[]: an array of objects representing market data
|
732
798
|
"""
|
733
799
|
requests = [self.fetch_swap_markets(params)]
|
734
800
|
isSandbox = self.safe_bool(self.options, 'sandboxMode', False)
|
735
801
|
if not isSandbox:
|
802
|
+
requests.append(self.fetch_inverse_swap_markets(params))
|
736
803
|
requests.append(self.fetch_spot_markets(params)) # sandbox is swap only
|
737
804
|
promises = requests
|
738
|
-
|
739
|
-
|
805
|
+
linearSwapMarkets = self.safe_list(promises, 0, [])
|
806
|
+
inverseSwapMarkets = self.safe_list(promises, 1, [])
|
807
|
+
spotMarkets = self.safe_list(promises, 2, [])
|
808
|
+
swapMarkets = self.array_concat(linearSwapMarkets, inverseSwapMarkets)
|
740
809
|
return self.array_concat(spotMarkets, swapMarkets)
|
741
810
|
|
742
811
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
@@ -1465,6 +1534,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
1465
1534
|
percentage = percentage.replace('%', '')
|
1466
1535
|
change = self.safe_string(ticker, 'priceChange')
|
1467
1536
|
ts = self.safe_integer(ticker, 'closeTime')
|
1537
|
+
if ts == 0:
|
1538
|
+
ts = None
|
1468
1539
|
datetime = self.iso8601(ts)
|
1469
1540
|
bid = self.safe_string(ticker, 'bidPrice')
|
1470
1541
|
bidVolume = self.safe_string(ticker, 'bidQty')
|
ccxt/bitflyer.py
CHANGED
@@ -566,7 +566,13 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
566
566
|
'product_code': self.market_id(symbol),
|
567
567
|
'child_order_acceptance_id': id,
|
568
568
|
}
|
569
|
-
|
569
|
+
response = self.privatePostCancelchildorder(self.extend(request, params))
|
570
|
+
#
|
571
|
+
# 200 OK.
|
572
|
+
#
|
573
|
+
return self.safe_order({
|
574
|
+
'info': response,
|
575
|
+
})
|
570
576
|
|
571
577
|
def parse_order_status(self, status: Str):
|
572
578
|
statuses: dict = {
|
ccxt/bitget.py
CHANGED
@@ -4691,6 +4691,22 @@ class bitget(Exchange, ImplicitAPI):
|
|
4691
4691
|
response = self.privateMarginPostMarginV1CrossOrderBatchCancelOrder(self.extend(request, params))
|
4692
4692
|
else:
|
4693
4693
|
response = self.privateMarginPostMarginV1IsolatedOrderBatchCancelOrder(self.extend(request, params))
|
4694
|
+
#
|
4695
|
+
# {
|
4696
|
+
# "code": "00000",
|
4697
|
+
# "msg": "success",
|
4698
|
+
# "requestTime": 1700717155622,
|
4699
|
+
# "data": {
|
4700
|
+
# "resultList": [
|
4701
|
+
# {
|
4702
|
+
# "orderId": "1111453253721796609",
|
4703
|
+
# "clientOid": "2ae7fc8a4ff949b6b60d770ca3950e2d"
|
4704
|
+
# },
|
4705
|
+
# ],
|
4706
|
+
# "failure": []
|
4707
|
+
# }
|
4708
|
+
# }
|
4709
|
+
#
|
4694
4710
|
else:
|
4695
4711
|
if stop:
|
4696
4712
|
stopRequest: dict = {
|
@@ -4699,6 +4715,27 @@ class bitget(Exchange, ImplicitAPI):
|
|
4699
4715
|
response = self.privateSpotPostV2SpotTradeBatchCancelPlanOrder(self.extend(stopRequest, params))
|
4700
4716
|
else:
|
4701
4717
|
response = self.privateSpotPostV2SpotTradeCancelSymbolOrder(self.extend(request, params))
|
4718
|
+
#
|
4719
|
+
# {
|
4720
|
+
# "code": "00000",
|
4721
|
+
# "msg": "success",
|
4722
|
+
# "requestTime": 1700716953996,
|
4723
|
+
# "data": {
|
4724
|
+
# "symbol": "BTCUSDT"
|
4725
|
+
# }
|
4726
|
+
# }
|
4727
|
+
#
|
4728
|
+
timestamp = self.safe_integer(response, 'requestTime')
|
4729
|
+
responseData = self.safe_dict(response, 'data')
|
4730
|
+
marketId = self.safe_string(responseData, 'symbol')
|
4731
|
+
return [
|
4732
|
+
self.safe_order({
|
4733
|
+
'info': response,
|
4734
|
+
'symbol': self.safe_symbol(marketId, None, None, 'spot'),
|
4735
|
+
'timestamp': timestamp,
|
4736
|
+
'datetime': self.iso8601(timestamp),
|
4737
|
+
}),
|
4738
|
+
]
|
4702
4739
|
else:
|
4703
4740
|
productType = None
|
4704
4741
|
productType, params = self.handle_product_type_and_params(market, params)
|
@@ -4707,53 +4744,25 @@ class bitget(Exchange, ImplicitAPI):
|
|
4707
4744
|
response = self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
|
4708
4745
|
else:
|
4709
4746
|
response = self.privateMixPostV2MixOrderBatchCancelOrders(self.extend(request, params))
|
4710
|
-
|
4711
|
-
|
4712
|
-
|
4713
|
-
|
4714
|
-
|
4715
|
-
|
4716
|
-
|
4717
|
-
|
4718
|
-
|
4719
|
-
|
4720
|
-
|
4721
|
-
|
4722
|
-
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
|
4728
|
-
|
4729
|
-
# "successList": [
|
4730
|
-
# {
|
4731
|
-
# "orderId": "1024598257429823488",
|
4732
|
-
# "clientOid": "876493ce-c287-4bfc-9f4a-8b1905881313"
|
4733
|
-
# },
|
4734
|
-
# ],
|
4735
|
-
# "failureList": []
|
4736
|
-
# }
|
4737
|
-
# }
|
4738
|
-
#
|
4739
|
-
# spot margin
|
4740
|
-
#
|
4741
|
-
# {
|
4742
|
-
# "code": "00000",
|
4743
|
-
# "msg": "success",
|
4744
|
-
# "requestTime": 1700717155622,
|
4745
|
-
# "data": {
|
4746
|
-
# "resultList": [
|
4747
|
-
# {
|
4748
|
-
# "orderId": "1111453253721796609",
|
4749
|
-
# "clientOid": "2ae7fc8a4ff949b6b60d770ca3950e2d"
|
4750
|
-
# },
|
4751
|
-
# ],
|
4752
|
-
# "failure": []
|
4753
|
-
# }
|
4754
|
-
# }
|
4755
|
-
#
|
4756
|
-
return response
|
4747
|
+
# {
|
4748
|
+
# "code": "00000",
|
4749
|
+
# "msg": "success",
|
4750
|
+
# "requestTime": "1680008815965",
|
4751
|
+
# "data": {
|
4752
|
+
# "successList": [
|
4753
|
+
# {
|
4754
|
+
# "orderId": "1024598257429823488",
|
4755
|
+
# "clientOid": "876493ce-c287-4bfc-9f4a-8b1905881313"
|
4756
|
+
# },
|
4757
|
+
# ],
|
4758
|
+
# "failureList": []
|
4759
|
+
# }
|
4760
|
+
# }
|
4761
|
+
data = self.safe_dict(response, 'data')
|
4762
|
+
resultList = self.safe_list_2(data, 'resultList', 'successList')
|
4763
|
+
failureList = self.safe_list_2(data, 'failure', 'failureList')
|
4764
|
+
responseList = self.array_concat(resultList, failureList)
|
4765
|
+
return self.parse_orders(responseList)
|
4757
4766
|
|
4758
4767
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
4759
4768
|
"""
|
ccxt/bitopro.py
CHANGED
@@ -1038,6 +1038,20 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1038
1038
|
#
|
1039
1039
|
return self.parse_order(response, market)
|
1040
1040
|
|
1041
|
+
def parse_cancel_orders(self, data):
|
1042
|
+
dataKeys = list(data.keys())
|
1043
|
+
orders = []
|
1044
|
+
for i in range(0, len(dataKeys)):
|
1045
|
+
marketId = dataKeys[i]
|
1046
|
+
orderIds = data[marketId]
|
1047
|
+
for j in range(0, len(orderIds)):
|
1048
|
+
orders.append(self.safe_order({
|
1049
|
+
'info': orderIds[j],
|
1050
|
+
'id': orderIds[j],
|
1051
|
+
'symbol': self.safe_symbol(marketId),
|
1052
|
+
}))
|
1053
|
+
return orders
|
1054
|
+
|
1041
1055
|
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
1042
1056
|
"""
|
1043
1057
|
cancel multiple orders
|
@@ -1065,7 +1079,8 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1065
1079
|
# }
|
1066
1080
|
# }
|
1067
1081
|
#
|
1068
|
-
|
1082
|
+
data = self.safe_dict(response, 'data')
|
1083
|
+
return self.parse_cancel_orders(data)
|
1069
1084
|
|
1070
1085
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1071
1086
|
"""
|
@@ -1086,7 +1101,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1086
1101
|
response = self.privateDeleteOrdersPair(self.extend(request, params))
|
1087
1102
|
else:
|
1088
1103
|
response = self.privateDeleteOrdersAll(self.extend(request, params))
|
1089
|
-
|
1104
|
+
data = self.safe_value(response, 'data', {})
|
1090
1105
|
#
|
1091
1106
|
# {
|
1092
1107
|
# "data":{
|
@@ -1097,7 +1112,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1097
1112
|
# }
|
1098
1113
|
# }
|
1099
1114
|
#
|
1100
|
-
return
|
1115
|
+
return self.parse_cancel_orders(data)
|
1101
1116
|
|
1102
1117
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1103
1118
|
"""
|
ccxt/btcmarkets.py
CHANGED
@@ -14,7 +14,6 @@ from ccxt.base.errors import BadRequest
|
|
14
14
|
from ccxt.base.errors import InsufficientFunds
|
15
15
|
from ccxt.base.errors import InvalidOrder
|
16
16
|
from ccxt.base.errors import OrderNotFound
|
17
|
-
from ccxt.base.errors import DDoSProtection
|
18
17
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
19
18
|
from ccxt.base.precise import Precise
|
20
19
|
|
@@ -161,16 +160,18 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
161
160
|
},
|
162
161
|
'precisionMode': TICK_SIZE,
|
163
162
|
'exceptions': {
|
164
|
-
'
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
163
|
+
'exact': {
|
164
|
+
'InsufficientFund': InsufficientFunds,
|
165
|
+
'InvalidPrice': InvalidOrder,
|
166
|
+
'InvalidAmount': InvalidOrder,
|
167
|
+
'MissingArgument': BadRequest,
|
168
|
+
'OrderAlreadyCancelled': InvalidOrder,
|
169
|
+
'OrderNotFound': OrderNotFound,
|
170
|
+
'OrderStatusIsFinal': InvalidOrder,
|
171
|
+
'InvalidPaginationParameter': BadRequest,
|
172
|
+
},
|
173
|
+
'broad': {
|
174
|
+
},
|
174
175
|
},
|
175
176
|
'fees': {
|
176
177
|
'percentage': True,
|
@@ -370,7 +371,8 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
370
371
|
# "minOrderAmount":"0.00007",
|
371
372
|
# "maxOrderAmount":"1000000",
|
372
373
|
# "amountDecimals":"8",
|
373
|
-
# "priceDecimals":"2"
|
374
|
+
# "priceDecimals":"2",
|
375
|
+
# "status": "Online"
|
374
376
|
# }
|
375
377
|
# ]
|
376
378
|
#
|
@@ -387,6 +389,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
387
389
|
pricePrecision = self.parse_number(self.parse_precision(self.safe_string(market, 'priceDecimals')))
|
388
390
|
minAmount = self.safe_number(market, 'minOrderAmount')
|
389
391
|
maxAmount = self.safe_number(market, 'maxOrderAmount')
|
392
|
+
status = self.safe_string(market, 'status')
|
390
393
|
minPrice = None
|
391
394
|
if quote == 'AUD':
|
392
395
|
minPrice = pricePrecision
|
@@ -405,7 +408,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
405
408
|
'swap': False,
|
406
409
|
'future': False,
|
407
410
|
'option': False,
|
408
|
-
'active':
|
411
|
+
'active': (status == 'Online'),
|
409
412
|
'contract': False,
|
410
413
|
'linear': None,
|
411
414
|
'inverse': None,
|
@@ -1204,18 +1207,16 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1204
1207
|
def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
1205
1208
|
if response is None:
|
1206
1209
|
return None # fallback to default error handler
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
if code >= 400:
|
1215
|
-
errorCode = self.safe_string(response, 'code')
|
1216
|
-
message = self.safe_string(response, 'message')
|
1210
|
+
#
|
1211
|
+
# {"code":"UnAuthorized","message":"invalid access token"}
|
1212
|
+
# {"code":"MarketNotFound","message":"invalid marketId"}
|
1213
|
+
#
|
1214
|
+
errorCode = self.safe_string(response, 'code')
|
1215
|
+
message = self.safe_string(response, 'message')
|
1216
|
+
if errorCode is not None:
|
1217
1217
|
feedback = self.id + ' ' + body
|
1218
|
-
self.throw_exactly_matched_exception(self.exceptions,
|
1219
|
-
self.throw_exactly_matched_exception(self.exceptions,
|
1220
|
-
|
1218
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], message, feedback)
|
1219
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
|
1220
|
+
self.throw_broadly_matched_exception(self.exceptions['broad'], message, feedback)
|
1221
|
+
raise ExchangeError(feedback) # unknown message
|
1221
1222
|
return None
|
ccxt/bybit.py
CHANGED
@@ -2921,14 +2921,17 @@ class bybit(Exchange, ImplicitAPI):
|
|
2921
2921
|
enableUnifiedMargin, enableUnifiedAccount = self.is_unified_enabled()
|
2922
2922
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
2923
2923
|
type = None
|
2924
|
-
type, params = self.
|
2924
|
+
type, params = self.get_bybit_type('fetchBalance', None, params)
|
2925
2925
|
isSpot = (type == 'spot')
|
2926
|
-
|
2926
|
+
isLinear = (type == 'linear')
|
2927
|
+
isInverse = (type == 'inverse')
|
2927
2928
|
if isUnifiedAccount:
|
2928
|
-
if
|
2929
|
+
if isInverse:
|
2930
|
+
type = 'contract'
|
2931
|
+
else:
|
2929
2932
|
type = 'unified'
|
2930
2933
|
else:
|
2931
|
-
if
|
2934
|
+
if isLinear or isInverse:
|
2932
2935
|
type = 'contract'
|
2933
2936
|
accountTypes = self.safe_dict(self.options, 'accountsByType', {})
|
2934
2937
|
unifiedType = self.safe_string_upper(accountTypes, type, type)
|
@@ -3231,7 +3234,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3231
3234
|
else:
|
3232
3235
|
feeCurrencyCode = market['base'] if market['inverse'] else market['settle']
|
3233
3236
|
fee = {
|
3234
|
-
'cost': feeCostString,
|
3237
|
+
'cost': self.parse_number(feeCostString),
|
3235
3238
|
'currency': feeCurrencyCode,
|
3236
3239
|
}
|
3237
3240
|
clientOrderId = self.safe_string(order, 'orderLinkId')
|
ccxt/coinone.py
CHANGED
@@ -25,8 +25,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
25
25
|
'id': 'coinone',
|
26
26
|
'name': 'CoinOne',
|
27
27
|
'countries': ['KR'], # Korea
|
28
|
-
|
29
|
-
'rateLimit': 667,
|
28
|
+
'rateLimit': 50,
|
30
29
|
'version': 'v2',
|
31
30
|
'pro': False,
|
32
31
|
'has': {
|
@@ -198,10 +197,10 @@ class coinone(Exchange, ImplicitAPI):
|
|
198
197
|
},
|
199
198
|
'precisionMode': TICK_SIZE,
|
200
199
|
'exceptions': {
|
201
|
-
'
|
202
|
-
'
|
203
|
-
'108': BadSymbol,
|
204
|
-
'
|
200
|
+
'104': OrderNotFound,
|
201
|
+
'107': BadRequest,
|
202
|
+
'108': BadSymbol,
|
203
|
+
'405': OnMaintenance,
|
205
204
|
},
|
206
205
|
'commonCurrencies': {
|
207
206
|
'SOC': 'Soda Coin',
|
@@ -1111,17 +1110,14 @@ class coinone(Exchange, ImplicitAPI):
|
|
1111
1110
|
|
1112
1111
|
def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
1113
1112
|
if response is None:
|
1114
|
-
return None
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
raise ExchangeError(feedback)
|
1125
|
-
else:
|
1126
|
-
raise ExchangeError(self.id + ' ' + body)
|
1113
|
+
return None # fallback to default error handler
|
1114
|
+
#
|
1115
|
+
# {"result":"error","error_code":"107","error_msg":"Parameter value is wrong"}
|
1116
|
+
# {"result":"error","error_code":"108","error_msg":"Unknown CryptoCurrency"}
|
1117
|
+
#
|
1118
|
+
errorCode = self.safe_string(response, 'error_code')
|
1119
|
+
if errorCode != '0':
|
1120
|
+
feedback = self.id + ' ' + body
|
1121
|
+
self.throw_exactly_matched_exception(self.exceptions, errorCode, feedback)
|
1122
|
+
raise ExchangeError(feedback) # unknown message
|
1127
1123
|
return None
|
ccxt/delta.py
CHANGED
@@ -1946,7 +1946,11 @@ class delta(Exchange, ImplicitAPI):
|
|
1946
1946
|
# "success":true
|
1947
1947
|
# }
|
1948
1948
|
#
|
1949
|
-
return
|
1949
|
+
return [
|
1950
|
+
self.safe_order({
|
1951
|
+
'info': response,
|
1952
|
+
}),
|
1953
|
+
]
|
1950
1954
|
|
1951
1955
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1952
1956
|
"""
|