From a6670caf5ee04800d0d2728e4ea26a1ac390ea4d Mon Sep 17 00:00:00 2001 From: itsdeka Date: Tue, 4 Jan 2022 17:30:32 +0100 Subject: [PATCH 1/3] Avoid p_sub not initialized issue Thanks to @nkasimova (https://github.com/bitfinexcom/bitfinex-api-py/pull/170) --- bfxapi/websockets/subscription_manager.py | 1 + 1 file changed, 1 insertion(+) 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 From 64d203d8a82f41f879c843a2471d43d5ab69e2c7 Mon Sep 17 00:00:00 2001 From: itsdeka Date: Tue, 4 Jan 2022 17:42:15 +0100 Subject: [PATCH 2/3] Add submit cancel all funding offer Thanks to @charlychiu (https://github.com/bitfinexcom/bitfinex-api-py/pull/169) --- CHANGELOG | 4 ++++ bfxapi/rest/bfx_rest.py | 11 +++++++++++ bfxapi/version.py | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 5f5e657..5cfd0ec 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +1.3.4 +-) Fixed undefined p_sub issue in subscription_manager.py +-) Added submit cancel all funding orders 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..c29707f 100644 --- a/bfxapi/rest/bfx_rest.py +++ b/bfxapi/rest/bfx_rest.py @@ -636,6 +636,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' From 7fff1038af6c06e8ca80045e613fc496066237f2 Mon Sep 17 00:00:00 2001 From: itsdeka Date: Tue, 4 Jan 2022 17:58:10 +0100 Subject: [PATCH 3/3] Added get all exchange pairs endpoint (REST) --- CHANGELOG | 1 + bfxapi/rest/bfx_rest.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5cfd0ec..3c1f98a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ 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 c29707f..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 #