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