Beispiel #1
0
 def sign_message(
     self,
     message="",
     derivation_path="m",
     device_type=None,
     path=None,
     fingerprint=None,
     passphrase="",
     chain="",
 ):
     if message == "":
         raise Exception("Message must not be empty")
     print(derivation_path)
     with self._get_client(
             device_type=device_type,
             fingerprint=fingerprint,
             path=path,
             passphrase=passphrase,
             chain=chain,
     ) as client:
         status = hwi_commands.signmessage(client, message, derivation_path)
         if "error" in status:
             raise Exception(status["error"])
         elif "signature" in status:
             return status["signature"]
         else:
             raise Exception(
                 "Failed to sign message with device: Unknown Error")
Beispiel #2
0
 def sign_message(self, message='', derivation_path='m', device_type=None, path=None, fingerprint=None, passphrase='', chain=''):
     if message == '':
         raise Exception("Message must not be empty")
     print(derivation_path)
     with self._get_client(device_type=device_type,
                           fingerprint=fingerprint,
                           path=path,
                           passphrase=passphrase,
                           chain=chain) as client:
         status = hwi_commands.signmessage(client, message, derivation_path)
         if 'error' in status:
             raise Exception(status['error'])
         elif 'signature' in status:
             return status['signature']
         else:
             raise Exception("Failed to sign message with device: Unknown Error")