"use strict";

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

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

var _Option = _interopRequireDefault(require("../../codec/Option"));

var _Struct = _interopRequireDefault(require("../../codec/Struct"));

var _Vec = _interopRequireDefault(require("../../codec/Vec"));

var _Storage = require("./Storage");

// 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.

/**
 * @name ModuleMetadataV7
 * @description
 * The definition of a module in the system
 */
class ModuleMetadataV7 extends _Struct.default {
  constructor(value) {
    super({
      name: 'Text',
      storage: _Option.default.with(_Storage.StorageMetadata),
      calls: _Option.default.with('Vec<FunctionMetadataV7>'),
      events: _Option.default.with('Vec<EventMetadataV7>'),
      constants: 'Vec<ModuleConstantMetadataV7>'
    }, value);
  }
  /**
   * @description the module calls
   */


  get calls() {
    return this.get('calls');
  }
  /**
   * @description the module constants
   */


  get constants() {
    return this.get('constants');
  }
  /**
   * @description the module events
   */


  get events() {
    return this.get('events');
  }
  /**
   * @description the module name
   */


  get name() {
    return this.get('name');
  }
  /**
   * @description the associated module storage
   */


  get storage() {
    return this.get('storage');
  }

}
/**
 * @name MetadataV7
 * @description
 * The runtime metadata as a decoded structure
 */


exports.ModuleMetadataV7 = ModuleMetadataV7;

class MetadataV7 extends _Struct.default {
  constructor(value) {
    super({
      modules: _Vec.default.with(ModuleMetadataV7)
    }, value);
  }
  /**
   * @description The associated modules for this structure
   */


  get modules() {
    return this.get('modules');
  }

}

exports.default = MetadataV7;