Skip to content

Commit

Permalink
Fix for 404 error get_deals_and_orders(). #102 (#105)
Browse files Browse the repository at this point in the history
* Update constants.py

Added DEALS_PATH  and ORDERS_PATH

* Update avanza.py

Added get_deals(self) and get_orders(self)

* Update avanza.py

Removed get_deals_and_orders()
Fixed intendation

* Update constants.py

Removed DEALS_AND_ORDERS_PATH
  • Loading branch information
Unt3r authored Jun 25, 2024
1 parent 81fa337 commit 3a589a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 9 additions & 5 deletions avanza/avanza.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,15 @@ def get_insights_report(
HttpMethod.GET,
Route.INSIGHTS_PATH.value.format(time_period.value, account_id),
)

def get_deals_and_orders(self) -> DealsAndOrders:
"""Get currently active deals and orders"""
return self.__call(HttpMethod.GET, Route.DEALS_AND_ORDERS_PATH.value)


def get_deals(self):
""" Get currently active deals """
return self.__call(HttpMethod.GET, Route.DEALS_PATH.value)

def get_orders(self):
""" Get currently active orders """
return self.__call(HttpMethod.GET, Route.ORDERS_PATH.value)

def get_inspiration_lists(self) -> List[InspirationListItem]:
"""Get all available inspiration lists
Expand Down
3 changes: 2 additions & 1 deletion avanza/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ class Route(enum.Enum):
CATEGORIZED_ACCOUNTS = "/_api/account-overview/overview/categorizedAccounts"
CHARTDATA_PATH = "/_api/price-chart/stock/{}"
CURRENT_OFFERS_PATH = "/_api/customer-offer/currentoffers/"
DEALS_AND_ORDERS_PATH = "/_mobile/account/dealsandorders"
DEALS_PATH = "/_api/trading/rest/deals"
ORDERS_PATH = "/_api/trading/rest/orders"
FUND_PATH = "/_api/fund-guide/guide/{}"
INSIGHTS_PATH = "/_api/insights-development/?timePeriod={}&accountIds={}"
INSPIRATION_LIST_PATH = "/_mobile/marketing/inspirationlist/{}"
Expand Down

0 comments on commit 3a589a4

Please sign in to comment.