@plugnet/jsonrpc
Version:
Method definitions for the Plugnet RPC layer
35 lines (32 loc) • 747 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createMethod;
var _util = require("@plugnet/util");
// Copyright 2017-2019 @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.
function createMethod(section, method, _ref) {
let {
description,
isDeprecated = false,
isHidden = false,
isSigned = false,
params,
pubsub,
type
} = _ref;
return {
description,
isDeprecated,
isHidden,
isSigned,
isSubscription: !(0, _util.isUndefined)(pubsub),
method,
params,
pubsub: pubsub || ['', '', ''],
section,
type
};
}