import "./keys.mjs";
import "../utxo/Utxo.mjs";
import { ethers as e } from "ethers";
import { PublicKey as t } from "@solana/web3.js";
import n from "libsodium-wrappers";
//#region libs/shared/common/src/data-structures/crypto-keys/encryptDecryptUtxo.ts
var r = (e) => e.startsWith("0x") ? e : `0x${e}`, i = (i) => {
	let a = [
		Buffer.from(e.toBeHex(i.amount)),
		Buffer.from(r(i.erc20TokenAddress)),
		Buffer.from(e.toBeHex(i.randomization)),
		Buffer.from(r(i.getStealthAddress())),
		Buffer.from(e.toBeHex(BigInt(i.timeStamp))),
		Buffer.from(e.toBeHex(BigInt(i.tokenId ?? 0)))
	];
	if (i.mintAddress) {
		let n = new t(i.mintAddress), r = e.hexlify(n.toBytes());
		a.push(Buffer.from(r));
	}
	let o = Buffer.concat(a);
	return n.crypto_box_seal(o, e.getBytes(i.getEncryptionKey()));
};
//#endregion
export { i as encryptUtxo };
