UNPKG

@polkadot/jsonrpc

Version:
38 lines (34 loc) 769 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = createMethod; var _util = require("@polkadot/util"); // Copyright 2017-2020 @polkadot/jsonrpc authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. /** @internal */ function createMethod(section, method, { description, isDeprecated = false, isHidden = false, isOptional = false, isSigned = false, params, pubsub, type }) { return { description, isDeprecated, isHidden, isOptional, isSigned, isSubscription: !(0, _util.isUndefined)(pubsub), method, params, pubsub: pubsub || ['', '', ''], section, type }; }