import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
import { solanaNativeAddress as t, zeroAddress as n } from "../../constants/protocol.constants.mjs";
import { BPS_DENOMINATOR as r, EXTENDED_NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS as i, NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS as a } from "../../constants/fees.constants.mjs";
import { defaultFeeStructure as o } from "../../types/hinkal.types.mjs";
import { getERC20Token as s } from "./erc20tokenFunctions.mjs";
//#region libs/shared/common/src/functions/utils/fees.utils.ts
var c = (e, t) => {
	if (e.length !== t.length) throw Error("length mismatch");
	let n = e.findIndex((e) => e !== 0n);
	return n === -1 ? o : {
		feeToken: t[n],
		flatFee: e[n],
		variableRate: 0n
	};
}, l = (r) => {
	if (!r) return i;
	let o = n;
	e(r) && (o = t);
	let c = s(o, r)?.symbol;
	return e(r) && c ? [c] : c && !a(r).includes(c) ? [c, ...a(r)] : a(r);
}, u = (e, t) => {
	let n = e * t.variableRate / r;
	return t.flatFee + n;
};
//#endregion
export { u as calculateTotalFee, c as generateFeeStructure, l as getGasTokenSymbols };
