diff --git a/CHANGELOG b/CHANGELOG index 5f5e657..3c1f98a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 -) Fixed socket.send() issue (IndexError: deque index out of range) diff --git a/bfxapi/rest/bfx_rest.py b/bfxapi/rest/bfx_rest.py index a2a104e..5cfc97a 100644 --- a/bfxapi/rest/bfx_rest.py +++ b/bfxapi/rest/bfx_rest.py @@ -370,6 +370,15 @@ class BfxRest: stats = await self.fetch(endpoint) 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 # @@ -636,6 +645,17 @@ class BfxRest: raw_notification = await self.post(endpoint, {'id': fundingId}) 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): """ Toggle to keep funding taken. Specify loan for unused funding and credit for used funding. diff --git a/bfxapi/version.py b/bfxapi/version.py index 85f1fa2..bceabe3 100644 --- a/bfxapi/version.py +++ b/bfxapi/version.py @@ -2,4 +2,4 @@ This module contains the current version of the bfxapi lib """ -__version__ = '1.3.3' +__version__ = '1.3.4' diff --git a/bfxapi/websockets/subscription_manager.py b/bfxapi/websockets/subscription_manager.py index c90c073..b516867 100644 --- a/bfxapi/websockets/subscription_manager.py +++ b/bfxapi/websockets/subscription_manager.py @@ -62,6 +62,7 @@ class SubscriptionManager: channel = raw_ws_data.get("channel") chan_id = raw_ws_data.get("chanId") key = raw_ws_data.get("key", None) + p_sub = None get_key = "{}_{}".format(channel, key or symbol) if chan_id in self.subscriptions_chanid: # subscription has already existed in the past