mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-20 06:08:39 +01:00
1.2 KiB
1.2 KiB
Sign message
Asks device to sign a message using the private key derived by given BIP32 path.
const result = await TrezorConnect.signMessage(params);
Params
flowtype
path— requiredstring | Array<number>minimum length is3. read moremessage- requiredstringcoin- 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
Example
TrezorConnect.signMessage({
path: "m/44'/0'/0'",
message: 'example message',
});
Result
flowtype
{
success: true,
payload: {
address: string, // signer address
signature: string, // signature in base64 format
}
}
Error
{
success: false,
payload: {
error: string // error message
}
}