ccxt 4.2.93__py2.py3-none-any.whl → 4.2.95__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 +2 -2
- ccxt/abstract/binance.py +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/bitstamp.py +6 -0
- ccxt/ace.py +1 -1
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +2 -2
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +7 -1
- ccxt/async_support/bigone.py +1 -1
- ccxt/async_support/binance.py +63 -5
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitget.py +136 -2
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +1 -1
- ccxt/async_support/bitmex.py +1 -1
- ccxt/async_support/bitopro.py +1 -1
- ccxt/async_support/bitrue.py +1 -1
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitstamp.py +7 -1
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +1 -1
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/blofin.py +1 -1
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/bybit.py +2 -2
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +1 -1
- ccxt/async_support/coinbaseinternational.py +1 -1
- ccxt/async_support/coinbasepro.py +1 -1
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +62 -56
- ccxt/async_support/coinlist.py +1 -1
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/deribit.py +1 -1
- ccxt/async_support/digifinex.py +1 -1
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/gemini.py +3 -2
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +117 -116
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/idex.py +1 -1
- ccxt/async_support/indodax.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/krakenfutures.py +2 -2
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/kucoinfutures.py +1 -1
- ccxt/async_support/latoken.py +1 -1
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/mexc.py +1 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okcoin.py +1 -1
- ccxt/async_support/okx.py +191 -43
- ccxt/async_support/onetrading.py +1 -1
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/phemex.py +1 -1
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/poloniexfutures.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +1 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/upbit.py +2 -2
- ccxt/async_support/wavesexchange.py +1 -1
- ccxt/async_support/whitebit.py +1 -1
- ccxt/async_support/woo.py +136 -2
- ccxt/async_support/yobit.py +1 -1
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/errors.py +7 -7
- ccxt/base/exchange.py +18 -1
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +1 -1
- ccxt/binance.py +63 -5
- ccxt/bingx.py +1 -1
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +1 -1
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +1 -1
- ccxt/bitget.py +136 -2
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +1 -1
- ccxt/bitmex.py +1 -1
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +1 -1
- ccxt/bitso.py +1 -1
- ccxt/bitstamp.py +7 -1
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +1 -1
- ccxt/blockchaincom.py +1 -1
- ccxt/blofin.py +1 -1
- ccxt/btcalpha.py +1 -1
- ccxt/btcbox.py +1 -1
- ccxt/bybit.py +2 -2
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/coinbasepro.py +1 -1
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +62 -56
- ccxt/coinlist.py +1 -1
- ccxt/coinmate.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/cryptocom.py +1 -1
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +1 -1
- ccxt/deribit.py +1 -1
- ccxt/digifinex.py +1 -1
- ccxt/exmo.py +1 -1
- ccxt/gate.py +1 -1
- ccxt/gemini.py +3 -2
- ccxt/hitbtc.py +1 -1
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +117 -116
- ccxt/huobijp.py +1 -1
- ccxt/idex.py +1 -1
- ccxt/indodax.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/krakenfutures.py +2 -2
- ccxt/kucoin.py +1 -1
- ccxt/kucoinfutures.py +1 -1
- ccxt/latoken.py +1 -1
- ccxt/lbank.py +1 -1
- ccxt/mexc.py +1 -1
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +1 -1
- ccxt/oceanex.py +1 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +191 -43
- ccxt/onetrading.py +1 -1
- ccxt/p2b.py +1 -1
- ccxt/phemex.py +1 -1
- ccxt/poloniex.py +1 -1
- ccxt/poloniexfutures.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/ascendex.py +1 -1
- ccxt/pro/bitfinex2.py +1 -1
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bitmart.py +1 -1
- ccxt/pro/bitmex.py +1 -1
- ccxt/pro/bitstamp.py +1 -1
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/blockchaincom.py +1 -1
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/coinbase.py +12 -0
- ccxt/pro/coinbaseinternational.py +1 -1
- ccxt/pro/coinbasepro.py +1 -1
- ccxt/pro/coinex.py +1 -1
- ccxt/pro/cryptocom.py +1 -1
- ccxt/pro/gate.py +1 -1
- ccxt/pro/hitbtc.py +1 -1
- ccxt/pro/hollaex.py +1 -1
- ccxt/pro/htx.py +1 -1
- ccxt/pro/kraken.py +97 -19
- ccxt/pro/krakenfutures.py +105 -40
- ccxt/pro/kucoin.py +25 -16
- ccxt/pro/okcoin.py +1 -1
- ccxt/pro/okx.py +1 -1
- ccxt/pro/poloniex.py +1 -1
- ccxt/pro/poloniexfutures.py +1 -1
- ccxt/pro/whitebit.py +1 -1
- ccxt/probit.py +1 -1
- ccxt/timex.py +1 -1
- ccxt/tokocrypto.py +1 -1
- ccxt/tradeogre.py +1 -1
- ccxt/upbit.py +2 -2
- ccxt/wavesexchange.py +1 -1
- ccxt/whitebit.py +1 -1
- ccxt/woo.py +136 -2
- ccxt/yobit.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.2.93.dist-info → ccxt-4.2.95.dist-info}/METADATA +4 -4
- {ccxt-4.2.93.dist-info → ccxt-4.2.95.dist-info}/RECORD +190 -190
- {ccxt-4.2.93.dist-info → ccxt-4.2.95.dist-info}/WHEEL +0 -0
- {ccxt-4.2.93.dist-info → ccxt-4.2.95.dist-info}/top_level.txt +0 -0
ccxt/async_support/whitebit.py
CHANGED
@@ -9,6 +9,7 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Bool, Currencies, Currency, Int, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import PermissionDenied
|
13
14
|
from ccxt.base.errors import ArgumentsRequired
|
14
15
|
from ccxt.base.errors import BadRequest
|
@@ -19,7 +20,6 @@ from ccxt.base.errors import OrderNotFound
|
|
19
20
|
from ccxt.base.errors import NotSupported
|
20
21
|
from ccxt.base.errors import DDoSProtection
|
21
22
|
from ccxt.base.errors import ExchangeNotAvailable
|
22
|
-
from ccxt.base.errors import AuthenticationError
|
23
23
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
24
24
|
from ccxt.base.precise import Precise
|
25
25
|
|
ccxt/async_support/woo.py
CHANGED
@@ -6,16 +6,16 @@
|
|
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, Balances, Bool, Currencies, Currency, Int, Leverage, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Bool, Conversion, Currencies, Currency, Int, Leverage, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import ArgumentsRequired
|
13
14
|
from ccxt.base.errors import BadRequest
|
14
15
|
from ccxt.base.errors import InvalidOrder
|
15
16
|
from ccxt.base.errors import NotSupported
|
16
17
|
from ccxt.base.errors import RateLimitExceeded
|
17
18
|
from ccxt.base.errors import OnMaintenance
|
18
|
-
from ccxt.base.errors import AuthenticationError
|
19
19
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
20
20
|
from ccxt.base.precise import Precise
|
21
21
|
|
@@ -66,6 +66,8 @@ class woo(Exchange, ImplicitAPI):
|
|
66
66
|
'fetchCanceledOrders': False,
|
67
67
|
'fetchClosedOrder': False,
|
68
68
|
'fetchClosedOrders': True,
|
69
|
+
'fetchConvertCurrencies': True,
|
70
|
+
'fetchConvertQuote': True,
|
69
71
|
'fetchCurrencies': True,
|
70
72
|
'fetchDepositAddress': True,
|
71
73
|
'fetchDeposits': True,
|
@@ -2781,6 +2783,138 @@ class woo(Exchange, ImplicitAPI):
|
|
2781
2783
|
'takeProfitPrice': None,
|
2782
2784
|
})
|
2783
2785
|
|
2786
|
+
async def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
2787
|
+
"""
|
2788
|
+
fetch a quote for converting from one currency to another
|
2789
|
+
:see: https://docs.woo.org/#get-quote-rfq
|
2790
|
+
:param str fromCode: the currency that you want to sell and convert from
|
2791
|
+
:param str toCode: the currency that you want to buy and convert into
|
2792
|
+
:param float [amount]: how much you want to trade in units of the from currency
|
2793
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2794
|
+
:returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
|
2795
|
+
"""
|
2796
|
+
await self.load_markets()
|
2797
|
+
request = {
|
2798
|
+
'sellToken': fromCode.upper(),
|
2799
|
+
'buyToken': toCode.upper(),
|
2800
|
+
'sellQuantity': self.number_to_string(amount),
|
2801
|
+
}
|
2802
|
+
response = await self.v3PrivateGetConvertRfq(self.extend(request, params))
|
2803
|
+
#
|
2804
|
+
# {
|
2805
|
+
# "success": True,
|
2806
|
+
# "data": {
|
2807
|
+
# "quoteId": 123123123,
|
2808
|
+
# "counterPartyId": "",
|
2809
|
+
# "sellToken": "ETH",
|
2810
|
+
# "sellQuantity": "0.0445",
|
2811
|
+
# "buyToken": "USDT",
|
2812
|
+
# "buyQuantity": "33.45",
|
2813
|
+
# "buyPrice": "6.77",
|
2814
|
+
# "expireTimestamp": 1659084466000,
|
2815
|
+
# "message": 1659084466000
|
2816
|
+
# }
|
2817
|
+
# }
|
2818
|
+
#
|
2819
|
+
data = self.safe_dict(response, 'data', {})
|
2820
|
+
fromCurrencyId = self.safe_string(data, 'sellToken', fromCode)
|
2821
|
+
fromCurrency = self.currency(fromCurrencyId)
|
2822
|
+
toCurrencyId = self.safe_string(data, 'buyToken', toCode)
|
2823
|
+
toCurrency = self.currency(toCurrencyId)
|
2824
|
+
return self.parse_conversion(data, fromCurrency, toCurrency)
|
2825
|
+
|
2826
|
+
def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
2827
|
+
#
|
2828
|
+
# fetchConvertQuote
|
2829
|
+
#
|
2830
|
+
# {
|
2831
|
+
# "quoteId": 123123123,
|
2832
|
+
# "counterPartyId": "",
|
2833
|
+
# "sellToken": "ETH",
|
2834
|
+
# "sellQuantity": "0.0445",
|
2835
|
+
# "buyToken": "USDT",
|
2836
|
+
# "buyQuantity": "33.45",
|
2837
|
+
# "buyPrice": "6.77",
|
2838
|
+
# "expireTimestamp": 1659084466000,
|
2839
|
+
# "message": 1659084466000
|
2840
|
+
# }
|
2841
|
+
#
|
2842
|
+
timestamp = self.safe_integer(conversion, 'expireTimestamp')
|
2843
|
+
fromCoin = self.safe_string(conversion, 'sellToken')
|
2844
|
+
fromCode = self.safe_currency_code(fromCoin, fromCurrency)
|
2845
|
+
to = self.safe_string(conversion, 'buyToken')
|
2846
|
+
toCode = self.safe_currency_code(to, toCurrency)
|
2847
|
+
return {
|
2848
|
+
'info': conversion,
|
2849
|
+
'timestamp': timestamp,
|
2850
|
+
'datetime': self.iso8601(timestamp),
|
2851
|
+
'id': self.safe_string(conversion, 'quoteId'),
|
2852
|
+
'fromCurrency': fromCode,
|
2853
|
+
'fromAmount': self.safe_number(conversion, 'sellQuantity'),
|
2854
|
+
'toCurrency': toCode,
|
2855
|
+
'toAmount': self.safe_number(conversion, 'buyQuantity'),
|
2856
|
+
'price': self.safe_number(conversion, 'buyPrice'),
|
2857
|
+
'fee': None,
|
2858
|
+
}
|
2859
|
+
|
2860
|
+
async def fetch_convert_currencies(self, params={}) -> Currencies:
|
2861
|
+
"""
|
2862
|
+
fetches all available currencies that can be converted
|
2863
|
+
:see: https://docs.woo.org/#get-quote-asset-info
|
2864
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2865
|
+
:returns dict: an associative dictionary of currencies
|
2866
|
+
"""
|
2867
|
+
await self.load_markets()
|
2868
|
+
response = await self.v3PrivateGetConvertAssetInfo(params)
|
2869
|
+
#
|
2870
|
+
# {
|
2871
|
+
# "success": True,
|
2872
|
+
# "rows": [
|
2873
|
+
# {
|
2874
|
+
# "token": "BTC",
|
2875
|
+
# "tick": 0.0001,
|
2876
|
+
# "createdTime": "1575014248.99", # Unix epoch time in seconds
|
2877
|
+
# "updatedTime": "1575014248.99" # Unix epoch time in seconds
|
2878
|
+
# },
|
2879
|
+
# ]
|
2880
|
+
# }
|
2881
|
+
#
|
2882
|
+
result = {}
|
2883
|
+
data = self.safe_list(response, 'rows', [])
|
2884
|
+
for i in range(0, len(data)):
|
2885
|
+
entry = data[i]
|
2886
|
+
id = self.safe_string(entry, 'token')
|
2887
|
+
code = self.safe_currency_code(id)
|
2888
|
+
result[code] = {
|
2889
|
+
'info': entry,
|
2890
|
+
'id': id,
|
2891
|
+
'code': code,
|
2892
|
+
'networks': None,
|
2893
|
+
'type': None,
|
2894
|
+
'name': None,
|
2895
|
+
'active': None,
|
2896
|
+
'deposit': None,
|
2897
|
+
'withdraw': None,
|
2898
|
+
'fee': None,
|
2899
|
+
'precision': self.safe_number(entry, 'tick'),
|
2900
|
+
'limits': {
|
2901
|
+
'amount': {
|
2902
|
+
'min': None,
|
2903
|
+
'max': None,
|
2904
|
+
},
|
2905
|
+
'withdraw': {
|
2906
|
+
'min': None,
|
2907
|
+
'max': None,
|
2908
|
+
},
|
2909
|
+
'deposit': {
|
2910
|
+
'min': None,
|
2911
|
+
'max': None,
|
2912
|
+
},
|
2913
|
+
},
|
2914
|
+
'created': self.safe_timestamp(entry, 'createdTime'),
|
2915
|
+
}
|
2916
|
+
return result
|
2917
|
+
|
2784
2918
|
def default_network_code_for_currency(self, code):
|
2785
2919
|
currencyItem = self.currency(code)
|
2786
2920
|
networks = currencyItem['networks']
|
ccxt/async_support/yobit.py
CHANGED
@@ -9,6 +9,7 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import ArgumentsRequired
|
13
14
|
from ccxt.base.errors import InsufficientFunds
|
14
15
|
from ccxt.base.errors import InvalidOrder
|
@@ -17,7 +18,6 @@ from ccxt.base.errors import DDoSProtection
|
|
17
18
|
from ccxt.base.errors import RateLimitExceeded
|
18
19
|
from ccxt.base.errors import ExchangeNotAvailable
|
19
20
|
from ccxt.base.errors import InvalidNonce
|
20
|
-
from ccxt.base.errors import AuthenticationError
|
21
21
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
22
22
|
from ccxt.base.precise import Precise
|
23
23
|
|
ccxt/async_support/zonda.py
CHANGED
@@ -9,6 +9,7 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import PermissionDenied
|
13
14
|
from ccxt.base.errors import AccountSuspended
|
14
15
|
from ccxt.base.errors import BadRequest
|
@@ -20,7 +21,6 @@ from ccxt.base.errors import OrderImmediatelyFillable
|
|
20
21
|
from ccxt.base.errors import RateLimitExceeded
|
21
22
|
from ccxt.base.errors import OnMaintenance
|
22
23
|
from ccxt.base.errors import InvalidNonce
|
23
|
-
from ccxt.base.errors import AuthenticationError
|
24
24
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
25
25
|
from ccxt.base.precise import Precise
|
26
26
|
|
ccxt/base/errors.py
CHANGED
@@ -34,6 +34,7 @@ error_hierarchy = {
|
|
34
34
|
},
|
35
35
|
'NotSupported': {},
|
36
36
|
'ProxyError': {},
|
37
|
+
'ExchangeClosedByUser': {},
|
37
38
|
},
|
38
39
|
'OperationFailed': {
|
39
40
|
'NetworkError': {
|
@@ -46,7 +47,6 @@ error_hierarchy = {
|
|
46
47
|
'RequestTimeout': {},
|
47
48
|
},
|
48
49
|
},
|
49
|
-
'ExchangeClosedByUser': {},
|
50
50
|
},
|
51
51
|
}
|
52
52
|
|
@@ -159,6 +159,10 @@ class ProxyError(ExchangeError):
|
|
159
159
|
pass
|
160
160
|
|
161
161
|
|
162
|
+
class ExchangeClosedByUser(ExchangeError):
|
163
|
+
pass
|
164
|
+
|
165
|
+
|
162
166
|
class OperationFailed(BaseError):
|
163
167
|
pass
|
164
168
|
|
@@ -191,10 +195,6 @@ class RequestTimeout(NetworkError):
|
|
191
195
|
pass
|
192
196
|
|
193
197
|
|
194
|
-
class ExchangeClosedByUser(BaseError):
|
195
|
-
pass
|
196
|
-
|
197
|
-
|
198
198
|
__all__ = [
|
199
199
|
'error_hierarchy',
|
200
200
|
'BaseError',
|
@@ -224,6 +224,7 @@ __all__ = [
|
|
224
224
|
'ContractUnavailable',
|
225
225
|
'NotSupported',
|
226
226
|
'ProxyError',
|
227
|
+
'ExchangeClosedByUser',
|
227
228
|
'OperationFailed',
|
228
229
|
'NetworkError',
|
229
230
|
'DDoSProtection',
|
@@ -231,6 +232,5 @@ __all__ = [
|
|
231
232
|
'ExchangeNotAvailable',
|
232
233
|
'OnMaintenance',
|
233
234
|
'InvalidNonce',
|
234
|
-
'RequestTimeout'
|
235
|
-
'ExchangeClosedByUser'
|
235
|
+
'RequestTimeout'
|
236
236
|
]
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.2.
|
7
|
+
__version__ = '4.2.95'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -3225,6 +3225,14 @@ class Exchange(object):
|
|
3225
3225
|
result.append(self.market_id(symbols[i]))
|
3226
3226
|
return result
|
3227
3227
|
|
3228
|
+
def markets_for_symbols(self, symbols: Strings = None):
|
3229
|
+
if symbols is None:
|
3230
|
+
return symbols
|
3231
|
+
result = []
|
3232
|
+
for i in range(0, len(symbols)):
|
3233
|
+
result.append(self.market(symbols[i]))
|
3234
|
+
return result
|
3235
|
+
|
3228
3236
|
def market_symbols(self, symbols: Strings = None, type: Str = None, allowEmpty=True, sameTypeOnly=False, sameSubTypeOnly=False):
|
3229
3237
|
if symbols is None:
|
3230
3238
|
if not allowEmpty:
|
@@ -4369,6 +4377,9 @@ class Exchange(object):
|
|
4369
4377
|
def fetch_option(self, symbol: str, params={}):
|
4370
4378
|
raise NotSupported(self.id + ' fetchOption() is not supported yet')
|
4371
4379
|
|
4380
|
+
def fetch_convert_quote(self, fromCode: str, toCode: str, amount: Num = None, params={}):
|
4381
|
+
raise NotSupported(self.id + ' fetchConvertQuote() is not supported yet')
|
4382
|
+
|
4372
4383
|
def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
4373
4384
|
"""
|
4374
4385
|
fetch history of deposits and withdrawals
|
@@ -4842,6 +4853,9 @@ class Exchange(object):
|
|
4842
4853
|
fees = self.fetch_trading_fees(params)
|
4843
4854
|
return self.safe_dict(fees, symbol)
|
4844
4855
|
|
4856
|
+
def fetch_convert_currencies(self, params={}):
|
4857
|
+
raise NotSupported(self.id + ' fetchConvertCurrencies() is not supported yet')
|
4858
|
+
|
4845
4859
|
def parse_open_interest(self, interest, market: Market = None):
|
4846
4860
|
raise NotSupported(self.id + ' parseOpenInterest() is not supported yet')
|
4847
4861
|
|
@@ -5425,6 +5439,9 @@ class Exchange(object):
|
|
5425
5439
|
def parse_leverage(self, leverage, market: Market = None):
|
5426
5440
|
raise NotSupported(self.id + ' parseLeverage() is not supported yet')
|
5427
5441
|
|
5442
|
+
def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None):
|
5443
|
+
raise NotSupported(self.id + ' parseConversion() is not supported yet')
|
5444
|
+
|
5428
5445
|
def convert_expire_date(self, date: str):
|
5429
5446
|
# parse YYMMDD to datetime string
|
5430
5447
|
year = date[0:2]
|
ccxt/base/types.py
CHANGED
@@ -311,6 +311,19 @@ class Greeks(TypedDict):
|
|
311
311
|
info: Dict[str, Any]
|
312
312
|
|
313
313
|
|
314
|
+
class Conversion(TypedDict):
|
315
|
+
info: Dict[str, Any]
|
316
|
+
timestamp: Int
|
317
|
+
datetime: Str
|
318
|
+
id: Str
|
319
|
+
fromCurrency: Str
|
320
|
+
fromAmount: Num
|
321
|
+
toCurrency: Str
|
322
|
+
toAmount: Num
|
323
|
+
price: Num
|
324
|
+
fee: Num
|
325
|
+
|
326
|
+
|
314
327
|
class Option(TypedDict):
|
315
328
|
info: Dict[str, Any]
|
316
329
|
currency: Str
|
ccxt/bigone.py
CHANGED
@@ -8,6 +8,7 @@ from ccxt.abstract.bigone import ImplicitAPI
|
|
8
8
|
from ccxt.base.types import Balances, Bool, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
|
+
from ccxt.base.errors import AuthenticationError
|
11
12
|
from ccxt.base.errors import PermissionDenied
|
12
13
|
from ccxt.base.errors import ArgumentsRequired
|
13
14
|
from ccxt.base.errors import BadRequest
|
@@ -16,7 +17,6 @@ from ccxt.base.errors import InsufficientFunds
|
|
16
17
|
from ccxt.base.errors import InvalidOrder
|
17
18
|
from ccxt.base.errors import NotSupported
|
18
19
|
from ccxt.base.errors import RateLimitExceeded
|
19
|
-
from ccxt.base.errors import AuthenticationError
|
20
20
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
21
21
|
from ccxt.base.precise import Precise
|
22
22
|
|
ccxt/binance.py
CHANGED
@@ -10,11 +10,13 @@ import json
|
|
10
10
|
from ccxt.base.types import Balances, Currencies, Currency, Greeks, Int, Leverage, Leverages, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
|
+
from ccxt.base.errors import AuthenticationError
|
13
14
|
from ccxt.base.errors import PermissionDenied
|
14
15
|
from ccxt.base.errors import AccountSuspended
|
15
16
|
from ccxt.base.errors import ArgumentsRequired
|
16
17
|
from ccxt.base.errors import BadRequest
|
17
18
|
from ccxt.base.errors import BadSymbol
|
19
|
+
from ccxt.base.errors import OperationRejected
|
18
20
|
from ccxt.base.errors import MarginModeAlreadySet
|
19
21
|
from ccxt.base.errors import BadResponse
|
20
22
|
from ccxt.base.errors import InsufficientFunds
|
@@ -23,14 +25,12 @@ from ccxt.base.errors import OrderNotFound
|
|
23
25
|
from ccxt.base.errors import OrderImmediatelyFillable
|
24
26
|
from ccxt.base.errors import OrderNotFillable
|
25
27
|
from ccxt.base.errors import NotSupported
|
28
|
+
from ccxt.base.errors import OperationFailed
|
26
29
|
from ccxt.base.errors import DDoSProtection
|
27
30
|
from ccxt.base.errors import RateLimitExceeded
|
28
31
|
from ccxt.base.errors import OnMaintenance
|
29
32
|
from ccxt.base.errors import InvalidNonce
|
30
33
|
from ccxt.base.errors import RequestTimeout
|
31
|
-
from ccxt.base.errors import AuthenticationError
|
32
|
-
from ccxt.base.errors import OperationRejected
|
33
|
-
from ccxt.base.errors import OperationFailed
|
34
34
|
from ccxt.base.decimal_to_precision import TRUNCATE
|
35
35
|
from ccxt.base.decimal_to_precision import DECIMAL_PLACES
|
36
36
|
from ccxt.base.precise import Precise
|
@@ -93,6 +93,8 @@ class binance(Exchange, ImplicitAPI):
|
|
93
93
|
'fetchCanceledOrders': 'emulated',
|
94
94
|
'fetchClosedOrder': False,
|
95
95
|
'fetchClosedOrders': 'emulated',
|
96
|
+
'fetchConvertCurrencies': True,
|
97
|
+
'fetchConvertQuote': False,
|
96
98
|
'fetchCrossBorrowRate': True,
|
97
99
|
'fetchCrossBorrowRates': False,
|
98
100
|
'fetchCurrencies': True,
|
@@ -992,6 +994,7 @@ class binance(Exchange, ImplicitAPI):
|
|
992
994
|
},
|
993
995
|
'post': {
|
994
996
|
'order/oco': 0.2,
|
997
|
+
'orderList/oco': 0.2,
|
995
998
|
'sor/order': 0.2,
|
996
999
|
'sor/order/test': 0.2,
|
997
1000
|
'order': 0.2,
|
@@ -4108,10 +4111,13 @@ class binance(Exchange, ImplicitAPI):
|
|
4108
4111
|
'interval': self.safe_string(self.timeframes, timeframe, timeframe),
|
4109
4112
|
'limit': limit,
|
4110
4113
|
}
|
4114
|
+
marketId = market['id']
|
4111
4115
|
if price == 'index':
|
4112
|
-
|
4116
|
+
parts = marketId.split('_')
|
4117
|
+
pair = self.safe_string(parts, 0)
|
4118
|
+
request['pair'] = pair # Index price takes self argument instead of symbol
|
4113
4119
|
else:
|
4114
|
-
request['symbol'] =
|
4120
|
+
request['symbol'] = marketId
|
4115
4121
|
# duration = self.parse_timeframe(timeframe)
|
4116
4122
|
if since is not None:
|
4117
4123
|
request['startTime'] = since
|
@@ -11577,3 +11583,55 @@ class binance(Exchange, ImplicitAPI):
|
|
11577
11583
|
#
|
11578
11584
|
modifications = self.parse_margin_modifications(response)
|
11579
11585
|
return self.filter_by_symbol_since_limit(modifications, symbol, since, limit)
|
11586
|
+
|
11587
|
+
def fetch_convert_currencies(self, params={}) -> Currencies:
|
11588
|
+
"""
|
11589
|
+
fetches all available currencies that can be converted
|
11590
|
+
:see: https://binance-docs.github.io/apidocs/spot/en/#query-order-quantity-precision-per-asset-user_data
|
11591
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
11592
|
+
:returns dict: an associative dictionary of currencies
|
11593
|
+
"""
|
11594
|
+
self.load_markets()
|
11595
|
+
response = self.sapiGetConvertAssetInfo(params)
|
11596
|
+
#
|
11597
|
+
# [
|
11598
|
+
# {
|
11599
|
+
# "asset": "BTC",
|
11600
|
+
# "fraction": 8
|
11601
|
+
# },
|
11602
|
+
# ]
|
11603
|
+
#
|
11604
|
+
result = {}
|
11605
|
+
for i in range(0, len(response)):
|
11606
|
+
entry = response[i]
|
11607
|
+
id = self.safe_string(entry, 'asset')
|
11608
|
+
code = self.safe_currency_code(id)
|
11609
|
+
result[code] = {
|
11610
|
+
'info': entry,
|
11611
|
+
'id': id,
|
11612
|
+
'code': code,
|
11613
|
+
'networks': None,
|
11614
|
+
'type': None,
|
11615
|
+
'name': None,
|
11616
|
+
'active': None,
|
11617
|
+
'deposit': None,
|
11618
|
+
'withdraw': None,
|
11619
|
+
'fee': None,
|
11620
|
+
'precision': self.safe_integer(entry, 'fraction'),
|
11621
|
+
'limits': {
|
11622
|
+
'amount': {
|
11623
|
+
'min': None,
|
11624
|
+
'max': None,
|
11625
|
+
},
|
11626
|
+
'withdraw': {
|
11627
|
+
'min': None,
|
11628
|
+
'max': None,
|
11629
|
+
},
|
11630
|
+
'deposit': {
|
11631
|
+
'min': None,
|
11632
|
+
'max': None,
|
11633
|
+
},
|
11634
|
+
},
|
11635
|
+
'created': None,
|
11636
|
+
}
|
11637
|
+
return result
|
ccxt/bingx.py
CHANGED
@@ -10,6 +10,7 @@ import numbers
|
|
10
10
|
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
|
+
from ccxt.base.errors import AuthenticationError
|
13
14
|
from ccxt.base.errors import PermissionDenied
|
14
15
|
from ccxt.base.errors import AccountSuspended
|
15
16
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -19,7 +20,6 @@ from ccxt.base.errors import InsufficientFunds
|
|
19
20
|
from ccxt.base.errors import OrderNotFound
|
20
21
|
from ccxt.base.errors import NotSupported
|
21
22
|
from ccxt.base.errors import DDoSProtection
|
22
|
-
from ccxt.base.errors import AuthenticationError
|
23
23
|
from ccxt.base.decimal_to_precision import DECIMAL_PLACES
|
24
24
|
from ccxt.base.precise import Precise
|
25
25
|
|
ccxt/bit2c.py
CHANGED
@@ -9,12 +9,12 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import PermissionDenied
|
13
14
|
from ccxt.base.errors import ArgumentsRequired
|
14
15
|
from ccxt.base.errors import OrderNotFound
|
15
16
|
from ccxt.base.errors import NotSupported
|
16
17
|
from ccxt.base.errors import InvalidNonce
|
17
|
-
from ccxt.base.errors import AuthenticationError
|
18
18
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
19
19
|
from ccxt.base.precise import Precise
|
20
20
|
|
ccxt/bitbank.py
CHANGED
@@ -9,12 +9,12 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import PermissionDenied
|
13
14
|
from ccxt.base.errors import InsufficientFunds
|
14
15
|
from ccxt.base.errors import InvalidOrder
|
15
16
|
from ccxt.base.errors import OrderNotFound
|
16
17
|
from ccxt.base.errors import InvalidNonce
|
17
|
-
from ccxt.base.errors import AuthenticationError
|
18
18
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
19
19
|
|
20
20
|
|
ccxt/bitfinex.py
CHANGED
@@ -9,6 +9,7 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import PermissionDenied
|
13
14
|
from ccxt.base.errors import ArgumentsRequired
|
14
15
|
from ccxt.base.errors import BadSymbol
|
@@ -19,7 +20,6 @@ from ccxt.base.errors import NotSupported
|
|
19
20
|
from ccxt.base.errors import RateLimitExceeded
|
20
21
|
from ccxt.base.errors import ExchangeNotAvailable
|
21
22
|
from ccxt.base.errors import InvalidNonce
|
22
|
-
from ccxt.base.errors import AuthenticationError
|
23
23
|
from ccxt.base.decimal_to_precision import ROUND
|
24
24
|
from ccxt.base.decimal_to_precision import TRUNCATE
|
25
25
|
from ccxt.base.decimal_to_precision import DECIMAL_PLACES
|
ccxt/bitfinex2.py
CHANGED
@@ -9,6 +9,7 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import PermissionDenied
|
13
14
|
from ccxt.base.errors import ArgumentsRequired
|
14
15
|
from ccxt.base.errors import BadRequest
|
@@ -22,7 +23,6 @@ from ccxt.base.errors import RateLimitExceeded
|
|
22
23
|
from ccxt.base.errors import ExchangeNotAvailable
|
23
24
|
from ccxt.base.errors import OnMaintenance
|
24
25
|
from ccxt.base.errors import InvalidNonce
|
25
|
-
from ccxt.base.errors import AuthenticationError
|
26
26
|
from ccxt.base.decimal_to_precision import ROUND
|
27
27
|
from ccxt.base.decimal_to_precision import TRUNCATE
|
28
28
|
from ccxt.base.decimal_to_precision import DECIMAL_PLACES
|