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