import { getContractAddress as e } from "../../utils/getContractAddress.mjs";
import { ERC20ABI as t } from "../../../externalABIs/index.mjs";
import { ethers as n } from "ethers";
//#region libs/shared/common/src/functions/web3/functionCalls/constructBatchCall.ts
var r = (e, r) => new n.Interface(t).encodeFunctionData("approve", [e, r]), i = (e, t, n, r) => r.encodeFunctionData("transact", [
	e[0],
	e[1],
	e[2],
	t,
	n
]), a = (e, t, n, r, i) => i.encodeFunctionData("prooflessDeposit", [
	e,
	t,
	n,
	r
]), o = (e, t, i, a, o, s) => {
	let c = [];
	for (let a = 0; a < e.length; a += 1) {
		let o = e[a], s = t[a];
		o !== n.ZeroAddress && s > 0n && c.push({
			to: o,
			value: "0x0",
			data: r(i, s)
		});
	}
	return c.push({
		to: a,
		value: s > 0n ? `0x${s.toString(16)}` : "0x0",
		data: o
	}), c;
}, s = (t, a, o, s, c, l, u, d) => {
	let f = [];
	for (let e = 0; e < t.length; e += 1) {
		let i = t[e], s = a[e];
		i !== n.ZeroAddress && s > 0n && f.push({
			to: i,
			value: "0x0",
			data: r(o, s)
		});
	}
	return f.push({
		to: e(s),
		value: d > 0n ? `0x${d.toString(16)}` : "0x0",
		data: i(c, l, u, s.interface)
	}), f;
}, c = (t, n, r, i, s, c, l, u, d) => {
	let f = a(s, c, l, u, i.interface);
	return o(t, n, r, e(i), f, d);
};
//#endregion
export { c as buildApproveAndProoflessDepositCalls, s as buildApproveAndTransactCalls };
