import { API_CONFIG as e } from "../constants/server.constants.mjs";
import { SERVER_URL as t } from "./getServerURL.mjs";
import { httpClient as n } from "../data-structures/http/HttpClient.mjs";
import "../data-structures/http/index.mjs";
//#region libs/shared/common/src/API/callOneInchAPI.ts
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.post(`${t}${e.ROUTES.callOneInchAPI}`, o)).oneInchResponse;
};
//#endregion
export { r as callOneInchAPI };
