ccxt 4.3.18__py2.py3-none-any.whl → 4.3.20__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 +3 -1
- ccxt/abstract/bitget.py +3 -0
- ccxt/abstract/bybit.py +1 -0
- ccxt/abstract/okx.py +1 -0
- ccxt/abstract/woofipro.py +119 -0
- ccxt/ace.py +1 -1
- ccxt/ascendex.py +7 -8
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/ascendex.py +7 -8
- ccxt/async_support/base/exchange.py +25 -2
- ccxt/async_support/bigone.py +4 -4
- ccxt/async_support/binance.py +9 -9
- ccxt/async_support/bingx.py +4 -4
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +28 -4
- ccxt/async_support/bitfinex2.py +62 -54
- ccxt/async_support/bitflyer.py +1 -1
- ccxt/async_support/bitget.py +11 -11
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +8 -8
- ccxt/async_support/bitmex.py +2 -2
- ccxt/async_support/bitopro.py +1 -1
- ccxt/async_support/bitrue.py +3 -3
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitstamp.py +3 -5
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +1 -1
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/blofin.py +3 -3
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +1 -1
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +44 -17
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +2 -2
- ccxt/async_support/coinbasepro.py +1 -1
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +358 -543
- ccxt/async_support/coinlist.py +6 -7
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinmetro.py +1 -1
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/coinspot.py +1 -1
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/currencycom.py +2 -2
- ccxt/async_support/delta.py +4 -4
- ccxt/async_support/deribit.py +8 -8
- ccxt/async_support/digifinex.py +5 -5
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/gate.py +5 -5
- ccxt/async_support/gemini.py +1 -1
- ccxt/async_support/hitbtc.py +3 -3
- ccxt/async_support/hollaex.py +4 -4
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/idex.py +1 -1
- ccxt/async_support/independentreserve.py +1 -1
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +2 -2
- ccxt/async_support/krakenfutures.py +3 -3
- ccxt/async_support/kucoin.py +3 -3
- ccxt/async_support/kucoinfutures.py +3 -3
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/latoken.py +6 -6
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +1 -1
- ccxt/async_support/mercado.py +1 -1
- ccxt/async_support/mexc.py +7 -7
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +3 -4
- ccxt/async_support/okcoin.py +3 -3
- ccxt/async_support/okx.py +27 -10
- ccxt/async_support/onetrading.py +1 -1
- ccxt/async_support/paymium.py +3 -3
- ccxt/async_support/phemex.py +19 -11
- ccxt/async_support/poloniex.py +3 -4
- ccxt/async_support/poloniexfutures.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +1 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/wavesexchange.py +3 -3
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/whitebit.py +2 -2
- ccxt/async_support/woo.py +25 -10
- ccxt/async_support/woofipro.py +2524 -0
- ccxt/async_support/yobit.py +1 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +3 -3
- ccxt/base/exchange.py +64 -16
- ccxt/base/types.py +20 -0
- ccxt/bigone.py +4 -4
- ccxt/binance.py +9 -9
- ccxt/bingx.py +4 -4
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +1 -1
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +28 -4
- ccxt/bitfinex2.py +62 -54
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +11 -11
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +8 -8
- ccxt/bitmex.py +2 -2
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +3 -3
- ccxt/bitso.py +1 -1
- ccxt/bitstamp.py +3 -5
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +1 -1
- ccxt/bl3p.py +1 -1
- ccxt/blockchaincom.py +1 -1
- ccxt/blofin.py +3 -3
- ccxt/btcalpha.py +1 -1
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +1 -1
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +44 -17
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +2 -2
- ccxt/coinbasepro.py +1 -1
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +358 -543
- ccxt/coinlist.py +6 -7
- ccxt/coinmate.py +1 -1
- ccxt/coinmetro.py +1 -1
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/coinspot.py +1 -1
- ccxt/cryptocom.py +1 -1
- ccxt/currencycom.py +2 -2
- ccxt/delta.py +4 -4
- ccxt/deribit.py +8 -8
- ccxt/digifinex.py +5 -5
- ccxt/exmo.py +1 -1
- ccxt/gate.py +5 -5
- ccxt/gemini.py +1 -1
- ccxt/hitbtc.py +3 -3
- ccxt/hollaex.py +4 -4
- ccxt/htx.py +2 -2
- ccxt/huobijp.py +1 -1
- ccxt/idex.py +1 -1
- ccxt/independentreserve.py +1 -1
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +2 -2
- ccxt/krakenfutures.py +3 -3
- ccxt/kucoin.py +3 -3
- ccxt/kucoinfutures.py +3 -3
- ccxt/kuna.py +1 -1
- ccxt/latoken.py +6 -6
- ccxt/lbank.py +1 -1
- ccxt/luno.py +1 -1
- ccxt/lykke.py +1 -1
- ccxt/mercado.py +1 -1
- ccxt/mexc.py +7 -7
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +3 -4
- ccxt/okcoin.py +3 -3
- ccxt/okx.py +27 -10
- ccxt/onetrading.py +1 -1
- ccxt/paymium.py +3 -3
- ccxt/phemex.py +19 -11
- ccxt/poloniex.py +3 -4
- ccxt/poloniexfutures.py +1 -1
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/bitget.py +127 -190
- ccxt/pro/coinbaseinternational.py +11 -4
- ccxt/pro/htx.py +12 -6
- ccxt/pro/okx.py +79 -1
- ccxt/pro/woofipro.py +1183 -0
- ccxt/probit.py +1 -1
- ccxt/test/test_async.py +31 -1
- ccxt/test/test_sync.py +31 -1
- ccxt/timex.py +1 -1
- ccxt/tokocrypto.py +1 -1
- ccxt/upbit.py +1 -1
- ccxt/wavesexchange.py +3 -3
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +2 -2
- ccxt/woo.py +25 -10
- ccxt/woofipro.py +2524 -0
- ccxt/yobit.py +1 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +3 -3
- {ccxt-4.3.18.dist-info → ccxt-4.3.20.dist-info}/METADATA +8 -6
- {ccxt-4.3.18.dist-info → ccxt-4.3.20.dist-info}/RECORD +195 -191
- {ccxt-4.3.18.dist-info → ccxt-4.3.20.dist-info}/WHEEL +0 -0
- {ccxt-4.3.18.dist-info → ccxt-4.3.20.dist-info}/top_level.txt +0 -0
ccxt/bybit.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bybit import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
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
|
9
|
+
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
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -360,6 +360,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
360
360
|
'v5/asset/coin/query-info': 28, # should be 25 but exceeds ratelimit unless the weight is 28 or higher
|
361
361
|
'v5/asset/withdraw/query-record': 10, # 5/s => cost = 50 / 5 = 10
|
362
362
|
'v5/asset/withdraw/withdrawable-amount': 5,
|
363
|
+
'v5/asset/withdraw/vasp/list': 5,
|
363
364
|
# user
|
364
365
|
'v5/user/query-sub-members': 5, # 10/s => cost = 50 / 10 = 5
|
365
366
|
'v5/user/query-api': 5, # 10/s => cost = 50 / 10 = 5
|
@@ -1852,7 +1853,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1852
1853
|
}))
|
1853
1854
|
return result
|
1854
1855
|
|
1855
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1856
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
1856
1857
|
#
|
1857
1858
|
# spot
|
1858
1859
|
#
|
@@ -6156,7 +6157,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6156
6157
|
position = self.fetch_position(symbol, params)
|
6157
6158
|
return self.parse_leverage(position, market)
|
6158
6159
|
|
6159
|
-
def parse_leverage(self, leverage, market=None) -> Leverage:
|
6160
|
+
def parse_leverage(self, leverage: dict, market: Market = None) -> Leverage:
|
6160
6161
|
marketId = self.safe_string(leverage, 'symbol')
|
6161
6162
|
leverageValue = self.safe_integer(leverage, 'leverage')
|
6162
6163
|
return {
|
@@ -6664,7 +6665,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6664
6665
|
'status': status,
|
6665
6666
|
})
|
6666
6667
|
|
6667
|
-
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
6668
|
+
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> TransferEntries:
|
6668
6669
|
"""
|
6669
6670
|
fetch a history of internal transfers made on an account
|
6670
6671
|
:see: https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
|
@@ -6809,7 +6810,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6809
6810
|
'info': info,
|
6810
6811
|
}
|
6811
6812
|
|
6812
|
-
def parse_transfer_status(self, status):
|
6813
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
6813
6814
|
statuses = {
|
6814
6815
|
'0': 'ok',
|
6815
6816
|
'OK': 'ok',
|
@@ -6817,7 +6818,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
6817
6818
|
}
|
6818
6819
|
return self.safe_string(statuses, status, status)
|
6819
6820
|
|
6820
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
6821
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
6821
6822
|
#
|
6822
6823
|
# transfer
|
6823
6824
|
#
|
@@ -7401,7 +7402,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7401
7402
|
'datetime': self.iso8601(timestamp),
|
7402
7403
|
})
|
7403
7404
|
|
7404
|
-
def parse_greeks(self, greeks, market: Market = None):
|
7405
|
+
def parse_greeks(self, greeks: dict, market: Market = None) -> Greeks:
|
7405
7406
|
#
|
7406
7407
|
# {
|
7407
7408
|
# "symbol": "BTC-26JAN24-39000-C",
|
@@ -7580,6 +7581,33 @@ class bybit(Exchange, ImplicitAPI):
|
|
7580
7581
|
'datetime': self.iso8601(timestamp),
|
7581
7582
|
})
|
7582
7583
|
|
7584
|
+
def get_leverage_tiers_paginated(self, symbol: Str = None, params={}):
|
7585
|
+
self.load_markets()
|
7586
|
+
market = None
|
7587
|
+
if symbol is not None:
|
7588
|
+
market = self.market(symbol)
|
7589
|
+
paginate = False
|
7590
|
+
paginate, params = self.handle_option_and_params(params, 'getLeverageTiersPaginated', 'paginate')
|
7591
|
+
if paginate:
|
7592
|
+
return self.fetch_paginated_call_cursor('getLeverageTiersPaginated', symbol, None, None, params, 'nextPageCursor', 'cursor', None, 100)
|
7593
|
+
subType = None
|
7594
|
+
subType, params = self.handle_sub_type_and_params('getLeverageTiersPaginated', market, params, 'linear')
|
7595
|
+
request = {
|
7596
|
+
'category': subType,
|
7597
|
+
}
|
7598
|
+
response = self.publicGetV5MarketRiskLimit(self.extend(request, params))
|
7599
|
+
result = self.add_pagination_cursor_to_result(response)
|
7600
|
+
first = self.safe_dict(result, 0)
|
7601
|
+
total = len(result)
|
7602
|
+
lastIndex = total - 1
|
7603
|
+
last = self.safe_dict(result, lastIndex)
|
7604
|
+
cursorValue = self.safe_string(first, 'nextPageCursor')
|
7605
|
+
last['info'] = {
|
7606
|
+
'nextPageCursor': cursorValue,
|
7607
|
+
}
|
7608
|
+
result[lastIndex] = last
|
7609
|
+
return result
|
7610
|
+
|
7583
7611
|
def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
7584
7612
|
"""
|
7585
7613
|
:see: https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
@@ -7587,22 +7615,18 @@ class bybit(Exchange, ImplicitAPI):
|
|
7587
7615
|
:param str[] [symbols]: a list of unified market symbols
|
7588
7616
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7589
7617
|
:param str [params.subType]: market subType, ['linear', 'inverse'], default is 'linear'
|
7618
|
+
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
7590
7619
|
:returns dict: a dictionary of `leverage tiers structures <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`, indexed by market symbols
|
7591
7620
|
"""
|
7592
7621
|
self.load_markets()
|
7593
7622
|
market = None
|
7623
|
+
symbol = None
|
7594
7624
|
if symbols is not None:
|
7595
7625
|
market = self.market(symbols[0])
|
7596
7626
|
if market['spot']:
|
7597
7627
|
raise NotSupported(self.id + ' fetchLeverageTiers() is not supported for spot market')
|
7598
|
-
|
7599
|
-
|
7600
|
-
request = {
|
7601
|
-
'category': subType,
|
7602
|
-
}
|
7603
|
-
response = self.publicGetV5MarketRiskLimit(self.extend(request, params))
|
7604
|
-
result = self.safe_dict(response, 'result', {})
|
7605
|
-
data = self.safe_list(result, 'list', [])
|
7628
|
+
symbol = market['symbol']
|
7629
|
+
data = self.get_leverage_tiers_paginated(symbol, self.extend({'paginate': True, 'paginationCalls': 20}, params))
|
7606
7630
|
symbols = self.market_symbols(symbols)
|
7607
7631
|
return self.parse_leverage_tiers(data, symbols, 'symbol')
|
7608
7632
|
|
@@ -7628,9 +7652,12 @@ class bybit(Exchange, ImplicitAPI):
|
|
7628
7652
|
for i in range(0, len(keys)):
|
7629
7653
|
marketId = keys[i]
|
7630
7654
|
entry = grouped[marketId]
|
7655
|
+
for j in range(0, len(entry)):
|
7656
|
+
id = self.safe_integer(entry[j], 'id')
|
7657
|
+
entry[j]['id'] = id
|
7631
7658
|
market = self.safe_market(marketId, None, None, 'contract')
|
7632
7659
|
symbol = market['symbol']
|
7633
|
-
tiers[symbol] = self.parse_market_leverage_tiers(entry, market)
|
7660
|
+
tiers[symbol] = self.parse_market_leverage_tiers(self.sort_by(entry, 'id'), market)
|
7634
7661
|
return tiers
|
7635
7662
|
|
7636
7663
|
def parse_market_leverage_tiers(self, info, market: Market = None):
|
@@ -7876,7 +7903,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
7876
7903
|
resultList = self.safe_list(result, 'list', [])
|
7877
7904
|
return self.parse_option_chain(resultList, None, 'symbol')
|
7878
7905
|
|
7879
|
-
def parse_option(self, chain, currency: Currency = None, market: Market = None):
|
7906
|
+
def parse_option(self, chain: dict, currency: Currency = None, market: Market = None) -> Option:
|
7880
7907
|
#
|
7881
7908
|
# {
|
7882
7909
|
# "symbol": "BTC-27DEC24-55000-P",
|
ccxt/cex.py
CHANGED
@@ -562,7 +562,7 @@ class cex(Exchange, ImplicitAPI):
|
|
562
562
|
return []
|
563
563
|
return None
|
564
564
|
|
565
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
565
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
566
566
|
timestamp = self.safe_timestamp(ticker, 'timestamp')
|
567
567
|
volume = self.safe_string(ticker, 'volume')
|
568
568
|
high = self.safe_string(ticker, 'high')
|
ccxt/coinbase.py
CHANGED
@@ -1877,7 +1877,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1877
1877
|
ticker['ask'] = self.safe_number(response, 'best_ask')
|
1878
1878
|
return ticker
|
1879
1879
|
|
1880
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1880
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
1881
1881
|
#
|
1882
1882
|
# fetchTickerV2
|
1883
1883
|
#
|
@@ -3977,7 +3977,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
3977
3977
|
data = self.safe_dict(response, 'trade', {})
|
3978
3978
|
return self.parse_conversion(data)
|
3979
3979
|
|
3980
|
-
def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
3980
|
+
def parse_conversion(self, conversion: dict, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
3981
3981
|
fromCoin = self.safe_string(conversion, 'source_currency')
|
3982
3982
|
fromCode = self.safe_currency_code(fromCoin, fromCurrency)
|
3983
3983
|
to = self.safe_string(conversion, 'target_currency')
|
ccxt/coinbasepro.py
CHANGED
@@ -542,7 +542,7 @@ class coinbasepro(Exchange, ImplicitAPI):
|
|
542
542
|
orderbook['nonce'] = self.safe_integer(response, 'sequence')
|
543
543
|
return orderbook
|
544
544
|
|
545
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
545
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
546
546
|
#
|
547
547
|
# fetchTickers
|
548
548
|
#
|
ccxt/coincheck.py
CHANGED
@@ -289,7 +289,7 @@ class coincheck(Exchange, ImplicitAPI):
|
|
289
289
|
response = self.publicGetOrderBooks(self.extend(request, params))
|
290
290
|
return self.parse_order_book(response, market['symbol'])
|
291
291
|
|
292
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
292
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
293
293
|
#
|
294
294
|
# {
|
295
295
|
# "last":4192632.0,
|