Asks device to sign a message using the private key derived by given BIP32 path.
ES6
const result = await TrezorConnect.ethereumSignMessage(params);
CommonJS
TrezorConnect.ethereumSignMessage(params).then(function(result) {
});
path
— obligatorystring | Array<number>
minimum length is3
. read moremessage
- obligatorystring
message to sign in plain texthex
- optionalboolean
convert message from hex
TrezorConnect.ethereumSignMessage({
path: "m/44'/60'/0'",
message: "example message"
});
{
success: true,
payload: {
address: string,
signature: string,
}
}
Error
{
success: false,
payload: {
error: string // error message
}
}
version 4 and below
TrezorConnect.ethereumSignMessage("m/44'/60'/0'", "example message", function(result) {
result.address // address without "0x" prefix
result.signature
});
version 5
// params are key-value pairs inside Object
TrezorConnect.ethereumSignMessage({
path: "m/44'/60'/0'",
message: "example message"
}).then(function(result) {
result.address // address with "0x" prefix and checksum
result.signature // no change
})