import { SchemeNetworkFacilitator, PaymentPayload, PaymentRequirements, VerifyResponse, SettleResponse, Network } from '@aeon-ai-pay/core/types'; import { F as FacilitatorEvmSigner } from '../../signer-BlO7K3AE.js'; import { x402Facilitator } from '@aeon-ai-pay/core/facilitator'; interface ExactEvmSchemeConfig { /** * If enabled, the facilitator will deploy ERC-4337 smart wallets * via EIP-6492 when encountering undeployed contract signatures. * * @default false */ deployERC4337WithEIP6492?: boolean; } /** * EVM facilitator implementation for the Exact payment scheme. */ declare class ExactEvmScheme implements SchemeNetworkFacilitator { private readonly signer; readonly scheme = "exact"; readonly caipFamily = "eip155:*"; private readonly config; /** * Creates a new ExactEvmFacilitator instance. * * @param signer - The EVM signer for facilitator operations * @param config - Optional configuration for the facilitator */ constructor(signer: FacilitatorEvmSigner, config?: ExactEvmSchemeConfig); /** * Get mechanism-specific extra data for the supported kinds endpoint. * For EVM, no extra data is needed. * * @param _ - The network identifier (unused for EVM) * @returns undefined (EVM has no extra data) */ getExtra(_: string): Record | undefined; /** * Get signer addresses used by this facilitator. * Returns all addresses this facilitator can use for signing/settling transactions. * * @param _ - The network identifier (unused for EVM, addresses are network-agnostic) * @returns Array of facilitator wallet addresses */ getSigners(_: string): string[]; private getNetworkIdFromNetwork; /** * 获取代币的精度(decimals) * 通过调用ERC20合约的decimals()函数来获取代币精度 * * @param tokenAddress - 代币合约地址 * @returns Promise - 代币精度(通常为6或18) */ private getAssetDecimals; /** * Verifies a payment payload. * * @param payload - The payment payload to verify * @param requirements - The payment requirements * @returns Promise resolving to verification response */ verify(payload: PaymentPayload, requirements: PaymentRequirements): Promise; /** * Settles a payment by executing the transfer. * * @param payload - The payment payload to settle * @param requirements - The payment requirements * @returns Promise resolving to settlement response */ settle(payload: PaymentPayload, requirements: PaymentRequirements): Promise; } /** * Configuration options for registering EVM schemes to an x402Facilitator */ interface EvmFacilitatorConfig { /** * The EVM signer for facilitator operations (verify and settle) */ signer: FacilitatorEvmSigner; /** * Networks to register (single network or array of networks) * Examples: "eip155:84532", ["eip155:84532", "eip155:1"] */ networks: Network | Network[]; /** * If enabled, the facilitator will deploy ERC-4337 smart wallets * via EIP-6492 when encountering undeployed contract signatures. * * @default false */ deployERC4337WithEIP6492?: boolean; } /** * Registers EVM exact payment schemes to an x402Facilitator instance. * * This function registers: * - V2: Specified networks with ExactEvmScheme * - V1: All supported EVM networks with ExactEvmSchemeV1 * * @param facilitator - The x402Facilitator instance to register schemes to * @param config - Configuration for EVM facilitator registration * @returns The facilitator instance for chaining * * @example * ```typescript * import { registerExactEvmScheme } from "@aeon-ai-pay/evm/exact/facilitator/register"; * import { x402Facilitator } from "@aeon-ai-pay/core/facilitator"; * import { createPublicClient, createWalletClient } from "viem"; * * const facilitator = new x402Facilitator(); * * // Single network * registerExactEvmScheme(facilitator, { * signer: combinedClient, * networks: "eip155:84532" // Base Sepolia * }); * * // Multiple networks (will auto-derive eip155:* pattern) * registerExactEvmScheme(facilitator, { * signer: combinedClient, * networks: ["eip155:84532", "eip155:1"] // Base Sepolia and Mainnet * }); * ``` */ declare function registerExactEvmScheme(facilitator: x402Facilitator, config: EvmFacilitatorConfig): x402Facilitator; export { type EvmFacilitatorConfig, ExactEvmScheme, type ExactEvmSchemeConfig, registerExactEvmScheme };