mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-20 15:24:21 +01:00
Replace 'is not' with '!='
This commit is contained in:
committed by
Jacob Plaster
parent
cea31acf9d
commit
2cde664359
@@ -1,5 +1,6 @@
|
||||
1.1.4
|
||||
- Locks mutex when sending websocket messages
|
||||
- Fix py3.8 stricter linting errors
|
||||
|
||||
1.1.3
|
||||
- Adds ability to specify channel_filter in client
|
||||
|
||||
@@ -41,7 +41,7 @@ class BfxRest:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(url) as resp:
|
||||
text = await resp.text()
|
||||
if resp.status is not 200:
|
||||
if resp.status != 200:
|
||||
raise Exception('GET {} failed with status {} - {}'
|
||||
.format(url, resp.status, text))
|
||||
parsed = json.loads(text, parse_float=self.parse_float)
|
||||
|
||||
@@ -131,19 +131,19 @@ class OrderManager:
|
||||
flags = calculate_order_flags(hidden, close, reduce_only, post_only, oco)
|
||||
payload['flags'] = flags
|
||||
# add extra parameters
|
||||
if price_trailing is not None:
|
||||
if price_trailing != None:
|
||||
payload['price_trailing'] = price_trailing
|
||||
if price_aux_limit is not None:
|
||||
if price_aux_limit != None:
|
||||
payload['price_aux_limit'] = price_aux_limit
|
||||
if oco_stop_price is not None:
|
||||
if oco_stop_price != None:
|
||||
payload['price_oco_stop'] = str(oco_stop_price)
|
||||
if time_in_force is not None:
|
||||
if time_in_force != None:
|
||||
payload['tif'] = time_in_force
|
||||
if gid is not None:
|
||||
if gid != None:
|
||||
payload['gid'] = gid
|
||||
if leverage is not None:
|
||||
if leverage != None:
|
||||
payload['lev'] = str(leverage)
|
||||
if aff_code is not None:
|
||||
if aff_code != None:
|
||||
payload['meta']['aff_code'] = str(aff_code)
|
||||
# submit the order
|
||||
self.pending_orders[cid] = payload
|
||||
@@ -180,19 +180,19 @@ class OrderManager:
|
||||
"""
|
||||
self._create_callback(orderId, onConfirm, self.pending_update_confirm_callbacks)
|
||||
payload = {"id": orderId}
|
||||
if price is not None:
|
||||
if price != None:
|
||||
payload['price'] = str(price)
|
||||
if amount is not None:
|
||||
if amount != None:
|
||||
payload['amount'] = str(amount)
|
||||
if delta is not None:
|
||||
if delta != None:
|
||||
payload['delta'] = str(delta)
|
||||
if price_aux_limit is not None:
|
||||
if price_aux_limit != None:
|
||||
payload['price_aux_limit'] = str(price_aux_limit)
|
||||
if price_trailing is not None:
|
||||
if price_trailing != None:
|
||||
payload['price_trailing'] = str(price_trailing)
|
||||
if time_in_force is not None:
|
||||
if time_in_force != None:
|
||||
payload['time_in_force'] = str(time_in_force)
|
||||
if leverage is not None:
|
||||
if leverage != None:
|
||||
payload['lev'] = str(leverage)
|
||||
flags = calculate_order_flags(
|
||||
hidden, close, reduce_only, post_only, False)
|
||||
|
||||
Reference in New Issue
Block a user