import { caseInsensitiveEqual as e } from "./caseInsensitive.utils.mjs";
import { API as t } from "../../API/API.mjs";
import { getERC20Registry as n } from "../../constants/token-data/ERC20Registry.mjs";
import { transactionErrorCodes as r } from "../../error-handling/error-codes.constants.mjs";
//#region libs/shared/common/src/functions/utils/token-check.utils.ts
var i = async (e, n) => {
	let r = await t.tokensInfoCall(e, n), i = [];
	return r.forEach((e, t) => {
		(!e || !e.balanceStorageOffset || !e.allowanceStorageOffset) && i.push(n[t]);
	}), i;
}, a = (e) => {
	if (e.length === 0) throw Error("Token array cannot be empty");
	let t = e.map((e) => e.chainId), n = t[0];
	if (!t.every((e) => e === n)) throw Error(r.TOKENS_DO_NOT_BELONG_SAME_CHAIN);
	return n;
}, o = (t, n) => !t || !n ? !1 : e(t.erc20TokenAddress, n.erc20TokenAddress) && t.chainId === n.chainId, s = (t, r) => r.every((r) => n(t).some(({ erc20TokenAddress: t }) => e(t, r)));
//#endregion
export { s as areErc20TokensInRegistry, i as checkTokensForShielding, o as isSameERC20Token, a as validateAndGetChainId };
