const e=require(`../../types/hinkal.types.cjs`);require(`../../types/index.cjs`);const t=require(`../utils/erc20tokenFunctions.cjs`),n=require(`./interaction-to-action.cjs`),r=require(`./process-gas-estimates.cjs`);var i=async(i,a,o,s,c,l=[])=>{let u,d=n.getInteractionFromAction(o);if(d===e.INTERACTION.NONE)throw Error(`No interaction was choosen`);let f;switch(d){case e.INTERACTION.WITHDRAW:u=t.getERC20Token(a[0],i);break;case e.INTERACTION.SWAP:u=t.getERC20Token(a[1],i);break;case e.INTERACTION.CLAIMING:u=t.getERC20Token(a[1],i);break;case e.INTERACTION.EMPORIUM:f=s.findIndex(e=>e>0n),u=t.getERC20Token(a[f],i);break;default:break}let p,m,h=s.length;u&&({priceOfTransactionInToken:p,priceOfTransactionInUSD:m}=await r.processGasEstimates(i,u,o,h,void 0,l));let g=Array(h).fill(0n);switch(d){case e.INTERACTION.WITHDRAW:g[0]=p||0n;break;case e.INTERACTION.SWAP:g[1]=p||0n;break;case e.INTERACTION.CLAIMING:g[1]=p||0n;break;case e.INTERACTION.EMPORIUM:f!==void 0&&f!==-1&&(g[f]=p||0n);break;default:break}return{flatFees:g,priceOfTransactionInToken:p,feeUnit:u,priceOfTransactionInUSD:m}};exports.getFlatFees=i;