import type { GeneratedWallet } from '../../../utils/wallet.js'; import type { AmountLike } from '../../types/index.js'; export type { AmountLike }; export type FourSignConfig = { rpcUrl: string; fourApiUrl?: string; club48Endpoint?: string; club48ExplorerEndpoint?: string; txType?: 0 | 2; gasLimit?: number | bigint; gasLimitMultiplier?: number; gasPriceMultiplierPercent?: number; minGasPriceGwei?: number; chainId?: number; prefer21000ForNative?: boolean; checkBnbForErc20NoHop?: boolean; estimateGas?: boolean; customSubmitFn?: (signedTxs: string[]) => Promise; spPrivateKey?: string; spMode?: 'none' | 'timestampPersonalSign' | 'concatTxHash' | 'rawTimestamp'; spVMode?: '27_28' | '0_1'; bribeAmount?: number; }; export type FourBundleMerkleConfig = { apiKey: string; customRpcUrl?: string; fourApiUrl?: string; bundleBlockOffset?: number; minBlockOffset?: number; autoRetryBundle?: boolean; maxBundleRetries?: number; txType?: 0 | 2; gasLimit?: number | bigint; gasLimitMultiplier?: number; gasPriceMultiplierPercent?: number; minGasPriceGwei?: number; waitForConfirmation?: boolean; waitTimeoutMs?: number; chainId?: number; prefer21000ForNative?: boolean; checkBnbForErc20NoHop?: boolean; skipSubmit?: boolean; /** BlockRazor 贿赂金额(BNB),与 `FourSignConfig` 对齐 */ bribeAmount?: number; }; export type MerkleTransactionStatus = { index: number; hash: string; success: boolean; blockNumber?: number; gasUsed?: string; effectiveGasPrice?: string; gasCost?: string; error?: string; }; export type MerkleBundleStatus = { bundleHash: string; txHashes: string[]; results: MerkleTransactionStatus[]; successCount: number; totalGasUsed: bigint; targetBlock: number; }; /** Merkle 结果 metadata 字段值(各方法返回的键不固定,值类型统一收窄) */ export type MerkleResultMetadataValue = string | number | boolean | string[] | undefined; /** 元数据(如利润信息等) */ export type MerkleResultMetadata = Record; /** * 统一的 Merkle 方法返回类型 * SDK 不再内部提交,只返回签名交易和元数据 */ export type MerkleSignedResult = { /** 已签名的交易数组(发送到服务器进行提交) */ signedTransactions: string[]; /** 创建代币时返回的代币地址(仅 create 方法使用) */ tokenAddress?: string; /** ✅ 转账多跳中间钱包(disperse/sweep 使用,按接收者分组)- 兼容旧版 string[][] 和新版 GeneratedWallet[][] */ hopWallets?: (string | GeneratedWallet)[][]; /** ✅ 利润多跳中间钱包 */ profitHopWallets?: GeneratedWallet[]; /** 元数据(如利润信息等) */ metadata?: MerkleResultMetadata; /** 交易哈希数组(内部提交时返回) */ txHashes?: string[]; }; /** 代币池子类型 */ export type TokenPoolType = 'flap' | 'four' | 'v2' | 'v3'; /** 报价代币类型(池子的计价代币) */ export type QuoteTokenType = 'native' | 'usdt' | 'usdc'; /** * 用户类型(用于利润费率) * - v0: 万分之6 (6 bps = 0.06%) * - v1: 万分之5 (5 bps = 0.05%) */ export type UserType = 'v0' | 'v1';