ccxt 3.0.85__py2.py3-none-any.whl → 3.0.87__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/ace.py +2 -1
- ccxt/alpaca.py +2 -1
- ccxt/ascendex.py +2 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +2 -1
- ccxt/async_support/alpaca.py +2 -1
- ccxt/async_support/ascendex.py +2 -1
- ccxt/async_support/base/exchange.py +6 -6
- ccxt/async_support/bequant.py +2 -1
- ccxt/async_support/bigone.py +2 -1
- ccxt/async_support/binance.py +4 -3
- ccxt/async_support/binancecoinm.py +2 -1
- ccxt/async_support/binanceus.py +2 -1
- ccxt/async_support/binanceusdm.py +2 -1
- ccxt/async_support/bit2c.py +2 -1
- ccxt/async_support/bitbank.py +2 -1
- ccxt/async_support/bitbay.py +2 -1
- ccxt/async_support/bitbns.py +2 -1
- ccxt/async_support/bitcoincom.py +2 -1
- ccxt/async_support/bitfinex.py +2 -1
- ccxt/async_support/bitfinex2.py +2 -1
- ccxt/async_support/bitflyer.py +2 -1
- ccxt/async_support/bitforex.py +2 -1
- ccxt/async_support/bitget.py +19 -3
- ccxt/async_support/bithumb.py +2 -1
- ccxt/async_support/bitmart.py +2 -1
- ccxt/async_support/bitmex.py +3 -2
- ccxt/async_support/bitopro.py +2 -1
- ccxt/async_support/bitpanda.py +2 -1
- ccxt/async_support/bitrue.py +3 -2
- ccxt/async_support/bitso.py +2 -1
- ccxt/async_support/bitstamp.py +2 -1
- ccxt/async_support/bitstamp1.py +2 -1
- ccxt/async_support/bittrex.py +2 -1
- ccxt/async_support/bitvavo.py +3 -2
- ccxt/async_support/bkex.py +2 -1
- ccxt/async_support/bl3p.py +2 -1
- ccxt/async_support/blockchaincom.py +2 -1
- ccxt/async_support/btcalpha.py +2 -1
- ccxt/async_support/btcbox.py +4 -3
- ccxt/async_support/btcex.py +2 -1
- ccxt/async_support/btcmarkets.py +2 -1
- ccxt/async_support/btctradeua.py +2 -1
- ccxt/async_support/btcturk.py +2 -1
- ccxt/async_support/bybit.py +2 -1
- ccxt/async_support/cex.py +2 -1
- ccxt/async_support/coinbase.py +2 -1
- ccxt/async_support/coinbaseprime.py +2 -1
- ccxt/async_support/coinbasepro.py +4 -3
- ccxt/async_support/coincheck.py +2 -1
- ccxt/async_support/coinex.py +3 -2
- ccxt/async_support/coinfalcon.py +2 -1
- ccxt/async_support/coinmate.py +2 -1
- ccxt/async_support/coinone.py +2 -1
- ccxt/async_support/coinsph.py +3 -2
- ccxt/async_support/coinspot.py +2 -1
- ccxt/async_support/cryptocom.py +2 -1
- ccxt/async_support/currencycom.py +2 -1
- ccxt/async_support/delta.py +2 -1
- ccxt/async_support/deribit.py +2 -1
- ccxt/async_support/digifinex.py +4 -3
- ccxt/async_support/exmo.py +2 -1
- ccxt/async_support/fmfwio.py +2 -1
- ccxt/async_support/gate.py +2 -1
- ccxt/async_support/gateio.py +2 -1
- ccxt/async_support/gemini.py +2 -1
- ccxt/async_support/hitbtc.py +2 -1
- ccxt/async_support/hitbtc3.py +2 -1
- ccxt/async_support/hollaex.py +2 -1
- ccxt/async_support/huobi.py +2 -1
- ccxt/async_support/huobijp.py +2 -1
- ccxt/async_support/huobipro.py +2 -1
- ccxt/async_support/idex.py +3 -2
- ccxt/async_support/independentreserve.py +2 -1
- ccxt/async_support/indodax.py +2 -1
- ccxt/async_support/kraken.py +2 -1
- ccxt/async_support/krakenfutures.py +2 -1
- ccxt/async_support/kucoin.py +3 -2
- ccxt/async_support/kucoinfutures.py +147 -8
- ccxt/async_support/kuna.py +2 -1
- ccxt/async_support/latoken.py +2 -1
- ccxt/async_support/lbank.py +2 -1
- ccxt/async_support/lbank2.py +2 -1
- ccxt/async_support/luno.py +2 -1
- ccxt/async_support/lykke.py +2 -1
- ccxt/async_support/mercado.py +2 -1
- ccxt/async_support/mexc.py +4 -1
- ccxt/async_support/mexc3.py +2 -1
- ccxt/async_support/ndax.py +2 -1
- ccxt/async_support/novadax.py +2 -1
- ccxt/async_support/oceanex.py +2 -1
- ccxt/async_support/okcoin.py +2 -1
- ccxt/async_support/okex.py +2 -1
- ccxt/async_support/okex5.py +2 -1
- ccxt/async_support/okx.py +5 -1
- ccxt/async_support/paymium.py +2 -1
- ccxt/async_support/phemex.py +3 -1
- ccxt/async_support/poloniex.py +3 -1
- ccxt/async_support/poloniexfutures.py +2 -1
- ccxt/async_support/probit.py +2 -1
- ccxt/async_support/stex.py +3 -2
- ccxt/async_support/tidex.py +2 -1
- ccxt/async_support/timex.py +2 -1
- ccxt/async_support/tokocrypto.py +3 -2
- ccxt/async_support/upbit.py +2 -1
- ccxt/async_support/wavesexchange.py +2 -1
- ccxt/async_support/wazirx.py +2 -1
- ccxt/async_support/whitebit.py +2 -1
- ccxt/async_support/woo.py +2 -1
- ccxt/async_support/xt.py +7 -2
- ccxt/async_support/yobit.py +2 -1
- ccxt/async_support/zaif.py +2 -1
- ccxt/async_support/zonda.py +2 -1
- ccxt/base/exchange.py +6 -74
- ccxt/base/types.py +24 -0
- ccxt/bequant.py +2 -1
- ccxt/bigone.py +2 -1
- ccxt/binance.py +4 -3
- ccxt/binancecoinm.py +2 -1
- ccxt/binanceus.py +2 -1
- ccxt/binanceusdm.py +2 -1
- ccxt/bit2c.py +2 -1
- ccxt/bitbank.py +2 -1
- ccxt/bitbay.py +2 -1
- ccxt/bitbns.py +2 -1
- ccxt/bitcoincom.py +2 -1
- ccxt/bitfinex.py +2 -1
- ccxt/bitfinex2.py +2 -1
- ccxt/bitflyer.py +2 -1
- ccxt/bitforex.py +2 -1
- ccxt/bitget.py +19 -3
- ccxt/bithumb.py +2 -1
- ccxt/bitmart.py +2 -1
- ccxt/bitmex.py +3 -2
- ccxt/bitopro.py +2 -1
- ccxt/bitpanda.py +2 -1
- ccxt/bitrue.py +3 -2
- ccxt/bitso.py +2 -1
- ccxt/bitstamp.py +2 -1
- ccxt/bitstamp1.py +2 -1
- ccxt/bittrex.py +2 -1
- ccxt/bitvavo.py +3 -2
- ccxt/bkex.py +2 -1
- ccxt/bl3p.py +2 -1
- ccxt/blockchaincom.py +2 -1
- ccxt/btcalpha.py +2 -1
- ccxt/btcbox.py +4 -3
- ccxt/btcex.py +2 -1
- ccxt/btcmarkets.py +2 -1
- ccxt/btctradeua.py +2 -1
- ccxt/btcturk.py +2 -1
- ccxt/bybit.py +2 -1
- ccxt/cex.py +2 -1
- ccxt/coinbase.py +2 -1
- ccxt/coinbaseprime.py +2 -1
- ccxt/coinbasepro.py +4 -3
- ccxt/coincheck.py +2 -1
- ccxt/coinex.py +3 -2
- ccxt/coinfalcon.py +2 -1
- ccxt/coinmate.py +2 -1
- ccxt/coinone.py +2 -1
- ccxt/coinsph.py +3 -2
- ccxt/coinspot.py +2 -1
- ccxt/cryptocom.py +2 -1
- ccxt/currencycom.py +2 -1
- ccxt/delta.py +2 -1
- ccxt/deribit.py +2 -1
- ccxt/digifinex.py +4 -3
- ccxt/exmo.py +2 -1
- ccxt/fmfwio.py +2 -1
- ccxt/gate.py +2 -1
- ccxt/gateio.py +2 -1
- ccxt/gemini.py +2 -1
- ccxt/hitbtc.py +2 -1
- ccxt/hitbtc3.py +2 -1
- ccxt/hollaex.py +2 -1
- ccxt/huobi.py +2 -1
- ccxt/huobijp.py +2 -1
- ccxt/huobipro.py +2 -1
- ccxt/idex.py +3 -2
- ccxt/independentreserve.py +2 -1
- ccxt/indodax.py +2 -1
- ccxt/kraken.py +2 -1
- ccxt/krakenfutures.py +2 -1
- ccxt/kucoin.py +3 -2
- ccxt/kucoinfutures.py +147 -8
- ccxt/kuna.py +2 -1
- ccxt/latoken.py +2 -1
- ccxt/lbank.py +2 -1
- ccxt/lbank2.py +2 -1
- ccxt/luno.py +2 -1
- ccxt/lykke.py +2 -1
- ccxt/mercado.py +2 -1
- ccxt/mexc.py +4 -1
- ccxt/mexc3.py +2 -1
- ccxt/ndax.py +2 -1
- ccxt/novadax.py +2 -1
- ccxt/oceanex.py +2 -1
- ccxt/okcoin.py +2 -1
- ccxt/okex.py +2 -1
- ccxt/okex5.py +2 -1
- ccxt/okx.py +5 -1
- ccxt/paymium.py +2 -1
- ccxt/phemex.py +3 -1
- ccxt/poloniex.py +3 -1
- ccxt/poloniexfutures.py +2 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/probit.py +2 -1
- ccxt/stex.py +3 -2
- ccxt/tidex.py +2 -1
- ccxt/timex.py +2 -1
- ccxt/tokocrypto.py +3 -2
- ccxt/upbit.py +2 -1
- ccxt/wavesexchange.py +2 -1
- ccxt/wazirx.py +2 -1
- ccxt/whitebit.py +2 -1
- ccxt/woo.py +2 -1
- ccxt/xt.py +7 -2
- ccxt/yobit.py +2 -1
- ccxt/zaif.py +2 -1
- ccxt/zonda.py +2 -1
- {ccxt-3.0.85.dist-info → ccxt-3.0.87.dist-info}/METADATA +4 -4
- ccxt-3.0.87.dist-info/RECORD +355 -0
- ccxt-3.0.85.dist-info/RECORD +0 -355
- {ccxt-3.0.85.dist-info → ccxt-3.0.87.dist-info}/WHEEL +0 -0
- {ccxt-3.0.85.dist-info → ccxt-3.0.87.dist-info}/top_level.txt +0 -0
ccxt/async_support/okex.py
CHANGED
@@ -4,9 +4,10 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.okx import okx
|
7
|
+
from ccxt.abstract.okex import ImplicitAPI
|
7
8
|
|
8
9
|
|
9
|
-
class okex(okx):
|
10
|
+
class okex(okx, ImplicitAPI):
|
10
11
|
|
11
12
|
def describe(self):
|
12
13
|
return self.deep_extend(super(okex, self).describe(), {
|
ccxt/async_support/okex5.py
CHANGED
@@ -4,9 +4,10 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.okex import okex
|
7
|
+
from ccxt.abstract.okex5 import ImplicitAPI
|
7
8
|
|
8
9
|
|
9
|
-
class okex5(okex):
|
10
|
+
class okex5(okex, ImplicitAPI):
|
10
11
|
|
11
12
|
def describe(self):
|
12
13
|
return self.deep_extend(super(okex5, self).describe(), {
|
ccxt/async_support/okx.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.okx import ImplicitAPI
|
7
8
|
import asyncio
|
8
9
|
import hashlib
|
9
10
|
from ccxt.base.types import OrderSide
|
@@ -33,7 +34,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
33
34
|
from ccxt.base.precise import Precise
|
34
35
|
|
35
36
|
|
36
|
-
class okx(Exchange):
|
37
|
+
class okx(Exchange, ImplicitAPI):
|
37
38
|
|
38
39
|
def describe(self):
|
39
40
|
return self.deep_extend(super(okx, self).describe(), {
|
@@ -272,6 +273,7 @@ class okx(Exchange):
|
|
272
273
|
'trade/orders-algo-history': 1,
|
273
274
|
'trade/order-algo': 1,
|
274
275
|
'account/subaccount/balances': 10,
|
276
|
+
'account/subaccount/interest-limits': 4,
|
275
277
|
'asset/subaccount/bills': 5 / 3,
|
276
278
|
'users/subaccount/list': 10,
|
277
279
|
'users/subaccount/apikey': 10,
|
@@ -332,6 +334,7 @@ class okx(Exchange):
|
|
332
334
|
'account/quick-margin-borrow-repay': 4,
|
333
335
|
'account/activate-option': 4,
|
334
336
|
'account/set-auto-loan': 4,
|
337
|
+
'account/subaccount/set-loan-allocation': 4,
|
335
338
|
'asset/transfer': 10,
|
336
339
|
'asset/withdrawal': 5 / 3,
|
337
340
|
'asset/withdrawal-lightning': 5,
|
@@ -343,6 +346,7 @@ class okx(Exchange):
|
|
343
346
|
'trade/cancel-batch-orders': 1 / 15,
|
344
347
|
'trade/amend-order': 1 / 3,
|
345
348
|
'trade/amend-batch-orders': 1 / 3,
|
349
|
+
'trade/amend-algos': 1,
|
346
350
|
'trade/close-position': 1,
|
347
351
|
'trade/order-algo': 1,
|
348
352
|
'trade/cancel-algos': 1,
|
ccxt/async_support/paymium.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.paymium import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -12,7 +13,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
12
13
|
from ccxt.base.precise import Precise
|
13
14
|
|
14
15
|
|
15
|
-
class paymium(Exchange):
|
16
|
+
class paymium(Exchange, ImplicitAPI):
|
16
17
|
|
17
18
|
def describe(self):
|
18
19
|
return self.deep_extend(super(paymium, self).describe(), {
|
ccxt/async_support/phemex.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.phemex import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
import numbers
|
9
10
|
from ccxt.base.types import OrderSide
|
@@ -28,7 +29,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
28
29
|
from ccxt.base.precise import Precise
|
29
30
|
|
30
31
|
|
31
|
-
class phemex(Exchange):
|
32
|
+
class phemex(Exchange, ImplicitAPI):
|
32
33
|
|
33
34
|
def describe(self):
|
34
35
|
return self.deep_extend(super(phemex, self).describe(), {
|
@@ -3549,6 +3550,7 @@ class phemex(Exchange):
|
|
3549
3550
|
:returns dict: response from the exchange
|
3550
3551
|
"""
|
3551
3552
|
self.check_required_argument('setPositionMode', symbol, 'symbol')
|
3553
|
+
await self.load_markets()
|
3552
3554
|
market = self.market(symbol)
|
3553
3555
|
if market['settle'] != 'USDT':
|
3554
3556
|
raise BadSymbol(self.id + ' setPositionMode() supports USDT settled markets only')
|
ccxt/async_support/poloniex.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.poloniex import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -27,7 +28,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
27
28
|
from ccxt.base.precise import Precise
|
28
29
|
|
29
30
|
|
30
|
-
class poloniex(Exchange):
|
31
|
+
class poloniex(Exchange, ImplicitAPI):
|
31
32
|
|
32
33
|
def describe(self):
|
33
34
|
return self.deep_extend(super(poloniex, self).describe(), {
|
@@ -686,6 +687,7 @@ class poloniex(Exchange):
|
|
686
687
|
'withdraw': None,
|
687
688
|
'fee': fee,
|
688
689
|
'precision': None,
|
690
|
+
'networks': {},
|
689
691
|
'limits': {
|
690
692
|
'amount': {
|
691
693
|
'min': None,
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.poloniexfutures import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -22,7 +23,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
22
23
|
from ccxt.base.precise import Precise
|
23
24
|
|
24
25
|
|
25
|
-
class poloniexfutures(Exchange):
|
26
|
+
class poloniexfutures(Exchange, ImplicitAPI):
|
26
27
|
|
27
28
|
def describe(self):
|
28
29
|
return self.deep_extend(super(poloniexfutures, self).describe(), {
|
ccxt/async_support/probit.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.probit import ImplicitAPI
|
7
8
|
import math
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -25,7 +26,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
25
26
|
from ccxt.base.precise import Precise
|
26
27
|
|
27
28
|
|
28
|
-
class probit(Exchange):
|
29
|
+
class probit(Exchange, ImplicitAPI):
|
29
30
|
|
30
31
|
def describe(self):
|
31
32
|
return self.deep_extend(super(probit, self).describe(), {
|
ccxt/async_support/stex.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.stex import ImplicitAPI
|
7
8
|
from ccxt.base.types import OrderSide
|
8
9
|
from typing import Optional
|
9
10
|
from typing import List
|
@@ -22,7 +23,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
22
23
|
from ccxt.base.precise import Precise
|
23
24
|
|
24
25
|
|
25
|
-
class stex(Exchange):
|
26
|
+
class stex(Exchange, ImplicitAPI):
|
26
27
|
|
27
28
|
def describe(self):
|
28
29
|
return self.deep_extend(super(stex, self).describe(), {
|
@@ -448,7 +449,7 @@ class stex(Exchange):
|
|
448
449
|
minPrice = Precise.string_max(minBuyPrice, minSellPrice)
|
449
450
|
buyFee = Precise.string_div(self.safe_string(market, 'buy_fee_percent'), '100')
|
450
451
|
sellFee = Precise.string_div(self.safe_string(market, 'sell_fee_percent'), '100')
|
451
|
-
fee = Precise.string_max(buyFee, sellFee)
|
452
|
+
fee = self.parse_number(Precise.string_max(buyFee, sellFee))
|
452
453
|
result.append({
|
453
454
|
'id': id,
|
454
455
|
'numericId': numericId,
|
ccxt/async_support/tidex.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.tidex import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -21,7 +22,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
21
22
|
from ccxt.base.precise import Precise
|
22
23
|
|
23
24
|
|
24
|
-
class tidex(Exchange):
|
25
|
+
class tidex(Exchange, ImplicitAPI):
|
25
26
|
|
26
27
|
def describe(self):
|
27
28
|
return self.deep_extend(super(tidex, self).describe(), {
|
ccxt/async_support/timex.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.timex import ImplicitAPI
|
7
8
|
from ccxt.base.types import OrderSide
|
8
9
|
from typing import Optional
|
9
10
|
from typing import List
|
@@ -22,7 +23,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
22
23
|
from ccxt.base.precise import Precise
|
23
24
|
|
24
25
|
|
25
|
-
class timex(Exchange):
|
26
|
+
class timex(Exchange, ImplicitAPI):
|
26
27
|
|
27
28
|
def describe(self):
|
28
29
|
return self.deep_extend(super(timex, self).describe(), {
|
ccxt/async_support/tokocrypto.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.tokocrypto import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
import json
|
9
10
|
from ccxt.base.types import OrderSide
|
@@ -35,7 +36,7 @@ from ccxt.base.decimal_to_precision import DECIMAL_PLACES
|
|
35
36
|
from ccxt.base.precise import Precise
|
36
37
|
|
37
38
|
|
38
|
-
class tokocrypto(Exchange):
|
39
|
+
class tokocrypto(Exchange, ImplicitAPI):
|
39
40
|
|
40
41
|
def describe(self):
|
41
42
|
return self.deep_extend(super(tokocrypto, self).describe(), {
|
@@ -2312,7 +2313,7 @@ class tokocrypto(Exchange):
|
|
2312
2313
|
raise ExchangeError(self.id + ' ' + body)
|
2313
2314
|
return None
|
2314
2315
|
|
2315
|
-
def calculate_rate_limiter_cost(self, api, method, path, params, config={}
|
2316
|
+
def calculate_rate_limiter_cost(self, api, method, path, params, config={}):
|
2316
2317
|
if ('noCoin' in config) and not ('coin' in params):
|
2317
2318
|
return config['noCoin']
|
2318
2319
|
elif ('noSymbol' in config) and not ('symbol' in params):
|
ccxt/async_support/upbit.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.upbit import ImplicitAPI
|
7
8
|
from ccxt.base.types import OrderSide
|
8
9
|
from typing import Optional
|
9
10
|
from typing import List
|
@@ -19,7 +20,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
19
20
|
from ccxt.base.precise import Precise
|
20
21
|
|
21
22
|
|
22
|
-
class upbit(Exchange):
|
23
|
+
class upbit(Exchange, ImplicitAPI):
|
23
24
|
|
24
25
|
def describe(self):
|
25
26
|
return self.deep_extend(super(upbit, self).describe(), {
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.wavesexchange import ImplicitAPI
|
7
8
|
import math
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -22,7 +23,7 @@ from ccxt.base.errors import AuthenticationError
|
|
22
23
|
from ccxt.base.precise import Precise
|
23
24
|
|
24
25
|
|
25
|
-
class wavesexchange(Exchange):
|
26
|
+
class wavesexchange(Exchange, ImplicitAPI):
|
26
27
|
|
27
28
|
def describe(self):
|
28
29
|
return self.deep_extend(super(wavesexchange, self).describe(), {
|
ccxt/async_support/wazirx.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.wazirx import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -20,7 +21,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
20
21
|
from ccxt.base.precise import Precise
|
21
22
|
|
22
23
|
|
23
|
-
class wazirx(Exchange):
|
24
|
+
class wazirx(Exchange, ImplicitAPI):
|
24
25
|
|
25
26
|
def describe(self):
|
26
27
|
return self.deep_extend(super(wazirx, self).describe(), {
|
ccxt/async_support/whitebit.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.whitebit import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -24,7 +25,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
24
25
|
from ccxt.base.precise import Precise
|
25
26
|
|
26
27
|
|
27
|
-
class whitebit(Exchange):
|
28
|
+
class whitebit(Exchange, ImplicitAPI):
|
28
29
|
|
29
30
|
def describe(self):
|
30
31
|
return self.deep_extend(super(whitebit, self).describe(), {
|
ccxt/async_support/woo.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.woo import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -18,7 +19,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
18
19
|
from ccxt.base.precise import Precise
|
19
20
|
|
20
21
|
|
21
|
-
class woo(Exchange):
|
22
|
+
class woo(Exchange, ImplicitAPI):
|
22
23
|
|
23
24
|
def describe(self):
|
24
25
|
return self.deep_extend(super(woo, self).describe(), {
|
ccxt/async_support/xt.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.xt import ImplicitAPI
|
7
8
|
import asyncio
|
8
9
|
import hashlib
|
9
10
|
from typing import Optional
|
@@ -22,7 +23,7 @@ from ccxt.base.decimal_to_precision import DECIMAL_PLACES
|
|
22
23
|
from ccxt.base.precise import Precise
|
23
24
|
|
24
25
|
|
25
|
-
class xt(Exchange):
|
26
|
+
class xt(Exchange, ImplicitAPI):
|
26
27
|
|
27
28
|
def describe(self):
|
28
29
|
return self.deep_extend(super(xt, self).describe(), {
|
@@ -496,6 +497,8 @@ class xt(Exchange):
|
|
496
497
|
},
|
497
498
|
'commonCurrencies': {},
|
498
499
|
'options': {
|
500
|
+
'adjustForTimeDifference': False,
|
501
|
+
'timeDifference': 0,
|
499
502
|
'networks': {
|
500
503
|
'ERC20': 'Ethereum',
|
501
504
|
'TRC20': 'Tron',
|
@@ -621,7 +624,7 @@ class xt(Exchange):
|
|
621
624
|
})
|
622
625
|
|
623
626
|
def nonce(self):
|
624
|
-
return self.milliseconds()
|
627
|
+
return self.milliseconds() - self.options['timeDifference']
|
625
628
|
|
626
629
|
async def fetch_time(self, params={}):
|
627
630
|
"""
|
@@ -748,6 +751,8 @@ class xt(Exchange):
|
|
748
751
|
:param dict params: extra parameters specific to the xt api endpoint
|
749
752
|
:returns [dict]: an array of objects representing market data
|
750
753
|
"""
|
754
|
+
if self.options['adjustForTimeDifference']:
|
755
|
+
await self.load_time_difference()
|
751
756
|
promisesUnresolved = [
|
752
757
|
self.fetch_spot_markets(params),
|
753
758
|
self.fetch_swap_and_future_markets(params),
|
ccxt/async_support/yobit.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.yobit import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -22,7 +23,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
22
23
|
from ccxt.base.precise import Precise
|
23
24
|
|
24
25
|
|
25
|
-
class yobit(Exchange):
|
26
|
+
class yobit(Exchange, ImplicitAPI):
|
26
27
|
|
27
28
|
def describe(self):
|
28
29
|
return self.deep_extend(super(yobit, self).describe(), {
|
ccxt/async_support/zaif.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.zaif import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -13,7 +14,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
13
14
|
from ccxt.base.precise import Precise
|
14
15
|
|
15
16
|
|
16
|
-
class zaif(Exchange):
|
17
|
+
class zaif(Exchange, ImplicitAPI):
|
17
18
|
|
18
19
|
def describe(self):
|
19
20
|
return self.deep_extend(super(zaif, self).describe(), {
|
ccxt/async_support/zonda.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.zonda import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
from ccxt.base.types import OrderSide
|
9
10
|
from typing import Optional
|
@@ -24,7 +25,7 @@ from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
24
25
|
from ccxt.base.precise import Precise
|
25
26
|
|
26
27
|
|
27
|
-
class zonda(Exchange):
|
28
|
+
class zonda(Exchange, ImplicitAPI):
|
28
29
|
|
29
30
|
def describe(self):
|
30
31
|
return self.deep_extend(super(zonda, self).describe(), {
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '3.0.
|
7
|
+
__version__ = '3.0.87'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -408,9 +408,6 @@ class Exchange(object):
|
|
408
408
|
else:
|
409
409
|
setattr(self, key, settings[key])
|
410
410
|
|
411
|
-
if self.api:
|
412
|
-
self.define_rest_api(self.api, 'request')
|
413
|
-
|
414
411
|
if self.markets:
|
415
412
|
self.set_markets(self.markets)
|
416
413
|
|
@@ -467,71 +464,6 @@ class Exchange(object):
|
|
467
464
|
self.urls['api'] = self.urls['apiBackup']
|
468
465
|
del self.urls['apiBackup']
|
469
466
|
|
470
|
-
def define_rest_api_endpoint(self, method_name, uppercase_method, lowercase_method, camelcase_method, path, paths, config={}):
|
471
|
-
cls = type(self)
|
472
|
-
entry = getattr(cls, method_name) # returns a function (instead of a bound method)
|
473
|
-
delimiters = re.compile('[^a-zA-Z0-9]')
|
474
|
-
split_path = delimiters.split(path)
|
475
|
-
lowercase_path = [x.strip().lower() for x in split_path]
|
476
|
-
camelcase_suffix = ''.join([Exchange.capitalize(x) for x in split_path])
|
477
|
-
underscore_suffix = '_'.join([x for x in lowercase_path if len(x)])
|
478
|
-
camelcase_prefix = ''
|
479
|
-
underscore_prefix = ''
|
480
|
-
if len(paths):
|
481
|
-
camelcase_prefix = paths[0]
|
482
|
-
underscore_prefix = paths[0]
|
483
|
-
if len(paths) > 1:
|
484
|
-
camelcase_prefix += ''.join([Exchange.capitalize(x) for x in paths[1:]])
|
485
|
-
underscore_prefix += '_' + '_'.join([x.strip() for p in paths[1:] for x in delimiters.split(p)])
|
486
|
-
api_argument = paths
|
487
|
-
else:
|
488
|
-
api_argument = paths[0]
|
489
|
-
camelcase = camelcase_prefix + camelcase_method + Exchange.capitalize(camelcase_suffix)
|
490
|
-
underscore = underscore_prefix + '_' + lowercase_method + '_' + underscore_suffix.lower()
|
491
|
-
|
492
|
-
def partialer():
|
493
|
-
outer_kwargs = {'path': path, 'api': api_argument, 'method': uppercase_method, 'config': config}
|
494
|
-
|
495
|
-
@functools.wraps(entry)
|
496
|
-
def inner(_self, params=None, context=None):
|
497
|
-
"""
|
498
|
-
Inner is called when a generated method (publicGetX) is called.
|
499
|
-
_self is a reference to self created by function.__get__(exchange, type(exchange))
|
500
|
-
https://en.wikipedia.org/wiki/Closure_(computer_programming) equivalent to functools.partial
|
501
|
-
"""
|
502
|
-
inner_kwargs = dict(outer_kwargs) # avoid mutation
|
503
|
-
if params is not None:
|
504
|
-
inner_kwargs['params'] = params
|
505
|
-
if context is not None:
|
506
|
-
inner_kwargs['context'] = params
|
507
|
-
return entry(_self, **inner_kwargs)
|
508
|
-
return inner
|
509
|
-
to_bind = partialer()
|
510
|
-
setattr(cls, camelcase, to_bind)
|
511
|
-
setattr(cls, underscore, to_bind)
|
512
|
-
|
513
|
-
def define_rest_api(self, api, method_name, paths=[]):
|
514
|
-
for key, value in api.items():
|
515
|
-
uppercase_method = key.upper()
|
516
|
-
lowercase_method = key.lower()
|
517
|
-
camelcase_method = lowercase_method.capitalize()
|
518
|
-
if isinstance(value, list):
|
519
|
-
for path in value:
|
520
|
-
self.define_rest_api_endpoint(method_name, uppercase_method, lowercase_method, camelcase_method, path, paths)
|
521
|
-
# the options HTTP method conflicts with the 'options' API url path
|
522
|
-
# elif re.search(r'^(?:get|post|put|delete|options|head|patch)$', key, re.IGNORECASE) is not None:
|
523
|
-
elif re.search(r'^(?:get|post|put|delete|head|patch)$', key, re.IGNORECASE) is not None:
|
524
|
-
for [endpoint, config] in value.items():
|
525
|
-
path = endpoint.strip()
|
526
|
-
if isinstance(config, dict):
|
527
|
-
self.define_rest_api_endpoint(method_name, uppercase_method, lowercase_method, camelcase_method, path, paths, config)
|
528
|
-
elif isinstance(config, Number):
|
529
|
-
self.define_rest_api_endpoint(method_name, uppercase_method, lowercase_method, camelcase_method, path, paths, {'cost': config})
|
530
|
-
else:
|
531
|
-
raise NotSupported(self.id + ' define_rest_api() API format not supported, API leafs must strings, objects or numbers')
|
532
|
-
else:
|
533
|
-
self.define_rest_api(value, method_name, paths + [key])
|
534
|
-
|
535
467
|
def throttle(self, cost=None):
|
536
468
|
now = float(self.milliseconds())
|
537
469
|
elapsed = now - self.lastRestRequestTimestamp
|
@@ -2870,16 +2802,16 @@ class Exchange(object):
|
|
2870
2802
|
results.append(objects[i])
|
2871
2803
|
return self.index_by(results, key) if indexed else results
|
2872
2804
|
|
2873
|
-
def fetch2(self, path, api: Any = 'public', method='GET', params={}, headers: Optional[Any] = None, body: Optional[Any] = None, config={}
|
2805
|
+
def fetch2(self, path, api: Any = 'public', method='GET', params={}, headers: Optional[Any] = None, body: Optional[Any] = None, config={}):
|
2874
2806
|
if self.enableRateLimit:
|
2875
|
-
cost = self.calculate_rate_limiter_cost(api, method, path, params, config
|
2807
|
+
cost = self.calculate_rate_limiter_cost(api, method, path, params, config)
|
2876
2808
|
self.throttle(cost)
|
2877
2809
|
self.lastRestRequestTimestamp = self.milliseconds()
|
2878
2810
|
request = self.sign(path, api, method, params, headers, body)
|
2879
2811
|
return self.fetch(request['url'], request['method'], request['headers'], request['body'])
|
2880
2812
|
|
2881
|
-
def request(self, path, api: Any = 'public', method='GET', params={}, headers: Optional[Any] = None, body: Optional[Any] = None, config={}
|
2882
|
-
return self.fetch2(path, api, method, params, headers, body, config
|
2813
|
+
def request(self, path, api: Any = 'public', method='GET', params={}, headers: Optional[Any] = None, body: Optional[Any] = None, config={}):
|
2814
|
+
return self.fetch2(path, api, method, params, headers, body, config)
|
2883
2815
|
|
2884
2816
|
def load_accounts(self, reload=False, params={}):
|
2885
2817
|
if reload:
|
@@ -3207,7 +3139,7 @@ class Exchange(object):
|
|
3207
3139
|
# raise NotSupported(self.id + ' handleErrors() not implemented yet')
|
3208
3140
|
return None
|
3209
3141
|
|
3210
|
-
def calculate_rate_limiter_cost(self, api, method, path, params, config={}
|
3142
|
+
def calculate_rate_limiter_cost(self, api, method, path, params, config={}):
|
3211
3143
|
return self.safe_value(config, 'cost', 1)
|
3212
3144
|
|
3213
3145
|
def fetch_ticker(self, symbol: str, params={}):
|
ccxt/base/types.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import sys
|
2
|
+
import types
|
2
3
|
from typing import Union
|
3
4
|
|
4
5
|
if sys.version_info.minor > 7:
|
@@ -12,6 +13,29 @@ OrderSide = Literal['buy', 'sell']
|
|
12
13
|
OrderType = Literal['limit', 'market']
|
13
14
|
|
14
15
|
|
16
|
+
class Entry:
|
17
|
+
def __init__(self, path, api, method, config):
|
18
|
+
self.name = None
|
19
|
+
self.path = path
|
20
|
+
self.api = api
|
21
|
+
self.method = method
|
22
|
+
self.config = config
|
23
|
+
|
24
|
+
def unbound_method(_self, params={}):
|
25
|
+
return _self.request(self.path, self.api, self.method, params, config=self.config)
|
26
|
+
|
27
|
+
self.unbound_method = unbound_method
|
28
|
+
|
29
|
+
def __get__(self, instance, owner):
|
30
|
+
if instance is None:
|
31
|
+
return self.unbound_method
|
32
|
+
else:
|
33
|
+
return types.MethodType(self.unbound_method, instance)
|
34
|
+
|
35
|
+
def __set_name__(self, owner, name):
|
36
|
+
self.name = name
|
37
|
+
|
38
|
+
|
15
39
|
class Balance(TypedDict):
|
16
40
|
free: Union[None, str, float]
|
17
41
|
used: Union[None, str, float]
|
ccxt/bequant.py
CHANGED
@@ -4,9 +4,10 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.hitbtc import hitbtc
|
7
|
+
from ccxt.abstract.bequant import ImplicitAPI
|
7
8
|
|
8
9
|
|
9
|
-
class bequant(hitbtc):
|
10
|
+
class bequant(hitbtc, ImplicitAPI):
|
10
11
|
|
11
12
|
def describe(self):
|
12
13
|
return self.deep_extend(super(bequant, self).describe(), {
|
ccxt/bigone.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.bigone import ImplicitAPI
|
7
8
|
from ccxt.base.types import OrderSide
|
8
9
|
from typing import Optional
|
9
10
|
from typing import List
|
@@ -19,7 +20,7 @@ from ccxt.base.errors import AuthenticationError
|
|
19
20
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
20
21
|
|
21
22
|
|
22
|
-
class bigone(Exchange):
|
23
|
+
class bigone(Exchange, ImplicitAPI):
|
23
24
|
|
24
25
|
def describe(self):
|
25
26
|
return self.deep_extend(super(bigone, self).describe(), {
|
ccxt/binance.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
|
+
from ccxt.abstract.binance import ImplicitAPI
|
7
8
|
import hashlib
|
8
9
|
import json
|
9
10
|
from ccxt.base.types import OrderSide
|
@@ -35,7 +36,7 @@ from ccxt.base.decimal_to_precision import DECIMAL_PLACES
|
|
35
36
|
from ccxt.base.precise import Precise
|
36
37
|
|
37
38
|
|
38
|
-
class binance(Exchange):
|
39
|
+
class binance(Exchange, ImplicitAPI):
|
39
40
|
|
40
41
|
def describe(self):
|
41
42
|
return self.deep_extend(super(binance, self).describe(), {
|
@@ -7124,7 +7125,7 @@ class binance(Exchange):
|
|
7124
7125
|
raise ExchangeError(self.id + ' ' + body)
|
7125
7126
|
return None
|
7126
7127
|
|
7127
|
-
def calculate_rate_limiter_cost(self, api, method, path, params, config={}
|
7128
|
+
def calculate_rate_limiter_cost(self, api, method, path, params, config={}):
|
7128
7129
|
if ('noCoin' in config) and not ('coin' in params):
|
7129
7130
|
return config['noCoin']
|
7130
7131
|
elif ('noSymbol' in config) and not ('symbol' in params):
|
@@ -7141,7 +7142,7 @@ class binance(Exchange):
|
|
7141
7142
|
return self.safe_value(config, 'cost', 1)
|
7142
7143
|
|
7143
7144
|
def request(self, path, api='public', method='GET', params={}, headers=None, body=None, config={}, context={}):
|
7144
|
-
response = self.fetch2(path, api, method, params, headers, body, config
|
7145
|
+
response = self.fetch2(path, api, method, params, headers, body, config)
|
7145
7146
|
# a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
7146
7147
|
if (api == 'private') or (api == 'wapi'):
|
7147
7148
|
self.options['hasAlreadyAuthenticatedSuccessfully'] = True
|