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/delta.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.delta import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Greeks, Int, Order, OrderBook, OrderSide, OrderType,
|
9
|
+
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import BadRequest
|
@@ -806,7 +806,7 @@ class delta(Exchange, ImplicitAPI):
|
|
806
806
|
})
|
807
807
|
return result
|
808
808
|
|
809
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
809
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
810
810
|
#
|
811
811
|
# spot: fetchTicker, fetchTickers
|
812
812
|
#
|
@@ -1278,7 +1278,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1278
1278
|
result = self.safe_value(response, 'result', {})
|
1279
1279
|
return self.parse_order_book(result, market['symbol'], None, 'buy', 'sell', 'price', 'size')
|
1280
1280
|
|
1281
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
1281
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1282
1282
|
#
|
1283
1283
|
# public fetchTrades
|
1284
1284
|
#
|
@@ -1407,7 +1407,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1407
1407
|
result = self.safe_value(response, 'result', [])
|
1408
1408
|
return self.parse_trades(result, market, since, limit)
|
1409
1409
|
|
1410
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
1410
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
1411
1411
|
#
|
1412
1412
|
# {
|
1413
1413
|
# "time":1605393120,
|
@@ -1583,7 +1583,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1583
1583
|
result = self.safe_value(response, 'result', [])
|
1584
1584
|
return self.parse_positions(result, symbols)
|
1585
1585
|
|
1586
|
-
def parse_position(self, position, market=None):
|
1586
|
+
def parse_position(self, position, market: Market = None):
|
1587
1587
|
#
|
1588
1588
|
# fetchPosition
|
1589
1589
|
#
|
@@ -1659,7 +1659,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1659
1659
|
}
|
1660
1660
|
return self.safe_string(statuses, status, status)
|
1661
1661
|
|
1662
|
-
def parse_order(self, order, market=None) -> Order:
|
1662
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
1663
1663
|
#
|
1664
1664
|
# createOrder, cancelOrder, editOrder, fetchOpenOrders, fetchClosedOrders
|
1665
1665
|
#
|
@@ -1866,7 +1866,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1866
1866
|
result = self.safe_value(response, 'result')
|
1867
1867
|
return self.parse_order(result, market)
|
1868
1868
|
|
1869
|
-
def cancel_order(self, id: str, symbol:
|
1869
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1870
1870
|
"""
|
1871
1871
|
cancels an open order
|
1872
1872
|
:see: https://docs.delta.exchange/#cancel-order
|
@@ -1922,7 +1922,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1922
1922
|
result = self.safe_value(response, 'result')
|
1923
1923
|
return self.parse_order(result, market)
|
1924
1924
|
|
1925
|
-
def cancel_all_orders(self, symbol:
|
1925
|
+
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1926
1926
|
"""
|
1927
1927
|
cancel all open orders in a market
|
1928
1928
|
:see: https://docs.delta.exchange/#cancel-all-open-orders
|
@@ -1947,7 +1947,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1947
1947
|
#
|
1948
1948
|
return response
|
1949
1949
|
|
1950
|
-
def fetch_open_orders(self, symbol:
|
1950
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1951
1951
|
"""
|
1952
1952
|
fetch all unfilled currently open orders
|
1953
1953
|
:see: https://docs.delta.exchange/#get-active-orders
|
@@ -1959,7 +1959,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1959
1959
|
"""
|
1960
1960
|
return self.fetch_orders_with_method('privateGetOrders', symbol, since, limit, params)
|
1961
1961
|
|
1962
|
-
def fetch_closed_orders(self, symbol:
|
1962
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1963
1963
|
"""
|
1964
1964
|
fetches information on multiple closed orders made by the user
|
1965
1965
|
:see: https://docs.delta.exchange/#get-order-history-cancelled-and-closed
|
@@ -1971,7 +1971,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1971
1971
|
"""
|
1972
1972
|
return self.fetch_orders_with_method('privateGetOrdersHistory', symbol, since, limit, params)
|
1973
1973
|
|
1974
|
-
def fetch_orders_with_method(self, method, symbol:
|
1974
|
+
def fetch_orders_with_method(self, method, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1975
1975
|
self.load_markets()
|
1976
1976
|
request = {
|
1977
1977
|
# 'product_ids': market['id'], # comma-separated
|
@@ -2018,7 +2018,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2018
2018
|
result = self.safe_value(response, 'result', [])
|
2019
2019
|
return self.parse_orders(result, market, since, limit)
|
2020
2020
|
|
2021
|
-
def fetch_my_trades(self, symbol:
|
2021
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2022
2022
|
"""
|
2023
2023
|
fetch all trades made by the user
|
2024
2024
|
:see: https://docs.delta.exchange/#get-user-fills-by-filters
|
@@ -2095,7 +2095,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2095
2095
|
result = self.safe_value(response, 'result', [])
|
2096
2096
|
return self.parse_trades(result, market, since, limit)
|
2097
2097
|
|
2098
|
-
def fetch_ledger(self, code:
|
2098
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2099
2099
|
"""
|
2100
2100
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
2101
2101
|
:see: https://docs.delta.exchange/#get-wallet-transactions
|
@@ -2159,7 +2159,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2159
2159
|
}
|
2160
2160
|
return self.safe_string(types, type, type)
|
2161
2161
|
|
2162
|
-
def parse_ledger_entry(self, item, currency=None):
|
2162
|
+
def parse_ledger_entry(self, item, currency: Currency = None):
|
2163
2163
|
#
|
2164
2164
|
# {
|
2165
2165
|
# "amount":"29.889184",
|
@@ -2252,7 +2252,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2252
2252
|
result = self.safe_value(response, 'result', {})
|
2253
2253
|
return self.parse_deposit_address(result, currency)
|
2254
2254
|
|
2255
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
2255
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
2256
2256
|
#
|
2257
2257
|
# {
|
2258
2258
|
# "id": 1915615,
|
@@ -2408,7 +2408,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2408
2408
|
result = self.parse_funding_rates(rates)
|
2409
2409
|
return self.filter_by_array(result, 'symbol', symbols)
|
2410
2410
|
|
2411
|
-
def parse_funding_rate(self, contract, market=None):
|
2411
|
+
def parse_funding_rate(self, contract, market: Market = None):
|
2412
2412
|
#
|
2413
2413
|
# {
|
2414
2414
|
# "close": 30600.5,
|
@@ -2534,7 +2534,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2534
2534
|
result = self.safe_value(response, 'result', {})
|
2535
2535
|
return self.parse_margin_modification(result, market)
|
2536
2536
|
|
2537
|
-
def parse_margin_modification(self, data, market=None):
|
2537
|
+
def parse_margin_modification(self, data, market: Market = None):
|
2538
2538
|
#
|
2539
2539
|
# {
|
2540
2540
|
# "auto_topup": False,
|
@@ -2638,7 +2638,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2638
2638
|
result = self.safe_value(response, 'result', {})
|
2639
2639
|
return self.parse_open_interest(result, market)
|
2640
2640
|
|
2641
|
-
def parse_open_interest(self, interest, market=None):
|
2641
|
+
def parse_open_interest(self, interest, market: Market = None):
|
2642
2642
|
#
|
2643
2643
|
# {
|
2644
2644
|
# "close": 894.0,
|
@@ -2729,7 +2729,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2729
2729
|
#
|
2730
2730
|
return self.privateGetProductsProductIdOrdersLeverage(self.extend(request, params))
|
2731
2731
|
|
2732
|
-
def set_leverage(self, leverage, symbol:
|
2732
|
+
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
2733
2733
|
"""
|
2734
2734
|
set the level of leverage for a market
|
2735
2735
|
:see: https://docs.delta.exchange/#change-order-leverage
|
@@ -2758,7 +2758,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2758
2758
|
#
|
2759
2759
|
return self.privatePostProductsProductIdOrdersLeverage(self.extend(request, params))
|
2760
2760
|
|
2761
|
-
def fetch_settlement_history(self, symbol:
|
2761
|
+
def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2762
2762
|
"""
|
2763
2763
|
fetches historical settlement records
|
2764
2764
|
:see: https://docs.delta.exchange/#get-product-settlement-prices
|
@@ -2980,7 +2980,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2980
2980
|
result = self.safe_value(response, 'result', {})
|
2981
2981
|
return self.parse_greeks(result, market)
|
2982
2982
|
|
2983
|
-
def parse_greeks(self, greeks, market=None):
|
2983
|
+
def parse_greeks(self, greeks, market: Market = None):
|
2984
2984
|
#
|
2985
2985
|
# {
|
2986
2986
|
# "close": 6793.0,
|
ccxt/deribit.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.deribit import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Greeks, Int, Order, OrderBook, OrderSide, OrderType,
|
9
|
+
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -578,7 +578,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
578
578
|
result = self.safe_value(response, 'result', [])
|
579
579
|
return self.parse_accounts(result)
|
580
580
|
|
581
|
-
def parse_account(self, account, currency=None):
|
581
|
+
def parse_account(self, account, currency: Currency = None):
|
582
582
|
#
|
583
583
|
# {
|
584
584
|
# "username": "someusername_1",
|
@@ -958,7 +958,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
958
958
|
'info': response,
|
959
959
|
}
|
960
960
|
|
961
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
961
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
962
962
|
#
|
963
963
|
# fetchTicker /public/ticker
|
964
964
|
#
|
@@ -1183,7 +1183,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1183
1183
|
ohlcvs = self.convert_trading_view_to_ohlcv(result, 'ticks', 'open', 'high', 'low', 'close', 'volume', True)
|
1184
1184
|
return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
|
1185
1185
|
|
1186
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
1186
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1187
1187
|
#
|
1188
1188
|
# fetchTrades(public)
|
1189
1189
|
#
|
@@ -1519,7 +1519,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1519
1519
|
}
|
1520
1520
|
return self.safe_string(orderTypes, orderType, orderType)
|
1521
1521
|
|
1522
|
-
def parse_order(self, order, market=None) -> Order:
|
1522
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
1523
1523
|
#
|
1524
1524
|
# createOrder
|
1525
1525
|
#
|
@@ -1611,7 +1611,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1611
1611
|
'trades': trades,
|
1612
1612
|
}, market)
|
1613
1613
|
|
1614
|
-
def fetch_order(self, id: str, symbol:
|
1614
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1615
1615
|
"""
|
1616
1616
|
fetches information on an order made by the user
|
1617
1617
|
:param str symbol: unified symbol of the market the order was made in
|
@@ -1831,7 +1831,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1831
1831
|
order['trades'] = trades
|
1832
1832
|
return self.parse_order(order)
|
1833
1833
|
|
1834
|
-
def cancel_order(self, id: str, symbol:
|
1834
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1835
1835
|
"""
|
1836
1836
|
cancels an open order
|
1837
1837
|
:param str id: order id
|
@@ -1847,7 +1847,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1847
1847
|
result = self.safe_value(response, 'result', {})
|
1848
1848
|
return self.parse_order(result)
|
1849
1849
|
|
1850
|
-
def cancel_all_orders(self, symbol:
|
1850
|
+
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1851
1851
|
"""
|
1852
1852
|
cancel all open orders
|
1853
1853
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
@@ -1866,7 +1866,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1866
1866
|
response = getattr(self, method)(self.extend(request, params))
|
1867
1867
|
return response
|
1868
1868
|
|
1869
|
-
def fetch_open_orders(self, symbol:
|
1869
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1870
1870
|
"""
|
1871
1871
|
fetch all unfilled currently open orders
|
1872
1872
|
:param str symbol: unified market symbol
|
@@ -1892,7 +1892,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1892
1892
|
result = self.safe_value(response, 'result', [])
|
1893
1893
|
return self.parse_orders(result, market, since, limit)
|
1894
1894
|
|
1895
|
-
def fetch_closed_orders(self, symbol:
|
1895
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1896
1896
|
"""
|
1897
1897
|
fetches information on multiple closed orders made by the user
|
1898
1898
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -1918,7 +1918,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1918
1918
|
result = self.safe_value(response, 'result', [])
|
1919
1919
|
return self.parse_orders(result, market, since, limit)
|
1920
1920
|
|
1921
|
-
def fetch_order_trades(self, id: str, symbol:
|
1921
|
+
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1922
1922
|
"""
|
1923
1923
|
fetch all the trades made from a single order
|
1924
1924
|
:param str id: order id
|
@@ -1969,7 +1969,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1969
1969
|
result = self.safe_value(response, 'result', {})
|
1970
1970
|
return self.parse_trades(result, None, since, limit)
|
1971
1971
|
|
1972
|
-
def fetch_my_trades(self, symbol:
|
1972
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1973
1973
|
"""
|
1974
1974
|
fetch all trades made by the user
|
1975
1975
|
:param str symbol: unified market symbol
|
@@ -2041,7 +2041,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2041
2041
|
trades = self.safe_value(result, 'trades', [])
|
2042
2042
|
return self.parse_trades(trades, market, since, limit)
|
2043
2043
|
|
2044
|
-
def fetch_deposits(self, code:
|
2044
|
+
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2045
2045
|
"""
|
2046
2046
|
fetch all deposits made to an account
|
2047
2047
|
:param str code: unified currency code
|
@@ -2084,7 +2084,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2084
2084
|
data = self.safe_value(result, 'data', [])
|
2085
2085
|
return self.parse_transactions(data, currency, since, limit, params)
|
2086
2086
|
|
2087
|
-
def fetch_withdrawals(self, code:
|
2087
|
+
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2088
2088
|
"""
|
2089
2089
|
fetch all withdrawals made from an account
|
2090
2090
|
:param str code: unified currency code
|
@@ -2138,7 +2138,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2138
2138
|
}
|
2139
2139
|
return self.safe_string(statuses, status, status)
|
2140
2140
|
|
2141
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
2141
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2142
2142
|
#
|
2143
2143
|
# fetchWithdrawals
|
2144
2144
|
#
|
@@ -2206,7 +2206,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2206
2206
|
'fee': fee,
|
2207
2207
|
}
|
2208
2208
|
|
2209
|
-
def parse_position(self, position, market=None):
|
2209
|
+
def parse_position(self, position, market: Market = None):
|
2210
2210
|
#
|
2211
2211
|
# {
|
2212
2212
|
# "jsonrpc": "2.0",
|
@@ -2431,7 +2431,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2431
2431
|
})
|
2432
2432
|
return result
|
2433
2433
|
|
2434
|
-
def fetch_transfers(self, code:
|
2434
|
+
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2435
2435
|
"""
|
2436
2436
|
fetch a history of internal transfers made on an account
|
2437
2437
|
:param str code: unified currency code of the currency transferred
|
@@ -2530,7 +2530,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2530
2530
|
result = self.safe_value(response, 'result', {})
|
2531
2531
|
return self.parse_transfer(result, currency)
|
2532
2532
|
|
2533
|
-
def parse_transfer(self, transfer, currency=None):
|
2533
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
2534
2534
|
#
|
2535
2535
|
# {
|
2536
2536
|
# "updated_timestamp": 1550232862350,
|
@@ -2596,7 +2596,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2596
2596
|
response = self.privateGetWithdraw(self.extend(request, params))
|
2597
2597
|
return self.parse_transaction(response, currency)
|
2598
2598
|
|
2599
|
-
def parse_deposit_withdraw_fee(self, fee, currency=None):
|
2599
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
2600
2600
|
#
|
2601
2601
|
# {
|
2602
2602
|
# "withdrawal_priorities": [],
|
@@ -2688,7 +2688,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2688
2688
|
#
|
2689
2689
|
return self.parse_funding_rate(response, market)
|
2690
2690
|
|
2691
|
-
def fetch_funding_rate_history(self, symbol:
|
2691
|
+
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2692
2692
|
"""
|
2693
2693
|
fetch the current funding rate
|
2694
2694
|
:see: https://docs.deribit.com/#public-get_funding_rate_history
|
@@ -2737,7 +2737,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2737
2737
|
rates.append(rate)
|
2738
2738
|
return self.filter_by_symbol_since_limit(rates, symbol, since, limit)
|
2739
2739
|
|
2740
|
-
def parse_funding_rate(self, contract, market=None):
|
2740
|
+
def parse_funding_rate(self, contract, market: Market = None):
|
2741
2741
|
#
|
2742
2742
|
# {
|
2743
2743
|
# "jsonrpc":"2.0",
|
@@ -2849,7 +2849,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2849
2849
|
data[dataLength - 1] = last
|
2850
2850
|
return data
|
2851
2851
|
|
2852
|
-
def fetch_my_liquidations(self, symbol:
|
2852
|
+
def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2853
2853
|
"""
|
2854
2854
|
retrieves the users liquidated positions
|
2855
2855
|
:see: https://docs.deribit.com/#private-get_settlement_history_by_instrument
|
@@ -2901,7 +2901,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2901
2901
|
settlements = self.safe_value(result, 'settlements', [])
|
2902
2902
|
return self.parse_liquidations(settlements, market, since, limit)
|
2903
2903
|
|
2904
|
-
def parse_liquidation(self, liquidation, market=None):
|
2904
|
+
def parse_liquidation(self, liquidation, market: Market = None):
|
2905
2905
|
#
|
2906
2906
|
# {
|
2907
2907
|
# "type": "bankruptcy",
|
@@ -2990,7 +2990,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2990
2990
|
result = self.safe_value(response, 'result', {})
|
2991
2991
|
return self.parse_greeks(result, market)
|
2992
2992
|
|
2993
|
-
def parse_greeks(self, greeks, market=None):
|
2993
|
+
def parse_greeks(self, greeks, market: Market = None):
|
2994
2994
|
#
|
2995
2995
|
# {
|
2996
2996
|
# "estimated_delivery_price": 36552.72,
|