/** * 归集(sweepWithBundleMerkle)拆分后的共享上下文与分支结果类型 */ import type { JsonRpcProvider, Wallet } from 'ethers'; import type { SweepSignParams } from '../types/index.js'; import type { GeneratedWallet } from '../../../utils/wallet.js'; import type { NonceManager } from '../../../core/nonce/nonce-manager.js'; /** 归集比例收窄(0-100 整数) */ export declare function clampRatio(n?: number): number | undefined; /** 归集各分支共用的只读上下文 */ export interface SweepBranchContext { provider: JsonRpcProvider; chainIdNum: number; txType: 0 | 2; config: SweepSignParams['config']; target: string; targetWallet: Wallet | null; tokenAddress: string | undefined; tokenDecimals: number | undefined; skipIfInsufficient: boolean; isNative: boolean; extractProfit: boolean; profitAddr: string; actualKeys: string[]; sources: SweepSignParams['sources']; ratios: SweepSignParams['ratios']; amounts: SweepSignParams['amounts']; amount: SweepSignParams['amount']; finalGasLimit: bigint; nativeGasLimit: bigint; /** clampRatio(ratioPct) 的结果 */ ratio: number | undefined; /** 共享 NonceManager(用于统一协调 贿赂/利润提取 等 targetWallet 交易的 nonce,避免 nonce 冲突) */ nonceManager: NonceManager; } /** 归集分支返回值(由主流程合并) */ export interface SweepBranchResult { signedTxs: string[]; totalProfit: bigint; totalAmountBeforeProfit: bigint; profitHopWallets?: GeneratedWallet[]; }