From 6838111c34c3f3dcb1e758200b57296bd573c731 Mon Sep 17 00:00:00 2001 From: Nelson Dane <47427072+NelsonDane@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:02:45 -0400 Subject: [PATCH] fix fennel short tickers? --- fennelAPI.py | 15 ++++++++------- requirements.txt | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fennelAPI.py b/fennelAPI.py index 7b880b9b..512b7ccb 100644 --- a/fennelAPI.py +++ b/fennelAPI.py @@ -64,17 +64,18 @@ def fennel_init(FENNEL_EXTERNAL=None, botObj=None, loop=None): else: raise e fennel_obj.set_logged_in_object(name, fb, "fb") - full_accounts = fb.get_full_accounts() - for a in full_accounts: - b = fb.get_portfolio_summary(a["id"]) - fennel_obj.set_account_number(name, a["name"]) + account_ids = fb.get_account_ids() + for i, an in enumerate(account_ids): + account_name = f"Account {i + 1}" + b = fb.get_portfolio_summary(an) + fennel_obj.set_account_number(name, account_name) fennel_obj.set_account_totals( name, - a["name"], + account_name, b["cash"]["balance"]["canTrade"], ) - fennel_obj.set_logged_in_object(name, a["id"], a["name"]) - print(f"Found account {a['name']}") + fennel_obj.set_logged_in_object(name, an, account_name) + print(f"Found {account_name}") print(f"{name}: Logged in") except Exception as e: print(f"Error logging into Fennel: {e}") diff --git a/requirements.txt b/requirements.txt index 2d2ee7d3..23b4f3e2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ bbae-invest-api==0.1.3 chaseinvest-api==0.2.6 discord.py==2.4.0 dspac_invest_api==0.1.3 -fennel-invest-api==1.1.0 +fennel-invest-api==1.1.1 firstrade==0.0.30 GitPython==3.1.43 # playwright stealth from pypi seems abandoned