ccxt 4.4.33__py2.py3-none-any.whl → 4.4.35__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 +3 -1
- ccxt/abstract/bingx.py +17 -0
- ccxt/abstract/bitbank.py +5 -0
- ccxt/abstract/bitfinex2.py +1 -0
- ccxt/abstract/bitpanda.py +0 -12
- ccxt/abstract/bitrue.py +3 -3
- ccxt/abstract/ellipx.py +25 -0
- ccxt/abstract/okx.py +1 -0
- ccxt/abstract/onetrading.py +0 -12
- ccxt/abstract/xt.py +5 -5
- ccxt/alpaca.py +2 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/alpaca.py +2 -0
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +19 -15
- ccxt/async_support/bingx.py +479 -146
- ccxt/async_support/bitbank.py +5 -0
- ccxt/async_support/bitbns.py +2 -0
- ccxt/async_support/bitfinex2.py +1 -0
- ccxt/async_support/bitget.py +174 -40
- ccxt/async_support/bitmex.py +3 -1
- ccxt/async_support/bitopro.py +3 -0
- ccxt/async_support/bitrue.py +3 -2
- ccxt/async_support/btcmarkets.py +5 -3
- ccxt/async_support/btcturk.py +19 -19
- ccxt/async_support/bybit.py +13 -10
- ccxt/async_support/cex.py +13 -4
- ccxt/async_support/coinbase.py +3 -2
- ccxt/async_support/coinex.py +1 -0
- ccxt/async_support/coinone.py +7 -7
- ccxt/async_support/coinsph.py +7 -7
- ccxt/async_support/coinspot.py +39 -39
- ccxt/async_support/cryptocom.py +36 -34
- ccxt/async_support/ellipx.py +1828 -0
- ccxt/async_support/gate.py +143 -39
- ccxt/async_support/hyperliquid.py +70 -11
- ccxt/async_support/idex.py +3 -4
- ccxt/async_support/kraken.py +58 -49
- ccxt/async_support/krakenfutures.py +3 -1
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/okcoin.py +2 -0
- ccxt/async_support/okx.py +15 -10
- ccxt/async_support/onetrading.py +67 -370
- ccxt/async_support/paradex.py +2 -0
- ccxt/async_support/phemex.py +16 -0
- ccxt/async_support/poloniex.py +3 -1
- ccxt/async_support/poloniexfutures.py +3 -1
- ccxt/async_support/vertex.py +2 -0
- ccxt/async_support/woo.py +69 -69
- ccxt/async_support/xt.py +10 -10
- ccxt/base/exchange.py +28 -7
- ccxt/binance.py +19 -15
- ccxt/bingx.py +479 -146
- ccxt/bitbank.py +5 -0
- ccxt/bitbns.py +2 -0
- ccxt/bitfinex2.py +1 -0
- ccxt/bitget.py +174 -40
- ccxt/bitmex.py +3 -1
- ccxt/bitopro.py +3 -0
- ccxt/bitrue.py +3 -2
- ccxt/btcmarkets.py +5 -3
- ccxt/btcturk.py +19 -19
- ccxt/bybit.py +13 -10
- ccxt/cex.py +13 -4
- ccxt/coinbase.py +3 -2
- ccxt/coinex.py +1 -0
- ccxt/coinone.py +7 -7
- ccxt/coinsph.py +7 -7
- ccxt/coinspot.py +39 -39
- ccxt/cryptocom.py +36 -34
- ccxt/ellipx.py +1828 -0
- ccxt/gate.py +143 -39
- ccxt/hyperliquid.py +70 -11
- ccxt/idex.py +3 -4
- ccxt/kraken.py +58 -49
- ccxt/krakenfutures.py +3 -1
- ccxt/kucoin.py +1 -1
- ccxt/okcoin.py +2 -0
- ccxt/okx.py +15 -10
- ccxt/onetrading.py +67 -370
- ccxt/paradex.py +2 -0
- ccxt/phemex.py +16 -0
- ccxt/poloniex.py +3 -1
- ccxt/poloniexfutures.py +3 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitrue.py +13 -11
- ccxt/pro/idex.py +15 -0
- ccxt/pro/probit.py +58 -68
- ccxt/pro/woo.py +15 -15
- ccxt/test/tests_async.py +29 -2
- ccxt/test/tests_helpers.py +0 -2
- ccxt/test/tests_sync.py +29 -2
- ccxt/vertex.py +2 -0
- ccxt/woo.py +69 -69
- ccxt/xt.py +10 -10
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/METADATA +9 -8
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/RECORD +100 -97
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/WHEEL +0 -0
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/top_level.txt +0 -0
ccxt/bybit.py
CHANGED
@@ -1076,6 +1076,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1076
1076
|
'default': {
|
1077
1077
|
'sandbox': True,
|
1078
1078
|
'createOrder': {
|
1079
|
+
'marginMode': False,
|
1079
1080
|
'triggerPrice': True,
|
1080
1081
|
'triggerPriceType': {
|
1081
1082
|
'last': True,
|
@@ -1093,7 +1094,6 @@ class bybit(Exchange, ImplicitAPI):
|
|
1093
1094
|
},
|
1094
1095
|
'limitPrice': True,
|
1095
1096
|
},
|
1096
|
-
'marginMode': False,
|
1097
1097
|
'timeInForce': {
|
1098
1098
|
'GTC': True,
|
1099
1099
|
'IOC': True,
|
@@ -1113,6 +1113,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1113
1113
|
'max': 10,
|
1114
1114
|
},
|
1115
1115
|
'fetchMyTrades': {
|
1116
|
+
'marginMode': False,
|
1116
1117
|
'limit': 100,
|
1117
1118
|
'daysBack': 365 * 2, # 2 years
|
1118
1119
|
'untilDays': 7, # days between start-end
|
@@ -1123,18 +1124,18 @@ class bybit(Exchange, ImplicitAPI):
|
|
1123
1124
|
'trailing': False,
|
1124
1125
|
},
|
1125
1126
|
'fetchOpenOrders': {
|
1126
|
-
'limit': 50,
|
1127
1127
|
'marginMode': False,
|
1128
|
+
'limit': 50,
|
1128
1129
|
'trigger': True,
|
1129
1130
|
'trailing': False,
|
1130
1131
|
},
|
1131
1132
|
'fetchOrders': None,
|
1132
1133
|
'fetchClosedOrders': {
|
1134
|
+
'marginMode': False,
|
1133
1135
|
'limit': 50,
|
1134
1136
|
'daysBackClosed': 365 * 2, # 2 years
|
1135
1137
|
'daysBackCanceled': 1,
|
1136
1138
|
'untilDays': 7,
|
1137
|
-
'marginMode': False,
|
1138
1139
|
'trigger': True,
|
1139
1140
|
'trailing': False,
|
1140
1141
|
},
|
@@ -1145,6 +1146,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1145
1146
|
'spot': {
|
1146
1147
|
'extends': 'default',
|
1147
1148
|
'createOrder': {
|
1149
|
+
'marginMode': False,
|
1148
1150
|
'triggerPrice': True,
|
1149
1151
|
'triggerPriceType': None,
|
1150
1152
|
'triggerDirection': False,
|
@@ -1154,7 +1156,6 @@ class bybit(Exchange, ImplicitAPI):
|
|
1154
1156
|
'triggerPriceType': None,
|
1155
1157
|
'limitPrice': True,
|
1156
1158
|
},
|
1157
|
-
'marginMode': False,
|
1158
1159
|
'timeInForce': {
|
1159
1160
|
'GTC': True,
|
1160
1161
|
'IOC': True,
|
@@ -1228,7 +1229,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1228
1229
|
|
1229
1230
|
def add_pagination_cursor_to_result(self, response):
|
1230
1231
|
result = self.safe_dict(response, 'result', {})
|
1231
|
-
data = self.
|
1232
|
+
data = self.safe_list_n(result, ['list', 'rows', 'data', 'dataList'], [])
|
1232
1233
|
paginationCursor = self.safe_string_2(result, 'nextPageCursor', 'cursor')
|
1233
1234
|
dataLength = len(data)
|
1234
1235
|
if (paginationCursor is not None) and (dataLength > 0):
|
@@ -1239,12 +1240,12 @@ class bybit(Exchange, ImplicitAPI):
|
|
1239
1240
|
|
1240
1241
|
def is_unified_enabled(self, params={}):
|
1241
1242
|
"""
|
1242
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1243
1243
|
|
1244
1244
|
https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
|
1245
1245
|
https://bybit-exchange.github.io/docs/v5/account/account-info
|
1246
1246
|
|
1247
1247
|
returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
|
1248
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1248
1249
|
:returns any: [enableUnifiedMargin, enableUnifiedAccount]
|
1249
1250
|
"""
|
1250
1251
|
# The API key of user id must own one of permissions will be allowed to call following API endpoints.
|
@@ -2277,6 +2278,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2277
2278
|
:param str[] symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
2278
2279
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2279
2280
|
:param str [params.subType]: *contract only* 'linear', 'inverse'
|
2281
|
+
:param str [params.baseCoin]: *option only* base coin, default is 'BTC'
|
2280
2282
|
:returns dict: an array of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
2281
2283
|
"""
|
2282
2284
|
self.load_markets()
|
@@ -2318,10 +2320,11 @@ class bybit(Exchange, ImplicitAPI):
|
|
2318
2320
|
# only if passedSubType is None, then use spot
|
2319
2321
|
if type == 'spot' and passedSubType is None:
|
2320
2322
|
request['category'] = 'spot'
|
2321
|
-
elif type == 'swap' or type == 'future' or subType is not None:
|
2322
|
-
request['category'] = subType
|
2323
2323
|
elif type == 'option':
|
2324
2324
|
request['category'] = 'option'
|
2325
|
+
request['baseCoin'] = self.safe_string(params, 'baseCoin', 'BTC')
|
2326
|
+
elif type == 'swap' or type == 'future' or subType is not None:
|
2327
|
+
request['category'] = subType
|
2325
2328
|
response = self.publicGetV5MarketTickers(self.extend(request, params))
|
2326
2329
|
#
|
2327
2330
|
# {
|
@@ -3108,7 +3111,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3108
3111
|
'datetime': self.iso8601(timestamp),
|
3109
3112
|
}
|
3110
3113
|
responseResult = self.safe_dict(response, 'result', {})
|
3111
|
-
currencyList = self.
|
3114
|
+
currencyList = self.safe_list_n(responseResult, ['loanAccountList', 'list', 'balance'])
|
3112
3115
|
if currencyList is None:
|
3113
3116
|
# usdc wallet
|
3114
3117
|
code = 'USDC'
|
@@ -3878,7 +3881,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3878
3881
|
side = self.safe_string(rawOrder, 'side')
|
3879
3882
|
amount = self.safe_value(rawOrder, 'amount')
|
3880
3883
|
price = self.safe_value(rawOrder, 'price')
|
3881
|
-
orderParams = self.
|
3884
|
+
orderParams = self.safe_dict(rawOrder, 'params', {})
|
3882
3885
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams, isUta)
|
3883
3886
|
ordersRequests.append(orderRequest)
|
3884
3887
|
symbols = self.market_symbols(orderSymbols, None, False, True, True)
|
ccxt/cex.py
CHANGED
@@ -26,7 +26,7 @@ class cex(Exchange, ImplicitAPI):
|
|
26
26
|
'id': 'cex',
|
27
27
|
'name': 'CEX.IO',
|
28
28
|
'countries': ['GB', 'EU', 'CY', 'RU'],
|
29
|
-
'rateLimit':
|
29
|
+
'rateLimit': 300, # 200 req/min
|
30
30
|
'pro': True,
|
31
31
|
'has': {
|
32
32
|
'CORS': None,
|
@@ -38,6 +38,8 @@ class cex(Exchange, ImplicitAPI):
|
|
38
38
|
'cancelAllOrders': True,
|
39
39
|
'cancelOrder': True,
|
40
40
|
'createOrder': True,
|
41
|
+
'createStopOrder': True,
|
42
|
+
'createTriggerOrder': True,
|
41
43
|
'fetchAccounts': True,
|
42
44
|
'fetchBalance': True,
|
43
45
|
'fetchClosedOrder': True,
|
@@ -918,7 +920,7 @@ class cex(Exchange, ImplicitAPI):
|
|
918
920
|
# },
|
919
921
|
# ...
|
920
922
|
#
|
921
|
-
data = self.
|
923
|
+
data = self.safe_list(response, 'data', [])
|
922
924
|
return self.parse_orders(data, market, since, limit)
|
923
925
|
|
924
926
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -987,10 +989,16 @@ class cex(Exchange, ImplicitAPI):
|
|
987
989
|
|
988
990
|
def parse_order_status(self, status: Str):
|
989
991
|
statuses: dict = {
|
992
|
+
'PENDING_NEW': 'open',
|
993
|
+
'NEW': 'open',
|
994
|
+
'PARTIALLY_FILLED': 'open',
|
990
995
|
'FILLED': 'closed',
|
996
|
+
'EXPIRED': 'expired',
|
997
|
+
'REJECTED': 'rejected',
|
998
|
+
'PENDING_CANCEL': 'canceling',
|
991
999
|
'CANCELLED': 'canceled',
|
992
1000
|
}
|
993
|
-
return self.safe_string(statuses, status,
|
1001
|
+
return self.safe_string(statuses, status, status)
|
994
1002
|
|
995
1003
|
def parse_order(self, order: dict, market: Market = None) -> Order:
|
996
1004
|
#
|
@@ -1039,7 +1047,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1039
1047
|
currencyId = self.safe_string(order, 'feeCurrency')
|
1040
1048
|
feeCode = self.safe_currency_code(currencyId)
|
1041
1049
|
fee['currency'] = feeCode
|
1042
|
-
fee['
|
1050
|
+
fee['cost'] = feeAmount
|
1043
1051
|
timestamp = self.safe_integer(order, 'serverCreateTimestamp')
|
1044
1052
|
requestedBase = self.safe_number(order, 'requestedAmountCcy1')
|
1045
1053
|
executedBase = self.safe_number(order, 'executedAmountCcy1')
|
@@ -1083,6 +1091,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1083
1091
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1084
1092
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1085
1093
|
:param str [params.accountId]: account-id to use(default is empty string)
|
1094
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1086
1095
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1087
1096
|
"""
|
1088
1097
|
accountId = None
|
ccxt/coinbase.py
CHANGED
@@ -2181,7 +2181,8 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2181
2181
|
|
2182
2182
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2183
2183
|
:param boolean [params.v3]: default False, set True to use v3 api endpoint
|
2184
|
-
:param
|
2184
|
+
:param str [params.type]: "spot"(default) or "swap" or "future"
|
2185
|
+
:param int [params.limit]: default 250, maximum number of accounts to return
|
2185
2186
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
2186
2187
|
"""
|
2187
2188
|
self.load_markets()
|
@@ -2198,7 +2199,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2198
2199
|
request['limit'] = 250
|
2199
2200
|
response = self.v3PrivateGetBrokerageAccounts(self.extend(request, params))
|
2200
2201
|
else:
|
2201
|
-
request['limit'] =
|
2202
|
+
request['limit'] = 250
|
2202
2203
|
response = self.v2PrivateGetAccounts(self.extend(request, params))
|
2203
2204
|
#
|
2204
2205
|
# v2PrivateGetAccounts
|
ccxt/coinex.py
CHANGED
ccxt/coinone.py
CHANGED
@@ -240,7 +240,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
240
240
|
# }
|
241
241
|
#
|
242
242
|
result: dict = {}
|
243
|
-
currencies = self.
|
243
|
+
currencies = self.safe_list(response, 'currencies', [])
|
244
244
|
for i in range(0, len(currencies)):
|
245
245
|
entry = currencies[i]
|
246
246
|
id = self.safe_string(entry, 'symbol')
|
@@ -320,7 +320,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
320
320
|
# ]
|
321
321
|
# }
|
322
322
|
#
|
323
|
-
tickers = self.
|
323
|
+
tickers = self.safe_list(response, 'tickers', [])
|
324
324
|
result = []
|
325
325
|
for i in range(0, len(tickers)):
|
326
326
|
entry = self.safe_value(tickers, i)
|
@@ -570,7 +570,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
570
570
|
# ]
|
571
571
|
# }
|
572
572
|
#
|
573
|
-
data = self.
|
573
|
+
data = self.safe_list(response, 'tickers', [])
|
574
574
|
ticker = self.safe_dict(data, 0, {})
|
575
575
|
return self.parse_ticker(ticker, market)
|
576
576
|
|
@@ -603,8 +603,8 @@ class coinone(Exchange, ImplicitAPI):
|
|
603
603
|
#
|
604
604
|
timestamp = self.safe_integer(ticker, 'timestamp')
|
605
605
|
last = self.safe_string(ticker, 'last')
|
606
|
-
asks = self.
|
607
|
-
bids = self.
|
606
|
+
asks = self.safe_list(ticker, 'best_asks', [])
|
607
|
+
bids = self.safe_list(ticker, 'best_bids', [])
|
608
608
|
baseId = self.safe_string(ticker, 'target_currency')
|
609
609
|
quoteId = self.safe_string(ticker, 'quote_currency')
|
610
610
|
base = self.safe_currency_code(baseId)
|
@@ -658,7 +658,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
658
658
|
#
|
659
659
|
timestamp = self.safe_integer(trade, 'timestamp')
|
660
660
|
market = self.safe_market(None, market)
|
661
|
-
isSellerMaker = self.
|
661
|
+
isSellerMaker = self.safe_bool(trade, 'is_seller_maker')
|
662
662
|
side = None
|
663
663
|
if isSellerMaker is not None:
|
664
664
|
side = 'sell' if isSellerMaker else 'buy'
|
@@ -1063,7 +1063,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
1063
1063
|
# }
|
1064
1064
|
# }
|
1065
1065
|
#
|
1066
|
-
walletAddress = self.
|
1066
|
+
walletAddress = self.safe_dict(response, 'walletAddress', {})
|
1067
1067
|
keys = list(walletAddress.keys())
|
1068
1068
|
result: dict = {}
|
1069
1069
|
for i in range(0, len(keys)):
|
ccxt/coinsph.py
CHANGED
@@ -555,7 +555,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
555
555
|
# ]
|
556
556
|
# }
|
557
557
|
#
|
558
|
-
markets = self.
|
558
|
+
markets = self.safe_list(response, 'symbols', [])
|
559
559
|
result = []
|
560
560
|
for i in range(0, len(markets)):
|
561
561
|
market = markets[i]
|
@@ -564,7 +564,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
564
564
|
quoteId = self.safe_string(market, 'quoteAsset')
|
565
565
|
base = self.safe_currency_code(baseId)
|
566
566
|
quote = self.safe_currency_code(quoteId)
|
567
|
-
limits = self.index_by(self.
|
567
|
+
limits = self.index_by(self.safe_list(market, 'filters', []), 'filterType')
|
568
568
|
amountLimits = self.safe_value(limits, 'LOT_SIZE', {})
|
569
569
|
priceLimits = self.safe_value(limits, 'PRICE_FILTER', {})
|
570
570
|
costLimits = self.safe_value(limits, 'NOTIONAL', {})
|
@@ -644,7 +644,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
644
644
|
ids.append(id)
|
645
645
|
request['symbols'] = ids
|
646
646
|
defaultMethod = 'publicGetOpenapiQuoteV1Ticker24hr'
|
647
|
-
options = self.
|
647
|
+
options = self.safe_dict(self.options, 'fetchTickers', {})
|
648
648
|
method = self.safe_string(options, 'method', defaultMethod)
|
649
649
|
tickers = None
|
650
650
|
if method == 'publicGetOpenapiQuoteV1TickerPrice':
|
@@ -673,7 +673,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
673
673
|
'symbol': market['id'],
|
674
674
|
}
|
675
675
|
defaultMethod = 'publicGetOpenapiQuoteV1Ticker24hr'
|
676
|
-
options = self.
|
676
|
+
options = self.safe_dict(self.options, 'fetchTicker', {})
|
677
677
|
method = self.safe_string(options, 'method', defaultMethod)
|
678
678
|
ticker = None
|
679
679
|
if method == 'publicGetOpenapiQuoteV1TickerPrice':
|
@@ -1002,7 +1002,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
1002
1002
|
'cost': feeCost,
|
1003
1003
|
'currency': self.safe_currency_code(feeCurrencyId),
|
1004
1004
|
}
|
1005
|
-
isBuyer = self.
|
1005
|
+
isBuyer = self.safe_bool_2(trade, 'isBuyer', 'isBuyerMaker', None)
|
1006
1006
|
side = None
|
1007
1007
|
if isBuyer is not None:
|
1008
1008
|
side = 'buy' if (isBuyer is True) else 'sell'
|
@@ -1064,7 +1064,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
1064
1064
|
return self.parse_balance(response)
|
1065
1065
|
|
1066
1066
|
def parse_balance(self, response) -> Balances:
|
1067
|
-
balances = self.
|
1067
|
+
balances = self.safe_list(response, 'balances', [])
|
1068
1068
|
result: dict = {
|
1069
1069
|
'info': response,
|
1070
1070
|
'timestamp': None,
|
@@ -1484,7 +1484,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
1484
1484
|
# }
|
1485
1485
|
# ]
|
1486
1486
|
#
|
1487
|
-
tradingFee = self.
|
1487
|
+
tradingFee = self.safe_dict(response, 0, {})
|
1488
1488
|
return self.parse_trading_fee(tradingFee, market)
|
1489
1489
|
|
1490
1490
|
def fetch_trading_fees(self, params={}) -> TradingFees:
|
ccxt/coinspot.py
CHANGED
@@ -270,7 +270,7 @@ class coinspot(Exchange, ImplicitAPI):
|
|
270
270
|
response = self.publicGetLatest(params)
|
271
271
|
id = market['id']
|
272
272
|
id = id.lower()
|
273
|
-
prices = self.
|
273
|
+
prices = self.safe_dict(response, 'prices', {})
|
274
274
|
#
|
275
275
|
# {
|
276
276
|
# "status":"ok",
|
@@ -301,22 +301,22 @@ class coinspot(Exchange, ImplicitAPI):
|
|
301
301
|
#
|
302
302
|
# {
|
303
303
|
# "status": "ok",
|
304
|
-
# "prices":
|
305
|
-
#
|
306
|
-
#
|
307
|
-
#
|
308
|
-
#
|
309
|
-
#
|
310
|
-
#
|
311
|
-
#
|
312
|
-
#
|
313
|
-
#
|
304
|
+
# "prices": {
|
305
|
+
# "btc": {
|
306
|
+
# "bid": "25050",
|
307
|
+
# "ask": "25370",
|
308
|
+
# "last": "25234"
|
309
|
+
# },
|
310
|
+
# "ltc": {
|
311
|
+
# "bid": "79.39192993",
|
312
|
+
# "ask": "87.98",
|
313
|
+
# "last": "87.95"
|
314
|
+
# }
|
314
315
|
# }
|
315
|
-
# }
|
316
316
|
# }
|
317
317
|
#
|
318
318
|
result: dict = {}
|
319
|
-
prices = self.
|
319
|
+
prices = self.safe_dict(response, 'prices', {})
|
320
320
|
ids = list(prices.keys())
|
321
321
|
for i in range(0, len(ids)):
|
322
322
|
id = ids[i]
|
@@ -377,35 +377,35 @@ class coinspot(Exchange, ImplicitAPI):
|
|
377
377
|
request['startdate'] = self.yyyymmdd(since)
|
378
378
|
response = self.privatePostRoMyTransactions(self.extend(request, params))
|
379
379
|
# {
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
#
|
384
|
-
#
|
385
|
-
#
|
386
|
-
#
|
387
|
-
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
#
|
392
|
-
#
|
393
|
-
#
|
394
|
-
#
|
395
|
-
#
|
396
|
-
#
|
397
|
-
#
|
398
|
-
#
|
399
|
-
#
|
400
|
-
#
|
401
|
-
#
|
402
|
-
#
|
403
|
-
#
|
380
|
+
# "status": "ok",
|
381
|
+
# "buyorders": [
|
382
|
+
# {
|
383
|
+
# "otc": False,
|
384
|
+
# "market": "ALGO/AUD",
|
385
|
+
# "amount": 386.95197925,
|
386
|
+
# "created": "2022-10-20T09:56:44.502Z",
|
387
|
+
# "audfeeExGst": 1.80018002,
|
388
|
+
# "audGst": 0.180018,
|
389
|
+
# "audtotal": 200
|
390
|
+
# },
|
391
|
+
# ],
|
392
|
+
# "sellorders": [
|
393
|
+
# {
|
394
|
+
# "otc": False,
|
395
|
+
# "market": "SOLO/ALGO",
|
396
|
+
# "amount": 154.52345614,
|
397
|
+
# "total": 115.78858204658796,
|
398
|
+
# "created": "2022-04-16T09:36:43.698Z",
|
399
|
+
# "audfeeExGst": 1.08995731,
|
400
|
+
# "audGst": 0.10899573,
|
401
|
+
# "audtotal": 118.7
|
402
|
+
# },
|
403
|
+
# ]
|
404
404
|
# }
|
405
|
-
buyTrades = self.
|
405
|
+
buyTrades = self.safe_list(response, 'buyorders', [])
|
406
406
|
for i in range(0, len(buyTrades)):
|
407
407
|
buyTrades[i]['side'] = 'buy'
|
408
|
-
sellTrades = self.
|
408
|
+
sellTrades = self.safe_list(response, 'sellorders', [])
|
409
409
|
for i in range(0, len(sellTrades)):
|
410
410
|
sellTrades[i]['side'] = 'sell'
|
411
411
|
trades = self.array_concat(buyTrades, sellTrades)
|
ccxt/cryptocom.py
CHANGED
@@ -58,6 +58,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
58
58
|
'createMarketSellOrderWithCost': False,
|
59
59
|
'createOrder': True,
|
60
60
|
'createOrders': True,
|
61
|
+
'createStopOrder': True,
|
62
|
+
'createTriggerOrder': True,
|
61
63
|
'fetchAccounts': True,
|
62
64
|
'fetchBalance': True,
|
63
65
|
'fetchBidsAsks': False,
|
@@ -520,8 +522,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
520
522
|
# }
|
521
523
|
# }
|
522
524
|
#
|
523
|
-
resultResponse = self.
|
524
|
-
data = self.
|
525
|
+
resultResponse = self.safe_dict(response, 'result', {})
|
526
|
+
data = self.safe_list(resultResponse, 'data', [])
|
525
527
|
result = []
|
526
528
|
for i in range(0, len(data)):
|
527
529
|
market = data[i]
|
@@ -538,8 +540,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
538
540
|
settle = None if spot else self.safe_currency_code(settleId)
|
539
541
|
optionType = self.safe_string_lower(market, 'put_call')
|
540
542
|
strike = self.safe_string(market, 'strike')
|
541
|
-
marginBuyEnabled = self.
|
542
|
-
marginSellEnabled = self.
|
543
|
+
marginBuyEnabled = self.safe_bool(market, 'margin_buy_enabled')
|
544
|
+
marginSellEnabled = self.safe_bool(market, 'margin_sell_enabled')
|
543
545
|
expiryString = self.omit_zero(self.safe_string(market, 'expiry_timestamp_ms'))
|
544
546
|
expiry = int(expiryString) if (expiryString is not None) else None
|
545
547
|
symbol = base + '/' + quote
|
@@ -576,7 +578,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
576
578
|
'swap': swap,
|
577
579
|
'future': future,
|
578
580
|
'option': option,
|
579
|
-
'active': self.
|
581
|
+
'active': self.safe_bool(market, 'tradable'),
|
580
582
|
'contract': contract,
|
581
583
|
'linear': True if (contract) else None,
|
582
584
|
'inverse': False if (contract) else None,
|
@@ -662,7 +664,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
662
664
|
# }
|
663
665
|
# }
|
664
666
|
#
|
665
|
-
result = self.
|
667
|
+
result = self.safe_dict(response, 'result', {})
|
666
668
|
data = self.safe_list(result, 'data', [])
|
667
669
|
return self.parse_tickers(data, symbols)
|
668
670
|
|
@@ -753,7 +755,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
753
755
|
# }
|
754
756
|
# }
|
755
757
|
#
|
756
|
-
data = self.
|
758
|
+
data = self.safe_dict(response, 'result', {})
|
757
759
|
orders = self.safe_list(data, 'data', [])
|
758
760
|
return self.parse_orders(orders, market, since, limit)
|
759
761
|
|
@@ -809,7 +811,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
809
811
|
# }
|
810
812
|
# }
|
811
813
|
#
|
812
|
-
result = self.
|
814
|
+
result = self.safe_dict(response, 'result', {})
|
813
815
|
trades = self.safe_list(result, 'data', [])
|
814
816
|
return self.parse_trades(trades, market, since, limit)
|
815
817
|
|
@@ -876,7 +878,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
876
878
|
# }
|
877
879
|
# }
|
878
880
|
#
|
879
|
-
result = self.
|
881
|
+
result = self.safe_dict(response, 'result', {})
|
880
882
|
data = self.safe_list(result, 'data', [])
|
881
883
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
882
884
|
|
@@ -917,15 +919,15 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
917
919
|
# }
|
918
920
|
# }
|
919
921
|
#
|
920
|
-
result = self.
|
921
|
-
data = self.
|
922
|
+
result = self.safe_dict(response, 'result', {})
|
923
|
+
data = self.safe_list(result, 'data', [])
|
922
924
|
orderBook = self.safe_value(data, 0)
|
923
925
|
timestamp = self.safe_integer(orderBook, 't')
|
924
926
|
return self.parse_order_book(orderBook, symbol, timestamp)
|
925
927
|
|
926
928
|
def parse_balance(self, response) -> Balances:
|
927
|
-
responseResult = self.
|
928
|
-
data = self.
|
929
|
+
responseResult = self.safe_dict(response, 'result', {})
|
930
|
+
data = self.safe_list(responseResult, 'data', [])
|
929
931
|
positionBalances = self.safe_value(data[0], 'position_balances', [])
|
930
932
|
result: dict = {'info': response}
|
931
933
|
for i in range(0, len(positionBalances)):
|
@@ -1145,7 +1147,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1145
1147
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1146
1148
|
:param str [params.timeInForce]: 'GTC', 'IOC', 'FOK' or 'PO'
|
1147
1149
|
:param str [params.ref_price_type]: 'MARK_PRICE', 'INDEX_PRICE', 'LAST_PRICE' which trigger price type to use, default is MARK_PRICE
|
1148
|
-
:param float [params.
|
1150
|
+
:param float [params.triggerPrice]: price to trigger a stop order
|
1149
1151
|
:param float [params.stopLossPrice]: price to trigger a stop-loss trigger order
|
1150
1152
|
:param float [params.takeProfitPrice]: price to trigger a take-profit trigger order
|
1151
1153
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -1188,7 +1190,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1188
1190
|
side = self.safe_string(rawOrder, 'side')
|
1189
1191
|
amount = self.safe_value(rawOrder, 'amount')
|
1190
1192
|
price = self.safe_value(rawOrder, 'price')
|
1191
|
-
orderParams = self.
|
1193
|
+
orderParams = self.safe_dict(rawOrder, 'params', {})
|
1192
1194
|
orderRequest = self.create_advanced_order_request(marketId, type, side, amount, price, orderParams)
|
1193
1195
|
ordersRequests.append(orderRequest)
|
1194
1196
|
contigency = self.safe_string(params, 'contingency_type', 'LIST')
|
@@ -1510,7 +1512,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1510
1512
|
# }
|
1511
1513
|
# }
|
1512
1514
|
#
|
1513
|
-
data = self.
|
1515
|
+
data = self.safe_dict(response, 'result', {})
|
1514
1516
|
orders = self.safe_list(data, 'data', [])
|
1515
1517
|
return self.parse_orders(orders, market, since, limit)
|
1516
1518
|
|
@@ -1576,7 +1578,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1576
1578
|
# }
|
1577
1579
|
# }
|
1578
1580
|
#
|
1579
|
-
result = self.
|
1581
|
+
result = self.safe_dict(response, 'result', {})
|
1580
1582
|
trades = self.safe_list(result, 'data', [])
|
1581
1583
|
return self.parse_trades(trades, market, since, limit)
|
1582
1584
|
|
@@ -1675,14 +1677,14 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1675
1677
|
# }
|
1676
1678
|
# }
|
1677
1679
|
#
|
1678
|
-
data = self.
|
1679
|
-
addresses = self.
|
1680
|
+
data = self.safe_dict(response, 'result', {})
|
1681
|
+
addresses = self.safe_list(data, 'deposit_address_list', [])
|
1680
1682
|
addressesLength = len(addresses)
|
1681
1683
|
if addressesLength == 0:
|
1682
1684
|
raise ExchangeError(self.id + ' fetchDepositAddressesByNetwork() generating address...')
|
1683
1685
|
result: dict = {}
|
1684
1686
|
for i in range(0, addressesLength):
|
1685
|
-
value = self.
|
1687
|
+
value = self.safe_dict(addresses, i)
|
1686
1688
|
addressString = self.safe_string(value, 'address')
|
1687
1689
|
currencyId = self.safe_string(value, 'currency')
|
1688
1690
|
responseCode = self.safe_currency_code(currencyId)
|
@@ -1769,7 +1771,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1769
1771
|
# }
|
1770
1772
|
# }
|
1771
1773
|
#
|
1772
|
-
data = self.
|
1774
|
+
data = self.safe_dict(response, 'result', {})
|
1773
1775
|
depositList = self.safe_list(data, 'deposit_list', [])
|
1774
1776
|
return self.parse_transactions(depositList, currency, since, limit)
|
1775
1777
|
|
@@ -1826,7 +1828,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1826
1828
|
# }
|
1827
1829
|
# }
|
1828
1830
|
#
|
1829
|
-
data = self.
|
1831
|
+
data = self.safe_dict(response, 'result', {})
|
1830
1832
|
withdrawalList = self.safe_list(data, 'withdrawal_list', [])
|
1831
1833
|
return self.parse_transactions(withdrawalList, currency, since, limit)
|
1832
1834
|
|
@@ -2225,7 +2227,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2225
2227
|
# ]
|
2226
2228
|
# }
|
2227
2229
|
#
|
2228
|
-
networkList = self.
|
2230
|
+
networkList = self.safe_list(fee, 'network_list', [])
|
2229
2231
|
networkListLength = len(networkList)
|
2230
2232
|
result: dict = {
|
2231
2233
|
'info': fee,
|
@@ -2326,8 +2328,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2326
2328
|
# }
|
2327
2329
|
# }
|
2328
2330
|
#
|
2329
|
-
result = self.
|
2330
|
-
ledger = self.
|
2331
|
+
result = self.safe_dict(response, 'result', {})
|
2332
|
+
ledger = self.safe_list(result, 'data', [])
|
2331
2333
|
return self.parse_ledger(ledger, currency, since, limit)
|
2332
2334
|
|
2333
2335
|
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
@@ -2451,9 +2453,9 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2451
2453
|
# }
|
2452
2454
|
# }
|
2453
2455
|
#
|
2454
|
-
result = self.
|
2455
|
-
masterAccount = self.
|
2456
|
-
accounts = self.
|
2456
|
+
result = self.safe_dict(response, 'result', {})
|
2457
|
+
masterAccount = self.safe_dict(result, 'master_account', {})
|
2458
|
+
accounts = self.safe_list(result, 'sub_account_list', [])
|
2457
2459
|
accounts.append(masterAccount)
|
2458
2460
|
return self.parse_accounts(accounts, params)
|
2459
2461
|
|
@@ -2533,8 +2535,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2533
2535
|
# }
|
2534
2536
|
# }
|
2535
2537
|
#
|
2536
|
-
result = self.
|
2537
|
-
data = self.
|
2538
|
+
result = self.safe_dict(response, 'result', {})
|
2539
|
+
data = self.safe_list(result, 'data', [])
|
2538
2540
|
settlements = self.parse_settlements(data, market)
|
2539
2541
|
sorted = self.sort_by(settlements, 'timestamp')
|
2540
2542
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
@@ -2627,8 +2629,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2627
2629
|
# }
|
2628
2630
|
# }
|
2629
2631
|
#
|
2630
|
-
result = self.
|
2631
|
-
data = self.
|
2632
|
+
result = self.safe_dict(response, 'result', {})
|
2633
|
+
data = self.safe_list(result, 'data', [])
|
2632
2634
|
marketId = self.safe_string(result, 'instrument_name')
|
2633
2635
|
rates = []
|
2634
2636
|
for i in range(0, len(data)):
|
@@ -2734,8 +2736,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2734
2736
|
# }
|
2735
2737
|
# }
|
2736
2738
|
#
|
2737
|
-
responseResult = self.
|
2738
|
-
positions = self.
|
2739
|
+
responseResult = self.safe_dict(response, 'result', {})
|
2740
|
+
positions = self.safe_list(responseResult, 'data', [])
|
2739
2741
|
result = []
|
2740
2742
|
for i in range(0, len(positions)):
|
2741
2743
|
entry = positions[i]
|