import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
import { randomBigInt as t } from "../../functions/web3/etherFunctions.mjs";
import { Utxo as n } from "../utxo/Utxo.mjs";
import { validateAndGetChainId as r } from "../../functions/utils/token-check.utils.mjs";
import { calcStealthAddressStructure as i } from "../../functions/snarkjs/common.snarkjs.mjs";
import { submitSolanaProoflessDeposit as a } from "./hinkalSolanaDeposit.mjs";
//#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.ts
var o = async (o, s, c, l, u) => {
	if (s.length === 0) throw Error("erc20Tokens must not be empty");
	if (s.length !== c.length) throw Error("erc20Tokens and amountChanges length mismatch");
	if (!e(r(s))) throw Error("hinkalSolanaProoflessDepositHash: non-Solana chain");
	let d = s[0];
	if (!s.every((e) => e.erc20TokenAddress === d.erc20TokenAddress)) throw Error("Solana prooflessDeposit supports one mint per transaction");
	if (l && l.length !== c.length) throw Error("Stealth address structures length mismatch");
	return a(o, d, c, l ?? c.map(() => {
		let e = o.userKeys.getShieldedPrivateKey();
		return i(n.findCorrectRandomization(t(31), e), e);
	}), u);
};
//#endregion
export { o as hinkalSolanaProoflessDeposit };
