import { av as b, cp as f, d as p, cq as y, au as l, ae as L } from "./address-BLzPWV-E.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(p.Buffer.from(d));
  }, o.encode = (c, n, d) => {
    const i = y(c, e);
    return u(i, n, d);
  }, o;
}, I = m(8), K = (e) => {
  const t = l(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
};
