构造
方法
detect(token)→TokenDetectionResultgetRecommendedMethod(token)→"eip3009" | "permit" | "permit2" | nullinitialize(tokens)→ 预热缓存getCacheStats/clearCache
签名与入参
输入地址应为合法 EVM 地址(0x + 40 hex),内部大小写不敏感。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
TokenDetector 构造与方法参数
new TokenDetector(publicClient);
detect(token) → TokenDetectionResultgetRecommendedMethod(token) → "eip3009" | "permit" | "permit2" | nullinitialize(tokens) → 预热缓存getCacheStats/clearCache// 检测单个 Token
detect(tokenAddress: string): Promise<TokenDetectionResult>;
// 推荐支付方法
getRecommendedMethod(tokenAddress: string): Promise<"eip3009" | "permit" | "permit2" | null>;
// 批量初始化
initialize(tokenAddresses: string[]): Promise<TokenDetectionResult[]>;
// 清理缓存
clearCache(tokenAddress?: string): Promise<void>;
// 检测收款地址的结算能力(EIP-7702 + x402x 扩展)
detectSettleMethods(
client: PublicClient,
address: string,
logger?: Logger | null
): Promise<{
supportsSettleWithPermit: boolean;
supportsSettleWithERC3009: boolean;
supportsSettleWithPermit2: boolean;
}>;
输入地址应为合法 EVM 地址(0x + 40 hex),内部大小写不敏感。