Merge pull request #187 from itsdeka/combinedPRs

Combined all old unmerged PRs
This commit is contained in:
Vigan Abdurrahmani
2022-01-04 20:41:07 +01:00
committed by GitHub
4 changed files with 27 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
1.3.4
-) Fixed undefined p_sub issue in subscription_manager.py
-) Added submit cancel all funding orders endpoint (REST)
-) Added get all exchange pairs endpoint (REST)
1.3.3 1.3.3
-) Fixed socket.send() issue (IndexError: deque index out of range) -) Fixed socket.send() issue (IndexError: deque index out of range)

View File

@@ -370,6 +370,15 @@ class BfxRest:
stats = await self.fetch(endpoint) stats = await self.fetch(endpoint)
return stats return stats
async def get_conf_list_pair_exchange(self):
"""
Get list of available exchange pairs
# Attributes
@return Array [ SYMBOL ]
"""
endpoint = "conf/pub:list:pair:exchange"
pairs = await self.fetch(endpoint)
return pairs
################################################## ##################################################
# Authenticated Data # # Authenticated Data #
@@ -636,6 +645,17 @@ class BfxRest:
raw_notification = await self.post(endpoint, {'id': fundingId}) raw_notification = await self.post(endpoint, {'id': fundingId})
return Notification.from_raw_notification(raw_notification) return Notification.from_raw_notification(raw_notification)
async def submit_cancel_all_funding_offer(self, currency):
"""
Cancel all funding offers at once
# Attributes
@param currency str: currency for which to cancel all offers (USD, BTC, UST ...)
"""
endpoint = "auth/w/funding/offer/cancel/all"
raw_notification = await self.post(endpoint, {'currency': currency})
return Notification.from_raw_notification(raw_notification)
async def keep_funding(self, type, id): async def keep_funding(self, type, id):
""" """
Toggle to keep funding taken. Specify loan for unused funding and credit for used funding. Toggle to keep funding taken. Specify loan for unused funding and credit for used funding.

View File

@@ -2,4 +2,4 @@
This module contains the current version of the bfxapi lib This module contains the current version of the bfxapi lib
""" """
__version__ = '1.3.3' __version__ = '1.3.4'

View File

@@ -62,6 +62,7 @@ class SubscriptionManager:
channel = raw_ws_data.get("channel") channel = raw_ws_data.get("channel")
chan_id = raw_ws_data.get("chanId") chan_id = raw_ws_data.get("chanId")
key = raw_ws_data.get("key", None) key = raw_ws_data.get("key", None)
p_sub = None
get_key = "{}_{}".format(channel, key or symbol) get_key = "{}_{}".format(channel, key or symbol)
if chan_id in self.subscriptions_chanid: if chan_id in self.subscriptions_chanid:
# subscription has already existed in the past # subscription has already existed in the past