ccxt 4.4.57__py2.py3-none-any.whl → 4.4.59__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -3
- ccxt/abstract/xt.py +1 -0
- ccxt/ace.py +2 -2
- ccxt/alpaca.py +4 -4
- ccxt/ascendex.py +5 -3
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/ace.py +2 -2
- ccxt/async_support/alpaca.py +4 -4
- ccxt/async_support/ascendex.py +5 -3
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bequant.py +2 -1
- ccxt/async_support/bigone.py +5 -5
- ccxt/async_support/binance.py +22 -6
- ccxt/async_support/binancecoinm.py +2 -1
- ccxt/async_support/binanceus.py +2 -1
- ccxt/async_support/binanceusdm.py +2 -1
- ccxt/async_support/bingx.py +3 -3
- ccxt/async_support/bit2c.py +9 -9
- ccxt/async_support/bitbank.py +2 -2
- ccxt/async_support/bitbns.py +2 -2
- ccxt/async_support/bitcoincom.py +2 -1
- ccxt/async_support/bitfinex.py +2 -2
- ccxt/async_support/bitfinex1.py +2 -2
- ccxt/async_support/bitflyer.py +2 -2
- ccxt/async_support/bitget.py +8 -3
- ccxt/async_support/bithumb.py +2 -2
- ccxt/async_support/bitmart.py +150 -89
- ccxt/async_support/bitmex.py +2 -2
- ccxt/async_support/bitopro.py +2 -2
- ccxt/async_support/bitpanda.py +2 -1
- ccxt/async_support/bitrue.py +3 -3
- ccxt/async_support/bitso.py +2 -2
- ccxt/async_support/bitstamp.py +2 -2
- ccxt/async_support/bitteam.py +2 -2
- ccxt/async_support/bitvavo.py +3 -3
- ccxt/async_support/bl3p.py +2 -2
- ccxt/async_support/blockchaincom.py +2 -2
- ccxt/async_support/blofin.py +3 -4
- ccxt/async_support/btcalpha.py +2 -2
- ccxt/async_support/btcbox.py +2 -2
- ccxt/async_support/btcmarkets.py +3 -3
- ccxt/async_support/btcturk.py +2 -2
- ccxt/async_support/bybit.py +17 -6
- ccxt/async_support/cex.py +3 -3
- ccxt/async_support/coinbase.py +12 -5
- ccxt/async_support/coinbaseadvanced.py +2 -1
- ccxt/async_support/coinbaseexchange.py +3 -3
- ccxt/async_support/coinbaseinternational.py +3 -4
- ccxt/async_support/coincatch.py +3 -3
- ccxt/async_support/coincheck.py +2 -2
- ccxt/async_support/coinex.py +3 -3
- ccxt/async_support/coinlist.py +3 -3
- ccxt/async_support/coinmate.py +2 -2
- ccxt/async_support/coinmetro.py +2 -2
- ccxt/async_support/coinone.py +2 -2
- ccxt/async_support/coinsph.py +3 -3
- ccxt/async_support/coinspot.py +2 -2
- ccxt/async_support/cryptocom.py +2 -2
- ccxt/async_support/currencycom.py +3 -3
- ccxt/async_support/defx.py +3 -3
- ccxt/async_support/delta.py +3 -3
- ccxt/async_support/deribit.py +3 -3
- ccxt/async_support/digifinex.py +3 -3
- ccxt/async_support/ellipx.py +1 -1
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/fmfwio.py +2 -1
- ccxt/async_support/gate.py +3 -3
- ccxt/async_support/gateio.py +2 -1
- ccxt/async_support/gemini.py +2 -2
- ccxt/async_support/hashkey.py +2 -2
- ccxt/async_support/hitbtc.py +3 -3
- ccxt/async_support/hollaex.py +2 -2
- ccxt/async_support/htx.py +3 -3
- ccxt/async_support/huobi.py +2 -1
- ccxt/async_support/huobijp.py +3 -3
- ccxt/async_support/hyperliquid.py +91 -6
- ccxt/async_support/idex.py +3 -3
- ccxt/async_support/independentreserve.py +2 -2
- ccxt/async_support/indodax.py +3 -3
- ccxt/async_support/kraken.py +3 -3
- ccxt/async_support/krakenfutures.py +2 -2
- ccxt/async_support/kucoin.py +3 -3
- ccxt/async_support/kucoinfutures.py +3 -3
- ccxt/async_support/kuna.py +3 -3
- ccxt/async_support/latoken.py +3 -3
- ccxt/async_support/lbank.py +3 -3
- ccxt/async_support/luno.py +2 -2
- ccxt/async_support/mercado.py +2 -2
- ccxt/async_support/mexc.py +3 -3
- ccxt/async_support/myokx.py +2 -1
- ccxt/async_support/ndax.py +2 -2
- ccxt/async_support/novadax.py +3 -3
- ccxt/async_support/oceanex.py +3 -3
- ccxt/async_support/okcoin.py +3 -3
- ccxt/async_support/okx.py +3 -4
- ccxt/async_support/onetrading.py +3 -3
- ccxt/async_support/oxfun.py +2 -2
- ccxt/async_support/p2b.py +2 -2
- ccxt/async_support/paradex.py +3 -3
- ccxt/async_support/paymium.py +2 -2
- ccxt/async_support/phemex.py +2 -2
- ccxt/async_support/poloniex.py +3 -3
- ccxt/async_support/poloniexfutures.py +3 -3
- ccxt/async_support/probit.py +3 -3
- ccxt/async_support/timex.py +15 -5
- ccxt/async_support/tokocrypto.py +3 -3
- ccxt/async_support/tradeogre.py +2 -2
- ccxt/async_support/upbit.py +2 -2
- ccxt/async_support/vertex.py +5 -5
- ccxt/async_support/wavesexchange.py +2 -3
- ccxt/async_support/whitebit.py +5 -4
- ccxt/async_support/woo.py +3 -4
- ccxt/async_support/woofipro.py +3 -4
- ccxt/async_support/xt.py +57 -4
- ccxt/async_support/yobit.py +2 -2
- ccxt/async_support/zaif.py +2 -2
- ccxt/async_support/zonda.py +2 -2
- ccxt/base/exchange.py +5 -4
- ccxt/bequant.py +2 -1
- ccxt/bigone.py +5 -5
- ccxt/binance.py +22 -6
- ccxt/binancecoinm.py +2 -1
- ccxt/binanceus.py +2 -1
- ccxt/binanceusdm.py +2 -1
- ccxt/bingx.py +3 -3
- ccxt/bit2c.py +9 -9
- ccxt/bitbank.py +2 -2
- ccxt/bitbns.py +2 -2
- ccxt/bitcoincom.py +2 -1
- ccxt/bitfinex.py +2 -2
- ccxt/bitfinex1.py +2 -2
- ccxt/bitflyer.py +2 -2
- ccxt/bitget.py +8 -3
- ccxt/bithumb.py +2 -2
- ccxt/bitmart.py +150 -89
- ccxt/bitmex.py +2 -2
- ccxt/bitopro.py +2 -2
- ccxt/bitpanda.py +2 -1
- ccxt/bitrue.py +3 -3
- ccxt/bitso.py +2 -2
- ccxt/bitstamp.py +2 -2
- ccxt/bitteam.py +2 -2
- ccxt/bitvavo.py +3 -3
- ccxt/bl3p.py +2 -2
- ccxt/blockchaincom.py +2 -2
- ccxt/blofin.py +3 -4
- ccxt/btcalpha.py +2 -2
- ccxt/btcbox.py +2 -2
- ccxt/btcmarkets.py +3 -3
- ccxt/btcturk.py +2 -2
- ccxt/bybit.py +17 -6
- ccxt/cex.py +3 -3
- ccxt/coinbase.py +12 -5
- ccxt/coinbaseadvanced.py +2 -1
- ccxt/coinbaseexchange.py +3 -3
- ccxt/coinbaseinternational.py +3 -4
- ccxt/coincatch.py +3 -3
- ccxt/coincheck.py +2 -2
- ccxt/coinex.py +3 -3
- ccxt/coinlist.py +3 -3
- ccxt/coinmate.py +2 -2
- ccxt/coinmetro.py +2 -2
- ccxt/coinone.py +2 -2
- ccxt/coinsph.py +3 -3
- ccxt/coinspot.py +2 -2
- ccxt/cryptocom.py +2 -2
- ccxt/currencycom.py +3 -3
- ccxt/defx.py +3 -3
- ccxt/delta.py +3 -3
- ccxt/deribit.py +3 -3
- ccxt/digifinex.py +3 -3
- ccxt/ellipx.py +1 -1
- ccxt/exmo.py +2 -2
- ccxt/fmfwio.py +2 -1
- ccxt/gate.py +3 -3
- ccxt/gateio.py +2 -1
- ccxt/gemini.py +2 -2
- ccxt/hashkey.py +2 -2
- ccxt/hitbtc.py +3 -3
- ccxt/hollaex.py +2 -2
- ccxt/htx.py +3 -3
- ccxt/huobi.py +2 -1
- ccxt/huobijp.py +3 -3
- ccxt/hyperliquid.py +91 -6
- ccxt/idex.py +3 -3
- ccxt/independentreserve.py +2 -2
- ccxt/indodax.py +3 -3
- ccxt/kraken.py +3 -3
- ccxt/krakenfutures.py +2 -2
- ccxt/kucoin.py +3 -3
- ccxt/kucoinfutures.py +3 -3
- ccxt/kuna.py +3 -3
- ccxt/latoken.py +3 -3
- ccxt/lbank.py +3 -3
- ccxt/luno.py +2 -2
- ccxt/mercado.py +2 -2
- ccxt/mexc.py +3 -3
- ccxt/myokx.py +2 -1
- ccxt/ndax.py +2 -2
- ccxt/novadax.py +3 -3
- ccxt/oceanex.py +3 -3
- ccxt/okcoin.py +3 -3
- ccxt/okx.py +3 -4
- ccxt/onetrading.py +3 -3
- ccxt/oxfun.py +2 -2
- ccxt/p2b.py +2 -2
- ccxt/paradex.py +3 -3
- ccxt/paymium.py +2 -2
- ccxt/phemex.py +2 -2
- ccxt/poloniex.py +3 -3
- ccxt/poloniexfutures.py +3 -3
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/alpaca.py +2 -2
- ccxt/pro/ascendex.py +2 -2
- ccxt/pro/bequant.py +2 -1
- ccxt/pro/binance.py +2 -3
- ccxt/pro/binancecoinm.py +2 -1
- ccxt/pro/binanceus.py +3 -2
- ccxt/pro/binanceusdm.py +2 -1
- ccxt/pro/bingx.py +2 -2
- ccxt/pro/bitcoincom.py +2 -1
- ccxt/pro/bitfinex.py +2 -2
- ccxt/pro/bitfinex1.py +2 -2
- ccxt/pro/bitget.py +2 -3
- ccxt/pro/bithumb.py +2 -2
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitmex.py +2 -2
- ccxt/pro/bitopro.py +2 -2
- ccxt/pro/bitpanda.py +2 -1
- ccxt/pro/bitrue.py +2 -2
- ccxt/pro/bitstamp.py +2 -2
- ccxt/pro/bitvavo.py +2 -2
- ccxt/pro/blockchaincom.py +2 -2
- ccxt/pro/blofin.py +1 -1
- ccxt/pro/bybit.py +6 -4
- ccxt/pro/cex.py +2 -2
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinbaseadvanced.py +2 -1
- ccxt/pro/coinbaseexchange.py +2 -2
- ccxt/pro/coinbaseinternational.py +2 -2
- ccxt/pro/coincatch.py +2 -3
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/coinone.py +2 -2
- ccxt/pro/cryptocom.py +2 -3
- ccxt/pro/currencycom.py +2 -2
- ccxt/pro/defx.py +2 -3
- ccxt/pro/deribit.py +2 -2
- ccxt/pro/exmo.py +2 -2
- ccxt/pro/gate.py +2 -3
- ccxt/pro/gateio.py +2 -1
- ccxt/pro/gemini.py +2 -2
- ccxt/pro/hashkey.py +2 -2
- ccxt/pro/hitbtc.py +2 -2
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/htx.py +2 -2
- ccxt/pro/huobi.py +2 -1
- ccxt/pro/huobijp.py +2 -2
- ccxt/pro/hyperliquid.py +2 -3
- ccxt/pro/idex.py +2 -2
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +2 -2
- ccxt/pro/krakenfutures.py +2 -2
- ccxt/pro/kucoin.py +2 -3
- ccxt/pro/kucoinfutures.py +2 -3
- ccxt/pro/lbank.py +2 -2
- ccxt/pro/luno.py +2 -2
- ccxt/pro/mexc.py +5 -3
- ccxt/pro/myokx.py +2 -1
- ccxt/pro/ndax.py +2 -2
- ccxt/pro/okcoin.py +2 -2
- ccxt/pro/okx.py +2 -3
- ccxt/pro/onetrading.py +2 -2
- ccxt/pro/oxfun.py +2 -2
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/paradex.py +2 -2
- ccxt/pro/phemex.py +2 -2
- ccxt/pro/poloniex.py +2 -2
- ccxt/pro/poloniexfutures.py +2 -2
- ccxt/pro/probit.py +2 -2
- ccxt/pro/upbit.py +2 -2
- ccxt/pro/vertex.py +2 -2
- ccxt/pro/wazirx.py +2 -2
- ccxt/pro/whitebit.py +2 -2
- ccxt/pro/woo.py +2 -2
- ccxt/pro/woofipro.py +2 -2
- ccxt/pro/xt.py +2 -2
- ccxt/probit.py +3 -3
- ccxt/test/tests_init.py +2 -2
- ccxt/timex.py +15 -5
- ccxt/tokocrypto.py +3 -3
- ccxt/tradeogre.py +2 -2
- ccxt/upbit.py +2 -2
- ccxt/vertex.py +5 -5
- ccxt/wavesexchange.py +2 -3
- ccxt/whitebit.py +5 -4
- ccxt/woo.py +3 -4
- ccxt/woofipro.py +3 -4
- ccxt/xt.py +57 -4
- ccxt/yobit.py +2 -2
- ccxt/zaif.py +2 -2
- ccxt/zonda.py +2 -2
- {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/METADATA +30 -33
- {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/RECORD +307 -310
- ccxt/abstract/wazirx.py +0 -30
- ccxt/async_support/wazirx.py +0 -1336
- ccxt/wazirx.py +0 -1336
- {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/WHEEL +0 -0
- {ccxt-4.4.57.dist-info → ccxt-4.4.59.dist-info}/top_level.txt +0 -0
ccxt/async_support/tradeogre.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.tradeogre import ImplicitAPI
|
8
|
-
from ccxt.base.types import IndexType, Int, Market, Num, Order, OrderSide, OrderType, Str, Ticker
|
8
|
+
from ccxt.base.types import Any, IndexType, Int, Market, Num, Order, OrderSide, OrderType, Str, Ticker
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -17,7 +17,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
17
17
|
|
18
18
|
class tradeogre(Exchange, ImplicitAPI):
|
19
19
|
|
20
|
-
def describe(self):
|
20
|
+
def describe(self) -> Any:
|
21
21
|
return self.deep_extend(super(tradeogre, self).describe(), {
|
22
22
|
'id': 'tradeogre',
|
23
23
|
'name': 'tradeogre',
|
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 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, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -22,7 +22,7 @@ from ccxt.base.precise import Precise
|
|
22
22
|
|
23
23
|
class upbit(Exchange, ImplicitAPI):
|
24
24
|
|
25
|
-
def describe(self):
|
25
|
+
def describe(self) -> Any:
|
26
26
|
return self.deep_extend(super(upbit, self).describe(), {
|
27
27
|
'id': 'upbit',
|
28
28
|
'name': 'Upbit',
|
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 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, 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
|
@@ -22,7 +22,7 @@ from ccxt.base.precise import Precise
|
|
22
22
|
|
23
23
|
class vertex(Exchange, ImplicitAPI):
|
24
24
|
|
25
|
-
def describe(self):
|
25
|
+
def describe(self) -> Any:
|
26
26
|
return self.deep_extend(super(vertex, self).describe(), {
|
27
27
|
'id': 'vertex',
|
28
28
|
'name': 'Vertex',
|
@@ -622,7 +622,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
622
622
|
result.append(self.parse_market(rawMarket))
|
623
623
|
return result
|
624
624
|
|
625
|
-
async def fetch_time(self, params={}):
|
625
|
+
async def fetch_time(self, params={}) -> Int:
|
626
626
|
"""
|
627
627
|
fetches the current integer timestamp in milliseconds from the exchange server
|
628
628
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -630,7 +630,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
630
630
|
"""
|
631
631
|
response = await self.v1GatewayGetTime(params)
|
632
632
|
# 1717481623452
|
633
|
-
return self.
|
633
|
+
return self.parse_to_int(response)
|
634
634
|
|
635
635
|
async def fetch_status(self, params={}):
|
636
636
|
"""
|
@@ -1523,7 +1523,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
1523
1523
|
marketId = base + '/' + quote
|
1524
1524
|
if base.find('PERP') > 0:
|
1525
1525
|
marketId = marketId.replace('-PERP', '') + ':USDC'
|
1526
|
-
market = self.
|
1526
|
+
market = self.safe_market(marketId, market)
|
1527
1527
|
last = self.safe_string(ticker, 'last_price')
|
1528
1528
|
return self.safe_ticker({
|
1529
1529
|
'symbol': market['symbol'],
|
@@ -7,9 +7,8 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.wavesexchange import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Any, Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
|
-
from typing import Any
|
13
12
|
from ccxt.base.errors import ExchangeError
|
14
13
|
from ccxt.base.errors import AuthenticationError
|
15
14
|
from ccxt.base.errors import AccountSuspended
|
@@ -27,7 +26,7 @@ from ccxt.base.precise import Precise
|
|
27
26
|
|
28
27
|
class wavesexchange(Exchange, ImplicitAPI):
|
29
28
|
|
30
|
-
def describe(self):
|
29
|
+
def describe(self) -> Any:
|
31
30
|
return self.deep_extend(super(wavesexchange, self).describe(), {
|
32
31
|
'id': 'wavesexchange',
|
33
32
|
'name': 'Waves.Exchange',
|
ccxt/async_support/whitebit.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.whitebit import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, BorrowInterest, Bool, Currencies, Currency, DepositAddress, Int, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, BorrowInterest, Bool, Currencies, Currency, DepositAddress, Int, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, 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
|
@@ -26,7 +26,7 @@ from ccxt.base.precise import Precise
|
|
26
26
|
|
27
27
|
class whitebit(Exchange, ImplicitAPI):
|
28
28
|
|
29
|
-
def describe(self):
|
29
|
+
def describe(self) -> Any:
|
30
30
|
return self.deep_extend(super(whitebit, self).describe(), {
|
31
31
|
'id': 'whitebit',
|
32
32
|
'name': 'WhiteBit',
|
@@ -1291,7 +1291,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1291
1291
|
'info': response,
|
1292
1292
|
}
|
1293
1293
|
|
1294
|
-
async def fetch_time(self, params={}):
|
1294
|
+
async def fetch_time(self, params={}) -> Int:
|
1295
1295
|
"""
|
1296
1296
|
fetches the current integer timestamp in milliseconds from the exchange server
|
1297
1297
|
|
@@ -2626,12 +2626,13 @@ class whitebit(Exchange, ImplicitAPI):
|
|
2626
2626
|
# For cases where we have a meaningful status
|
2627
2627
|
# {"response":null,"status":422,"errors":{"orderId":["Finished order id 435453454535 not found on your account"]},"notification":null,"warning":"Finished order id 435453454535 not found on your account","_token":null}
|
2628
2628
|
status = self.safe_string(response, 'status')
|
2629
|
+
errors = self.safe_value(response, 'errors')
|
2629
2630
|
# {"code":10,"message":"Unauthorized request."}
|
2630
2631
|
message = self.safe_string(response, 'message')
|
2631
2632
|
# For these cases where we have a generic code variable error key
|
2632
2633
|
# {"code":0,"message":"Validation failed","errors":{"amount":["Amount must be greater than 0"]}}
|
2633
2634
|
codeNew = self.safe_integer(response, 'code')
|
2634
|
-
hasErrorStatus = status is not None and status != '200'
|
2635
|
+
hasErrorStatus = status is not None and status != '200' and errors is not None
|
2635
2636
|
if hasErrorStatus or codeNew is not None:
|
2636
2637
|
feedback = self.id + ' ' + body
|
2637
2638
|
errorInfo = message
|
ccxt/async_support/woo.py
CHANGED
@@ -6,9 +6,8 @@
|
|
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, 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, Str, Strings, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
|
-
from typing import Any
|
12
11
|
from ccxt.base.errors import ExchangeError
|
13
12
|
from ccxt.base.errors import AuthenticationError
|
14
13
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -24,7 +23,7 @@ from ccxt.base.precise import Precise
|
|
24
23
|
|
25
24
|
class woo(Exchange, ImplicitAPI):
|
26
25
|
|
27
|
-
def describe(self):
|
26
|
+
def describe(self) -> Any:
|
28
27
|
return self.deep_extend(super(woo, self).describe(), {
|
29
28
|
'id': 'woo',
|
30
29
|
'name': 'WOO X',
|
@@ -484,7 +483,7 @@ class woo(Exchange, ImplicitAPI):
|
|
484
483
|
'info': response,
|
485
484
|
}
|
486
485
|
|
487
|
-
async def fetch_time(self, params={}):
|
486
|
+
async def fetch_time(self, params={}) -> Int:
|
488
487
|
"""
|
489
488
|
fetches the current integer timestamp in milliseconds from the exchange server
|
490
489
|
|
ccxt/async_support/woofipro.py
CHANGED
@@ -5,9 +5,8 @@
|
|
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 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, Str, Strings, FundingRate, FundingRates, Trade, TradingFees, Transaction
|
9
9
|
from typing import List
|
10
|
-
from typing import Any
|
11
10
|
from ccxt.base.errors import ExchangeError
|
12
11
|
from ccxt.base.errors import AuthenticationError
|
13
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -23,7 +22,7 @@ from ccxt.base.precise import Precise
|
|
23
22
|
|
24
23
|
class woofipro(Exchange, ImplicitAPI):
|
25
24
|
|
26
|
-
def describe(self):
|
25
|
+
def describe(self) -> Any:
|
27
26
|
return self.deep_extend(super(woofipro, self).describe(), {
|
28
27
|
'id': 'woofipro',
|
29
28
|
'name': 'WOOFI PRO',
|
@@ -471,7 +470,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
471
470
|
'info': response,
|
472
471
|
}
|
473
472
|
|
474
|
-
async def fetch_time(self, params={}):
|
473
|
+
async def fetch_time(self, params={}) -> Int:
|
475
474
|
"""
|
476
475
|
fetches the current integer timestamp in milliseconds from the exchange server
|
477
476
|
|
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 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, 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
|
@@ -28,7 +28,7 @@ from ccxt.base.precise import Precise
|
|
28
28
|
|
29
29
|
class xt(Exchange, ImplicitAPI):
|
30
30
|
|
31
|
-
def describe(self):
|
31
|
+
def describe(self) -> Any:
|
32
32
|
return self.deep_extend(super(xt, self).describe(), {
|
33
33
|
'id': 'xt',
|
34
34
|
'name': 'XT',
|
@@ -129,7 +129,7 @@ class xt(Exchange, ImplicitAPI):
|
|
129
129
|
'repayMargin': False,
|
130
130
|
'setLeverage': True,
|
131
131
|
'setMargin': False,
|
132
|
-
'setMarginMode':
|
132
|
+
'setMarginMode': True,
|
133
133
|
'setPositionMode': False,
|
134
134
|
'signIn': False,
|
135
135
|
'transfer': True,
|
@@ -287,6 +287,7 @@ class xt(Exchange, ImplicitAPI):
|
|
287
287
|
'future/user/v1/position/margin': 1,
|
288
288
|
'future/user/v1/user/collection/add': 1,
|
289
289
|
'future/user/v1/user/collection/cancel': 1,
|
290
|
+
'future/user/v1/position/change-type': 1,
|
290
291
|
},
|
291
292
|
},
|
292
293
|
'inverse': {
|
@@ -532,10 +533,12 @@ class xt(Exchange, ImplicitAPI):
|
|
532
533
|
'TRANSFER_012': PermissionDenied, # Currency transfer prohibited
|
533
534
|
'symbol_not_support_trading_via_api': BadSymbol, # {"returnCode":1,"msgInfo":"failure","error":{"code":"symbol_not_support_trading_via_api","msg":"The symbol does not support trading via API"},"result":null}
|
534
535
|
'open_order_min_nominal_value_limit': InvalidOrder, # {"returnCode":1,"msgInfo":"failure","error":{"code":"open_order_min_nominal_value_limit","msg":"Exceeds the minimum notional value of a single order"},"result":null}
|
536
|
+
'insufficient_balance': InsufficientFunds,
|
535
537
|
},
|
536
538
|
'broad': {
|
537
539
|
'The symbol does not support trading via API': BadSymbol, # {"returnCode":1,"msgInfo":"failure","error":{"code":"symbol_not_support_trading_via_api","msg":"The symbol does not support trading via API"},"result":null}
|
538
540
|
'Exceeds the minimum notional value of a single order': InvalidOrder, # {"returnCode":1,"msgInfo":"failure","error":{"code":"open_order_min_nominal_value_limit","msg":"Exceeds the minimum notional value of a single order"},"result":null}
|
541
|
+
'insufficient balance': InsufficientFunds,
|
539
542
|
},
|
540
543
|
},
|
541
544
|
'timeframes': {
|
@@ -810,7 +813,7 @@ class xt(Exchange, ImplicitAPI):
|
|
810
813
|
def nonce(self):
|
811
814
|
return self.milliseconds() - self.options['timeDifference']
|
812
815
|
|
813
|
-
async def fetch_time(self, params={}):
|
816
|
+
async def fetch_time(self, params={}) -> Int:
|
814
817
|
"""
|
815
818
|
fetches the current integer timestamp in milliseconds from the xt server
|
816
819
|
|
@@ -4617,6 +4620,53 @@ class xt(Exchange, ImplicitAPI):
|
|
4617
4620
|
'status': None,
|
4618
4621
|
}
|
4619
4622
|
|
4623
|
+
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
4624
|
+
"""
|
4625
|
+
set margin mode to 'cross' or 'isolated'
|
4626
|
+
|
4627
|
+
https://doc.xt.com/#futures_userchangePositionType
|
4628
|
+
|
4629
|
+
:param str marginMode: 'cross' or 'isolated'
|
4630
|
+
:param str [symbol]: required
|
4631
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4632
|
+
:param str [params.positionSide]: *required* "long" or "short"
|
4633
|
+
:returns dict: response from the exchange
|
4634
|
+
"""
|
4635
|
+
if symbol is None:
|
4636
|
+
raise ArgumentsRequired(self.id + ' setMarginMode() requires a symbol argument')
|
4637
|
+
await self.load_markets()
|
4638
|
+
market = self.market(symbol)
|
4639
|
+
if market['spot']:
|
4640
|
+
raise BadSymbol(self.id + ' setMarginMode() supports contract markets only')
|
4641
|
+
marginMode = marginMode.lower()
|
4642
|
+
if marginMode != 'isolated' and marginMode != 'cross':
|
4643
|
+
raise BadRequest(self.id + ' setMarginMode() marginMode argument should be isolated or cross')
|
4644
|
+
if marginMode == 'cross':
|
4645
|
+
marginMode = 'CROSSED'
|
4646
|
+
else:
|
4647
|
+
marginMode = 'ISOLATED'
|
4648
|
+
posSide = self.safe_string_upper(params, 'positionSide')
|
4649
|
+
if posSide is None:
|
4650
|
+
raise ArgumentsRequired(self.id + ' setMarginMode() requires a positionSide parameter, either "LONG" or "SHORT"')
|
4651
|
+
request: dict = {
|
4652
|
+
'positionType': marginMode,
|
4653
|
+
'positionSide': posSide,
|
4654
|
+
'symbol': market['id'],
|
4655
|
+
}
|
4656
|
+
response = await self.privateLinearPostFutureUserV1PositionChangeType(self.extend(request, params))
|
4657
|
+
#
|
4658
|
+
# {
|
4659
|
+
# "error": {
|
4660
|
+
# "code": "",
|
4661
|
+
# "msg": ""
|
4662
|
+
# },
|
4663
|
+
# "msgInfo": "",
|
4664
|
+
# "result": {},
|
4665
|
+
# "returnCode": 0
|
4666
|
+
# }
|
4667
|
+
#
|
4668
|
+
return response # unify return type
|
4669
|
+
|
4620
4670
|
def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
4621
4671
|
#
|
4622
4672
|
# spot: error
|
@@ -4667,6 +4717,9 @@ class xt(Exchange, ImplicitAPI):
|
|
4667
4717
|
# "result": {}
|
4668
4718
|
# }
|
4669
4719
|
#
|
4720
|
+
# {"returnCode":1,"msgInfo":"failure","error":{"code":"insufficient_balance","msg":"insufficient balance","args":[]},"result":null}
|
4721
|
+
#
|
4722
|
+
#
|
4670
4723
|
status = self.safe_string_upper_2(response, 'msgInfo', 'mc')
|
4671
4724
|
if status is not None and status != 'SUCCESS':
|
4672
4725
|
feedback = self.id + ' ' + body
|
ccxt/async_support/yobit.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.yobit import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, OrderBooks, Trade, TradingFees, Transaction
|
10
|
+
from ccxt.base.types import Any, Balances, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, OrderBooks, Trade, TradingFees, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -25,7 +25,7 @@ from ccxt.base.precise import Precise
|
|
25
25
|
|
26
26
|
class yobit(Exchange, ImplicitAPI):
|
27
27
|
|
28
|
-
def describe(self):
|
28
|
+
def describe(self) -> Any:
|
29
29
|
return self.deep_extend(super(yobit, self).describe(), {
|
30
30
|
'id': 'yobit',
|
31
31
|
'name': 'YoBit',
|
ccxt/async_support/zaif.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.zaif import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction
|
9
|
+
from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import BadRequest
|
@@ -16,7 +16,7 @@ from ccxt.base.precise import Precise
|
|
16
16
|
|
17
17
|
class zaif(Exchange, ImplicitAPI):
|
18
18
|
|
19
|
-
def describe(self):
|
19
|
+
def describe(self) -> Any:
|
20
20
|
return self.deep_extend(super(zaif, self).describe(), {
|
21
21
|
'id': 'zaif',
|
22
22
|
'name': 'Zaif',
|
ccxt/async_support/zonda.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.zonda import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currency, DepositAddress, Int, LedgerEntry, 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
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -27,7 +27,7 @@ from ccxt.base.precise import Precise
|
|
27
27
|
|
28
28
|
class zonda(Exchange, ImplicitAPI):
|
29
29
|
|
30
|
-
def describe(self):
|
30
|
+
def describe(self) -> Any:
|
31
31
|
return self.deep_extend(super(zonda, self).describe(), {
|
32
32
|
'id': 'zonda',
|
33
33
|
'name': 'Zonda',
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.59'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -1791,7 +1791,7 @@ class Exchange(object):
|
|
1791
1791
|
|
1792
1792
|
# METHODS BELOW THIS LINE ARE TRANSPILED FROM JAVASCRIPT TO PYTHON AND PHP
|
1793
1793
|
|
1794
|
-
def describe(self):
|
1794
|
+
def describe(self) -> Any:
|
1795
1795
|
return {
|
1796
1796
|
'id': None,
|
1797
1797
|
'name': None,
|
@@ -3657,7 +3657,7 @@ class Exchange(object):
|
|
3657
3657
|
change = self.omit_zero(self.safe_string(ticker, 'change'))
|
3658
3658
|
percentage = self.omit_zero(self.safe_string(ticker, 'percentage'))
|
3659
3659
|
average = self.omit_zero(self.safe_string(ticker, 'average'))
|
3660
|
-
vwap = self.
|
3660
|
+
vwap = self.safe_string(ticker, 'vwap')
|
3661
3661
|
baseVolume = self.safe_string(ticker, 'baseVolume')
|
3662
3662
|
quoteVolume = self.safe_string(ticker, 'quoteVolume')
|
3663
3663
|
if vwap is None:
|
@@ -6118,7 +6118,8 @@ class Exchange(object):
|
|
6118
6118
|
parsed = self.parse_income(entry, market)
|
6119
6119
|
result.append(parsed)
|
6120
6120
|
sorted = self.sort_by(result, 'timestamp')
|
6121
|
-
|
6121
|
+
symbol = self.safe_string(market, 'symbol')
|
6122
|
+
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
6122
6123
|
|
6123
6124
|
def get_market_from_symbols(self, symbols: Strings = None):
|
6124
6125
|
if symbols is None:
|
ccxt/bequant.py
CHANGED
@@ -5,11 +5,12 @@
|
|
5
5
|
|
6
6
|
from ccxt.hitbtc import hitbtc
|
7
7
|
from ccxt.abstract.bequant import ImplicitAPI
|
8
|
+
from ccxt.base.types import Any
|
8
9
|
|
9
10
|
|
10
11
|
class bequant(hitbtc, ImplicitAPI):
|
11
12
|
|
12
|
-
def describe(self):
|
13
|
+
def describe(self) -> Any:
|
13
14
|
return self.deep_extend(super(bequant, self).describe(), {
|
14
15
|
'id': 'bequant',
|
15
16
|
'name': 'Bequant',
|
ccxt/bigone.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bigone import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Bool, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
8
|
+
from ccxt.base.types import Any, Balances, Bool, Currencies, Currency, DepositAddress, 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
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -23,7 +23,7 @@ from ccxt.base.precise import Precise
|
|
23
23
|
|
24
24
|
class bigone(Exchange, ImplicitAPI):
|
25
25
|
|
26
|
-
def describe(self):
|
26
|
+
def describe(self) -> Any:
|
27
27
|
return self.deep_extend(super(bigone, self).describe(), {
|
28
28
|
'id': 'bigone',
|
29
29
|
'name': 'BigONE',
|
@@ -964,7 +964,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
964
964
|
tickers = self.parse_tickers(data, symbols)
|
965
965
|
return self.filter_by_array_tickers(tickers, 'symbol', symbols)
|
966
966
|
|
967
|
-
def fetch_time(self, params={}):
|
967
|
+
def fetch_time(self, params={}) -> Int:
|
968
968
|
"""
|
969
969
|
fetches the current integer timestamp in milliseconds from the exchange server
|
970
970
|
|
@@ -1162,8 +1162,8 @@ class bigone(Exchange, ImplicitAPI):
|
|
1162
1162
|
'cost': None,
|
1163
1163
|
'info': trade,
|
1164
1164
|
}
|
1165
|
-
makerCurrencyCode
|
1166
|
-
takerCurrencyCode
|
1165
|
+
makerCurrencyCode: str
|
1166
|
+
takerCurrencyCode: str
|
1167
1167
|
if takerOrMaker is not None:
|
1168
1168
|
if side == 'buy':
|
1169
1169
|
if takerOrMaker == 'maker':
|
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 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, 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
|
@@ -39,7 +39,7 @@ from ccxt.base.precise import Precise
|
|
39
39
|
|
40
40
|
class binance(Exchange, ImplicitAPI):
|
41
41
|
|
42
|
-
def describe(self):
|
42
|
+
def describe(self) -> Any:
|
43
43
|
return self.deep_extend(super(binance, self).describe(), {
|
44
44
|
'id': 'binance',
|
45
45
|
'name': 'Binance',
|
@@ -1584,6 +1584,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1584
1584
|
'legalMoneyCurrenciesById': {
|
1585
1585
|
'BUSD': 'USD',
|
1586
1586
|
},
|
1587
|
+
'defaultWithdrawPrecision': 0.00000001,
|
1587
1588
|
},
|
1588
1589
|
'features': {
|
1589
1590
|
'spot': {
|
@@ -1634,6 +1635,7 @@ class binance(Exchange, ImplicitAPI):
|
|
1634
1635
|
'limit': None,
|
1635
1636
|
'trigger': False,
|
1636
1637
|
'trailing': False,
|
1638
|
+
'symbolRequired': False,
|
1637
1639
|
},
|
1638
1640
|
'fetchOrders': {
|
1639
1641
|
'marginMode': True,
|
@@ -2936,7 +2938,7 @@ class binance(Exchange, ImplicitAPI):
|
|
2936
2938
|
def nonce(self):
|
2937
2939
|
return self.milliseconds() - self.options['timeDifference']
|
2938
2940
|
|
2939
|
-
def fetch_time(self, params={}):
|
2941
|
+
def fetch_time(self, params={}) -> Int:
|
2940
2942
|
"""
|
2941
2943
|
fetches the current integer timestamp in milliseconds from the exchange server
|
2942
2944
|
|
@@ -3096,6 +3098,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3096
3098
|
id = self.safe_string(entry, 'coin')
|
3097
3099
|
name = self.safe_string(entry, 'name')
|
3098
3100
|
code = self.safe_currency_code(id)
|
3101
|
+
isFiat = self.safe_bool(entry, 'isLegalMoney')
|
3099
3102
|
minPrecision = None
|
3100
3103
|
isWithdrawEnabled = True
|
3101
3104
|
isDepositEnabled = True
|
@@ -3107,6 +3110,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3107
3110
|
networkItem = networkList[j]
|
3108
3111
|
network = self.safe_string(networkItem, 'network')
|
3109
3112
|
networkCode = self.network_id_to_code(network)
|
3113
|
+
isETF = (network == 'ETF') # e.g. BTCUP, ETHDOWN
|
3110
3114
|
# name = self.safe_string(networkItem, 'name')
|
3111
3115
|
withdrawFee = self.safe_number(networkItem, 'withdrawFee')
|
3112
3116
|
depositEnable = self.safe_bool(networkItem, 'depositEnable')
|
@@ -3117,11 +3121,22 @@ class binance(Exchange, ImplicitAPI):
|
|
3117
3121
|
isDefault = self.safe_bool(networkItem, 'isDefault')
|
3118
3122
|
if isDefault or (fee is None):
|
3119
3123
|
fee = withdrawFee
|
3124
|
+
# todo: default networks in "setMarkets" overload
|
3125
|
+
# if isDefault:
|
3126
|
+
# self.options['defaultNetworkCodesForCurrencies'][code] = networkCode
|
3127
|
+
# }
|
3120
3128
|
precisionTick = self.safe_string(networkItem, 'withdrawIntegerMultiple')
|
3121
|
-
|
3122
|
-
#
|
3129
|
+
withdrawPrecision = precisionTick
|
3130
|
+
# avoid zero values, which are mostly from fiat or leveraged tokens or some abandoned coins : https://github.com/ccxt/ccxt/pull/14902#issuecomment-1271636731
|
3123
3131
|
if not Precise.string_eq(precisionTick, '0'):
|
3124
3132
|
minPrecision = precisionTick if (minPrecision is None) else Precise.string_min(minPrecision, precisionTick)
|
3133
|
+
else:
|
3134
|
+
if not isFiat and not isETF:
|
3135
|
+
# non-fiat and non-ETF currency, there are many cases when precision is set to zero(probably bug, we've reported to binance already)
|
3136
|
+
# in such cases, we can set default precision of 8(which is in UI for such coins)
|
3137
|
+
withdrawPrecision = self.omit_zero(self.safe_string(networkItem, 'withdrawInternalMin'))
|
3138
|
+
if withdrawPrecision is None:
|
3139
|
+
withdrawPrecision = self.safe_string(self.options, 'defaultWithdrawPrecision')
|
3125
3140
|
networks[networkCode] = {
|
3126
3141
|
'info': networkItem,
|
3127
3142
|
'id': network,
|
@@ -3130,7 +3145,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3130
3145
|
'deposit': depositEnable,
|
3131
3146
|
'withdraw': withdrawEnable,
|
3132
3147
|
'fee': withdrawFee,
|
3133
|
-
'precision': self.parse_number(
|
3148
|
+
'precision': self.parse_number(withdrawPrecision),
|
3134
3149
|
'limits': {
|
3135
3150
|
'withdraw': {
|
3136
3151
|
'min': self.safe_number(networkItem, 'withdrawMin'),
|
@@ -3159,6 +3174,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3159
3174
|
'id': id,
|
3160
3175
|
'name': name,
|
3161
3176
|
'code': code,
|
3177
|
+
'type': 'fiat' if isFiat else 'crypto',
|
3162
3178
|
'precision': self.parse_number(minPrecision),
|
3163
3179
|
'info': entry,
|
3164
3180
|
'active': active,
|
ccxt/binancecoinm.py
CHANGED
@@ -5,11 +5,12 @@
|
|
5
5
|
|
6
6
|
from ccxt.binance import binance
|
7
7
|
from ccxt.abstract.binancecoinm import ImplicitAPI
|
8
|
+
from ccxt.base.types import Any
|
8
9
|
|
9
10
|
|
10
11
|
class binancecoinm(binance, ImplicitAPI):
|
11
12
|
|
12
|
-
def describe(self):
|
13
|
+
def describe(self) -> Any:
|
13
14
|
return self.deep_extend(super(binancecoinm, self).describe(), {
|
14
15
|
'id': 'binancecoinm',
|
15
16
|
'name': 'Binance COIN-M',
|
ccxt/binanceus.py
CHANGED
@@ -5,11 +5,12 @@
|
|
5
5
|
|
6
6
|
from ccxt.binance import binance
|
7
7
|
from ccxt.abstract.binanceus import ImplicitAPI
|
8
|
+
from ccxt.base.types import Any
|
8
9
|
|
9
10
|
|
10
11
|
class binanceus(binance, ImplicitAPI):
|
11
12
|
|
12
|
-
def describe(self):
|
13
|
+
def describe(self) -> Any:
|
13
14
|
return self.deep_extend(super(binanceus, self).describe(), {
|
14
15
|
'id': 'binanceus',
|
15
16
|
'name': 'Binance US',
|
ccxt/binanceusdm.py
CHANGED
@@ -5,12 +5,13 @@
|
|
5
5
|
|
6
6
|
from ccxt.binance import binance
|
7
7
|
from ccxt.abstract.binanceusdm import ImplicitAPI
|
8
|
+
from ccxt.base.types import Any
|
8
9
|
from ccxt.base.errors import InvalidOrder
|
9
10
|
|
10
11
|
|
11
12
|
class binanceusdm(binance, ImplicitAPI):
|
12
13
|
|
13
|
-
def describe(self):
|
14
|
+
def describe(self) -> Any:
|
14
15
|
return self.deep_extend(super(binanceusdm, self).describe(), {
|
15
16
|
'id': 'binanceusdm',
|
16
17
|
'name': 'Binance USDⓈ-M',
|
ccxt/bingx.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bingx import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import numbers
|
10
|
-
from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, 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
|
@@ -28,7 +28,7 @@ from ccxt.base.precise import Precise
|
|
28
28
|
|
29
29
|
class bingx(Exchange, ImplicitAPI):
|
30
30
|
|
31
|
-
def describe(self):
|
31
|
+
def describe(self) -> Any:
|
32
32
|
return self.deep_extend(super(bingx, self).describe(), {
|
33
33
|
'id': 'bingx',
|
34
34
|
'name': 'BingX',
|
@@ -680,7 +680,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
680
680
|
},
|
681
681
|
})
|
682
682
|
|
683
|
-
def fetch_time(self, params={}):
|
683
|
+
def fetch_time(self, params={}) -> Int:
|
684
684
|
"""
|
685
685
|
fetches the current integer timestamp in milliseconds from the bingx server
|
686
686
|
|