Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async signMessage(path, message, hex = false) {
let result;
if (this.currency === 'ethereum') {
const params = { path, message, hex };
result = await TrezorConnect.ethereumSignMessage(params);
} else {
console.log('Stellar Signing messages is not supported by Trezor.');
result = false;
}
return result;
}
ethereumSignMessage (path, message, cb) {
TrezorConnect.ethereumSignMessage({ device: this.device, path, message, hex: true }).then(res => {
if (!res.success) return cb(new Error(res.payload.error))
cb(null, res.payload)
}).catch(err => cb(err))
}