UNPKG

@neo-one/node-protocol

Version:

NEO•ONE NEO node and consensus protocol.

40 lines (38 loc) 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertCommand = exports.InvalidCommandError = exports.Command = void 0; const utils_1 = require("@neo-one/utils"); var Command; (function (Command) { Command["addr"] = "addr"; Command["block"] = "block"; Command["consensus"] = "consensus"; Command["filteradd"] = "filteradd"; Command["filterclear"] = "filterclear"; Command["filterload"] = "filterload"; Command["getaddr"] = "getaddr"; Command["getblocks"] = "getblocks"; Command["getdata"] = "getdata"; Command["getheaders"] = "getheaders"; Command["headers"] = "headers"; Command["inv"] = "inv"; Command["mempool"] = "mempool"; Command["tx"] = "tx"; Command["verack"] = "verack"; Command["version"] = "version"; Command["alert"] = "alert"; Command["merkleblock"] = "merkleblock"; Command["notfound"] = "notfound"; Command["ping"] = "ping"; Command["pong"] = "pong"; Command["reject"] = "reject"; })(Command = exports.Command || (exports.Command = {})); exports.InvalidCommandError = utils_1.makeErrorWithCode('INVALID_COMMAND', (command) => `Invalid Command. Found: ${command}`); const isCommand = (command) => Command[command] !== undefined; exports.assertCommand = (command) => { if (isCommand(command)) { return command; } throw new exports.InvalidCommandError(command); }; //# sourceMappingURL=Command.js.map