"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = toCallsOnly;

var _v = _interopRequireDefault(require("../v8"));

// Copyright 2017-2019 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

/**
 * @description Convert from MetadataV8 to a stripped representation of MetadataV8
 */
function toCallsOnly(_ref) {
  let {
    modules
  } = _ref;
  return new _v.default({
    // FIXME, this needs typing, not any
    modules: modules.map((_ref2) => {
      let {
        calls,
        name
      } = _ref2;
      return {
        name,
        calls
      };
    })
  }).toJSON();
}