require(`../../constants/protocol.constants.cjs`);const e=require(`../../types/external-action.types.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../functions/utils/token-check.utils.cjs`),r=require(`../AccountActions/AccountActions.cjs`),i=require(`../../functions/pre-transaction/getFeeStructure.cjs`),a=require(`../../constants/addresses.constants.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=n.validateAndGetChainId(l),x=r.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(t.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let w=await s.createSwapToEmporiumOps(c,b,d,a.SWAP_ROUTER_ADDRESSES[d][b],f,S[0],u[0],u[1],S[1],p,x,C,!0),T=g??await i.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;