Skip to main content

index/functions/signChainDtoPersonalSign.md

signChainDtoPersonalSign(privateKey, data): string

Signs a GalaChain personal-sign scheme DTO from the exact string a dApp sent through gala_signChainDto (wallet signChainDtoPersonalSign). See resolvePersonalSignChainDtoPayload for what is signed and what is refused; the signature recovers, under the chain's getPayloadToSign, to this key for the DTO the dApp submits with its prefix, and equals a personal_sign of the bare body when that prefix is the EIP-191 header of the bare body's byte length.

Parameters​

ParameterType
privateKeyPrivateKeyInput
datastring

Returns​

string

Throws​

GalaSDKError (PERSONAL_SIGN_*, see resolvePersonalSignChainDtoPayload) before any signing when the input is refused.