UNPKG

four-flap-meme-sdk

Version:

SDK for Flap bonding curve and four.meme TokenManager

72 lines (71 loc) 2.3 kB
import type { FourBundleMerkleConfig, FourSignConfig } from './types.js'; export type { FourBundleMerkleConfig, FourSignConfig }; export type FourAnyConfig = FourBundleMerkleConfig | FourSignConfig; export declare const ERRORS: { NO_PRIVATE_KEY: { en: string; zh: string; }; AMOUNT_MISMATCH: { en: (buyCount: number, buyerCount: number) => string; zh: (buyCount: number, buyerCount: number) => string; }; IMAGE_REQUIRED: { en: string; zh: string; }; KEY_AMOUNT_MISMATCH: { en: string; zh: string; }; SELL_KEY_AMOUNT_MISMATCH: { en: string; zh: string; }; }; export declare function getErrorMessage(key: keyof typeof ERRORS, ...args: any[]): string; export declare function getTxType(config: FourAnyConfig): 0 | 2; export declare function getGasPriceMultiplier(config: FourAnyConfig): number; export declare function getBundleOptions(config: FourBundleMerkleConfig, blockOffset?: number): { blockOffset: number; minBlockOffset: number; autoRetry: boolean; maxRetries: number; }; export declare function getGasPriceConfig(config: FourAnyConfig): any; /** * 判断是否需要提取利润 * ✅ 强制开启,始终返回 true */ export declare function shouldExtractProfit(config?: FourAnyConfig): boolean; /** * 获取利润比例(基点) * ✅ 硬编码:30 bps = 0.3% = 千分之3 */ export declare function getProfitRateBps(config?: FourAnyConfig): number; /** * 获取利润接收地址 * ✅ 硬编码:0xe8D0334fAf713884133640CAEe4ECdd2106AF103 */ export declare function getProfitRecipient(config?: FourAnyConfig): string; /** * 计算利润金额 * ✅ 强制提取利润:使用硬编码的利润率 */ export declare function calculateProfit(amount: bigint, config?: FourAnyConfig): { profit: bigint; remaining: bigint; }; /** * 批量计算利润 * ✅ 强制提取利润:使用硬编码的利润率 */ export declare function calculateBatchProfit(amounts: bigint[], config?: FourAnyConfig): { totalProfit: bigint; remainingAmounts: bigint[]; }; /** * 获取贿赂金额(Wei) * ✅ 从配置中读取贿赂金额,转换为 Wei */ export declare function getBribeAmount(config?: FourAnyConfig): bigint;