lisk-framework
Version:
Lisk blockchain application platform
36 lines • 1.18 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseModule = void 0;
const named_registry_1 = require("./named_registry");
class BaseModule {
constructor() {
this.commands = [];
this.events = new named_registry_1.NamedRegistry();
this.stores = new named_registry_1.NamedRegistry();
this.offchainStores = new named_registry_1.NamedRegistry();
}
get name() {
const name = this.constructor.name.replace('Module', '');
return name.charAt(0).toLowerCase() + name.substr(1);
}
baseMetadata() {
return {
commands: this.commands.map(command => ({
name: command.name,
params: command.schema,
})),
events: this.events.values().map(v => ({
name: v.name,
data: v.schema,
})),
stores: this.stores.values().map(v => ({
key: v.key.toString('hex'),
data: v.schema,
})),
endpoints: [],
assets: [],
};
}
}
exports.BaseModule = BaseModule;
//# sourceMappingURL=base_module.js.map
;