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/digifinex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.digifinex import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Any, Balances, BorrowInterest, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, DepositAddress, Int, LedgerEntry, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Any, Balances, BorrowInterest, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, DepositAddress, Int, LedgerEntry, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -3375,7 +3375,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3375
3375
|
'tierBased': None,
|
3376
3376
|
}
|
3377
3377
|
|
3378
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
3378
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
3379
3379
|
"""
|
3380
3380
|
fetch all open positions
|
3381
3381
|
|
ccxt/gate.py
CHANGED
@@ -5723,7 +5723,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5723
5723
|
#
|
5724
5724
|
return self.parse_position(response, market)
|
5725
5725
|
|
5726
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
5726
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
5727
5727
|
"""
|
5728
5728
|
fetch all open positions
|
5729
5729
|
|
ccxt/hitbtc.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hitbtc import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, OrderBooks, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, OrderBooks, Trade, TradingFeeInterface, 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
|
@@ -966,6 +966,8 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
966
966
|
transferEnabled = self.safe_bool(entry, 'transfer_enabled', False)
|
967
967
|
active = payinEnabled and payoutEnabled and transferEnabled
|
968
968
|
rawNetworks = self.safe_value(entry, 'networks', [])
|
969
|
+
isCrypto = self.safe_bool(entry, 'crypto')
|
970
|
+
type = 'crypto' if isCrypto else 'fiat'
|
969
971
|
networks: dict = {}
|
970
972
|
fee = None
|
971
973
|
depositEnabled = None
|
@@ -1023,6 +1025,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
1023
1025
|
'max': None,
|
1024
1026
|
},
|
1025
1027
|
},
|
1028
|
+
'type': type,
|
1026
1029
|
}
|
1027
1030
|
return result
|
1028
1031
|
|
@@ -2823,7 +2826,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2823
2826
|
sorted = self.sort_by(rates, 'timestamp')
|
2824
2827
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
2825
2828
|
|
2826
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
2829
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2827
2830
|
"""
|
2828
2831
|
fetch all open positions
|
2829
2832
|
|
ccxt/htx.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.htx import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, BorrowInterest, Currencies, Currency, DepositAddress, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Any, Balances, BorrowInterest, Currencies, Currency, DepositAddress, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -7337,7 +7337,7 @@ class htx(Exchange, ImplicitAPI):
|
|
7337
7337
|
'takeProfitPrice': None,
|
7338
7338
|
})
|
7339
7339
|
|
7340
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
7340
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
7341
7341
|
"""
|
7342
7342
|
fetch all open positions
|
7343
7343
|
|
ccxt/hyperliquid.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hyperliquid import ImplicitAPI
|
8
8
|
import math
|
9
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -771,12 +771,15 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
771
771
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
772
772
|
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
773
773
|
:param str [params.type]: wallet type, ['spot', 'swap'], defaults to swap
|
774
|
+
:param str [params.marginMode]: 'cross' or 'isolated', for margin trading, uses self.options.defaultMarginMode if not passed, defaults to None/None/None
|
774
775
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
775
776
|
"""
|
776
777
|
userAddress = None
|
777
778
|
userAddress, params = self.handle_public_address('fetchBalance', params)
|
778
779
|
type = None
|
779
780
|
type, params = self.handle_market_type_and_params('fetchBalance', None, params)
|
781
|
+
marginMode = None
|
782
|
+
marginMode, params = self.handle_margin_mode_and_params('fetchBalance', params)
|
780
783
|
isSpot = (type == 'spot')
|
781
784
|
reqType = 'spotClearinghouseState' if (isSpot) else 'clearinghouseState'
|
782
785
|
request: dict = {
|
@@ -833,12 +836,16 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
833
836
|
spotBalances[code] = account
|
834
837
|
return self.safe_balance(spotBalances)
|
835
838
|
data = self.safe_dict(response, 'marginSummary', {})
|
839
|
+
usdcBalance = {
|
840
|
+
'total': self.safe_number(data, 'accountValue'),
|
841
|
+
}
|
842
|
+
if (marginMode is not None) and (marginMode == 'isolated'):
|
843
|
+
usdcBalance['free'] = self.safe_number(response, 'withdrawable')
|
844
|
+
else:
|
845
|
+
usdcBalance['used'] = self.safe_number(data, 'totalMarginUsed')
|
836
846
|
result: dict = {
|
837
847
|
'info': response,
|
838
|
-
'USDC':
|
839
|
-
'total': self.safe_number(data, 'accountValue'),
|
840
|
-
'used': self.safe_number(data, 'totalMarginUsed'),
|
841
|
-
},
|
848
|
+
'USDC': usdcBalance,
|
842
849
|
}
|
843
850
|
timestamp = self.safe_integer(response, 'time')
|
844
851
|
result['timestamp'] = timestamp
|
@@ -2452,7 +2459,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2452
2459
|
positions = self.fetch_positions([symbol], params)
|
2453
2460
|
return self.safe_dict(positions, 0, {})
|
2454
2461
|
|
2455
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
2462
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2456
2463
|
"""
|
2457
2464
|
fetch all open positions
|
2458
2465
|
|
ccxt/kraken.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.kraken import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, IndexType, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, IndexType, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -3067,7 +3067,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
3067
3067
|
return self.parse_transaction(result, currency)
|
3068
3068
|
raise ExchangeError(self.id + " withdraw() requires a 'key' parameter(withdrawal key name, up on your account)")
|
3069
3069
|
|
3070
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
3070
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
3071
3071
|
"""
|
3072
3072
|
fetch all open positions
|
3073
3073
|
|
ccxt/krakenfutures.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.krakenfutures import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currency, Int, Leverage, Leverages, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currency, Int, Leverage, Leverages, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -2287,7 +2287,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2287
2287
|
sorted = self.sort_by(result, 'timestamp')
|
2288
2288
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
2289
2289
|
|
2290
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
2290
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2291
2291
|
"""
|
2292
2292
|
|
2293
2293
|
https://docs.futures.kraken.com/#http-api-trading-v3-api-account-information-get-open-positions
|
ccxt/kucoinfutures.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.kucoin import kucoin
|
7
7
|
from ccxt.abstract.kucoinfutures import ImplicitAPI
|
8
|
-
from ccxt.base.types import Any, Balances, Currency, DepositAddress, Int, Leverage, LeverageTier, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
|
8
|
+
from ccxt.base.types import Any, Balances, Currency, DepositAddress, Int, Leverage, LeverageTier, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import AuthenticationError
|
11
11
|
from ccxt.base.errors import PermissionDenied
|
@@ -1232,7 +1232,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1232
1232
|
data = self.safe_dict(response, 'data', {})
|
1233
1233
|
return self.parse_position(data, market)
|
1234
1234
|
|
1235
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
1235
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
1236
1236
|
"""
|
1237
1237
|
fetch all open positions
|
1238
1238
|
|
ccxt/mexc.py
CHANGED
@@ -1097,80 +1097,47 @@ class mexc(Exchange, ImplicitAPI):
|
|
1097
1097
|
id = self.safe_string(currency, 'coin')
|
1098
1098
|
code = self.safe_currency_code(id)
|
1099
1099
|
name = self.safe_string(currency, 'name')
|
1100
|
-
currencyActive = False
|
1101
|
-
currencyFee = None
|
1102
|
-
currencyWithdrawMin = None
|
1103
|
-
currencyWithdrawMax = None
|
1104
|
-
depositEnabled = False
|
1105
|
-
withdrawEnabled = False
|
1106
1100
|
networks: dict = {}
|
1107
1101
|
chains = self.safe_value(currency, 'networkList', [])
|
1108
1102
|
for j in range(0, len(chains)):
|
1109
1103
|
chain = chains[j]
|
1110
1104
|
networkId = self.safe_string_2(chain, 'netWork', 'network')
|
1111
1105
|
network = self.network_id_to_code(networkId)
|
1112
|
-
isDepositEnabled = self.safe_bool(chain, 'depositEnable', False)
|
1113
|
-
isWithdrawEnabled = self.safe_bool(chain, 'withdrawEnable', False)
|
1114
|
-
active = (isDepositEnabled and isWithdrawEnabled)
|
1115
|
-
currencyActive = active or currencyActive
|
1116
|
-
withdrawMin = self.safe_string(chain, 'withdrawMin')
|
1117
|
-
withdrawMax = self.safe_string(chain, 'withdrawMax')
|
1118
|
-
currencyWithdrawMin = withdrawMin if (currencyWithdrawMin is None) else currencyWithdrawMin
|
1119
|
-
currencyWithdrawMax = withdrawMax if (currencyWithdrawMax is None) else currencyWithdrawMax
|
1120
|
-
fee = self.safe_number(chain, 'withdrawFee')
|
1121
|
-
currencyFee = fee if (currencyFee is None) else currencyFee
|
1122
|
-
if Precise.string_gt(currencyWithdrawMin, withdrawMin):
|
1123
|
-
currencyWithdrawMin = withdrawMin
|
1124
|
-
if Precise.string_lt(currencyWithdrawMax, withdrawMax):
|
1125
|
-
currencyWithdrawMax = withdrawMax
|
1126
|
-
if isDepositEnabled:
|
1127
|
-
depositEnabled = True
|
1128
|
-
if isWithdrawEnabled:
|
1129
|
-
withdrawEnabled = True
|
1130
1106
|
networks[network] = {
|
1131
1107
|
'info': chain,
|
1132
1108
|
'id': networkId,
|
1133
1109
|
'network': network,
|
1134
|
-
'active':
|
1135
|
-
'deposit':
|
1136
|
-
'withdraw':
|
1137
|
-
'fee':
|
1110
|
+
'active': None,
|
1111
|
+
'deposit': self.safe_bool(chain, 'depositEnable', False),
|
1112
|
+
'withdraw': self.safe_bool(chain, 'withdrawEnable', False),
|
1113
|
+
'fee': self.safe_number(chain, 'withdrawFee'),
|
1138
1114
|
'precision': None,
|
1139
1115
|
'limits': {
|
1140
1116
|
'withdraw': {
|
1141
|
-
'min': withdrawMin,
|
1142
|
-
'max': withdrawMax,
|
1117
|
+
'min': self.safe_string(chain, 'withdrawMin'),
|
1118
|
+
'max': self.safe_string(chain, 'withdrawMax'),
|
1143
1119
|
},
|
1144
1120
|
},
|
1145
1121
|
}
|
1146
|
-
|
1147
|
-
networkKeysLength = len(networkKeys)
|
1148
|
-
if (networkKeysLength == 1) or ('NONE' in networks):
|
1149
|
-
defaultNetwork = self.safe_value_2(networks, 'NONE', networkKeysLength - 1)
|
1150
|
-
if defaultNetwork is not None:
|
1151
|
-
currencyFee = defaultNetwork['fee']
|
1152
|
-
result[code] = {
|
1122
|
+
result[code] = self.safe_currency_structure({
|
1153
1123
|
'info': currency,
|
1154
1124
|
'id': id,
|
1155
1125
|
'code': code,
|
1156
1126
|
'name': name,
|
1157
|
-
'active':
|
1158
|
-
'deposit':
|
1159
|
-
'withdraw':
|
1160
|
-
'fee':
|
1127
|
+
'active': None,
|
1128
|
+
'deposit': None,
|
1129
|
+
'withdraw': None,
|
1130
|
+
'fee': None,
|
1161
1131
|
'precision': None,
|
1162
1132
|
'limits': {
|
1163
1133
|
'amount': {
|
1164
1134
|
'min': None,
|
1165
1135
|
'max': None,
|
1166
1136
|
},
|
1167
|
-
'withdraw': {
|
1168
|
-
'min': currencyWithdrawMin,
|
1169
|
-
'max': currencyWithdrawMax,
|
1170
|
-
},
|
1171
1137
|
},
|
1138
|
+
'type': 'crypto',
|
1172
1139
|
'networks': networks,
|
1173
|
-
}
|
1140
|
+
})
|
1174
1141
|
return result
|
1175
1142
|
|
1176
1143
|
def fetch_markets(self, params={}) -> List[Market]:
|
@@ -3253,13 +3220,27 @@ class mexc(Exchange, ImplicitAPI):
|
|
3253
3220
|
|
3254
3221
|
def parse_order(self, order: dict, market: Market = None) -> Order:
|
3255
3222
|
#
|
3256
|
-
# spot
|
3223
|
+
# spot
|
3224
|
+
# createOrder
|
3257
3225
|
#
|
3258
|
-
#
|
3226
|
+
# {
|
3227
|
+
# "symbol": "FARTCOINUSDT",
|
3228
|
+
# "orderId": "C02__342252993005723644225",
|
3229
|
+
# "orderListId": "-1",
|
3230
|
+
# "price": "1.1",
|
3231
|
+
# "origQty": "6.3",
|
3232
|
+
# "type": "IMMEDIATE_OR_CANCEL",
|
3233
|
+
# "side": "SELL",
|
3234
|
+
# "transactTime": "1745852205223"
|
3235
|
+
# }
|
3236
|
+
#
|
3237
|
+
# unknown endpoint on spot
|
3238
|
+
#
|
3239
|
+
# {
|
3259
3240
|
# "symbol": "BTCUSDT",
|
3260
3241
|
# "orderId": "123738410679123456",
|
3261
3242
|
# "orderListId": -1
|
3262
|
-
#
|
3243
|
+
# }
|
3263
3244
|
#
|
3264
3245
|
# margin: createOrder
|
3265
3246
|
#
|
@@ -3421,6 +3402,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
3421
3402
|
id = order
|
3422
3403
|
else:
|
3423
3404
|
id = self.safe_string_2(order, 'orderId', 'id')
|
3405
|
+
timeInForce = self.parse_order_time_in_force(self.safe_string(order, 'timeInForce'))
|
3406
|
+
typeRaw = self.safe_string(order, 'type')
|
3407
|
+
if timeInForce is None:
|
3408
|
+
timeInForce = self.get_tif_from_raw_order_type(typeRaw)
|
3424
3409
|
marketId = self.safe_string(order, 'symbol')
|
3425
3410
|
market = self.safe_market(marketId, market)
|
3426
3411
|
timestamp = self.safe_integer_n(order, ['time', 'createTime', 'transactTime'])
|
@@ -3442,8 +3427,8 @@ class mexc(Exchange, ImplicitAPI):
|
|
3442
3427
|
'lastTradeTimestamp': None, # TODO: self might be 'updateTime' if order-status is filled, otherwise cancellation time. needs to be checked
|
3443
3428
|
'status': self.parse_order_status(self.safe_string_2(order, 'status', 'state')),
|
3444
3429
|
'symbol': market['symbol'],
|
3445
|
-
'type': self.parse_order_type(
|
3446
|
-
'timeInForce':
|
3430
|
+
'type': self.parse_order_type(typeRaw),
|
3431
|
+
'timeInForce': timeInForce,
|
3447
3432
|
'side': self.parse_order_side(self.safe_string(order, 'side')),
|
3448
3433
|
'price': self.safe_number(order, 'price'),
|
3449
3434
|
'triggerPrice': self.safe_number_2(order, 'stopPrice', 'triggerPrice'),
|
@@ -3472,6 +3457,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
3472
3457
|
'MARKET': 'market',
|
3473
3458
|
'LIMIT': 'limit',
|
3474
3459
|
'LIMIT_MAKER': 'limit',
|
3460
|
+
# on spot, during submission below types are used only accepted order
|
3461
|
+
'IMMEDIATE_OR_CANCEL': 'limit',
|
3462
|
+
'FILL_OR_KILL': 'limit',
|
3475
3463
|
}
|
3476
3464
|
return self.safe_string(statuses, status, status)
|
3477
3465
|
|
@@ -3499,6 +3487,16 @@ class mexc(Exchange, ImplicitAPI):
|
|
3499
3487
|
}
|
3500
3488
|
return self.safe_string(statuses, status, status)
|
3501
3489
|
|
3490
|
+
def get_tif_from_raw_order_type(self, orderType: Str = None):
|
3491
|
+
statuses: dict = {
|
3492
|
+
'LIMIT': 'GTC',
|
3493
|
+
'LIMIT_MAKER': 'POST_ONLY',
|
3494
|
+
'IMMEDIATE_OR_CANCEL': 'IOC',
|
3495
|
+
'FILL_OR_KILL': 'FOK',
|
3496
|
+
'MARKET': 'IOC',
|
3497
|
+
}
|
3498
|
+
return self.safe_string(statuses, orderType, orderType)
|
3499
|
+
|
3502
3500
|
def fetch_account_helper(self, type, params):
|
3503
3501
|
if type == 'spot':
|
3504
3502
|
return self.spotPrivateGetAccount(params)
|
@@ -4849,7 +4847,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4849
4847
|
response = self.fetch_positions(None, self.extend(request, params))
|
4850
4848
|
return self.safe_value(response, 0)
|
4851
4849
|
|
4852
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
4850
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
4853
4851
|
"""
|
4854
4852
|
fetch all open positions
|
4855
4853
|
|
ccxt/okx.py
CHANGED
@@ -5401,7 +5401,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5401
5401
|
return None
|
5402
5402
|
return self.parse_position(position, market)
|
5403
5403
|
|
5404
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
5404
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
5405
5405
|
"""
|
5406
5406
|
|
5407
5407
|
https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
|
ccxt/oxfun.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.oxfun import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -2129,7 +2129,7 @@ class oxfun(Exchange, ImplicitAPI):
|
|
2129
2129
|
data['type'] = 'withdrawal'
|
2130
2130
|
return self.parse_transaction(data, currency)
|
2131
2131
|
|
2132
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
2132
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
2133
2133
|
"""
|
2134
2134
|
fetch all open positions
|
2135
2135
|
|
ccxt/paradex.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.paradex import ImplicitAPI
|
8
|
-
from ccxt.base.types import Any, Balances, Currency, Int, Leverage, MarginMode, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
8
|
+
from ccxt.base.types import Any, Balances, Currency, Int, Leverage, MarginMode, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -1815,7 +1815,7 @@ class paradex(Exchange, ImplicitAPI):
|
|
1815
1815
|
positions = self.fetch_positions([market['symbol']], params)
|
1816
1816
|
return self.safe_dict(positions, 0, {})
|
1817
1817
|
|
1818
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
1818
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
1819
1819
|
"""
|
1820
1820
|
fetch all open positions
|
1821
1821
|
|
ccxt/phemex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.phemex import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import numbers
|
10
|
-
from ccxt.base.types import Any, Balances, Conversion, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Any, Balances, Conversion, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -1166,7 +1166,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
1166
1166
|
},
|
1167
1167
|
},
|
1168
1168
|
'valueScale': valueScale,
|
1169
|
-
'networks':
|
1169
|
+
'networks': None,
|
1170
|
+
'type': 'crypto',
|
1170
1171
|
}
|
1171
1172
|
return result
|
1172
1173
|
|
@@ -3570,7 +3571,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3570
3571
|
'fee': fee,
|
3571
3572
|
}
|
3572
3573
|
|
3573
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
3574
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
3574
3575
|
"""
|
3575
3576
|
fetch all open positions
|
3576
3577
|
|
ccxt/poloniex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.poloniex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, 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
|
@@ -1827,7 +1827,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1827
1827
|
isTrigger = self.safe_value_2(params, 'trigger', 'stop')
|
1828
1828
|
params = self.omit(params, ['trigger', 'stop'])
|
1829
1829
|
response = None
|
1830
|
-
if
|
1830
|
+
if marketType != 'spot':
|
1831
1831
|
raw = self.swapPrivateGetV3TradeOrderOpens(self.extend(request, params))
|
1832
1832
|
#
|
1833
1833
|
# {
|
@@ -3284,7 +3284,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
3284
3284
|
#
|
3285
3285
|
return response
|
3286
3286
|
|
3287
|
-
def fetch_positions(self, symbols: Strings = None, params={}):
|
3287
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
3288
3288
|
"""
|
3289
3289
|
fetch all open positions
|
3290
3290
|
|
ccxt/pro/__init__.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
|
|
@@ -13,6 +13,7 @@ from ccxt.async_support.base.exchange import Exchange # noqa: F401
|
|
13
13
|
# CCXT Pro exchanges (now this is mainly used for importing exchanges in WS tests)
|
14
14
|
|
15
15
|
from ccxt.pro.alpaca import alpaca # noqa: F401
|
16
|
+
from ccxt.pro.apex import apex # noqa: F401
|
16
17
|
from ccxt.pro.ascendex import ascendex # noqa: F401
|
17
18
|
from ccxt.pro.bequant import bequant # noqa: F401
|
18
19
|
from ccxt.pro.binance import binance # noqa: F401
|
@@ -76,6 +77,7 @@ from ccxt.pro.paradex import paradex # noqa
|
|
76
77
|
from ccxt.pro.phemex import phemex # noqa: F401
|
77
78
|
from ccxt.pro.poloniex import poloniex # noqa: F401
|
78
79
|
from ccxt.pro.probit import probit # noqa: F401
|
80
|
+
from ccxt.pro.tradeogre import tradeogre # noqa: F401
|
79
81
|
from ccxt.pro.upbit import upbit # noqa: F401
|
80
82
|
from ccxt.pro.vertex import vertex # noqa: F401
|
81
83
|
from ccxt.pro.whitebit import whitebit # noqa: F401
|
@@ -85,6 +87,7 @@ from ccxt.pro.xt import xt # noqa
|
|
85
87
|
|
86
88
|
exchanges = [
|
87
89
|
'alpaca',
|
90
|
+
'apex',
|
88
91
|
'ascendex',
|
89
92
|
'bequant',
|
90
93
|
'binance',
|
@@ -148,6 +151,7 @@ exchanges = [
|
|
148
151
|
'phemex',
|
149
152
|
'poloniex',
|
150
153
|
'probit',
|
154
|
+
'tradeogre',
|
151
155
|
'upbit',
|
152
156
|
'vertex',
|
153
157
|
'whitebit',
|