const e=require(`../../types/external-action.types.cjs`);require(`../../constants/protocol.constants.cjs`);const t=require(`../../constants/addresses.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/utils/token-check.utils.cjs`),i=require(`../AccountActions/AccountActions.cjs`),a=require(`../../functions/pre-transaction/getFeeStructure.cjs`),o=require(`../../functions/utils/convertEmporiumOpToCallInfo.cjs`),s=require(`../../functions/private-wallet/emporium.swap.helpers.cjs`);var c=async(c,l,u,d,f,p,m,h,g,_=!1,v,y)=>{if(!h)throw Error(`Fee token is required in hinkalProxySwap`);let b=r.validateAndGetChainId(l),x=i.AccountActions.getAddressFromSubAccount(b,m);if(!x)throw Error(`Public account address is not available`);let S=l.map(e=>e.erc20TokenAddress),C=await c.getRandomRelay(b,!0);if(!C)throw Error(n.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let w=await s.createSwapToEmporiumOps(c,b,d,t.SWAP_ROUTER_ADDRESSES[d][b],f,S[0],u[0],u[1],S[1],p,x,C,!0),T=g??await a.getFeeStructure(b,h,S,e.ExternalActionId.Emporium,w.map(e=>o.convertEmporiumOpToCallInfo(e,x,b)),35n),E=l.map((e,t)=>({token:e,amount:u[t]}));return c.actionPrivateWallet(b,[],[],[],w,E,m,h,T,C,_,v,y,void 0)};exports.hinkalProxySwap=c;