tronSignMessage

TRON: sign message

Asks device to sign a message using the private key derived by given BIP32 path.

const result = await HardwareSDK.tronSignMessage(connectId, deviceId, params);

Params

Optional common params

  • pathrequired string | Array<number> minimum length is 3. read more

  • messageHex - required string message to sign in hex text

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",
    message: messageHex
});

Result

{
    success: true,
    payload: {
        signature: string;
        address: string;
    }
}

Error

{
    success: false,
    payload: {
        error: string, // error message
        code: number // error code
    }
}

Last updated