const e=require(`../constants/server.constants.cjs`),t=require(`./getServerURL.cjs`),n=require(`../data-structures/http/HttpClient.cjs`);require(`../data-structures/http/index.cjs`);var r=async(r,i)=>{let a=new URLSearchParams;a.append(`fromTokenAddress`,i.fromTokenAddress),a.append(`toTokenAddress`,i.toTokenAddress),a.append(`amount`,`${i.amount}`),a.append(`fromAddress`,i.fromAddress),a.append(`slippage`,`${i.slippage}`),i.destReceiver&&a.append(`destReceiver`,i.destReceiver),i.disableEstimate&&a.append(`disableEstimate`,`${i.disableEstimate}`),i.allowPartialFill&&a.append(`allowPartialFill`,`${i.allowPartialFill}`);let o={url:`https://api.1inch.dev/swap/v5.2/${r}/swap?${a}`};return(await n.httpClient.post(`${t.SERVER_URL}${e.API_CONFIG.ROUTES.callOneInchAPI}`,o)).oneInchResponse};exports.callOneInchAPI=r;