import { PublicKey as e, TransactionInstruction as t } from "@solana/web3.js";
//#region libs/shared/common/src/functions/utils/solana-memo.ts
var n = new e("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"), r = "hinkal-pal:", i = (e) => new t({
	keys: [],
	programId: n,
	data: Buffer.from(`${r}${e.replace(/-/g, "")}`, "utf8")
}), a = (e, t) => e.map((e) => {
	if (!t.get(e.programIdIndex)?.equals(n)) return null;
	let i = Buffer.from(e.data).toString("utf8");
	if (!i.startsWith(r)) return null;
	let a = i.slice(11);
	return a.length === 32 ? `${a.slice(0, 8)}-${a.slice(8, 12)}-${a.slice(12, 16)}-${a.slice(16, 20)}-${a.slice(20, 32)}` : null;
}).find((e) => e !== null) ?? null;
//#endregion
export { i as buildOrderIdMemoInstruction, a as extractOrderIdFromMemos };
