On this page
alephiumSignMessage
Requirements
- Minimum firmware versions
- Touch: 4.10.0
Alephium: sign message
Sign a message using the private key derived from the specified BIP32 path. User needs to confirm the action on OneKey device.
// Original message
const message = "Hello Alephium";
// Convert to hex
const messageHex = Buffer.from(message).toString('hex');
const result = await HardwareSDK.alephiumSignMessage(connectId, deviceId, {
path: "m/44'/1234'/0'/0/0",
messageHex, // "Hello Alephium" in hex
messageType: "alephium"
});Params
path- requiredstring | Array<number>SDK minimum length is3messageHex- requiredstringmessage to sign in hexadecimal formatmessageType- required"alephium" | "sha256" | "blake2b" | "identity". Message signing mode.
Example
// Original message
const message = "Hello Alephium";
// Convert to hex
const messageHex = Buffer.from(message).toString('hex');
const response = await HardwareSDK.alephiumSignMessage(connectId, deviceId, {
path: "m/44'/1234'/0'/0/0",
messageHex,
messageType: "alephium"
});Result
{
success: true,
payload: {
signature: string;
address: string;
}
}Error
{
success: false,
payload: {
error: string, // error message
code?: string | number // error code
}
}Last updated on