import type { WebhookEventBase } from './types.js'; export interface VerifyWebhookOptions { /** * Maximum drift in seconds between the request timestamp and the * verifier's clock. Defaults to 300 (5 minutes) per contract §4.4. * Set higher only if your server is reverse-proxied through a queue * that may stall messages. */ tolerance?: number; /** * Override the "now" clock — exposed primarily so tests can pin a * deterministic time. Returns unix seconds. */ now?: () => number; } /** * Verify an incoming webhook delivery using the iSnap signing scheme: * * - `X-iSnap-Signature` header carries the hex-encoded * `HMAC-SHA256(secret, ".")` * - `X-iSnap-Timestamp` header carries the unix-second issuance time * * Throws `WebhookSignatureError` on missing headers, malformed * timestamp, expired timestamp (outside `tolerance`), or signature * mismatch. Returns the parsed event envelope on success. * * `secret` may be a single secret string OR an array — pass `[newSecret, * oldSecret]` during the 5-minute rotate-secret grace window so both * still validate. The verifier tries each in order and returns on the * first match. * * Headers may be a `Record` (e.g. Express's `req.headers`) * or a `Headers` instance — both are read case-insensitively. * * **Consumers MUST dedupe by `event.event_id`** — retries replay the same * envelope (same `event_id`, same body, same signature, refreshed * timestamp). Without consumer-side dedup, an at-least-once delivery * model produces duplicate side-effects on the partner system. */ export declare function verifyWebhook(rawBody: string, headers: Record | Headers, secret: string | readonly string[], options?: VerifyWebhookOptions): WebhookEventBase; //# sourceMappingURL=verify.d.ts.map