import { z } from 'zod'; import type { HashedDappDocument } from './canonicalDocument.ts'; export declare const SideChannelEnvelopeSchema: "network.xyo.dapp.side.channel.envelope" & { readonly __schema: true; }; export declare const SideChannelSignatureAlgorithm: "xyo-secp256k1-compact-v1"; export declare const SideChannelSigningEnvelopeZod: z.ZodObject<{ schema: z.ZodLiteral<"network.xyo.dapp.side.channel.envelope" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; dappId: z.ZodString; protocolVersion: z.ZodString; messageId: z.ZodString; correlationId: z.ZodString; sender: z.ZodString; audience: z.ZodArray; kind: z.ZodEnum<{ ephemeral: "ephemeral"; proposal: "proposal"; attestation: "attestation"; "projection-hint": "projection-hint"; }>; bodyHashAlgorithm: z.ZodLiteral<"sha256-v1">; bodyHash: z.ZodString; issuedAt: z.ZodNumber; expiresAt: z.ZodNumber; nonce: z.ZodString; chainContext: z.ZodObject<{ chainId: z.ZodString; finalizedBlock: z.ZodNumber; }, z.core.$strict>; signatureAlgorithm: z.ZodString; }, z.core.$strict>; export type SideChannelSigningEnvelope = z.infer; export declare const SideChannelEnvelopeZod: z.ZodObject<{ signature: z.ZodString; schema: z.ZodLiteral<"network.xyo.dapp.side.channel.envelope" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; dappId: z.ZodString; protocolVersion: z.ZodString; messageId: z.ZodString; correlationId: z.ZodString; sender: z.ZodString; audience: z.ZodArray; kind: z.ZodEnum<{ ephemeral: "ephemeral"; proposal: "proposal"; attestation: "attestation"; "projection-hint": "projection-hint"; }>; bodyHashAlgorithm: z.ZodLiteral<"sha256-v1">; bodyHash: z.ZodString; issuedAt: z.ZodNumber; expiresAt: z.ZodNumber; nonce: z.ZodString; chainContext: z.ZodObject<{ chainId: z.ZodString; finalizedBlock: z.ZodNumber; }, z.core.$strict>; signatureAlgorithm: z.ZodString; }, z.core.$strict>; export type SideChannelEnvelope = z.infer; export declare const SideChannelEnvelopeIssueCodes: readonly ["envelope.audience-mismatch", "envelope.chain-id-mismatch", "envelope.dapp-id-mismatch", "envelope.expired", "envelope.invalid", "envelope.not-yet-valid", "envelope.protocol-version-mismatch", "envelope.replay", "envelope.sender-unauthorized", "envelope.signature-algorithm-unsupported", "envelope.signature-invalid"]; export declare const SideChannelEnvelopeIssueCodeZod: z.ZodEnum<{ "envelope.audience-mismatch": "envelope.audience-mismatch"; "envelope.chain-id-mismatch": "envelope.chain-id-mismatch"; "envelope.dapp-id-mismatch": "envelope.dapp-id-mismatch"; "envelope.expired": "envelope.expired"; "envelope.invalid": "envelope.invalid"; "envelope.not-yet-valid": "envelope.not-yet-valid"; "envelope.protocol-version-mismatch": "envelope.protocol-version-mismatch"; "envelope.replay": "envelope.replay"; "envelope.sender-unauthorized": "envelope.sender-unauthorized"; "envelope.signature-algorithm-unsupported": "envelope.signature-algorithm-unsupported"; "envelope.signature-invalid": "envelope.signature-invalid"; }>; export type SideChannelEnvelopeIssueCode = z.infer; export interface SideChannelSignatureVerificationInput { algorithm: typeof SideChannelSignatureAlgorithm; sender: string; signature: string; signingHash: string; } export type SideChannelSignatureVerifier = (input: SideChannelSignatureVerificationInput) => boolean | Promise; export interface SideChannelEnvelopeContext { acceptedClockSkewMilliseconds: number; authorizedSenders: readonly string[]; expectedAudience: string; expectedChainId: string; expectedDappId: string; expectedProtocolVersion: string; now: number; seenMessageIds: readonly string[]; verifySignature: SideChannelSignatureVerifier; } export interface SideChannelEnvelopeIssue { code: SideChannelEnvelopeIssueCode; path: (number | string)[]; } export interface SideChannelEnvelopeValidationSuccess { signingHash: string; success: true; value: SideChannelEnvelope; } export interface SideChannelEnvelopeValidationFailure { issues: SideChannelEnvelopeIssue[]; success: false; } export type SideChannelEnvelopeValidationResult = SideChannelEnvelopeValidationFailure | SideChannelEnvelopeValidationSuccess; export declare function hashSideChannelEnvelopeForSigning(value: unknown): HashedDappDocument; export declare function validateSideChannelEnvelope(value: unknown, context: SideChannelEnvelopeContext): Promise; //# sourceMappingURL=sideChannel.d.ts.map