Skip to main content

Function: signPersonalMessage()

GalaChain core SDK 1.0.0-rc.8


GalaChain core SDK 1.0.0-rc.8 / index / signPersonalMessage

Function: signPersonalMessage()

signPersonalMessage(privateKey, prefix, message): string

Defined in: packages/gala-core-sdk/dist/index.d.ts:1592

Personal-sign hash and signature: keccak256(prefix + message), both hashed VERBATIM with no further EIP-191 wrapping. Passing prefix = calculatePersonalSignPrefix(message) reproduces a wallet's personal_sign of message. Gala Wallet's gala_signChainDto (personal-sign scheme) hashes prefix + the exact string it is handed, which can differ from the bare message (see the signatureOverPrefixlessBody vectors); that quirk is why the two inputs stay separate.

Parameters​

privateKey​

Uint8Array

prefix​

string

message​

string

Returns​

string