import type { Merchant, OpenCheckoutMandate, OpenPaymentMandate, PaymentMandate, UcpCheckout } from "../types.js"; export interface Violation { /** `constraint`: a known limit was exceeded. `preset`: a claim the open mandate fixed was changed. * `unknown-constraint`: a limit this verifier does not know, so it cannot pass it (rule 3). * `malformed`: a limit is missing a field it needs, so it cannot be evaluated — refused, never thrown. */ code: "constraint" | "preset" | "unknown-constraint" | "malformed"; /** The constraint `type` that refused, when one did. */ constraint?: string; detail: string; } /** What has already been spent under this permission — budget and recurrence are stateful. */ export interface Spent { /** Minor units, in the budget's currency, across every earlier payment under this mandate. */ amount: number; /** Earlier payments under this mandate. */ uses: number; } /** AP2's merchant match: by `id` when both carry one, else by `name` and `website` together. */ export declare function merchantMatches(candidate: Merchant | undefined, target: Merchant | undefined): boolean; /** Violations of an Open Checkout Mandate by the checkout the agent signed for. */ export declare function evaluateCheckout(open: OpenCheckoutMandate, checkout: UcpCheckout): Violation[]; export interface PaymentContext { /** The open checkout mandate disclosed beside this payment — what `payment.reference` names. */ openCheckout: OpenCheckoutMandate; /** Usage so far. Required by `payment.budget` and `payment.agent_recurrence`; absent ⇒ refused. */ spent?: Spent; /** Epoch ms — the moment a payment that names no `execution_date` executes. Defaults to now. */ nowMs?: number; } /** Violations of an Open Payment Mandate by the closed payment the agent signed. */ export declare function evaluatePayment(open: OpenPaymentMandate, closed: PaymentMandate, ctx: PaymentContext): Violation[];