import type { Webhook } from "./webhook-events.js"; export type WebhookVerificationFailure = "TIMESTAMP_SKEW" | "SECRET_MISMATCH" | "BODY_HASH_MISMATCH"; export type WebhookVerificationResult = { ok: true; event: Webhook.Event; } | { ok: false; code: WebhookVerificationFailure; }; export interface VerifyWebhookInput { rawBody: string | Uint8Array; headers: Headers | Record; secret: string | readonly string[]; } /** * Strip the `dalp_whsk_` family prefix from a DALP signing secret. * * The Standard Webhooks library expects the bare secret material; DALP * adds the prefix for parity with the `sm_dalp_` API-key family. Both * the dispatcher (DALP-side) and any verifier (DALP or consumer) must * call this before constructing a `new Webhook(...)` instance, otherwise * the HMAC inputs differ on the two ends and every signature mismatches. */ export declare function toStandardWebhookSecret(secret: string): string; /** * Verifies a DALP webhook signature and returns the typed event union. * * Use the returned lifecycle state and `supersedes` accessor to reconcile * cached DAPI mutation responses with later on-chain outcomes. * * @see ../../kit/docs/content/events/idempotency-and-on-chain-outcome.mdx */ export declare function verifyWebhook({ rawBody, headers, secret }: VerifyWebhookInput): WebhookVerificationResult; //# sourceMappingURL=verify-webhook.d.ts.map