bitmex-api 0.0.71__py3-none-any.whl → 0.0.72__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.
bitmex/ccxt/__init__.py CHANGED
@@ -26,7 +26,7 @@ sys.modules['ccxt'] = ccxt_module
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
29
- __version__ = '4.4.92'
29
+ __version__ = '4.4.93'
30
30
 
31
31
  # ----------------------------------------------------------------------------
32
32
 
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.92'
11
+ __version__ = '4.4.93'
12
12
 
13
13
  # -----------------------------------------------------------------------------
14
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.92'
5
+ __version__ = '4.4.93'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -1573,6 +1573,9 @@ class Exchange(BaseExchange):
1573
1573
  async def fetch_greeks(self, symbol: str, params={}):
1574
1574
  raise NotSupported(self.id + ' fetchGreeks() is not supported yet')
1575
1575
 
1576
+ async def fetch_all_greeks(self, symbols: Strings = None, params={}):
1577
+ raise NotSupported(self.id + ' fetchAllGreeks() is not supported yet')
1578
+
1576
1579
  async def fetch_option_chain(self, code: str, params={}):
1577
1580
  raise NotSupported(self.id + ' fetchOptionChain() is not supported yet')
1578
1581
 
@@ -137,6 +137,9 @@ class Client(object):
137
137
  self.reject(error)
138
138
 
139
139
  task.add_done_callback(after_interrupt)
140
+ else:
141
+ # connection got terminated after the connection was made and before the receive loop ran
142
+ self.on_close(1006)
140
143
 
141
144
  async def open(self, session, backoff_delay=0):
142
145
  # exponential backoff for consequent connections if necessary
@@ -1924,7 +1924,7 @@ class bitmex(Exchange, ImplicitAPI):
1924
1924
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1925
1925
  :param dict [params]: extra parameters specific to the exchange API endpoint
1926
1926
  :param dict [params.triggerPrice]: the price at which a trigger order is triggered at
1927
- :param dict [params.triggerDirection]: the direction whenever the trigger happens with relation to price - 'above' or 'below'
1927
+ :param dict [params.triggerDirection]: the direction whenever the trigger happens with relation to price - 'ascending' or 'descending'
1928
1928
  :param float [params.trailingAmount]: the quote amount to trail away from the current market price
1929
1929
  :returns dict: an `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
1930
1930
  """
@@ -1951,7 +1951,7 @@ class bitmex(Exchange, ImplicitAPI):
1951
1951
  isTrailingAmountOrder = trailingAmount is not None
1952
1952
  if isTriggerOrder or isTrailingAmountOrder:
1953
1953
  triggerDirection = self.safe_string(params, 'triggerDirection')
1954
- triggerAbove = (triggerDirection == 'above')
1954
+ triggerAbove = ((triggerDirection == 'ascending') or (triggerDirection == 'above'))
1955
1955
  if (type == 'limit') or (type == 'market'):
1956
1956
  self.check_required_argument('createOrder', triggerDirection, 'triggerDirection', ['above', 'below'])
1957
1957
  if type == 'limit':
@@ -1994,7 +1994,7 @@ class bitmex(Exchange, ImplicitAPI):
1994
1994
  isTrailingAmountOrder = trailingAmount is not None
1995
1995
  if isTrailingAmountOrder:
1996
1996
  triggerDirection = self.safe_string(params, 'triggerDirection')
1997
- triggerAbove = (triggerDirection == 'above')
1997
+ triggerAbove = ((triggerDirection == 'ascending') or (triggerDirection == 'above'))
1998
1998
  if (type == 'limit') or (type == 'market'):
1999
1999
  self.check_required_argument('createOrder', triggerDirection, 'triggerDirection', ['above', 'below'])
2000
2000
  orderType = None
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.92'
7
+ __version__ = '4.4.93'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -4229,7 +4229,7 @@ class Exchange(object):
4229
4229
  return self.filter_by_since_limit(sorted, since, limit, 0, tail)
4230
4230
 
4231
4231
  def parse_leverage_tiers(self, response: Any, symbols: List[str] = None, marketIdKey=None):
4232
- # marketIdKey should only be None when response is a dictionary
4232
+ # marketIdKey should only be None when response is a dictionary.
4233
4233
  symbols = self.market_symbols(symbols)
4234
4234
  tiers = {}
4235
4235
  symbolsLength = 0
@@ -5450,6 +5450,9 @@ class Exchange(object):
5450
5450
  def fetch_greeks(self, symbol: str, params={}):
5451
5451
  raise NotSupported(self.id + ' fetchGreeks() is not supported yet')
5452
5452
 
5453
+ def fetch_all_greeks(self, symbols: Strings = None, params={}):
5454
+ raise NotSupported(self.id + ' fetchAllGreeks() is not supported yet')
5455
+
5453
5456
  def fetch_option_chain(self, code: str, params={}):
5454
5457
  raise NotSupported(self.id + ' fetchOptionChain() is not supported yet')
5455
5458
 
@@ -5703,10 +5706,16 @@ class Exchange(object):
5703
5706
  precisionNumber = int(precision)
5704
5707
  if precisionNumber == 0:
5705
5708
  return '1'
5706
- parsedPrecision = '0.'
5707
- for i in range(0, precisionNumber - 1):
5708
- parsedPrecision = parsedPrecision + '0'
5709
- return parsedPrecision + '1'
5709
+ if precisionNumber > 0:
5710
+ parsedPrecision = '0.'
5711
+ for i in range(0, precisionNumber - 1):
5712
+ parsedPrecision = parsedPrecision + '0'
5713
+ return parsedPrecision + '1'
5714
+ else:
5715
+ parsedPrecision = '1'
5716
+ for i in range(0, precisionNumber * -1 - 1):
5717
+ parsedPrecision = parsedPrecision + '0'
5718
+ return parsedPrecision + '0'
5710
5719
 
5711
5720
  def integer_precision_to_amount(self, precision: Str):
5712
5721
  """
@@ -6682,6 +6691,27 @@ class Exchange(object):
6682
6691
  def parse_greeks(self, greeks: dict, market: Market = None):
6683
6692
  raise NotSupported(self.id + ' parseGreeks() is not supported yet')
6684
6693
 
6694
+ def parse_all_greeks(self, greeks, symbols: Strings = None, params={}):
6695
+ #
6696
+ # the value of greeks is either a dict or a list
6697
+ #
6698
+ results = []
6699
+ if isinstance(greeks, list):
6700
+ for i in range(0, len(greeks)):
6701
+ parsedTicker = self.parse_greeks(greeks[i])
6702
+ greek = self.extend(parsedTicker, params)
6703
+ results.append(greek)
6704
+ else:
6705
+ marketIds = list(greeks.keys())
6706
+ for i in range(0, len(marketIds)):
6707
+ marketId = marketIds[i]
6708
+ market = self.safe_market(marketId)
6709
+ parsed = self.parse_greeks(greeks[marketId], market)
6710
+ greek = self.extend(parsed, params)
6711
+ results.append(greek)
6712
+ symbols = self.market_symbols(symbols)
6713
+ return self.filter_by_array(results, 'symbol', symbols)
6714
+
6685
6715
  def parse_option(self, chain: dict, currency: Currency = None, market: Market = None):
6686
6716
  raise NotSupported(self.id + ' parseOption() is not supported yet')
6687
6717
 
@@ -6883,14 +6913,27 @@ class Exchange(object):
6883
6913
  """
6884
6914
  raise NotSupported(self.id + ' fetchTransfers() is not supported yet')
6885
6915
 
6886
- def clean_unsubscription(self, client, subHash: str, unsubHash: str):
6916
+ def clean_unsubscription(self, client, subHash: str, unsubHash: str, subHashIsPrefix=False):
6887
6917
  if unsubHash in client.subscriptions:
6888
6918
  del client.subscriptions[unsubHash]
6889
- if subHash in client.subscriptions:
6890
- del client.subscriptions[subHash]
6891
- if subHash in client.futures:
6892
- error = UnsubscribeError(self.id + ' ' + subHash)
6893
- client.reject(error, subHash)
6919
+ if not subHashIsPrefix:
6920
+ if subHash in client.subscriptions:
6921
+ del client.subscriptions[subHash]
6922
+ if subHash in client.futures:
6923
+ error = UnsubscribeError(self.id + ' ' + subHash)
6924
+ client.reject(error, subHash)
6925
+ else:
6926
+ clientSubscriptions = list(client.subscriptions.keys())
6927
+ for i in range(0, len(clientSubscriptions)):
6928
+ sub = clientSubscriptions[i]
6929
+ if sub.startswith(subHash):
6930
+ del client.subscriptions[sub]
6931
+ clientFutures = list(client.futures.keys())
6932
+ for i in range(0, len(clientFutures)):
6933
+ future = clientFutures[i]
6934
+ if future.startswith(subHash):
6935
+ error = UnsubscribeError(self.id + ' ' + future)
6936
+ client.reject(error, future)
6894
6937
  client.resolve(True, unsubHash)
6895
6938
 
6896
6939
  def clean_cache(self, subscription: dict):
bitmex/ccxt/bitmex.py CHANGED
@@ -1924,7 +1924,7 @@ class bitmex(Exchange, ImplicitAPI):
1924
1924
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1925
1925
  :param dict [params]: extra parameters specific to the exchange API endpoint
1926
1926
  :param dict [params.triggerPrice]: the price at which a trigger order is triggered at
1927
- :param dict [params.triggerDirection]: the direction whenever the trigger happens with relation to price - 'above' or 'below'
1927
+ :param dict [params.triggerDirection]: the direction whenever the trigger happens with relation to price - 'ascending' or 'descending'
1928
1928
  :param float [params.trailingAmount]: the quote amount to trail away from the current market price
1929
1929
  :returns dict: an `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
1930
1930
  """
@@ -1951,7 +1951,7 @@ class bitmex(Exchange, ImplicitAPI):
1951
1951
  isTrailingAmountOrder = trailingAmount is not None
1952
1952
  if isTriggerOrder or isTrailingAmountOrder:
1953
1953
  triggerDirection = self.safe_string(params, 'triggerDirection')
1954
- triggerAbove = (triggerDirection == 'above')
1954
+ triggerAbove = ((triggerDirection == 'ascending') or (triggerDirection == 'above'))
1955
1955
  if (type == 'limit') or (type == 'market'):
1956
1956
  self.check_required_argument('createOrder', triggerDirection, 'triggerDirection', ['above', 'below'])
1957
1957
  if type == 'limit':
@@ -1994,7 +1994,7 @@ class bitmex(Exchange, ImplicitAPI):
1994
1994
  isTrailingAmountOrder = trailingAmount is not None
1995
1995
  if isTrailingAmountOrder:
1996
1996
  triggerDirection = self.safe_string(params, 'triggerDirection')
1997
- triggerAbove = (triggerDirection == 'above')
1997
+ triggerAbove = ((triggerDirection == 'ascending') or (triggerDirection == 'above'))
1998
1998
  if (type == 'limit') or (type == 'market'):
1999
1999
  self.check_required_argument('createOrder', triggerDirection, 'triggerDirection', ['above', 'below'])
2000
2000
  orderType = None
@@ -8,7 +8,7 @@ sys.modules['ccxt'] = ccxt_module
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
11
- __version__ = '4.4.92'
11
+ __version__ = '4.4.93'
12
12
 
13
13
  # ----------------------------------------------------------------------------
14
14
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitmex-api
3
- Version: 0.0.71
3
+ Version: 0.0.72
4
4
  Summary: bitmex crypto exchange api client
5
5
  Project-URL: Homepage, https://github.com/ccxt/ccxt
6
6
  Project-URL: Issues, https://github.com/ccxt/ccxt
@@ -1,15 +1,15 @@
1
1
  bitmex/__init__.py,sha256=YoXAuxG_VioYinNV_H2dBOxO7R1bhKl6aL_6s6TfuWg,246
2
- bitmex/ccxt/__init__.py,sha256=aEJyISXdcfVqLr5aEV8As2cwXDxAzseaaQzKY8py4vI,6048
3
- bitmex/ccxt/bitmex.py,sha256=yfYWTE6n3KxcWIGrbEwus9Q4eOm5xGlmjapaBOjQfek,131832
2
+ bitmex/ccxt/__init__.py,sha256=Obef7QWau9q5fHC4c4gn95HCXqBvODamHIn-FaXSR2I,6048
3
+ bitmex/ccxt/bitmex.py,sha256=ueedqmgQhSTNZdES0h7RCHD2Vqy34lHyuQajQRz3AOA,131919
4
4
  bitmex/ccxt/abstract/bitmex.py,sha256=v15OP-vSO_eotD6KVf1BgKrbPxCPl2eXXYIuzWF1dl4,10774
5
- bitmex/ccxt/async_support/__init__.py,sha256=8F3ZBrf8hi2jBcKKKDe_XEpWrp6jl9ebmV_Dpp0l7KE,4781
6
- bitmex/ccxt/async_support/bitmex.py,sha256=Nol7iGiAzcCom877VUrfsL0cobZ5DXPRmYmq6noBsoM,132410
5
+ bitmex/ccxt/async_support/__init__.py,sha256=LdbXxMk9EW2jxYHzXKpVGfmzHSSv-Psu9o3uTnLk4Zw,4781
6
+ bitmex/ccxt/async_support/bitmex.py,sha256=pImd4aNvGd6-Kp8HqX78kA7toBrrbS0bIHSbG_13s5M,132497
7
7
  bitmex/ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
8
- bitmex/ccxt/async_support/base/exchange.py,sha256=FQynGv0nHLJXfqiWThG1GFXUYqFMvMBdRkMYAxVGrqY,119286
8
+ bitmex/ccxt/async_support/base/exchange.py,sha256=WRCIHpPMqJ4UpcL4x534QQWA1Bo4RFS1xJitRjKFViw,119440
9
9
  bitmex/ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
10
10
  bitmex/ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
11
11
  bitmex/ccxt/async_support/base/ws/cache.py,sha256=xf2VOtfUwloxSlIQ39M1RGZHWQzyS9IGhB5NX6cDcAc,8370
12
- bitmex/ccxt/async_support/base/ws/client.py,sha256=1N_ji0ekjViecIHdcT7a8DVbq8aB-ZVgjK6ccJZntMU,13476
12
+ bitmex/ccxt/async_support/base/ws/client.py,sha256=ekIN5HNgeQgMG3tLZMsE889Aoxs960DLwQnwkTGhdi8,13624
13
13
  bitmex/ccxt/async_support/base/ws/functions.py,sha256=qwvEnjtINWL5ZU-dbbeIunjyBxzFqbGWHfVhxqAcKug,1499
14
14
  bitmex/ccxt/async_support/base/ws/future.py,sha256=9yFyxqT7cl-7ZFM6LM4b6UPXyO2FGIbAhs5uoJ3-Smo,1271
15
15
  bitmex/ccxt/async_support/base/ws/order_book.py,sha256=uBUaIHhzMRykpmo4BCsdJ-t_HozS6VxhEs8x-Kbj-NI,2894
@@ -17,10 +17,10 @@ bitmex/ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9pr
17
17
  bitmex/ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
18
18
  bitmex/ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
19
19
  bitmex/ccxt/base/errors.py,sha256=MvCrL_sAM3de616T6RE0PSxiF2xV6Qqz5b1y1ghidbk,4888
20
- bitmex/ccxt/base/exchange.py,sha256=_2FOqAIq1yfzBic5QI4JMQseWYPIesZpubuSde7jxYk,328428
20
+ bitmex/ccxt/base/exchange.py,sha256=64LNTmAxXu8gUG6n4pwCNjTmVZmV0otj7ceWXRB3G6o,330373
21
21
  bitmex/ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
22
22
  bitmex/ccxt/base/types.py,sha256=vMQfFDVntED4YHrRJt0Q98YaM7OtGhK-DkbkqXFTYHc,11485
23
- bitmex/ccxt/pro/__init__.py,sha256=3KZOyC7YKnTsJEMTTiRvKjLX8-vWw6l1SwI5Jh65UAc,4095
23
+ bitmex/ccxt/pro/__init__.py,sha256=IdLOKCMg8sPsG9N9bC3Kzacmyngl8q5QKWSoNvp_TTU,4095
24
24
  bitmex/ccxt/pro/bitmex.py,sha256=5gpicgex_am9Km9ZsZpMKBSKX-SFFAD3PPuv9r-nNdA,74693
25
25
  bitmex/ccxt/static_dependencies/README.md,sha256=3TCvhhn09_Cqf9BDDpao1V7EfKHDpQ6k9oWRsLFixpU,18
26
26
  bitmex/ccxt/static_dependencies/__init__.py,sha256=tzFje8cloqmiIE6kola3EaYC0SnD1izWnri69hzHsSw,168
@@ -281,6 +281,6 @@ bitmex/ccxt/static_dependencies/toolz/curried/exceptions.py,sha256=gKFOHDIayAWnX
281
281
  bitmex/ccxt/static_dependencies/toolz/curried/operator.py,sha256=ML92mknkAwzBl2NCm-4werSUmJEtSHNY9NSzhseNM9s,525
282
282
  bitmex/ccxt/static_dependencies/typing_inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
283
283
  bitmex/ccxt/static_dependencies/typing_inspect/typing_inspect.py,sha256=5gIWomLPfuDpgd3gX1GlnX0MuXM3VorR4j2W2qXORiQ,28269
284
- bitmex_api-0.0.71.dist-info/METADATA,sha256=JzM5mSY1O5atdt_4CH7nc_ufMMdRVG5r1tmMWbsNx1k,10822
285
- bitmex_api-0.0.71.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
- bitmex_api-0.0.71.dist-info/RECORD,,
284
+ bitmex_api-0.0.72.dist-info/METADATA,sha256=H8VM9D6wIoTk4C78OMu-ICnml0cdNkehc1JRT36nfHs,10822
285
+ bitmex_api-0.0.72.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
286
+ bitmex_api-0.0.72.dist-info/RECORD,,