index/functions/resolvePersonalSignChainDtoPayload.md
resolvePersonalSignChainDtoPayload(
data):PersonalSignChainDtoPayload
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.
personal sign chain dto payload gala resolve sdk error not json object bad prefix envelope fields canonical strings instructions
Parameters
| Parameter | Type |
|---|---|
data | string |
Returns
personal sign chain dto payload