import { type Bounds, type Tagged } from "@bounded-authority-protocol/verifier"; import type { AnchorCompact, Envelope, GrantCompact, TransitionCompact } from "./api.js"; import { type KeyHandle, type SignerResult } from "./handle.js"; export interface V2SignerEvent { readonly kind: "v2_report" | "v2_anchor" | "v2_grant" | "v2_key_transition"; readonly phase: "start" | "stop" | "error"; } export interface V2SignOpts { readonly bounds?: Bounds; readonly issuedAt?: number; readonly proofId?: string; readonly anchoredAt?: number; readonly onEvent?: (event: V2SignerEvent) => void; } export interface V2ReportInput { readonly grantCompact: Uint8Array; readonly operation: string; readonly method: string; readonly targetUri: string; readonly invocationId: string; readonly castArguments: Tagged; readonly nonce?: string; } export interface V2AnchorInput { readonly anchorId: string; readonly chainId: string; readonly sequence: number; readonly chainHash: Uint8Array; } /** A v2 selector: the v1 kinds plus `lte` / `gte` with an integer- or float-tagged bound. */ export type V2SelectorInput = "all" | { readonly kind: "all"; } | { readonly kind: "equals"; readonly path: readonly string[]; readonly value: Tagged; } | { readonly kind: "one_of"; readonly path: readonly string[]; readonly values: readonly Tagged[]; } | { readonly kind: "lte"; readonly path: readonly string[]; readonly value: Tagged; } | { readonly kind: "gte"; readonly path: readonly string[]; readonly value: Tagged; }; export interface V2OperationInput { readonly name: string; readonly selectors: readonly V2SelectorInput[]; } export interface V2GrantInput { readonly issuer: string; readonly grantId: string; readonly audiences: readonly string[]; readonly issuedAt: number; readonly notBefore: number; readonly expiresAt: number; readonly holderThumbprint: string; readonly operations: readonly V2OperationInput[]; } export interface V2TransitionInput { readonly transitionId: string; readonly chainId: string; readonly effectiveAt: number; readonly nextKeyId: string; readonly nextPublicKey: Uint8Array; } export declare function signV2Report(report: V2ReportInput, handle: KeyHandle, opts?: V2SignOpts): Promise>; export declare function signV2Anchor(input: V2AnchorInput, handle: KeyHandle, opts?: V2SignOpts): Promise>; export declare function signV2Grant(input: V2GrantInput, handle: KeyHandle, opts?: V2SignOpts): Promise>; export declare function signV2KeyTransition(input: V2TransitionInput, handle: KeyHandle, opts?: V2SignOpts): Promise>;