import { poseidonFunction as e } from "../../crypto/poseidon.mjs";
import { BN as t } from "@coral-xyz/anchor";
import { PublicKey as n } from "@solana/web3.js";
//#region libs/shared/common/src/functions/pre-transaction/solana.ts
var r = (e) => new TextEncoder().encode(e), i = (e) => {
	let t = [], n = e;
	for (; n > 0n;) t.unshift(Number(n % 256n)), n /= 256n;
	for (; t.length < 32;) t.unshift(0);
	return t;
}, a = (e) => ({
	extraRandomization: i(e.extraRandomization),
	stealthAddress: i(e.stealthAddress),
	h0: i(e.H0),
	h1: i(e.H1)
}), o = (e, t) => {
	let i = [r("hinkal"), t.toBytes()], [a] = n.findProgramAddressSync(i, e);
	return a;
}, s = (e, t) => {
	let i = [r("hinkal_merkle"), t.toBytes()], [a] = n.findProgramAddressSync(i, e);
	return a;
}, c = (e, t) => {
	let i = [r("hinkal_merkle_access_token"), t.toBytes()], [a] = n.findProgramAddressSync(i, e);
	return a;
}, l = (e, i, a) => {
	let o = [
		r("hinkal_swapper"),
		i.toBytes(),
		new Uint8Array(new t(a.toString()).toArray("be", 32))
	], [s] = n.findProgramAddressSync(o, e);
	return s;
}, u = (t, n, r) => l(t, n, e(r)), d = (e, t) => {
	let i = [r("hinkal_vault"), t.toBytes()], [a] = n.findProgramAddressSync(i, e);
	return a;
}, f = (e, t, a) => {
	let o = i(e), s = [
		r("hinkal_access_keys"),
		a.toBytes(),
		new Uint8Array(o)
	], [c] = n.findProgramAddressSync(s, t);
	return c;
}, p = (e, t, i) => {
	let a = [
		r("hinkal_token_limit"),
		t.toBytes(),
		i.toBytes()
	], [o] = n.findProgramAddressSync(a, e);
	return o;
};
//#endregion
export { a as buildAnchorStealthAddressStructure, i as encodeToByte32Array, f as getAccessTokenAccountPublicKey, c as getAccessTokenMerkleAccountPublicKey, s as getMerkleAccountPublicKey, o as getStorageAccountPublicKey, d as getStorageVaultPublicKey, l as getSwapperAccountPublicKey, u as getSwapperAccountPublicKeyFromSalt, p as getTokenLimitStorageAccountPublicKey };
