ccxt 4.3.30__py2.py3-none-any.whl → 4.3.32__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/abstract/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/ace.py +14 -14
- ccxt/alpaca.py +16 -16
- ccxt/ascendex.py +46 -46
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +14 -14
- ccxt/async_support/alpaca.py +16 -16
- ccxt/async_support/ascendex.py +46 -46
- ccxt/async_support/base/exchange.py +23 -23
- ccxt/async_support/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +21 -21
- ccxt/async_support/bit2c.py +13 -13
- ccxt/async_support/bitbank.py +19 -19
- ccxt/async_support/bitbns.py +17 -17
- ccxt/async_support/bitfinex.py +24 -24
- ccxt/async_support/bitfinex2.py +142 -109
- ccxt/async_support/bitflyer.py +23 -23
- ccxt/async_support/bitget.py +76 -76
- ccxt/async_support/bithumb.py +20 -20
- ccxt/async_support/bitmart.py +55 -55
- ccxt/async_support/bitmex.py +41 -41
- ccxt/async_support/bitopro.py +30 -30
- ccxt/async_support/bitrue.py +37 -37
- ccxt/async_support/bitso.py +30 -30
- ccxt/async_support/bitstamp.py +31 -31
- ccxt/async_support/bitteam.py +26 -26
- ccxt/async_support/bitvavo.py +27 -27
- ccxt/async_support/bl3p.py +8 -8
- ccxt/async_support/blockchaincom.py +24 -24
- ccxt/async_support/blofin.py +37 -37
- ccxt/async_support/btcalpha.py +19 -19
- ccxt/async_support/btcbox.py +11 -11
- ccxt/async_support/btcmarkets.py +22 -22
- ccxt/async_support/btcturk.py +13 -13
- ccxt/async_support/bybit.py +96 -96
- ccxt/async_support/cex.py +21 -21
- ccxt/async_support/coinbase.py +53 -53
- ccxt/async_support/coinbaseexchange.py +29 -29
- ccxt/async_support/coinbaseinternational.py +32 -32
- ccxt/async_support/coincheck.py +14 -14
- ccxt/async_support/coinex.py +208 -175
- ccxt/async_support/coinlist.py +35 -35
- ccxt/async_support/coinmate.py +22 -22
- ccxt/async_support/coinmetro.py +22 -22
- ccxt/async_support/coinone.py +18 -18
- ccxt/async_support/coinsph.py +32 -32
- ccxt/async_support/coinspot.py +8 -8
- ccxt/async_support/cryptocom.py +43 -43
- ccxt/async_support/currencycom.py +33 -33
- ccxt/async_support/delta.py +35 -35
- ccxt/async_support/deribit.py +54 -54
- ccxt/async_support/digifinex.py +56 -56
- ccxt/async_support/exmo.py +34 -34
- ccxt/async_support/gate.py +60 -60
- ccxt/async_support/gemini.py +24 -24
- ccxt/async_support/hitbtc.py +51 -51
- ccxt/async_support/hollaex.py +29 -29
- ccxt/async_support/htx.py +73 -73
- ccxt/async_support/huobijp.py +30 -30
- ccxt/async_support/hyperliquid.py +58 -58
- ccxt/async_support/idex.py +33 -33
- ccxt/async_support/independentreserve.py +12 -12
- ccxt/async_support/indodax.py +21 -21
- ccxt/async_support/kraken.py +46 -51
- ccxt/async_support/krakenfutures.py +29 -29
- ccxt/async_support/kucoin.py +51 -51
- ccxt/async_support/kucoinfutures.py +33 -33
- ccxt/async_support/kuna.py +27 -27
- ccxt/async_support/latoken.py +27 -27
- ccxt/async_support/lbank.py +35 -35
- ccxt/async_support/luno.py +19 -19
- ccxt/async_support/lykke.py +20 -20
- ccxt/async_support/mercado.py +17 -17
- ccxt/async_support/mexc.py +64 -64
- ccxt/async_support/ndax.py +38 -38
- ccxt/async_support/novadax.py +26 -26
- ccxt/async_support/oceanex.py +21 -21
- ccxt/async_support/okcoin.py +35 -35
- ccxt/async_support/okx.py +85 -85
- ccxt/async_support/onetrading.py +32 -32
- ccxt/async_support/p2b.py +14 -14
- ccxt/async_support/paymium.py +12 -12
- ccxt/async_support/phemex.py +50 -50
- ccxt/async_support/poloniex.py +35 -35
- ccxt/async_support/poloniexfutures.py +25 -21
- ccxt/async_support/probit.py +30 -30
- ccxt/async_support/timex.py +22 -22
- ccxt/async_support/tokocrypto.py +26 -26
- ccxt/async_support/tradeogre.py +12 -12
- ccxt/async_support/upbit.py +28 -28
- ccxt/async_support/wavesexchange.py +33 -33
- ccxt/async_support/wazirx.py +21 -21
- ccxt/async_support/whitebit.py +37 -37
- ccxt/async_support/woo.py +51 -51
- ccxt/async_support/woofipro.py +46 -46
- ccxt/async_support/yobit.py +20 -20
- ccxt/async_support/zaif.py +12 -12
- ccxt/async_support/zonda.py +22 -22
- ccxt/base/exchange.py +48 -36
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +21 -21
- ccxt/bit2c.py +13 -13
- ccxt/bitbank.py +19 -19
- ccxt/bitbns.py +17 -17
- ccxt/bitfinex.py +24 -24
- ccxt/bitfinex2.py +142 -109
- ccxt/bitflyer.py +23 -23
- ccxt/bitget.py +76 -76
- ccxt/bithumb.py +20 -20
- ccxt/bitmart.py +55 -55
- ccxt/bitmex.py +41 -41
- ccxt/bitopro.py +30 -30
- ccxt/bitrue.py +37 -37
- ccxt/bitso.py +30 -30
- ccxt/bitstamp.py +31 -31
- ccxt/bitteam.py +26 -26
- ccxt/bitvavo.py +27 -27
- ccxt/bl3p.py +8 -8
- ccxt/blockchaincom.py +24 -24
- ccxt/blofin.py +37 -37
- ccxt/btcalpha.py +19 -19
- ccxt/btcbox.py +11 -11
- ccxt/btcmarkets.py +22 -22
- ccxt/btcturk.py +13 -13
- ccxt/bybit.py +96 -96
- ccxt/cex.py +21 -21
- ccxt/coinbase.py +53 -53
- ccxt/coinbaseexchange.py +29 -29
- ccxt/coinbaseinternational.py +32 -32
- ccxt/coincheck.py +14 -14
- ccxt/coinex.py +208 -175
- ccxt/coinlist.py +35 -35
- ccxt/coinmate.py +22 -22
- ccxt/coinmetro.py +22 -22
- ccxt/coinone.py +18 -18
- ccxt/coinsph.py +32 -32
- ccxt/coinspot.py +8 -8
- ccxt/cryptocom.py +43 -43
- ccxt/currencycom.py +33 -33
- ccxt/delta.py +35 -35
- ccxt/deribit.py +54 -54
- ccxt/digifinex.py +56 -56
- ccxt/exmo.py +34 -34
- ccxt/gate.py +60 -60
- ccxt/gemini.py +24 -24
- ccxt/hitbtc.py +51 -51
- ccxt/hollaex.py +29 -29
- ccxt/htx.py +73 -73
- ccxt/huobijp.py +30 -30
- ccxt/hyperliquid.py +58 -58
- ccxt/idex.py +33 -33
- ccxt/independentreserve.py +12 -12
- ccxt/indodax.py +21 -21
- ccxt/kraken.py +46 -51
- ccxt/krakenfutures.py +29 -29
- ccxt/kucoin.py +51 -51
- ccxt/kucoinfutures.py +33 -33
- ccxt/kuna.py +27 -27
- ccxt/latoken.py +27 -27
- ccxt/lbank.py +35 -35
- ccxt/luno.py +19 -19
- ccxt/lykke.py +20 -20
- ccxt/mercado.py +17 -17
- ccxt/mexc.py +64 -64
- ccxt/ndax.py +38 -38
- ccxt/novadax.py +26 -26
- ccxt/oceanex.py +21 -21
- ccxt/okcoin.py +35 -35
- ccxt/okx.py +85 -85
- ccxt/onetrading.py +32 -32
- ccxt/p2b.py +14 -14
- ccxt/paymium.py +12 -12
- ccxt/phemex.py +50 -50
- ccxt/poloniex.py +35 -35
- ccxt/poloniexfutures.py +25 -21
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -8
- ccxt/pro/ascendex.py +4 -4
- ccxt/pro/binance.py +56 -56
- ccxt/pro/bingx.py +5 -5
- ccxt/pro/bitfinex.py +6 -6
- ccxt/pro/bitfinex2.py +10 -10
- ccxt/pro/bitget.py +17 -17
- ccxt/pro/bithumb.py +6 -6
- ccxt/pro/bitmart.py +8 -8
- ccxt/pro/bitmex.py +16 -16
- ccxt/pro/bitopro.py +4 -4
- ccxt/pro/bitrue.py +8 -8
- ccxt/pro/bitstamp.py +5 -5
- ccxt/pro/bitvavo.py +14 -14
- ccxt/pro/blockchaincom.py +7 -7
- ccxt/pro/bybit.py +12 -12
- ccxt/pro/cex.py +20 -20
- ccxt/pro/coinbase.py +32 -2
- ccxt/pro/coinbaseexchange.py +10 -10
- ccxt/pro/coinbaseinternational.py +4 -4
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +15 -15
- ccxt/pro/coinone.py +4 -4
- ccxt/pro/cryptocom.py +11 -11
- ccxt/pro/currencycom.py +4 -4
- ccxt/pro/deribit.py +9 -9
- ccxt/pro/exmo.py +9 -9
- ccxt/pro/gate.py +12 -12
- ccxt/pro/gemini.py +11 -11
- ccxt/pro/hitbtc.py +13 -13
- ccxt/pro/hollaex.py +6 -6
- ccxt/pro/htx.py +15 -15
- ccxt/pro/huobijp.py +16 -16
- ccxt/pro/hyperliquid.py +9 -9
- ccxt/pro/idex.py +12 -12
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +14 -14
- ccxt/pro/krakenfutures.py +12 -12
- ccxt/pro/kucoin.py +12 -12
- ccxt/pro/kucoinfutures.py +16 -16
- ccxt/pro/lbank.py +12 -12
- ccxt/pro/luno.py +4 -4
- ccxt/pro/mexc.py +14 -14
- ccxt/pro/ndax.py +12 -12
- ccxt/pro/okcoin.py +6 -6
- ccxt/pro/okx.py +30 -30
- ccxt/pro/onetrading.py +13 -13
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/phemex.py +9 -9
- ccxt/pro/poloniex.py +9 -9
- ccxt/pro/poloniexfutures.py +10 -10
- ccxt/pro/probit.py +8 -8
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/wazirx.py +10 -10
- ccxt/pro/whitebit.py +8 -8
- ccxt/pro/woo.py +14 -14
- ccxt/pro/woofipro.py +14 -14
- ccxt/probit.py +30 -30
- ccxt/test/base/test_shared_methods.py +1 -0
- ccxt/test/test_async.py +1 -1
- ccxt/test/test_sync.py +1 -1
- ccxt/timex.py +22 -22
- ccxt/tokocrypto.py +26 -26
- ccxt/tradeogre.py +12 -12
- ccxt/upbit.py +28 -28
- ccxt/wavesexchange.py +33 -33
- ccxt/wazirx.py +21 -21
- ccxt/whitebit.py +37 -37
- ccxt/woo.py +51 -51
- ccxt/woofipro.py +46 -46
- ccxt/yobit.py +20 -20
- ccxt/zaif.py +12 -12
- ccxt/zonda.py +22 -22
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/METADATA +4 -4
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/RECORD +260 -260
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/WHEEL +0 -0
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.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, CrossBorrowRate, Currencies, Currency, Greeks, Int, Leverage, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry, TransferEntries
|
10
|
+
from ccxt.base.types import Balances, CrossBorrowRate, Currencies, Currency, Greeks, Int, Leverage, LeverageTier, LeverageTiers, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry, TransferEntries
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -1334,14 +1334,14 @@ class bybit(Exchange, ImplicitAPI):
|
|
1334
1334
|
#
|
1335
1335
|
data = self.safe_dict(response, 'result', {})
|
1336
1336
|
rows = self.safe_list(data, 'rows', [])
|
1337
|
-
result = {}
|
1337
|
+
result: dict = {}
|
1338
1338
|
for i in range(0, len(rows)):
|
1339
1339
|
currency = rows[i]
|
1340
1340
|
currencyId = self.safe_string(currency, 'coin')
|
1341
1341
|
code = self.safe_currency_code(currencyId)
|
1342
1342
|
name = self.safe_string(currency, 'name')
|
1343
1343
|
chains = self.safe_list(currency, 'chains', [])
|
1344
|
-
networks = {}
|
1344
|
+
networks: dict = {}
|
1345
1345
|
minPrecision = None
|
1346
1346
|
minWithdrawFeeString = None
|
1347
1347
|
minWithdrawString = None
|
@@ -1454,7 +1454,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1454
1454
|
return self.array_concat(spotMarkets, derivativeMarkets)
|
1455
1455
|
|
1456
1456
|
async def fetch_spot_markets(self, params):
|
1457
|
-
request = {
|
1457
|
+
request: dict = {
|
1458
1458
|
'category': 'spot',
|
1459
1459
|
}
|
1460
1460
|
response = await self.publicGetV5MarketInstrumentsInfo(self.extend(request, params))
|
@@ -1727,7 +1727,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1727
1727
|
return result
|
1728
1728
|
|
1729
1729
|
async def fetch_option_markets(self, params):
|
1730
|
-
request = {
|
1730
|
+
request: dict = {
|
1731
1731
|
'category': 'option',
|
1732
1732
|
}
|
1733
1733
|
response = await self.publicGetV5MarketInstrumentsInfo(self.extend(request, params))
|
@@ -1983,7 +1983,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1983
1983
|
raise ArgumentsRequired(self.id + ' fetchTicker() requires a symbol argument')
|
1984
1984
|
await self.load_markets()
|
1985
1985
|
market = self.market(symbol)
|
1986
|
-
request = {
|
1986
|
+
request: dict = {
|
1987
1987
|
'symbol': market['id'],
|
1988
1988
|
# 'baseCoin': '', Base coin. For option only
|
1989
1989
|
# 'expDate': '', Expiry date. e.g., 25DEC22. For option only
|
@@ -2073,7 +2073,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2073
2073
|
elif market['type'] != currentType:
|
2074
2074
|
raise BadRequest(self.id + ' fetchTickers can only accept a list of symbols of the same type')
|
2075
2075
|
parsedSymbols.append(market['symbol'])
|
2076
|
-
request = {
|
2076
|
+
request: dict = {
|
2077
2077
|
# 'symbol': market['id'],
|
2078
2078
|
# 'baseCoin': '', # Base coin. For option only
|
2079
2079
|
# 'expDate': '', # Expiry date. e.g., 25DEC22. For option only
|
@@ -2182,7 +2182,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2182
2182
|
if paginate:
|
2183
2183
|
return await self.fetch_paginated_call_deterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1000)
|
2184
2184
|
market = self.market(symbol)
|
2185
|
-
request = {
|
2185
|
+
request: dict = {
|
2186
2186
|
'symbol': market['id'],
|
2187
2187
|
}
|
2188
2188
|
if limit is None:
|
@@ -2322,7 +2322,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2322
2322
|
"""
|
2323
2323
|
await self.load_markets()
|
2324
2324
|
market = None
|
2325
|
-
request = {}
|
2325
|
+
request: dict = {}
|
2326
2326
|
if symbols is not None:
|
2327
2327
|
symbols = self.market_symbols(symbols)
|
2328
2328
|
market = self.market(symbols[0])
|
@@ -2377,7 +2377,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2377
2377
|
tickerList = self.safe_value(response, 'result', [])
|
2378
2378
|
timestamp = self.safe_integer(response, 'time')
|
2379
2379
|
tickerList = self.safe_value(tickerList, 'list')
|
2380
|
-
fundingRates = {}
|
2380
|
+
fundingRates: dict = {}
|
2381
2381
|
for i in range(0, len(tickerList)):
|
2382
2382
|
rawTicker = tickerList[i]
|
2383
2383
|
rawTicker['timestamp'] = timestamp # will be removed inside the parser
|
@@ -2407,7 +2407,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2407
2407
|
return await self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 200)
|
2408
2408
|
if limit is None:
|
2409
2409
|
limit = 200
|
2410
|
-
request = {
|
2410
|
+
request: dict = {
|
2411
2411
|
# 'category': '', # Product type. linear,inverse
|
2412
2412
|
# 'symbol': '', # Symbol name
|
2413
2413
|
# 'startTime': 0, # The start timestamp(ms)
|
@@ -2469,7 +2469,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2469
2469
|
sorted = self.sort_by(rates, 'timestamp')
|
2470
2470
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
2471
2471
|
|
2472
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
2472
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
2473
2473
|
#
|
2474
2474
|
# public https://bybit-exchange.github.io/docs/v5/market/recent-trade
|
2475
2475
|
#
|
@@ -2654,7 +2654,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2654
2654
|
raise ArgumentsRequired(self.id + ' fetchTrades() requires a symbol argument')
|
2655
2655
|
await self.load_markets()
|
2656
2656
|
market = self.market(symbol)
|
2657
|
-
request = {
|
2657
|
+
request: dict = {
|
2658
2658
|
'symbol': market['id'],
|
2659
2659
|
# 'baseCoin': '', # Base coin. For option only. If not passed, return BTC data by default
|
2660
2660
|
# 'optionType': 'Call', # Option type. Call or Put. For option only
|
@@ -2706,7 +2706,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2706
2706
|
raise ArgumentsRequired(self.id + ' fetchOrderBook() requires a symbol argument')
|
2707
2707
|
await self.load_markets()
|
2708
2708
|
market = self.market(symbol)
|
2709
|
-
request = {
|
2709
|
+
request: dict = {
|
2710
2710
|
'symbol': market['id'],
|
2711
2711
|
}
|
2712
2712
|
defaultLimit = 25
|
@@ -2859,7 +2859,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2859
2859
|
# }
|
2860
2860
|
#
|
2861
2861
|
timestamp = self.safe_integer(response, 'time')
|
2862
|
-
result = {
|
2862
|
+
result: dict = {
|
2863
2863
|
'info': response,
|
2864
2864
|
'timestamp': timestamp,
|
2865
2865
|
'datetime': self.iso8601(timestamp),
|
@@ -2917,7 +2917,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2917
2917
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
2918
2918
|
"""
|
2919
2919
|
await self.load_markets()
|
2920
|
-
request = {}
|
2920
|
+
request: dict = {}
|
2921
2921
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
2922
2922
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
2923
2923
|
type = None
|
@@ -3049,8 +3049,8 @@ class bybit(Exchange, ImplicitAPI):
|
|
3049
3049
|
#
|
3050
3050
|
return self.parse_balance(response)
|
3051
3051
|
|
3052
|
-
def parse_order_status(self, status):
|
3053
|
-
statuses = {
|
3052
|
+
def parse_order_status(self, status: Str):
|
3053
|
+
statuses: dict = {
|
3054
3054
|
# v3 spot
|
3055
3055
|
'NEW': 'open',
|
3056
3056
|
'PARTIALLY_FILLED': 'open',
|
@@ -3077,8 +3077,8 @@ class bybit(Exchange, ImplicitAPI):
|
|
3077
3077
|
}
|
3078
3078
|
return self.safe_string(statuses, status, status)
|
3079
3079
|
|
3080
|
-
def parse_time_in_force(self, timeInForce):
|
3081
|
-
timeInForces = {
|
3080
|
+
def parse_time_in_force(self, timeInForce: Str):
|
3081
|
+
timeInForces: dict = {
|
3082
3082
|
'GoodTillCancel': 'GTC',
|
3083
3083
|
'ImmediateOrCancel': 'IOC',
|
3084
3084
|
'FillOrKill': 'FOK',
|
@@ -3086,7 +3086,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3086
3086
|
}
|
3087
3087
|
return self.safe_string(timeInForces, timeInForce, timeInForce)
|
3088
3088
|
|
3089
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
3089
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
3090
3090
|
#
|
3091
3091
|
# v1 for usdc normal account
|
3092
3092
|
# {
|
@@ -3396,7 +3396,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3396
3396
|
raise ArgumentsRequired(self.id + ' createOrder requires a price argument for limit orders')
|
3397
3397
|
defaultMethod = None
|
3398
3398
|
defaultMethod, params = self.handle_option_and_params(params, 'createOrder', 'method', 'privatePostV5OrderCreate')
|
3399
|
-
request = {
|
3399
|
+
request: dict = {
|
3400
3400
|
'symbol': market['id'],
|
3401
3401
|
# 'side': self.capitalize(side),
|
3402
3402
|
# 'orderType': self.capitalize(lowerCaseType), # limit or market
|
@@ -3604,7 +3604,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3604
3604
|
category, params = self.get_bybit_type('createOrders', market, params)
|
3605
3605
|
if category == 'inverse':
|
3606
3606
|
raise NotSupported(self.id + ' createOrders does not allow inverse orders')
|
3607
|
-
request = {
|
3607
|
+
request: dict = {
|
3608
3608
|
'category': category,
|
3609
3609
|
'request': ordersRequests,
|
3610
3610
|
}
|
@@ -3666,7 +3666,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3666
3666
|
lowerCaseType = type.lower()
|
3667
3667
|
if (price is None) and (lowerCaseType == 'limit'):
|
3668
3668
|
raise ArgumentsRequired(self.id + ' createOrder requires a price argument for limit orders')
|
3669
|
-
request = {
|
3669
|
+
request: dict = {
|
3670
3670
|
'symbol': market['id'],
|
3671
3671
|
'side': self.capitalize(side),
|
3672
3672
|
'orderType': self.capitalize(lowerCaseType), # limit or market
|
@@ -3772,7 +3772,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3772
3772
|
async def edit_usdc_order(self, id, symbol, type, side, amount=None, price=None, params={}):
|
3773
3773
|
await self.load_markets()
|
3774
3774
|
market = self.market(symbol)
|
3775
|
-
request = {
|
3775
|
+
request: dict = {
|
3776
3776
|
'symbol': market['id'],
|
3777
3777
|
'orderId': id,
|
3778
3778
|
}
|
@@ -3819,7 +3819,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3819
3819
|
|
3820
3820
|
def edit_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
3821
3821
|
market = self.market(symbol)
|
3822
|
-
request = {
|
3822
|
+
request: dict = {
|
3823
3823
|
'symbol': market['id'],
|
3824
3824
|
'orderId': id,
|
3825
3825
|
# 'orderLinkId': 'string', # unique client order id, max 36 characters
|
@@ -3940,7 +3940,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3940
3940
|
raise ArgumentsRequired(self.id + ' cancelUsdcOrder() requires a symbol argument')
|
3941
3941
|
await self.load_markets()
|
3942
3942
|
market = self.market(symbol)
|
3943
|
-
request = {
|
3943
|
+
request: dict = {
|
3944
3944
|
'symbol': market['id'],
|
3945
3945
|
# 'orderLinkId': 'string', # one of order_id, stop_order_id or order_link_id is required
|
3946
3946
|
# 'orderId': id,
|
@@ -3973,7 +3973,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3973
3973
|
|
3974
3974
|
def cancel_order_request(self, id: str, symbol: Str = None, params={}):
|
3975
3975
|
market = self.market(symbol)
|
3976
|
-
request = {
|
3976
|
+
request: dict = {
|
3977
3977
|
'symbol': market['id'],
|
3978
3978
|
# 'orderLinkId': 'string',
|
3979
3979
|
# 'orderId': id,
|
@@ -4065,7 +4065,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4065
4065
|
'symbol': market['id'],
|
4066
4066
|
'orderId': self.safe_string(ids, i),
|
4067
4067
|
})
|
4068
|
-
request = {
|
4068
|
+
request: dict = {
|
4069
4069
|
'category': category,
|
4070
4070
|
'request': ordersRequests,
|
4071
4071
|
}
|
@@ -4138,12 +4138,12 @@ class bybit(Exchange, ImplicitAPI):
|
|
4138
4138
|
idKey = 'orderId'
|
4139
4139
|
if clientOrderId is not None:
|
4140
4140
|
idKey = 'orderLinkId'
|
4141
|
-
orderItem = {
|
4141
|
+
orderItem: dict = {
|
4142
4142
|
'symbol': market['id'],
|
4143
4143
|
}
|
4144
4144
|
orderItem[idKey] = id if (idKey == 'orderId') else clientOrderId
|
4145
4145
|
ordersRequests.append(orderItem)
|
4146
|
-
request = {
|
4146
|
+
request: dict = {
|
4147
4147
|
'category': category,
|
4148
4148
|
'request': ordersRequests,
|
4149
4149
|
}
|
@@ -4192,7 +4192,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4192
4192
|
raise ArgumentsRequired(self.id + ' cancelAllUsdcOrders() requires a symbol argument')
|
4193
4193
|
await self.load_markets()
|
4194
4194
|
market = self.market(symbol)
|
4195
|
-
request = {
|
4195
|
+
request: dict = {
|
4196
4196
|
'symbol': market['id'],
|
4197
4197
|
}
|
4198
4198
|
response = None
|
@@ -4245,7 +4245,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4245
4245
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
4246
4246
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
4247
4247
|
market = None
|
4248
|
-
request = {}
|
4248
|
+
request: dict = {}
|
4249
4249
|
if symbol is not None:
|
4250
4250
|
market = self.market(symbol)
|
4251
4251
|
isUsdcSettled = market['settle'] == 'USDC'
|
@@ -4304,7 +4304,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4304
4304
|
async def fetch_usdc_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4305
4305
|
await self.load_markets()
|
4306
4306
|
market = None
|
4307
|
-
request = {
|
4307
|
+
request: dict = {
|
4308
4308
|
# 'category': '', # Type. PERPETUAL, OPTION
|
4309
4309
|
# 'symbol': '', # Contract name
|
4310
4310
|
# 'baseCoin': '', # Base currency
|
@@ -4397,7 +4397,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4397
4397
|
market = self.market(symbol)
|
4398
4398
|
if market['spot']:
|
4399
4399
|
raise NotSupported(self.id + ' fetchOrder() is not supported for spot markets')
|
4400
|
-
request = {
|
4400
|
+
request: dict = {
|
4401
4401
|
'orderId': id,
|
4402
4402
|
}
|
4403
4403
|
result = await self.fetch_orders(symbol, None, None, self.extend(request, params))
|
@@ -4469,7 +4469,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4469
4469
|
return await self.fetch_paginated_call_cursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', None, 50)
|
4470
4470
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
4471
4471
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
4472
|
-
request = {}
|
4472
|
+
request: dict = {}
|
4473
4473
|
market = None
|
4474
4474
|
isUsdcSettled = False
|
4475
4475
|
if symbol is not None:
|
@@ -4564,7 +4564,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4564
4564
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
4565
4565
|
"""
|
4566
4566
|
await self.load_markets()
|
4567
|
-
request = {
|
4567
|
+
request: dict = {
|
4568
4568
|
'orderId': id,
|
4569
4569
|
}
|
4570
4570
|
result = await self.fetch_closed_orders(symbol, None, None, self.extend(request, params))
|
@@ -4593,7 +4593,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4593
4593
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
4594
4594
|
"""
|
4595
4595
|
await self.load_markets()
|
4596
|
-
request = {
|
4596
|
+
request: dict = {
|
4597
4597
|
'orderId': id,
|
4598
4598
|
}
|
4599
4599
|
result = await self.fetch_open_orders(symbol, None, None, self.extend(request, params))
|
@@ -4629,7 +4629,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4629
4629
|
return await self.fetch_paginated_call_cursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', None, 50)
|
4630
4630
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
4631
4631
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
4632
|
-
request = {}
|
4632
|
+
request: dict = {}
|
4633
4633
|
market = None
|
4634
4634
|
isUsdcSettled = False
|
4635
4635
|
if symbol is not None:
|
@@ -4725,7 +4725,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4725
4725
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
4726
4726
|
"""
|
4727
4727
|
await self.load_markets()
|
4728
|
-
request = {
|
4728
|
+
request: dict = {
|
4729
4729
|
'orderStatus': 'Filled',
|
4730
4730
|
}
|
4731
4731
|
return await self.fetch_canceled_and_closed_orders(symbol, since, limit, self.extend(request, params))
|
@@ -4747,14 +4747,14 @@ class bybit(Exchange, ImplicitAPI):
|
|
4747
4747
|
:returns dict: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
4748
4748
|
"""
|
4749
4749
|
await self.load_markets()
|
4750
|
-
request = {
|
4750
|
+
request: dict = {
|
4751
4751
|
'orderStatus': 'Cancelled',
|
4752
4752
|
}
|
4753
4753
|
return await self.fetch_canceled_and_closed_orders(symbol, since, limit, self.extend(request, params))
|
4754
4754
|
|
4755
4755
|
async def fetch_usdc_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4756
4756
|
await self.load_markets()
|
4757
|
-
request = {}
|
4757
|
+
request: dict = {}
|
4758
4758
|
market = None
|
4759
4759
|
if symbol is not None:
|
4760
4760
|
market = self.market(symbol)
|
@@ -4812,7 +4812,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4812
4812
|
await self.load_markets()
|
4813
4813
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
4814
4814
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
4815
|
-
request = {}
|
4815
|
+
request: dict = {}
|
4816
4816
|
market = None
|
4817
4817
|
isUsdcSettled = False
|
4818
4818
|
if symbol is not None:
|
@@ -4901,7 +4901,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4901
4901
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4902
4902
|
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
4903
4903
|
"""
|
4904
|
-
request = {}
|
4904
|
+
request: dict = {}
|
4905
4905
|
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'orderLinkId')
|
4906
4906
|
if clientOrderId is not None:
|
4907
4907
|
request['orderLinkId'] = clientOrderId
|
@@ -4913,7 +4913,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4913
4913
|
async def fetch_my_usdc_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4914
4914
|
await self.load_markets()
|
4915
4915
|
market = None
|
4916
|
-
request = {}
|
4916
|
+
request: dict = {}
|
4917
4917
|
if symbol is not None:
|
4918
4918
|
market = self.market(symbol)
|
4919
4919
|
request['symbol'] = market['id']
|
@@ -4973,7 +4973,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
4973
4973
|
return await self.fetch_paginated_call_cursor('fetchMyTrades', symbol, since, limit, params, 'nextPageCursor', 'cursor', None, 100)
|
4974
4974
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
4975
4975
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
4976
|
-
request = {
|
4976
|
+
request: dict = {
|
4977
4977
|
'execType': 'Trade',
|
4978
4978
|
}
|
4979
4979
|
market = None
|
@@ -5068,7 +5068,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5068
5068
|
"""
|
5069
5069
|
await self.load_markets()
|
5070
5070
|
currency = self.currency(code)
|
5071
|
-
request = {
|
5071
|
+
request: dict = {
|
5072
5072
|
'coin': currency['id'],
|
5073
5073
|
}
|
5074
5074
|
response = await self.privateGetV5AssetDepositQueryAddress(self.extend(request, params))
|
@@ -5112,7 +5112,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5112
5112
|
networkCode, query = self.handle_network_code_and_params(params)
|
5113
5113
|
networkId = self.network_code_to_id(networkCode)
|
5114
5114
|
currency = self.currency(code)
|
5115
|
-
request = {
|
5115
|
+
request: dict = {
|
5116
5116
|
'coin': currency['id'],
|
5117
5117
|
}
|
5118
5118
|
if networkId is not None:
|
@@ -5163,7 +5163,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5163
5163
|
paginate, params = self.handle_option_and_params(params, 'fetchDeposits', 'paginate')
|
5164
5164
|
if paginate:
|
5165
5165
|
return await self.fetch_paginated_call_cursor('fetchDeposits', code, since, limit, params, 'nextPageCursor', 'cursor', None, 50)
|
5166
|
-
request = {
|
5166
|
+
request: dict = {
|
5167
5167
|
# 'coin': currency['id'],
|
5168
5168
|
# 'limit': 20, # max 50
|
5169
5169
|
# 'cursor': '',
|
@@ -5225,7 +5225,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5225
5225
|
paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
|
5226
5226
|
if paginate:
|
5227
5227
|
return await self.fetch_paginated_call_cursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', 'cursor', None, 50)
|
5228
|
-
request = {
|
5228
|
+
request: dict = {
|
5229
5229
|
# 'coin': currency['id'],
|
5230
5230
|
# 'limit': 20, # max 50
|
5231
5231
|
# 'cusor': '',
|
@@ -5285,7 +5285,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5285
5285
|
return self.parse_transactions(data, currency, since, limit)
|
5286
5286
|
|
5287
5287
|
def parse_transaction_status(self, status):
|
5288
|
-
statuses = {
|
5288
|
+
statuses: dict = {
|
5289
5289
|
# v3 deposit status
|
5290
5290
|
'0': 'unknown',
|
5291
5291
|
'1': 'pending',
|
@@ -5303,7 +5303,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5303
5303
|
}
|
5304
5304
|
return self.safe_string(statuses, status, status)
|
5305
5305
|
|
5306
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
5306
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
5307
5307
|
#
|
5308
5308
|
# fetchWithdrawals
|
5309
5309
|
#
|
@@ -5392,7 +5392,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5392
5392
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
5393
5393
|
"""
|
5394
5394
|
await self.load_markets()
|
5395
|
-
request = {
|
5395
|
+
request: dict = {
|
5396
5396
|
# 'coin': currency['id'],
|
5397
5397
|
# 'currency': currency['id'], # alias
|
5398
5398
|
# 'start_date': self.iso8601(since),
|
@@ -5537,7 +5537,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5537
5537
|
data = self.add_pagination_cursor_to_result(response)
|
5538
5538
|
return self.parse_ledger(data, currency, since, limit)
|
5539
5539
|
|
5540
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
5540
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
5541
5541
|
#
|
5542
5542
|
# {
|
5543
5543
|
# "id": 234467,
|
@@ -5608,7 +5608,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5608
5608
|
}
|
5609
5609
|
|
5610
5610
|
def parse_ledger_entry_type(self, type):
|
5611
|
-
types = {
|
5611
|
+
types: dict = {
|
5612
5612
|
'Deposit': 'transaction',
|
5613
5613
|
'Withdraw': 'transaction',
|
5614
5614
|
'RealisedPNL': 'trade',
|
@@ -5647,7 +5647,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5647
5647
|
await self.load_markets()
|
5648
5648
|
self.check_address(address)
|
5649
5649
|
currency = self.currency(code)
|
5650
|
-
request = {
|
5650
|
+
request: dict = {
|
5651
5651
|
'coin': currency['id'],
|
5652
5652
|
'amount': self.number_to_string(amount),
|
5653
5653
|
'address': address,
|
@@ -5686,7 +5686,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5686
5686
|
raise ArgumentsRequired(self.id + ' fetchPosition() requires a symbol argument')
|
5687
5687
|
await self.load_markets()
|
5688
5688
|
market = self.market(symbol)
|
5689
|
-
request = {
|
5689
|
+
request: dict = {
|
5690
5690
|
'symbol': market['id'],
|
5691
5691
|
}
|
5692
5692
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
@@ -5752,7 +5752,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5752
5752
|
|
5753
5753
|
async def fetch_usdc_positions(self, symbols: Strings = None, params={}):
|
5754
5754
|
await self.load_markets()
|
5755
|
-
request = {}
|
5755
|
+
request: dict = {}
|
5756
5756
|
market = None
|
5757
5757
|
if isinstance(symbols, list):
|
5758
5758
|
length = len(symbols)
|
@@ -5846,7 +5846,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5846
5846
|
await self.load_markets()
|
5847
5847
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
5848
5848
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
5849
|
-
request = {}
|
5849
|
+
request: dict = {}
|
5850
5850
|
market = None
|
5851
5851
|
isUsdcSettled = False
|
5852
5852
|
if symbol is not None:
|
@@ -5918,7 +5918,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
5918
5918
|
results.append(self.parse_position(rawPosition))
|
5919
5919
|
return self.filter_by_array_positions(results, 'symbol', symbols, False)
|
5920
5920
|
|
5921
|
-
def parse_position(self, position, market: Market = None):
|
5921
|
+
def parse_position(self, position: dict, market: Market = None):
|
5922
5922
|
#
|
5923
5923
|
# linear swap
|
5924
5924
|
#
|
@@ -6194,7 +6194,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6194
6194
|
marginMode = 'PORTFOLIO_MARGIN'
|
6195
6195
|
else:
|
6196
6196
|
raise NotSupported(self.id + ' setMarginMode() marginMode must be either [isolated, cross, portfolio]')
|
6197
|
-
request = {
|
6197
|
+
request: dict = {
|
6198
6198
|
'setMarginMode': marginMode,
|
6199
6199
|
}
|
6200
6200
|
response = await self.privatePostV5AccountSetMarginMode(self.extend(request, params))
|
@@ -6210,7 +6210,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6210
6210
|
marginMode = 'PORTFOLIO_MARGIN'
|
6211
6211
|
else:
|
6212
6212
|
raise NotSupported(self.id + ' setMarginMode() for usdc market marginMode must be either [cross, portfolio]')
|
6213
|
-
request = {
|
6213
|
+
request: dict = {
|
6214
6214
|
'setMarginMode': marginMode,
|
6215
6215
|
}
|
6216
6216
|
response = await self.privatePostV5AccountSetMarginMode(self.extend(request, params))
|
@@ -6241,7 +6241,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6241
6241
|
sellLeverage = leverage
|
6242
6242
|
buyLeverage = leverage
|
6243
6243
|
params = self.omit(params, 'leverage')
|
6244
|
-
request = {
|
6244
|
+
request: dict = {
|
6245
6245
|
'category': type,
|
6246
6246
|
'symbol': market['id'],
|
6247
6247
|
'tradeMode': tradeMode,
|
@@ -6274,7 +6274,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6274
6274
|
# engage in leverage setting
|
6275
6275
|
# we reuse the code here instead of having two methods
|
6276
6276
|
leverageString = self.number_to_string(leverage)
|
6277
|
-
request = {
|
6277
|
+
request: dict = {
|
6278
6278
|
'symbol': market['id'],
|
6279
6279
|
'buyLeverage': leverageString,
|
6280
6280
|
'sellLeverage': leverageString,
|
@@ -6313,7 +6313,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6313
6313
|
mode = 3
|
6314
6314
|
else:
|
6315
6315
|
mode = 0
|
6316
|
-
request = {
|
6316
|
+
request: dict = {
|
6317
6317
|
'mode': mode,
|
6318
6318
|
}
|
6319
6319
|
if symbol is None:
|
@@ -6348,7 +6348,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6348
6348
|
interval = self.safe_string(intervals, timeframe) # 5min,15min,30min,1h,4h,1d
|
6349
6349
|
if interval is None:
|
6350
6350
|
raise BadRequest(self.id + ' fetchOpenInterestHistory() cannot use the ' + timeframe + ' timeframe')
|
6351
|
-
request = {
|
6351
|
+
request: dict = {
|
6352
6352
|
'symbol': market['id'],
|
6353
6353
|
'intervalTime': interval,
|
6354
6354
|
'category': category,
|
@@ -6412,7 +6412,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6412
6412
|
raise BadRequest(self.id + ' fetchOpenInterest() cannot use the ' + timeframe + ' timeframe')
|
6413
6413
|
subType = 'linear' if market['linear'] else 'inverse'
|
6414
6414
|
category = self.safe_string(params, 'category', subType)
|
6415
|
-
request = {
|
6415
|
+
request: dict = {
|
6416
6416
|
'symbol': market['id'],
|
6417
6417
|
'intervalTime': interval,
|
6418
6418
|
'category': category,
|
@@ -6469,7 +6469,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6469
6469
|
market = self.market(symbol)
|
6470
6470
|
if market['spot'] or market['option']:
|
6471
6471
|
raise BadRequest(self.id + ' fetchOpenInterestHistory() symbol does not support market ' + symbol)
|
6472
|
-
request = {
|
6472
|
+
request: dict = {
|
6473
6473
|
'symbol': market['id'],
|
6474
6474
|
}
|
6475
6475
|
if limit is not None:
|
@@ -6504,7 +6504,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6504
6504
|
"""
|
6505
6505
|
await self.load_markets()
|
6506
6506
|
currency = self.currency(code)
|
6507
|
-
request = {
|
6507
|
+
request: dict = {
|
6508
6508
|
'coin': currency['id'],
|
6509
6509
|
}
|
6510
6510
|
response = await self.privateGetV5SpotCrossMarginTradeLoanInfo(self.extend(request, params))
|
@@ -6560,7 +6560,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6560
6560
|
:returns dict[]: a list of `borrow interest structures <https://docs.ccxt.com/#/?id=borrow-interest-structure>`
|
6561
6561
|
"""
|
6562
6562
|
await self.load_markets()
|
6563
|
-
request = {}
|
6563
|
+
request: dict = {}
|
6564
6564
|
response = await self.privateGetV5SpotCrossMarginTradeAccount(self.extend(request, params))
|
6565
6565
|
#
|
6566
6566
|
# {
|
@@ -6592,7 +6592,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6592
6592
|
interest = self.parse_borrow_interests(rows, None)
|
6593
6593
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
6594
6594
|
|
6595
|
-
def parse_borrow_interest(self, info, market: Market = None):
|
6595
|
+
def parse_borrow_interest(self, info: dict, market: Market = None):
|
6596
6596
|
#
|
6597
6597
|
# {
|
6598
6598
|
# "tokenId": "BTC",
|
@@ -6634,7 +6634,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6634
6634
|
toId = self.safe_string(accountTypes, toAccount, toAccount)
|
6635
6635
|
currency = self.currency(code)
|
6636
6636
|
amountToPrecision = self.currency_to_precision(code, amount)
|
6637
|
-
request = {
|
6637
|
+
request: dict = {
|
6638
6638
|
'transferId': transferId,
|
6639
6639
|
'fromAccountType': fromId,
|
6640
6640
|
'toAccountType': toId,
|
@@ -6684,7 +6684,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6684
6684
|
if paginate:
|
6685
6685
|
return await self.fetch_paginated_call_cursor('fetchTransfers', code, since, limit, params, 'nextPageCursor', 'cursor', None, 50)
|
6686
6686
|
currency = None
|
6687
|
-
request = {}
|
6687
|
+
request: dict = {}
|
6688
6688
|
if code is not None:
|
6689
6689
|
currency = self.safe_currency_code(code)
|
6690
6690
|
request['coin'] = currency
|
@@ -6730,7 +6730,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6730
6730
|
"""
|
6731
6731
|
await self.load_markets()
|
6732
6732
|
currency = self.currency(code)
|
6733
|
-
request = {
|
6733
|
+
request: dict = {
|
6734
6734
|
'coin': currency['id'],
|
6735
6735
|
'qty': self.currency_to_precision(code, amount),
|
6736
6736
|
}
|
@@ -6764,7 +6764,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6764
6764
|
"""
|
6765
6765
|
await self.load_markets()
|
6766
6766
|
currency = self.currency(code)
|
6767
|
-
request = {
|
6767
|
+
request: dict = {
|
6768
6768
|
'coin': currency['id'],
|
6769
6769
|
'qty': self.number_to_string(amount),
|
6770
6770
|
}
|
@@ -6812,7 +6812,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6812
6812
|
}
|
6813
6813
|
|
6814
6814
|
def parse_transfer_status(self, status: Str) -> Str:
|
6815
|
-
statuses = {
|
6815
|
+
statuses: dict = {
|
6816
6816
|
'0': 'ok',
|
6817
6817
|
'OK': 'ok',
|
6818
6818
|
'SUCCESS': 'ok',
|
@@ -6861,7 +6861,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6861
6861
|
async def fetch_derivatives_market_leverage_tiers(self, symbol: str, params={}):
|
6862
6862
|
await self.load_markets()
|
6863
6863
|
market = self.market(symbol)
|
6864
|
-
request = {
|
6864
|
+
request: dict = {
|
6865
6865
|
'symbol': market['id'],
|
6866
6866
|
}
|
6867
6867
|
if market['linear']:
|
@@ -6896,7 +6896,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6896
6896
|
tiers = self.safe_list(result, 'list')
|
6897
6897
|
return self.parse_market_leverage_tiers(tiers, market)
|
6898
6898
|
|
6899
|
-
async def fetch_market_leverage_tiers(self, symbol: str, params={}):
|
6899
|
+
async def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
6900
6900
|
"""
|
6901
6901
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
6902
6902
|
:see: https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
@@ -6905,7 +6905,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6905
6905
|
:returns dict: a `leverage tiers structure <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`
|
6906
6906
|
"""
|
6907
6907
|
await self.load_markets()
|
6908
|
-
request = {}
|
6908
|
+
request: dict = {}
|
6909
6909
|
market = None
|
6910
6910
|
market = self.market(symbol)
|
6911
6911
|
if market['spot'] or market['option']:
|
@@ -6913,7 +6913,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6913
6913
|
request['symbol'] = market['id']
|
6914
6914
|
return await self.fetch_derivatives_market_leverage_tiers(symbol, params)
|
6915
6915
|
|
6916
|
-
def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
|
6916
|
+
def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
|
6917
6917
|
#
|
6918
6918
|
# {
|
6919
6919
|
# "symbol": "ETHUSDT",
|
@@ -6943,7 +6943,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6943
6943
|
"""
|
6944
6944
|
await self.load_markets()
|
6945
6945
|
market = self.market(symbol)
|
6946
|
-
request = {
|
6946
|
+
request: dict = {
|
6947
6947
|
'symbol': market['id'],
|
6948
6948
|
}
|
6949
6949
|
category = None
|
@@ -7012,7 +7012,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7012
7012
|
#
|
7013
7013
|
fees = self.safe_dict(response, 'result', {})
|
7014
7014
|
fees = self.safe_list(fees, 'list', [])
|
7015
|
-
result = {}
|
7015
|
+
result: dict = {}
|
7016
7016
|
for i in range(0, len(fees)):
|
7017
7017
|
fee = self.parse_trading_fee(fees[i])
|
7018
7018
|
symbol = fee['symbol']
|
@@ -7042,7 +7042,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7042
7042
|
#
|
7043
7043
|
chains = self.safe_list(fee, 'chains', [])
|
7044
7044
|
chainsLength = len(chains)
|
7045
|
-
result = {
|
7045
|
+
result: dict = {
|
7046
7046
|
'info': fee,
|
7047
7047
|
'withdraw': {
|
7048
7048
|
'fee': None,
|
@@ -7127,7 +7127,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7127
7127
|
:returns dict[]: a list of [settlement history objects]
|
7128
7128
|
"""
|
7129
7129
|
await self.load_markets()
|
7130
|
-
request = {}
|
7130
|
+
request: dict = {}
|
7131
7131
|
market = None
|
7132
7132
|
if symbol is not None:
|
7133
7133
|
market = self.market(symbol)
|
@@ -7178,7 +7178,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7178
7178
|
:returns dict[]: a list of [settlement history objects]
|
7179
7179
|
"""
|
7180
7180
|
await self.load_markets()
|
7181
|
-
request = {}
|
7181
|
+
request: dict = {}
|
7182
7182
|
market = None
|
7183
7183
|
if symbol is not None:
|
7184
7184
|
market = self.market(symbol)
|
@@ -7297,7 +7297,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7297
7297
|
"""
|
7298
7298
|
await self.load_markets()
|
7299
7299
|
currency = self.currency(code)
|
7300
|
-
request = {
|
7300
|
+
request: dict = {
|
7301
7301
|
'category': 'option',
|
7302
7302
|
'baseCoin': currency['id'],
|
7303
7303
|
}
|
@@ -7349,7 +7349,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7349
7349
|
"""
|
7350
7350
|
await self.load_markets()
|
7351
7351
|
market = self.market(symbol)
|
7352
|
-
request = {
|
7352
|
+
request: dict = {
|
7353
7353
|
'symbol': market['id'],
|
7354
7354
|
'category': 'option',
|
7355
7355
|
}
|
@@ -7475,7 +7475,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7475
7475
|
paginate, params = self.handle_option_and_params(params, 'fetchMyLiquidations', 'paginate')
|
7476
7476
|
if paginate:
|
7477
7477
|
return await self.fetch_paginated_call_cursor('fetchMyLiquidations', symbol, since, limit, params, 'nextPageCursor', 'cursor', None, 100)
|
7478
|
-
request = {
|
7478
|
+
request: dict = {
|
7479
7479
|
'execType': 'BustTrade',
|
7480
7480
|
}
|
7481
7481
|
market = None
|
@@ -7593,7 +7593,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7593
7593
|
return await self.fetch_paginated_call_cursor('getLeverageTiersPaginated', symbol, None, None, params, 'nextPageCursor', 'cursor', None, 100)
|
7594
7594
|
subType = None
|
7595
7595
|
subType, params = self.handle_sub_type_and_params('getLeverageTiersPaginated', market, params, 'linear')
|
7596
|
-
request = {
|
7596
|
+
request: dict = {
|
7597
7597
|
'category': subType,
|
7598
7598
|
}
|
7599
7599
|
response = await self.publicGetV5MarketRiskLimit(self.extend(request, params))
|
@@ -7609,7 +7609,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7609
7609
|
result[lastIndex] = last
|
7610
7610
|
return result
|
7611
7611
|
|
7612
|
-
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
7612
|
+
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
7613
7613
|
"""
|
7614
7614
|
:see: https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
7615
7615
|
retrieve information on the maximum leverage, for different trade sizes
|
@@ -7645,7 +7645,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7645
7645
|
# }
|
7646
7646
|
# ]
|
7647
7647
|
#
|
7648
|
-
tiers = {}
|
7648
|
+
tiers: dict = {}
|
7649
7649
|
marketIds = self.market_ids(symbols)
|
7650
7650
|
filteredResults = self.filter_by_array(response, marketIdKey, marketIds, False)
|
7651
7651
|
grouped = self.group_by(filteredResults, marketIdKey)
|
@@ -7661,7 +7661,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7661
7661
|
tiers[symbol] = self.parse_market_leverage_tiers(self.sort_by(entry, 'id'), market)
|
7662
7662
|
return tiers
|
7663
7663
|
|
7664
|
-
def parse_market_leverage_tiers(self, info, market: Market = None):
|
7664
|
+
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
7665
7665
|
#
|
7666
7666
|
# [
|
7667
7667
|
# {
|
@@ -7710,7 +7710,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7710
7710
|
paginate, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'paginate')
|
7711
7711
|
if paginate:
|
7712
7712
|
return await self.fetch_paginated_call_cursor('fetchFundingHistory', symbol, since, limit, params, 'nextPageCursor', 'cursor', None, 100)
|
7713
|
-
request = {
|
7713
|
+
request: dict = {
|
7714
7714
|
'execType': 'Funding',
|
7715
7715
|
}
|
7716
7716
|
market: Market = None
|
@@ -7795,7 +7795,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7795
7795
|
"""
|
7796
7796
|
await self.load_markets()
|
7797
7797
|
market = self.market(symbol)
|
7798
|
-
request = {
|
7798
|
+
request: dict = {
|
7799
7799
|
'category': 'option',
|
7800
7800
|
'symbol': market['id'],
|
7801
7801
|
}
|
@@ -7855,7 +7855,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7855
7855
|
"""
|
7856
7856
|
await self.load_markets()
|
7857
7857
|
currency = self.currency(code)
|
7858
|
-
request = {
|
7858
|
+
request: dict = {
|
7859
7859
|
'category': 'option',
|
7860
7860
|
'baseCoin': currency['id'],
|
7861
7861
|
}
|
@@ -7979,7 +7979,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7979
7979
|
until = self.safe_integer(params, 'until')
|
7980
7980
|
subType, params = self.handle_sub_type_and_params('fetchPositionsHistory', market, params, 'linear')
|
7981
7981
|
params = self.omit(params, 'until')
|
7982
|
-
request = {
|
7982
|
+
request: dict = {
|
7983
7983
|
'category': subType,
|
7984
7984
|
}
|
7985
7985
|
if (symbols is not None) and (symbolsLength == 1):
|