"use strict";
// 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.
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const method_1 = __importDefault(require("./create/method"));
const param_1 = __importDefault(require("./create/param"));
const removeExtrinsic = {
    description: 'Remove given extrinsic from the pool and temporarily ban it to prevent reimporting',
    params: [
        param_1.default('bytesOrHash', 'Vec<ExtrinsicOrHash>')
    ],
    type: 'Vec<Hash>'
};
const insertKey = {
    description: 'Insert a key into the keystore.',
    params: [
        param_1.default('keyType', 'Text'),
        param_1.default('suri', 'Text'),
        param_1.default('publicKey', 'Bytes')
    ],
    type: 'Bytes'
};
const rotateKeys = {
    description: 'Generate new session keys and returns the corresponding public keys',
    params: [],
    type: 'Bytes'
};
const pendingExtrinsics = {
    description: 'Returns all pending extrinsics, potentially grouped by sender',
    params: [],
    type: 'Vec<Extrinsic>'
};
const submitExtrinsic = {
    isSigned: true,
    description: 'Submit a fully formatted extrinsic for block inclusion',
    params: [
        param_1.default('extrinsic', 'Extrinsic')
    ],
    type: 'Hash'
};
const submitAndWatchExtrinsic = {
    description: 'Submit and subscribe to watch an extrinsic until unsubscribed',
    isSigned: true,
    params: [
        param_1.default('extrinsic', 'Extrinsic')
    ],
    pubsub: [
        'extrinsicUpdate',
        'submitAndWatchExtrinsic',
        'unwatchExtrinsic'
    ],
    type: 'ExtrinsicStatus'
};
const section = 'author';
/**
 * @summary Calls to work with authors & contributors.
 */
exports.default = {
    isDeprecated: false,
    isHidden: false,
    description: 'Authoring of network items',
    section,
    methods: {
        insertKey: method_1.default(section, 'insertKey', insertKey),
        removeExtrinsic: method_1.default(section, 'removeExtrinsic', removeExtrinsic),
        rotateKeys: method_1.default(section, 'rotateKeys', rotateKeys),
        pendingExtrinsics: method_1.default(section, 'pendingExtrinsics', pendingExtrinsics),
        submitExtrinsic: method_1.default(section, 'submitExtrinsic', submitExtrinsic),
        submitAndWatchExtrinsic: method_1.default(section, 'submitAndWatchExtrinsic', submitAndWatchExtrinsic)
    }
};
