import type { GeneratedWallet } from '../../../utils/wallet.js'; import type { CommonBundleConfig } from '../../../utils/bundle-helpers.js'; import type { UserType } from './config.js'; /** Swap 签名配置(不含 Merkle 字段) */ export type FourSwapSignConfig = { rpcUrl: string; gasLimit?: number | bigint; gasLimitMultiplier?: number; minGasPriceGwei?: number; maxGasPriceGwei?: number; txType?: 0 | 2; chainId?: number; reserveGasBNB?: number; userType?: UserType; bribeAmount?: number; }; /** Swap Merkle 配置(保留兼容) */ export type FourSwapConfig = CommonBundleConfig & { apiKey: string; customRpcUrl?: string; bundleBlockOffset?: number; reserveGasBNB?: number; waitForConfirmation?: boolean; waitTimeoutMs?: number; skipApprovalCheck?: boolean; }; export type FourBundleSwapSignParams = { sellerPrivateKey: string; sellAmount?: string; sellPercentage?: number; buyerPrivateKey: string; tokenAddress: string; config: FourSwapSignConfig; startNonces?: number[]; }; export type FourBundleSwapParams = { sellerPrivateKey: string; sellAmount?: string; sellPercentage?: number; buyerPrivateKey: string; tokenAddress: string; config: FourSwapConfig; }; export type FourSwapResult = { signedTransactions: string[]; profitHopWallets?: GeneratedWallet[]; metadata?: { sellerAddress: string; buyerAddress: string; sellAmount: string; buyAmount: string; hasApproval?: boolean; profitAmount?: string; }; }; export type FourBatchSwapSignParams = { sellerPrivateKey: string; sellAmount?: string; sellPercentage?: number; buyerPrivateKeys: string[]; buyerRatios?: number[]; tokenAddress: string; config: FourSwapSignConfig; startNonces?: number[]; }; export type FourBatchSwapResult = { signedTransactions: string[]; profitHopWallets?: GeneratedWallet[]; metadata?: { sellerAddress: string; buyerAddresses: string[]; sellAmount: string; buyAmounts: string[]; hasApproval?: boolean; profitAmount?: string; }; }; export type FourQuickBatchSwapSignParams = { sellerPrivateKey: string; sellAmount?: string; sellPercentage?: number; buyerPrivateKeys: string[]; buyerRatios?: number[]; buyerAmounts?: string[]; tokenAddress: string; config: FourSwapSignConfig; disperseHopCount?: number; startNonces?: number[]; }; export type FourQuickBatchSwapResult = { signedTransactions: string[]; disperseHopWallets?: GeneratedWallet[]; profitHopWallets?: GeneratedWallet[]; metadata?: { sellerAddress: string; buyerAddresses: string[]; sellAmount: string; estimatedBNBOut: string; transferAmounts: string[]; profitAmount?: string; disperseHopCount?: number; }; };