evmSignMessage

Ethereum: sign message

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

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

Params

Optional common params

  • path — required string | Array<number> minimum length is 3. read more

  • messageHex - required string message to sign in hex text

  • chainId - optional number The ChainId in ETH is a unique identifier for a specific Ethereum network, used to distinguish different versions of the blockchain. Reference.

Example

HardwareSDK.evmSignMessage(connectId, deviceId, {
    path: "m/44'/60'/0'",
    messageHex: "6578616d706c65206d657373616765",
    chainId: 1
});

Result

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

Error

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

Last updated