Пример #1
0
    def login(self):
        # GET ATTRIBUTES
        degiro_model = self.__degiro_model
        default_credentials = degiro_model.login_default_credentials()

        credentials = Credentials()
        credentials.CopyFrom(default_credentials)
        degiro_model.login()

        DegiroView.__login_display_success()
Пример #2
0
 def __init__(self):
     self.__default_credentials = Credentials(
         int_account=None,
         username=config.DG_USERNAME,
         password=config.DG_PASSWORD,
         one_time_password=None,
         totp_secret_key=config.DG_TOTP_SECRET,
     )
     self.__trading_api = TradingAPI(
         credentials=self.__default_credentials, )
Пример #3
0
    def login(self, ns_parser: Namespace):
        # GET ATTRIBUTES
        degiro_model = self.__degiro_model
        default_credentials = degiro_model.login_default_credentials()

        credentials = Credentials()
        credentials.CopyFrom(default_credentials)
        credentials.username = ns_parser.username
        credentials.password = ns_parser.password

        if ns_parser.otp is not None:
            credentials.one_time_password = ns_parser.otp
        if ns_parser.topt_secret is not None:
            credentials.totp_secret_key = ns_parser.topt_secret

        degiro_model.login(credentials=credentials)

        DegiroView.__login_display_success()
Пример #4
0
    def login(self, ns_parser: Namespace):
        # GET ATTRIBUTES
        degiro_model = self.__degiro_model
        default_credentials = degiro_model.login_default_credentials()

        credentials = Credentials()
        credentials.CopyFrom(default_credentials)
        credentials.username = ns_parser.username
        credentials.password = ns_parser.password

        if "REPLACE_ME" in (credentials.username, credentials.username):
            console.print("No Degiro's credentials provided. Login failed.")
            return

        if ns_parser.otp is not None:
            credentials.one_time_password = ns_parser.otp
        if ns_parser.topt_secret is not None:
            credentials.totp_secret_key = ns_parser.topt_secret

        degiro_model.login(credentials=credentials)

        DegiroView.__login_display_success()