Skip to content

Misleading interface of signPersonalMessage() method #46

@refi93

Description

@refi93

Looks like the sdk internally expects an utf-8 string despite the respective parameter being called messageHex. Could you please adjust the docstring/parameter name to match reality and avoid confusion?

* @param path - The derivation path for the private key used to sign the message.
* @param messageHex - A hexadecimal string that represents the message to be signed.
* @return A Promise that resolves to an object with properties:
* - r: A string representing the "r" value of the signature.
* - s: A string representing the "s" value of the signature.
* - v: A string representing the "v" value of the signature.
*/
async signPersonalMessage(path: string, messageHex: string): Promise<{ r: string, s: string, v: string }> {
const messageBuffer = Buffer.from(messageHex, 'utf-8');
return this.sign(path, messageBuffer, DataType.personalMessage);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions