@blockchaincommons/xid - v1.0.0-beta.3
    Preparing search index...

    Class Provenance

    A provenance mark and, optionally, the generator that continues its chain.

    Index
    • get mark(): ProvenanceMark

      The current mark.

      Returns ProvenanceMark

    • get generator(): ProvenanceMarkGenerator | undefined

      The generator when held in the clear.

      Returns ProvenanceMarkGenerator | undefined

    • get hasGenerator(): boolean

      Whether the generator is held in the clear.

      Returns boolean

    • get hasEncryptedGenerator(): boolean

      Whether the generator is held locked (parsed without the password).

      Returns boolean

    • get generatorSalt(): Salt | undefined

      The salt the 'provenanceGenerator' assertion carries.

      Returns Salt | undefined

    • Replaces the mark (no chain check, as the reference's set_mark).

      Parameters

      • mark: ProvenanceMark

      Returns void

    • Sets or replaces the generator, with a fresh salt.

      Parameters

      • generator: ProvenanceMarkGenerator

      Returns void

    • Removes and returns the generator as held (in the clear or the locked envelope) with its salt; undefined when there is none.

      Returns TakenGenerator | undefined

    • The generator, unlocking a locked one with the password (it stays unlocked); InvalidPassword when it is locked and the password is missing or wrong; undefined when there is no generator.

      Parameters

      Returns ProvenanceMarkGenerator | undefined

    • The generator as an envelope: in the clear when held so, unlocked with the password when locked (InvalidPassword when it does not fit), or the locked envelope itself without a password.

      Parameters

      Returns Envelope | undefined

    • A provenance from its envelope. A locked generator is unlocked with the password when one is given and it fits; otherwise it is kept locked. A subject that is not a mark is Cbor; a missing or repeated 'salt' is EnvelopeParsing; a generator envelope that is not a generator's is ProvenanceMark.

      Parameters

      Returns Provenance

    • Same mark and generator (in the clear or locked, with its salt) — as the reference's equality.

      Parameters

      Returns boolean