From 23c00e77a2d47342961aebadcb083a07bc8a03a7 Mon Sep 17 00:00:00 2001 From: itsdeka Date: Sat, 27 Aug 2022 17:17:13 +0200 Subject: [PATCH] refactoring - updated tests --- bfxapi/examples/rest/create_funding.py | 3 ++- bfxapi/examples/rest/create_order.py | 3 ++- bfxapi/examples/rest/get_authenticated_data.py | 3 ++- bfxapi/examples/rest/get_public_data.py | 3 ++- bfxapi/examples/rest/get_seed_trades.py | 3 ++- bfxapi/examples/rest/merchant.py | 3 ++- bfxapi/examples/rest/transfer_wallet.py | 3 ++- bfxapi/examples/ws/cancel_order.py | 3 ++- bfxapi/examples/ws/connect.py | 3 ++- bfxapi/examples/ws/connect_auth.py | 3 ++- bfxapi/examples/ws/full_orderbook.py | 3 ++- bfxapi/examples/ws/multiple_instances.py | 3 ++- bfxapi/examples/ws/resubscribe_orderbook.py | 3 ++- bfxapi/examples/ws/send_order.py | 3 ++- bfxapi/examples/ws/start_stop_connection.py | 3 ++- bfxapi/examples/ws/subscribe_derivative_status.py | 3 ++- bfxapi/examples/ws/subscribe_orderbook.py | 3 ++- bfxapi/examples/ws/subscribe_tickers.py | 3 ++- bfxapi/examples/ws/subscribe_trades_candles.py | 3 ++- bfxapi/examples/ws/update_order.py | 3 ++- bfxapi/examples/ws/wallet_balance.py | 3 ++- 21 files changed, 42 insertions(+), 21 deletions(-) diff --git a/bfxapi/examples/rest/create_funding.py b/bfxapi/examples/rest/create_funding.py index 8e4eeae..db16826 100644 --- a/bfxapi/examples/rest/create_funding.py +++ b/bfxapi/examples/rest/create_funding.py @@ -3,7 +3,8 @@ import sys import asyncio sys.path.append('../../../') -from bfxapi import Client, WS_HOST, REST_HOST +from bfxapi import Client +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET") diff --git a/bfxapi/examples/rest/create_order.py b/bfxapi/examples/rest/create_order.py index ad5bc23..94e9640 100644 --- a/bfxapi/examples/rest/create_order.py +++ b/bfxapi/examples/rest/create_order.py @@ -3,7 +3,8 @@ import sys import asyncio import time sys.path.append('../../../') -from bfxapi import Client, WS_HOST, REST_HOST +from bfxapi import Client +from bfxapi.constants import WS_HOST, REST_HOST from bfxapi.models import OrderType API_KEY=os.getenv("BFX_KEY") diff --git a/bfxapi/examples/rest/get_authenticated_data.py b/bfxapi/examples/rest/get_authenticated_data.py index c5776a1..a557de2 100644 --- a/bfxapi/examples/rest/get_authenticated_data.py +++ b/bfxapi/examples/rest/get_authenticated_data.py @@ -4,7 +4,8 @@ import asyncio import time sys.path.append('../../../') -from bfxapi import Client, WS_HOST, REST_HOST +from bfxapi import Client +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET") diff --git a/bfxapi/examples/rest/get_public_data.py b/bfxapi/examples/rest/get_public_data.py index 151ca0d..6d1e246 100644 --- a/bfxapi/examples/rest/get_public_data.py +++ b/bfxapi/examples/rest/get_public_data.py @@ -4,7 +4,8 @@ import asyncio import time sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST # Retrieving public data requires public hosts bfx = Client( diff --git a/bfxapi/examples/rest/get_seed_trades.py b/bfxapi/examples/rest/get_seed_trades.py index caffb19..6f9cbf8 100644 --- a/bfxapi/examples/rest/get_seed_trades.py +++ b/bfxapi/examples/rest/get_seed_trades.py @@ -3,7 +3,8 @@ import sys import asyncio sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST # Retrieving seed trades requires public hosts bfx = Client( diff --git a/bfxapi/examples/rest/merchant.py b/bfxapi/examples/rest/merchant.py index 81c8fae..5477588 100644 --- a/bfxapi/examples/rest/merchant.py +++ b/bfxapi/examples/rest/merchant.py @@ -2,7 +2,8 @@ import os import sys import asyncio sys.path.append('../../../') -from bfxapi import Client, WS_HOST, REST_HOST +from bfxapi import Client +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET") diff --git a/bfxapi/examples/rest/transfer_wallet.py b/bfxapi/examples/rest/transfer_wallet.py index 84e5616..a0c59ce 100644 --- a/bfxapi/examples/rest/transfer_wallet.py +++ b/bfxapi/examples/rest/transfer_wallet.py @@ -3,7 +3,8 @@ import sys import asyncio sys.path.append('../../../') -from bfxapi import Client, WS_HOST, REST_HOST +from bfxapi import Client +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET") diff --git a/bfxapi/examples/ws/cancel_order.py b/bfxapi/examples/ws/cancel_order.py index 6804c30..e37ad00 100644 --- a/bfxapi/examples/ws/cancel_order.py +++ b/bfxapi/examples/ws/cancel_order.py @@ -2,7 +2,8 @@ import os import sys sys.path.append('../../../') -from bfxapi import Client, Order, WS_HOST, REST_HOST +from bfxapi import Client, Order +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET") diff --git a/bfxapi/examples/ws/connect.py b/bfxapi/examples/ws/connect.py index ffb28ac..b63cd7d 100644 --- a/bfxapi/examples/ws/connect.py +++ b/bfxapi/examples/ws/connect.py @@ -2,7 +2,8 @@ import os import sys sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST bfx = Client( logLevel='DEBUG', diff --git a/bfxapi/examples/ws/connect_auth.py b/bfxapi/examples/ws/connect_auth.py index 4e5db58..a01c6d3 100644 --- a/bfxapi/examples/ws/connect_auth.py +++ b/bfxapi/examples/ws/connect_auth.py @@ -2,7 +2,8 @@ import os import sys sys.path.append('../../../') -from bfxapi import Client, WS_HOST, REST_HOST +from bfxapi import Client +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET") diff --git a/bfxapi/examples/ws/full_orderbook.py b/bfxapi/examples/ws/full_orderbook.py index 49639b4..baac656 100644 --- a/bfxapi/examples/ws/full_orderbook.py +++ b/bfxapi/examples/ws/full_orderbook.py @@ -3,7 +3,8 @@ import time from collections import OrderedDict sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST # Retrieving orderbook requires public hosts bfx = Client( diff --git a/bfxapi/examples/ws/multiple_instances.py b/bfxapi/examples/ws/multiple_instances.py index 9cb89ed..cf1dc04 100644 --- a/bfxapi/examples/ws/multiple_instances.py +++ b/bfxapi/examples/ws/multiple_instances.py @@ -10,7 +10,8 @@ sys.path.append('../../../') import asyncio from functools import partial import websockets as ws -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST import math import random diff --git a/bfxapi/examples/ws/resubscribe_orderbook.py b/bfxapi/examples/ws/resubscribe_orderbook.py index 7bbfb20..5e10277 100644 --- a/bfxapi/examples/ws/resubscribe_orderbook.py +++ b/bfxapi/examples/ws/resubscribe_orderbook.py @@ -1,7 +1,8 @@ import sys sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST # Retrieving orderbook requires public hosts bfx = Client( diff --git a/bfxapi/examples/ws/send_order.py b/bfxapi/examples/ws/send_order.py index f26d670..743934d 100644 --- a/bfxapi/examples/ws/send_order.py +++ b/bfxapi/examples/ws/send_order.py @@ -2,7 +2,8 @@ import os import sys sys.path.append('../../../') -from bfxapi import Client, Order, WS_HOST, REST_HOST +from bfxapi import Client, Order +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET") diff --git a/bfxapi/examples/ws/start_stop_connection.py b/bfxapi/examples/ws/start_stop_connection.py index 59de479..4ddafbf 100644 --- a/bfxapi/examples/ws/start_stop_connection.py +++ b/bfxapi/examples/ws/start_stop_connection.py @@ -1,7 +1,8 @@ import sys sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST bfx = Client( logLevel='DEBUG', diff --git a/bfxapi/examples/ws/subscribe_derivative_status.py b/bfxapi/examples/ws/subscribe_derivative_status.py index 52ca79d..3c5a995 100644 --- a/bfxapi/examples/ws/subscribe_derivative_status.py +++ b/bfxapi/examples/ws/subscribe_derivative_status.py @@ -1,7 +1,8 @@ import sys sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST # Retrieving derivative status requires public hosts bfx = Client( diff --git a/bfxapi/examples/ws/subscribe_orderbook.py b/bfxapi/examples/ws/subscribe_orderbook.py index bc06945..a9c44ab 100644 --- a/bfxapi/examples/ws/subscribe_orderbook.py +++ b/bfxapi/examples/ws/subscribe_orderbook.py @@ -2,7 +2,8 @@ import os import sys sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST # Retrieving trades/candles requires public hosts bfx = Client( diff --git a/bfxapi/examples/ws/subscribe_tickers.py b/bfxapi/examples/ws/subscribe_tickers.py index 2eb744f..616571e 100644 --- a/bfxapi/examples/ws/subscribe_tickers.py +++ b/bfxapi/examples/ws/subscribe_tickers.py @@ -1,7 +1,8 @@ import sys sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST # Retrieving tickers requires public hosts bfx = Client( diff --git a/bfxapi/examples/ws/subscribe_trades_candles.py b/bfxapi/examples/ws/subscribe_trades_candles.py index 1248dea..024eb58 100644 --- a/bfxapi/examples/ws/subscribe_trades_candles.py +++ b/bfxapi/examples/ws/subscribe_trades_candles.py @@ -1,7 +1,8 @@ import sys sys.path.append('../../../') -from bfxapi import Client, PUB_WS_HOST, PUB_REST_HOST +from bfxapi import Client +from bfxapi.constants import PUB_WS_HOST, PUB_REST_HOST # Retrieving trades/candles requires public hosts bfx = Client( diff --git a/bfxapi/examples/ws/update_order.py b/bfxapi/examples/ws/update_order.py index 936d1b6..8eb26ae 100644 --- a/bfxapi/examples/ws/update_order.py +++ b/bfxapi/examples/ws/update_order.py @@ -2,7 +2,8 @@ import os import sys sys.path.append('../../../') -from bfxapi import Client, Order, WS_HOST, REST_HOST +from bfxapi import Client, Order +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET") diff --git a/bfxapi/examples/ws/wallet_balance.py b/bfxapi/examples/ws/wallet_balance.py index 731faa6..f4af163 100644 --- a/bfxapi/examples/ws/wallet_balance.py +++ b/bfxapi/examples/ws/wallet_balance.py @@ -1,7 +1,8 @@ import os import sys sys.path.append('../../../') -from bfxapi import Client, WS_HOST, REST_HOST +from bfxapi import Client +from bfxapi.constants import WS_HOST, REST_HOST API_KEY=os.getenv("BFX_KEY") API_SECRET=os.getenv("BFX_SECRET")