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/async_support/bybit.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bybit import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, Greeks, Int, 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
|
@@ -1833,7 +1833,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1833
1833
|
})
|
1834
1834
|
return result
|
1835
1835
|
|
1836
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
1836
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1837
1837
|
#
|
1838
1838
|
# spot
|
1839
1839
|
#
|
@@ -2105,7 +2105,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2105
2105
|
tickers[symbol] = ticker
|
2106
2106
|
return self.filter_by_array_tickers(tickers, 'symbol', symbols)
|
2107
2107
|
|
2108
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
2108
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
2109
2109
|
#
|
2110
2110
|
# [
|
2111
2111
|
# "1621162800",
|
@@ -2225,7 +2225,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2225
2225
|
ohlcvs = self.safe_value(result, 'list', [])
|
2226
2226
|
return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
|
2227
2227
|
|
2228
|
-
def parse_funding_rate(self, ticker, market=None):
|
2228
|
+
def parse_funding_rate(self, ticker, market: Market = None):
|
2229
2229
|
# {
|
2230
2230
|
# "symbol": "BTCUSDT",
|
2231
2231
|
# "bidPrice": "19255",
|
@@ -2352,7 +2352,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2352
2352
|
fundingRates[symbol] = ticker
|
2353
2353
|
return self.filter_by_array(fundingRates, 'symbol', symbols)
|
2354
2354
|
|
2355
|
-
async def fetch_funding_rate_history(self, symbol:
|
2355
|
+
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2356
2356
|
"""
|
2357
2357
|
fetches historical funding rate prices
|
2358
2358
|
:see: https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
|
@@ -2434,7 +2434,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2434
2434
|
sorted = self.sort_by(rates, 'timestamp')
|
2435
2435
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
2436
2436
|
|
2437
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
2437
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
2438
2438
|
#
|
2439
2439
|
# public https://bybit-exchange.github.io/docs/v5/market/recent-trade
|
2440
2440
|
#
|
@@ -3049,7 +3049,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3049
3049
|
}
|
3050
3050
|
return self.safe_string(timeInForces, timeInForce, timeInForce)
|
3051
3051
|
|
3052
|
-
def parse_order(self, order, market=None) -> Order:
|
3052
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
3053
3053
|
#
|
3054
3054
|
# v1 for usdc normal account
|
3055
3055
|
# {
|
@@ -3246,7 +3246,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3246
3246
|
'trades': None,
|
3247
3247
|
}, market)
|
3248
3248
|
|
3249
|
-
async def fetch_order(self, id: str, symbol:
|
3249
|
+
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
3250
3250
|
"""
|
3251
3251
|
fetches information on an order made by the user
|
3252
3252
|
:see: https://bybit-exchange.github.io/docs/v5/order/order-list
|
@@ -3789,7 +3789,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3789
3789
|
'id': self.safe_string(result, 'orderId'),
|
3790
3790
|
})
|
3791
3791
|
|
3792
|
-
async def cancel_usdc_order(self, id, symbol:
|
3792
|
+
async def cancel_usdc_order(self, id, symbol: Str = None, params={}):
|
3793
3793
|
self.check_required_symbol('cancelUsdcOrder', symbol)
|
3794
3794
|
await self.load_markets()
|
3795
3795
|
market = self.market(symbol)
|
@@ -3824,7 +3824,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3824
3824
|
result = self.safe_value(response, 'result', {})
|
3825
3825
|
return self.parse_order(result, market)
|
3826
3826
|
|
3827
|
-
async def cancel_order(self, id: str, symbol:
|
3827
|
+
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
3828
3828
|
"""
|
3829
3829
|
cancels an open order
|
3830
3830
|
:see: https://bybit-exchange.github.io/docs/v5/order/cancel-order
|
@@ -3881,7 +3881,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3881
3881
|
result = self.safe_value(response, 'result', {})
|
3882
3882
|
return self.parse_order(result, market)
|
3883
3883
|
|
3884
|
-
async def cancel_all_usdc_orders(self, symbol:
|
3884
|
+
async def cancel_all_usdc_orders(self, symbol: Str = None, params={}):
|
3885
3885
|
self.check_required_symbol('cancelAllUsdcOrders', symbol)
|
3886
3886
|
await self.load_markets()
|
3887
3887
|
market = self.market(symbol)
|
@@ -3921,7 +3921,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3921
3921
|
return response
|
3922
3922
|
return self.parse_orders(result, market)
|
3923
3923
|
|
3924
|
-
async def cancel_all_orders(self, symbol:
|
3924
|
+
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
3925
3925
|
"""
|
3926
3926
|
cancel all open orders
|
3927
3927
|
:see: https://bybit-exchange.github.io/docs/v5/order/cancel-all
|
@@ -3994,7 +3994,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3994
3994
|
return response
|
3995
3995
|
return self.parse_orders(orders, market)
|
3996
3996
|
|
3997
|
-
async def fetch_usdc_orders(self, symbol:
|
3997
|
+
async def fetch_usdc_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3998
3998
|
await self.load_markets()
|
3999
3999
|
market = None
|
4000
4000
|
request = {
|
@@ -4076,7 +4076,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4076
4076
|
data = self.safe_value(result, 'dataList', [])
|
4077
4077
|
return self.parse_orders(data, market, since, limit)
|
4078
4078
|
|
4079
|
-
async def fetch_orders(self, symbol:
|
4079
|
+
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4080
4080
|
"""
|
4081
4081
|
fetches information on multiple orders made by the user
|
4082
4082
|
:see: https://bybit-exchange.github.io/docs/v5/order/order-list
|
@@ -4181,7 +4181,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4181
4181
|
data = self.add_pagination_cursor_to_result(response)
|
4182
4182
|
return self.parse_orders(data, market, since, limit)
|
4183
4183
|
|
4184
|
-
async def fetch_closed_orders(self, symbol:
|
4184
|
+
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4185
4185
|
"""
|
4186
4186
|
fetches information on multiple closed orders made by the user
|
4187
4187
|
:see: https://bybit-exchange.github.io/docs/v5/order/order-list
|
@@ -4197,7 +4197,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4197
4197
|
}
|
4198
4198
|
return await self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
4199
4199
|
|
4200
|
-
async def fetch_canceled_orders(self, symbol:
|
4200
|
+
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4201
4201
|
"""
|
4202
4202
|
fetches information on multiple canceled orders made by the user
|
4203
4203
|
:see: https://bybit-exchange.github.io/docs/v5/order/order-list
|
@@ -4216,7 +4216,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4216
4216
|
}
|
4217
4217
|
return await self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
4218
4218
|
|
4219
|
-
async def fetch_usdc_open_orders(self, symbol:
|
4219
|
+
async def fetch_usdc_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4220
4220
|
await self.load_markets()
|
4221
4221
|
request = {}
|
4222
4222
|
market = None
|
@@ -4257,7 +4257,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4257
4257
|
#
|
4258
4258
|
return self.parse_orders(orders, market, since, limit)
|
4259
4259
|
|
4260
|
-
async def fetch_open_orders(self, symbol:
|
4260
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4261
4261
|
"""
|
4262
4262
|
fetch all unfilled currently open orders
|
4263
4263
|
:see: https://bybit-exchange.github.io/docs/v5/order/open-order
|
@@ -4357,7 +4357,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4357
4357
|
data = self.add_pagination_cursor_to_result(response)
|
4358
4358
|
return self.parse_orders(data, market, since, limit)
|
4359
4359
|
|
4360
|
-
async def fetch_order_trades(self, id: str, symbol:
|
4360
|
+
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4361
4361
|
"""
|
4362
4362
|
fetch all the trades made from a single order
|
4363
4363
|
:see: https://bybit-exchange.github.io/docs/v5/position/execution
|
@@ -4378,7 +4378,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4378
4378
|
params = self.omit(params, ['clientOrderId', 'orderLinkId'])
|
4379
4379
|
return await self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
|
4380
4380
|
|
4381
|
-
async def fetch_my_usdc_trades(self, symbol:
|
4381
|
+
async def fetch_my_usdc_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4382
4382
|
await self.load_markets()
|
4383
4383
|
market = None
|
4384
4384
|
request = {}
|
@@ -4421,7 +4421,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4421
4421
|
dataList = self.safe_value(result, 'dataList', [])
|
4422
4422
|
return self.parse_trades(dataList, market, since, limit)
|
4423
4423
|
|
4424
|
-
async def fetch_my_trades(self, symbol:
|
4424
|
+
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4425
4425
|
"""
|
4426
4426
|
fetch all trades made by the user
|
4427
4427
|
:see: https://bybit-exchange.github.io/docs/v5/position/execution
|
@@ -4514,7 +4514,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4514
4514
|
trades = self.add_pagination_cursor_to_result(response)
|
4515
4515
|
return self.parse_trades(trades, market, since, limit)
|
4516
4516
|
|
4517
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
4517
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
4518
4518
|
#
|
4519
4519
|
# {
|
4520
4520
|
# "chainType": "ERC20",
|
@@ -4622,7 +4622,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4622
4622
|
addressObject = self.safe_value(chainsIndexedById, selectedNetworkId, {})
|
4623
4623
|
return self.parse_deposit_address(addressObject, currency)
|
4624
4624
|
|
4625
|
-
async def fetch_deposits(self, code:
|
4625
|
+
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4626
4626
|
"""
|
4627
4627
|
fetch all deposits made to an account
|
4628
4628
|
:see: https://bybit-exchange.github.io/docs/v5/asset/deposit-record
|
@@ -4687,7 +4687,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4687
4687
|
data = self.add_pagination_cursor_to_result(response)
|
4688
4688
|
return self.parse_transactions(data, currency, since, limit)
|
4689
4689
|
|
4690
|
-
async def fetch_withdrawals(self, code:
|
4690
|
+
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4691
4691
|
"""
|
4692
4692
|
fetch all withdrawals made from an account
|
4693
4693
|
:see: https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
|
@@ -4782,7 +4782,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4782
4782
|
}
|
4783
4783
|
return self.safe_string(statuses, status, status)
|
4784
4784
|
|
4785
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
4785
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
4786
4786
|
#
|
4787
4787
|
# fetchWithdrawals
|
4788
4788
|
#
|
@@ -4860,7 +4860,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4860
4860
|
'comment': None,
|
4861
4861
|
}
|
4862
4862
|
|
4863
|
-
async def fetch_ledger(self, code:
|
4863
|
+
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
4864
4864
|
"""
|
4865
4865
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
4866
4866
|
:see: https://bybit-exchange.github.io/docs/v5/account/transaction-log
|
@@ -5016,7 +5016,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5016
5016
|
data = self.add_pagination_cursor_to_result(response)
|
5017
5017
|
return self.parse_ledger(data, currency, since, limit)
|
5018
5018
|
|
5019
|
-
def parse_ledger_entry(self, item, currency=None):
|
5019
|
+
def parse_ledger_entry(self, item, currency: Currency = None):
|
5020
5020
|
#
|
5021
5021
|
# {
|
5022
5022
|
# "id": 234467,
|
@@ -5395,7 +5395,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5395
5395
|
results.append(self.parse_position(rawPosition))
|
5396
5396
|
return self.filter_by_array_positions(results, 'symbol', symbols, False)
|
5397
5397
|
|
5398
|
-
def parse_position(self, position, market=None):
|
5398
|
+
def parse_position(self, position, market: Market = None):
|
5399
5399
|
#
|
5400
5400
|
# linear swap
|
5401
5401
|
#
|
@@ -5593,7 +5593,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5593
5593
|
'takeProfitPrice': self.safe_number_2(position, 'take_profit', 'takeProfit'),
|
5594
5594
|
})
|
5595
5595
|
|
5596
|
-
async def set_margin_mode(self, marginMode, symbol:
|
5596
|
+
async def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
|
5597
5597
|
"""
|
5598
5598
|
set margin mode(account) or trade mode(symbol)
|
5599
5599
|
:see: https://bybit-exchange.github.io/docs/v5/account/set-margin-mode
|
@@ -5675,7 +5675,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5675
5675
|
response = await self.privatePostV5PositionSwitchIsolated(self.extend(request, params))
|
5676
5676
|
return response
|
5677
5677
|
|
5678
|
-
async def set_leverage(self, leverage, symbol:
|
5678
|
+
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
5679
5679
|
"""
|
5680
5680
|
set the level of leverage for a market
|
5681
5681
|
:see: https://bybit-exchange.github.io/docs/v5/position/leverage
|
@@ -5718,7 +5718,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5718
5718
|
response = await self.privatePostV5PositionSetLeverage(self.extend(request, params))
|
5719
5719
|
return response
|
5720
5720
|
|
5721
|
-
async def set_position_mode(self, hedged, symbol:
|
5721
|
+
async def set_position_mode(self, hedged, symbol: Str = None, params={}):
|
5722
5722
|
"""
|
5723
5723
|
set hedged to True or False for a market
|
5724
5724
|
:see: https://bybit-exchange.github.io/docs/v5/position/position-mode
|
@@ -5898,7 +5898,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5898
5898
|
request['limit'] = limit
|
5899
5899
|
return await self.fetch_derivatives_open_interest_history(symbol, timeframe, since, limit, params)
|
5900
5900
|
|
5901
|
-
def parse_open_interest(self, interest, market=None):
|
5901
|
+
def parse_open_interest(self, interest, market: Market = None):
|
5902
5902
|
#
|
5903
5903
|
# {
|
5904
5904
|
# "openInterest": 64757.62400000,
|
@@ -5947,7 +5947,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5947
5947
|
data = self.safe_value(response, 'result', {})
|
5948
5948
|
return self.parse_borrow_rate(data, currency)
|
5949
5949
|
|
5950
|
-
def parse_borrow_rate(self, info, currency=None):
|
5950
|
+
def parse_borrow_rate(self, info, currency: Currency = None):
|
5951
5951
|
#
|
5952
5952
|
# {
|
5953
5953
|
# "coin": "USDT",
|
@@ -5967,7 +5967,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5967
5967
|
'info': info,
|
5968
5968
|
}
|
5969
5969
|
|
5970
|
-
async def fetch_borrow_interest(self, code:
|
5970
|
+
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5971
5971
|
"""
|
5972
5972
|
fetch the interest owed by the user for borrowing currency for margin trading
|
5973
5973
|
:see: https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/account-info
|
@@ -6011,7 +6011,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6011
6011
|
interest = self.parse_borrow_interests(rows, None)
|
6012
6012
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
6013
6013
|
|
6014
|
-
def parse_borrow_interest(self, info, market=None):
|
6014
|
+
def parse_borrow_interest(self, info, market: Market = None):
|
6015
6015
|
#
|
6016
6016
|
# {
|
6017
6017
|
# "tokenId": "BTC",
|
@@ -6085,7 +6085,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6085
6085
|
'status': status,
|
6086
6086
|
})
|
6087
6087
|
|
6088
|
-
async def fetch_transfers(self, code:
|
6088
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
6089
6089
|
"""
|
6090
6090
|
fetch a history of internal transfers made on an account
|
6091
6091
|
:see: https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
|
@@ -6138,7 +6138,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6138
6138
|
data = self.add_pagination_cursor_to_result(response)
|
6139
6139
|
return self.parse_transfers(data, currency, since, limit)
|
6140
6140
|
|
6141
|
-
async def borrow_margin(self, code: str, amount, symbol:
|
6141
|
+
async def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
|
6142
6142
|
"""
|
6143
6143
|
create a loan to borrow margin
|
6144
6144
|
:see: https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow
|
@@ -6176,7 +6176,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6176
6176
|
'amount': amount,
|
6177
6177
|
})
|
6178
6178
|
|
6179
|
-
async def repay_margin(self, code: str, amount, symbol:
|
6179
|
+
async def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
|
6180
6180
|
"""
|
6181
6181
|
repay borrowed margin and interest
|
6182
6182
|
:see: https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay
|
@@ -6214,7 +6214,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6214
6214
|
'amount': amount,
|
6215
6215
|
})
|
6216
6216
|
|
6217
|
-
def parse_margin_loan(self, info, currency=None):
|
6217
|
+
def parse_margin_loan(self, info, currency: Currency = None):
|
6218
6218
|
#
|
6219
6219
|
# borrowMargin
|
6220
6220
|
#
|
@@ -6246,7 +6246,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6246
6246
|
}
|
6247
6247
|
return self.safe_string(statuses, status, status)
|
6248
6248
|
|
6249
|
-
def parse_transfer(self, transfer, currency=None):
|
6249
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
6250
6250
|
#
|
6251
6251
|
# transfer
|
6252
6252
|
#
|
@@ -6340,7 +6340,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6340
6340
|
request['symbol'] = market['id']
|
6341
6341
|
return await self.fetch_derivatives_market_leverage_tiers(symbol, params)
|
6342
6342
|
|
6343
|
-
def parse_market_leverage_tiers(self, info, market=None):
|
6343
|
+
def parse_market_leverage_tiers(self, info, market: Market = None):
|
6344
6344
|
#
|
6345
6345
|
# {
|
6346
6346
|
# "id": 1,
|
@@ -6369,7 +6369,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6369
6369
|
minNotional = maxNotional
|
6370
6370
|
return tiers
|
6371
6371
|
|
6372
|
-
def parse_trading_fee(self, fee, market=None):
|
6372
|
+
def parse_trading_fee(self, fee, market: Market = None):
|
6373
6373
|
#
|
6374
6374
|
# {
|
6375
6375
|
# "symbol": "ETHUSDT",
|
@@ -6464,7 +6464,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6464
6464
|
result[symbol] = fee
|
6465
6465
|
return result
|
6466
6466
|
|
6467
|
-
def parse_deposit_withdraw_fee(self, fee, currency=None):
|
6467
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
6468
6468
|
#
|
6469
6469
|
# {
|
6470
6470
|
# "name": "BTC",
|
@@ -6559,7 +6559,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6559
6559
|
rows = self.safe_value(data, 'rows', [])
|
6560
6560
|
return self.parse_deposit_withdraw_fees(rows, codes, 'coin')
|
6561
6561
|
|
6562
|
-
async def fetch_settlement_history(self, symbol:
|
6562
|
+
async def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6563
6563
|
"""
|
6564
6564
|
fetches historical settlement records
|
6565
6565
|
:see: https://bybit-exchange.github.io/docs/v5/market/delivery-price
|
@@ -6610,7 +6610,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6610
6610
|
sorted = self.sort_by(settlements, 'timestamp')
|
6611
6611
|
return self.filter_by_symbol_since_limit(sorted, market['symbol'], since, limit)
|
6612
6612
|
|
6613
|
-
async def fetch_my_settlement_history(self, symbol:
|
6613
|
+
async def fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6614
6614
|
"""
|
6615
6615
|
fetches historical settlement records of the user
|
6616
6616
|
:see: https://bybit-exchange.github.io/docs/v5/asset/delivery
|
@@ -6848,7 +6848,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6848
6848
|
'datetime': self.iso8601(timestamp),
|
6849
6849
|
})
|
6850
6850
|
|
6851
|
-
def parse_greeks(self, greeks, market=None):
|
6851
|
+
def parse_greeks(self, greeks, market: Market = None):
|
6852
6852
|
#
|
6853
6853
|
# {
|
6854
6854
|
# "symbol": "BTC-26JAN24-39000-C",
|
ccxt/async_support/cex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.cex import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Balances, Int, Order, OrderBook, OrderSide, OrderType,
|
10
|
+
from ccxt.base.types import Balances, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -491,7 +491,7 @@ class cex(Exchange, ImplicitAPI):
|
|
491
491
|
timestamp = self.safe_timestamp(response, 'timestamp')
|
492
492
|
return self.parse_order_book(response, market['symbol'], timestamp)
|
493
493
|
|
494
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
494
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
495
495
|
#
|
496
496
|
# [
|
497
497
|
# 1591403940,
|
@@ -549,7 +549,7 @@ class cex(Exchange, ImplicitAPI):
|
|
549
549
|
return []
|
550
550
|
return None
|
551
551
|
|
552
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
552
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
553
553
|
timestamp = self.safe_timestamp(ticker, 'timestamp')
|
554
554
|
volume = self.safe_string(ticker, 'volume')
|
555
555
|
high = self.safe_string(ticker, 'high')
|
@@ -620,7 +620,7 @@ class cex(Exchange, ImplicitAPI):
|
|
620
620
|
ticker = await self.publicGetTickerPair(self.extend(request, params))
|
621
621
|
return self.parse_ticker(ticker, market)
|
622
622
|
|
623
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
623
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
624
624
|
#
|
625
625
|
# fetchTrades(public)
|
626
626
|
#
|
@@ -784,7 +784,7 @@ class cex(Exchange, ImplicitAPI):
|
|
784
784
|
'trades': None,
|
785
785
|
})
|
786
786
|
|
787
|
-
async def cancel_order(self, id: str, symbol:
|
787
|
+
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
788
788
|
"""
|
789
789
|
cancels an open order
|
790
790
|
:param str id: order id
|
@@ -800,7 +800,7 @@ class cex(Exchange, ImplicitAPI):
|
|
800
800
|
# 'true'
|
801
801
|
return self.extend(self.parse_order({}), {'info': response, 'type': None, 'id': id, 'status': 'canceled'})
|
802
802
|
|
803
|
-
def parse_order(self, order, market=None) -> Order:
|
803
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
804
804
|
# Depending on the call, 'time' can be a unix int, unix string or ISO string
|
805
805
|
# Yes, really
|
806
806
|
timestamp = self.safe_value(order, 'time')
|
@@ -1046,7 +1046,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1046
1046
|
'average': None,
|
1047
1047
|
})
|
1048
1048
|
|
1049
|
-
async def fetch_open_orders(self, symbol:
|
1049
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1050
1050
|
"""
|
1051
1051
|
fetch all unfilled currently open orders
|
1052
1052
|
:param str symbol: unified market symbol
|
@@ -1068,7 +1068,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1068
1068
|
orders[i] = self.extend(orders[i], {'status': 'open'})
|
1069
1069
|
return self.parse_orders(orders, market, since, limit)
|
1070
1070
|
|
1071
|
-
async def fetch_closed_orders(self, symbol:
|
1071
|
+
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1072
1072
|
"""
|
1073
1073
|
fetches information on multiple closed orders made by the user
|
1074
1074
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -1085,7 +1085,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1085
1085
|
response = await getattr(self, method)(self.extend(request, params))
|
1086
1086
|
return self.parse_orders(response, market, since, limit)
|
1087
1087
|
|
1088
|
-
async def fetch_order(self, id: str, symbol:
|
1088
|
+
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1089
1089
|
"""
|
1090
1090
|
fetches information on an order made by the user
|
1091
1091
|
:param str symbol: not used by cex fetchOrder
|
@@ -1200,7 +1200,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1200
1200
|
#
|
1201
1201
|
return self.parse_order(data)
|
1202
1202
|
|
1203
|
-
async def fetch_orders(self, symbol:
|
1203
|
+
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1204
1204
|
"""
|
1205
1205
|
fetches information on multiple orders made by the user
|
1206
1206
|
:param str symbol: unified market symbol of the market orders were made in
|