import { hex as e, base58 as n } from "@scure/base";
import { isStellarAddress as c } from "../chains/isStellarAddress.js";
import { logger as o } from "../../logger.js";
import { notReachable as a } from "../notReachable.js";
import { stellarAddressToBytes as i } from "../stellar/stellarAddressToBytes.js";
const h = ({ walletAddress: r, addressType: t }) => {
  if (!(!r || !t)) {
    if (r.includes("0x") && t === "sol") {
      o.error("Solana address should not start with 0x");
      return;
    }
    if (!c(r) && t === "stellar") {
      o.error("Stellar address should start with G");
      return;
    }
    switch (t) {
      case "evm":
      case "near":
        return r.toLowerCase();
      case "stellar":
        return e.encode(i(r));
      case "sol":
        return e.encode(n.decode(r));
      default:
        return o.error("Unsupported connected wallet type"), a(t, { throwError: !1 });
    }
  }
};
export {
  h as getIntentsAccountId
};
//# sourceMappingURL=getIntentsAccountId.js.map
