import { HELIUS_RPC_URL as e } from "../../constants/chains.constants.mjs";
import { MAX_MICRO_LAMPORTS_PER_CU as t } from "../../constants/protocol.constants.mjs";
import { httpClient as n } from "../../data-structures/http/HttpClient.mjs";
import "../../data-structures/http/index.mjs";
import { Logger as r } from "../../error-handling/logger.mjs";
import { SolanaPriorityFeeMode as i } from "../../types/fee.types.mjs";
//#region libs/shared/common/src/functions/web3/getSolanaPriorityFee.ts
var a = async (a, o = i.RECOMMENDED) => {
	let s = a.map((e) => e.toBase58());
	try {
		let r = await n.post(e, {
			jsonrpc: "2.0",
			id: "1",
			method: "getPriorityFeeEstimate",
			params: [{
				accountKeys: s,
				options: o === i.RECOMMENDED ? { recommended: !0 } : { includeAllPriorityFeeLevels: !0 }
			}]
		}), a = o === i.RECOMMENDED ? r.result?.priorityFeeEstimate : r.result?.priorityFeeLevels?.high;
		return Math.min(a ?? 15e5, t);
	} catch (e) {
		return r.error("Error getting solana priority fee:", e), t;
	}
};
//#endregion
export { a as getSolanaPriorityFee };
