/** * Fee utility for resolving fee presets to micro-STX values. * * Supports both numeric strings (e.g., "100000") and preset strings * ("low", "medium", "high") that are resolved by fetching current * fee estimates from the Stacks mempool. */ import type { Network } from "../config/networks.js"; /** * Valid fee preset strings. * These map to the mempool fee priorities: * - "low" -> low_priority * - "medium" -> medium_priority * - "high" -> high_priority */ export type FeePreset = "low" | "medium" | "high"; /** * Check if a string is a valid fee preset. */ export declare function isFeePreset(value: string): value is FeePreset; /** * Resolve a fee string to a bigint value in micro-STX. * * @param fee - Either a numeric string (micro-STX) or preset ("low" | "medium" | "high") * @param network - The network to fetch fee estimates from * @param txType - The transaction type for more accurate fee estimates. * Defaults to "all" which uses aggregate fees. * @returns The fee in micro-STX as bigint, or undefined if fee is undefined * * @example * // Numeric string - returns as-is * await resolveFee("100000", "mainnet") // -> 100000n * * // Preset string - fetches from mempool * await resolveFee("high", "mainnet") // -> fetches high_priority fee * * // Undefined - returns undefined (auto-estimate) * await resolveFee(undefined, "mainnet") // -> undefined */ export declare function resolveFee(fee: string | undefined, network: Network, txType?: "all" | "token_transfer" | "contract_call" | "smart_contract"): Promise; /** * Resolve a default medium-priority fee for a given transaction type. * * Used by builder functions when the caller does not supply an explicit fee, * so that ALL write paths receive a clamped fee rather than relying on the * unclamped @stacks/transactions auto-estimation which can over-shoot. * * Falls back gracefully: if the Hiro mempool API is unreachable, returns the * floor × 2 (medium multiplier) for the tx type. * * @param network - The Stacks network to fetch fee estimates from * @param txType - The transaction type for ceiling/floor selection * @returns Fee in micro-STX as bigint */ export declare function resolveDefaultFee(network: Network, txType?: "token_transfer" | "contract_call" | "smart_contract"): Promise; //# sourceMappingURL=fee.d.ts.map