Documentation
    Preparing search index...

    Function verifyAggregate

    • Verify that an event's declared aggregate x tag equals the aggregate recomputed from its path tags.

      Parameters

      • tags: readonly (readonly string[])[]

        The manifest event's tags

      Returns boolean

      true only when an aggregate x tag is present and matches the recomputed value; false otherwise (mismatch or missing aggregate tag)

      import { verifyAggregate } from '@kehto/nip/5a';
      if (!verifyAggregate(manifestEvent.tags)) throw new Error('aggregate mismatch');