Skip to content

Commit b9ede4c

Browse files
committed
Add supported symbols url
1 parent 5c5dde6 commit b9ede4c

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

finterion/configuration/urls.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ def get_retrieve_position_url(base_url, position_id):
2828

2929
def get_retrieve_portfolio_url(base_url):
3030
return f"{base_url}/portfolio"
31+
32+
33+
def get_supported_symbols_url(base_url):
34+
return f"{base_url}/symbols"

finterion/finterion.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,11 @@ def get_portfolio(self, query_params: dict = None):
184184
)
185185
logger.debug(f"get_portfolio response {response}")
186186
return response
187+
188+
def get_supported_symbols(self):
189+
response = services.get_supported_symbols(
190+
api_key=self.api_key,
191+
base_url=self.base_url
192+
)
193+
logger.debug(f"get_supported_symbols response {response}")
194+
return response

finterion/services.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from finterion.configuration.urls import get_retrieve_order_url, \
77
get_ping_url, get_algorithm_url, get_retrieve_portfolio_url, \
88
get_retrieve_position_url, get_list_positions_url, get_list_orders_url, \
9-
create_order_url
9+
create_order_url, get_supported_symbols_url
1010
from finterion.exceptions import ClientException
1111

1212
logger = logging.getLogger("finterion")
@@ -108,3 +108,10 @@ def get_portfolio(api_key, base_url, query_params):
108108
url, headers={"XApiKey": api_key}, params=query_params
109109
)
110110
return handle_response(response)
111+
112+
113+
def get_supported_symbols(api_key, base_url):
114+
logger.debug("Getting supported symbols")
115+
url = get_supported_symbols_url(base_url)
116+
response = requests.get(url, headers={"XApiKey": api_key})
117+
return handle_response(response)

version.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)