From de619e25487f3dc207405439ba3a9c426c433ced Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Fri, 2 Aug 2024 05:28:56 +0200 Subject: [PATCH] Type adjustments --- fin_depo/investbank_nordnet.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fin_depo/investbank_nordnet.py b/fin_depo/investbank_nordnet.py index c601c9b..52b4c13 100644 --- a/fin_depo/investbank_nordnet.py +++ b/fin_depo/investbank_nordnet.py @@ -18,18 +18,19 @@ import fin_defs import requests from frozendict import frozendict from nordnet_api_client import NordnetClient +from nordnet_api_client.data import Instrument from .data import Depo, DepoFetcher, DepoGroup, DepoSingle logger = logging.getLogger(__name__) -def asset_from_instrument(intrument) -> fin_defs.Asset | None: - if intrument.instrument_group_type == 'FND': +def asset_from_instrument(instrument: Instrument) -> fin_defs.Asset | None: + if instrument.instrument_group_type == 'FND': return None - symbol = intrument.symbol - exchange_id = intrument.tradables[0].mic - return fin_defs.Stock(symbol, fin_defs.EXCHANGES_BY_IDS[exchange_id]) + symbol = instrument.symbol + exchange_id = instrument.tradables[0].mic + return fin_defs.Stock(symbol, fin_defs.EXCHANGES_BY_IDS[exchange_id], nordnet_id = instrument.instrument_id) EMPTY_DICT: Mapping[str, str | int] = frozendict()