"use client";
function u(r, e, o, s = "GET") {
  if (!e)
    throw new Error("API Key is required for bungeeApiFetcher");
  let t = {};
  return o && s === "POST" ? t = {
    "x-api-key": e,
    "Content-Type": "application/json",
    "API-KEY": e
  } : t = {
    "x-api-key": e,
    "API-KEY": e
  }, fetch(r, {
    headers: t,
    body: o,
    method: s
  }).then((n) => n.ok ? n.json() : n.json().then((i) => {
    console.log("error data: ", i);
    const h = i.message || "An error occurred";
    throw new Error(`${n.status}: ${h}`);
  }));
}
const f = (r, e = 4) => r ? r.length <= e * 2 ? r : `${r.slice(0, e + 2)}...${r.slice(-e)}` : "";
export {
  u as bungeeApiFetcher,
  f as shortenAddress
};
//# sourceMappingURL=utils.js.map
