import { av as b, cq as f, d as y, cr as l, au as p, ae as L } from "./address-CBux52Na.mjs";
const a = (e) => {
  const t = e.decode.bind(e), r = e.encode.bind(e);
  return { decode: t, encode: r };
}, m = (e) => (t) => {
  const r = b(e, t), { encode: u, decode: s } = a(r), o = r;
  return o.decode = (c, n) => {
    const d = s(c, n);
    return f(y.Buffer.from(d));
  }, o.encode = (c, n, d) => {
    const i = l(c, e);
    return u(i, n, d);
  }, o;
}, I = m(8), K = (e) => {
  const t = p(e), { encode: r, decode: u } = a(t), s = t;
  return s.decode = (o, c) => !!u(o, c), s.encode = (o, c, n) => {
    const d = Number(o);
    return r(d, c, n);
  }, s;
}, g = (e) => {
  const t = b(32, e), { encode: r, decode: u } = a(t), s = t;
  return s.decode = (o, c) => {
    const n = u(o, c);
    return new L(n);
  }, s.encode = (o, c, n) => {
    const d = o.toBuffer();
    return r(d, c, n);
  }, s;
};
export {
  K as b,
  g as p,
  I as u
};
