ccxt 4.3.66__py2.py3-none-any.whl → 4.3.67__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 +1 -1
- ccxt/abstract/bingx.py +7 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bingx.py +147 -19
- ccxt/async_support/bithumb.py +60 -17
- ccxt/async_support/whitebit.py +1 -1
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +10 -10
- ccxt/bingx.py +147 -19
- ccxt/bithumb.py +59 -17
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/currencycom.py +1 -1
- ccxt/pro/hollaex.py +1 -1
- ccxt/pro/hyperliquid.py +1 -1
- ccxt/pro/kucoin.py +1 -1
- ccxt/pro/kucoinfutures.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/pro/okcoin.py +1 -1
- ccxt/pro/okx.py +16 -4
- ccxt/pro/oxfun.py +1 -1
- ccxt/pro/p2b.py +1 -1
- ccxt/pro/poloniex.py +1 -1
- ccxt/pro/whitebit.py +1 -1
- ccxt/test/tests_async.py +58 -28
- ccxt/test/tests_helpers.py +8 -1
- ccxt/test/tests_sync.py +58 -28
- ccxt/whitebit.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.3.66.dist-info → ccxt-4.3.67.dist-info}/METADATA +4 -4
- {ccxt-4.3.66.dist-info → ccxt-4.3.67.dist-info}/RECORD +37 -37
- {ccxt-4.3.66.dist-info → ccxt-4.3.67.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.66.dist-info → ccxt-4.3.67.dist-info}/WHEEL +0 -0
- {ccxt-4.3.66.dist-info → ccxt-4.3.67.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/bingx.py
CHANGED
@@ -85,13 +85,20 @@ class ImplicitAPI:
|
|
85
85
|
cswap_v1_private_get_trade_leverage = cswapV1PrivateGetTradeLeverage = Entry('trade/leverage', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
86
86
|
cswap_v1_private_get_trade_forceorders = cswapV1PrivateGetTradeForceOrders = Entry('trade/forceOrders', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
87
87
|
cswap_v1_private_get_trade_allfillorders = cswapV1PrivateGetTradeAllFillOrders = Entry('trade/allFillOrders', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
88
|
+
cswap_v1_private_get_trade_openorders = cswapV1PrivateGetTradeOpenOrders = Entry('trade/openOrders', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
89
|
+
cswap_v1_private_get_trade_orderdetail = cswapV1PrivateGetTradeOrderDetail = Entry('trade/orderDetail', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
90
|
+
cswap_v1_private_get_trade_orderhistory = cswapV1PrivateGetTradeOrderHistory = Entry('trade/orderHistory', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
91
|
+
cswap_v1_private_get_trade_margintype = cswapV1PrivateGetTradeMarginType = Entry('trade/marginType', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
88
92
|
cswap_v1_private_get_user_commissionrate = cswapV1PrivateGetUserCommissionRate = Entry('user/commissionRate', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
89
93
|
cswap_v1_private_get_user_positions = cswapV1PrivateGetUserPositions = Entry('user/positions', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
90
94
|
cswap_v1_private_get_user_balance = cswapV1PrivateGetUserBalance = Entry('user/balance', ['cswap', 'v1', 'private'], 'GET', {'cost': 2})
|
91
95
|
cswap_v1_private_post_trade_order = cswapV1PrivatePostTradeOrder = Entry('trade/order', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
|
92
96
|
cswap_v1_private_post_trade_leverage = cswapV1PrivatePostTradeLeverage = Entry('trade/leverage', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
|
93
97
|
cswap_v1_private_post_trade_closeallpositions = cswapV1PrivatePostTradeCloseAllPositions = Entry('trade/closeAllPositions', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
|
98
|
+
cswap_v1_private_post_trade_margintype = cswapV1PrivatePostTradeMarginType = Entry('trade/marginType', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
|
99
|
+
cswap_v1_private_post_trade_positionmargin = cswapV1PrivatePostTradePositionMargin = Entry('trade/positionMargin', ['cswap', 'v1', 'private'], 'POST', {'cost': 2})
|
94
100
|
cswap_v1_private_delete_trade_allopenorders = cswapV1PrivateDeleteTradeAllOpenOrders = Entry('trade/allOpenOrders', ['cswap', 'v1', 'private'], 'DELETE', {'cost': 2})
|
101
|
+
cswap_v1_private_delete_trade_cancelorder = cswapV1PrivateDeleteTradeCancelOrder = Entry('trade/cancelOrder', ['cswap', 'v1', 'private'], 'DELETE', {'cost': 2})
|
95
102
|
contract_v1_private_get_allposition = contractV1PrivateGetAllPosition = Entry('allPosition', ['contract', 'v1', 'private'], 'GET', {'cost': 2})
|
96
103
|
contract_v1_private_get_allorders = contractV1PrivateGetAllOrders = Entry('allOrders', ['contract', 'v1', 'private'], 'GET', {'cost': 2})
|
97
104
|
contract_v1_private_get_balance = contractV1PrivateGetBalance = Entry('balance', ['contract', 'v1', 'private'], 'GET', {'cost': 2})
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/bingx.py
CHANGED
@@ -298,6 +298,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
298
298
|
'trade/leverage': 2,
|
299
299
|
'trade/forceOrders': 2,
|
300
300
|
'trade/allFillOrders': 2,
|
301
|
+
'trade/openOrders': 2,
|
302
|
+
'trade/orderDetail': 2,
|
303
|
+
'trade/orderHistory': 2,
|
304
|
+
'trade/marginType': 2,
|
301
305
|
'user/commissionRate': 2,
|
302
306
|
'user/positions': 2,
|
303
307
|
'user/balance': 2,
|
@@ -306,9 +310,12 @@ class bingx(Exchange, ImplicitAPI):
|
|
306
310
|
'trade/order': 2,
|
307
311
|
'trade/leverage': 2,
|
308
312
|
'trade/closeAllPositions': 2,
|
313
|
+
'trade/marginType': 2,
|
314
|
+
'trade/positionMargin': 2,
|
309
315
|
},
|
310
316
|
'delete': {
|
311
317
|
'trade/allOpenOrders': 2,
|
318
|
+
'trade/cancelOrder': 2,
|
312
319
|
},
|
313
320
|
},
|
314
321
|
},
|
@@ -2835,7 +2842,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2835
2842
|
# "clientOrderID": ""
|
2836
2843
|
# }
|
2837
2844
|
#
|
2838
|
-
# inverse swap cancelAllOrders
|
2845
|
+
# inverse swap cancelAllOrders, cancelOrder
|
2846
|
+
# inverse swap cancelAllOrders, cancelOrder, fetchOpenOrders
|
2839
2847
|
#
|
2840
2848
|
# {
|
2841
2849
|
# "symbol": "SOL-USD",
|
@@ -2979,13 +2987,14 @@ class bingx(Exchange, ImplicitAPI):
|
|
2979
2987
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2980
2988
|
"""
|
2981
2989
|
cancels an open order
|
2982
|
-
:see: https://bingx-api.github.io/docs/#/spot/trade-api.html#Cancel%
|
2983
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%
|
2990
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20Order
|
2991
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20Order
|
2992
|
+
:see: https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Cancel%20an%20Order
|
2984
2993
|
:param str id: order id
|
2985
2994
|
:param str symbol: unified symbol of the market the order was made in
|
2986
2995
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2987
2996
|
:param str [params.clientOrderId]: a unique id for the order
|
2988
|
-
:returns dict:
|
2997
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2989
2998
|
"""
|
2990
2999
|
if symbol is None:
|
2991
3000
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
@@ -3001,11 +3010,17 @@ class bingx(Exchange, ImplicitAPI):
|
|
3001
3010
|
else:
|
3002
3011
|
request['orderId'] = id
|
3003
3012
|
response = None
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3013
|
+
type = None
|
3014
|
+
subType = None
|
3015
|
+
type, params = self.handle_market_type_and_params('cancelOrder', market, params)
|
3016
|
+
subType, params = self.handle_sub_type_and_params('cancelOrder', market, params)
|
3017
|
+
if type == 'spot':
|
3018
|
+
response = await self.spotV1PrivatePostTradeCancel(self.extend(request, params))
|
3007
3019
|
else:
|
3008
|
-
|
3020
|
+
if subType == 'inverse':
|
3021
|
+
response = await self.cswapV1PrivateDeleteTradeCancelOrder(self.extend(request, params))
|
3022
|
+
else:
|
3023
|
+
response = await self.swapV2PrivateDeleteTradeOrder(self.extend(request, params))
|
3009
3024
|
#
|
3010
3025
|
# spot
|
3011
3026
|
#
|
@@ -3025,7 +3040,59 @@ class bingx(Exchange, ImplicitAPI):
|
|
3025
3040
|
# }
|
3026
3041
|
# }
|
3027
3042
|
#
|
3028
|
-
# swap
|
3043
|
+
# inverse swap
|
3044
|
+
#
|
3045
|
+
# {
|
3046
|
+
# "code": 0,
|
3047
|
+
# "msg": "",
|
3048
|
+
# "data": {
|
3049
|
+
# "order": {
|
3050
|
+
# "symbol": "SOL-USD",
|
3051
|
+
# "orderId": "1816002957423951872",
|
3052
|
+
# "side": "BUY",
|
3053
|
+
# "positionSide": "Long",
|
3054
|
+
# "type": "Pending",
|
3055
|
+
# "quantity": 0,
|
3056
|
+
# "origQty": "0",
|
3057
|
+
# "price": "150",
|
3058
|
+
# "executedQty": "0",
|
3059
|
+
# "avgPrice": "0",
|
3060
|
+
# "cumQuote": "0",
|
3061
|
+
# "stopPrice": "",
|
3062
|
+
# "profit": "0.0000",
|
3063
|
+
# "commission": "0.000000",
|
3064
|
+
# "status": "CANCELLED",
|
3065
|
+
# "time": 1721803819410,
|
3066
|
+
# "updateTime": 1721803819427,
|
3067
|
+
# "clientOrderId": "",
|
3068
|
+
# "leverage": "",
|
3069
|
+
# "takeProfit": {
|
3070
|
+
# "type": "",
|
3071
|
+
# "quantity": 0,
|
3072
|
+
# "stopPrice": 0,
|
3073
|
+
# "price": 0,
|
3074
|
+
# "workingType": "",
|
3075
|
+
# "stopGuaranteed": ""
|
3076
|
+
# },
|
3077
|
+
# "stopLoss": {
|
3078
|
+
# "type": "",
|
3079
|
+
# "quantity": 0,
|
3080
|
+
# "stopPrice": 0,
|
3081
|
+
# "price": 0,
|
3082
|
+
# "workingType": "",
|
3083
|
+
# "stopGuaranteed": ""
|
3084
|
+
# },
|
3085
|
+
# "advanceAttr": 0,
|
3086
|
+
# "positionID": 0,
|
3087
|
+
# "takeProfitEntrustPrice": 0,
|
3088
|
+
# "stopLossEntrustPrice": 0,
|
3089
|
+
# "orderType": "",
|
3090
|
+
# "workingType": ""
|
3091
|
+
# }
|
3092
|
+
# }
|
3093
|
+
# }
|
3094
|
+
#
|
3095
|
+
# linear swap
|
3029
3096
|
#
|
3030
3097
|
# {
|
3031
3098
|
# "code": 0,
|
@@ -3052,9 +3119,9 @@ class bingx(Exchange, ImplicitAPI):
|
|
3052
3119
|
# }
|
3053
3120
|
# }
|
3054
3121
|
#
|
3055
|
-
data = self.
|
3056
|
-
|
3057
|
-
return self.parse_order(
|
3122
|
+
data = self.safe_dict(response, 'data', {})
|
3123
|
+
order = self.safe_dict(data, 'order', data)
|
3124
|
+
return self.parse_order(order, market)
|
3058
3125
|
|
3059
3126
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
3060
3127
|
"""
|
@@ -3498,9 +3565,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
3498
3565
|
|
3499
3566
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
3500
3567
|
"""
|
3501
|
-
:see: https://bingx-api.github.io/docs/#/spot/trade-api.html#Query%20Open%20Orders
|
3502
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20all%20current%20pending%20orders
|
3503
3568
|
fetch all unfilled currently open orders
|
3569
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Current%20Open%20Orders
|
3570
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Current%20All%20Open%20Orders
|
3571
|
+
:see: https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20all%20current%20pending%20orders
|
3504
3572
|
:param str symbol: unified market symbol
|
3505
3573
|
:param int [since]: the earliest time in ms to fetch open orders for
|
3506
3574
|
:param int [limit]: the maximum number of open order structures to retrieve
|
@@ -3513,12 +3581,18 @@ class bingx(Exchange, ImplicitAPI):
|
|
3513
3581
|
if symbol is not None:
|
3514
3582
|
market = self.market(symbol)
|
3515
3583
|
request['symbol'] = market['id']
|
3584
|
+
type = None
|
3585
|
+
subType = None
|
3516
3586
|
response = None
|
3517
|
-
|
3518
|
-
|
3519
|
-
|
3587
|
+
type, params = self.handle_market_type_and_params('fetchOpenOrders', market, params)
|
3588
|
+
subType, params = self.handle_sub_type_and_params('fetchOpenOrders', market, params)
|
3589
|
+
if type == 'spot':
|
3590
|
+
response = await self.spotV1PrivateGetTradeOpenOrders(self.extend(request, params))
|
3520
3591
|
else:
|
3521
|
-
|
3592
|
+
if subType == 'inverse':
|
3593
|
+
response = await self.cswapV1PrivateGetTradeOpenOrders(self.extend(request, params))
|
3594
|
+
else:
|
3595
|
+
response = await self.swapV2PrivateGetTradeOpenOrders(self.extend(request, params))
|
3522
3596
|
#
|
3523
3597
|
# spot
|
3524
3598
|
#
|
@@ -3545,7 +3619,61 @@ class bingx(Exchange, ImplicitAPI):
|
|
3545
3619
|
# }
|
3546
3620
|
# }
|
3547
3621
|
#
|
3548
|
-
# swap
|
3622
|
+
# inverse swap
|
3623
|
+
#
|
3624
|
+
# {
|
3625
|
+
# "code": 0,
|
3626
|
+
# "msg": "",
|
3627
|
+
# "data": {
|
3628
|
+
# "orders": [
|
3629
|
+
# {
|
3630
|
+
# "symbol": "SOL-USD",
|
3631
|
+
# "orderId": "1816013900044320768",
|
3632
|
+
# "side": "BUY",
|
3633
|
+
# "positionSide": "Long",
|
3634
|
+
# "type": "LIMIT",
|
3635
|
+
# "quantity": 1,
|
3636
|
+
# "origQty": "",
|
3637
|
+
# "price": "150",
|
3638
|
+
# "executedQty": "0",
|
3639
|
+
# "avgPrice": "0.000",
|
3640
|
+
# "cumQuote": "",
|
3641
|
+
# "stopPrice": "",
|
3642
|
+
# "profit": "0.0000",
|
3643
|
+
# "commission": "0.0000",
|
3644
|
+
# "status": "Pending",
|
3645
|
+
# "time": 1721806428334,
|
3646
|
+
# "updateTime": 1721806428352,
|
3647
|
+
# "clientOrderId": "",
|
3648
|
+
# "leverage": "",
|
3649
|
+
# "takeProfit": {
|
3650
|
+
# "type": "TAKE_PROFIT",
|
3651
|
+
# "quantity": 0,
|
3652
|
+
# "stopPrice": 0,
|
3653
|
+
# "price": 0,
|
3654
|
+
# "workingType": "MARK_PRICE",
|
3655
|
+
# "stopGuaranteed": ""
|
3656
|
+
# },
|
3657
|
+
# "stopLoss": {
|
3658
|
+
# "type": "STOP",
|
3659
|
+
# "quantity": 0,
|
3660
|
+
# "stopPrice": 0,
|
3661
|
+
# "price": 0,
|
3662
|
+
# "workingType": "MARK_PRICE",
|
3663
|
+
# "stopGuaranteed": ""
|
3664
|
+
# },
|
3665
|
+
# "advanceAttr": 0,
|
3666
|
+
# "positionID": 0,
|
3667
|
+
# "takeProfitEntrustPrice": 0,
|
3668
|
+
# "stopLossEntrustPrice": 0,
|
3669
|
+
# "orderType": "",
|
3670
|
+
# "workingType": "MARK_PRICE"
|
3671
|
+
# }
|
3672
|
+
# ]
|
3673
|
+
# }
|
3674
|
+
# }
|
3675
|
+
#
|
3676
|
+
# linear swap
|
3549
3677
|
#
|
3550
3678
|
# {
|
3551
3679
|
# "code": 0,
|
ccxt/async_support/bithumb.py
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bithumb import ImplicitAPI
|
8
|
+
import asyncio
|
8
9
|
import hashlib
|
9
10
|
from ccxt.base.types import Balances, Currency, Int, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
11
|
from typing import List
|
@@ -212,17 +213,56 @@ class bithumb(Exchange, ImplicitAPI):
|
|
212
213
|
:returns dict[]: an array of objects representing market data
|
213
214
|
"""
|
214
215
|
result = []
|
215
|
-
quoteCurrencies = self.
|
216
|
+
quoteCurrencies = self.safe_dict(self.options, 'quoteCurrencies', {})
|
216
217
|
quotes = list(quoteCurrencies.keys())
|
218
|
+
promises = []
|
219
|
+
for i in range(0, len(quotes)):
|
220
|
+
request = {
|
221
|
+
'quoteId': quotes[i],
|
222
|
+
}
|
223
|
+
promises.append(self.publicGetTickerALLQuoteId(self.extend(request, params)))
|
224
|
+
#
|
225
|
+
# {
|
226
|
+
# "status": "0000",
|
227
|
+
# "data": {
|
228
|
+
# "ETH": {
|
229
|
+
# "opening_price": "0.05153399",
|
230
|
+
# "closing_price": "0.05145144",
|
231
|
+
# "min_price": "0.05145144",
|
232
|
+
# "max_price": "0.05160781",
|
233
|
+
# "units_traded": "6.541124172077830855",
|
234
|
+
# "acc_trade_value": "0.33705472498492329997697755",
|
235
|
+
# "prev_closing_price": "0.0515943",
|
236
|
+
# "units_traded_24H": "43.368879902677400513",
|
237
|
+
# "acc_trade_value_24H": "2.24165339555398079994373342",
|
238
|
+
# "fluctate_24H": "-0.00018203",
|
239
|
+
# "fluctate_rate_24H": "-0.35"
|
240
|
+
# },
|
241
|
+
# "XRP": {
|
242
|
+
# "opening_price": "0.00000918",
|
243
|
+
# "closing_price": "0.0000092",
|
244
|
+
# "min_price": "0.00000918",
|
245
|
+
# "max_price": "0.0000092",
|
246
|
+
# "units_traded": "6516.949363",
|
247
|
+
# "acc_trade_value": "0.0598792533602796",
|
248
|
+
# "prev_closing_price": "0.00000916",
|
249
|
+
# "units_traded_24H": "229161.50354738",
|
250
|
+
# "acc_trade_value_24H": "2.0446589371637117",
|
251
|
+
# "fluctate_24H": "0.00000049",
|
252
|
+
# "fluctate_rate_24H": "5.63"
|
253
|
+
# },
|
254
|
+
# ...
|
255
|
+
# "date": "1721675913145"
|
256
|
+
# }
|
257
|
+
# }
|
258
|
+
#
|
259
|
+
results = await asyncio.gather(*promises)
|
217
260
|
for i in range(0, len(quotes)):
|
218
261
|
quote = quotes[i]
|
219
262
|
quoteId = quote
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
}
|
224
|
-
response = await self.publicGetTickerALLQuoteId(self.extend(request, params))
|
225
|
-
data = self.safe_value(response, 'data')
|
263
|
+
response = results[i]
|
264
|
+
data = self.safe_dict(response, 'data')
|
265
|
+
extension = self.safe_dict(quoteCurrencies, quote, {})
|
226
266
|
currencyIds = list(data.keys())
|
227
267
|
for j in range(0, len(currencyIds)):
|
228
268
|
currencyId = currencyIds[j]
|
@@ -286,7 +326,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
286
326
|
|
287
327
|
def parse_balance(self, response) -> Balances:
|
288
328
|
result: dict = {'info': response}
|
289
|
-
balances = self.
|
329
|
+
balances = self.safe_dict(response, 'data')
|
290
330
|
codes = list(self.currencies.keys())
|
291
331
|
for i in range(0, len(codes)):
|
292
332
|
code = codes[i]
|
@@ -351,7 +391,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
351
391
|
# }
|
352
392
|
# }
|
353
393
|
#
|
354
|
-
data = self.
|
394
|
+
data = self.safe_dict(response, 'data', {})
|
355
395
|
timestamp = self.safe_integer(data, 'timestamp')
|
356
396
|
return self.parse_order_book(data, symbol, timestamp, 'bids', 'asks', 'price', 'quantity')
|
357
397
|
|
@@ -413,15 +453,18 @@ class bithumb(Exchange, ImplicitAPI):
|
|
413
453
|
"""
|
414
454
|
await self.load_markets()
|
415
455
|
result: dict = {}
|
416
|
-
quoteCurrencies = self.
|
456
|
+
quoteCurrencies = self.safe_dict(self.options, 'quoteCurrencies', {})
|
417
457
|
quotes = list(quoteCurrencies.keys())
|
458
|
+
promises = []
|
418
459
|
for i in range(0, len(quotes)):
|
419
|
-
quote = quotes[i]
|
420
|
-
quoteId = quote
|
421
460
|
request: dict = {
|
422
|
-
'quoteId':
|
461
|
+
'quoteId': quotes[i],
|
423
462
|
}
|
424
|
-
|
463
|
+
promises.append(self.publicGetTickerALLQuoteId(self.extend(request, params)))
|
464
|
+
responses = await asyncio.gather(*promises)
|
465
|
+
for i in range(0, len(quotes)):
|
466
|
+
quote = quotes[i]
|
467
|
+
response = responses[i]
|
425
468
|
#
|
426
469
|
# {
|
427
470
|
# "status":"0000",
|
@@ -443,7 +486,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
443
486
|
# }
|
444
487
|
# }
|
445
488
|
#
|
446
|
-
data = self.
|
489
|
+
data = self.safe_dict(response, 'data', {})
|
447
490
|
timestamp = self.safe_integer(data, 'date')
|
448
491
|
tickers = self.omit(data, 'date')
|
449
492
|
currencyIds = list(tickers.keys())
|
@@ -805,7 +848,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
805
848
|
# }
|
806
849
|
#
|
807
850
|
timestamp = self.safe_integer_product(order, 'order_date', 0.001)
|
808
|
-
sideProperty = self.
|
851
|
+
sideProperty = self.safe_string_2(order, 'type', 'side')
|
809
852
|
side = 'buy' if (sideProperty == 'bid') else 'sell'
|
810
853
|
status = self.parse_order_status(self.safe_string(order, 'order_status'))
|
811
854
|
price = self.safe_string_2(order, 'order_price', 'price')
|
@@ -830,7 +873,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
830
873
|
market = self.safe_market(None, market)
|
831
874
|
symbol = market['symbol']
|
832
875
|
id = self.safe_string(order, 'order_id')
|
833
|
-
rawTrades = self.
|
876
|
+
rawTrades = self.safe_list(order, 'contract', [])
|
834
877
|
return self.safe_order({
|
835
878
|
'info': order,
|
836
879
|
'id': id,
|
ccxt/async_support/whitebit.py
CHANGED
@@ -2404,7 +2404,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
2404
2404
|
records = self.safe_list(response, 'records')
|
2405
2405
|
return self.parse_transactions(records, currency, since, limit)
|
2406
2406
|
|
2407
|
-
def is_fiat(self, currency: str):
|
2407
|
+
def is_fiat(self, currency: str) -> bool:
|
2408
2408
|
fiatCurrencies = self.safe_value(self.options, 'fiatCurrencies', [])
|
2409
2409
|
return self.in_array(currency, fiatCurrencies)
|
2410
2410
|
|
ccxt/async_support/zonda.py
CHANGED
@@ -1467,7 +1467,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1467
1467
|
# {status: "Ok", errors: []}
|
1468
1468
|
return self.parse_order(response)
|
1469
1469
|
|
1470
|
-
def is_fiat(self, currency: str):
|
1470
|
+
def is_fiat(self, currency: str) -> bool:
|
1471
1471
|
fiatCurrencies: dict = {
|
1472
1472
|
'USD': True,
|
1473
1473
|
'EUR': True,
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.67'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2225,7 +2225,7 @@ class Exchange(object):
|
|
2225
2225
|
def parse_transfer(self, transfer: dict, currency: Currency = None):
|
2226
2226
|
raise NotSupported(self.id + ' parseTransfer() is not supported yet')
|
2227
2227
|
|
2228
|
-
def parse_account(self, account):
|
2228
|
+
def parse_account(self, account: dict):
|
2229
2229
|
raise NotSupported(self.id + ' parseAccount() is not supported yet')
|
2230
2230
|
|
2231
2231
|
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
@@ -2462,7 +2462,7 @@ class Exchange(object):
|
|
2462
2462
|
},
|
2463
2463
|
}, currency)
|
2464
2464
|
|
2465
|
-
def safe_market_structure(self, market=None):
|
2465
|
+
def safe_market_structure(self, market: dict = None):
|
2466
2466
|
cleanStructure = {
|
2467
2467
|
'id': None,
|
2468
2468
|
'lowercaseId': None,
|
@@ -2622,7 +2622,7 @@ class Exchange(object):
|
|
2622
2622
|
superWithRestDescribe = self.deep_extend(extendedRestDescribe, wsBaseDescribe)
|
2623
2623
|
return superWithRestDescribe
|
2624
2624
|
|
2625
|
-
def safe_balance(self, balance:
|
2625
|
+
def safe_balance(self, balance: dict):
|
2626
2626
|
balances = self.omit(balance, ['info', 'timestamp', 'datetime', 'free', 'used', 'total'])
|
2627
2627
|
codes = list(balances.keys())
|
2628
2628
|
balance['free'] = {}
|
@@ -2656,7 +2656,7 @@ class Exchange(object):
|
|
2656
2656
|
balance['debt'] = debtBalance
|
2657
2657
|
return balance
|
2658
2658
|
|
2659
|
-
def safe_order(self, order:
|
2659
|
+
def safe_order(self, order: dict, market: Market = None):
|
2660
2660
|
# parses numbers
|
2661
2661
|
# * it is important pass the trades rawTrades
|
2662
2662
|
amount = self.omit_zero(self.safe_string(order, 'amount'))
|
@@ -2961,7 +2961,7 @@ class Exchange(object):
|
|
2961
2961
|
'cost': self.parse_number(cost),
|
2962
2962
|
}
|
2963
2963
|
|
2964
|
-
def safe_liquidation(self, liquidation:
|
2964
|
+
def safe_liquidation(self, liquidation: dict, market: Market = None):
|
2965
2965
|
contracts = self.safe_string(liquidation, 'contracts')
|
2966
2966
|
contractSize = self.safe_string(market, 'contractSize')
|
2967
2967
|
price = self.safe_string(liquidation, 'price')
|
@@ -2978,7 +2978,7 @@ class Exchange(object):
|
|
2978
2978
|
liquidation['quoteValue'] = self.parse_number(quoteValue)
|
2979
2979
|
return liquidation
|
2980
2980
|
|
2981
|
-
def safe_trade(self, trade:
|
2981
|
+
def safe_trade(self, trade: dict, market: Market = None):
|
2982
2982
|
amount = self.safe_string(trade, 'amount')
|
2983
2983
|
price = self.safe_string(trade, 'price')
|
2984
2984
|
cost = self.safe_string(trade, 'cost')
|
@@ -3120,7 +3120,7 @@ class Exchange(object):
|
|
3120
3120
|
result = self.array_concat(result, reducedFeeValues)
|
3121
3121
|
return result
|
3122
3122
|
|
3123
|
-
def safe_ticker(self, ticker:
|
3123
|
+
def safe_ticker(self, ticker: dict, market: Market = None):
|
3124
3124
|
open = self.omit_zero(self.safe_string(ticker, 'open'))
|
3125
3125
|
close = self.omit_zero(self.safe_string(ticker, 'close'))
|
3126
3126
|
last = self.omit_zero(self.safe_string(ticker, 'last'))
|
@@ -3553,7 +3553,7 @@ class Exchange(object):
|
|
3553
3553
|
self.options['limitsLoaded'] = self.milliseconds()
|
3554
3554
|
return self.markets
|
3555
3555
|
|
3556
|
-
def safe_position(self, position):
|
3556
|
+
def safe_position(self, position: dict):
|
3557
3557
|
# simplified version of: /pull/12765/
|
3558
3558
|
unrealizedPnlString = self.safe_string(position, 'unrealisedPnl')
|
3559
3559
|
initialMarginString = self.safe_string(position, 'initialMargin')
|
@@ -5721,7 +5721,7 @@ class Exchange(object):
|
|
5721
5721
|
params = self.omit(params, ['until', 'till'])
|
5722
5722
|
return [request, params]
|
5723
5723
|
|
5724
|
-
def safe_open_interest(self, interest, market: Market = None):
|
5724
|
+
def safe_open_interest(self, interest: dict, market: Market = None):
|
5725
5725
|
symbol = self.safe_string(interest, 'symbol')
|
5726
5726
|
if symbol is None:
|
5727
5727
|
symbol = self.safe_string(market, 'symbol')
|