import type { EIP7702Config, GeneratedWallet, TradeType, UserType } from './types-base.js'; export interface BundleBuyParams { /** 主钱包(发起交易,支付 gas) */ mainPrivateKey: string; /** 买入钱包私钥列表 */ privateKeys: string[]; /** 每个钱包的买入金额 (OKB) */ buyAmounts: string[]; /** 代币地址 */ tokenAddress: string; /** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */ tradeType?: TradeType; /** 路由地址(可选,根据 tradeType 自动选择) */ routerAddress?: string; /** V3 费率(可选,默认 2500,仅 V3 使用) */ fee?: number; /** 用户类型(影响利润率) */ userType?: UserType; /** 配置 */ config?: EIP7702Config; } export interface BundleBuyResult { /** 签名后的交易 */ signedTransaction: string; /** 交易哈希(发送后) */ txHash?: string; /** 元数据 */ metadata: { totalBuyAmount: string; walletCount: number; profitAmount: string; }; } export interface BundleSellParams { /** 主钱包(发起交易,支付 gas) */ mainPrivateKey: string; /** 卖出钱包私钥列表 */ privateKeys: string[]; /** 卖出数量(代币单位)或百分比 */ sellAmounts?: string[]; /** 卖出百分比(0-100) */ sellPercent?: number; /** 代币地址 */ tokenAddress: string; /** 代币精度 */ tokenDecimals?: number; /** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */ tradeType?: TradeType; /** 路由地址(可选,根据 tradeType 自动选择) */ routerAddress?: string; /** V3 费率(可选,默认 2500,仅 V3 使用) */ fee?: number; /** 用户类型(影响利润率) */ userType?: UserType; /** 配置 */ config?: EIP7702Config; } export interface BundleSellResult { /** 签名后的交易 */ signedTransaction: string; /** 交易哈希(发送后) */ txHash?: string; /** 元数据 */ metadata: { /** 总卖出代币数量 */ totalSellAmount: string; /** 参与卖出的钱包数量 */ walletCount: number; /** 预估卖出获得的 OKB 数量 */ estimatedOkbOut: string; /** 利润金额(OKB) */ profitAmount: string; /** 利润接收地址 */ profitRecipient: string; /** 用户类型 */ userType: string; }; } export interface BundleApproveParams { /** 主钱包(发起交易,支付 gas) */ mainPrivateKey: string; /** 需要授权的钱包私钥列表 */ privateKeys: string[]; /** 代币地址 */ tokenAddress: string; /** 授权给的地址(spender) */ spenderAddress: string; /** 授权金额(可选,默认 MaxUint256) */ amount?: bigint; /** 配置 */ config?: EIP7702Config; } export interface BundleApproveResult { /** 签名后的交易 */ signedTransaction: string; /** 交易哈希(发送后) */ txHash?: string; /** 元数据 */ metadata: { walletCount: number; tokenAddress: string; spenderAddress: string; }; } export interface BundleSwapParams { /** 卖出钱包私钥 */ sellerPrivateKey: string; /** 买入钱包私钥 */ buyerPrivateKey: string; /** 代币地址 */ tokenAddress: string; /** 代币精度 */ tokenDecimals?: number; /** 卖出数量(代币单位) */ sellAmount: string; /** 中间跳转次数 */ hopCount?: number; /** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */ tradeType?: TradeType; /** 路由地址(可选,根据 tradeType 自动选择) */ routerAddress?: string; /** V3 费率(可选,默认 2500,仅 V3 使用) */ fee?: number; /** 用户类型(影响利润率) */ userType?: UserType; /** * 是否使用资金利用率模式(默认 false) * - false(普通模式): 卖家卖出 OKB 留在卖家账户,买家用自己预存的 OKB 买入 * - true(资金利用率模式): 卖家卖出的 OKB 通过多跳转账给买家,买家用收到的 OKB 买入 */ useFundUtilization?: boolean; /** 配置 */ config?: EIP7702Config; } export interface BundleBatchSwapParams { /** 卖出钱包私钥 */ sellerPrivateKey: string; /** 买入钱包私钥列表 */ buyerPrivateKeys: string[]; /** 每个买入钱包的分配比例(百分比) */ buyerRatios?: number[]; /** 代币地址 */ tokenAddress: string; /** 代币精度 */ tokenDecimals?: number; /** 卖出数量(代币单位) */ sellAmount: string; /** 中间跳转次数 */ hopCount?: number; /** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */ tradeType?: TradeType; /** 路由地址(可选,根据 tradeType 自动选择) */ routerAddress?: string; /** V3 费率(可选,默认 2500,仅 V3 使用) */ fee?: number; /** 用户类型(影响利润率) */ userType?: UserType; /** * 是否使用资金利用率模式(默认 false) * - false(普通模式): 卖家卖出 OKB 留在卖家账户,买家用自己预存的 OKB 买入 * - true(资金利用率模式): 卖家卖出的 OKB 通过多跳转账给买家,买家用收到的 OKB 买入 */ useFundUtilization?: boolean; /** 配置 */ config?: EIP7702Config; } export interface BundleSwapResult { /** 签名后的交易 */ signedTransaction: string; /** 交易哈希(发送后) */ txHash?: string; /** 中间钱包(临时生成) */ hopWallets?: GeneratedWallet[]; /** 元数据 */ metadata: { sellerAddress: string; buyerAddresses: string[]; sellAmount: string; /** 预估卖出获得的 OKB 数量 */ estimatedOkbOut?: string; estimatedBuyAmount: string; /** 利润金额(OKB) */ profitAmount: string; /** 利润接收地址 */ profitRecipient?: string; /** 用户类型 */ userType?: string; /** 是否使用资金利用率模式 */ useFundUtilization?: boolean; }; }