import { ExternalActionId as e } from "../../types/external-action.types.mjs";
import { validateAndGetChainId as t } from "../../functions/utils/token-check.utils.mjs";
import { modifyVolatileTokenAmountChanges as n } from "../../functions/pre-transaction/getVolatileTransferAmount.mjs";
import { AccountActions as r } from "../AccountActions/AccountActions.mjs";
import { getFeeStructure as i } from "../../functions/pre-transaction/getFeeStructure.mjs";
import { convertEmporiumOpToCallInfo as a } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
import { createTransaferEmporiumOpsBatch as o } from "../../functions/private-wallet/emporium.helpers.mjs";
//#region libs/shared/common/src/data-structures/Hinkal/hinkalActionReceive.ts
var s = async (s, c, l, u, d, f, p) => {
	if (!f) throw Error("hinkalActionReceive: subAccount should be provided");
	if (!u) throw Error("Fee token is required in hinkalActionReceive");
	let m = t(c), h = r.getAddressFromSubAccount(m, f);
	if (!h) throw Error("Public account address is not available");
	let g = c.map((e) => e.erc20TokenAddress), _ = await n(m, c, l, h), v = o(s, m, g, _), y = d ?? await i(m, u, g, e.Emporium, v.map((e) => a(e, h, m))), b = c.map((e, t) => ({
		token: e,
		amount: -1n * _[t]
	}));
	return s.actionPrivateWallet(m, c, _, _.map(() => !1), v, b, f, u, y, void 0, void 0, void 0, p, void 0);
};
//#endregion
export { s as hinkalActionReceive };
