"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.ModuleMetadataV3 = 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 ModuleMetadataV3
 * @description
 * The definition of a module in the system
 */
class ModuleMetadataV3 extends _Struct.default {
  constructor(value) {
    super({
      name: 'Text',
      prefix: 'Text',
      storage: _Option.default.with(_Vec.default.with(_Storage.StorageFunctionMetadata)),
      calls: _Option.default.with('Vec<FunctionMetadataV3>'),
      events: _Option.default.with('Vec<EventMetadataV3>')
    }, value);
  }
  /**
   * @description the module calls
   */


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


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


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


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


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

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


exports.ModuleMetadataV3 = ModuleMetadataV3;

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


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

}

exports.default = MetadataV3;