import type { EIP7702Config, TradeType, UserType } from './types-base.js'; export interface TokenInfo { /** 代币名称 */ name: string; /** 代币符号 */ symbol: string; /** 代币元数据 (IPFS URI 等) */ meta: string; } export interface CreateTokenParams { /** 代币信息 */ tokenInfo: TokenInfo; /** 预计算的代币地址(可选) */ tokenAddress?: string; /** 毕业阈值 (1-255, 默认 1) */ dexThresh?: number; /** 盐值 (bytes32, 默认 0x0) */ salt?: string; /** 税率 (0-100, 默认 0) */ taxRate?: number; /** 迁移器类型 (默认 0) */ migratorType?: number; /** 报价代币地址 (默认零地址=原生代币) */ quoteToken?: string; /** 报价代币数量 (默认 0) */ quoteAmt?: bigint; /** 受益人地址 (默认发起者) */ beneficiary?: string; /** 许可数据 (默认 0x) */ permitData?: string; /** 扩展 ID (bytes32, V3/V4 使用) */ extensionID?: string; /** 扩展数据 (V3/V4 使用) */ extensionData?: string; /** DEX ID (V4 使用) */ dexId?: number; /** LP 费率配置 (V4 使用, 0=0.25%, 1=0.01%, 2=1%) */ lpFeeProfile?: number; /** Tax Token V2 高级税收配置(V5 使用,taxRate > 0 时启用) */ taxV2Config?: { taxDuration: number; antiFarmerDuration: number; mktBps: number; deflationBps: number; dividendBps: number; lpBps: number; minimumShareBalance?: number; }; } export interface BundleCreateBuyParams extends CreateTokenParams { /** 开发者钱包私钥(发起者,发币) */ devPrivateKey: string; /** 买入钱包私钥列表 */ buyerPrivateKeys: string[]; /** 每个买入钱包的金额 (OKB) */ buyAmounts: string[]; /** 用户类型(影响利润率) */ userType?: 'v0' | 'v1' | 'default'; /** 配置 */ config?: EIP7702Config; } export interface BundleCreateBuyResult { /** 签名后的交易 */ signedTransaction: string; /** 预计算的代币地址 */ tokenAddress: string; /** 元数据 */ metadata: { devAddress: string; buyerCount: number; totalBuyAmount: string; profitAmount: string; }; } export interface BundleCreateToDexParams extends CreateTokenParams { /** Payer 私钥(支付 gas,发起交易) */ payerPrivateKey: string; /** 内盘买入钱包私钥列表 */ curveBuyerPrivateKeys: string[]; /** 内盘买入金额 (OKB) */ curveBuyAmounts: string[]; /** 是否启用外盘买入 */ enableDexBuy?: boolean; /** 外盘买入钱包私钥列表 */ dexBuyerPrivateKeys?: string[]; /** 外盘买入金额 (OKB) */ dexBuyAmounts?: string[]; /** 用户类型(影响利润率) */ userType?: 'v0' | 'v1' | 'default'; /** 配置 */ config?: EIP7702Config; } export interface BundleCreateToDexResult { /** 签名后的交易 */ signedTransaction: string; /** 预计算的代币地址 */ tokenAddress: string; /** 元数据 */ metadata: { payerAddress: string; curveBuyerCount: number; curveTotalBuyAmount: string; enableDexBuy: boolean; dexBuyerCount: number; dexTotalBuyAmount: string; profitAmount: string; }; } export interface BundleMultiSwapParams { /** Payer 钱包私钥(支付 Gas 费) */ mainPrivateKey: string; /** 卖出钱包私钥列表 */ sellerPrivateKeys: string[]; /** 买入钱包私钥列表 */ buyerPrivateKeys: string[]; /** 买入总金额 (OKB) */ totalBuyAmount: string; /** 代币地址 */ tokenAddress: string; /** 代币精度 */ tokenDecimals?: number; /** 卖出百分比(1-100,默认 100) */ sellPercent?: number; /** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */ tradeType?: TradeType; /** 路由地址(可选,根据 tradeType 自动选择) */ routerAddress?: string; /** V3 费率(可选,默认 2500,仅 V3 使用) */ fee?: number; /** 用户类型(影响利润率) */ userType?: UserType; /** 配置 */ config?: EIP7702Config; } export interface BundleMultiSwapResult { /** 签名后的交易 */ signedTransaction: string; /** 元数据 */ metadata: { payerAddress: string; sellerAddresses: string[]; buyerAddresses: string[]; sellerCount: number; buyerCount: number; totalBuyAmount: string; totalSellAmount: string; profitAmount: string; profitRecipient: string; userType: string; }; } export interface BundleApproveMultiSpendersParams { /** 主钱包(发起交易,支付 gas) */ mainPrivateKey: string; /** 需要授权的钱包私钥列表 */ privateKeys: string[]; /** 代币地址 */ tokenAddress: string; /** 授权给的地址列表(多个 spender) */ spenderAddresses: string[]; /** 授权金额(可选,默认 MaxUint256) */ amount?: bigint; /** 配置 */ config?: EIP7702Config; } export interface BundleApproveMultiSpendersResult { /** 签名后的交易 */ signedTransaction: string; /** 元数据 */ metadata: { walletCount: number; tokenAddress: string; spenderAddresses: string[]; totalApproveCalls: number; }; } export type AmountMode = 'average' | 'random' | 'custom'; export interface BundleGraduateBuyParams { /** 代币地址 */ tokenAddress: string; /** 买入钱包私钥列表 */ privateKeys: string[]; /** Payer 私钥(支付 gas) */ payerPrivateKey: string; /** 金额分配模式 */ amountMode: AmountMode; /** 总买入金额 (average 模式) */ totalBuyAmount?: number; /** 最小金额 (random 模式) */ minAmount?: number; /** 最大金额 (random 模式) */ maxAmount?: number; /** 钱包金额映射 (custom 模式) */ walletAmounts?: Record; /** 是否启用外盘买入 */ enableDexBuy?: boolean; /** 扩展数据(V3/V4 代币使用) */ extensionData?: string; /** 前端传递的内盘买家地址 */ curveAddresses?: string[]; /** 前端传递的外盘买家地址 */ dexAddresses?: string[]; /** 毕业金额(OKB) */ graduationAmount?: number; /** 用户类型(影响利润率) */ userType?: 'v0' | 'v1' | 'default'; /** 配置 */ config?: EIP7702Config; } export interface BundleGraduateBuyResult { /** 签名后的交易 */ signedTransaction: string; /** 元数据 */ metadata: { tokenAddress: string; curveCount: number; dexCount: number; curveTotalAmount: string; dexTotalAmount: string; profitAmount: string; }; }