/** * `paygate wrap` — gate an EXISTING upstream API behind x402, unattended. * * Flow (the M2M onboarding ordering): wrap → deploy → register → verify. * This command does step 1 only: it derives the gating config (from flags or * --from-openapi), and writes a deployable gateway project + manifest. * * Machine contract: zero prompts ever (unlike init there is no TTY prompt * path — wrap is agent-first); all failures are S2-structured with --json * (`{ error: { code, message, retryable } }`); re-runs are idempotent, and * conflicting files produce a diff summary instead of silent refusal. */ import { type WrapOptions, type WrapRoute } from "./wrap-templates.js"; export interface WrapError { code: string; message: string; retryable: boolean; } export interface WrapIO { stdout: (s: string) => void; stderr: (s: string) => void; } export interface OpenApiDerivation { routes: WrapRoute[]; /** The spec with 402 responses documented on every gated operation. */ documented: string; } /** * Derive gated routes from an OpenAPI 3.x JSON document and document the * 402 response into each gated operation. Per-operation price override via * the `x-arispay-price-cents` extension (integer cents); default otherwise. */ export declare function deriveFromOpenApi(raw: string, defaultPriceCents: number): { ok: true; value: OpenApiDerivation; } | { ok: false; error: WrapError; }; export interface WrapArgs { upstream?: string; wallet?: string; price?: string; currency?: string; network?: string; scheme?: string; asset?: string; route?: string; method?: string; fromOpenapi?: string; directory?: string; name?: string; json: boolean; dryRun: boolean; help: boolean; } export declare function parseWrapArgv(argv: string[]): { ok: true; args: WrapArgs; } | { ok: false; error: WrapError; }; export declare function validateWrapArgs(args: WrapArgs, openapiRoutes?: WrapRoute[]): { ok: true; options: WrapOptions & { directory: string; dryRun: boolean; }; } | { ok: false; error: WrapError; }; /** First-differing-line summary per conflicting file — the re-run diff. */ export declare function diffSummary(directory: string, files: Array<{ path: string; content: string; }>, conflicts: string[]): string; export declare const WRAP_HELP_TEXT = "paygate wrap \u2014 put an x402 paywall in front of an existing API.\n\nZero prompts, agent-first. Ordering: wrap \u2192 deploy \u2192 register \u2192 verify.\n\nUsage:\n npx paygate wrap --upstream https://api.example.com --wallet 0xYourAddress [options]\n\nOptions:\n --upstream The API to gate (required; https, or http://localhost)\n --wallet <0x...> Receiving EVM address (required; public info, no key is generated)\n --price Default price per request in INTEGER cents (default: 1)\n --currency USD | EUR (default USD; EUR requires --network base)\n --network base | base-sepolia (default base-sepolia)\n --scheme x402 scheme; only \"exact\" is supported\n --asset <0x...> Override the settlement asset contract (advanced)\n --route Single gated route (default: /* \u2014 gate everything)\n --method Method for --route (default GET)\n --from-openapi Derive gated routes from an OpenAPI 3.x JSON URL or\n file; documents 402 responses into ./openapi.json.\n Per-op price override: x-arispay-price-cents.\n --directory Target directory (default ./)\n --name Project/manifest name (default derived from upstream host)\n --json Machine output (S2 errors + result JSON)\n --dry-run Print the file plan, write nothing\n"; export declare function runWrap(argv: string[], io?: WrapIO, fetchImpl?: typeof fetch): Promise; //# sourceMappingURL=wrap.d.ts.map