import type { ContractTransactionReceipt } from 'ethers'; import type { NonceManager } from '../nonce/nonce-manager.js'; export type EnsureAllowanceResult = { /** 是否已经授权 */ alreadyApproved: boolean; /** 当前授权额度 */ currentAllowance: bigint; /** 需要的授权额度 */ requiredAllowance: bigint; /** 授权交易回执(如果发送了新交易) */ txReceipt?: ContractTransactionReceipt | null; }; export type EnsureAllowanceBatchItemResult = EnsureAllowanceResult & { owner: string; }; export type ApproveTokenBatchParams = { chain: 'BSC' | 'BASE' | 'XLAYER' | 'MORPH' | 'MONAD'; platform: 'flap' | 'four' | 'pancake-v2' | 'pancake-v3'; rpcUrl: string; privateKeys: string[]; tokenAddress: string; amounts: (bigint | 'max')[]; signOnly?: boolean; gasPriceGwei?: number; gasLimit?: number; chainId?: number; skipValidation?: boolean; }; export type ApproveTokenBatchRawParams = { rpcUrl: string; privateKeys: string[]; tokenAddress: string; spenderAddress: string; amounts: (bigint | 'max')[]; signOnly?: boolean; gasPriceGwei?: number; gasLimit?: number; chainId?: number; nonceManager?: NonceManager; skipValidation?: boolean; }; export type ApproveTokenBatchResult = { success: boolean; approvedCount: number; results: Array<{ owner: string; alreadyApproved: boolean; currentAllowance: bigint; requiredAllowance: bigint; txHash?: string; error?: string; }>; }; export type ApproveTokenBatchSignResult = { signedTransactions: string[]; results: Array<{ owner: string; alreadyApproved: boolean; currentAllowance: bigint; requiredAllowance: bigint; signedTx?: string; }>; needApproveCount: number; alreadyApprovedCount: number; };