import '../../utils/types/array.js';
import { u8aToString } from '../../utils/types/bytes.js';
import 'bs58';
import 'multiformats/bases/base58';
import 'varint';
import '../../utils/encoding/ss-58.js';
import '../../utils/inheritance.js';
import '../../utils/types/object.js';
import '../../utils/types/iterable.js';
import '../../utils/types/set.js';
import 'crypto';
import '../../utils/interfaces.js';
import '../../utils/assert.js';
import '../../utils/error.js';
import '../../utils/types/string.js';
import 'blake2b';

function withFromJSONBytes(klass) {
  const name = `withFromJSONBytes(${klass.name})`;

  const obj = {
    [name]: class extends klass {
      static from(value) {
        if (value instanceof Uint8Array) {
          return this.fromJSON(JSON.parse(u8aToString(value)));
        } else {
          return super.from(value);
        }
      }
    },
  };

  return obj[name];
}

export { withFromJSONBytes as default };
//# sourceMappingURL=with-from-json-bytes.js.map
