Example #1
0
 def send_pin(self, pin='', device_type=None, path=None, passphrase='', chain=''):
     if device_type == "keepkey" or device_type == "trezor":
         if pin == '':
             raise Exception("Must enter a non-empty PIN")
         client = self._get_client(device_type=device_type, path=path, passphrase=passphrase, chain=chain)
         return hwi_commands.send_pin(client, pin)
     else:
         raise Exception("Invalid HWI device type %s, send_pin is only supported for Trezor and Keepkey devices" % device_type)
Example #2
0
def hwi_send_pin():
    type = request.form.get("type")
    path = request.form.get("path")
    pin = request.form.get("pin")

    try:
        client = get_hwi_client(type, path)
        status = hwilib_commands.send_pin(client, pin)
        return jsonify(status)
    except Exception as e:
        print(e)
        return jsonify(success=False, error=e)