benfenSignMessage
Use requirement
Firmware version required
pro: 4.12.0
Benfen: sign message
Sign a message using the private key derived by given BIP32 path. User needs to confirm the action on OneKey device.
const result = await HardwareSDK.benfenSignMessage(connectId, deviceId,{
path: "m/44'/728'/0'/0'/0'",
messageHex: "68656c6c6f" // "hello" in hex
});Params
Optional common params
path— requiredstring | Array<number>minimum length is3. read moremessageHex- requiredstringMessage to sign in hex format
Returns
success- boolean True if successfulpayloadsignature- string Signature in hex formataddress- string BFC format address used for signing
Example:
const params = {
path: "m/44'/728'/0'/0'/0'",
messageHex: "68656c6c6f" // "hello" in hex
};
const response = await HardwareSDK.benfenSignMessage(connectId, deviceId, params);Result
{
success: true,
payload: {
signature: string,
address: string.
}
}Error
{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}Last updated
Was this helpful?