CCC Docs
    Preparing search index...

    Function getDidCkbHistory

    • Walk the DID cell chain backwards to produce the ordered list of operations applied to a DID.

      Each transferDidCkb consumes the previous DID cell as an input and creates a new one with the same Type ID args; the genesis (createDidCkb / createDidCkb with localId) has no DID input. We start from the live cell, read its tx, look for the prior DID cell among the inputs, and repeat. The first entry returned is the newest (most recent transfer); the last is the genesis.

      Cost: roughly one getTransaction call per step plus one input.getCell lookup per non-DID input on each step. input.getCell goes through the client's cell cache, so repeated walks over the same chain are cheap.

      Parameters

      • props: { client: Client; id: BytesLike; liveCell?: Cell; maxSteps?: number }
        • client: Client
        • id: BytesLike

          Either the 20-byte Type ID args hex returned by createDidCkb, or a did:ckb: URI. URIs are converted via didToArgs.

        • OptionalliveCell?: Cell

          Pre-resolved live cell; if omitted, we fetch it.

        • OptionalmaxSteps?: number

          Safety bound to prevent runaway walks. Default 50.

      Returns Promise<HistoryEntry[]>