import { JsonRpcProvider } from 'ethers'; import type { TransactionRequest } from 'ethers'; import type { SoulPointSignatureMode, VNormalizationMode } from '../shared/clients/club48.js'; import { BundleStatus } from '../shared/clients/club48.js'; import type { GeneratedWallet } from '../utils/wallet.js'; /** * four.meme Bundle 交易方法 * 使用 48.club Bundle 服务实现原子化交易 */ export { BUNDLE_ERRORS as ERRORS, getBundleErrorMessage as getErrorMessage } from '../bundle-core/errors.js'; export type FourBundleConfig = { rpcUrl: string; fourApiUrl?: string; club48Endpoint?: string; club48ExplorerEndpoint?: string; spMode?: SoulPointSignatureMode; spVMode?: VNormalizationMode; spPrivateKey?: string; bundleBlockOffset?: number; noMerge?: boolean; tipAmountWei?: bigint; txType?: 0 | 2; gasLimitMultiplier?: number; customSubmitFn?: (signedTxs: string[]) => Promise; }; /** * 等待交易上链(不使用 club48 客户端) */ export type FourProviderBundleWaitStatus = { status: 'INCLUDED'; includedBlock?: number; } | { status: 'FAILED'; } | { status: 'PENDING'; }; export declare function waitForBundleWithProvider(provider: JsonRpcProvider, firstTxSigned: string, _bundleUuid: string): Promise; /** * 估算 gas 并应用用户配置的倍数 */ export declare function estimateGasWithMultiplier(provider: JsonRpcProvider, txRequest: TransactionRequest, multiplier?: number): Promise; /** * 获取交易类型(用户可配置) */ export declare function getTxType(config: FourBundleConfig): 0 | 2; /** * 构建完整的交易请求(包含 gas 估算和交易类型) */ export declare function buildTxRequest(provider: JsonRpcProvider, unsigned: TransactionRequest, from: string, nonce: number, gasPrice: bigint, config: FourBundleConfig, value?: bigint): Promise; export type FourCreateWithBundleBuyParams = { privateKeys: string[]; buyAmounts: string[]; b0Amount?: string; tokenInfo: { name: string; symbol: string; description: string; imageUrl?: string; imageFile?: Blob; label?: 'Meme' | 'AI' | 'Defi' | 'Games' | 'Infra' | 'De-Sci' | 'Social' | 'Depin' | 'Charity' | 'Others'; preSale?: string; webUrl?: string; twitterUrl?: string; telegramUrl?: string; }; config: FourBundleConfig; }; export type FourCreateWithBundleBuyResult = { bundleUuid: string; tokenAddress?: string; status: BundleStatus | FourProviderBundleWaitStatus; createTx: string; buyTxs: string[]; profitTxs: string[]; profitHopWallets?: GeneratedWallet[]; }; /** * four.meme: 创建代币 + 捆绑购买 * * 用户只需传入: * - dev 私钥 + N 个买家私钥 * - 对应的购买金额 * - 代币基本信息 */