const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../data-structures/http/HttpClient.cjs`);require(`../../data-structures/http/index.cjs`);const r=require(`../../error-handling/logger.cjs`),i=require(`../../types/fee.types.cjs`);var a=async(a,o=i.SolanaPriorityFeeMode.RECOMMENDED)=>{let s=a.map(e=>e.toBase58());try{let r=await n.httpClient.post(e.HELIUS_RPC_URL,{jsonrpc:`2.0`,id:`1`,method:`getPriorityFeeEstimate`,params:[{accountKeys:s,options:o===i.SolanaPriorityFeeMode.RECOMMENDED?{recommended:!0}:{includeAllPriorityFeeLevels:!0}}]}),a=o===i.SolanaPriorityFeeMode.RECOMMENDED?r.result?.priorityFeeEstimate:r.result?.priorityFeeLevels?.high;return Math.min(a??15e5,t.MAX_MICRO_LAMPORTS_PER_CU)}catch(e){return r.Logger.error(`Error getting solana priority fee:`,e),t.MAX_MICRO_LAMPORTS_PER_CU}};exports.getSolanaPriorityFee=a;