ccxt 4.4.77__py2.py3-none-any.whl → 4.4.78__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 -3
- ccxt/abstract/apex.py +31 -0
- ccxt/apex.py +1884 -0
- ccxt/ascendex.py +2 -2
- ccxt/async_support/__init__.py +3 -3
- ccxt/async_support/apex.py +1884 -0
- ccxt/async_support/ascendex.py +2 -2
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +3 -3
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/bitfinex.py +2 -2
- ccxt/async_support/bitflyer.py +2 -2
- ccxt/async_support/bitget.py +134 -64
- ccxt/async_support/bitmart.py +2 -2
- ccxt/async_support/bitmex.py +6 -6
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +29 -4
- ccxt/async_support/coincatch.py +66 -0
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/cryptocom.py +2 -2
- ccxt/async_support/defx.py +1 -1
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/deribit.py +2 -2
- ccxt/async_support/derive.py +2 -2
- ccxt/async_support/digifinex.py +2 -2
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hitbtc.py +5 -2
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/hyperliquid.py +13 -6
- ccxt/async_support/kraken.py +2 -2
- ccxt/async_support/krakenfutures.py +2 -2
- ccxt/async_support/kucoinfutures.py +2 -2
- ccxt/async_support/mexc.py +50 -52
- ccxt/async_support/okx.py +1 -1
- ccxt/async_support/oxfun.py +2 -2
- ccxt/async_support/paradex.py +2 -2
- ccxt/async_support/phemex.py +4 -3
- ccxt/async_support/poloniex.py +3 -3
- ccxt/async_support/probit.py +1 -0
- ccxt/async_support/tradeogre.py +2 -1
- ccxt/async_support/upbit.py +201 -43
- ccxt/async_support/vertex.py +2 -2
- ccxt/async_support/whitebit.py +1 -0
- ccxt/async_support/woo.py +5 -3
- ccxt/async_support/woofipro.py +2 -2
- ccxt/async_support/xt.py +9 -2
- ccxt/base/errors.py +6 -0
- ccxt/base/exchange.py +69 -2
- ccxt/binance.py +3 -3
- ccxt/bingx.py +1 -1
- ccxt/bitfinex.py +2 -2
- ccxt/bitflyer.py +2 -2
- ccxt/bitget.py +134 -64
- ccxt/bitmart.py +2 -2
- ccxt/bitmex.py +6 -6
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +29 -4
- ccxt/coincatch.py +66 -0
- ccxt/coinex.py +1 -1
- ccxt/cryptocom.py +2 -2
- ccxt/defx.py +1 -1
- ccxt/delta.py +1 -1
- ccxt/deribit.py +2 -2
- ccxt/derive.py +2 -2
- ccxt/digifinex.py +2 -2
- ccxt/gate.py +1 -1
- ccxt/hitbtc.py +5 -2
- ccxt/htx.py +2 -2
- ccxt/hyperliquid.py +13 -6
- ccxt/kraken.py +2 -2
- ccxt/krakenfutures.py +2 -2
- ccxt/kucoinfutures.py +2 -2
- ccxt/mexc.py +50 -52
- ccxt/okx.py +1 -1
- ccxt/oxfun.py +2 -2
- ccxt/paradex.py +2 -2
- ccxt/phemex.py +4 -3
- ccxt/poloniex.py +3 -3
- ccxt/pro/__init__.py +5 -1
- ccxt/pro/apex.py +984 -0
- ccxt/pro/coinbase.py +4 -6
- ccxt/pro/gate.py +22 -2
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/tradeogre.py +272 -0
- ccxt/probit.py +1 -0
- ccxt/test/tests_async.py +4 -0
- ccxt/test/tests_sync.py +4 -0
- ccxt/tradeogre.py +2 -1
- ccxt/upbit.py +201 -43
- ccxt/vertex.py +2 -2
- ccxt/whitebit.py +1 -0
- ccxt/woo.py +5 -3
- ccxt/woofipro.py +2 -2
- ccxt/xt.py +9 -2
- {ccxt-4.4.77.dist-info → ccxt-4.4.78.dist-info}/METADATA +4 -4
- {ccxt-4.4.77.dist-info → ccxt-4.4.78.dist-info}/RECORD +100 -98
- ccxt/abstract/ace.py +0 -15
- ccxt/ace.py +0 -1152
- ccxt/async_support/ace.py +0 -1152
- {ccxt-4.4.77.dist-info → ccxt-4.4.78.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.77.dist-info → ccxt-4.4.78.dist-info}/WHEEL +0 -0
- {ccxt-4.4.77.dist-info → ccxt-4.4.78.dist-info}/top_level.txt +0 -0
ccxt/async_support/upbit.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.upbit import ImplicitAPI
|
8
|
-
from ccxt.base.types import Any, Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, OrderBooks, Trade, TradingFeeInterface, Transaction
|
8
|
+
from ccxt.base.types import Any, Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, OrderBooks, Trade, TradingFeeInterface, TradingFees, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -45,6 +45,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
45
45
|
'createMarketOrderWithCost': False,
|
46
46
|
'createMarketSellOrderWithCost': False,
|
47
47
|
'createOrder': True,
|
48
|
+
'editOrder': True,
|
48
49
|
'fetchBalance': True,
|
49
50
|
'fetchCanceledOrders': True,
|
50
51
|
'fetchClosedOrders': True,
|
@@ -75,7 +76,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
75
76
|
'fetchTickers': True,
|
76
77
|
'fetchTrades': True,
|
77
78
|
'fetchTradingFee': True,
|
78
|
-
'fetchTradingFees':
|
79
|
+
'fetchTradingFees': True,
|
79
80
|
'fetchTransactions': False,
|
80
81
|
'fetchWithdrawal': True,
|
81
82
|
'fetchWithdrawals': True,
|
@@ -275,8 +276,6 @@ class upbit(Exchange, ImplicitAPI):
|
|
275
276
|
},
|
276
277
|
'options': {
|
277
278
|
'createMarketBuyOrderRequiresPrice': True,
|
278
|
-
'fetchTickersMaxLength': 4096, # 2048,
|
279
|
-
'fetchOrderBooksMaxLength': 4096, # 2048,
|
280
279
|
'tradingFeesByQuoteCurrency': {
|
281
280
|
'KRW': 0.0005,
|
282
281
|
},
|
@@ -624,10 +623,6 @@ class upbit(Exchange, ImplicitAPI):
|
|
624
623
|
ids = None
|
625
624
|
if symbols is None:
|
626
625
|
ids = ','.join(self.ids)
|
627
|
-
# max URL length is 2083 symbols, including http schema, hostname, tld, etc...
|
628
|
-
if len(ids) > self.options['fetchOrderBooksMaxLength']:
|
629
|
-
numIds = len(self.ids)
|
630
|
-
raise ExchangeError(self.id + ' fetchOrderBooks() has ' + str(numIds) + ' symbols(' + str(len(ids)) + ' characters) exceeding max URL length(' + str(self.options['fetchOrderBooksMaxLength']) + ' characters), you are required to specify a list of symbols in the first argument to fetchOrderBooks')
|
631
626
|
else:
|
632
627
|
ids = self.market_ids(symbols)
|
633
628
|
ids = ','.join(ids)
|
@@ -764,10 +759,6 @@ class upbit(Exchange, ImplicitAPI):
|
|
764
759
|
ids = None
|
765
760
|
if symbols is None:
|
766
761
|
ids = ','.join(self.ids)
|
767
|
-
# max URL length is 2083 symbols, including http schema, hostname, tld, etc...
|
768
|
-
if len(ids) > self.options['fetchTickersMaxLength']:
|
769
|
-
numIds = len(self.ids)
|
770
|
-
raise ExchangeError(self.id + ' fetchTickers() has ' + str(numIds) + ' symbols exceeding max URL length, you are required to specify a list of symbols in the first argument to fetchTickers')
|
771
762
|
else:
|
772
763
|
ids = self.market_ids(symbols)
|
773
764
|
ids = ','.join(ids)
|
@@ -1001,6 +992,26 @@ class upbit(Exchange, ImplicitAPI):
|
|
1001
992
|
'tierBased': False,
|
1002
993
|
}
|
1003
994
|
|
995
|
+
async def fetch_trading_fees(self, params={}) -> TradingFees:
|
996
|
+
"""
|
997
|
+
fetch the trading fees for markets
|
998
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
999
|
+
:returns dict: a `trading fee structure <https://docs.ccxt.com/#/?id=trading-fee-structure>`
|
1000
|
+
"""
|
1001
|
+
await self.load_markets()
|
1002
|
+
fetchMarketResponse = await self.fetch_markets(params)
|
1003
|
+
response: dict = {}
|
1004
|
+
for i in range(0, len(fetchMarketResponse)):
|
1005
|
+
element: dict = {}
|
1006
|
+
element['maker'] = self.safe_number(fetchMarketResponse[i], 'maker')
|
1007
|
+
element['taker'] = self.safe_number(fetchMarketResponse[i], 'taker')
|
1008
|
+
element['symbol'] = self.safe_string(fetchMarketResponse[i], 'symbol')
|
1009
|
+
element['percentage'] = True
|
1010
|
+
element['tierBased'] = False
|
1011
|
+
element['info'] = fetchMarketResponse[i]
|
1012
|
+
response[self.safe_string(fetchMarketResponse[i], 'symbol')] = element
|
1013
|
+
return response
|
1014
|
+
|
1004
1015
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
1005
1016
|
#
|
1006
1017
|
# {
|
@@ -1092,6 +1103,25 @@ class upbit(Exchange, ImplicitAPI):
|
|
1092
1103
|
#
|
1093
1104
|
return self.parse_ohlcvs(response, market, timeframe, since, limit)
|
1094
1105
|
|
1106
|
+
def calc_order_price(self, symbol: str, amount: float, price: Num = None, params={}) -> str:
|
1107
|
+
quoteAmount = None
|
1108
|
+
createMarketBuyOrderRequiresPrice = self.safe_value(self.options, 'createMarketBuyOrderRequiresPrice')
|
1109
|
+
cost = self.safe_string(params, 'cost')
|
1110
|
+
if cost is not None:
|
1111
|
+
quoteAmount = self.cost_to_precision(symbol, cost)
|
1112
|
+
elif createMarketBuyOrderRequiresPrice:
|
1113
|
+
if price is None or amount is None:
|
1114
|
+
raise InvalidOrder(self.id + ' createOrder() requires the price and amount argument for market buy orders to calculate the total cost to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend(quote quantity) in the amount argument')
|
1115
|
+
amountString = self.number_to_string(amount)
|
1116
|
+
priceString = self.number_to_string(price)
|
1117
|
+
costRequest = Precise.string_mul(amountString, priceString)
|
1118
|
+
quoteAmount = self.cost_to_precision(symbol, costRequest)
|
1119
|
+
else:
|
1120
|
+
if amount is None:
|
1121
|
+
raise ArgumentsRequired(self.id + ' When createMarketBuyOrderRequiresPrice is False, "amount" is required and should be the total quote amount to spend.')
|
1122
|
+
quoteAmount = self.cost_to_precision(symbol, amount)
|
1123
|
+
return quoteAmount
|
1124
|
+
|
1095
1125
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1096
1126
|
"""
|
1097
1127
|
create a trade order
|
@@ -1100,13 +1130,14 @@ class upbit(Exchange, ImplicitAPI):
|
|
1100
1130
|
https://global-docs.upbit.com/reference/order
|
1101
1131
|
|
1102
1132
|
:param str symbol: unified symbol of the market to create an order in
|
1103
|
-
:param str type: 'market'
|
1133
|
+
:param str type: supports 'market' and 'limit'. if params.ordType is set to best, a best-type order will be created regardless of the value of type.
|
1104
1134
|
:param str side: 'buy' or 'sell'
|
1105
1135
|
:param float amount: how much you want to trade in units of the base currency
|
1106
1136
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1107
1137
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1108
|
-
:param float [params.cost]: for market buy orders, the quote quantity that can be used alternative for the amount
|
1109
|
-
:param str [params.
|
1138
|
+
:param float [params.cost]: for market buy and best buy orders, the quote quantity that can be used alternative for the amount
|
1139
|
+
:param str [params.ordType]: self field can be used to place a ‘best’ type order
|
1140
|
+
:param str [params.timeInForce]: 'IOC' or 'FOK'. only for limit or best type orders. self field is required when the order type is 'best'.
|
1110
1141
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1111
1142
|
"""
|
1112
1143
|
await self.load_markets()
|
@@ -1117,46 +1148,52 @@ class upbit(Exchange, ImplicitAPI):
|
|
1117
1148
|
elif side == 'sell':
|
1118
1149
|
orderSide = 'ask'
|
1119
1150
|
else:
|
1120
|
-
raise InvalidOrder(self.id + ' createOrder()
|
1151
|
+
raise InvalidOrder(self.id + ' createOrder() supports only buy or sell in the side argument.')
|
1121
1152
|
request: dict = {
|
1122
1153
|
'market': market['id'],
|
1123
1154
|
'side': orderSide,
|
1124
1155
|
}
|
1125
1156
|
if type == 'limit':
|
1157
|
+
if price is None or amount is None:
|
1158
|
+
raise ArgumentsRequired(self.id + ' the limit type order in createOrder() is required price and amount.')
|
1159
|
+
request['ord_type'] = 'limit'
|
1126
1160
|
request['price'] = self.price_to_precision(symbol, price)
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
params = self.omit(params, 'cost')
|
1134
|
-
if cost is not None:
|
1135
|
-
quoteAmount = self.cost_to_precision(symbol, cost)
|
1136
|
-
elif createMarketBuyOrderRequiresPrice:
|
1137
|
-
if price is None:
|
1138
|
-
raise InvalidOrder(self.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend(quote quantity) in the amount argument')
|
1139
|
-
else:
|
1140
|
-
amountString = self.number_to_string(amount)
|
1141
|
-
priceString = self.number_to_string(price)
|
1142
|
-
costRequest = Precise.string_mul(amountString, priceString)
|
1143
|
-
quoteAmount = self.cost_to_precision(symbol, costRequest)
|
1161
|
+
request['volume'] = self.amount_to_precision(symbol, amount)
|
1162
|
+
elif type == 'market':
|
1163
|
+
if side == 'buy':
|
1164
|
+
request['ord_type'] = 'price'
|
1165
|
+
orderPrice = self.calc_order_price(symbol, amount, price, params)
|
1166
|
+
request['price'] = orderPrice
|
1144
1167
|
else:
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1168
|
+
if amount is None:
|
1169
|
+
raise ArgumentsRequired(self.id + ' the market sell type order in createOrder() is required amount.')
|
1170
|
+
request['ord_type'] = 'market'
|
1171
|
+
request['volume'] = self.amount_to_precision(symbol, amount)
|
1148
1172
|
else:
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1173
|
+
raise InvalidOrder(self.id + ' createOrder() supports only limit or market types in the type argument.')
|
1174
|
+
customType = self.safe_string_2(params, 'ordType', 'ord_type')
|
1175
|
+
if customType == 'best':
|
1176
|
+
params = self.omit(params, ['ordType', 'ord_type'])
|
1177
|
+
request['ord_type'] = 'best'
|
1178
|
+
if side == 'buy':
|
1179
|
+
orderPrice = self.calc_order_price(symbol, amount, price, params)
|
1180
|
+
request['price'] = orderPrice
|
1181
|
+
else:
|
1182
|
+
if amount is None:
|
1183
|
+
raise ArgumentsRequired(self.id + ' the best sell type order in createOrder() is required amount.')
|
1184
|
+
request['volume'] = self.amount_to_precision(symbol, amount)
|
1185
|
+
clientOrderId = self.safe_string(params, 'clientOrderId')
|
1152
1186
|
if clientOrderId is not None:
|
1153
1187
|
request['identifier'] = clientOrderId
|
1154
|
-
if
|
1188
|
+
if request['ord_type'] != 'market' and request['ord_type'] != 'price':
|
1155
1189
|
timeInForce = self.safe_string_lower_2(params, 'timeInForce', 'time_in_force')
|
1156
|
-
params = self.omit(params, 'timeInForce')
|
1190
|
+
params = self.omit(params, ['timeInForce'])
|
1157
1191
|
if timeInForce is not None:
|
1158
1192
|
request['time_in_force'] = timeInForce
|
1159
|
-
|
1193
|
+
else:
|
1194
|
+
if request['ord_type'] == 'best':
|
1195
|
+
raise ArgumentsRequired(self.id + ' the best type order in createOrder() is required timeInForce.')
|
1196
|
+
params = self.omit(params, ['clientOrderId', 'cost'])
|
1160
1197
|
response = await self.privatePostOrders(self.extend(request, params))
|
1161
1198
|
#
|
1162
1199
|
# {
|
@@ -1217,6 +1254,106 @@ class upbit(Exchange, ImplicitAPI):
|
|
1217
1254
|
#
|
1218
1255
|
return self.parse_order(response)
|
1219
1256
|
|
1257
|
+
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}) -> Order:
|
1258
|
+
"""
|
1259
|
+
|
1260
|
+
https://docs.upbit.com/reference/%EC%B7%A8%EC%86%8C-%ED%9B%84-%EC%9E%AC%EC%A3%BC%EB%AC%B8
|
1261
|
+
|
1262
|
+
canceled existing order and create new order. It's only generated same side and symbol canceled order. it returns the data of the canceled order, except for `new_order_uuid` and `new_identifier`. to get the details of the new order, use `fetchOrder(new_order_uuid)`.
|
1263
|
+
:param str id: the uuid of the previous order you want to edit.
|
1264
|
+
:param str symbol: the symbol of the new order. it must be the same symbol of the previous order.
|
1265
|
+
:param str type: the type of the new order. only limit or market is accepted. if params.newOrdType is set to best, a best-type order will be created regardless of the value of type.
|
1266
|
+
:param str side: the side of the new order. it must be the same side of the previous order.
|
1267
|
+
:param number amount: the amount of the asset you want to buy or sell. It could be overridden by specifying the new_volume parameter in params.
|
1268
|
+
:param number price: the price of the asset you want to buy or sell. It could be overridden by specifying the new_price parameter in params.
|
1269
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint.
|
1270
|
+
:param str [params.clientOrderId]: to identify the previous order, either the id or self field is hasattr(self, required) method.
|
1271
|
+
:param float [params.cost]: for market buy and best buy orders, the quote quantity that can be used alternative for the amount.
|
1272
|
+
:param str [params.newTimeInForce]: 'IOC' or 'FOK'. only for limit or best type orders. self field is required when the order type is 'best'.
|
1273
|
+
:param str [params.newClientOrderId]: the order ID that the user can define.
|
1274
|
+
:param str [params.newOrdType]: self field only accepts limit, price, market, or best. You can refer to the Upbit developer documentation for details on how to use self field.
|
1275
|
+
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1276
|
+
"""
|
1277
|
+
await self.load_markets()
|
1278
|
+
request: dict = {}
|
1279
|
+
prevClientOrderId = self.safe_string(params, 'clientOrderId')
|
1280
|
+
params = self.omit(params, 'clientOrderId')
|
1281
|
+
if id is not None:
|
1282
|
+
request['prev_order_uuid'] = id
|
1283
|
+
elif prevClientOrderId is not None:
|
1284
|
+
request['prev_order_identifier'] = prevClientOrderId
|
1285
|
+
else:
|
1286
|
+
raise ArgumentsRequired(self.id + ' editOrder() is required id or clientOrderId.')
|
1287
|
+
if type == 'limit':
|
1288
|
+
if price is None or amount is None:
|
1289
|
+
raise ArgumentsRequired(self.id + ' editOrder() is required price and amount to create limit type order.')
|
1290
|
+
request['new_ord_type'] = 'limit'
|
1291
|
+
request['new_price'] = self.price_to_precision(symbol, price)
|
1292
|
+
request['new_volume'] = self.amount_to_precision(symbol, amount)
|
1293
|
+
elif type == 'market':
|
1294
|
+
if side == 'buy':
|
1295
|
+
request['new_ord_type'] = 'price'
|
1296
|
+
orderPrice = self.calc_order_price(symbol, amount, price, params)
|
1297
|
+
request['new_price'] = orderPrice
|
1298
|
+
else:
|
1299
|
+
if amount is None:
|
1300
|
+
raise ArgumentsRequired(self.id + ' editOrder() is required amount to create market sell type order.')
|
1301
|
+
request['new_ord_type'] = 'market'
|
1302
|
+
request['new_volume'] = self.amount_to_precision(symbol, amount)
|
1303
|
+
else:
|
1304
|
+
raise InvalidOrder(self.id + ' editOrder() supports only limit or market types in the type argument.')
|
1305
|
+
customType = self.safe_string_2(params, 'newOrdType', 'new_ord_type')
|
1306
|
+
if customType == 'best':
|
1307
|
+
params = self.omit(params, ['newOrdType', 'new_ord_type'])
|
1308
|
+
request['new_ord_type'] = 'best'
|
1309
|
+
if side == 'buy':
|
1310
|
+
orderPrice = self.calc_order_price(symbol, amount, price, params)
|
1311
|
+
request['new_price'] = orderPrice
|
1312
|
+
else:
|
1313
|
+
if amount is None:
|
1314
|
+
raise ArgumentsRequired(self.id + ' editOrder() is required amount to create best sell order.')
|
1315
|
+
request['new_volume'] = self.amount_to_precision(symbol, amount)
|
1316
|
+
clientOrderId = self.safe_string(params, 'newClientOrderId')
|
1317
|
+
if clientOrderId is not None:
|
1318
|
+
request['new_identifier'] = clientOrderId
|
1319
|
+
if request['new_ord_type'] != 'market' and request['new_ord_type'] != 'price':
|
1320
|
+
timeInForce = self.safe_string_lower_2(params, 'newTimeInForce', 'new_time_in_force')
|
1321
|
+
params = self.omit(params, ['newTimeInForce', 'new_time_in_force'])
|
1322
|
+
if timeInForce is not None:
|
1323
|
+
request['new_time_in_force'] = timeInForce
|
1324
|
+
else:
|
1325
|
+
if request['new_ord_type'] == 'best':
|
1326
|
+
raise ArgumentsRequired(self.id + ' the best type order is required timeInForce.')
|
1327
|
+
params = self.omit(params, ['newClientOrderId', 'cost'])
|
1328
|
+
# print('check the each request params: ', request)
|
1329
|
+
response = await self.privatePostOrdersCancelAndNew(self.extend(request, params))
|
1330
|
+
# {
|
1331
|
+
# uuid: '63b38774-27db-4439-ac20-1be16a24d18e', #previous order data
|
1332
|
+
# side: 'bid', #previous order data
|
1333
|
+
# ord_type: 'limit', #previous order data
|
1334
|
+
# price: '100000000', #previous order data
|
1335
|
+
# state: 'wait', #previous order data
|
1336
|
+
# market: 'KRW-BTC', #previous order data
|
1337
|
+
# created_at: '2025-04-01T15:30:47+09:00', #previous order data
|
1338
|
+
# volume: '0.00008', #previous order data
|
1339
|
+
# remaining_volume: '0.00008', #previous order data
|
1340
|
+
# reserved_fee: '4', #previous order data
|
1341
|
+
# remaining_fee: '4', #previous order data
|
1342
|
+
# paid_fee: '0', #previous order data
|
1343
|
+
# locked: '8004', #previous order data
|
1344
|
+
# executed_volume: '0', #previous order data
|
1345
|
+
# trades_count: '0', #previous order data
|
1346
|
+
# identifier: '21', #previous order data
|
1347
|
+
# new_order_uuid: 'cb1cce56-6237-4a78-bc11-4cfffc1bb4c2', # new order data
|
1348
|
+
# new_order_identifier: '22' # new order data
|
1349
|
+
# }
|
1350
|
+
result: dict = {}
|
1351
|
+
result['uuid'] = self.safe_string(response, 'new_order_uuid')
|
1352
|
+
result['identifier'] = self.safe_string(response, 'new_order_identifier')
|
1353
|
+
result['side'] = self.safe_string(response, 'side')
|
1354
|
+
result['market'] = self.safe_string(response, 'market')
|
1355
|
+
return self.parse_order(result)
|
1356
|
+
|
1220
1357
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1221
1358
|
"""
|
1222
1359
|
|
@@ -1530,12 +1667,33 @@ class upbit(Exchange, ImplicitAPI):
|
|
1530
1667
|
# "time_in_force": "ioc"
|
1531
1668
|
# }
|
1532
1669
|
#
|
1670
|
+
# {
|
1671
|
+
# uuid: '63b38774-27db-4439-ac20-1be16a24d18e',
|
1672
|
+
# side: 'bid',
|
1673
|
+
# ord_type: 'limit',
|
1674
|
+
# price: '100000000',
|
1675
|
+
# state: 'wait',
|
1676
|
+
# market: 'KRW-BTC',
|
1677
|
+
# created_at: '2025-04-01T15:30:47+09:00',
|
1678
|
+
# volume: '0.00008',
|
1679
|
+
# remaining_volume: '0.00008',
|
1680
|
+
# reserved_fee: '4',
|
1681
|
+
# remaining_fee: '4',
|
1682
|
+
# paid_fee: '0',
|
1683
|
+
# locked: '8004',
|
1684
|
+
# executed_volume: '0',
|
1685
|
+
# trades_count: '0',
|
1686
|
+
# identifier: '21',
|
1687
|
+
# new_order_uuid: 'cb1cce56-6237-4a78-bc11-4cfffc1bb4c2',
|
1688
|
+
# new_order_identifier: '22'
|
1689
|
+
# }
|
1533
1690
|
id = self.safe_string(order, 'uuid')
|
1534
1691
|
side = self.safe_string(order, 'side')
|
1535
1692
|
if side == 'bid':
|
1536
1693
|
side = 'buy'
|
1537
1694
|
else:
|
1538
1695
|
side = 'sell'
|
1696
|
+
identifier = self.safe_string(order, 'identifier')
|
1539
1697
|
type = self.safe_string(order, 'ord_type')
|
1540
1698
|
timestamp = self.parse8601(self.safe_string(order, 'created_at'))
|
1541
1699
|
status = self.parse_order_status(self.safe_string(order, 'state'))
|
@@ -1585,7 +1743,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
1585
1743
|
return self.safe_order({
|
1586
1744
|
'info': order,
|
1587
1745
|
'id': id,
|
1588
|
-
'clientOrderId':
|
1746
|
+
'clientOrderId': identifier,
|
1589
1747
|
'timestamp': timestamp,
|
1590
1748
|
'datetime': self.iso8601(timestamp),
|
1591
1749
|
'lastTradeTimestamp': lastTradeTimestamp,
|
ccxt/async_support/vertex.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.vertex import ImplicitAPI
|
8
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction
|
8
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -2859,7 +2859,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
2859
2859
|
'takeProfitPrice': None,
|
2860
2860
|
})
|
2861
2861
|
|
2862
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
2862
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2863
2863
|
"""
|
2864
2864
|
fetch all open positions
|
2865
2865
|
|
ccxt/async_support/whitebit.py
CHANGED
ccxt/async_support/woo.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.woo import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, Bool, Conversion, Currencies, Currency, DepositAddress, Int, LedgerEntry, Leverage, MarginModification, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Any, Balances, Bool, Conversion, Currencies, Currency, DepositAddress, Int, LedgerEntry, Leverage, MarginModification, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -574,6 +574,7 @@ class woo(Exchange, ImplicitAPI):
|
|
574
574
|
contractSize = self.parse_number('1')
|
575
575
|
linear = True
|
576
576
|
inverse = False
|
577
|
+
active = self.safe_string(market, 'is_trading') == '1'
|
577
578
|
return {
|
578
579
|
'id': marketId,
|
579
580
|
'symbol': symbol,
|
@@ -589,7 +590,7 @@ class woo(Exchange, ImplicitAPI):
|
|
589
590
|
'swap': swap,
|
590
591
|
'future': False,
|
591
592
|
'option': False,
|
592
|
-
'active':
|
593
|
+
'active': active,
|
593
594
|
'contract': contract,
|
594
595
|
'linear': linear,
|
595
596
|
'inverse': inverse,
|
@@ -926,6 +927,7 @@ class woo(Exchange, ImplicitAPI):
|
|
926
927
|
'networks': resultingNetworks,
|
927
928
|
'deposit': None,
|
928
929
|
'withdraw': None,
|
930
|
+
'type': 'crypto',
|
929
931
|
'limits': {
|
930
932
|
'deposit': {
|
931
933
|
'min': None,
|
@@ -3163,7 +3165,7 @@ class woo(Exchange, ImplicitAPI):
|
|
3163
3165
|
#
|
3164
3166
|
return self.parse_position(response, market)
|
3165
3167
|
|
3166
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
3168
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
3167
3169
|
await self.load_markets()
|
3168
3170
|
response = await self.v3PrivateGetPositions(params)
|
3169
3171
|
#
|
ccxt/async_support/woofipro.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.woofipro import ImplicitAPI
|
8
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, FundingRate, FundingRates, Trade, TradingFees, Transaction
|
8
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, FundingRate, FundingRates, Trade, TradingFees, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -2599,7 +2599,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
2599
2599
|
data = self.safe_dict(response, 'data')
|
2600
2600
|
return self.parse_position(data, market)
|
2601
2601
|
|
2602
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
2602
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2603
2603
|
"""
|
2604
2604
|
fetch all open positions
|
2605
2605
|
|
ccxt/async_support/xt.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.xt import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Any, Currencies, Currency, DepositAddress, Int, LedgerEntry, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderSide, OrderType, Str, Tickers, FundingRate, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Any, Currencies, Currency, DepositAddress, Int, LedgerEntry, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderSide, OrderType, Position, Str, Tickers, FundingRate, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -962,6 +962,12 @@ class xt(Exchange, ImplicitAPI):
|
|
962
962
|
},
|
963
963
|
},
|
964
964
|
}
|
965
|
+
typeRaw = self.safe_string(entry, 'type')
|
966
|
+
type: Str = None
|
967
|
+
if typeRaw == 'FT':
|
968
|
+
type = 'crypto'
|
969
|
+
else:
|
970
|
+
type = 'other'
|
965
971
|
result[code] = {
|
966
972
|
'info': entry,
|
967
973
|
'id': currencyId,
|
@@ -973,6 +979,7 @@ class xt(Exchange, ImplicitAPI):
|
|
973
979
|
'deposit': deposit,
|
974
980
|
'withdraw': withdraw,
|
975
981
|
'networks': networks,
|
982
|
+
'type': type,
|
976
983
|
'limits': {
|
977
984
|
'amount': {
|
978
985
|
'min': None,
|
@@ -4487,7 +4494,7 @@ class xt(Exchange, ImplicitAPI):
|
|
4487
4494
|
return self.parse_position(entry, marketInner)
|
4488
4495
|
return None
|
4489
4496
|
|
4490
|
-
async def fetch_positions(self, symbols: List[str] = None, params={}):
|
4497
|
+
async def fetch_positions(self, symbols: List[str] = None, params={}) -> List[Position]:
|
4491
4498
|
"""
|
4492
4499
|
fetch all open positions
|
4493
4500
|
|
ccxt/base/errors.py
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
|
3
|
+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
4
|
+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
|
+
# EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
6
|
+
|
1
7
|
error_hierarchy = {
|
2
8
|
'BaseError': {
|
3
9
|
'ExchangeError': {
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.78'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -67,6 +67,10 @@ from ccxt.static_dependencies.starknet.hash.address import compute_address
|
|
67
67
|
from ccxt.static_dependencies.starknet.hash.selector import get_selector_from_name
|
68
68
|
from ccxt.static_dependencies.starknet.hash.utils import message_signature, private_to_stark_key
|
69
69
|
from ccxt.static_dependencies.starknet.utils.typed_data import TypedData as TypedDataDataclass
|
70
|
+
try:
|
71
|
+
import apexpro.zklink_sdk as zklink_sdk
|
72
|
+
except ImportError:
|
73
|
+
zklink_sdk = None
|
70
74
|
|
71
75
|
# -----------------------------------------------------------------------------
|
72
76
|
|
@@ -1755,6 +1759,69 @@ class Exchange(object):
|
|
1755
1759
|
def binary_length(self, binary):
|
1756
1760
|
return len(binary)
|
1757
1761
|
|
1762
|
+
def get_zk_contract_signature_obj(self, seeds: str, params={}):
|
1763
|
+
if zklink_sdk is None:
|
1764
|
+
raise Exception('zklink_sdk is not installed, please do pip3 install apexomni-arm or apexomni-x86-mac or apexomni-x86-windows-linux')
|
1765
|
+
|
1766
|
+
slotId = self.safe_string(params, 'slotId')
|
1767
|
+
nonceInt = int(self.remove0x_prefix(self.hash(self.encode(slotId), 'sha256', 'hex')), 16)
|
1768
|
+
|
1769
|
+
maxUint64 = 18446744073709551615
|
1770
|
+
maxUint32 = 4294967295
|
1771
|
+
|
1772
|
+
slotId = (nonceInt % maxUint64) / maxUint32
|
1773
|
+
nonce = nonceInt % maxUint32
|
1774
|
+
accountId = int(self.safe_string(params, 'accountId'), 10) % maxUint32
|
1775
|
+
|
1776
|
+
priceStr = (Decimal(self.safe_string(params, 'price')) * Decimal(10) ** Decimal('18')).quantize(Decimal(0), rounding='ROUND_DOWN')
|
1777
|
+
sizeStr = (Decimal(self.safe_string(params, 'size')) * Decimal(10) ** Decimal('18')).quantize(Decimal(0), rounding='ROUND_DOWN')
|
1778
|
+
|
1779
|
+
takerFeeRateStr = (Decimal(self.safe_string(params, 'takerFeeRate')) * Decimal(10000)).quantize(Decimal(0), rounding='ROUND_UP')
|
1780
|
+
makerFeeRateStr = (Decimal(self.safe_string(params, 'makerFeeRate')) * Decimal(10000)).quantize(Decimal(0), rounding='ROUND_UP')
|
1781
|
+
|
1782
|
+
builder = zklink_sdk.ContractBuilder(
|
1783
|
+
int(accountId), int(0), int(slotId), int(nonce), int(self.safe_number(params, 'pairId')),
|
1784
|
+
sizeStr.__str__(), priceStr.__str__(), self.safe_string(params, 'direction') == "BUY",
|
1785
|
+
int(takerFeeRateStr), int(makerFeeRateStr), False)
|
1786
|
+
|
1787
|
+
|
1788
|
+
tx = zklink_sdk.Contract(builder)
|
1789
|
+
seedsByte = bytes.fromhex(seeds.removeprefix('0x'))
|
1790
|
+
signerSeed = zklink_sdk.ZkLinkSigner().new_from_seed(seedsByte)
|
1791
|
+
auth_data = signerSeed.sign_musig(tx.get_bytes())
|
1792
|
+
signature = auth_data.signature
|
1793
|
+
return signature
|
1794
|
+
|
1795
|
+
def get_zk_transfer_signature_obj(self, seeds: str, params={}):
|
1796
|
+
if zklink_sdk is None:
|
1797
|
+
raise Exception('zklink_sdk is not installed, please do pip3 install apexomni-arm or apexomni-x86-mac or apexomni-x86-windows-linux')
|
1798
|
+
|
1799
|
+
nonce = self.safe_string(params, 'nonce', '0')
|
1800
|
+
if self.safe_bool(params, 'isContract'):
|
1801
|
+
formattedUint32 = '4294967295'
|
1802
|
+
formattedNonce = int(self.remove0x_prefix(self.hash(self.encode(nonce), 'sha256', 'hex')), 16)
|
1803
|
+
nonce = Precise.string_mod(str(formattedNonce), formattedUint32)
|
1804
|
+
|
1805
|
+
tx_builder = zklink_sdk.TransferBuilder(
|
1806
|
+
int(self.safe_number(params, 'zkAccountId', 0)),
|
1807
|
+
self.safe_string(params, 'receiverAddress'),
|
1808
|
+
int(self.safe_number(params, 'subAccountId', 0)),
|
1809
|
+
int(self.safe_number(params, 'receiverSubAccountId', 0)),
|
1810
|
+
int(self.safe_number(params, 'tokenId', 0)),
|
1811
|
+
self.safe_string(params, 'amount', '0'),
|
1812
|
+
self.safe_string(params, 'fee', '0'),
|
1813
|
+
self.parse_to_int(nonce),
|
1814
|
+
int(self.safe_number(params, 'timestampSeconds', 0))
|
1815
|
+
)
|
1816
|
+
|
1817
|
+
tx = zklink_sdk.Transfer(tx_builder)
|
1818
|
+
seedsByte = bytes.fromhex(seeds.removeprefix('0x'))
|
1819
|
+
signerSeed = zklink_sdk.ZkLinkSigner().new_from_seed(seedsByte)
|
1820
|
+
auth_data = signerSeed.sign_musig(tx.get_bytes())
|
1821
|
+
signature = auth_data.signature
|
1822
|
+
return signature
|
1823
|
+
|
1824
|
+
|
1758
1825
|
# ########################################################################
|
1759
1826
|
# ########################################################################
|
1760
1827
|
# ########################################################################
|
@@ -2953,7 +3020,7 @@ class Exchange(object):
|
|
2953
3020
|
# find lowest precision(which is more desired)
|
2954
3021
|
precision = self.safe_string(network, 'precision')
|
2955
3022
|
precisionMain = self.safe_string(currency, 'precision')
|
2956
|
-
if precisionMain is None or Precise.
|
3023
|
+
if precisionMain is None or Precise.string_gt(precision, precisionMain):
|
2957
3024
|
currency['precision'] = self.parse_number(precision)
|
2958
3025
|
# limits
|
2959
3026
|
limits = self.safe_dict(network, 'limits')
|
ccxt/binance.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.binance import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
|
10
|
+
from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -43,7 +43,7 @@ class binance(Exchange, ImplicitAPI):
|
|
43
43
|
return self.deep_extend(super(binance, self).describe(), {
|
44
44
|
'id': 'binance',
|
45
45
|
'name': 'Binance',
|
46
|
-
'countries': [
|
46
|
+
'countries': [], # Japan
|
47
47
|
'rateLimit': 50,
|
48
48
|
'certified': True,
|
49
49
|
'pro': True,
|
@@ -10110,7 +10110,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10110
10110
|
'percentage': None,
|
10111
10111
|
})
|
10112
10112
|
|
10113
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
10113
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
10114
10114
|
"""
|
10115
10115
|
fetch all open positions
|
10116
10116
|
|
ccxt/bingx.py
CHANGED
@@ -2371,7 +2371,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2371
2371
|
positions = self.parse_positions(records)
|
2372
2372
|
return self.filter_by_symbol_since_limit(positions, symbol, since, limit)
|
2373
2373
|
|
2374
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
2374
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2375
2375
|
"""
|
2376
2376
|
fetch all open positions
|
2377
2377
|
|
ccxt/bitfinex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitfinex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -2675,7 +2675,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
2675
2675
|
self.throw_broadly_matched_exception(self.exceptions['broad'], text, text)
|
2676
2676
|
return self.parse_transaction(response, currency)
|
2677
2677
|
|
2678
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
2678
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2679
2679
|
"""
|
2680
2680
|
fetch all open positions
|
2681
2681
|
|