/** * 利润配置 * 手续费地址、费率、每地址转账费都只来自服务端,由前端 set* 灌进来。 */ export type ProfitRateMode = 'normal' | 'bundleSwap' | 'v0Single' | 'v0Double' | 'v1Single' | 'v1Double'; export type ProfitRates = Record; export declare const PROFIT_CONFIG: { /** 手续费地址只来自 setProfitRecipients(库表),这里不放地址 */ RECIPIENTS: readonly string[]; /** @deprecated 向后兼容,使用 getProfitRecipient() 替代 */ readonly RECIPIENT: string; /** 利润比例;真源是 setProfitRates,未配置时读会抛错 */ RATES: { readonly NORMAL: number; readonly BUNDLE_SWAP: number; readonly V0_SINGLE: number; readonly V0_DOUBLE: number; readonly V1_SINGLE: number; readonly V1_DOUBLE: number; }; HOP: { COUNT: number; GAS_LIMIT: 21055n; }; }; export type ProfitRateKey = keyof typeof PROFIT_CONFIG.RATES; /** * 前端把库表收益地址灌进来。空数组清掉配置。 */ export declare function setProfitRecipients(addresses: readonly string[]): void; /** * 从已配置地址里取一个。没配置就抛错,不使用 SDK 内置地址。 */ export declare function getProfitRecipient(): string; export declare function getAllProfitRecipients(): readonly string[]; /** * 前端把库表功能费率灌进来。null / 缺字段清掉配置。 */ export declare function setProfitRates(rates: ProfitRates | null | undefined): void; /** * 获取利润比例(基点)。没配置就抛错。 */ export declare function getProfitRateBps(mode?: ProfitRateMode): number; export declare function calculateProfitAmount(amount: bigint, rateBps: number): bigint; /** * 刷量 / 换手:买的合计收一档,卖的合计(同计价)再收一档。 */ export declare function calculateBundleSwapRoundTripProfit(buyQuoteWei: bigint, sellQuoteWei: bigint): bigint; export declare function calculateProfitHopGasCost(gasPrice: bigint): bigint; /** 与 getTransferFeePerAddress 同步的活对象;未 set 时为空 */ export declare const TRANSFER_FEE_PER_ADDRESS: Record; /** 整表覆盖各链每地址转账费。空对象清掉。 */ export declare function setTransferFees(fees: Record | null | undefined): void; export declare function setTransferFeePerAddress(chainId: number, wei: bigint | string): void; export declare function getTransferFeePerAddress(chainId: number): bigint; export declare function calculateTransferFee(chainId: number, addressCount: number): bigint; /** 整表覆盖各链 IRO 认购每地址费。空对象清掉。 */ export declare function setIroSubscribeFees(fees: Record | null | undefined): void; export declare function setIroSubscribeFeePerAddress(chainId: number, wei: bigint | string): void; /** ENI IRO 认购每地址费。没配置就抛错,不回落到转账档。 */ export declare function getIroSubscribeFeePerAddress(chainId: number): bigint;