import type { Origin } from "../origin.js"; import { type IntentBoundsInput } from "./bounds.js"; import { type DelegateHashAlg, type DelegateJwk, type MandateContent } from "./mandates.js"; import type { DcqlQuery, ReaderIdentity } from "../../types.js"; export interface SignedIntentRequest { protocol: "openid4vp-v1-signed"; /** The ES256-signed OpenID4VP request JWT (real). */ request: string; /** The DCQL embedded in the signed request (echoed for callers/tests). */ dcql_query: DcqlQuery; /** Sealed reader context (ECDH key + challenge + boundsHash + grantId) for /verify. */ readerContextToken: string; /** The bounds-bound nonce embedded in the request (echoed for the wallet/tests). */ nonce: string; /** The Mandate Content the wallet is asked to sign — echoed so a caller can show it. */ mandates: MandateContent[]; /** The array-element digests the returned KB-JWT must carry in `delegate_payload`. */ delegateDigests: string[]; trust_level: "device-signed"; } /** * Build the REAL signed OpenID4VP request for signing a grant's Intent Mandate. * * Asks for the payment credential as an SD-JWT VC (`dcql.ts`) and carries the grant's Mandate * Content in an AP2 `delegate` transaction-data entry, which is what the wallet's key binding * signs. `secret` seals the reader context so `/verify` can re-derive everything it needs from * the server's own state. */ export declare function buildIntentSignRequest(args: { bounds: IntentBoundsInput; origin: Origin; secret: string; /** The agent's public key. AP2 binds an open mandate to the agent allowed to use it. */ delegate: DelegateJwk; /** Absolute expiry for the mandates, epoch seconds. */ mandateExp: number; /** The product ids the grant may buy, resolved server-side (`grants._allowedSkusFor`). */ allowedSkus: string[]; /** The digest algorithm the `delegate` entries ask for. Defaults to `sha-256` (RFC 9901's). */ hashAlg?: DelegateHashAlg; readerIdentity?: ReaderIdentity; /** The store's public URL — `walletOrigin`, path included — which names the merchant the * mandates bind to (`merchantFor`, the same id the store's own checkouts carry). Separate * from `origin`, the bare origin the wallet presentation is bound to: a store served under * a path is a different merchant from its host's root (#331). Required — no default could * know the path, and guessing the root would let a sibling store accept the permission. */ merchantUrl: string; }): Promise;