Skip to Content
API referenceSIWX CoreSrcComponentsparseMessage()

API Reference — @tuwaio/siwx (CAIP-122 Authentication Layer)


parseMessage()

parseMessage(message): SiwxMessageFields

Defined in: packages/siwx-core/src/parseMessage.ts:31 

Parses a raw CAIP-122 compliant message string into a structured ParsedSiwxMessage object.

Parameters

message

string

The raw message string produced by buildMessage and signed by the wallet.

Returns

SiwxMessageFields

The structured fields extracted from the message.

Throws

If the message is malformed or missing required fields.

Example

const parsed = parseMessage(rawMessageString); console.log(parsed.address); // "eip155:1:0xAb5..."
Last updated on