const e=require(`../../API/simulate-transaction.cjs`),t=require(`../../error-handling/logger.cjs`);require(`../../error-handling/index.cjs`);const n=require(`../../data-structures/token-price-fetcher/TokenChecker.cjs`);var r=async(r,i,a,o)=>{try{let t=i.map((e,t)=>{let r=a[t];return e&&n.TokenChecker.isPotentiallyVolatile(e)?{tokenAddress:e.erc20TokenAddress,amount:r.toString(),...o===void 0?{}:{targetAddress:o},originalIndex:t}:null}).filter(e=>e!==null);if(t.length===0)return a;let s=await e.simulateVolatileTokenTransfer(r,t);return a.map((e,n)=>{let r=t.findIndex(e=>e.originalIndex===n);if(r!==-1&&s[r].success){let t=s[r].balanceDifference;return t?BigInt(t):e}return e})}catch(e){return t.Logger.error(`Volatile transfer simulation failed:`,e),a}};exports.modifyVolatileTokenAmountChanges=r;