API Reference — @tuwaio/siwx (CAIP-122 Authentication Layer)
validateMessage()
validateMessage(
fields,options?):SiwxValidationResult
Defined in: packages/siwx-core/dist/index.d.ts:420
Validates all fields of a CAIP-122 message object. Collects all errors and returns them together rather than failing on the first.
Parameters
fields
The message fields to validate.
options?
Optional validation options or verification policy.
Returns
SiwxValidationResult
A SiwxValidationResult with valid: true or a list of errors.
Example
const result = validateMessage(parsedMessage, {
policy: { expectedDomain: 'tuwa.io', requireExpirationTime: true },
});
if (!result.valid) {
console.error(result.errors);
}Last updated on