Esempio n. 1
0
    def __init__(self, path: str, password: str = "", expert: bool = False) -> None:
        super(TrezorClient, self).__init__(path, password, expert)
        self.simulator = False
        transport = get_path_transport(path)
        if path.startswith("udp"):
            logging.debug("Simulator found, using DebugLink")
            self.client = TrezorClientDebugLink(transport=transport)
            self.simulator = True
            self.client.use_passphrase(password)
        else:
            self.client = Trezor(transport=transport, ui=PassphraseUI(password))

        # if it wasn't able to find a client, throw an error
        if not self.client:
            raise IOError("no Device")

        self.password = password
        self.type = "Trezor"
Esempio n. 2
0
    def __init__(self, path, password='', expert=False):
        super(TrezorClient, self).__init__(path, password, expert)
        self.simulator = False
        if path.startswith('udp'):
            logging.debug('Simulator found, using DebugLink')
            transport = get_transport(path)
            self.client = TrezorClientDebugLink(transport=transport)
            self.simulator = True
            self.client.set_passphrase(password)
        else:
            self.client = Trezor(transport=get_transport(path), ui=PassphraseUI(password))

        # if it wasn't able to find a client, throw an error
        if not self.client:
            raise IOError("no Device")

        self.password = password
        self.type = 'Trezor'