import type { Request } from "express"; import type { PaywallConfig, PaywallProvider } from "@x402/core/server"; import type { TollgateConfig } from "./config.js"; /** Minimal payment-required shape accepted by `@x402/paywall` generateHtml. */ export type PaywallPaymentRequired = { x402Version: number; error?: string; resource?: { url: string; description?: string; mimeType?: string; [key: string]: unknown; }; accepts: Array>; extensions?: Record; }; /** Free path for Coinbase Onramp session tokens (server CDP credentials only). */ export declare const SESSION_TOKEN_PATH = "/x402/session-token"; /** * Marker inside `@x402/paywall` EVM bundle (v2.24) WagmiProvider setup. * Stock connectors: injected (`Sm`) + Coinbase Wallet / Smart Wallet (`l8`). */ export declare const PAYWALL_CONNECTORS_MARKER = "connectors:[Sm(),l8({appName:window.x402.appName||\"x402 Paywall\"})]"; /** * PaywallConfig extended with buyer-facing CDP client key (public), Onramp * session-token endpoint, and WalletConnect project id. */ export type TollgatePaywallConfig = PaywallConfig & { /** Public CDP client / project API key for browser Smart Wallet UX. */ cdpClientKey?: string; /** POST endpoint that mints Onramp session tokens (never expose secrets). */ sessionTokenEndpoint?: string; /** WalletConnect Cloud project id (public). */ walletConnectProjectId?: string; /** When true, register `@x402/paywall` SVM handler (Solana accepts). */ enableSvm?: boolean; }; export declare function isBrowserPaymentRequest(req: Pick | { getHeader?(name: string): string | undefined; }): boolean; export declare function buildPaywallConfig(config: TollgateConfig): TollgatePaywallConfig; /** * Official `@x402/paywall` provider + thin multi-wallet / Onramp injection. * Primary CTA: Coinbase Smart Wallet (Passkey). Also: MetaMask, injected, WalletConnect. * SVM paywall registered only when `paywallSvm` / Solana accepts are enabled. */ export declare function createTollgatePaywall(config: TollgateConfig): PaywallProvider; /** * Expand stock wagmi connectors so the "Select a wallet" dropdown lists: * MetaMask (injected target), Injected, Coinbase Smart Wallet (Passkey-capable), * plus optional WalletConnect via `window.x402.extraConnectors`. */ export declare function patchPaywallConnectors(html: string): string; /** * Inject public buyer config + optional Onramp + WalletConnect loader + secondary CTA copy. */ export declare function injectBuyerExtras(html: string, config: TollgatePaywallConfig): string; /** * Thin chain + asset picker when paymentRequired.accepts.length > 1. * Stock `@x402/paywall` always signs accepts[0] — we reorder before React mounts * (sessionStorage + optional reload) so the selected entry drives the signature. */ export declare function acceptPickerHtml(): string;