Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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