ccxt 4.1.54__py2.py3-none-any.whl → 4.1.56__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 +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/bitbank.py +1 -0
- ccxt/abstract/coinbase.py +2 -0
- ccxt/abstract/htx.py +3 -0
- ccxt/abstract/huobi.py +3 -0
- ccxt/abstract/huobipro.py +3 -0
- ccxt/abstract/okex.py +3 -1
- ccxt/abstract/okex5.py +3 -1
- ccxt/abstract/okx.py +3 -1
- ccxt/ace.py +23 -23
- ccxt/alpaca.py +8 -8
- ccxt/ascendex.py +26 -26
- ccxt/async_support/__init__.py +2 -2
- ccxt/async_support/ace.py +23 -23
- ccxt/async_support/alpaca.py +8 -8
- ccxt/async_support/ascendex.py +26 -26
- ccxt/async_support/base/exchange.py +4 -2216
- ccxt/async_support/bigone.py +21 -24
- ccxt/async_support/binance.py +61 -54
- ccxt/async_support/bingx.py +28 -28
- ccxt/async_support/bit2c.py +9 -9
- ccxt/async_support/bitbank.py +11 -10
- ccxt/async_support/bitbns.py +11 -11
- ccxt/async_support/bitfinex.py +15 -15
- ccxt/async_support/bitfinex2.py +22 -22
- ccxt/async_support/bitflyer.py +13 -13
- ccxt/async_support/bitforex.py +10 -10
- ccxt/async_support/bitget.py +44 -44
- ccxt/async_support/bithumb.py +9 -9
- ccxt/async_support/bitmart.py +85 -104
- ccxt/async_support/bitmex.py +27 -27
- ccxt/async_support/bitopro.py +18 -18
- ccxt/async_support/bitpanda.py +18 -18
- ccxt/async_support/bitrue.py +14 -14
- ccxt/async_support/bitso.py +17 -17
- ccxt/async_support/bitstamp.py +17 -17
- ccxt/async_support/bittrex.py +22 -24
- ccxt/async_support/bitvavo.py +15 -15
- ccxt/async_support/bl3p.py +4 -4
- ccxt/async_support/blockchaincom.py +17 -17
- ccxt/async_support/btcalpha.py +14 -14
- ccxt/async_support/btcbox.py +9 -9
- ccxt/async_support/btcmarkets.py +17 -17
- ccxt/async_support/btcturk.py +9 -9
- ccxt/async_support/bybit.py +46 -46
- ccxt/async_support/cex.py +10 -10
- ccxt/async_support/coinbase.py +69 -25
- ccxt/async_support/coinbasepro.py +19 -19
- ccxt/async_support/coincheck.py +10 -10
- ccxt/async_support/coinex.py +57 -66
- ccxt/async_support/coinlist.py +22 -22
- ccxt/async_support/coinmate.py +10 -10
- ccxt/async_support/coinone.py +10 -10
- ccxt/async_support/coinsph.py +17 -17
- ccxt/async_support/coinspot.py +5 -5
- ccxt/async_support/cryptocom.py +27 -27
- ccxt/async_support/currencycom.py +18 -18
- ccxt/async_support/delta.py +21 -21
- ccxt/async_support/deribit.py +24 -24
- ccxt/async_support/digifinex.py +35 -35
- ccxt/async_support/exmo.py +19 -19
- ccxt/async_support/gate.py +38 -38
- ccxt/async_support/gemini.py +11 -11
- ccxt/async_support/hitbtc.py +27 -27
- ccxt/async_support/hollaex.py +19 -19
- ccxt/async_support/htx.py +47 -44
- ccxt/async_support/huobijp.py +22 -22
- ccxt/async_support/idex.py +20 -20
- ccxt/async_support/independentreserve.py +9 -9
- ccxt/async_support/indodax.py +10 -10
- ccxt/async_support/kraken.py +25 -25
- ccxt/async_support/krakenfutures.py +17 -17
- ccxt/async_support/kucoin.py +27 -27
- ccxt/async_support/kucoinfutures.py +20 -20
- ccxt/async_support/kuna.py +19 -19
- ccxt/async_support/latoken.py +14 -14
- ccxt/async_support/lbank.py +18 -18
- ccxt/async_support/luno.py +14 -14
- ccxt/async_support/lykke.py +12 -12
- ccxt/async_support/mercado.py +11 -11
- ccxt/async_support/mexc.py +36 -36
- ccxt/async_support/ndax.py +18 -18
- ccxt/async_support/novadax.py +17 -17
- ccxt/async_support/oceanex.py +12 -12
- ccxt/async_support/okcoin.py +19 -19
- ccxt/async_support/okx.py +48 -45
- ccxt/async_support/p2b.py +6 -6
- ccxt/async_support/paymium.py +6 -6
- ccxt/async_support/phemex.py +57 -57
- ccxt/async_support/poloniex.py +31 -30
- ccxt/async_support/poloniexfutures.py +16 -16
- ccxt/async_support/probit.py +22 -22
- ccxt/async_support/tidex.py +15 -15
- ccxt/async_support/timex.py +20 -20
- ccxt/async_support/tokocrypto.py +16 -16
- ccxt/async_support/upbit.py +15 -15
- ccxt/async_support/wavesexchange.py +12 -12
- ccxt/async_support/wazirx.py +13 -13
- ccxt/async_support/whitebit.py +26 -26
- ccxt/async_support/woo.py +47 -47
- ccxt/async_support/yobit.py +8 -8
- ccxt/async_support/zaif.py +10 -10
- ccxt/async_support/zonda.py +16 -16
- ccxt/base/errors.py +17 -16
- ccxt/base/exchange.py +57 -97
- ccxt/base/types.py +138 -139
- ccxt/bigone.py +21 -24
- ccxt/binance.py +61 -54
- ccxt/bingx.py +28 -28
- ccxt/bit2c.py +9 -9
- ccxt/bitbank.py +11 -10
- ccxt/bitbns.py +11 -11
- ccxt/bitfinex.py +15 -15
- ccxt/bitfinex2.py +22 -22
- ccxt/bitflyer.py +13 -13
- ccxt/bitforex.py +10 -10
- ccxt/bitget.py +44 -44
- ccxt/bithumb.py +9 -9
- ccxt/bitmart.py +85 -104
- ccxt/bitmex.py +27 -27
- ccxt/bitopro.py +18 -18
- ccxt/bitpanda.py +18 -18
- ccxt/bitrue.py +14 -14
- ccxt/bitso.py +17 -17
- ccxt/bitstamp.py +17 -17
- ccxt/bittrex.py +22 -24
- ccxt/bitvavo.py +15 -15
- ccxt/bl3p.py +4 -4
- ccxt/blockchaincom.py +17 -17
- ccxt/btcalpha.py +14 -14
- ccxt/btcbox.py +9 -9
- ccxt/btcmarkets.py +17 -17
- ccxt/btcturk.py +9 -9
- ccxt/bybit.py +46 -46
- ccxt/cex.py +10 -10
- ccxt/coinbase.py +69 -25
- ccxt/coinbasepro.py +19 -19
- ccxt/coincheck.py +10 -10
- ccxt/coinex.py +57 -66
- ccxt/coinlist.py +22 -22
- ccxt/coinmate.py +10 -10
- ccxt/coinone.py +10 -10
- ccxt/coinsph.py +17 -17
- ccxt/coinspot.py +5 -5
- ccxt/cryptocom.py +27 -27
- ccxt/currencycom.py +18 -18
- ccxt/delta.py +21 -21
- ccxt/deribit.py +24 -24
- ccxt/digifinex.py +35 -35
- ccxt/exmo.py +19 -19
- ccxt/gate.py +38 -38
- ccxt/gemini.py +11 -11
- ccxt/hitbtc.py +27 -27
- ccxt/hollaex.py +19 -19
- ccxt/htx.py +47 -44
- ccxt/huobijp.py +22 -22
- ccxt/idex.py +20 -20
- ccxt/independentreserve.py +9 -9
- ccxt/indodax.py +10 -10
- ccxt/kraken.py +25 -25
- ccxt/krakenfutures.py +17 -17
- ccxt/kucoin.py +27 -27
- ccxt/kucoinfutures.py +20 -20
- ccxt/kuna.py +19 -19
- ccxt/latoken.py +14 -14
- ccxt/lbank.py +18 -18
- ccxt/luno.py +14 -14
- ccxt/lykke.py +12 -12
- ccxt/mercado.py +11 -11
- ccxt/mexc.py +36 -36
- ccxt/ndax.py +18 -18
- ccxt/novadax.py +17 -17
- ccxt/oceanex.py +12 -12
- ccxt/okcoin.py +19 -19
- ccxt/okx.py +48 -45
- ccxt/p2b.py +6 -6
- ccxt/paymium.py +6 -6
- ccxt/phemex.py +57 -57
- ccxt/poloniex.py +31 -30
- ccxt/poloniexfutures.py +16 -16
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +3 -3
- ccxt/pro/ascendex.py +2 -2
- ccxt/pro/binance.py +9 -9
- ccxt/pro/bingx.py +3 -3
- ccxt/pro/bitfinex.py +3 -3
- ccxt/pro/bitfinex2.py +3 -3
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitmex.py +3 -3
- ccxt/pro/bitpanda.py +3 -3
- ccxt/pro/bitrue.py +2 -2
- ccxt/pro/bitstamp.py +2 -2
- ccxt/pro/bittrex.py +3 -3
- ccxt/pro/bitvavo.py +3 -3
- ccxt/pro/blockchaincom.py +2 -2
- ccxt/pro/bybit.py +4 -4
- ccxt/pro/cex.py +3 -3
- ccxt/pro/coinbasepro.py +3 -3
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/cryptocom.py +5 -5
- ccxt/pro/deribit.py +3 -3
- ccxt/pro/exmo.py +2 -2
- ccxt/pro/gate.py +3 -3
- ccxt/pro/gemini.py +2 -2
- ccxt/pro/hitbtc.py +4 -4
- ccxt/pro/hollaex.py +3 -3
- ccxt/pro/htx.py +3 -3
- ccxt/pro/idex.py +3 -3
- ccxt/pro/kraken.py +7 -7
- ccxt/pro/krakenfutures.py +4 -4
- ccxt/pro/kucoin.py +3 -3
- ccxt/pro/kucoinfutures.py +3 -3
- ccxt/pro/mexc.py +3 -3
- ccxt/pro/okcoin.py +2 -2
- ccxt/pro/okx.py +6 -6
- ccxt/pro/phemex.py +3 -3
- ccxt/pro/poloniex.py +3 -3
- ccxt/pro/poloniexfutures.py +3 -3
- ccxt/pro/probit.py +3 -3
- ccxt/pro/wazirx.py +3 -3
- ccxt/pro/whitebit.py +3 -3
- ccxt/pro/woo.py +2 -2
- ccxt/probit.py +22 -22
- ccxt/test/base/test_shared_methods.py +3 -3
- ccxt/test/test_async.py +543 -535
- ccxt/test/test_sync.py +542 -534
- ccxt/tidex.py +15 -15
- ccxt/timex.py +20 -20
- ccxt/tokocrypto.py +16 -16
- ccxt/upbit.py +15 -15
- ccxt/wavesexchange.py +12 -12
- ccxt/wazirx.py +13 -13
- ccxt/whitebit.py +26 -26
- ccxt/woo.py +47 -47
- ccxt/yobit.py +8 -8
- ccxt/zaif.py +10 -10
- ccxt/zonda.py +16 -16
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/METADATA +10 -8
- ccxt-4.1.56.dist-info/RECORD +449 -0
- ccxt/async_support/bitstamp1.py +0 -402
- ccxt/async_support/lbank2.py +0 -2620
- ccxt/bitstamp1.py +0 -402
- ccxt/lbank2.py +0 -2619
- ccxt-4.1.54.dist-info/RECORD +0 -453
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/WHEEL +0 -0
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/top_level.txt +0 -0
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, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType,
|
10
|
+
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -174,6 +174,7 @@ class binance(Exchange, ImplicitAPI):
|
|
174
174
|
'dapiPrivate': 'https://testnet.binancefuture.com/dapi/v1',
|
175
175
|
'dapiPrivateV2': 'https://testnet.binancefuture.com/dapi/v2',
|
176
176
|
'fapiPublic': 'https://testnet.binancefuture.com/fapi/v1',
|
177
|
+
'fapiPublicV2': 'https://testnet.binancefuture.com/fapi/v2',
|
177
178
|
'fapiPrivate': 'https://testnet.binancefuture.com/fapi/v1',
|
178
179
|
'fapiPrivateV2': 'https://testnet.binancefuture.com/fapi/v2',
|
179
180
|
'public': 'https://testnet.binance.vision/api/v3',
|
@@ -192,6 +193,7 @@ class binance(Exchange, ImplicitAPI):
|
|
192
193
|
'dapiPrivateV2': 'https://dapi.binance.com/dapi/v2',
|
193
194
|
'dapiData': 'https://dapi.binance.com/futures/data',
|
194
195
|
'fapiPublic': 'https://fapi.binance.com/fapi/v1',
|
196
|
+
'fapiPublicV2': 'https://fapi.binance.com/fapi/v2',
|
195
197
|
'fapiPrivate': 'https://fapi.binance.com/fapi/v1',
|
196
198
|
'fapiData': 'https://fapi.binance.com/futures/data',
|
197
199
|
'fapiPrivateV2': 'https://fapi.binance.com/fapi/v2',
|
@@ -809,6 +811,11 @@ class binance(Exchange, ImplicitAPI):
|
|
809
811
|
'listenKey': 1,
|
810
812
|
},
|
811
813
|
},
|
814
|
+
'fapiPublicV2': {
|
815
|
+
'get': {
|
816
|
+
'ticker/price': 0,
|
817
|
+
},
|
818
|
+
},
|
812
819
|
'fapiPrivateV2': {
|
813
820
|
'get': {
|
814
821
|
'account': 1,
|
@@ -2775,7 +2782,7 @@ class binance(Exchange, ImplicitAPI):
|
|
2775
2782
|
orderbook['nonce'] = self.safe_integer_2(response, 'lastUpdateId', 'u')
|
2776
2783
|
return orderbook
|
2777
2784
|
|
2778
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
2785
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
2779
2786
|
#
|
2780
2787
|
# {
|
2781
2788
|
# "symbol": "ETHBTC",
|
@@ -3028,7 +3035,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3028
3035
|
type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
|
3029
3036
|
response = None
|
3030
3037
|
if self.is_linear(type, subType):
|
3031
|
-
response = self.
|
3038
|
+
response = self.fapiPublicV2GetTickerPrice(params)
|
3032
3039
|
#
|
3033
3040
|
# [
|
3034
3041
|
# {
|
@@ -3066,7 +3073,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3066
3073
|
raise NotSupported(self.id + ' fetchLastPrices() does not support ' + type + ' markets yet')
|
3067
3074
|
return self.parse_last_prices(response, symbols)
|
3068
3075
|
|
3069
|
-
def parse_last_price(self, info, market=None):
|
3076
|
+
def parse_last_price(self, info, market: Market = None):
|
3070
3077
|
#
|
3071
3078
|
# spot
|
3072
3079
|
#
|
@@ -3142,7 +3149,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3142
3149
|
response = getattr(self, method)(query)
|
3143
3150
|
return self.parse_tickers(response, symbols)
|
3144
3151
|
|
3145
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
3152
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
3146
3153
|
# when api method = publicGetKlines or fapiPublicGetKlines or dapiPublicGetKlines
|
3147
3154
|
# [
|
3148
3155
|
# 1591478520000, # open time
|
@@ -3308,7 +3315,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3308
3315
|
#
|
3309
3316
|
return self.parse_ohlcvs(response, market, timeframe, since, limit)
|
3310
3317
|
|
3311
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
3318
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
3312
3319
|
if 'isDustTrade' in trade:
|
3313
3320
|
return self.parse_dust_trade(trade, market)
|
3314
3321
|
#
|
@@ -3916,7 +3923,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3916
3923
|
}
|
3917
3924
|
return self.safe_string(statuses, status, status)
|
3918
3925
|
|
3919
|
-
def parse_order(self, order, market=None) -> Order:
|
3926
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
3920
3927
|
#
|
3921
3928
|
# spot
|
3922
3929
|
#
|
@@ -4462,7 +4469,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4462
4469
|
requestParams = self.omit(params, ['quoteOrderQty', 'cost', 'stopPrice', 'test', 'type', 'newClientOrderId', 'clientOrderId', 'postOnly'])
|
4463
4470
|
return self.extend(request, requestParams)
|
4464
4471
|
|
4465
|
-
def fetch_order(self, id: str, symbol:
|
4472
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
4466
4473
|
"""
|
4467
4474
|
fetches information on an order made by the user
|
4468
4475
|
:see: https://binance-docs.github.io/apidocs/spot/en/#query-order-user_data
|
@@ -4507,7 +4514,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4507
4514
|
response = getattr(self, method)(self.extend(request, requestParams))
|
4508
4515
|
return self.parse_order(response, market)
|
4509
4516
|
|
4510
|
-
def fetch_orders(self, symbol:
|
4517
|
+
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4511
4518
|
"""
|
4512
4519
|
fetches information on multiple orders made by the user
|
4513
4520
|
:see: https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
|
@@ -4633,7 +4640,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4633
4640
|
#
|
4634
4641
|
return self.parse_orders(response, market, since, limit)
|
4635
4642
|
|
4636
|
-
def fetch_open_orders(self, symbol:
|
4643
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4637
4644
|
"""
|
4638
4645
|
:see: https://binance-docs.github.io/apidocs/spot/en/#cancel-an-existing-order-and-send-a-new-order-trade
|
4639
4646
|
:see: https://binance-docs.github.io/apidocs/futures/en/#current-all-open-orders-user_data
|
@@ -4696,7 +4703,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4696
4703
|
response = getattr(self, method)(self.extend(request, requestParams))
|
4697
4704
|
return self.parse_orders(response, market, since, limit)
|
4698
4705
|
|
4699
|
-
def fetch_closed_orders(self, symbol:
|
4706
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4700
4707
|
"""
|
4701
4708
|
fetches information on multiple closed orders made by the user
|
4702
4709
|
:see: https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
|
@@ -4714,7 +4721,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4714
4721
|
orders = self.fetch_orders(symbol, since, limit, params)
|
4715
4722
|
return self.filter_by(orders, 'status', 'closed')
|
4716
4723
|
|
4717
|
-
def fetch_canceled_orders(self, symbol:
|
4724
|
+
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4718
4725
|
"""
|
4719
4726
|
fetches information on multiple canceled orders made by the user
|
4720
4727
|
:see: https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
|
@@ -4737,7 +4744,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4737
4744
|
filteredOrders = self.filter_by(orders, 'status', 'canceled')
|
4738
4745
|
return self.filter_by_limit(filteredOrders, limit)
|
4739
4746
|
|
4740
|
-
def cancel_order(self, id: str, symbol:
|
4747
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
4741
4748
|
"""
|
4742
4749
|
cancels an open order
|
4743
4750
|
:see: https://binance-docs.github.io/apidocs/spot/en/#cancel-order-trade
|
@@ -4784,7 +4791,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4784
4791
|
response = getattr(self, method)(self.extend(request, requestParams))
|
4785
4792
|
return self.parse_order(response, market)
|
4786
4793
|
|
4787
|
-
def cancel_all_orders(self, symbol:
|
4794
|
+
def cancel_all_orders(self, symbol: Str = None, params={}):
|
4788
4795
|
"""
|
4789
4796
|
:see: https://binance-docs.github.io/apidocs/spot/en/#cancel-all-open-orders-on-a-symbol-trade
|
4790
4797
|
:see: https://binance-docs.github.io/apidocs/futures/en/#cancel-all-open-orders-trade
|
@@ -4823,7 +4830,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4823
4830
|
else:
|
4824
4831
|
return response
|
4825
4832
|
|
4826
|
-
def cancel_orders(self, ids: List[Int], symbol:
|
4833
|
+
def cancel_orders(self, ids: List[Int], symbol: Str = None, params={}):
|
4827
4834
|
"""
|
4828
4835
|
cancel multiple orders
|
4829
4836
|
:see: https://binance-docs.github.io/apidocs/futures/en/#cancel-multiple-orders-trade
|
@@ -4888,7 +4895,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4888
4895
|
#
|
4889
4896
|
return self.parse_orders(response, market)
|
4890
4897
|
|
4891
|
-
def fetch_order_trades(self, id: str, symbol:
|
4898
|
+
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4892
4899
|
"""
|
4893
4900
|
fetch all the trades made from a single order
|
4894
4901
|
:see: https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
|
@@ -4914,7 +4921,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4914
4921
|
}
|
4915
4922
|
return self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
|
4916
4923
|
|
4917
|
-
def fetch_my_trades(self, symbol:
|
4924
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4918
4925
|
"""
|
4919
4926
|
fetch all trades made by the user
|
4920
4927
|
:see: https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
|
@@ -5047,7 +5054,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5047
5054
|
#
|
5048
5055
|
return self.parse_trades(response, market, since, limit)
|
5049
5056
|
|
5050
|
-
def fetch_my_dust_trades(self, symbol:
|
5057
|
+
def fetch_my_dust_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5051
5058
|
"""
|
5052
5059
|
fetch all dust trades made by the user
|
5053
5060
|
:see: https://binance-docs.github.io/apidocs/spot/en/#dustlog-user_data
|
@@ -5109,7 +5116,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5109
5116
|
trades = self.parse_trades(data, None, since, limit)
|
5110
5117
|
return self.filter_by_since_limit(trades, since, limit)
|
5111
5118
|
|
5112
|
-
def parse_dust_trade(self, trade, market=None):
|
5119
|
+
def parse_dust_trade(self, trade, market: Market = None):
|
5113
5120
|
#
|
5114
5121
|
# {
|
5115
5122
|
# "fromAsset": "USDT",
|
@@ -5176,7 +5183,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5176
5183
|
'info': trade,
|
5177
5184
|
}
|
5178
5185
|
|
5179
|
-
def fetch_deposits(self, code:
|
5186
|
+
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
5180
5187
|
"""
|
5181
5188
|
:see: https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data
|
5182
5189
|
fetch all deposits made to an account
|
@@ -5277,7 +5284,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5277
5284
|
response[i]['type'] = 'deposit'
|
5278
5285
|
return self.parse_transactions(response, currency, since, limit)
|
5279
5286
|
|
5280
|
-
def fetch_withdrawals(self, code:
|
5287
|
+
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
5281
5288
|
"""
|
5282
5289
|
:see: https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data
|
5283
5290
|
:see: https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
|
@@ -5436,7 +5443,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5436
5443
|
statuses = self.safe_value(statusesByType, type, {})
|
5437
5444
|
return self.safe_string(statuses, status, status)
|
5438
5445
|
|
5439
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
5446
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
5440
5447
|
#
|
5441
5448
|
# fetchDeposits
|
5442
5449
|
#
|
@@ -5564,7 +5571,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5564
5571
|
}
|
5565
5572
|
return self.safe_string(statuses, status, status)
|
5566
5573
|
|
5567
|
-
def parse_transfer(self, transfer, currency=None):
|
5574
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
5568
5575
|
#
|
5569
5576
|
# transfer
|
5570
5577
|
#
|
@@ -5611,7 +5618,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5611
5618
|
'status': status,
|
5612
5619
|
}
|
5613
5620
|
|
5614
|
-
def parse_income(self, income, market=None):
|
5621
|
+
def parse_income(self, income, market: Market = None):
|
5615
5622
|
#
|
5616
5623
|
# {
|
5617
5624
|
# "symbol": "ETHUSDT",
|
@@ -5720,7 +5727,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5720
5727
|
#
|
5721
5728
|
return self.parse_transfer(response, currency)
|
5722
5729
|
|
5723
|
-
def fetch_transfers(self, code:
|
5730
|
+
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
5724
5731
|
"""
|
5725
5732
|
:see: https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer-user_data
|
5726
5733
|
fetch a history of internal transfers made on an account
|
@@ -6019,7 +6026,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6019
6026
|
#
|
6020
6027
|
return self.parse_deposit_withdraw_fees(response, codes, 'coin')
|
6021
6028
|
|
6022
|
-
def parse_deposit_withdraw_fee(self, fee, currency=None):
|
6029
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
6023
6030
|
#
|
6024
6031
|
# {
|
6025
6032
|
# "coin": "BAT",
|
@@ -6120,7 +6127,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6120
6127
|
# {id: '9a67628b16ba4988ae20d329333f16bc'}
|
6121
6128
|
return self.parse_transaction(response, currency)
|
6122
6129
|
|
6123
|
-
def parse_trading_fee(self, fee, market=None):
|
6130
|
+
def parse_trading_fee(self, fee, market: Market = None):
|
6124
6131
|
#
|
6125
6132
|
# spot
|
6126
6133
|
# [
|
@@ -6431,7 +6438,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6431
6438
|
#
|
6432
6439
|
return self.parse_funding_rate(response, market)
|
6433
6440
|
|
6434
|
-
def fetch_funding_rate_history(self, symbol:
|
6441
|
+
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6435
6442
|
"""
|
6436
6443
|
fetches historical funding rate prices
|
6437
6444
|
:see: https://binance-docs.github.io/apidocs/futures/en/#get-funding-rate-history
|
@@ -6529,7 +6536,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6529
6536
|
result.append(parsed)
|
6530
6537
|
return self.filter_by_array(result, 'symbol', symbols)
|
6531
6538
|
|
6532
|
-
def parse_funding_rate(self, contract, market=None):
|
6539
|
+
def parse_funding_rate(self, contract, market: Market = None):
|
6533
6540
|
# ensure it matches with https://www.binance.com/en/futures/funding-history/0
|
6534
6541
|
#
|
6535
6542
|
# {
|
@@ -6601,7 +6608,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6601
6608
|
result.append(parsed)
|
6602
6609
|
return result
|
6603
6610
|
|
6604
|
-
def parse_account_position(self, position, market=None):
|
6611
|
+
def parse_account_position(self, position, market: Market = None):
|
6605
6612
|
#
|
6606
6613
|
# usdm
|
6607
6614
|
# {
|
@@ -6785,7 +6792,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6785
6792
|
'percentage': percentage,
|
6786
6793
|
}
|
6787
6794
|
|
6788
|
-
def parse_position_risk(self, position, market=None):
|
6795
|
+
def parse_position_risk(self, position, market: Market = None):
|
6789
6796
|
#
|
6790
6797
|
# usdm
|
6791
6798
|
#
|
@@ -7041,7 +7048,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7041
7048
|
#
|
7042
7049
|
return self.parse_leverage_tiers(response, symbols, 'symbol')
|
7043
7050
|
|
7044
|
-
def parse_market_leverage_tiers(self, info, market=None):
|
7051
|
+
def parse_market_leverage_tiers(self, info, market: Market = None):
|
7045
7052
|
"""
|
7046
7053
|
* @ignore
|
7047
7054
|
:param dict info: Exchange response for 1 market
|
@@ -7173,7 +7180,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7173
7180
|
result.append(self.parse_position(response[i], market))
|
7174
7181
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
7175
7182
|
|
7176
|
-
def parse_position(self, position, market=None):
|
7183
|
+
def parse_position(self, position, market: Market = None):
|
7177
7184
|
#
|
7178
7185
|
# {
|
7179
7186
|
# "entryPrice": "27.70000000",
|
@@ -7367,7 +7374,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7367
7374
|
symbols = self.market_symbols(symbols)
|
7368
7375
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
7369
7376
|
|
7370
|
-
def fetch_funding_history(self, symbol:
|
7377
|
+
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7371
7378
|
"""
|
7372
7379
|
fetch the history of funding payments paid and received on self account
|
7373
7380
|
:see: https://binance-docs.github.io/apidocs/futures/en/#get-income-history-user_data
|
@@ -7407,7 +7414,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7407
7414
|
response = getattr(self, method)(self.extend(request, params))
|
7408
7415
|
return self.parse_incomes(response, market, since, limit)
|
7409
7416
|
|
7410
|
-
def set_leverage(self, leverage, symbol:
|
7417
|
+
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
7411
7418
|
"""
|
7412
7419
|
set the level of leverage for a market
|
7413
7420
|
:see: https://binance-docs.github.io/apidocs/futures/en/#change-initial-leverage-trade
|
@@ -7437,7 +7444,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7437
7444
|
}
|
7438
7445
|
return getattr(self, method)(self.extend(request, params))
|
7439
7446
|
|
7440
|
-
def set_margin_mode(self, marginMode: str, symbol:
|
7447
|
+
def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
7441
7448
|
"""
|
7442
7449
|
set margin mode to 'cross' or 'isolated'
|
7443
7450
|
:see: https://binance-docs.github.io/apidocs/futures/en/#change-margin-type-trade
|
@@ -7492,7 +7499,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7492
7499
|
raise e
|
7493
7500
|
return response
|
7494
7501
|
|
7495
|
-
def set_position_mode(self, hedged, symbol:
|
7502
|
+
def set_position_mode(self, hedged, symbol: Str = None, params={}):
|
7496
7503
|
"""
|
7497
7504
|
set hedged to True or False for a market
|
7498
7505
|
:see: https://binance-docs.github.io/apidocs/futures/en/#change-position-mode-trade
|
@@ -7527,7 +7534,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7527
7534
|
#
|
7528
7535
|
return getattr(self, method)(self.extend(request, params))
|
7529
7536
|
|
7530
|
-
def fetch_settlement_history(self, symbol:
|
7537
|
+
def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7531
7538
|
"""
|
7532
7539
|
fetches historical settlement records
|
7533
7540
|
:see: https://binance-docs.github.io/apidocs/voptions/en/#historical-exercise-records
|
@@ -7567,7 +7574,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7567
7574
|
sorted = self.sort_by(settlements, 'timestamp')
|
7568
7575
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
7569
7576
|
|
7570
|
-
def fetch_my_settlement_history(self, symbol:
|
7577
|
+
def fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
7571
7578
|
"""
|
7572
7579
|
fetches historical settlement records of the user
|
7573
7580
|
:see: https://binance-docs.github.io/apidocs/voptions/en/#user-exercise-record-user_data
|
@@ -7696,7 +7703,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7696
7703
|
result.append(self.parse_settlement(settlements[i], market))
|
7697
7704
|
return result
|
7698
7705
|
|
7699
|
-
def fetch_ledger(self, code:
|
7706
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
7700
7707
|
"""
|
7701
7708
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
7702
7709
|
:see: https://binance-docs.github.io/apidocs/voptions/en/#account-funding-flow-user_data
|
@@ -7773,7 +7780,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7773
7780
|
#
|
7774
7781
|
return self.parse_ledger(response, currency, since, limit)
|
7775
7782
|
|
7776
|
-
def parse_ledger_entry(self, item, currency=None):
|
7783
|
+
def parse_ledger_entry(self, item, currency: Currency = None):
|
7777
7784
|
#
|
7778
7785
|
# options(eapi)
|
7779
7786
|
#
|
@@ -8068,7 +8075,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8068
8075
|
'code': code,
|
8069
8076
|
})
|
8070
8077
|
|
8071
|
-
def parse_margin_modification(self, data, market=None):
|
8078
|
+
def parse_margin_modification(self, data, market: Market = None):
|
8072
8079
|
rawType = self.safe_integer(data, 'type')
|
8073
8080
|
resultType = 'add' if (rawType == 1) else 'reduce'
|
8074
8081
|
resultAmount = self.safe_number(data, 'amount')
|
@@ -8183,7 +8190,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8183
8190
|
sorted = self.sort_by(result, 'timestamp')
|
8184
8191
|
return self.filter_by_currency_since_limit(sorted, code, since, limit)
|
8185
8192
|
|
8186
|
-
def parse_borrow_rate(self, info, currency=None):
|
8193
|
+
def parse_borrow_rate(self, info, currency: Currency = None):
|
8187
8194
|
#
|
8188
8195
|
# {
|
8189
8196
|
# "asset": "USDT",
|
@@ -8193,9 +8200,9 @@ class binance(Exchange, ImplicitAPI):
|
|
8193
8200
|
# }
|
8194
8201
|
#
|
8195
8202
|
timestamp = self.safe_number(info, 'timestamp')
|
8196
|
-
|
8203
|
+
currencyId = self.safe_string(info, 'asset')
|
8197
8204
|
return {
|
8198
|
-
'currency': self.safe_currency_code(currency),
|
8205
|
+
'currency': self.safe_currency_code(currencyId, currency),
|
8199
8206
|
'rate': self.safe_number(info, 'dailyInterestRate'),
|
8200
8207
|
'period': 86400000,
|
8201
8208
|
'timestamp': timestamp,
|
@@ -8286,7 +8293,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8286
8293
|
#
|
8287
8294
|
return response
|
8288
8295
|
|
8289
|
-
def fetch_borrow_interest(self, code:
|
8296
|
+
def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
8290
8297
|
"""
|
8291
8298
|
fetch the interest owed by the user for borrowing currency for margin trading
|
8292
8299
|
:see: https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data
|
@@ -8331,7 +8338,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8331
8338
|
interest = self.parse_borrow_interests(rows, market)
|
8332
8339
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
8333
8340
|
|
8334
|
-
def parse_borrow_interest(self, info, market=None):
|
8341
|
+
def parse_borrow_interest(self, info, market: Market = None):
|
8335
8342
|
symbol = self.safe_string(info, 'isolatedSymbol')
|
8336
8343
|
timestamp = self.safe_number(info, 'interestAccuredTime')
|
8337
8344
|
marginMode = 'cross' if (symbol is None) else 'isolated'
|
@@ -8348,7 +8355,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8348
8355
|
'info': info,
|
8349
8356
|
}
|
8350
8357
|
|
8351
|
-
def repay_margin(self, code: str, amount, symbol:
|
8358
|
+
def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
|
8352
8359
|
"""
|
8353
8360
|
repay borrowed margin and interest
|
8354
8361
|
:see: https://binance-docs.github.io/apidocs/spot/en/#margin-account-repay-margin
|
@@ -8379,7 +8386,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8379
8386
|
#
|
8380
8387
|
return self.parse_margin_loan(response, currency)
|
8381
8388
|
|
8382
|
-
def borrow_margin(self, code: str, amount, symbol:
|
8389
|
+
def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
|
8383
8390
|
"""
|
8384
8391
|
create a loan to borrow margin
|
8385
8392
|
:see: https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-margin
|
@@ -8410,7 +8417,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8410
8417
|
#
|
8411
8418
|
return self.parse_margin_loan(response, currency)
|
8412
8419
|
|
8413
|
-
def parse_margin_loan(self, info, currency=None):
|
8420
|
+
def parse_margin_loan(self, info, currency: Currency = None):
|
8414
8421
|
#
|
8415
8422
|
# {
|
8416
8423
|
# "tranId": 108988250265,
|
@@ -8549,7 +8556,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8549
8556
|
else:
|
8550
8557
|
return self.parse_open_interest(response, market)
|
8551
8558
|
|
8552
|
-
def parse_open_interest(self, interest, market=None):
|
8559
|
+
def parse_open_interest(self, interest, market: Market = None):
|
8553
8560
|
timestamp = self.safe_integer_2(interest, 'timestamp', 'time')
|
8554
8561
|
id = self.safe_string(interest, 'symbol')
|
8555
8562
|
amount = self.safe_number_2(interest, 'sumOpenInterest', 'openInterest')
|
@@ -8567,7 +8574,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8567
8574
|
'info': interest,
|
8568
8575
|
}, market)
|
8569
8576
|
|
8570
|
-
def fetch_my_liquidations(self, symbol:
|
8577
|
+
def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
8571
8578
|
"""
|
8572
8579
|
retrieves the users liquidated positions
|
8573
8580
|
:see: https://binance-docs.github.io/apidocs/spot/en/#get-force-liquidation-record-user_data
|
@@ -8696,7 +8703,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8696
8703
|
liquidations = self.safe_value(response, 'rows', response)
|
8697
8704
|
return self.parse_liquidations(liquidations, market, since, limit)
|
8698
8705
|
|
8699
|
-
def parse_liquidation(self, liquidation, market=None):
|
8706
|
+
def parse_liquidation(self, liquidation, market: Market = None):
|
8700
8707
|
#
|
8701
8708
|
# margin
|
8702
8709
|
#
|
@@ -8812,7 +8819,7 @@ class binance(Exchange, ImplicitAPI):
|
|
8812
8819
|
#
|
8813
8820
|
return self.parse_greeks(response[0], market)
|
8814
8821
|
|
8815
|
-
def parse_greeks(self, greeks, market=None):
|
8822
|
+
def parse_greeks(self, greeks, market: Market = None):
|
8816
8823
|
#
|
8817
8824
|
# {
|
8818
8825
|
# "symbol": "BTC-231229-40000-C",
|