import type { PcaConfirmationOutcome } from '@origintrail-official/dkg-agent'; /** * The WIRE shape of the advisory confirmation. A discriminated union so the * illegal `{adapterSupported:false, verified:false|true}` combos stay * unrepresentable for wire/client consumers: * - `{ adapterSupported: false; verified: null }` — unsupported (no probe surface). * - `{ adapterSupported: true; verified: boolean | null }` — surface exists; * `verified` is true (confirmed) | false (not observed / lag) | null (inconclusive). */ type PcaAgentConfirmation = { adapterSupported: false; verified: null; } | { adapterSupported: true; verified: boolean | null; }; type RegisterPcaAgentResponseBase = { accountId: string; agent: string; txHash: string; blockNumber: number; }; /** * What the CURRENT daemon EMITS — STRICT. The mined tx is authoritative AND a * `success:false` tx is rejected upstream (502), so `registered` is literally * `true`, and the advisory is the coherent `PcaAgentConfirmation`. The * register-agent route assembles this: a future edit that drops the invariant — * `registered:false`, or a missing `verified`/`adapterSupported` — fails to * compile. */ export type RegisterPcaAgentResponse = RegisterPcaAgentResponseBase & { registered: true; } & PcaAgentConfirmation; /** Derive the wire advisory fields from the agent's single confirmation outcome. * The `never` default makes this compiler-exhaustive: a future * `PcaConfirmationOutcome` member must add a case here (compile error otherwise) * rather than falling through to an undefined wire shape. */ export declare function pcaConfirmationToWire(outcome: PcaConfirmationOutcome): PcaAgentConfirmation; /** The register-agent advisory confirmation status. Mirrors the agent's canonical * `PcaConfirmationOutcome` (confirmed / not_observed / inconclusive / unsupported) * so the client boundary PRESERVES the outcome rather than collapsing * not_observed and inconclusive into one lossy status — plus the single * skew-only status `legacy-unverified` (a pre-#1346 daemon that could not * confirm and whose tx success we cannot assert). Display text is derived at the * command layer. */ export type RegisterAgentAdvisoryStatus = PcaConfirmationOutcome | 'legacy-unverified'; /** * The stable, CLI-facing result of `ApiClient.registerPcaAgent` — the * current/legacy version-skew rules are normalized into `{ registered, advisory }` * at the client boundary, so callers render directly without re-deriving the * wire shapes. */ export type RegisterPcaAgentResult = { accountId: string; agent: string; registered: boolean; advisory: RegisterAgentAdvisoryStatus; txHash: string; blockNumber: number; }; /** * Parse a RAW register-agent JSON response into a stable {@link RegisterPcaAgentResult}, * VALIDATING the wire shape at the boundary rather than trusting a cast. Throws * on a missing/mistyped field or an incoherent advisory (e.g. no probe surface — * `adapterSupported:false` — with a non-null `verified`). Accepts the current * coherent shape and the legacy shape (`verified` absent). */ export declare function parseRegisterPcaAgentResult(raw: unknown): RegisterPcaAgentResult; export {}; //# sourceMappingURL=pca-confirmation-wire.d.ts.map