import { AgentContext, DidRecord, Logger } from '@credo-ts/core'; import { DIDLog, Signer, Verifier } from 'didwebvh-ts'; export interface RebuildWebVhLogOptions { /** Signer using a key that matches the active `updateKeys[0]` of the rebuilt prefix. */ signer: Signer; /** Verifier used both for resolution checks and for the `documentStateIsValid` step inside `updateDID`. */ verifier: Verifier; /** Optional domain hint (matches the tag stored on the DidRecord). */ domain?: string; } /** * Pure rebuild logic, decoupled from credo / askar so it can be unit-tested. * * If `log` resolves cleanly under the current didwebvh-ts version, returns `null` * (nothing to do). Otherwise, if the failure is the known `<2.7.4` "hash chain * broken" bug, rebuilds entries 2..N (preserving entry #1, SCID, every entry's * `state` and `parameters`) and returns the new log. For any other resolution * error, returns `null` and lets the caller decide what to do. */ export declare function rebuildWebVhLog(log: DIDLog, { signer, verifier, domain }: RebuildWebVhLogOptions): Promise; /** * Detect a `did:webvh` log that became unresolvable because of the * `didwebvh-ts` <2.7.4 entry-hash bug (placeholder versionId used for entries * after the first). If so, rebuild the log preserving: * - entry #1 byte-for-byte (preserving the SCID and therefore the public DID) * - the `state` and `parameters` of entries 2..N (services, keys, controller, etc.) * * Only the entryHash and proof of entries 2..N are recomputed/re-signed using * the controller key the agent already holds in askar. * * Returns true if migration ran successfully, false if it was not needed. * Throws if the rebuild fails or the result is somehow invalid. */ export declare function migrateWebVhLogIfBroken(agentContext: AgentContext, didRecord: DidRecord, logger: Logger): Promise;