'use strict';

require('../../utils/types/array.cjs');
var utils_types_bytes = require('../../utils/types/bytes.cjs');
require('bs58');
require('multiformats/bases/base58');
require('varint');
require('../../utils/encoding/ss-58.cjs');
require('../../utils/inheritance.cjs');
require('../../utils/types/object.cjs');
require('../../utils/types/iterable.cjs');
require('../../utils/types/set.cjs');
require('crypto');
require('../../utils/interfaces.cjs');
require('../../utils/assert.cjs');
require('../../utils/error.cjs');
require('../../utils/types/string.cjs');
require('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(utils_types_bytes.u8aToString(value)));
        } else {
          return super.from(value);
        }
      }
    },
  };

  return obj[name];
}

module.exports = withFromJSONBytes;
//# sourceMappingURL=with-from-json-bytes.cjs.map
