Function: resolvePersonalSignChainDtoPayload()
GalaChain core SDK 1.0.0-rc.8 / index / resolvePersonalSignChainDtoPayload
Function: resolvePersonalSignChainDtoPayload()
resolvePersonalSignChainDtoPayload(
data):PersonalSignChainDtoPayload
Defined in: packages/gala-core-sdk/dist/index.d.ts:1643
Derives what to hash for a gala_signChainDto personal-sign request from the exact string the
dApp sent (and the approval card displayed): wallet resolvePersonalSignChainDtoPayload.
The dApp submits { ...dto, prefix, signature }, which the chain recovers from
keccak256(prefix + serialize(dto WITHOUT prefix)). So when the string embeds a prefix
field, that field is removed and the remainder re-serialized; the prefix used is the dApp's own
value byte for byte. A string with no prefix field is hashed verbatim with an empty prefix
(chain-equivalent to a native signature of that exact string).
Fails closed (throws GalaSDKError PERSONAL_SIGN_NOT_JSON, PERSONAL_SIGN_NOT_OBJECT,
PERSONAL_SIGN_BAD_PREFIX, PERSONAL_SIGN_ENVELOPE_FIELDS or PERSONAL_SIGN_NOT_CANONICAL) on:
malformed JSON; JSON that is not a plain object; a prefix that is not an EIP-191
"Ethereum Signed Message" header; any signing-envelope field (signature, multisig, trace,
types, domain, stringsInstructions); and a string that is not already the canonical
serialization of what it parses to (duplicate keys, lossy numbers, key-order tricks the card
would render differently). Stripping prefix is therefore the ONLY byte change between the
reviewed string and the signed message.
Parameters
data
string