import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
import { solanaNativeAddress as t, zeroAddress as n } from "../../constants/protocol.constants.mjs";
import { caseInsensitiveEqual as r } from "./caseInsensitive.utils.mjs";
import { ethers as i } from "ethers";
import { PublicKey as a } from "@solana/web3.js";
import { TronWeb as o } from "tronweb";
//#region libs/shared/common/src/functions/utils/addresses.ts
var s = [
	"http://",
	"https://",
	"/payment/",
	".app/",
	".com/",
	".netlify."
], c = (e) => {
	if (s.some((t) => e.includes(t))) return !1;
	let [t, n, r, i, a] = e.split(","), o = !t || !a || !n || !r || !i, c = t?.substring(0, 2) !== "0x" || a?.substring(0, 2) !== "0x", l = a?.length !== 66 || t?.length > 66 || t?.length < 64, u = e?.includes("\"");
	return !(o || c || l || u);
}, l = (e) => {
	if (s.some((t) => e.includes(t))) return !1;
	let [t, n, r, i, a] = e.split(","), o = !t || !n || !r || !i || !a, c = n?.substring(0, 2) !== "0x" || r?.substring(0, 2) !== "0x", l = r?.length !== 66 || n?.length > 66 || n?.length < 64, u = e?.includes("\"");
	return !(o || c || l || u);
}, u = (e) => {
	let [t, n, r, i] = e.split(",");
	return {
		extraRandomization: BigInt(n) | 1n << 255n,
		stealthAddress: BigInt(t),
		H0: BigInt(r),
		H1: BigInt(i)
	};
}, d = (e) => i.keccak256(i.toUtf8Bytes(e.toLowerCase())), f = (e) => i.keccak256(i.toUtf8Bytes(e)), p = (e) => {
	try {
		return new a(e).toBase58() === e;
	} catch {
		return !1;
	}
}, m = (i, a) => i ? a === void 0 ? r(i, n) || r(i, "11111111111111111111111111111111") : e(a) ? r(i, t) : r(i, n) : !1, h = (e) => e ? e.length <= 10 ? e : `${e.slice(0, 6)}...${e.slice(-4)}` : "", g = (e) => {
	try {
		return o.isAddress(e);
	} catch {
		return !1;
	}
}, _ = (e, t, n) => e.trim() === "" ? !1 : t ? !p(e) : n ? !g(e) : !i.isAddress(e);
//#endregion
export { u as constructStealthAddressStructure, h as formatAddress, d as hashEthereumAddress, f as hashString, m as isNativePlaceholderAddress, _ as isRecipientAddressInvalid, l as isValidOldStylePrivateAddress, c as isValidPrivateAddress, p as isValidSolanaPublicKey, g as isValidTronAddress };
