Asks device to sign a message using the private key derived by given BIP32 path.
ES6
const result = await TrezorConnect.signMessage(params);CommonJS
TrezorConnect.signMessage(params).then(function(result) {
});path— obligatorystring | Array<number>minimum length is3. read moremessage- obligatorystringcoin- optionalstringDetermines network definition specified in coins.json file. Coinshortcut,nameorlabelcan be used. Ifcoinis not set API will try to get network definition frompath.hex- optionalbooleanconvert message from hex
TrezorConnect.signMessage({
path: "m/44'/0'/0'",
message: "example message"
});{
success: true,
payload: {
address: string, // signer address
signature: string, // signature in base64 format
}
}Error
{
success: false,
payload: {
error: string // error message
}
}version 4 and below
TrezorConnect.signMessage("m/44'/0'/0'", "example message", function(result) {
...
}, "bitcoin");version 5
// params are key-value pairs inside Object
TrezorConnect.signMessage({
path: "m/44'/0'/0'",
message: "example message"
}).then(function(result) {
...
})