import { getAmountInToken as e } from "../web3/etherFunctions.mjs";
import { Logger as t } from "../../error-handling/logger.mjs";
import { getPublicBalance as n } from "../utils/publicBalance.utils.mjs";
import "../utils/index.mjs";
import "../web3/index.mjs";
//#region libs/shared/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.ts
var r = async (r, i, a, o, s, c) => {
	try {
		let t = await a.getEthereumAddressByChain(i), l = await a.getBalances(i, a.userKeys.getShieldedPrivateKey(), a.userKeys.getShieldedPublicKey(), t);
		return await Promise.all(r.map(async (t) => {
			let r = t.erc20TokenAddress.toLowerCase(), i = l.get(r)?.balance ?? 0n, a = (await n(s, o, t))?.balance ?? 0n, u = c.get(r) ?? 0, d = parseFloat(e(t, i)) * u, f = parseFloat(e(t, a)) * u;
			return {
				erc20Token: t,
				privateUsdBalance: d,
				publicUsdBalance: f,
				totalUsdBalance: d + f
			};
		}));
	} catch (e) {
		return t.error("Error getting gas token records", e), [];
	}
};
//#endregion
export { r as getGasTokenRecords };
