import "../../constants/chains.constants.mjs";
import { poseidonHash as e } from "../../crypto/poseidon.mjs";
import { caseInsensitiveEqual as t } from "./caseInsensitive.utils.mjs";
import { Utxo as n } from "../../data-structures/utxo/Utxo.mjs";
import "../../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
import { convertBytes32ToBigInt as r } from "./bytes32.utils.mjs";
import { BorshCoder as i, EventParser as a } from "@coral-xyz/anchor";
import { PublicKey as o } from "@solana/web3.js";
//#region libs/shared/common/src/functions/utils/getUtxosFromReceiptSolana.ts
var s = (s, c, l, u) => [...new a(c.programId, new i(c.idl)).parseLogs(s.meta?.logMessages ?? [])].filter(({ name: e }) => t(e, "newCommitment")).filter(({ data: e }) => e.encryptedOutput.length === 0).map((t) => {
	let { onChainData: i } = t.data, [a, s, c, u, , , , d] = i.map(r), [, f, p] = i, m = new o([...f.slice(16), ...p.slice(16)]), h = e(s, c), g = new n({
		amount: a,
		timeStamp: d.toString(),
		randomization: u,
		shieldedPrivateKey: l.getShieldedPrivateKey(),
		mintAddress: m.toBase58(),
		erc20TokenAddress: h
	});
	return g.getStealthAddress(), g;
}).filter((e) => t(e.erc20TokenAddress, u));
//#endregion
export { s as getOnChainUtxosFromReceiptSolana };
