import type { Request } from "express"; /** Fixed operator feeCollector wallet (Plan A). Documented as FEE_COLLECTOR default. */ export declare const OPERATOR_FEE_COLLECTOR: `0x${string}`; export interface MerchantEntry { /** Merchant receive wallet (FeeSplitter.seller) — display only. */ seller: `0x${string}`; /** FeeSplitter contract address — x402 payTo for this merchant. */ payTo: `0x${string}`; /** Human-readable label (no secrets). */ label: string; } export type MerchantRegistry = Record; export interface MerchantResolveOk { ok: true; id: string; merchant: MerchantEntry; } export interface MerchantResolveErr { ok: false; error: "unknown_merchant"; id: string; } export type MerchantResolveResult = MerchantResolveOk | MerchantResolveErr; /** Built-in demo entry matching merchants.example.json (used when no file/env). */ export declare const BUILTIN_DEMO_MERCHANTS: MerchantRegistry; export declare function isEvmAddress(value: string): value is `0x${string}`; /** Parse and validate a merchants JSON object. Rejects invalid addresses. */ export declare function parseMerchantsRegistry(raw: unknown): MerchantRegistry; export interface LoadMerchantsOptions { /** * When true (permissionless seller mode), missing registry → `{}` * instead of built-in demo. Explicit MERCHANTS_JSON / file still loads. */ optional?: boolean; } /** * Load merchant registry at startup. * Prefer `MERCHANTS_JSON` (inline), else `MERCHANTS_FILE` (default `merchants.json`), * then `merchants.example.json` next to cwd / packaged example, else built-in demo. * * With `{ optional: true }` (seller via env / x402Tollgate), skips example/builtin * fallback so hosted multi-tenant registry is truly optional. */ export declare function loadMerchantsRegistry(env?: NodeJS.ProcessEnv, cwd?: string, options?: LoadMerchantsOptions): MerchantRegistry; /** Public list payload for GET /merchants (no secrets). */ export declare function listMerchantsPublic(registry: MerchantRegistry): Array<{ id: string; label: string; seller: string; payTo: string; }>; /** * Resolve merchant id from query `merchant` or header `x-merchant-id` * (case-insensitive header). Missing → defaultMerchantId. */ export declare function merchantIdFromRequest(req: Pick, defaultMerchantId: string): string; export declare function resolveMerchant(req: Pick, registry: MerchantRegistry, defaultMerchantId: string): MerchantResolveResult; /** Rewrite accepts[].payTo (and nested recipient if present) on a decoded PAYMENT-REQUIRED. */ export declare function rewritePaymentRequiredPayTo(decoded: Record, payTo: `0x${string}`): void;