On this page
tronSignMessage
TRON: sign message
Requests a message signature using the key derived from the specified path.
const result = await HardwareSDK.tronSignMessage(connectId, deviceId, params);Params
-
path- requiredstring | Array<number>SDK minimum length is3. Path format -
messageHex- requiredstringMessage to sign, encoded as a hexadecimal string. -
messageType-"V2". Pass this explicitly: the current runtime rejects omitted values and legacy"V1"requests. The public type still includes both values.
Example
// Original message
const message = "Hello World";
// Convert to hex
const messageHex = Buffer.from(message).toString('hex');
HardwareSDK.tronSignMessage(connectId, deviceId, {
path: "m/44'/195'/0'/0/0",
messageHex,
messageType: 'V2'
});Result
{
success: true,
payload: {
signature: string;
address: string;
}
}Error
{
success: false,
payload: {
error: string, // error message
code?: string | number // error code
}
}Last updated on